index.vue 28 KB

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