score.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <!-- 我的数字权益 -->
  2. <template>
  3. <s-layout class="wallet-wrap" :bgStyle="{'backgroundColor':'#ffffff'}" title="我的数字权益" navbar="normal">
  4. <view class="score-box bg-white ss-flex-col ss-row-center ss-col-center">
  5. <view class="ss-m-b-10 value-box ss-flex ss-row-center" >
  6. <view class="all-title">数字<br>权益</view>
  7. </view>
  8. <view class="ss-m-b-30 ss-font-40" style="color:#fe0000;">
  9. <text class="all-title ss-m-r-8">{{ points2point(userWallet.integralDO.currentQuota) }}</text>
  10. </view>
  11. <view class="ss-m-b-40">
  12. <view class="all-title ss-m-r-8">
  13. <!-- @tap="sheep.$router.go('/pages/user/wallet/scoreToMoney')" -->
  14. <button class="btn ss-reset-button ui-Shadow-Main" @tap="sheep.$helper.toast('功能待开放')">
  15. 兑换
  16. </button>
  17. </view>
  18. </view>
  19. <!-- 分割线 -->
  20. <view style="width: 100%;height: 20rpx;background-color: #ececec;"></view>
  21. <uni-list :border="false" class="ss-p-t-10 ss-w-100">
  22. <uni-list-item clickable @tap="sheep.$router.go('/pages/user/wallet/maxScoreLog', {isFreeze: true})" title="当前可获得峰值" showArrow :border="false">
  23. <template v-slot:body>
  24. <p style="width: 100%">当前可获得峰值:{{ points2point(userWallet.integralDO.currentQuota) }}/{{ points2point(userWallet.integralDO.highQuota) }}</p>
  25. </template>
  26. </uni-list-item>
  27. <uni-list-item clickable @tap="sheep.$router.go('/pages/user/wallet/ScoreLog', {isFreeze: true})" title="待确权" showArrow :border="false">
  28. <template v-slot:body>
  29. <p style="width: 100%">待确权:{{points2point(userWallet.integralDO.freezeQuota)}}</p>
  30. </template>
  31. </uni-list-item>
  32. <uni-list-item clickable @tap="sheep.$router.go('/pages/user/wallet/ScoreLog',{isFreeze: false})" title="数字权益来源记录" showArrow :border="false">
  33. <template v-slot:body>
  34. <p style="width: 100%">数字权益来源记录</p>
  35. </template>
  36. </uni-list-item>
  37. <uni-list-item clickable @tap="state.showModel = true" title="数字权益计算规则" :border="false">
  38. <template v-slot:body>
  39. <p style="width: 100%">数字权益计算规则</p>
  40. </template>
  41. </uni-list-item>
  42. </uni-list>
  43. </view>
  44. <!-- 数字权益计算规则 -->
  45. <su-popup :show="state.showModel" type="center" round="10" :isMaskClick="false" showClose @close="close">
  46. <view class="head-nav">
  47. <view :class="state.navIndex==0?'activite':''" class="ss-m-l-20" @click="checkIndex(0)">
  48. 数字权益计算规则
  49. </view>
  50. </view>
  51. <scroll-view class="scroll-view_H" scroll-y="true">
  52. <richtext title="数字权益计算规则" type='tab'/>
  53. </scroll-view>
  54. </su-popup>
  55. </s-layout>
  56. </template>
  57. <script setup>
  58. import sheep from '@/sheep';
  59. import {
  60. onLoad,
  61. onReachBottom
  62. } from '@dcloudio/uni-app';
  63. import {
  64. computed,
  65. reactive
  66. } from 'vue';
  67. import {
  68. points2point
  69. } from '@/sheep/hooks/useGoods';
  70. import _ from 'lodash';
  71. import dayjs from 'dayjs';
  72. import PointApi from '@/sheep/api/member/point';
  73. import {
  74. resetPagination
  75. } from '@/sheep/util';
  76. import ScoreApi from '@/sheep/api/distri/score';
  77. import ScoreLog from './ScoreLog'
  78. import richtext from '@/pages/public/richtext'
  79. const userWallet = computed(() => sheep.$store('user').userWallet);
  80. const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
  81. const userInfo = computed(() => sheep.$store('user').userInfo);
  82. const sys_navBar = sheep.$platform.navbar;
  83. const state = reactive({
  84. currentTab: 0,
  85. pagination: {
  86. list: [],
  87. total: 0,
  88. pageSize: 10,
  89. pageNo: 1,
  90. },
  91. loadStatus: '',
  92. showModel: false,
  93. });
  94. function close() {
  95. state.showModel = false;
  96. }
  97. async function getLogList(isFreeze) {
  98. state.loadStatus = 'loading';
  99. // isFreeze为true是冻结数字权益 isFreeze为false是已拿到的数字权益
  100. let {
  101. code,
  102. data
  103. } = await ScoreApi.getScoreApi({
  104. pageNo: state.pagination.pageNo,
  105. pageSize: state.pagination.pageSize,
  106. isFreeze: isFreeze
  107. });
  108. if (code !== 0) {
  109. return;
  110. }
  111. let list = _.concat(state.pagination.list, data.list);
  112. state.pagination.list = list;
  113. state.pagination.total = data.total;
  114. state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
  115. }
  116. onLoad(() => {
  117. });
  118. function onLoadMore(isFreeze) {
  119. if (state.loadStatus === 'noMore') {
  120. return;
  121. }
  122. state.pagination.pageNo++;
  123. getLogList(isFreeze);
  124. }
  125. onReachBottom(() => {
  126. onLoadMore();
  127. });
  128. </script>
  129. <style lang="scss" scoped>
  130. .scroll-view_H {
  131. width: 600rpx;
  132. height: 700rpx;
  133. padding: 20rpx;
  134. }
  135. .head-nav {
  136. margin: 20rpx auto;
  137. display: flex;
  138. align-items: center;
  139. box-sizing: border-box;
  140. color: rgb(14, 147, 46);
  141. }
  142. .head-nav>view {
  143. padding-bottom: 10rpx;
  144. border-bottom: 4rpx solid rgb(14, 147, 46);
  145. }
  146. .uni-list-item{
  147. margin: 0 20rpx;
  148. padding: 10rpx 0;
  149. border-bottom: 1px solid #d8d8d9;
  150. }
  151. .color-red {
  152. color: red;
  153. }
  154. .color-green {
  155. color: green;
  156. }
  157. .score-box {
  158. // margin: 20rpx;
  159. border-radius: 20rpx;
  160. padding-top: 100rpx;
  161. }
  162. .avatar-box {
  163. width: 100rpx;
  164. height: 100rpx;
  165. border-radius: 50%;
  166. overflow: hidden;
  167. .avatar-img {
  168. width: 100%;
  169. height: 100%;
  170. }
  171. }
  172. .value-box {
  173. width: 120rpx;
  174. height: 120rpx;
  175. // line-height: 100rpx;
  176. text-align: center;
  177. border-radius: 50%;
  178. border: 8px solid #fe0000;
  179. font-weight: bold;
  180. }
  181. .btn {
  182. width: 250rpx;
  183. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  184. border-radius: 20rpx;
  185. font-size: 30rpx;
  186. font-weight: 500;
  187. line-height: 80rpx;
  188. color: $white;
  189. position: relative;
  190. z-index: 1;
  191. }
  192. .header-box {
  193. width: 100%;
  194. background: linear-gradient(180deg, var(--ui-BG-Main) 0%, var(--ui-BG-Main-gradient) 100%) no-repeat;
  195. background-size: 750rpx 100%;
  196. padding: 0 0 120rpx 0;
  197. box-sizing: border-box;
  198. .score-box {
  199. height: 100%;
  200. .all-num {
  201. font-size: 50rpx;
  202. font-weight: bold;
  203. color: #fff;
  204. font-family: OPPOSANS;
  205. }
  206. .all-title {
  207. font-size: 26rpx;
  208. font-weight: 500;
  209. color: #fff;
  210. }
  211. .cicon-help-o {
  212. color: #fff;
  213. font-size: 28rpx;
  214. }
  215. }
  216. }
  217. // 筛选
  218. .filter-box {
  219. height: 114rpx;
  220. background-color: $bg-page;
  221. .total-box {
  222. font-size: 24rpx;
  223. font-weight: 500;
  224. color: $dark-9;
  225. }
  226. .date-btn {
  227. background-color: $white;
  228. line-height: 54rpx;
  229. border-radius: 27rpx;
  230. padding: 0 20rpx;
  231. font-size: 24rpx;
  232. font-weight: 500;
  233. color: $dark-6;
  234. .ss-seldate-icon {
  235. font-size: 50rpx;
  236. color: $dark-9;
  237. }
  238. }
  239. }
  240. .model-box {
  241. height: 50vh;
  242. }
  243. .list-box {
  244. width: 500rpx;
  245. padding: 0 30rpx;
  246. overflow-y: auto;
  247. .list-item {
  248. background: #fff;
  249. // border-bottom: 1rpx solid #dfdfdf;
  250. padding: 30rpx;
  251. .name {
  252. font-size: 28rpx;
  253. font-weight: 500;
  254. color: rgba(102, 102, 102, 1);
  255. line-height: 28rpx;
  256. // margin-bottom: 20rpx;
  257. }
  258. .time {
  259. font-size: 24rpx;
  260. font-weight: 500;
  261. color: rgba(196, 196, 196, 1);
  262. line-height: 24px;
  263. }
  264. .add {
  265. font-size: 30rpx;
  266. font-weight: 500;
  267. color: #e6b873;
  268. }
  269. .minus {
  270. font-size: 30rpx;
  271. font-weight: 500;
  272. color: $dark-3;
  273. }
  274. }
  275. }
  276. </style>