index.vue 13 KB

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