|
@@ -74,7 +74,7 @@
|
|
|
<up-picker :show="showPicker" :columns="columns" :defaultIndex="[0]" @cancel="handleCancel"
|
|
|
@confirm="handleConfirm" keyName="name" valueName="speciesId"></up-picker>
|
|
|
<!-- 签到打卡 -->
|
|
|
- <checkinPopup @closedCheckPopup="closedCheckPopup"></checkinPopup>
|
|
|
+ <checkinPopup v-if="showCheckin" @closedCheckPopup="closedCheckPopup"></checkinPopup>
|
|
|
<!-- 编辑树名称 -->
|
|
|
<editNamePopup ref="editNameRef" @editEnd="getBySampleId"></editNamePopup>
|
|
|
<!-- 海报弹窗 -->
|
|
@@ -90,7 +90,7 @@
|
|
|
<!-- 果树相册弹窗 -->
|
|
|
<tree-album-popup :show="showAlbum" :farmBuyId="farmBuyId" :sampleId="sampleId"></tree-album-popup>
|
|
|
<!-- 等级升级成功弹窗 -->
|
|
|
- <levelSuccessPopup :show="showUpgradePopup"></levelSuccessPopup>
|
|
|
+ <levelSuccessPopup :show="showUpgradePopup" @closeLevel="closeLevel"></levelSuccessPopup>
|
|
|
<!-- 祝福弹窗 -->
|
|
|
<blessingsPopup :show="showBlessingsPopup" :showSuccess="showSuccess" :farmBuyId="farmBuyId"
|
|
|
:clockinType="clockinType" @clockinCallback="getBySampleId" @closeBlessings="closeBlessings"></blessingsPopup>
|
|
@@ -122,6 +122,7 @@
|
|
|
import USER from '@/api/user.js'
|
|
|
import { CanvasUtils } from '@/utils/canvasUtils.js'
|
|
|
import {
|
|
|
+ onMounted,
|
|
|
ref
|
|
|
} from 'vue';
|
|
|
|
|
@@ -180,6 +181,7 @@
|
|
|
]
|
|
|
|
|
|
const showGuardSuccess = ref(false)
|
|
|
+ const showCheckin = ref(false)
|
|
|
|
|
|
const editNameRef = ref(null)
|
|
|
const formatDate = (dateStr) => {
|
|
@@ -201,9 +203,11 @@
|
|
|
// featchCategoryList()
|
|
|
// })
|
|
|
|
|
|
- onShow(()=>{
|
|
|
+ onShow(async ()=>{
|
|
|
userInfo.value = uni.getStorageSync('userInfo')
|
|
|
- featchLightTree()
|
|
|
+ await featchLightTree(() => {
|
|
|
+ handleUpgrade()
|
|
|
+ })
|
|
|
featchSessionStore()
|
|
|
})
|
|
|
|
|
@@ -217,6 +221,22 @@
|
|
|
stopDanmaku()
|
|
|
})
|
|
|
|
|
|
+ onMounted(() => {
|
|
|
+ featchIsLookedGuide()
|
|
|
+ })
|
|
|
+
|
|
|
+ async function handleUpgrade() {
|
|
|
+ // 是否有200积分弹窗
|
|
|
+ await TREE.fetchLevelAwardInfo({buyId: farmBuyId.value}).then(({data}) => {
|
|
|
+ if (data?.hasAward) {
|
|
|
+ clockinType.value = 4
|
|
|
+ showSuccess.value = !showSuccess.value
|
|
|
+ } else {
|
|
|
+ showCheckin.value = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
//品类查询所有
|
|
|
const featchCategoryList = () =>{
|
|
|
TREE.categoryList().then(({
|
|
@@ -254,9 +274,9 @@
|
|
|
miniUserId: userInfo.value.id
|
|
|
}).then((({data}) => {
|
|
|
if(data?.text === 'orderSuccess'){
|
|
|
- clockinType.value = 4
|
|
|
- showSuccess.value = !showSuccess.value
|
|
|
- treeSetSessionStore()
|
|
|
+ // clockinType.value = 4
|
|
|
+ // showSuccess.value = !showSuccess.value
|
|
|
+ // treeSetSessionStore()
|
|
|
}else{
|
|
|
if (data?.val == 0) {
|
|
|
showGuardSuccess.value = !showGuardSuccess.value
|
|
@@ -284,23 +304,28 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ // 升级弹窗关闭方法
|
|
|
+ function closeLevel() {
|
|
|
+ showCheckin.value = true
|
|
|
+ }
|
|
|
+
|
|
|
const closedCheckPopup = () =>{
|
|
|
showPoster.value = !showPoster.value
|
|
|
}
|
|
|
|
|
|
const sampleId = ref('')
|
|
|
//通过品类查询当前树
|
|
|
- const featchLightTree = () =>{
|
|
|
+ const featchLightTree = (callback) =>{
|
|
|
TREE.getLightTreeList().then((res =>{
|
|
|
sampleId.value = res.data[0].sampleId
|
|
|
- getBySampleId()
|
|
|
+ getBySampleId(callback)
|
|
|
}))
|
|
|
}
|
|
|
|
|
|
const treeData = ref({})
|
|
|
const farmBuyId = ref('')
|
|
|
const treeName = ref('')
|
|
|
- const getBySampleId = () => {
|
|
|
+ const getBySampleId = (callback) => {
|
|
|
TREE.getBySampleId({
|
|
|
sampleId: sampleId.value
|
|
|
}).then(({
|
|
@@ -314,6 +339,7 @@
|
|
|
treeName.value = '飞鸟守护'
|
|
|
}
|
|
|
farmBuyId.value = data.buyList[0].id
|
|
|
+ callback && callback()
|
|
|
featchSessionStore()
|
|
|
// 获取能量记录
|
|
|
// featchEnergyRecords()
|