index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. <template>
  2. <!-- 积分详情 -->
  3. <view :style="colorStyle">
  4. <!-- #ifdef MP || APP-PLUS -->
  5. <view class="accountTitle">
  6. <view :style="{height:getHeight.barTop+'px'}"></view>
  7. <view class="sysTitle acea-row row-center-wrapper" :style="{height:getHeight.barHeight+'px'}">
  8. <view>积分详情</view>
  9. <text class="iconfont icon-ic_leftarrow" @click="goarrow"></text>
  10. </view>
  11. </view>
  12. <view :style="{height:(getHeight.barTop+getHeight.barHeight)+'px'}"></view>
  13. <!-- #endif -->
  14. <view class='integral-details'>
  15. <view class='header'>
  16. <view class='currentScore acea-row row-middle'>
  17. <image src="../static/integral.png"></image>
  18. <view>我的积分</view>
  19. <view class="notice acea-row row-center-wrapper">
  20. <view class="iconfont icon-ic_horn1"></view>
  21. <view v-if="userInfo.clear_integral>0 && userInfo.clear_time>0">您的积分将于{{ userInfo.clear_time | dateFormat }}清零</view>
  22. <view v-else>积分数值的高低会直接影响您的会员等级</view>
  23. </view>
  24. </view>
  25. <view class="scoreNum">{{userInfo.integral}}</view>
  26. <view class='nav'>
  27. <view class="title acea-row row-middle">
  28. <text class="name">积分详情</text>
  29. <navigator url="/pages/users/user_integral_detail/index" hover-class="none">
  30. 积分明细<text class="iconfont icon-ic_rightarrow"></text>
  31. </navigator>
  32. </view>
  33. <view class="list acea-row row-middle row-around">
  34. <view class='item'>
  35. <view class='num'>{{userInfo.sum_integral}}</view>
  36. <view>累计积分</view>
  37. </view>
  38. <view class="line"></view>
  39. <view class='item'>
  40. <view class='num'>{{userInfo.deduction_integral}}</view>
  41. <view>累计消费</view>
  42. </view>
  43. <view class="line"></view>
  44. <view class='item'>
  45. <view class='num'>{{userInfo.frozen_integral}}</view>
  46. <view>冻结积分</view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="pictrue">
  51. <image :src="imgHost+'/statics/images/balance_species.png'"></image>
  52. </view>
  53. </view>
  54. <view class='wrapper'>
  55. <view class="title">互动玩积分</view>
  56. <view class="list acea-row row-bottom">
  57. <view class="item">
  58. <view class="name">下单抵扣</view>
  59. <view>购买商品可获得</view>
  60. <navigator hover-class='none' open-type="switchTab" url="/pages/index/index" class="bnt acea-row row-center-wrapper">去下单</navigator>
  61. </view>
  62. <view class="item on">
  63. <view class="name">积分兑换</view>
  64. <view>购买商品可获得</view>
  65. <navigator hover-class='none' url='/pages/activity/points_mall/index' class="bnt acea-row row-center-wrapper">去兑换</navigator>
  66. </view>
  67. <view class="item on1">
  68. <view class="name">抽奖赢积分</view>
  69. <view>购买商品可获得</view>
  70. <navigator hover-class='none' url='/pages/goods/lottery/grids/index?type=1' class="bnt acea-row row-center-wrapper">去抽奖</navigator>
  71. </view>
  72. </view>
  73. </view>
  74. <view class='wrapper on'>
  75. <view class="title">做任务领积分</view>
  76. <view class="task">
  77. <view class="item acea-row row-between-wrapper">
  78. <view class="picTxt acea-row row-middle">
  79. <view class="pictrue">
  80. <image src="../static/goumai.png"></image>
  81. </view>
  82. <view class="text">
  83. <view class="name">购买商品</view>
  84. <view class="info">购买商品可获得</view>
  85. </view>
  86. </view>
  87. <navigator hover-class='none' open-type="switchTab" url="/pages/index/index" class="bnt acea-row row-center-wrapper">去完成</navigator>
  88. </view>
  89. <view class="item acea-row row-between-wrapper">
  90. <view class="picTxt acea-row row-middle">
  91. <view class="pictrue">
  92. <image src="../static/qiandao.png"></image>
  93. </view>
  94. <view class="text">
  95. <view class="name">每日签到</view>
  96. <view class="info">每日签到可获得</view>
  97. </view>
  98. </view>
  99. <navigator hover-class='none' url='/pages/users/user_sgin/index' class="bnt acea-row row-center-wrapper">去完成</navigator>
  100. </view>
  101. <view class="item acea-row row-between-wrapper">
  102. <view class="picTxt acea-row row-middle">
  103. <view class="pictrue">
  104. <image src="../static/choujiang.png"></image>
  105. </view>
  106. <view class="text">
  107. <view class="name">九宫格抽奖</view>
  108. <view class="info">评价完成可获得</view>
  109. </view>
  110. </view>
  111. <navigator hover-class='none' url='/pages/goods/lottery/grids/index?type=1' class="bnt acea-row row-center-wrapper">去完成</navigator>
  112. </view>
  113. </view>
  114. </view>
  115. <view class="footer"></view>
  116. </view>
  117. </view>
  118. </template>
  119. <script>
  120. import { HTTP_REQUEST_URL } from '@/config/app';
  121. import home from '@/components/home';
  122. import {
  123. postSignUser
  124. } from '@/api/user.js';
  125. import dayjs from '@/plugin/dayjs/dayjs.min.js';
  126. import {
  127. toLogin
  128. } from '@/libs/login.js';
  129. import {
  130. mapGetters
  131. } from "vuex";
  132. import emptyPage from '@/components/emptyPage.vue';
  133. import colors from '@/mixins/color'
  134. export default {
  135. components: {
  136. emptyPage,
  137. home
  138. },
  139. filters: {
  140. dateFormat: function(value) {
  141. return dayjs(value * 1000).format('YYYY-MM-DD');
  142. }
  143. },
  144. mixins:[colors],
  145. data() {
  146. return {
  147. getHeight: this.$util.getWXStatusHeight(),
  148. imgHost:HTTP_REQUEST_URL,
  149. userInfo: {},
  150. isAuto: false, //没有授权的不会自动授权
  151. isShowAuth: false, //是否隐藏授权
  152. isTime: 0
  153. };
  154. },
  155. computed: mapGetters(['isLogin']),
  156. watch: {
  157. isLogin: {
  158. handler: function(newV, oldV) {
  159. if (newV) {
  160. // #ifdef H5 || APP-PLUS
  161. this.getUserInfo();
  162. // #endif
  163. }
  164. },
  165. deep: true
  166. }
  167. },
  168. onLoad() {
  169. if (this.isLogin) {
  170. this.getUserInfo();
  171. } else {
  172. toLogin()
  173. }
  174. },
  175. onShow() {
  176. uni.removeStorageSync('form_type_cart');
  177. },
  178. methods: {
  179. /**
  180. * 授权回调
  181. */
  182. onLoadFun: function() {
  183. this.getUserInfo();
  184. this.isShowAuth = false;
  185. },
  186. // 授权关闭
  187. authColse: function(e) {
  188. this.isShowAuth = e
  189. },
  190. goarrow(){
  191. uni.navigateBack()
  192. },
  193. getUserInfo: function() {
  194. let that = this;
  195. postSignUser({
  196. sign: 1,
  197. integral: 1,
  198. all: 1
  199. }).then(function(res) {
  200. that.$set(that, 'userInfo', res.data);
  201. let clearTime = res.data.clear_time;
  202. let showTime = clearTime-(86400*14);
  203. let timestamp = Date.parse(new Date())/1000;
  204. if(showTime < timestamp){
  205. that.isTime = 1
  206. }else{
  207. that.isTime = 0
  208. }
  209. });
  210. }
  211. }
  212. }
  213. </script>
  214. <style scoped lang="scss">
  215. @keyframes kf {
  216. 0% {
  217. transform: translateY(8rpx);
  218. }
  219. 100% {
  220. transform: translateY(0);
  221. }
  222. }
  223. .footer{
  224. height: 30rpx;
  225. height: calc(30rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  226. height: calc(30rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  227. }
  228. .accountTitle{
  229. background: linear-gradient(90deg, var(--view-theme) 0%, var(--view-gradient) 100%);
  230. position: fixed;
  231. left:0;
  232. top:0;
  233. width: 100%;
  234. z-index: 99;
  235. .sysTitle{
  236. width: 100%;
  237. position: relative;
  238. font-weight: 500;
  239. color: #fff;
  240. font-size: 30rpx;
  241. .iconfont{
  242. position: absolute;
  243. font-size: 36rpx;
  244. left:11rpx;
  245. width: 60rpx;
  246. }
  247. }
  248. }
  249. .integral-details{
  250. .wrapper{
  251. width: 710rpx;
  252. background: #FFFFFF;
  253. border-radius: 24rpx;
  254. margin: 86rpx auto 0 auto;
  255. padding-bottom: 22rpx;
  256. &.on{
  257. margin-top: 20rpx;
  258. padding-bottom: 32rpx;
  259. }
  260. .title{
  261. font-size: 32rpx;
  262. font-weight: 600;
  263. color: #333333;
  264. padding: 32rpx 32rpx 42rpx 32rpx;
  265. }
  266. .list{
  267. padding: 0 23rpx;
  268. .item{
  269. background-image: url('../static/integralBg03.png');
  270. background-repeat: no-repeat;
  271. background-size: 100% 100%;
  272. width: 212rpx;
  273. height: 294rpx;
  274. text-align: center;
  275. font-weight: 400;
  276. color: #999999;
  277. font-size: 24rpx;
  278. padding-top: 110rpx;
  279. &.on{
  280. background-image: url('../static/integralBg02.png');
  281. }
  282. &.on1{
  283. background-image: url('../static/integralBg01.png');
  284. }
  285. &~.item{
  286. margin-left: 14rpx;
  287. }
  288. .name{
  289. color: #333333;
  290. font-size: 28rpx;
  291. margin-bottom: 8rpx;
  292. }
  293. .bnt{
  294. width: 136rpx;
  295. height: 56rpx;
  296. background: linear-gradient(90deg, var(--view-theme) 0%, var(--view-gradient) 100%);
  297. border-radius: 50rpx;
  298. font-weight: 500;
  299. color: #FFFFFF;
  300. font-size: 24rpx;
  301. margin: 20rpx auto 0 auto;
  302. }
  303. }
  304. }
  305. .task{
  306. padding: 0 24rpx;
  307. .item{
  308. &~.item{
  309. margin-top: 52rpx;
  310. }
  311. .bnt{
  312. width: 136rpx;
  313. height: 56rpx;
  314. background: linear-gradient(90deg, var(--view-theme) 0%, var(--view-gradient) 100%);
  315. border-radius: 50rpx;
  316. color: #fff;
  317. font-weight: 500;
  318. font-size: 24rpx;
  319. }
  320. .picTxt{
  321. .pictrue{
  322. width: 88rpx;
  323. height: 88rpx;
  324. image{
  325. width: 100%;
  326. height: 100%;
  327. }
  328. }
  329. .text{
  330. margin-left: 16rpx;
  331. font-weight: 400;
  332. .name{
  333. font-size: 28rpx;
  334. color: #333333;
  335. }
  336. .info{
  337. color: #999999;
  338. font-size: 24rpx;
  339. margin-top: 8rpx;
  340. .num{
  341. color: var(--view-theme);
  342. margin-left: 4rpx;
  343. }
  344. }
  345. }
  346. }
  347. }
  348. }
  349. }
  350. }
  351. .integral-details .header {
  352. width: 100%;
  353. height: 380rpx;
  354. font-size: 72rpx;
  355. color: #fff;
  356. padding: 36rpx 0 45rpx 0;
  357. box-sizing: border-box;
  358. background: linear-gradient(90deg, var(--view-theme) 0%, var(--view-gradient) 100%);
  359. border-radius: 0 0 640rpx 640rpx/0 0 80rpx 80rpx;
  360. position: relative;
  361. .pictrue{
  362. position: absolute;
  363. width: 412rpx;
  364. height: 378rpx;
  365. right: 0;
  366. top: 22rpx;
  367. animation: kf 1.2s linear .8s infinite alternate;
  368. image{
  369. width: 100%;
  370. height: 100%;
  371. }
  372. }
  373. }
  374. .integral-details .header .currentScore {
  375. font-size: 24rpx;
  376. color: #fff;
  377. margin-left: 32rpx;
  378. image{
  379. width: 38rpx;
  380. height: 37rpx;
  381. display: block;
  382. margin-right: 4rpx;
  383. }
  384. .notice{
  385. background: rgba(0,0,0,0.1);
  386. padding: 13rpx 16rpx 15rpx 16rpx;
  387. border-radius: 50rpx;
  388. font-size: 22rpx;
  389. color: #FFFFFF;
  390. margin-left: 16rpx;
  391. .iconfont{
  392. font-size: 26rpx;
  393. margin-right: 8rpx;
  394. margin-top: 5rpx;
  395. }
  396. }
  397. }
  398. .integral-details .header .scoreNum {
  399. font-family: "SemiBold";
  400. margin: 8rpx 0 0 40rpx;
  401. }
  402. .integral-details .header .nav {
  403. background-image: url('../static/integralBg.png');
  404. background-repeat: no-repeat;
  405. background-size: 100% 100%;
  406. width: 710rpx;
  407. height: 240rpx;
  408. margin-top: 28rpx;
  409. margin: 28rpx auto 0 auto;
  410. position: relative;
  411. z-index: 9;
  412. .title{
  413. font-size: 22rpx;
  414. color: var(--view-theme);
  415. padding-top: 18rpx;
  416. margin-left: 32rpx;
  417. .name{
  418. font-size: 32rpx;
  419. font-weight: 600;
  420. color: #333333;
  421. margin-right: 16rpx;
  422. }
  423. .iconfont{
  424. font-size: 24rpx;
  425. }
  426. }
  427. .list{
  428. margin-top: 48rpx;
  429. .item{
  430. color: #999999;
  431. font-size: 24rpx;
  432. text-align: center;
  433. width: 33%;
  434. .num{
  435. color: #333333;
  436. font-size: 40rpx;
  437. margin-top: 14rpx;
  438. font-family: "SemiBold";
  439. margin-bottom: 5px;
  440. }
  441. }
  442. .line{
  443. width: 1px;
  444. height: 42rpx;
  445. background-color: #DDDDDD;
  446. }
  447. }
  448. }
  449. </style>