points.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <template>
  2. <view>
  3. <u-navbar title="积分">
  4. <view class="slot-wrap" @click="showPointsRule()" >
  5. 积分规则
  6. </view>
  7. </u-navbar>
  8. <u-modal v-model="showPointsRuleBl" title="积分规则" >
  9. <view class="showPointsRuleClass">
  10. <view>登陆微官网一分</view>
  11. <view>点赞一分</view>
  12. <view>分享一分</view>
  13. <view>登陆微官网一分</view>
  14. <view>每天上限为4分</view>
  15. </view>
  16. </u-modal>
  17. <view class="background">
  18. <view class="points">
  19. <view class="number">
  20. {{top?top.userScore:plusInfo.userPoints}}
  21. </view>
  22. <view class="unit">
  23. 积分
  24. </view>
  25. </view>
  26. <view class="rank" v-if="this.current==0" @click="gotoUrl('pages/mine/points/rankingList')">
  27. <view class="img"><img src="../../../assets/img/riFill-bar-chart-2-fill@1x.png" alt=""></view>
  28. <view class="text">积分排名{{top&&top.userSortNo?'第'+top.rank+'名':''}}</view>
  29. <view><u-icon name="arrow-right" color="#fff" size="28"></u-icon></view>
  30. </view>
  31. <view class="rank" v-if="this.current==1">
  32. <view class="img"><img src="../../../assets/img/riLine-gift-2-line@1x.png" alt=""></view>
  33. <view class="text">积分兑换</view>
  34. <view><u-icon name="arrow-right" color="#fff" size="28"></u-icon></view>
  35. </view>
  36. </view>
  37. <view class="record">
  38. <view class="tabs" v-if="false">
  39. <u-tabs bar-width="100" inactive-color="#bbbbbb" active-color="#101010" :list="tablist" :is-scroll="false" :current="current" @change="change" ></u-tabs>
  40. </view>
  41. <view class="get" v-if="this.current==0" >
  42. <!-- <view class="total">
  43. 6月获取278
  44. </view> -->
  45. <view class="each" v-for="(item,i) in list" :key="i">
  46. <view class="way-date">
  47. <view class="way">
  48. {{item.source}}
  49. </view>
  50. <view class="date">
  51. {{item.createTime}}
  52. </view>
  53. </view>
  54. <view class="number">
  55. {{item.score?"+"+item.score:item.score}}
  56. </view>
  57. </view>
  58. </view>
  59. <view class="exchange" v-if="this.current==1">
  60. <view class="item">
  61. <view class="month">
  62. 6月
  63. </view>
  64. <view class="details" v-for="(item,i) in 2" :key="i">
  65. <view class="picture">
  66. <img src="../../../assets/img/riLine-gift-2-line@1x.png" alt="">
  67. </view>
  68. <view class="infos">
  69. <view class="name">
  70. 兑换礼品名称
  71. </view>
  72. <view class="price">
  73. <text>价格:</text>
  74. <text>30积分</text>
  75. </view>
  76. <view class="date">
  77. <text>时间:</text>
  78. <text>2022-06-23 14:27:22兑换</text>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="item">
  84. <view class="month">
  85. 5月
  86. </view>
  87. <view class="details" v-for="(item,i) in 2" :key="i">
  88. <view class="picture">
  89. <img src="../../../assets/img/riLine-gift-2-line@1x.png" alt="">
  90. </view>
  91. <view class="infos">
  92. <view class="name">
  93. 兑换礼品名称
  94. </view>
  95. <view class="price">
  96. <text>价格:</text>
  97. <text>30积分</text>
  98. </view>
  99. <view class="date">
  100. <text>时间:</text>
  101. <text>2022-05-23 14:27:22兑换</text>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. <u-divider :isnone="list.length==0" nonetext="你还没有获取到积分" bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
  109. </view>
  110. </template>
  111. <script>
  112. import * as API from '@/apis/pagejs/user.js'
  113. export default {
  114. data() {
  115. return {
  116. plusInfo:{},
  117. userInfo:{},
  118. tablist: [{
  119. name: '积分获取'
  120. }, {
  121. name: '积分兑换'
  122. }],
  123. listForm:{
  124. pageIndex:1,
  125. pageSize:20,
  126. },
  127. recordsTotal:0,
  128. list:[],
  129. current: 0,
  130. top:null,
  131. showPointsRuleBl:false,
  132. }
  133. },
  134. onLoad() {
  135. this.plusInfo=this.carhelp.getPersonInfoPlus();
  136. this.userInfo=this.carhelp.getPersonInfo();
  137. this.getList()
  138. this.pointsNotes()
  139. },
  140. onReachBottom() {
  141. if (this.list.length < this.recordsTotal) {
  142. this.myLoadmore();
  143. }
  144. },
  145. methods: {
  146. showPointsRule(){
  147. this.showPointsRuleBl=true;
  148. },
  149. pointsNotes(){
  150. var year=new Date().getFullYear()
  151. API.myPointsSort({
  152. year:year,
  153. }).then((res) => {
  154. if(res.data.myPoint){
  155. this.top=res.data.myPoint
  156. this.top.rank=parseInt(res.data.myPoint.userSortNo)
  157. }
  158. uni.hideLoading();
  159. }).catch(error => {
  160. })
  161. },
  162. myLoadmore(){
  163. this.listForm.pageIndex += 1;
  164. this.getList();
  165. },
  166. change(index) {
  167. this.current = index;
  168. },
  169. getList(){
  170. uni.showLoading({
  171. title: "加载中",
  172. mask: true,
  173. })
  174. API.myPointsNotes(this.listForm).then((res) => {
  175. uni.hideLoading();
  176. this.list = [
  177. ...this.list,
  178. ...res.data.data
  179. ];
  180. this.recordsTotal = res.data.recordsTotal;
  181. }).catch(error => {
  182. uni.showToast({
  183. title: error,
  184. icon: "none"
  185. })
  186. })
  187. }
  188. }
  189. }
  190. </script>
  191. <style lang="scss" scoped>
  192. /deep/.u-slot-content {
  193. display: block;
  194. text-align: right !important;
  195. margin-right: 16px;
  196. color: rgba(31, 74, 153, 1);
  197. font-size: 16px;
  198. }
  199. .background{
  200. background: linear-gradient(180deg, rgba(18,114,238,1) 0%,rgba(244,244,246,1) 100%);
  201. padding: 32rpx;
  202. color: #fff;
  203. display: flex;
  204. justify-content: space-between;
  205. align-items: baseline;
  206. height: 231px;
  207. .points{
  208. display: flex;
  209. align-items: baseline;
  210. .number{
  211. font-size: 36px;
  212. font-family: 'Medium';
  213. }
  214. .unit{
  215. font-size: 16px;
  216. margin-left: 16rpx;
  217. font-family: 'Regular';
  218. }
  219. }
  220. .rank{
  221. display: flex;
  222. align-items: center;
  223. font-size: 32rpx;
  224. .img{
  225. width: 32rpx;
  226. height: 32rpx;
  227. img{
  228. width: 100%;
  229. height: 100%;
  230. }
  231. }
  232. .text{
  233. margin-left: 8rpx;
  234. margin-right: 4rpx;
  235. font-family: 'Regular';
  236. }
  237. }
  238. }
  239. .record{
  240. margin: -320rpx 32rpx 24rpx;
  241. background-color: #fff;
  242. border-radius: 8px 8px 0px 0px;
  243. min-height: 800rpx;
  244. .tabs{
  245. padding: 0 160rpx;
  246. height: 40px;
  247. border-bottom: 1px solid #E6E6E6;
  248. /deep/.u-tab-bar{
  249. background-color: #0076FF !important ;
  250. }
  251. }
  252. .get{
  253. .total{
  254. height: 44px;
  255. line-height: 44px;
  256. color: rgba(51, 51, 51, 1);
  257. font-size: 16px;
  258. border-bottom: 1px solid #E6E6E6;
  259. text-indent:32rpx;
  260. }
  261. .each{
  262. font-family: 'Regular';
  263. display: flex;
  264. justify-content: space-between;
  265. align-items: center;
  266. padding: 28rpx 0;
  267. margin: 0 32rpx;
  268. border-bottom: 1px solid #E6E6E6;
  269. .way-date{
  270. .way{
  271. color: rgba(51, 51, 51, 1);
  272. font-size: 16px;
  273. }
  274. .date{
  275. color: rgba(119, 119, 119, 1);
  276. margin-top: 16rpx;
  277. }
  278. }
  279. .number{
  280. color: rgba(31, 74, 153, 1);
  281. font-size: 24px;
  282. }
  283. }
  284. }
  285. .exchange{
  286. padding:0 32rpx 32rpx;
  287. .item{
  288. .month{
  289. height: 88rpx;
  290. line-height: 88rpx;
  291. color: #101010;
  292. }
  293. .details{
  294. display: flex;
  295. border-radius: 4px;
  296. background-color: rgba(242, 242, 242, 1);
  297. padding: 16rpx ;
  298. margin-bottom: 16rpx;
  299. .picture{
  300. width: 128rpx;
  301. height:128rpx;
  302. border-radius: 4px;
  303. background-color: rgba(255, 70, 41, 1);
  304. display: flex;
  305. align-items: center;
  306. justify-content: center;
  307. img{
  308. width: 88rpx;
  309. height: 88rpx;
  310. }
  311. }
  312. .infos{
  313. margin-left: 16rpx;
  314. .name{
  315. color: rgba(16, 16, 16, 1);
  316. font-size: 32rpx;
  317. }
  318. .price,.date{
  319. color: rgba(102, 102, 102, 1);
  320. line-height: 28rpx;
  321. margin-top: 14rpx;
  322. font-size: 28rpx
  323. }
  324. }
  325. }
  326. }
  327. }
  328. }
  329. </style>