anniversary2024.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. <template>
  2. <view class="background">
  3. <ujp-navbar title="优电联盟全新上线" bkUrl="/pages/index/index"></ujp-navbar>
  4. <view class="backgroundHead" @click="scrollToBottom">
  5. <img style="width: 100%;" src="@/assets/img/anniversary/两周年bg.jpg"></img>
  6. </view>
  7. <view class="btn">
  8. <view class="btnCard " :class="{
  9. btnCard1:key,
  10. btnCard2:!key
  11. }">
  12. <view class="text1">
  13. <view class="text11">服务费免单卷</view>
  14. <view class="text12">有效期{{str}},逾期作废,已使用过免单卷的无法再次领取</view>
  15. </view>
  16. <view class="text2" v-if="key" @click="exchangeBtn">
  17. 点击<br />
  18. 领取
  19. </view>
  20. <view class="text2" v-if="!key" @click="exchangeBtn2">
  21. 领取<br />
  22. 成功
  23. </view>
  24. </view>
  25. <view class="option">
  26. <u-button size="medium" type="error" @click="show=true">活动规则</u-button>
  27. <u-button size="medium" type="error" @click="gotoUrl('pages/user/coupon/myCoupon')">我的优惠券</u-button>
  28. </view>
  29. </view>
  30. <u-popup v-model="show" class="u-popup-class" border-radius="56" mode="center">
  31. <view class="popupMain">
  32. <view class="popup-content">
  33. <view class="p-head">活动规则</view>
  34. <view class="p-title">
  35. 活动对象:
  36. </view>
  37. <view class="p-value">
  38. 优电联盟会员
  39. </view>
  40. <view class="p-title">
  41. 活动时间:
  42. </view>
  43. <view class="p-value">
  44. {{str}}(以订单开始充电时间为准)
  45. </view>
  46. <view class="p-title">
  47. 活动范围:
  48. </view>
  49. <view class="p-value">
  50. 所有优电联盟充电站
  51. </view>
  52. <view class="p-title">
  53. 活动内容:
  54. </view>
  55. <view class="p-value">
  56. 51充电联盟二周年之际,完成品牌升级并更名为“优电联盟”,“优电联盟”将一贯秉承“共建、共享、共赢”理念,为用户提供更优充电服务。
  57. <br />优电联盟会员可领取一张“<span
  58. style="font-weight: bold;">服务费免单券</span>”,充电时使用本券可免单次充电服务费,每个账号可领取一次,该券使用有效期为{{str}},共7天,超过有效期无法使用。
  59. <br /><br />1.已使用过免单卷的无法再次领取
  60. <br />2.为方便用户使用“服务费免单券”,快捷充电功能将暂停,活动结束后快捷充电功能将恢复。
  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. <u-popup v-model="show2" class="u-popup-class" border-radius="56" mode="center">
  69. <view class="popupMain">
  70. <view class="popup-content" style="
  71. text-align: center; padding: 60rpx;
  72. ">
  73. <view class="p-title">
  74. <img style="height: 256rpx;width: 256rpx;" src="@/assets/img/anniversary/lq2.png">
  75. </view>
  76. <view class="p-title" style="color: rgba(100, 58, 28, 1);
  77. font-size: 48rpx;">
  78. 提示
  79. </view>
  80. <view class="p-value" style="color: rgba(100, 58, 28, 1);
  81. font-size: 32rpx;">
  82. 已使用过免单卷的无法再次领取
  83. </view>
  84. <view class="p-btn-view">
  85. <view class="p-btn" @click="show2=false">知道了</view>
  86. </view>
  87. </view>
  88. </view>
  89. </u-popup>
  90. <u-popup v-model="show3" class="u-popup-class popupMain2" border-radius="56" mode="center">
  91. <view class="popupMain ">
  92. <view class="popupMain-main ">
  93. <view class="popup-content" style=" text-align: center; padding: 60rpx;">
  94. <view class="p-title">
  95. <img style="height: 256rpx;width: 256rpx;" src="@/assets/img/anniversary/lq1.png">
  96. </view>
  97. <view class="p-title" style="color: rgba(100, 58, 28, 1);
  98. font-size: 48rpx;">
  99. 领取成功
  100. </view>
  101. <view class="p-value">
  102. </view>
  103. <view class="p-btn-view">
  104. <view class="p-btn" @click="redirectToInfo('/pages/index/index')">去充电</view>
  105. </view>
  106. </view>
  107. </view>
  108. <u-image width="36px" style="margin: auto;margin-top: 10rpx;" mode="widthFix" @click="show3=false"
  109. src="../../assets/img/if-close-line-circled.png"></u-image>
  110. </view>
  111. </u-popup>
  112. <u-popup v-model="show4" class="u-popup-class popupMain2" border-radius="56" mode="center">
  113. <view class="popupMain ">
  114. <view class="popupMain-main ">
  115. <view class="popup-content" style="
  116. text-align: center; padding: 60rpx;
  117. ">
  118. <view class="p-title">
  119. <img style="height: 256rpx;width: 256rpx;" src="@/assets/img/anniversary/lq1.png">
  120. </view>
  121. <view class="p-title" style="color: rgba(100, 58, 28, 1);font-size: 48rpx;">
  122. </view>
  123. <view class="p-value" style="color: rgba(100, 58, 28, 1);
  124. font-size: 32rpx;">
  125. 有效期{{str}},逾期作废,已使用过免单卷的无法再次领取
  126. </view>
  127. <view class="p-btn-view">
  128. <view class="p-btn" @click="redirectToInfo('/pages/index/index')">返回首页</view>
  129. </view>
  130. </view>
  131. </view>
  132. <u-image width="36px" style="margin: auto;margin-top: 10rpx;" mode="widthFix" @click="show4=false"
  133. src="../../assets/img/if-close-line-circled.png"></u-image>
  134. </view>
  135. </u-popup>
  136. <u-popup v-model="show5" class="u-popup-class popupMain2" border-radius="56" mode="center">
  137. <view class="popupMain ">
  138. <view class="popupMain-main ">
  139. <view class="popup-content" style="
  140. text-align: center; padding: 60rpx;
  141. ">
  142. <view class="p-title">
  143. <img style="height: 256rpx;width: 256rpx;" src="@/assets/img/anniversary/lq2.png">
  144. </view>
  145. <view class="p-title" style="color: rgba(100, 58, 28, 1);font-size: 48rpx;">
  146. 游客无法兑换,是否前往注册?
  147. </view>
  148. <view class="p-value">
  149. </view>
  150. <view class="p-btn-view">
  151. <view class="p-btn" @click="redirectToInfo('/pages/login/login')">前往注册</view>
  152. </view>
  153. </view>
  154. </view>
  155. <u-image width="36px" style="margin: auto;margin-top: 10rpx;" mode="widthFix" @click="show5=false"
  156. src="../../assets/img/if-close-line-circled.png"></u-image>
  157. </view>
  158. </u-popup>
  159. <view class="slogan-4">
  160. 活动时间 : {{str}}
  161. </view>
  162. </view>
  163. </template>
  164. <script>
  165. import * as userApi from '@/apis/user.js'
  166. import {
  167. checkPhone,newDate
  168. } from '@/utils'
  169. export default {
  170. data() {
  171. return {
  172. one: true,
  173. show: false, //活动规则
  174. show2: false, //已使用
  175. show3: false, //领取成功
  176. show4: false, //已领取
  177. show5: false, //游客
  178. str:"",
  179. couponList: [],
  180. key: "",
  181. }
  182. },
  183. onReady() {
  184. //this.str="5月18日12:00至25日12:00"
  185. this.str="5月25日12:00至6月1日12:00"
  186. //this.str2="2024年5月18日12:00至25日12:00"
  187. var time1=newDate("2024-06-01 12:00:00")
  188. var time3=new Date()
  189. if(time3>time1){
  190. this.str="至6月1日12:00-8日12:00"
  191. }
  192. this.getf5surprised()
  193. },
  194. methods: {
  195. scrollToBottom() {
  196. // 使用uni.pageScrollTo方法滚动到指定位置
  197. uni.pageScrollTo({
  198. scrollTop: 99999, // 设置一个足够大的值,确保滚动到最底部
  199. duration: 300 // 滚动动画时长,单位ms
  200. });
  201. },
  202. exchangeBtn2() {
  203. this.show4 = true
  204. },
  205. exchangeBtn() {
  206. var user = this.carhelp.getPersonInfo()
  207. if (user.userType == 1) {
  208. this.show5 = true
  209. } else {
  210. if (!this.key) {
  211. return
  212. }
  213. uni.showLoading({
  214. title: "加载中",
  215. mask: true,
  216. })
  217. userApi.exchangeByGroupFive({
  218. key: this.key
  219. }).then((res) => {
  220. uni.hideLoading();
  221. this.getf5surprised()
  222. this.show3 = true;
  223. }).catch(error => {
  224. //this.showNt = false;
  225. uni.showToast({
  226. title: error,
  227. icon: "none"
  228. })
  229. })
  230. }
  231. },
  232. redirectToInfo(url) {
  233. uni.redirectTo({
  234. url: url
  235. })
  236. },
  237. getf5surprised() {
  238. uni.showLoading({
  239. title: "加载中",
  240. mask: true,
  241. })
  242. userApi.exchangeGroupDetail2("周年红包").then((res) => {
  243. uni.hideLoading();
  244. var data = res.data;
  245. this.key = ""
  246. this.couponList = []
  247. if (data.length) {
  248. this.couponList = res.data[0].couponList;
  249. if (this.couponList && this.couponList.length) {
  250. this.key = res.data[0].key;
  251. }
  252. }
  253. if (res.message == "已使用") {
  254. this.show2 = true
  255. }
  256. }).catch(error => {
  257. uni.showToast({
  258. title: error,
  259. icon: "none"
  260. })
  261. })
  262. },
  263. }
  264. }
  265. </script>
  266. <style lang="scss" scoped>
  267. page {
  268. background-color: #eabe9a;
  269. }
  270. .btn {
  271. padding: 40rpx;
  272. top: -40rpx;
  273. background-color: #eabe9a;
  274. position: relative;
  275. border-radius: 10px 10px 0px 0px;
  276. }
  277. .btnCard {
  278. //padding: 40rpx;
  279. background-size: 100% 100%;
  280. display: flex;
  281. justify-content: space-between;
  282. .text1 {
  283. padding: 40rpx;
  284. width: 484rpx;
  285. color: #7D2B00;
  286. .text11 {
  287. font-size: 40rpx;
  288. font-weight: bold;
  289. }
  290. .text12 {
  291. font-size: 28rpx;
  292. }
  293. }
  294. .text2 {
  295. font-size: 36rpx;
  296. color: rgba(255, 255, 255, 1);
  297. padding: 40rpx;
  298. display: flex;
  299. width: 188rpx;
  300. align-items: center;
  301. justify-content: center;
  302. }
  303. }
  304. .btnCard1 {
  305. background-image: url("@/assets/img/anniversary/ticket_1.png");
  306. }
  307. .btnCard2 {
  308. background-image: url("@/assets/img/anniversary/ticket_2.png");
  309. }
  310. .option {
  311. display: flex;
  312. margin-top: 40rpx;
  313. margin-bottom: 60rpx;
  314. justify-content: space-between;
  315. ::v-deep .u-btn {
  316. width: 320rpx;
  317. margin: 0;
  318. border-color: #FE280F;
  319. background-color: #FE280F;
  320. }
  321. }
  322. .u-popup-class {
  323. margin: 40rpx;
  324. }
  325. ::v-deep .uni-scroll-view {
  326. border-radius: 40rpx;
  327. }
  328. ::v-deep .u-mode-center-box {
  329. background: linear-gradient(180deg, rgba(255, 179, 147, 1) 0%, rgba(246, 234, 214, 1) 100%);
  330. padding: 20rpx;
  331. }
  332. .popupMain2 {
  333. ::v-deep .u-mode-center-box {
  334. background: none !important;
  335. ;
  336. //padding: 20rpx;
  337. }
  338. .popupMain-main {
  339. padding: 20rpx;
  340. border-radius: 20px;
  341. background: linear-gradient(180deg, rgba(255, 179, 147, 1) 0%, rgba(246, 234, 214, 1) 100%);
  342. }
  343. }
  344. .popupMain {
  345. .popup-content {
  346. padding: 20rpx;
  347. border-radius: 20px;
  348. background-color: rgba(255, 255, 255, 1);
  349. .p-head {
  350. text-align: center;
  351. color: rgba(100, 58, 28, 1);
  352. font-size: 56rpx;
  353. font-weight: bold;
  354. margin: 16rpx;
  355. }
  356. .p-title {
  357. font-weight: bold;
  358. font-size: 32rpx;
  359. margin-bottom: 12rpx;
  360. }
  361. .p-value {
  362. font-size: 28rpx;
  363. margin-bottom: 28rpx;
  364. }
  365. .p-btn-view {
  366. .p-btn {
  367. background: linear-gradient(180deg, rgba(253, 133, 93, 1) 0%, rgba(230, 68, 53, 1) 100%);
  368. color: rgba(255, 255, 255, 1);
  369. font-size: 40rpx;
  370. width: 460rpx;
  371. border-radius: 50px;
  372. padding: 20rpx;
  373. text-align: center;
  374. margin: auto;
  375. }
  376. }
  377. }
  378. }
  379. .slogan-4 {
  380. position: relative;
  381. top: -1260rpx;
  382. width: 600rpx;
  383. text-align: center;
  384. margin: auto;
  385. border: 1px solid rgba(255, 255, 255, 0.5);
  386. font-size: 24rpx;
  387. padding: 12rpx;
  388. background-color: rgba(255, 255, 255, 0.21);
  389. border-radius: 50px;
  390. color: #fff;
  391. }
  392. </style>