integral.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <view class="integral-details" ref="container">
  3. <view class="header">
  4. <view class="currentScore">当前积分</view>
  5. <view>{{ data.integral }}</view>
  6. <view class="line"></view>
  7. <!--<view class="nav acea-row">-->
  8. <!--<view class="item">-->
  9. <!--<view class="num">{{ info.sum_integral }}</view>-->
  10. <!--<view>累计积分</view>-->
  11. <!--</view>-->
  12. <!--<view class="item">-->
  13. <!--<view class="num">{{ info.deduction_integral }}</view>-->
  14. <!--<view>累计消费</view>-->
  15. <!--</view>-->
  16. <!--<view class="item">-->
  17. <!--<view class="num">{{ info.today_integral }}</view>-->
  18. <!--<view>今日获得</view>-->
  19. <!--</view>-->
  20. <!--</view>-->
  21. </view>
  22. <view class="wrapper">
  23. <view class="nav acea-row">
  24. <view
  25. class="item acea-row row-center-wrapper"
  26. :class="current === navListIndex ? 'on' : ''"
  27. v-for="(item, navListIndex) in navList"
  28. :key="navListIndex"
  29. @click="nav(navListIndex)"
  30. >
  31. {{ item.name }}
  32. </view>
  33. </view>
  34. <view class="list" :hidden="current !== 0">
  35. <!--<view class="tip acea-row row-middle">-->
  36. <!--<text class="iconfont icon-shuoming"><text-->
  37. <!--&gt;提示:积分数值的高低会直接影响您的会员等级-->
  38. <!--</view>-->
  39. <view
  40. class="item acea-row row-between-wrapper"
  41. v-for="(item, listIndex) in list"
  42. :key="listIndex"
  43. >
  44. <view>
  45. <text class="state">{{ item.title }}</text>
  46. <div>{{ item.createTime }}</div>
  47. </view>
  48. <text class="num" v-if="item.pm == 1">+{{ item.number }}</text>
  49. <text class="num font-color-red" v-if="item.pm == 0">-{{ item.number }}</text>
  50. </view>
  51. </view>
  52. <!--<view class="list2" :hidden="current !== 1">-->
  53. <!--<view class="item acea-row row-between-wrapper" @click="goHome()">-->
  54. <!--<view class="pictrue"><image :src="`${$VUE_APP_RESOURCES_URL}/images/score.png`" /></view>-->
  55. <!--<view class="name">购买商品可获得积分奖励</view>-->
  56. <!--<view class="earn">赚积分</view>-->
  57. <!--</view>-->
  58. <!--<view-->
  59. <!--class="item acea-row row-between-wrapper"-->
  60. <!--@click="goSignIn()"-->
  61. <!--&gt;-->
  62. <!--<view class="pictrue"><image :src="`${$VUE_APP_RESOURCES_URL}/images/score.png`" /></view>-->
  63. <!--<view class="name">每日签到可获得积分奖励</view>-->
  64. <!--<view class="earn">赚积分</view>-->
  65. <!--</view>-->
  66. <!--</view>-->
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. name: "Integral",
  73. props: {},
  74. data: function() {
  75. return {
  76. navList: [
  77. { name: "分值明细"}
  78. // { name: "分值提升", icon: "icon-tishengfenzhi" }
  79. ],
  80. current: 0,
  81. where: {
  82. pageNum: 1,
  83. pageSize: 15
  84. },
  85. data: {
  86. sign: 1,
  87. integral: 1,
  88. all: 1
  89. },
  90. list: [],
  91. info: [],
  92. loaded: false,
  93. loading: false
  94. };
  95. },
  96. mounted: function() {
  97. this.getIntegral();
  98. this.getInfo();
  99. },
  100. onReachBottom() {
  101. !this.loading && this.getInfo();
  102. },
  103. methods: {
  104. nav: function(index) {
  105. this.current = index;
  106. },
  107. getInfo: function() {
  108. let that = this;
  109. uni.showLoading({
  110. title: '正在查询'
  111. })
  112. this.$api.request('get','app/userBill/list',that.where).then(
  113. res => {
  114. uni.hideLoading()
  115. that.loaded = res.total < that.where.pageSize;
  116. that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
  117. that.where.pageNum = that.where.pageNum + 1;
  118. that.list.push.apply(that.list, res.rows);
  119. },err => {
  120. uni.hideLoading()
  121. uni.showToast({
  122. title: err.msg || err.response.data.msg|| err.response.data.message,
  123. icon: 'none',
  124. duration: 2000
  125. });
  126. }
  127. );
  128. },
  129. getIntegral: function() {
  130. let that = this;
  131. this.$api.request('get', 'user/app/getUser').then(res => {
  132. that.data.integral = res.data.integral
  133. })
  134. }
  135. }
  136. };
  137. </script>
  138. <style lang="less">
  139. .list {
  140. }
  141. /*积分详情*/
  142. .integral-details .header {
  143. background-image: url('https://kxmalls.oss-cn-hangzhou.aliyuncs.com/bg/bg.png');
  144. background-repeat: no-repeat;
  145. background-size: 100% 100%;
  146. width: 100%;
  147. height: 3.6 * 100rpx;
  148. font-size: 0.72 * 100rpx;
  149. color: #fff;
  150. padding: 0.31 * 100rpx 0 0.45 * 100rpx 0;
  151. text-align: center;
  152. font-family: 'GuildfordProBook 5';
  153. }
  154. .integral-details .header .currentScore {
  155. font-size: 0.26 * 100rpx;
  156. color: rgba(255, 255, 255, 0.8);
  157. text-align: center;
  158. margin-bottom: 0.05 * 100rpx;
  159. }
  160. .integral-details .header .line {
  161. width: 0.6 * 100rpx;
  162. height: 0.03 * 100rpx;
  163. background-color: #fff;
  164. margin: 0.2 * 100rpx auto 0 auto;
  165. }
  166. .integral-details .header .nav {
  167. font-size: 0.22 * 100rpx;
  168. color: rgba(255, 255, 255, 0.8);
  169. flex: 1;
  170. -o-flex: 1;
  171. -ms-flex: 1;
  172. margin-top: 0.35 * 100rpx;
  173. }
  174. .integral-details .header .nav .item {
  175. width: 33.33%;
  176. text-align: center;
  177. }
  178. .integral-details .header .nav .item .num {
  179. color: #fff;
  180. font-size: 0.4 * 100rpx;
  181. }
  182. .integral-details .wrapper .nav {
  183. flex: 1;
  184. -o-flex: 1;
  185. -ms-flex: 1;
  186. width: 6.9 * 100rpx;
  187. border-radius: 0.2 * 100rpx 0.2 * 100rpx 0 0;
  188. margin: -0.96 * 100rpx auto 0 auto;
  189. background-color: #f7f7f7;
  190. height: 0.96 * 100rpx;
  191. font-size: 0.3 * 100rpx;
  192. color: #bbb;
  193. }
  194. .integral-details .wrapper .nav .item {
  195. text-align: center;
  196. width: 100%;
  197. }
  198. /*.integral-details .wrapper .nav .item{text-align:center;width:50%;}*/
  199. .integral-details .wrapper .nav .item.on {
  200. background-color: #fff;
  201. color: #eb3729;
  202. font-weight: bold;
  203. border-radius: 0.2 * 100rpx 0.2 * 100rpx 0 0;
  204. }
  205. .integral-details .wrapper .nav .item .iconfont {
  206. font-size: 0.38 * 100rpx;
  207. margin-right: 0.1 * 100rpx;
  208. }
  209. .integral-details .wrapper .list {
  210. background-color: #fff;
  211. padding: 0.24 * 100rpx 0.3 * 100rpx;
  212. }
  213. .integral-details .wrapper .list .tip {
  214. font-size: 0.25 * 100rpx;
  215. width: 6.9 * 100rpx;
  216. height: 0.6 * 100rpx;
  217. border-radius: 0.5 * 100rpx;
  218. background-color: #fff5e2;
  219. border: 1px solid #ffeac1;
  220. color: #c8a86b;
  221. padding: 0 0.2 * 100rpx;
  222. margin-bottom: 0.24 * 100rpx;
  223. }
  224. .integral-details .wrapper .list .tip .iconfont {
  225. font-size: 0.35 * 100rpx;
  226. margin-right: 0.15 * 100rpx;
  227. }
  228. .integral-details .wrapper .list .item {
  229. height: 1.24 * 100rpx;
  230. border-bottom: 1px solid #eee;
  231. font-size: 0.24 * 100rpx;
  232. color: #999;
  233. }
  234. .integral-details .wrapper .list .item .state {
  235. font-size: 0.28 * 100rpx;
  236. color: #282828;
  237. margin-bottom: 0.08 * 100rpx;
  238. }
  239. .integral-details .wrapper .list .item .num {
  240. font-size: 0.36 * 100rpx;
  241. font-family: 'GuildfordProBook 5';
  242. color: #16ac57;
  243. }
  244. .integral-details .wrapper .list2 {
  245. background-color: #fff;
  246. padding: 0.24 * 100rpx 0;
  247. }
  248. .integral-details .wrapper .list2 .item {
  249. background-image: linear-gradient(to right, #fff7e7 0%, #fffdf9 100%);
  250. background-image: -moz-linear-gradient(to right, #fff7e7 0%, #fffdf9 100%);
  251. width: 6.9 * 100rpx;
  252. height: 1.8 * 100rpx;
  253. position: relative;
  254. border-radius: 0.1 * 100rpx;
  255. margin: 0 auto 0.2 * 100rpx auto;
  256. padding: 0 0.25 * 100rpx 0 1.8 * 100rpx;
  257. }
  258. .integral-details .wrapper .list2 .item .pictrue {
  259. width: 0.9 * 100rpx;
  260. height: 1.5 * 100rpx;
  261. position: absolute;
  262. bottom: 0;
  263. left: 0.45 * 100rpx;
  264. }
  265. .integral-details .wrapper .list2 .item .pictrue image {
  266. width: 100%;
  267. height: 100%;
  268. }
  269. .integral-details .wrapper .list2 .item .name {
  270. width: 2.85 * 100rpx;
  271. font-size: 0.3 * 100rpx;
  272. font-weight: bold;
  273. color: #c8a86b;
  274. }
  275. .integral-details .wrapper .list2 .item .earn {
  276. font-size: 0.26 * 100rpx;
  277. color: #c8a86b;
  278. border: 0.02 * 100rpx solid #c8a86b;
  279. text-align: center;
  280. line-height: 0.52 * 100rpx;
  281. height: 0.52 * 100rpx;
  282. width: 1.6 * 100rpx;
  283. border-radius: 0.5 * 100rpx;
  284. }
  285. .acea-row.row-center-wrapper{
  286. align-items: center;
  287. justify-content: center;
  288. }
  289. .acea-row.row-between-wrapper {
  290. align-items: center;
  291. justify-content: space-between;
  292. }
  293. .acea-row {
  294. display: flex;
  295. flex-wrap: wrap /* 辅助类 */;
  296. }
  297. </style>