index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839
  1. <template>
  2. <div class="lottery-container">
  3. <van-swipe v-if="carousel.length" :autoplay="3000" class="lottery-swipe" vertical :show-indicators="false">
  4. <van-swipe-item v-for="item in carousel" :key="item.mealId">有{{item.count}}个用户 {{['', '抽奖', '购买'][item.type]}}{{item.title}}</van-swipe-item>
  5. </van-swipe>
  6. <img class="w51h26" src="~/assets/image/activity/lottery/rule.png" alt="" @click="showRule=true;makePoint('activity_购买协议')">
  7. <div class="roulette">
  8. <div class="arrow" @click="startRotation"></div>
  9. <img class="start-btn" src="~/assets/image/activity/lottery/start-btn.png" alt="" @click="startRotation">
  10. </div>
  11. <RoundTurntable ref="roundTurntable" :prize-data="prizeData" :rotate-circle="rotateCircle" :during-time="duringTime" :turntable-style-option="turntableStyleOption" class="turntable" @endRotation="endRotation">
  12. <template slot="item" slot-scope="scope">
  13. <div class="turntable-name"><span class="fs15">¥</span>{{ scope.item.level }}</div>
  14. <div class="turntable-img">
  15. <img src="~/assets/image/activity/lottery/yearCard.png" />
  16. </div>
  17. </template>
  18. </RoundTurntable>
  19. <div class="num">剩余机会{{num}}次</div>
  20. <van-popup v-model="showPay" closeable close-icon-position="top-right" round :close-on-click-overlay="false" @closed="closed">
  21. <div class="popup-view">
  22. <div class="txt1">恭喜你获得{{actualPrice}}年卡</div>
  23. <div :class="selMealId===mealId ? 'coupon-1 active' : 'coupon-1'" @click="selMealId=mealId">
  24. <img v-if="selMealId===mealId" class="coupon-select-icon" src="~/assets/image/activity/lottery/select-icon.png" alt="">
  25. <img v-else class="coupon-select-icon" src="~/assets/image/activity/lottery/unselect-icon.png" alt="">
  26. <div class="coupon-title"><span class="txt2">{{actualPrice}}</span><span>年卡会员</span></div>
  27. <div class="txt4">12个月 30H/月 不使用不计时</div>
  28. <img class="w253h73" src="~/assets/image/activity/lottery/coupon-1.png" alt="">
  29. </div>
  30. <div class="fb">
  31. <div v-for="item in mealList" :key="item.id" :class="selMealId===item.id ? 'coupon-2 active' : 'coupon-2'" @click="selMealId=item.id;makePoint(item.day === 30 ? 'activity_38月卡' : 'activity_268年卡')">
  32. <img v-if="selMealId===item.id" class="coupon-select-icon" src="~/assets/image/activity/lottery/select-icon.png" alt="">
  33. <img v-else class="coupon-select-icon" src="~/assets/image/activity/lottery/unselect-icon.png" alt="">
  34. <div class="coupon-title"><span class="txt2">{{item.originalPrice ? item.originalPrice : item.actualPrice}}</span><span>元</span></div>
  35. <div class="txt4">{{item.day === 30 ? '月卡' : '年卡'}}</div>
  36. <img class="w111h73" src="~/assets/image/activity/lottery/coupon-2.png" alt="">
  37. </div>
  38. </div>
  39. <div v-for="item in paySupportType" :key="item" class="fnbc" @click="payType = item;makePoint(item === 'aliPay' ? 'activity_支付宝' : 'activity_微信')">
  40. <div v-if="item === 'aliPay'" class="fnc">
  41. <van-icon class="icon-pay" :name="require('~/assets/image/activity/lottery/alipay.png')" />
  42. <span class="txt5">支付宝支付</span>
  43. </div>
  44. <div v-else class="fnc">
  45. <van-icon class="icon-pay" :name="require('~/assets/image/activity/lottery/wx.png')" />
  46. <span class="txt5">微信支付</span>
  47. </div>
  48. <van-icon :name="payType === item ? require('~/assets/image/activity/lottery/select-round-icon.png') : require('~/assets/image/activity/lottery/unselect-round-icon.png')" size="24" />
  49. </div>
  50. <img class="w304h62" src="~/assets/image/activity/lottery/pay-btn.png" alt="" @click="createOrder">
  51. <div class="txt6">开通前阅读并同意<a @click="showRule=true;makePoint('activity_购买协议')">购买协议</a></div>
  52. </div>
  53. </van-popup>
  54. <van-popup v-model="show" closeable close-icon-position="top-right" round @closed="makePoint('activity_关闭弹窗')">
  55. <div class="popup-view popup-view-leave">
  56. <div class="txt1">确定离开吗</div>
  57. <div class="txt6">离开后您将失去{{actualPrice}}年卡,24小时付款有效</div>
  58. <div :class="selMealId===mealId ? 'coupon-1 active' : 'coupon-1'" @click="selMealId=mealId">
  59. <img v-if="selMealId===mealId" class="coupon-select-icon" src="~/assets/image/activity/lottery/select-icon.png" alt="">
  60. <img v-else class="coupon-select-icon" src="~/assets/image/activity/lottery/unselect-icon.png" alt="">
  61. <div class="coupon-title"><span class="txt2">{{actualPrice}}</span><span>年卡会员</span></div>
  62. <div class="txt4">12个月 30H/月 不使用不计时</div>
  63. <img class="w253h73" src="~/assets/image/activity/lottery/coupon-1.png" alt="">
  64. </div>
  65. <div class="fb">
  66. <div v-for="item in mealList" :key="item.id" :class="selMealId===item.id ? 'coupon-2 active' : 'coupon-2'" @click="selMealId=item.id;makePoint(item.day === 30 ? 'activity_38月卡' : 'activity_268年卡')">
  67. <img v-if="selMealId===item.id" class="coupon-select-icon" src="~/assets/image/activity/lottery/select-icon.png" alt="">
  68. <img v-else class="coupon-select-icon" src="~/assets/image/activity/lottery/unselect-icon.png" alt="">
  69. <div class="coupon-title"><span class="txt2">{{item.originalPrice ? item.originalPrice : item.actualPrice}}</span><span>元</span></div>
  70. <div class="txt4">{{item.day === 30 ? '月卡' : '年卡'}}</div>
  71. <img class="w111h73" src="~/assets/image/activity/lottery/coupon-2.png" alt="">
  72. </div>
  73. </div>
  74. <div v-for="item in paySupportType" :key="item" class="fnbc" @click="payType = item;makePoint(item === 'aliPay' ? 'activity_支付宝' : 'activity_微信')">
  75. <div v-if="item === 'aliPay'" class="fnc">
  76. <van-icon class="icon-pay" :name="require('~/assets/image/activity/lottery/alipay.png')" />
  77. <span class="txt5">支付宝支付</span>
  78. </div>
  79. <div v-else class="fnc">
  80. <van-icon class="icon-pay" :name="require('~/assets/image/activity/lottery/wx.png')" />
  81. <span class="txt5">微信支付</span>
  82. </div>
  83. <van-icon :name="payType === item ? require('~/assets/image/activity/lottery/select-round-icon.png') : require('~/assets/image/activity/lottery/unselect-round-icon.png')" size="24" />
  84. </div>
  85. <div class="fnbc">
  86. <div class="btn-leave" @click="show=false;makePoint('activity_狠心离开')">狠心离开</div>
  87. <div class="btn-pay" @click="createOrder">立即购买</div>
  88. </div>
  89. </div>
  90. </van-popup>
  91. <van-popup v-model="showRule" style="background: transparent;padding-top: 14px;">
  92. <div class="popup-view-rule">
  93. <div class="popup-view-rule-box">
  94. <div class="popup-view-rule-title">购买协议</div>
  95. <div class="h330">
  96. <div class="txt7"> 参与活动前,请仔细阅读购买协议,特别是产品说明和注意事项。用户参与本活动即视为已充分阅读、理解本活动规则,并自愿受活动规则约束。</div>
  97. <div class="txt8 mt14 fw500">年卡特惠包 </div>
  98. <div class="txt9 mt5">每月自动续,时长不用愁</div>
  99. <div class="txt8 mt5 fw500">1年使用权 每月30小时</div>
  100. <div class="txt9 mt5">按实际使用计时,星曜机型可用,立即生效</div>
  101. <div class="txt9 mt14"><span class="txt7">有效时间:</span>按实际使用云手机的时间计时,不使用不计时;每月30H,当月时长不跨月;</div>
  102. <div class="txt9"><span class="txt7">可用范围:</span>星曜机型</div>
  103. <div class="txt9"><span class="txt7">生效方式:</span>立即生效</div>
  104. <div class="txt9"><span class="txt7">订购次数:</span>不可重复订购</div>
  105. <div class="txt9"><span class="txt7">退订说明:</span>特惠产品,不支持退订</div>
  106. <div class="txt9 mt14">产品说明:</div>
  107. <div class="txt7">1、产品内容:本产品为臂云科技旗下双子星云手机星曜机型新人特惠年包,包含星曜机型云手机1年使用权,连续12个月每月发放30H时长;进入云手机开始计时,下机后不计时。</div>
  108. <div class="txt7">2、生效时间:订购扣费后立即生效。</div>
  109. <div class="txt7">3、注意事项:</div>
  110. <div class="txt7">(1)本产品合约期12个月,自生效当月起每月发放30H时长;</div>
  111. <div class="txt7">(2)合约到期后需用户另外购买时长;</div>
  112. <div class="txt7">(3)合约到期后,年卡特惠包剩余时长自动失效;</div>
  113. <div class="txt7">(4)合约到期后,另外续费时长包所得的时长仍有效,云机可继续使用;</div>
  114. <div class="txt7">(5)年卡特惠包云手机与普通包月云手机计时逻辑不同,两种云手机时长不可叠加,若另外订购普通包月云手机将获得一台新云手机。</div>
  115. <div class="txt8 mt14">温馨提示:</div>
  116. <div class="txt7">1、请您理解:通过任何不正当手段参与活动,如借助非自然流量或外挂工具;利用技术漏洞,恶意退款,批量注册账号、买号等搅乱平台管理秩序的行为,臂云科技有权限制或取消用户的活动资格,不予发放或撤销相关交易及福利内容。</div>
  117. <div class="txt7">2、如有疑问请联系双子星APP客服咨询</div>
  118. <div class="txt8 mt5 fw500" style="color: #EC6250;">时长包使用规则</div>
  119. <div class="txt7 mt5">年卡特惠云手机,按需补充时长包</div>
  120. <div class="txt7">有效时间:<span class="txt10">时长用完前一直有效,支持跨月</span></div>
  121. <div class="txt7">可用范围:<span class="txt10">可续时长的机型</span></div>
  122. <div class="txt7">生效方式:<span class="txt10">立即生效</span></div>
  123. <div class="txt7">退订说明:<span class="txt10">立即生效产品,不支持退订</span></div>
  124. <div class="txt7 mt14">
  125. 产品说明<br />1、生效方式:时长补充包订购后立即生效,直至时长用完则失效,用户可重复订购。<br />
  126. 2、时长使用顺序:优先使用年卡特惠包时长,年卡特惠包时长耗尽,自动使用时长包时长。<br />3、年卡特惠包合约到期后,如时长补充包仍有时长,年卡特惠包所属云手机可继续使用至时长用尽。
  127. </div>
  128. </div>
  129. <img class="w304h62" src="~/assets/image/activity/lottery/buy-rule-icon.png" alt="" @click="showRule=false">
  130. </div>
  131. </div>
  132. </van-popup>
  133. </div>
  134. </template>
  135. <script>
  136. import { Toast } from 'vant'
  137. import RoundTurntable from './component/roundTurntable.vue'
  138. const RSA = require('../../../plugins/wx_rsa');
  139. const webUni = require('../../../plugins/uni');
  140. export default {
  141. name: 'Lottery',
  142. auth: false,
  143. components: {
  144. RoundTurntable
  145. },
  146. data() {
  147. return {
  148. showRule: false,
  149. show: false,
  150. showPay: false,
  151. // 转盘上的奖品数据
  152. prizeData: [
  153. {
  154. id: 6,
  155. level: 29.9
  156. },
  157. {
  158. id: 3,
  159. level: 58
  160. },
  161. {
  162. id: 2,
  163. level: 9.9
  164. },
  165. {
  166. id: 4,
  167. level: 39.9
  168. },
  169. {
  170. id: 5,
  171. level: 378
  172. },
  173. {
  174. id: 1,
  175. level: 15.9
  176. }
  177. ],
  178. // 转动的圈数
  179. rotateCircle: 6,
  180. // 转动需要持续的时间(s)
  181. duringTime: 4.5,
  182. // 转盘样式的选项
  183. turntableStyleOption: {
  184. // 背景色
  185. prizeBgColors: ['#FFF9F8', '#FFECC9', '#FFF9F8', '#FFECC9', '#FFF9F8', '#FFECC9'],
  186. // 转盘的外边框颜色
  187. borderColor: '#FFD790'
  188. },
  189. // 中奖的奖品的index
  190. prizeIndex: -1,
  191. // 用来锁定转盘,避免同时多次点击转动
  192. isLocking: false,
  193. // 剩余抽奖次数
  194. num: 2,
  195. token: '',
  196. activityId: '',
  197. actualPrice: 0,
  198. mealId: '',
  199. selMealId: '',
  200. paySupportType: [],
  201. title: '',
  202. payType: '',
  203. mealList: [],
  204. status: 0,
  205. carousel: [],
  206. phoneType: 'SVIP',
  207. client: 0
  208. }
  209. },
  210. async fetch() {
  211. if (this.$userAgent.isAndroid) {
  212. this.token = await window.native.getToken();
  213. } else {
  214. this.token = this.$route.query.token;
  215. }
  216. },
  217. head: {
  218. title: '年卡抽奖活动'
  219. },
  220. created() {
  221. if (this.$userAgent.isSzx && this.$userAgent.isAndroid) {
  222. this.client = 1
  223. } else if (this.$userAgent.isSzx && this.$userAgent.isIos) {
  224. this.client = 2
  225. } else if (this.$userAgent.isMiniProgram) {
  226. this.client = 5
  227. } else {
  228. this.client = 7
  229. }
  230. this.getLuckDrawActivity()
  231. this.getCarouselList()
  232. },
  233. methods: {
  234. async getCarouselList() {
  235. const res = await this.$axios.$post('/activity/v1/member/carousel');
  236. this.carousel = res.data;
  237. },
  238. async getMealInfo() {
  239. const res = await this.$axios.$get('/pay/v2/meal/info?phoneType=' + this.phoneType);
  240. this.mealList = res.data.list.filter(item => (item.day === 30 || item.day === 365) && item.id !== this.mealId)
  241. },
  242. async createOrder() {
  243. try {
  244. Toast.loading({
  245. duration: 0,
  246. forbidClick: true,
  247. });
  248. this.makePoint('activity_立即购买')
  249. let taocan = {
  250. buyType: 1,
  251. couponId: 0,
  252. id: this.selMealId,
  253. mealType: 0,
  254. phoneType: this.phoneType,
  255. quantity: 1,
  256. };
  257. taocan = this.sort_ASCII(taocan);
  258. const sign = this.jiaqian(JSON.stringify(taocan));
  259. const res = await this.$axios.$post('/pay/v1/order/create', taocan, { headers: { Authorization: this.token, sign } });
  260. Toast.clear();
  261. if (this.$userAgent.isSzx && this.$userAgent.isAndroid) {
  262. window.native.startPay(this.payType === 'aliPay' ? 3 : 2, res.data.myOrderNum, 1);
  263. } else if (this.$userAgent.isSzx && this.$userAgent.isIos) {
  264. window.webkit.messageHandlers.startPay.postMessage({
  265. payType: this.payType === 'aliPay' ? 3 : 2,
  266. orderNum: res.data.myOrderNum,
  267. actualPrice: this.actualPrice
  268. });
  269. } else if (this.$userAgent.isMiniProgram) {
  270. this.$wx.miniProgram.navigateTo({
  271. url: '/packageA/order/status/index?record=' + JSON.stringify({
  272. payActive: this.payType === 'wxPay' ? 1 : 0,
  273. myOrderNum: res.data.myOrderNum
  274. }),
  275. });
  276. } else {
  277. // 使用postMessage 方法可以发送消息到应用, 消息内容需要在data 对象中,否则webview无法接收到
  278. webUni.webView.postMessage({
  279. data: {
  280. payType: this.payType === 'aliPay' ? 3 : 2,
  281. orderNum: res.data.myOrderNum,
  282. buyType: 1,
  283. price: this.actualPrice
  284. }
  285. })
  286. }
  287. this.showPay = false
  288. } catch (error) {
  289. Toast.clear();
  290. Toast({
  291. message: error.message,
  292. position: 'top',
  293. duration: 4000
  294. });
  295. }
  296. },
  297. sort_ASCII(obj) {
  298. const arr = [];
  299. let num = 0;
  300. for (const i in obj) {
  301. arr[num] = i;
  302. num++;
  303. }
  304. const sortArr = arr.sort();
  305. const sortObj = {};
  306. for (const i in sortArr) {
  307. sortObj[sortArr[i]] = obj[sortArr[i]];
  308. }
  309. return sortObj;
  310. },
  311. jiaqian(content) {
  312. const PrivateKey =
  313. '-----BEGIN PRIVATE KEY-----MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKCIK/zTSJCP4XhNsb7Mc5lALog+oAja/spMjg8U6rAmVzRtKv8qhw1HK0CRbW/XV66uM+kY7fhjaYbjbbzu2PMMfs2GVpG15jCWLug9fn2hvPT1wkXfooJX61yHK7+inxAXPi4vPNi263mSQGbhZTeqbU5p7nLeRGbdFyBQXVKpAgMBAAECgYAu/475RxZAlI8rPHvkY1EYteypoMQTs6HSslUI31PSXHc9dxSWfenqHkLwdWM30jDuiDvUa6MIDHrRrfXr0XWcQ0IJ93jT7ABkFCdxcKEOG1WE8f1kZ5JyPDJjeQiI9R4jJCukpGU0DdzO7ORvRb4oTFQ15quM+3+SjnK5TtfUsQJBAOLLk03D2s7t2R0GPLZq+WL/ebowbRSy4VHP/IQi4K1bJrll0HLznov60m9UML1ATlS2ub98fBRFXEAaAwJE2O0CQQC1NDEWhrAPU5o3xjjcxIUbbYskskbhjaiX/1Vz0UzS4XfYek4SL68WBWPGWTrSbgbvXtaXj0gmcChF5jxOHtUtAkA4mPsqxfy99UdgYeUW1P1lgkH7gAhIyRdH1nK6+wU83el9DPaHKVrgrfiEBeuf3wNtSqhyK/u/B0wtRxCHKW1FAkAXfwcGdryJoDuVE9z3s3vXDKNIRN2wDaBY5UD9XZxqk9XoeiN5dDltz5EafSOFecLocxG8YVXntg9i0PHs506ZAkEAge9AKaXisZ4jCNHRn1LR2R82RtHTLb2mN3Cc6sGo+SnAKczwRwVg9RgnmaLG4Z/7kJpq0ALgEBlkOmy+9joxAw==-----END PRIVATE KEY-----';
  314. const signature = new RSA.KJUR.crypto.Signature({
  315. alg: 'SHA256withRSA',
  316. });
  317. signature.init(PrivateKey);
  318. signature.updateString(content);
  319. const signData = signature.sign();
  320. // 将内容转成base64
  321. return RSA.hex2b64(signData);
  322. },
  323. async getLuckDrawActivity() {
  324. const res = await this.$axios.$post('/activity/v1/member/luckDrawActivity');
  325. this.activityId = res.data.activityId
  326. this.status = res.data.status
  327. this.num = res.data.count
  328. if (this.num === 0) {
  329. this.getLuckDraw();
  330. }
  331. },
  332. // 开始抽奖
  333. startRotation() {
  334. // 如果还不可以转动
  335. if (!this.canBeRotated()) {
  336. return false;
  337. }
  338. this.makePoint('activity_立即抽奖')
  339. // 开始转动
  340. // 先上锁
  341. this.isLocking = true;
  342. this.getLuckDraw();
  343. // 成功后次数减少一次
  344. if (this.num > 1) {
  345. this.num--;
  346. }
  347. // 告诉子组件,开始转动了
  348. this.$refs.roundTurntable.rotate(this.prizeIndex);
  349. },
  350. async getLuckDraw() {
  351. // 设置在哪里停下,应该与后台交互,这里随机抽取0~5
  352. const res = await this.$axios.$post('/activity/v1/member/luckDraw?activityId=' + this.activityId, {}, { headers: { Authorization: this.token } });
  353. if (res.status === 0) {
  354. this.actualPrice = res.data.actualPrice
  355. if (res.data.luckDrawType === 1) {
  356. this.makePoint('activity_15.9年卡')
  357. if (Number(localStorage.getItem('year-15-9')) !== 2)
  358. localStorage.setItem('year-15-9', 1)
  359. }
  360. if (res.data.luckDrawType === 2) {
  361. if (Number(localStorage.getItem('year-9-9')) !== 2)
  362. this.makePoint('activity_9.9年卡')
  363. localStorage.setItem('year-9-9', 1)
  364. }
  365. this.mealId = res.data.mealId
  366. this.selMealId = res.data.mealId
  367. this.getMealInfo()
  368. this.paySupportType = res.data.paySupportType
  369. if (this.$userAgent.isMiniProgram) {
  370. this.paySupportType = ['wxPay']
  371. }
  372. this.payType = this.paySupportType[0]
  373. this.phoneType = res.data.phoneType
  374. this.title = res.data.title
  375. this.prizeIndex = res.data.luckDrawType;
  376. } else {
  377. Toast({
  378. message: res.msg,
  379. position: 'top',
  380. duration: 4000
  381. });
  382. }
  383. },
  384. makePoint(positionButton) {
  385. const now = new Date()
  386. this.$axios.$post('/public/v5/buriedPointRecord/reportRecords', [{ client: this.client, eventCode: '27_抽奖流程', userName: this.$auth.user.userName, positionButton, operationTime: now.toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') }])
  387. },
  388. // 已经转动完转盘触发的函数
  389. endRotation() {
  390. // 提示中奖
  391. this.showPay = true
  392. // 解锁
  393. this.isLocking = false;
  394. },
  395. // 判断是否可以转动
  396. canBeRotated() {
  397. if (this.isLocking) {
  398. return false;
  399. }
  400. if (this.status === 0) {
  401. Toast({
  402. message: '当前活动已过期',
  403. position: 'top',
  404. duration: 4000
  405. });
  406. return false;
  407. }
  408. if (this.status === 2) {
  409. Toast({
  410. message: '当前活动未开启',
  411. position: 'top',
  412. duration: 4000
  413. });
  414. return false;
  415. }
  416. if (this.status === 3) {
  417. Toast({
  418. message: '当前活动已结束',
  419. position: 'top',
  420. duration: 4000
  421. });
  422. return false;
  423. }
  424. if (this.num === 0) {
  425. this.showPay = true
  426. return false;
  427. }
  428. return true;
  429. },
  430. closed() {
  431. this.makePoint('activity_关闭抽奖', 'eventCode传27_抽奖流程')
  432. if (Number(localStorage.getItem('year-15-9')) !== 2) {
  433. this.show = true
  434. localStorage.setItem('year-15-9', 2)
  435. }
  436. if (Number(localStorage.getItem('year-9-9')) !== 2) {
  437. this.show = true
  438. localStorage.setItem('year-9-9', 2)
  439. }
  440. }
  441. }
  442. }
  443. </script>
  444. <style lang="scss" scoped>
  445. .fb {
  446. display: flex;
  447. justify-content: space-between;
  448. width: 286px;
  449. margin: 0 auto;
  450. }
  451. .fw500 {
  452. font-weight: 500;
  453. }
  454. .mt5 {
  455. margin-top: 5px;
  456. }
  457. .mt14 {
  458. margin-top: 14px;
  459. }
  460. .lottery-container {
  461. background-color: #bbe5f2;
  462. background-image: url('../../../assets/image/activity/lottery/bg.png');
  463. background-size: contain;
  464. min-height: 100vh;
  465. overflow: hidden;
  466. margin: 0 auto;
  467. }
  468. .lottery-swipe {
  469. width: 188px;
  470. height: 25px;
  471. background: rgba($color: #000000, $alpha: 0.24);
  472. border-radius: 0px 16px 16px 0px;
  473. position: absolute;
  474. top: 134px;
  475. left: 0;
  476. z-index: 1;
  477. }
  478. .lottery-swipe .van-swipe-item {
  479. color: #ffffff;
  480. font-size: 13px;
  481. line-height: 25px;
  482. text-align: center;
  483. }
  484. .w51h26 {
  485. width: 51px;
  486. height: 26px;
  487. position: absolute;
  488. top: 128px;
  489. right: 0;
  490. z-index: 2;
  491. }
  492. .roulette {
  493. width: 372px;
  494. height: 442px;
  495. background-image: url('../../../assets/image/activity/lottery/roulette.png');
  496. background-size: 100% 100%;
  497. margin: 127px auto 0;
  498. position: relative;
  499. }
  500. .arrow {
  501. width: 122px;
  502. height: 135px;
  503. position: absolute;
  504. top: 110px;
  505. left: 125px;
  506. background-image: url('../../../assets/image/activity/lottery/arrow.png');
  507. background-size: 100% 100%;
  508. z-index: 1;
  509. }
  510. .turntable {
  511. position: absolute;
  512. left: calc(50% - 144px);
  513. top: 163px;
  514. width: 288px;
  515. height: 288px;
  516. }
  517. .turntable-name {
  518. position: absolute;
  519. left: 10px;
  520. top: 20px;
  521. width: calc(100% - 20px);
  522. font-size: 20px;
  523. font-weight: 600;
  524. text-align: center;
  525. color: #b8320d;
  526. }
  527. .fs15 {
  528. font-size: 15px;
  529. }
  530. .turntable-img {
  531. position: relative;
  532. /*要居中就要50% - 宽度 / 2*/
  533. left: calc(50% - 40px / 2);
  534. top: 43px;
  535. width: 52px;
  536. height: 39px;
  537. img {
  538. display: inline-block;
  539. width: 52px;
  540. height: 39px;
  541. }
  542. }
  543. .start-btn {
  544. width: 276px;
  545. height: 55px;
  546. position: absolute;
  547. bottom: 16px;
  548. left: calc(50% - 138px);
  549. }
  550. .num {
  551. margin-top: 8px;
  552. text-align: center;
  553. font-size: 14px;
  554. color: #333333;
  555. line-height: 20px;
  556. }
  557. .popup-view {
  558. width: 324px;
  559. padding: 20px 10px;
  560. box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, 0.1);
  561. background: #ffffff;
  562. text-align: center;
  563. }
  564. .popup-view-rule {
  565. width: 324px;
  566. height: 452px;
  567. box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, 0.1);
  568. box-sizing: border-box;
  569. background: linear-gradient(
  570. 180deg,
  571. rgba(254, 178, 119, 1),
  572. rgba(255, 91, 46, 1)
  573. );
  574. position: relative;
  575. border-radius: 18px;
  576. padding: 6px;
  577. }
  578. .popup-view-rule-box {
  579. width: 312px;
  580. height: 440px;
  581. background: linear-gradient(181deg, #fffffe 0%, #f7f2e5 100%);
  582. border-radius: 18px;
  583. box-sizing: border-box;
  584. padding-top: 38px;
  585. }
  586. .popup-view-rule-title {
  587. width: 220px;
  588. height: 54px;
  589. background-image: url('../../../assets/image/activity/lottery/buy-rule-title.png');
  590. background-size: 100% 100%;
  591. position: absolute;
  592. top: -14px;
  593. left: 52px;
  594. font-size: 18px;
  595. font-weight: 600;
  596. color: #fffefc;
  597. line-height: 54px;
  598. text-align: center;
  599. }
  600. .h330 {
  601. height: 335px;
  602. overflow-y: auto;
  603. padding: 0 16px;
  604. }
  605. .txt1 {
  606. font-size: 18px;
  607. font-weight: 600;
  608. color: #333333;
  609. line-height: 25px;
  610. text-align: center;
  611. }
  612. .coupon-1 {
  613. width: 286px;
  614. height: 106px;
  615. box-sizing: border-box;
  616. margin: 11px auto 0;
  617. position: relative;
  618. border-radius: 13px;
  619. border: 2px solid;
  620. border-color: #e8e8e8;
  621. box-sizing: border-box;
  622. &::before,
  623. &::after {
  624. background-color: white;
  625. border-radius: 50%;
  626. content: '';
  627. width: 20px;
  628. height: 20px;
  629. position: absolute;
  630. top: 43px;
  631. z-index: 1;
  632. }
  633. &::before {
  634. border-right: 2px solid;
  635. border-color: #e8e8e8;
  636. left: -12px;
  637. border-radius: 0 10px 10px 0;
  638. }
  639. &::after {
  640. border-left: 2px solid;
  641. border-color: #e8e8e8;
  642. right: -12px;
  643. border-radius: 10px 0 0 10px;
  644. }
  645. }
  646. .coupon-1.active,
  647. .coupon-2.active {
  648. border-left: 2px solid;
  649. border-color: #d96a57 !important;
  650. &::before {
  651. border-right: 2px solid;
  652. border-color: #d96a57;
  653. }
  654. &::after {
  655. border-left: 2px solid;
  656. border-color: #d96a57;
  657. }
  658. }
  659. .coupon-title {
  660. color: #362113;
  661. font-size: 12px;
  662. text-align: center;
  663. z-index: 1;
  664. position: absolute;
  665. top: 23px;
  666. width: 100%;
  667. }
  668. .txt2 {
  669. font-weight: 600;
  670. font-size: 24px;
  671. }
  672. .txt3 {
  673. color: #db6857;
  674. }
  675. .txt4 {
  676. position: absolute;
  677. top: 68px;
  678. width: 100%;
  679. text-align: center;
  680. font-size: 14px;
  681. font-weight: 600;
  682. color: #ffffff;
  683. line-height: 20px;
  684. z-index: 1;
  685. }
  686. .coupon-select-icon {
  687. width: 34px;
  688. height: 20px;
  689. position: absolute;
  690. top: 0;
  691. right: 0;
  692. z-index: 2;
  693. }
  694. .w253h73 {
  695. width: 253px;
  696. height: 73px;
  697. position: absolute;
  698. top: 15px;
  699. left: 15px;
  700. }
  701. .coupon-2 {
  702. width: 137px;
  703. height: 106px;
  704. box-sizing: border-box;
  705. margin-top: 11px;
  706. position: relative;
  707. border-radius: 13px;
  708. box-sizing: border-box;
  709. border: 2px solid;
  710. border-color: #e8e8e8;
  711. &::before,
  712. &::after {
  713. background-color: white;
  714. border-radius: 50%;
  715. content: '';
  716. width: 20px;
  717. height: 20px;
  718. position: absolute;
  719. top: 43px;
  720. z-index: 1;
  721. }
  722. &::before {
  723. border-right: 2px solid;
  724. border-color: #e8e8e8;
  725. left: -12px;
  726. border-radius: 0 10px 10px 0;
  727. }
  728. &::after {
  729. border-left: 2px solid;
  730. border-color: #e8e8e8;
  731. right: -12px;
  732. border-radius: 10px 0 0 10px;
  733. }
  734. }
  735. .w111h73 {
  736. width: 111px;
  737. height: 73px;
  738. position: absolute;
  739. top: 15px;
  740. left: 12px;
  741. }
  742. .txt5 {
  743. font-size: 16px;
  744. color: #333333;
  745. margin-left: 7px;
  746. }
  747. .icon-pay {
  748. font-size: 26px;
  749. line-height: inherit;
  750. }
  751. .fnc {
  752. display: flex;
  753. align-items: center;
  754. }
  755. .fnbc {
  756. display: flex;
  757. justify-content: space-between;
  758. align-items: center;
  759. height: 50px;
  760. padding: 0 10px;
  761. }
  762. .w304h62 {
  763. width: 304px;
  764. height: 62px;
  765. margin: 0 auto;
  766. }
  767. .txt6 {
  768. color: #333333;
  769. font-size: 11px;
  770. line-height: 16px;
  771. a {
  772. color: #ff7656;
  773. text-decoration: underline;
  774. }
  775. }
  776. .popup-view-leave {
  777. background: linear-gradient(180deg, #ffffff 0%, #f7f1e3 100%);
  778. }
  779. .btn-leave {
  780. width: 140px;
  781. height: 48px;
  782. background: linear-gradient(180deg, #ffdb94 0%, #ff9539 100%);
  783. box-shadow: 0px 2px 7px 0px rgba(237, 76, 0, 0.17),
  784. inset 0px -5px 0px 0px #ff7700;
  785. border-radius: 24px;
  786. font-size: 18px;
  787. font-weight: 600;
  788. color: #ffffff;
  789. text-align: center;
  790. line-height: 43px;
  791. margin-top: 15px;
  792. }
  793. .btn-pay {
  794. width: 140px;
  795. height: 48px;
  796. background: linear-gradient(180deg, #ff9278 0%, #ff562f 100%);
  797. box-shadow: 0px 2px 7px 0px rgba(237, 76, 0, 0.17),
  798. inset 0px -5px 0px 0px #f62e00;
  799. border-radius: 24px;
  800. border-radius: 24px;
  801. font-size: 18px;
  802. font-weight: 600;
  803. color: #ffffff;
  804. text-align: center;
  805. line-height: 43px;
  806. margin-top: 15px;
  807. }
  808. .txt7 {
  809. font-size: 13px;
  810. line-height: 19px;
  811. color: #666666;
  812. text-shadow: 0px 1px 20px rgba(0, 0, 0, 0.1);
  813. }
  814. .txt8 {
  815. font-size: 15px;
  816. font-weight: 500;
  817. line-height: 19px;
  818. color: #333333;
  819. text-shadow: 0px 1px 20px rgba(0, 0, 0, 0.1);
  820. }
  821. .txt9 {
  822. font-size: 13px;
  823. color: #333333;
  824. line-height: 19px;
  825. text-shadow: 0px 1px 20px rgba(0, 0, 0, 0.1);
  826. }
  827. .txt10 {
  828. font-size: 13px;
  829. line-height: 19px;
  830. color: #333;
  831. text-shadow: 0px 1px 20px rgba(0, 0, 0, 0.1);
  832. }
  833. </style>