|
@@ -1,57 +1,106 @@
|
|
|
<template>
|
|
|
- <view class="sub-base-container">
|
|
|
- <member-level></member-level>
|
|
|
- <view class="tree-cont">
|
|
|
- <image class="drone-icon" :src="`${config.BASIC_IMG}img/treePage/drone-icon.png`"></image>
|
|
|
- <view class="tool-wrap">
|
|
|
- <view class="tool-left">
|
|
|
- <view :class="['tool-item',item.className]" v-for="(item,index) in toolList" :key="index">
|
|
|
- <image class="icon" :src="`${config.BASIC_IMG}img/treePage/${item.icon}.png`"></image>
|
|
|
- <view class="name">{{item.name}}</view>
|
|
|
+ <view class="base-template">
|
|
|
+ <view class="sub-base-container">
|
|
|
+ <member-level :treeData="treeData"></member-level>
|
|
|
+ <view class="tree-cont">
|
|
|
+ <view class="tree-name">
|
|
|
+ <view>{{treeName}}</view>
|
|
|
+ </view>
|
|
|
+ <image class="drone-icon" :src="`${config.BASIC_IMG}img/treePage/drone-icon.png`"></image>
|
|
|
+ <view class="tool-wrap">
|
|
|
+ <view class="tool-left">
|
|
|
+ <view :class="['tool-item',item.className]" v-for="(item,index) in toolList" :key="index">
|
|
|
+ <image class="icon" :src="`${config.BASIC_IMG}img/treePage/${item.icon}.png`"></image>
|
|
|
+ <view class="name">{{item.name}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="tree-footer">
|
|
|
+ <view class="blessing" @click="handleBlessing">
|
|
|
+ <image class="icon" :src="`${config.BASIC_IMG}img/treePage/b-tree-icon-2.png`"></image>
|
|
|
+ <text>送ta祝福</text>
|
|
|
+ </view>
|
|
|
+ <view class="button" @click="handlePage">{{userInfo.tel?'去看看我的树':'开启我的守护'}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="tree-footer">
|
|
|
- <view class="blessing" @click="handleBlessing">
|
|
|
- <image class="icon" :src="`${config.BASIC_IMG}img/treePage/b-tree-icon-2.png`"></image>
|
|
|
- <text>送ta祝福</text>
|
|
|
- </view>
|
|
|
- <view class="button">去看看我的树</view>
|
|
|
- </view>
|
|
|
+ <!-- 祝福弹窗 -->
|
|
|
+ <blessingsPopup :show="showBlessingsPopup" clockinType="3" :farmBuyId="farmBuyId" @clockinCallback="getBySampleId"></blessingsPopup>
|
|
|
</view>
|
|
|
- <!-- 编辑树名称 -->
|
|
|
- <editNamePopup></editNamePopup>
|
|
|
- <!-- 祝福弹窗 -->
|
|
|
- <blessingsPopup :show="showBlessingsPopup"></blessingsPopup>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import config from "@/api/config.js"
|
|
|
- import memberLevel from "../components/memberLevel.vue"
|
|
|
+ import memberLevel from "../components/memberLevel.vue"
|
|
|
import blessingsPopup from "../components/blessingsPopup.vue"
|
|
|
import {
|
|
|
+ onLoad
|
|
|
+ } from '@dcloudio/uni-app'
|
|
|
+ import TREE from '@/api/tree.js'
|
|
|
+ import {
|
|
|
ref,
|
|
|
reactive,
|
|
|
- onMounted
|
|
|
- } from 'vue';
|
|
|
-
|
|
|
- const showBlessingsPopup = ref(false)
|
|
|
+ } from 'vue';
|
|
|
+
|
|
|
+ const userInfo = uni.getStorageSync('userInfo')
|
|
|
+ const handlePage = () => {
|
|
|
+ if (userInfo.tel) {
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/tabBar/tree/tree'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/tabBar/home/subPages/gardenMap?enterSelectTree=true`
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const sampleId = ref('')
|
|
|
+ onLoad((options) => {
|
|
|
+ sampleId.value = options.sampleId
|
|
|
+ getBySampleId()
|
|
|
+ })
|
|
|
+
|
|
|
+ const treeData = ref({})
|
|
|
+ const treeName = ref('')
|
|
|
+ const farmBuyId = ref('')
|
|
|
+ const getBySampleId = () => {
|
|
|
+ TREE.getBySampleId({
|
|
|
+ sampleId: sampleId.value
|
|
|
+ }).then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ treeData.value = data || {}
|
|
|
+ treeName.value = data.buyList[0].treeName || (data.buyList[0].nickname.length ? data.buyList[0]
|
|
|
+ .nickname.slice(0, 3) + "荔" : data.buyList[0].owner.slice(0, 3) + "荔")
|
|
|
+ farmBuyId.value = data.buyList[0].id
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const showBlessingsPopup = ref(false)
|
|
|
const handleBlessing = () => {
|
|
|
- showBlessingsPopup.value = !showBlessingsPopup.value
|
|
|
+ if(treeData.value.buyList[0].level.clockinMap['3']){
|
|
|
+ uni.showToast({
|
|
|
+ title: '今日已送过祝福',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ showBlessingsPopup.value = !showBlessingsPopup.value
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const toolList = [{
|
|
|
- name: "相册",
|
|
|
- icon:'l-tree-icon-1'
|
|
|
+ name: "相册",
|
|
|
+ icon: 'l-tree-icon-1'
|
|
|
},
|
|
|
{
|
|
|
- name: "日记",
|
|
|
- icon:'l-tree-icon-2'
|
|
|
+ name: "日记",
|
|
|
+ icon: 'l-tree-icon-2'
|
|
|
},
|
|
|
{
|
|
|
- name: "果园",
|
|
|
- icon:'r-tree-icon-3'
|
|
|
+ name: "果园",
|
|
|
+ icon: 'r-tree-icon-3'
|
|
|
}
|
|
|
]
|
|
|
|
|
@@ -75,6 +124,17 @@
|
|
|
width: 100%;
|
|
|
margin-top: 10rpx;
|
|
|
|
|
|
+ .tree-name {
|
|
|
+ position: absolute;
|
|
|
+ top: 60.45%;
|
|
|
+ left: calc(50% - 32rpx);
|
|
|
+ z-index: 2;
|
|
|
+ font-size: 22rpx;
|
|
|
+ font-family: 'SweiSpringCJKtc';
|
|
|
+ text-align: center;
|
|
|
+ width: 88rpx;
|
|
|
+ }
|
|
|
+
|
|
|
.drone-icon {
|
|
|
width: 376rpx;
|
|
|
height: 384rpx;
|
|
@@ -90,7 +150,7 @@
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
|
|
|
- .tool-left{
|
|
|
+ .tool-left {
|
|
|
.tool-item {
|
|
|
color: #fff;
|
|
|
font-size: 24rpx;
|
|
@@ -126,30 +186,32 @@
|
|
|
left: 0;
|
|
|
bottom: 130rpx;
|
|
|
width: 100%;
|
|
|
- display: flex;
|
|
|
+ display: flex;
|
|
|
flex-direction: column;
|
|
|
- align-items: center;
|
|
|
- color: #fff;
|
|
|
- .blessing{
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- background: rgba(0, 0, 0, 0.3);
|
|
|
- border-radius: 50rpx;
|
|
|
- padding: 6rpx 60rpx;
|
|
|
- border: 1rpx solid rgba(255, 255, 255, 0.6);
|
|
|
- .icon{
|
|
|
- width: 86rpx;
|
|
|
- height: 86rpx;
|
|
|
- margin-right: 10rpx;
|
|
|
- }
|
|
|
+ align-items: center;
|
|
|
+ color: #fff;
|
|
|
+
|
|
|
+ .blessing {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ background: rgba(0, 0, 0, 0.3);
|
|
|
+ border-radius: 50rpx;
|
|
|
+ padding: 6rpx 60rpx;
|
|
|
+ border: 1rpx solid rgba(255, 255, 255, 0.6);
|
|
|
+
|
|
|
+ .icon {
|
|
|
+ width: 86rpx;
|
|
|
+ height: 86rpx;
|
|
|
+ margin-right: 10rpx;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- .button{
|
|
|
- padding: 26rpx 80rpx;
|
|
|
- border-radius: 50rpx;
|
|
|
- border: 2rpx solid #fff;
|
|
|
- background-image: linear-gradient(120deg,#FFD887,#ED9E1E);
|
|
|
- margin-top: 20rpx;
|
|
|
+ .button {
|
|
|
+ padding: 26rpx 80rpx;
|
|
|
+ border-radius: 50rpx;
|
|
|
+ border: 2rpx solid #fff;
|
|
|
+ background-image: linear-gradient(120deg, #FFD887, #ED9E1E);
|
|
|
+ margin-top: 20rpx;
|
|
|
}
|
|
|
}
|
|
|
}
|