tree.vue 5.2 KB

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