tree.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <view class="base-container">
  3. <member-level>
  4. <view class="toogle" @click="handleShow">切换 {{name}}<up-icon class="icon" name="arrow-down" color="#fff"
  5. size="12"></up-icon></view>
  6. </member-level>
  7. <view class="tree-cont">
  8. <image class="drone-icon" :src="`${config.BASIC_IMG}img/treePage/drone-icon.png`"></image>
  9. <view class="tool-wrap">
  10. <view class="tool-left">
  11. <view :class="['tool-item',item.className]" v-for="(item,index) in toolLeftList" :key="index"
  12. @click="handleToolItem(item)">
  13. <image class="icon" :src="`${config.BASIC_IMG}img/treePage/l-tree-icon-${index+1}.png`"></image>
  14. <view class="name">{{item.name}}</view>
  15. </view>
  16. </view>
  17. <view class="tool-right">
  18. <view :class="['tool-item',item.className]" v-for="(item,index) in toolRightList" :key="index"
  19. @click="handleToolItem(item)">
  20. <image class="icon" :src="`${config.BASIC_IMG}img/treePage/r-tree-icon-${index+1}.png`"></image>
  21. <view class="name">{{item.name}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="tree-footer">
  27. <view class="footer-item" v-for="(item,index) in footerList" :key="index">
  28. <image class="icon" :src="`${config.BASIC_IMG}img/treePage/b-tree-icon-${index+1}.png`"></image>
  29. <view class="name">{{item}}</view>
  30. </view>
  31. </view>
  32. </view>
  33. <!-- 切换 -->
  34. <up-picker :show="showPicker" :columns="columns" :defaultIndex="[0]" @cancel="handleCancel"
  35. @confirm="handleConfirm"></up-picker>
  36. <!-- 编辑树名称 -->
  37. <editNamePopup></editNamePopup>
  38. <posterPopup :showPoster="showPoster"></posterPopup>
  39. </template>
  40. <script setup>
  41. import config from "@/api/config.js"
  42. import memberLevel from "./components/memberLevel.vue"
  43. import {
  44. ref,
  45. reactive,
  46. onMounted
  47. } from 'vue';
  48. const name = ref('荔枝')
  49. const showPicker = ref(false)
  50. const columns = reactive([
  51. ['荔枝', '香蕉', '苹果']
  52. ]);
  53. const handleShow = () => {
  54. showPicker.value = true
  55. }
  56. const handleCancel = () => {
  57. showPicker.value = false
  58. }
  59. const handleConfirm = (e) => {
  60. name.value = e.value[0]
  61. handleCancel()
  62. }
  63. const toolLeftList = [{
  64. name: "相册",
  65. },
  66. {
  67. name: "日记",
  68. },
  69. {
  70. name: "海报",
  71. className: 'blue',
  72. clickName:'poster'
  73. },
  74. {
  75. name: "礼物",
  76. className: 'gift',
  77. path: 'gift'
  78. }
  79. ]
  80. const toolRightList = [{
  81. name: "好友",
  82. className: 'friend',
  83. path: 'rank'
  84. },
  85. {
  86. name: "认养",
  87. },
  88. {
  89. name: "果园",
  90. },
  91. {
  92. name: "动态",
  93. className: 'dynamic',
  94. path: 'dynamic'
  95. }
  96. ]
  97. const showPoster = ref(false)
  98. const handleToolItem = ({
  99. path,clickName
  100. }) => {
  101. if(clickName){
  102. showPoster.value = !showPoster.value
  103. }else{
  104. uni.navigateTo({
  105. url: `/pages/tabBar/tree/subPages/${path}`
  106. });
  107. }
  108. }
  109. const footerList = ["每日阳光", "送ta祝福", "分享转发", "水果订购"]
  110. </script>
  111. <style lang="scss" scoped>
  112. @import "@/static/style/mixin.scss";
  113. .base-container {
  114. @include ossBg("tree-bg.png");
  115. // background-position: top left;
  116. padding: 22rpx 0;
  117. .toogle {
  118. position: absolute;
  119. right: 0;
  120. top: calc(50% - 32rpx);
  121. font-size: 24rpx;
  122. color: #fff;
  123. border-radius: 50rpx 0 0 50rpx;
  124. background: rgba(0, 0, 0, 0.2);
  125. padding: 12rpx 20rpx;
  126. display: flex;
  127. .icon {
  128. margin-left: 10rpx;
  129. }
  130. }
  131. .tree-cont {
  132. width: 100%;
  133. margin-top: 10rpx;
  134. .drone-icon {
  135. width: 376rpx;
  136. height: 384rpx;
  137. margin-left: 26rpx;
  138. }
  139. .tool-wrap {
  140. width: 100%;
  141. padding: 14rpx;
  142. box-sizing: border-box;
  143. position: absolute;
  144. bottom: calc(50% - 350rpx);
  145. display: flex;
  146. justify-content: space-between;
  147. .tool-left,
  148. .tool-right {
  149. .tool-item {
  150. color: #fff;
  151. font-size: 24rpx;
  152. font-weight: 500;
  153. text-align: center;
  154. width: 100rpx;
  155. margin-bottom: 16rpx;
  156. text-shadow:
  157. 0 0 3rpx #D7660A,
  158. 0 0 3rpx #D7660A,
  159. 0 0 3rpx #D7660A,
  160. 0 0 3rpx #D7660A;
  161. &.blue {
  162. text-shadow:
  163. 0 0 3rpx #2199F8,
  164. 0 0 3rpx #2199F8,
  165. 0 0 3rpx #2199F8,
  166. 0 0 3rpx #2199F8;
  167. }
  168. .icon {
  169. width: 100%;
  170. height: 82rpx;
  171. position: relative;
  172. }
  173. .name {
  174. margin-top: -24rpx;
  175. position: relative;
  176. z-index: 2;
  177. }
  178. &.gift {
  179. .icon {
  180. height: 114rpx;
  181. margin-top: -5rpx;
  182. }
  183. .name {
  184. margin-top: -44rpx;
  185. }
  186. }
  187. &.friend {
  188. .icon {
  189. height: 90rpx;
  190. }
  191. .name {
  192. margin-top: -35rpx;
  193. }
  194. }
  195. &.dynamic {
  196. .icon {
  197. height: 96rpx;
  198. }
  199. .name {
  200. margin-top: -32rpx;
  201. }
  202. }
  203. }
  204. }
  205. }
  206. }
  207. .tree-footer {
  208. position: absolute;
  209. left: 0;
  210. bottom: 76rpx;
  211. width: 100%;
  212. display: flex;
  213. justify-content: center;
  214. .footer-item {
  215. width: 18%;
  216. text-align: center;
  217. .icon {
  218. width: 96rpx;
  219. height: 96rpx;
  220. }
  221. .name {
  222. font-size: 24rpx;
  223. font-weight: 500;
  224. padding: 2rpx 16rpx;
  225. background-image: linear-gradient(0deg, #FFFFFF, #FFE079);
  226. border-radius: 50rpx;
  227. border: 2rpx solid #fff;
  228. }
  229. }
  230. .footer-item+.footer-item {
  231. margin-left: 30rpx;
  232. }
  233. }
  234. }
  235. </style>