pointsExchange.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <view>
  3. <u-navbar title="积分兑换">
  4. <view class="slot-wrap" v-if="false">
  5. 兑换规则
  6. </view>
  7. </u-navbar>
  8. <view class="header">
  9. <!-- 积分 -->
  10. <view class="points">
  11. <view class="picture">
  12. <img src="../../../../assets/img/riFill-vip-diamond-fill Copy@1x.png" alt="">
  13. </view>
  14. <view class="number">
  15. {{plusInfo.userPoints}}
  16. </view>
  17. <view class="button" @click="gotoUrl('pages/mine/points/points')">
  18. 兑换记录
  19. </view>
  20. </view>
  21. <!-- 提示 -->
  22. <view class="hint" v-if="false">
  23. <view class="img"><img src="../../../../assets/img/md-notifications@1x.png" alt=""></view>
  24. <view class="text">
  25. 积分将于1月1日0时自动清零,记得使用哦~
  26. </view>
  27. </view>
  28. <!-- 标签 -->
  29. <view class="tabs">
  30. <u-tabs font-size="28" height="64 " :list="tablist" :is-scroll="false" :current="current" @change="change"></u-tabs>
  31. </view>
  32. </view>
  33. <!-- 奖品 -->
  34. <view class="prize">
  35. <view class="item" v-for="(item,i) in list" :key="i" @click="ckItem(item)" >
  36. <view class="picture">
  37. <img :src="item.photoUrl" alt="">
  38. </view>
  39. <view class="name">
  40. {{item.name}}
  41. </view>
  42. <view class="infos">
  43. <view class="points">
  44. {{item.needPoint}}积分
  45. </view>
  46. <view class="remain">
  47. 剩余{{item.quantity}}
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <u-divider :isnone="list.length==0" nonetext="敬请期待" bg-color="#B5D0F4" border-color="#A1B2D1">已经到底了</u-divider>
  53. </view>
  54. </template>
  55. <script>
  56. import * as API from '@/apis/pagejs/goods.js'
  57. export default {
  58. data() {
  59. return {
  60. tablist: [{
  61. name: '全部'
  62. }, {
  63. name: '1万及以上',
  64. start:10000,
  65. end:'',
  66. }, {
  67. name: '5千-1万',
  68. start:5000,
  69. end:10000,
  70. }, {
  71. name: '1千-5千',
  72. start:1000,
  73. end:5000,
  74. }, {
  75. name: '1千以下',
  76. start:'',
  77. end:1000,
  78. }],
  79. current: 0,
  80. plusInfo:{},
  81. list:[],
  82. listForm:{
  83. pageIndex:1,
  84. typeId:"",
  85. title:"",
  86. pageSize:20,
  87. },
  88. recordsTotal:0,
  89. }
  90. },
  91. onLoad(){
  92. //this.userInfo
  93. this.plusInfo=this.carhelp.getPersonInfoPlus()
  94. this.getList();
  95. },
  96. onReachBottom() {
  97. if (this.list.length < this.recordsTotal) {
  98. this.myLoadmore();
  99. }
  100. },
  101. methods: {
  102. ckItem(item){
  103. if(item.badgeId){
  104. var url="/pages/staffHome/teamHonor/badgeDetails?type="+item.badgeId+"&id="+item.type;
  105. uni.navigateTo({
  106. url:url
  107. })
  108. }
  109. },
  110. myLoadmore(){
  111. this.listForm.pageIndex += 1;
  112. this.getList();
  113. },
  114. change(index) {
  115. this.current = index;
  116. this.listForm.queryPointStart='';
  117. this.listForm.queryPointEnd='';
  118. if(index){
  119. this.listForm.queryPointStart=this.tablist[index].end;
  120. this.listForm.queryPointEnd=this.tablist[index].start;
  121. }
  122. this.listForm.pageIndex=1;
  123. this.getList();
  124. },
  125. getList(){
  126. uni.showLoading({
  127. title: "加载中",
  128. mask: true,
  129. })
  130. API.goodsList(this.listForm).then((res) => {
  131. uni.hideLoading();
  132. if(this.listForm.pageIndex==1){
  133. this.list = res.data.data;
  134. }else{
  135. this.list = [
  136. ...this.list,
  137. ...res.data.data
  138. ];
  139. }
  140. this.recordsTotal = res.data.recordsTotal;
  141. }).catch(error => {
  142. uni.showToast({
  143. title: error,
  144. icon: "none"
  145. })
  146. })
  147. }
  148. }
  149. }
  150. </script>
  151. <style lang="scss" scoped>
  152. page{
  153. background-color: #B5D0F4;
  154. padding-bottom: 100px;
  155. }
  156. /deep/.u-slot-content {
  157. display: block;
  158. text-align: right !important;
  159. margin-right: 16px;
  160. color: rgba(31, 74, 153, 1);
  161. font-size: 16px;
  162. }
  163. .header{
  164. background: linear-gradient(180deg, rgba(18,114,238,1) 0%,rgba(181,208,244,1) 100%);
  165. // 积分
  166. .points{
  167. padding: 48rpx 32rpx;
  168. display: flex;
  169. align-items: center;
  170. .picture{
  171. width: 80rpx;
  172. height: 80rpx;
  173. background-color: rgba(255, 175, 18, 1);
  174. border: 3px solid rgba(252, 236, 107, 1);
  175. border-radius: 20px;
  176. display: flex;
  177. align-items: center;
  178. justify-content: center;
  179. }
  180. .number{
  181. color: rgba(255, 255, 255, 1);
  182. font-size: 36px;
  183. margin-left: 24rpx;
  184. font-weight: bold;
  185. font-family: 'Medium';
  186. }
  187. .button{
  188. font-family: 'Regular';
  189. width: 144rpx;
  190. height: 56rpx;
  191. line-height: 56rpx;
  192. border-radius: 50px;
  193. background-color: rgba(255, 255, 255, 0.3);
  194. color: rgba(255, 255, 255, 1);
  195. text-align: center;
  196. margin-left: auto;
  197. }
  198. }
  199. // 提示
  200. .hint{
  201. font-family: 'Regular';
  202. border-radius: 8px;
  203. background-color: #018BB9;
  204. color: #fff;
  205. height: 72rpx;
  206. font-size: 14rpx;
  207. margin: 40rpx 48rpx 24rpx;
  208. display: flex;
  209. align-items: center;
  210. .img{
  211. margin-left: 8rpx;
  212. }
  213. img{
  214. vertical-align: middle;
  215. }
  216. }
  217. // 标签
  218. .tabs{
  219. margin: 0 32rpx;
  220. height: 96rpx;
  221. line-height:96rpx;
  222. background-color: #fff;
  223. border-radius: 8px;
  224. overflow: hidden;
  225. }
  226. }
  227. // 奖品
  228. .prize{
  229. margin-top: 32rpx;
  230. padding: 0 32rpx;
  231. display: flex;
  232. flex-wrap: wrap;
  233. justify-content: space-between;
  234. .item{
  235. background-color: #fff;
  236. border-radius: 8px;
  237. width: 336rpx;
  238. padding-bottom: 22rpx;
  239. margin-bottom: 24rpx;
  240. .picture{
  241. height: 336rpx;
  242. img{
  243. width: 100%;
  244. height: 100%;
  245. }
  246. }
  247. .name{
  248. font-family: 'Medium';
  249. margin-top: 24rpx;
  250. color: #101010;
  251. font-weight: bold;
  252. padding-left: 16rpx;
  253. }
  254. .infos{
  255. display: flex;
  256. justify-content: space-between;
  257. align-items: center;
  258. padding: 0 16rpx;
  259. margin-top: 16rpx;
  260. .points{
  261. color: rgba(255, 61, 0, 1);
  262. font-size: 32rpx;
  263. font-family: 'SemiBold';
  264. }
  265. .remain{
  266. color: rgba(148, 148, 148, 1);
  267. font-family: 'Regular';
  268. }
  269. }
  270. }
  271. }
  272. </style>