integral.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view>
  3. <view class="top">
  4. <text class="icon" @tap="openPopup">积分规则</text>
  5. <view class="jf">
  6. <text>积分</text>
  7. <view class="score">{{ userinfo.score }}</view>
  8. </view>
  9. <view class="rank">
  10. <text class="text">{{ userinfo.score | rank }}</text>
  11. </view>
  12. </view>
  13. <view class="title"><view class="text">积分明细</view></view>
  14. <view class="m_list">
  15. <view class="item" v-for="(v, i) in info.data" :key="i">
  16. <view class="left">
  17. <text class="t1">{{ v.memo }}</text>
  18. <text class="t2">{{ v.createdate }}</text>
  19. </view>
  20. <text class="right">+{{ v.score }}</text>
  21. </view>
  22. </view>
  23. <view class="empty" v-if="info.total == 0">暂无积分获取记录</view>
  24. <uni-popup ref="popup" type="center" class="popup" padding="0">
  25. <view class="popup_top">积分规则</view>
  26. <view class="info">
  27. <view class="item">1.每消费一笔订单,可得到支付金额相等的积分。</view>
  28. <view class="item">2.每发起一条论坛话题可增加5积分。</view>
  29. <view class="item">3.收到一条评论可增加1积分。</view>
  30. <text class="t3">积分使用</text>
  31. <view class="item1">1.500积分支付时95折</view>
  32. <view class="item1">2.1000积分支付时93折</view>
  33. <view class="item1">3.1500积分支付时9折</view>
  34. </view>
  35. <view class="bottom" @tap="closePopup()">知道了</view>
  36. </uni-popup>
  37. </view>
  38. </template>
  39. <script>
  40. import helper from '../../common/helper.js';
  41. import api from '../../common/api.js';
  42. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  43. export default {
  44. components: { uniPopup },
  45. filters: {
  46. rank: value => {
  47. if (value < 500) {
  48. return '银卡';
  49. }
  50. if (value < 1000) {
  51. return '金卡';
  52. }
  53. return '钻石卡';
  54. }
  55. },
  56. data() {
  57. return {
  58. map: {
  59. page: 1
  60. },
  61. info: {
  62. total: 0,
  63. data: []
  64. },
  65. userinfo: {}
  66. };
  67. },
  68. onShow() {
  69. this.getList();
  70. this.getUserInfo();
  71. },
  72. methods: {
  73. async getList() {
  74. let res = await api.getScoreLog(this.map);
  75. this.info = res.data;
  76. uni.stopPullDownRefresh();
  77. },
  78. async getUserInfo() {
  79. let res = await api.getUserInfo();
  80. this.userinfo = res.data;
  81. },
  82. onPullDownRefresh() {
  83. this.map.page = 1;
  84. this.getList();
  85. },
  86. onReachBottom() {
  87. if (this.info.last_page > this.info.current_page) {
  88. this.getList();
  89. }
  90. },
  91. openPopup() {
  92. this.$refs.popup.open();
  93. },
  94. closePopup() {
  95. this.$refs.popup.close();
  96. }
  97. }
  98. };
  99. </script>
  100. <style lang="scss" scoped>
  101. .empty {
  102. text-align: center;
  103. font-size: 26upx;
  104. padding: 60upx;
  105. }
  106. .top {
  107. background-color: #32c45e;
  108. color: #ffffff;
  109. height: 300upx;
  110. padding: 20upx;
  111. .jf {
  112. display: flex;
  113. flex-direction: column;
  114. align-items: center;
  115. justify-content: center;
  116. width: 100%;
  117. font-size: 26upx;
  118. }
  119. .icon {
  120. float: right;
  121. text-align: right;
  122. font-size: 26upx;
  123. }
  124. .score{
  125. font-size: 64upx;
  126. }
  127. }
  128. .title {
  129. width: 100%;
  130. margin-top: 10%;
  131. border-top: 1px solid #e1e1e1;
  132. display: flex;
  133. justify-content: center;
  134. .text {
  135. text-align: center;
  136. background-color: #ffffff;
  137. margin-top: -19upx;
  138. color: #9b9b9b;
  139. font-size: 24upx;
  140. padding: 0 20upx;
  141. }
  142. }
  143. .m_list {
  144. padding: 0 30upx;
  145. .item {
  146. display: flex;
  147. padding: 25upx 0;
  148. align-items: center;
  149. justify-content: space-between;
  150. border-bottom: 1px solid #eeeeee;
  151. .left {
  152. display: flex;
  153. flex-direction: column;
  154. .t1 {
  155. font-size: 28upx;
  156. font-weight: 800;
  157. }
  158. .t2 {
  159. font-size: 22upx;
  160. color: #999999;
  161. }
  162. }
  163. .right {
  164. color: #ea1010;
  165. font-size: 28upx;
  166. }
  167. }
  168. }
  169. .popup {
  170. font-size: 24upx;
  171. .popup_top {
  172. text-align: center;
  173. background-color: #32c45e;
  174. color: #ffffff;
  175. padding: 20upx;
  176. font-size: 30upx;
  177. }
  178. .info {
  179. padding: 20upx;
  180. .t3 {
  181. font-size: 30upx;
  182. width: 100%;
  183. line-height: 80upx;
  184. }
  185. .item,
  186. .item1 {
  187. margin-top: 10upx;
  188. }
  189. }
  190. .bottom {
  191. text-align: center;
  192. line-height: 80upx;
  193. margin-top: 20upx;
  194. box-shadow: 0px -2upx 2upx 2upx #ececec;
  195. }
  196. }
  197. .rank{
  198. text-align: center;
  199. margin-top: 20upx;
  200. .text{
  201. background-color: #FFFFFF;
  202. border: 1px solid #F0AD4E;
  203. color: #F0AD4E;
  204. border-radius: 20upx;
  205. font-size: 24upx;
  206. padding: 4upx 16upx;
  207. }
  208. }
  209. </style>