index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <view>
  3. <view class='integral-details' :style="colorStyle">
  4. <!-- <view class='header'>
  5. <view class='currentScore'>{{$t(`当前红色积分`)}}</view>
  6. <view class="scoreNum">{{userInfo.integral}}</view>
  7. <view class='line'></view>
  8. </view> -->
  9. <view class='wrapper'>
  10. <view class='list' :hidden='current!=0'>
  11. <view class='item acea-row row-between-wrapper' v-for="(item,index) in integralList" :key="index">
  12. <view>
  13. <view class='state'>{{$t(item.remake)}}</view>
  14. <view>{{item.createTime}}</view>
  15. </view>
  16. <view>
  17. <view class='num font-color' v-if="(item.type == 0)">+{{item.amount}}</view>
  18. <view class='num' v-else>-{{item.amount}}</view>
  19. <view>剩余:{{item.afterAmount}}</view>
  20. </view>
  21. </view>
  22. <view class='loadingicon acea-row row-center-wrapper' v-if="integralList.length>0">
  23. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  24. </view>
  25. <view v-if="integralList.length == 0">
  26. <emptyPage :title="$t(`暂无收益记录哦~`)"></emptyPage>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import {
  35. earningsList
  36. } from '@/api/home.js';
  37. import dayjs from '@/plugin/dayjs/dayjs.min.js';
  38. import {
  39. toLogin
  40. } from '@/libs/login.js';
  41. import {
  42. mapGetters
  43. } from "vuex";
  44. // #ifdef MP
  45. import authorize from '@/components/Authorize';
  46. // #endif
  47. import emptyPage from '@/components/emptyPage.vue';
  48. import colors from '@/mixins/color'
  49. export default {
  50. components: {
  51. // #ifdef MP
  52. authorize,
  53. // #endif
  54. emptyPage
  55. },
  56. filters: {
  57. dateFormat: function(value) {
  58. return dayjs(value * 1000).format('YYYY-MM-DD');
  59. }
  60. },
  61. mixins: [colors],
  62. data() {
  63. return {
  64. current: 0,
  65. page: 1,
  66. limit: 10,
  67. integralList: [],
  68. userInfo: {},
  69. loadend: false,
  70. loading: false,
  71. loadTitle: this.$t(`加载更多`),
  72. isAuto: false, //没有授权的不会自动授权
  73. isShowAuth: false, //是否隐藏授权
  74. isTime: 0
  75. };
  76. },
  77. computed: mapGetters(['isLogin']),
  78. watch: {
  79. isLogin: {
  80. handler: function(newV, oldV) {
  81. if (newV) {
  82. // this.getUserInfo();
  83. this.earningsList();
  84. }
  85. },
  86. deep: true
  87. }
  88. },
  89. onLoad() {
  90. if (this.isLogin) {
  91. // this.getUserInfo();
  92. this.getIntegralList();
  93. } else {
  94. toLogin();
  95. }
  96. },
  97. /**
  98. * 页面上拉触底事件的处理函数
  99. */
  100. onReachBottom: function() {
  101. this.getIntegralList();
  102. },
  103. methods: {
  104. /**
  105. * 授权回调
  106. */
  107. onLoadFun: function() {
  108. this.getUserInfo();
  109. this.getIntegralList();
  110. },
  111. // 授权关闭
  112. authColse: function(e) {
  113. this.isShowAuth = e
  114. },
  115. /**
  116. * 获取积分明细
  117. */
  118. getIntegralList: function() {
  119. let that = this;
  120. if (that.loading) return;
  121. if (that.loadend) return;
  122. that.loading = true;
  123. that.loadTitle = '';
  124. earningsList({
  125. userId: this.$store.state.app.uid,
  126. current: that.page,
  127. size: that.limit
  128. }).then(function(res) {
  129. let list = res.data,
  130. loadend = list.length < that.limit;
  131. that.integralList = that.$util.SplitArray(list, that.integralList);
  132. that.$set(that, 'integralList', that.integralList);
  133. that.page = that.page + 1;
  134. that.loading = false;
  135. that.loadend = loadend;
  136. that.loadTitle = loadend ? that.$t(`我也是有底线的`) : that.$t(`加载更多`);
  137. }, function(res) {
  138. this.loading = false;
  139. that.loadTitle = that.$t(`加载更多`);
  140. });
  141. },
  142. nav: function(current) {
  143. this.current = current;
  144. }
  145. }
  146. }
  147. </script>
  148. <style>
  149. .integral-details .header {
  150. // background-image: url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwkHBgoJCAkLCwoMDxkQDw4ODx4WFxIZJCAmJSMgIyIoLTkwKCo2KyIjMkQyNjs9QEBAJjBGS0U+Sjk/QD3/2wBDAQsLCw8NDx0QEB09KSMpPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT3/wgARCAHMAu4DAREAAhEBAxEB/8QAGQABAQEBAQEAAAAAAAAAAAAAAAECAwQF/8QAGQEBAQEBAQEAAAAAAAAAAAAAAAECAwUH/9oADAMBAAIQAxAAAAD5nh/QwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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oTaE2S9La6IRE6EvTp3QXqEJ1JCXqs2S8T//2Q==');
  151. background-repeat: no-repeat;
  152. background-size: 100% 100%;
  153. width: 100%;
  154. height: 210rpx;
  155. font-size: 72rpx;
  156. color: #fff;
  157. padding: 31rpx 0 45rpx 0;
  158. box-sizing: border-box;
  159. text-align: center;
  160. font-family: 'Guildford Pro';
  161. background-color: var(--view-theme);
  162. }
  163. .integral-details .header .currentScore {
  164. font-size: 26rpx;
  165. color: rgba(255, 255, 255, 0.8);
  166. text-align: center;
  167. margin-bottom: 11rpx;
  168. }
  169. .integral-details .header .scoreNum {
  170. font-family: "Guildford Pro";
  171. }
  172. .integral-details .header .line {
  173. width: 60rpx;
  174. height: 3rpx;
  175. background-color: #fff;
  176. margin: 20rpx auto 0 auto;
  177. }
  178. .integral-details .header .nav {
  179. font-size: 22rpx;
  180. color: rgba(255, 255, 255, 0.8);
  181. flex: 1;
  182. margin-top: 35rpx;
  183. }
  184. .integral-details .header .nav .item {
  185. width: 33.33%;
  186. text-align: center;
  187. }
  188. .integral-details .header .nav .item .num {
  189. color: #fff;
  190. font-size: 40rpx;
  191. margin-bottom: 5rpx;
  192. font-family: 'Guildford Pro';
  193. }
  194. .integral-details .wrapper .nav {
  195. flex: 1;
  196. width: 690rpx;
  197. border-radius: 20rpx 20rpx 0 0;
  198. margin: -96rpx auto 0 auto;
  199. background-color: #f7f7f7;
  200. height: 96rpx;
  201. font-size: 30rpx;
  202. color: #bbb;
  203. }
  204. .integral-details .wrapper .nav .item {
  205. text-align: center;
  206. width: 50%;
  207. }
  208. .integral-details .wrapper .nav .item.on {
  209. background-color: #fff;
  210. color: var(--view-theme);
  211. font-weight: bold;
  212. border-radius: 20rpx 0 0 0;
  213. }
  214. .integral-details .wrapper .nav .item:nth-of-type(2).on {
  215. border-radius: 0 20rpx 0 0;
  216. }
  217. .integral-details .wrapper .nav .item .iconfont {
  218. font-size: 38rpx;
  219. margin-right: 10rpx;
  220. }
  221. .integral-details .wrapper .list {
  222. background-color: #fff;
  223. padding: 24rpx 30rpx;
  224. }
  225. .integral-details .wrapper .list .tip {
  226. font-size: 25rpx;
  227. width: 690rpx;
  228. height: 60rpx;
  229. border-radius: 50rpx;
  230. background-color: #fff5e2;
  231. border: 1rpx solid #ffeac1;
  232. color: #c8a86b;
  233. padding: 0 20rpx;
  234. box-sizing: border-box;
  235. margin-bottom: 24rpx;
  236. }
  237. .integral-details .wrapper .list .tip .iconfont {
  238. font-size: 35rpx;
  239. margin-right: 15rpx;
  240. }
  241. .integral-details .wrapper .list .item {
  242. height: 124rpx;
  243. border-bottom: 1rpx solid #eee;
  244. font-size: 24rpx;
  245. color: #999;
  246. }
  247. .integral-details .wrapper .list .item .state {
  248. font-size: 28rpx;
  249. color: #282828;
  250. margin-bottom: 8rpx;
  251. }
  252. .integral-details .wrapper .list .item .num {
  253. font-size: 36rpx;
  254. font-family: 'Guildford Pro';
  255. color: #16AC57;
  256. }
  257. .integral-details .wrapper .list .item .num.font-color {
  258. color: #E93323 !important;
  259. }
  260. .integral-details .wrapper .list2 {
  261. background-color: #fff;
  262. padding: 24rpx 0;
  263. }
  264. .integral-details .wrapper .list2 .item {
  265. background-image: linear-gradient(to right, #fff7e7 0%, #fffdf9 100%);
  266. width: 690rpx;
  267. height: 180rpx;
  268. position: relative;
  269. border-radius: 10rpx;
  270. margin: 0 auto 20rpx auto;
  271. padding: 0 25rpx 0 180rpx;
  272. box-sizing: border-box;
  273. }
  274. .integral-details .wrapper .list2 .item .pictrue {
  275. width: 90rpx;
  276. height: 150rpx;
  277. position: absolute;
  278. bottom: 0;
  279. left: 45rpx;
  280. }
  281. .integral-details .wrapper .list2 .item .pictrue image {
  282. width: 100%;
  283. height: 100%;
  284. }
  285. .integral-details .wrapper .list2 .item .name {
  286. width: 285rpx;
  287. font-size: 30rpx;
  288. font-weight: bold;
  289. color: #c8a86b;
  290. }
  291. .integral-details .wrapper .list2 .item .earn {
  292. font-size: 26rpx;
  293. color: #c8a86b;
  294. border: 2rpx solid #c8a86b;
  295. text-align: center;
  296. line-height: 52rpx;
  297. height: 52rpx;
  298. width: 160rpx;
  299. border-radius: 50rpx;
  300. }
  301. .apply {
  302. top: 52rpx;
  303. right: 0;
  304. position: absolute;
  305. width: max-content;
  306. height: 56rpx;
  307. padding: 0 14rpx;
  308. background-color: #fff1db;
  309. color: #a56a15;
  310. font-size: 22rpx;
  311. border-radius: 30rpx 0 0 30rpx;
  312. display: flex;
  313. align-items: center;
  314. justify-content: center;
  315. }
  316. </style>