anniversary2024.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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" @click="exchangeBtn2">
  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" @click="gotoUrl('pages/user/coupon/myCoupon')" >我的优惠券</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. 优电联盟会员
  41. </view>
  42. <view class="p-title">
  43. 活动时间:
  44. </view>
  45. <view class="p-value">
  46. 2024年5月11日00:00至17日23:59(以订单开始充电时间为准)
  47. </view>
  48. <view class="p-title">
  49. 活动范围:
  50. </view>
  51. <view class="p-value">
  52. 所有优电联盟充电站
  53. </view>
  54. <view class="p-title">
  55. 活动内容:
  56. </view>
  57. <view class="p-value">
  58. 51充电联盟二周年之际,完成品牌升级并更名为“优电联盟”,“优电联盟”将一贯秉承“共建、共享、共赢”理念,为用户提供更优充电服务。
  59. <br/>优电联盟会员可领取一张“<span style="font-weight: bold;">服务费免单券</span>”,充电时使用本券可免单次充电服务费,每个账号可领取一次,该券使用有效期为5月11日-17日,共7天,超过有效期无法使用。
  60. <br/>为方便用户使用“服务费免单券”,快捷充电功能将暂停,活动结束后快捷充电功能将恢复。
  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. exchangeBtn2(){
  92. uni.showModal({
  93. title:"提示",
  94. content:"返回首页?",
  95. success: res1 => {
  96. if (res1.confirm) {
  97. uni.redirectTo({
  98. url: '/pages/index/index'
  99. })
  100. } else if (res1.cancel) {
  101. //('用户点击取消');
  102. }
  103. }
  104. })
  105. },
  106. exchangeBtn(){
  107. var user=this.carhelp.getPersonInfo()
  108. if(user.userType==1){
  109. uni.showModal({
  110. title:"提示",
  111. content:"游客无法兑换,是否前往注册?",
  112. confirmText:"前往注册",
  113. success: res1 => {
  114. if (res1.confirm) {
  115. uni.redirectTo({
  116. url: '/pages/login/login'
  117. })
  118. } else if (res1.cancel) {
  119. //('用户点击取消');
  120. }
  121. }
  122. })
  123. }else{
  124. if(!this.key){
  125. return
  126. }
  127. uni.showLoading({
  128. title: "加载中",
  129. mask: true,
  130. })
  131. userApi.exchange({
  132. key: this.key
  133. }).then((res) => {
  134. uni.hideLoading();
  135. this.getf5surprised()
  136. uni.showModal({
  137. title:"提示",
  138. content:"领取成功",
  139. confirmText:"返回首页",
  140. success: res1 => {
  141. if (res1.confirm) {
  142. uni.redirectTo({
  143. url: '/pages/index/index'
  144. })
  145. } else if (res1.cancel) {
  146. //('用户点击取消');
  147. }
  148. }
  149. })
  150. }).catch(error => {
  151. //this.showNt = false;
  152. uni.showToast({
  153. title: error,
  154. icon: "none"
  155. })
  156. })
  157. }
  158. },
  159. getf5surprised() {
  160. uni.showLoading({
  161. title: "加载中",
  162. mask: true,
  163. })
  164. userApi.exchangeGroupDetail2("周年红包").then((res) => {
  165. uni.hideLoading();
  166. var data=res.data;
  167. this.key=""
  168. this.couponList=[]
  169. if(data.length){
  170. this.couponList = res.data[0].couponList;
  171. if(this.couponList&&this.couponList.length){
  172. this.key=res.data[0].key;
  173. }
  174. }
  175. }).catch(error => {
  176. uni.showToast({
  177. title: error,
  178. icon: "none"
  179. })
  180. })
  181. },
  182. }
  183. }
  184. </script>
  185. <style lang="scss" scoped>
  186. page {
  187. background-color: #eabe9a;
  188. }
  189. .btn {
  190. padding: 40rpx;
  191. top: -40rpx;
  192. background-color: #eabe9a;
  193. position: relative;
  194. border-radius: 10px 10px 0px 0px;
  195. }
  196. .btnCard {
  197. //padding: 40rpx;
  198. background-size: 100% 100%;
  199. display: flex;
  200. justify-content: space-between;
  201. .text1 {
  202. padding: 40rpx;
  203. width: 484rpx;
  204. color: #7D2B00;
  205. .text11 {
  206. font-size: 40rpx;
  207. font-weight: bold;
  208. }
  209. .text12 {
  210. font-size: 28rpx;
  211. }
  212. }
  213. .text2 {
  214. font-size: 36rpx;
  215. color: rgba(255, 255, 255, 1);
  216. padding: 40rpx;
  217. display: flex;
  218. width: 188rpx;
  219. align-items: center;
  220. justify-content: center;
  221. }
  222. }
  223. .btnCard1 {
  224. background-image: url("@/assets/img/anniversary/ticket_1.png");
  225. }
  226. .btnCard2 {
  227. background-image: url("@/assets/img/anniversary/ticket_2.png");
  228. }
  229. .option {
  230. display: flex;
  231. margin-top: 40rpx;
  232. margin-bottom: 60rpx;
  233. justify-content: space-between;
  234. /deep/.u-btn {
  235. width: 320rpx;
  236. margin: 0;
  237. border-color: #FE280F;
  238. background-color: #FE280F;
  239. }
  240. }
  241. .u-popup-class {
  242. margin: 40rpx;
  243. }
  244. /deep/.uni-scroll-view {
  245. border-radius: 40rpx;
  246. }
  247. /deep/.u-mode-center-box {
  248. background: linear-gradient(180deg, rgba(255, 179, 147, 1) 0%, rgba(246, 234, 214, 1) 100%);
  249. padding: 20rpx;
  250. }
  251. .popupMain {
  252. .popup-content {
  253. padding: 20rpx;
  254. border-radius: 20px;
  255. background-color: rgba(255, 255, 255, 1);
  256. .p-head {
  257. text-align: center;
  258. color: rgba(100, 58, 28, 1);
  259. font-size: 56rpx;
  260. font-weight: bold;
  261. margin: 16rpx;
  262. }
  263. .p-title {
  264. font-weight: bold;
  265. font-size: 32rpx;
  266. margin-bottom: 12rpx;
  267. }
  268. .p-value {
  269. font-size: 28rpx;
  270. margin-bottom: 28rpx;
  271. }
  272. .p-btn-view {
  273. .p-btn {
  274. background: linear-gradient(180deg, rgba(253, 133, 93, 1) 0%, rgba(230, 68, 53, 1) 100%);
  275. color: rgba(255, 255, 255, 1);
  276. font-size: 40rpx;
  277. width: 460rpx;
  278. border-radius: 50px;
  279. padding: 20rpx;
  280. text-align: center;
  281. margin: auto;
  282. }
  283. }
  284. }
  285. }
  286. </style>