index.vue 13 KB

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