votePopup.vue 3.6 KB

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