index.vue 8.6 KB

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