gift.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <view class="sub-base-container">
  3. <view class="gift-title">
  4. <view class="name">
  5. <view class="txt">守护等级规则</view>
  6. <text>积累能量升等级 获大礼</text>
  7. </view>
  8. <image class="icon" :src="`${config.BASIC_IMG}img/subTreePage/energy-icon.png`"></image>
  9. </view>
  10. <view class="gift-card energy-card">
  11. <view class="gift-name">已打卡 <text>2</text>/7 天</view>
  12. <view class="tips">
  13. <text>再连续签到5天,获得</text>
  14. <image class="icon" :src="`${config.BASIC_IMG}img/subTreePage/leaf-icon.png`" alt=""></image>
  15. <view class="score"><up-icon name="plus" size="10" color="#D9AB14"></up-icon>30</view>
  16. </view>
  17. <view class="check-wrap">
  18. <view :class="['check-day',{active:item.check}]" v-for="(item, index) in checkDay" :key="index">
  19. <view class="leaf">
  20. <image class="icon"
  21. :src="`${config.BASIC_IMG}img/subTreePage/${item.check?'gray-leaf':'leaf-icon'}.png`" alt="">
  22. </image>
  23. <text>x{{item.energy}}</text>
  24. </view>
  25. <view v-if="item.check">已领取</view>
  26. <view v-else>第{{item.days}}天</view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="gift-card">
  31. <view class="card-title">守护等级划分</view>
  32. <view class="card-desc">守护等级共有5个等级,您的守护等级会根据您累计的能量值决定的,当您的能量值达到相应的要求即可升级并获得相对应礼物,不同等级的用户获得礼物不同。</view>
  33. <view class="card-table">
  34. <view class="table-item" v-for="(item,index) in tableList" :key="index">
  35. <view class="levle">{{item.level}}等级</view>
  36. <view>{{item.text}}</view>
  37. <view class="gift">{{item.gift}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="gift-card">
  42. <view class="card-title">积累能量规则</view>
  43. <view class="card-desc">每日登录会积累相应的能量,连续登录天数越高能量值越高,每天可以通过做任务增加能量值,每日阳光可以获得 10 能量,分享转发可以获得 10 能量,送ta祝福可以获得 10
  44. 能量,水果订购一次,可以获得 100 能量,但是需要扫描箱内溯源卡的二维码领取。</view>
  45. </view>
  46. </view>
  47. </template>
  48. <script setup>
  49. import config from "@/api/config.js"
  50. import TREE from '@/api/tree.js'
  51. import {
  52. ref
  53. } from 'vue';
  54. import {
  55. onLoad
  56. } from '@dcloudio/uni-app'
  57. const getRules = () => {
  58. TREE.ruleList().then((res) => {
  59. checkDay.value = res.data
  60. // firstRowItems.value = res.data.slice(0, 3);
  61. // secondRowItems.value = res.data.slice(3);
  62. });
  63. };
  64. onLoad(()=>{
  65. getRules()
  66. })
  67. const checkDay = ref([{
  68. day: 1,
  69. check: true
  70. },
  71. {
  72. day: 2,
  73. check: true
  74. },
  75. {
  76. day: 3,
  77. check: false
  78. },
  79. {
  80. day: 4,
  81. check: false
  82. },
  83. {
  84. day: 5,
  85. check: false
  86. },
  87. {
  88. day: 6,
  89. check: false
  90. },
  91. {
  92. day: 7,
  93. check: false
  94. }
  95. ])
  96. const tableList = [{
  97. level: '平民',
  98. text: '无要求',
  99. gift: '无礼品'
  100. },
  101. {
  102. level: '青铜',
  103. text: '达到200能量',
  104. gift: '一份曲奇'
  105. },
  106. {
  107. level: '白银',
  108. text: '达到1200能量',
  109. gift: '一份精美水果'
  110. },
  111. {
  112. level: '赤金',
  113. text: '达到5500能量',
  114. gift: '一份荔枝'
  115. },
  116. {
  117. level: '星勋',
  118. text: '达到9800能量',
  119. gift: '一份荔枝'
  120. }
  121. ]
  122. </script>
  123. <style lang="scss" scoped>
  124. @import "@/static/style/mixin.scss";
  125. .sub-base-container {
  126. @include ossBg("subTreePage/gift-bg.png");
  127. padding: 12rpx 20rpx 20rpx;
  128. .gift-title {
  129. display: flex;
  130. align-items: center;
  131. justify-content: space-between;
  132. padding: 0 14rpx;
  133. .name {
  134. color: rgba(0, 0, 0, 0.5);
  135. font-size: 28rpx;
  136. .txt {
  137. font-size: 60rpx;
  138. font-family: 'PangMenZhengDao';
  139. color: #000;
  140. }
  141. }
  142. .icon {
  143. width: 212rpx;
  144. height: 222rpx;
  145. }
  146. }
  147. .energy-card {
  148. margin-top: -10rpx;
  149. position: relative;
  150. z-index: 2;
  151. .gift-name {
  152. font-weight: 500;
  153. text {
  154. color: #F3B242;
  155. }
  156. }
  157. .tips {
  158. display: flex;
  159. align-items: center;
  160. font-size: 24rpx;
  161. color: rgba(0, 0, 0, 0.4);
  162. .icon{
  163. width: 24rpx;
  164. height: 22rpx;
  165. margin: 0 8rpx;
  166. }
  167. .score {
  168. display: flex;
  169. align-items: center;
  170. color: #D9AB14;
  171. }
  172. }
  173. .check-wrap {
  174. margin: 28rpx 0 20rpx 0;
  175. display: flex;
  176. .check-day {
  177. flex: 1;
  178. padding: 20rpx 0;
  179. font-size: 20rpx;
  180. color: #F3B242;
  181. background: rgba(185, 185, 185, 0.1);
  182. border-radius: 10rpx;
  183. text-align: center;
  184. &.active {
  185. color: #BCBCBA;
  186. }
  187. .leaf {
  188. font-size: 20rpx;
  189. display: flex;
  190. justify-content: center;
  191. align-items: center;
  192. .icon{
  193. width: 28rpx;
  194. height: 28rpx;
  195. margin-right: 4rpx;
  196. margin-bottom: 10rpx;
  197. }
  198. }
  199. }
  200. .check-day+.check-day {
  201. margin-left: 10rpx;
  202. }
  203. }
  204. }
  205. .gift-card {
  206. border-radius: 16rpx;
  207. background: #fff;
  208. padding: 20rpx;
  209. .card-title {
  210. font-weight: 500;
  211. }
  212. .card-desc {
  213. margin-top: 10rpx;
  214. line-height: 36rpx;
  215. font-size: 24rpx;
  216. }
  217. .card-table {
  218. margin-top: 20rpx;
  219. .table-item {
  220. display: flex;
  221. background: rgba(243, 193, 29, 0.07);
  222. .levle {
  223. background: rgba(243, 193, 29, 0.12);
  224. }
  225. .gift {
  226. color: #CC9D00;
  227. }
  228. view {
  229. flex: 1;
  230. padding: 30rpx 0;
  231. text-align: center;
  232. font-size: 28rpx;
  233. }
  234. }
  235. .table-item+.table-item {
  236. border-top: 2rpx solid rgba(0, 0, 0, 0.06);
  237. }
  238. }
  239. }
  240. .gift-card+.gift-card {
  241. margin-top: 20rpx;
  242. }
  243. }
  244. </style>