anniversary2024.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <view class="background">
  3. <ujp-navbar title="51充电联盟两周年庆典"
  4. bkUrl="/pages/index/index"
  5. ></ujp-navbar>
  6. <view class="backgroundHead" @click="scrollToBottom" >
  7. <img style="width: 100%;" src="@/assets/img/anniversary/两周年bg.jpg"></img>
  8. </view>
  9. <view class="btn">
  10. <view class="btnCard " :class="{
  11. btnCard1:key,
  12. btnCard2:!key
  13. }" >
  14. <view class="text1">
  15. <view class="text11">服务费免单卷</view>
  16. <view class="text12">有效期5月11日-17日,逾期作废</view>
  17. </view>
  18. <view class="text2" v-if="key" @click="exchangeBtn">
  19. 点击<br />
  20. 领取
  21. </view>
  22. <view class="text2" v-if="!key">
  23. 领取<br />
  24. 成功
  25. </view>
  26. </view>
  27. <view class="option">
  28. <u-button size="medium" type="error" @click="show=true">活动规则</u-button>
  29. <u-button size="medium" type="error">我的优惠券</u-button>
  30. </view>
  31. </view>
  32. <u-popup v-model="show" class="u-popup-class" border-radius="56" mode="center">
  33. <view class="popupMain">
  34. <view class="popup-content">
  35. <view class="p-head">活动规则</view>
  36. <view class="p-title">
  37. 活动对象:
  38. </view>
  39. <view class="p-value">
  40. 51充电联盟注册会员
  41. </view>
  42. <view class="p-title">
  43. 活动时间:
  44. </view>
  45. <view class="p-value">
  46. 2024年5月11日-17日
  47. </view>
  48. <view class="p-title">
  49. 活动范围:
  50. </view>
  51. <view class="p-value">
  52. 所有 51 充电联盟及优电联盟充电站
  53. </view>
  54. <view class="p-title">
  55. 活动内容:
  56. </view>
  57. <view class="p-value">
  58. 51充电联盟二周年之际,完成品牌升级并更名为“优电联盟”,“优电联盟”将一贯秉承“共建、共享、共赢”理念,为用户提供更优充电服务。
  59. 平台会员可领取一张“<span style="font-weight: bold;">服务费免单券</span>”,每个账号可领取一次,该券有效期为 5 月 11 日-17 日,共 7
  60. 天,超过有效期无法使用。
  61. </view>
  62. <view class="p-btn-view">
  63. <view class="p-btn" @click="show=false">知道了</view>
  64. </view>
  65. </view>
  66. </view>
  67. </u-popup>
  68. </view>
  69. </template>
  70. <script>
  71. import * as userApi from '@/apis/user.js'
  72. export default {
  73. data() {
  74. return {
  75. show: false,
  76. couponList:[],
  77. key:"",
  78. }
  79. },
  80. onReady() {
  81. this.getf5surprised()
  82. },
  83. methods: {
  84. scrollToBottom() {
  85. // 使用uni.pageScrollTo方法滚动到指定位置
  86. uni.pageScrollTo({
  87. scrollTop: 99999, // 设置一个足够大的值,确保滚动到最底部
  88. duration: 300 // 滚动动画时长,单位ms
  89. });
  90. } ,
  91. exchangeBtn(){
  92. if(!this.key){
  93. return
  94. }
  95. uni.showLoading({
  96. title: "加载中",
  97. mask: true,
  98. })
  99. userApi.exchange({
  100. key: this.key
  101. }).then((res) => {
  102. uni.hideLoading();
  103. this.getf5surprised()
  104. uni.showModal({
  105. showCancel:false,
  106. title:"提示",
  107. content:"领取成功"
  108. })
  109. }).catch(error => {
  110. //this.showNt = false;
  111. uni.showToast({
  112. title: error,
  113. icon: "none"
  114. })
  115. })
  116. },
  117. getf5surprised() {
  118. uni.showLoading({
  119. title: "加载中",
  120. mask: true,
  121. })
  122. userApi.exchangeGroupDetail2("周年红包").then((res) => {
  123. uni.hideLoading();
  124. var data=res.data;
  125. this.key=""
  126. this.couponList=[]
  127. if(data.length){
  128. this.couponList = res.data[0].couponList;
  129. if(this.couponList&&this.couponList.length){
  130. this.key=res.data[0].key;
  131. }
  132. }
  133. }).catch(error => {
  134. uni.showToast({
  135. title: error,
  136. icon: "none"
  137. })
  138. })
  139. },
  140. }
  141. }
  142. </script>
  143. <style lang="scss" scoped>
  144. page {
  145. background-color: #eabe9a;
  146. }
  147. .btn {
  148. padding: 40rpx;
  149. top: -40rpx;
  150. background-color: #eabe9a;
  151. position: relative;
  152. border-radius: 10px 10px 0px 0px;
  153. }
  154. .btnCard {
  155. //padding: 40rpx;
  156. background-size: 100% 100%;
  157. display: flex;
  158. justify-content: space-between;
  159. .text1 {
  160. padding: 40rpx;
  161. width: 484rpx;
  162. color: #7D2B00;
  163. .text11 {
  164. font-size: 40rpx;
  165. font-weight: bold;
  166. }
  167. .text12 {
  168. font-size: 28rpx;
  169. }
  170. }
  171. .text2 {
  172. font-size: 36rpx;
  173. color: rgba(255, 255, 255, 1);
  174. padding: 40rpx;
  175. display: flex;
  176. width: 188rpx;
  177. align-items: center;
  178. justify-content: center;
  179. }
  180. }
  181. .btnCard1 {
  182. background-image: url("@/assets/img/anniversary/ticket_1.png");
  183. }
  184. .btnCard2 {
  185. background-image: url("@/assets/img/anniversary/ticket_2.png");
  186. }
  187. .option {
  188. display: flex;
  189. margin-top: 40rpx;
  190. margin-bottom: 60rpx;
  191. justify-content: space-between;
  192. /deep/.u-btn {
  193. width: 320rpx;
  194. margin: 0;
  195. border-color: #FE280F;
  196. background-color: #FE280F;
  197. }
  198. }
  199. .u-popup-class {
  200. margin: 40rpx;
  201. }
  202. /deep/.uni-scroll-view {
  203. border-radius: 40rpx;
  204. }
  205. /deep/.u-mode-center-box {
  206. background: linear-gradient(180deg, rgba(255, 179, 147, 1) 0%, rgba(246, 234, 214, 1) 100%);
  207. padding: 20rpx;
  208. }
  209. .popupMain {
  210. .popup-content {
  211. padding: 20rpx;
  212. border-radius: 20px;
  213. background-color: rgba(255, 255, 255, 1);
  214. .p-head {
  215. text-align: center;
  216. color: rgba(100, 58, 28, 1);
  217. font-size: 56rpx;
  218. font-weight: bold;
  219. margin: 16rpx;
  220. }
  221. .p-title {
  222. font-weight: bold;
  223. font-size: 32rpx;
  224. margin-bottom: 12rpx;
  225. }
  226. .p-value {
  227. font-size: 28rpx;
  228. margin-bottom: 36rpx;
  229. }
  230. .p-btn-view {
  231. .p-btn {
  232. background: linear-gradient(180deg, rgba(253, 133, 93, 1) 0%, rgba(230, 68, 53, 1) 100%);
  233. color: rgba(255, 255, 255, 1);
  234. font-size: 40rpx;
  235. width: 460rpx;
  236. border-radius: 50px;
  237. padding: 20rpx;
  238. text-align: center;
  239. margin: auto;
  240. }
  241. }
  242. }
  243. }
  244. </style>