votePopup.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view>
  3. <u-popup v-model="show" mode="bottom" width="100%" height="750" border-radius="15" :closeable="true">
  4. <view class="padding-30">
  5. <view class="padding-top-20 text-bold text-xl">投票助力</view>
  6. <view class="padding-top-10 padding-bottom-10" style="color: #888888;font-size: 22rpx;" >
  7. 中国移动用户可使用移动积分兑换活力道具,兑换后可获得移动为你发起{{gitfs[selected].activeVote}}
  8. 人助力和{{vuex_active_setting.voteAndPointRate*gitfs[selected].activeVote}}个普法积分(可用于积分商城兑换商品),快为喜爱的作品加油助力吧
  9. </view>
  10. <scroll-view style="white-space: nowrap;" :scroll-x="true">
  11. <view v-for="(item,index) in gitfs" class="gift-item">
  12. <view @click.stop="selected = index;count = index" class="padding-20" :class="{'icon-box': true,'selected': index == selected}" >
  13. <image mode="aspectFit" class="gift-img" :src="item.imgUrl"></image>
  14. <view class="gift-name">{{item.name}}</view>
  15. </view>
  16. <view style="color: #999999;font-size: 20rpx;text-align: center;padding-top: 10rpx;">剩余免费次数</view>
  17. </view>
  18. </scroll-view>
  19. <view class="handle-bar">
  20. <view class="text-center padding-bottom-20" style="color: #0A9FEF;">您目前的移动积分</view>
  21. <view class="button-bar">
  22. <view class="button-r">
  23. <u-count-to v-if="show" color="#E72226" start-val="0" :end-val="gitfs[selected].point" :duration="500"></u-count-to>
  24. <span class="info">移动积分</span>
  25. </view>
  26. <view class="button-f">点击投票</view>
  27. </view>
  28. </view>
  29. </view>
  30. </u-popup>
  31. <point-auth ref="pointAuth"></point-auth>
  32. </view>
  33. </template>
  34. <script>
  35. import pointAuth from '../../components/alert/pointAuth.vue'
  36. export default {
  37. name:"votePopup",
  38. components:{ pointAuth },
  39. data() {
  40. return {
  41. show: false,
  42. selected: 0,
  43. count: 1000,
  44. gitfs: [],
  45. };
  46. },
  47. methods: {
  48. async showVote(){
  49. let params = {
  50. mobile: '13126058204'
  51. }
  52. const queryRes = (await this.$api.CMCC.queryCmccPoint(this.$u.queryParams(params)));
  53. if(queryRes.data.data.resultCode == '0001' ){
  54. this.$refs.pointAuth.showAuth(queryRes.data.data.data);
  55. return;
  56. }
  57. const res = await this.$api.activity.getGiftList({userId: 1,current: 1,size: 99});
  58. this.gitfs = res.data.data.records;
  59. this.show = true;
  60. },
  61. hideVote(){
  62. this.show = false;
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. .gift-item{
  69. width: 150rpx;
  70. height: 250rpx;
  71. margin: 12rpx;
  72. // box-shadow: 0rpx 2rpx 2rpx 2rpx #DDDDDD;
  73. // background: #007AFF;
  74. display: inline-block;
  75. .icon-box{
  76. width: 150rpx;
  77. height: 200rpx;
  78. border: 1rpx solid #DDDDDD;
  79. box-shadow: 3rpx 3rpx 4rpx rgba(26,26,26,0.2);
  80. border-radius: 10rpx;
  81. }
  82. .gift-img{
  83. width: 100rpx;
  84. height: 100rpx;
  85. border: 1rpx dashed #DDDDDD;
  86. padding: 10rpx;
  87. transition: border 0.5s;
  88. border: 0 solid transparent;
  89. }
  90. .selected{
  91. border: 2rpx solid #E72226;
  92. }
  93. .selected::before{
  94. content: "";
  95. position: absolute;
  96. margin-top: 147rpx;
  97. margin-left: 97rpx;
  98. border-radius: 5rpx 0 0 0 ;
  99. height: 30rpx;
  100. width: 30rpx;
  101. background: url(../../static/icon/selected.png) no-repeat center/22rpx red;
  102. }
  103. .gift-name{
  104. font-size:22rpx ;
  105. color: #353535;
  106. padding-top: 10rpx;
  107. }
  108. }
  109. .handle-bar{
  110. position: absolute;
  111. width: 100%;
  112. bottom: 0;
  113. left: 0;
  114. padding-bottom: 80rpx;
  115. .button-bar{
  116. width: 80%;
  117. height: 80rpx;
  118. border: 2rpx solid #E72226;
  119. margin: auto;
  120. border-radius: 100rpx;
  121. display: flex;
  122. .button-f{
  123. flex-basis: 50%;
  124. color: white;
  125. display: flex;
  126. font-size: 30rpx;
  127. justify-content: center;
  128. align-items: center;
  129. background: #E72226;
  130. border-radius: 0 100rpx 100rpx 0;
  131. }
  132. .button-r{
  133. color: #E82E3E;
  134. font-weight: 800;
  135. flex-basis: 50%;
  136. display: flex;
  137. font-size: 40rpx;
  138. justify-content: center;
  139. align-items: center;
  140. .info{
  141. color: #AAAAAA;
  142. font-weight: 500;
  143. margin-left: 15rpx;
  144. font-size: 22rpx;
  145. }
  146. }
  147. }
  148. }
  149. </style>