points.vue 7.9 KB

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