tree.vue 5.2 KB

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