index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  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. if (this.payType === 'aliPay') {
  271. Toast({
  272. message: '微信小程序不支持支付宝支付',
  273. position: 'top',
  274. duration: 4000
  275. });
  276. return false
  277. }
  278. this.$wx.miniProgram.navigateTo({
  279. url: '/packageA/order/status/index?record=' + JSON.stringify({
  280. payActive: this.payType === 'wxPay' ? 1 : 0,
  281. myOrderNum: res.data.myOrderNum
  282. }),
  283. });
  284. } else {
  285. // 使用postMessage 方法可以发送消息到应用, 消息内容需要在data 对象中,否则webview无法接收到
  286. webUni.webView.postMessage({
  287. data: {
  288. payType: this.payType === 'aliPay' ? 3 : 2,
  289. orderNum: res.data.myOrderNum,
  290. buyType: 1,
  291. price: this.actualPrice
  292. }
  293. })
  294. }
  295. this.showPay = false
  296. } catch (error) {
  297. Toast.clear();
  298. Toast({
  299. message: error.message,
  300. position: 'top',
  301. duration: 4000
  302. });
  303. }
  304. },
  305. sort_ASCII(obj) {
  306. const arr = [];
  307. let num = 0;
  308. for (const i in obj) {
  309. arr[num] = i;
  310. num++;
  311. }
  312. const sortArr = arr.sort();
  313. const sortObj = {};
  314. for (const i in sortArr) {
  315. sortObj[sortArr[i]] = obj[sortArr[i]];
  316. }
  317. return sortObj;
  318. },
  319. jiaqian(content) {
  320. const PrivateKey =
  321. '-----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-----';
  322. const signature = new RSA.KJUR.crypto.Signature({
  323. alg: 'SHA256withRSA',
  324. });
  325. signature.init(PrivateKey);
  326. signature.updateString(content);
  327. const signData = signature.sign();
  328. // 将内容转成base64
  329. return RSA.hex2b64(signData);
  330. },
  331. async getLuckDrawActivity() {
  332. const res = await this.$axios.$post('/activity/v1/member/luckDrawActivity');
  333. this.activityId = res.data.activityId
  334. this.status = res.data.status
  335. this.num = res.data.count
  336. if (this.num === 0) {
  337. this.getLuckDraw();
  338. }
  339. },
  340. // 开始抽奖
  341. startRotation() {
  342. // 如果还不可以转动
  343. if (!this.canBeRotated()) {
  344. return false;
  345. }
  346. this.makePoint('activity_立即抽奖')
  347. // 开始转动
  348. // 先上锁
  349. this.isLocking = true;
  350. this.getLuckDraw();
  351. // 成功后次数减少一次
  352. if (this.num > 1) {
  353. this.num--;
  354. }
  355. // 告诉子组件,开始转动了
  356. this.$refs.roundTurntable.rotate(this.prizeIndex);
  357. },
  358. async getLuckDraw() {
  359. // 设置在哪里停下,应该与后台交互,这里随机抽取0~5
  360. const res = await this.$axios.$post('/activity/v1/member/luckDraw?activityId=' + this.activityId, {}, { headers: { Authorization: this.token } });
  361. if (res.status === 0) {
  362. this.actualPrice = res.data.actualPrice
  363. if (res.data.luckDrawType === 1) {
  364. this.makePoint('activity_15.9年卡')
  365. if (Number(localStorage.getItem('year-15-9')) !== 2)
  366. localStorage.setItem('year-15-9', 1)
  367. }
  368. if (res.data.luckDrawType === 2) {
  369. if (Number(localStorage.getItem('year-9-9')) !== 2)
  370. this.makePoint('activity_9.9年卡')
  371. localStorage.setItem('year-9-9', 1)
  372. }
  373. this.mealId = res.data.mealId
  374. this.selMealId = res.data.mealId
  375. this.getMealInfo()
  376. this.paySupportType = res.data.paySupportType
  377. this.payType = this.paySupportType[0]
  378. this.phoneType = res.data.phoneType
  379. this.title = res.data.title
  380. this.prizeIndex = res.data.luckDrawType;
  381. } else {
  382. Toast({
  383. message: res.msg,
  384. position: 'top',
  385. duration: 4000
  386. });
  387. }
  388. },
  389. makePoint(positionButton) {
  390. const now = new Date()
  391. 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/, '') }])
  392. },
  393. // 已经转动完转盘触发的函数
  394. endRotation() {
  395. // 提示中奖
  396. this.showPay = true
  397. // 解锁
  398. this.isLocking = false;
  399. },
  400. // 判断是否可以转动
  401. canBeRotated() {
  402. if (this.isLocking) {
  403. return false;
  404. }
  405. if (this.status === 0) {
  406. Toast({
  407. message: '当前活动已过期',
  408. position: 'top',
  409. duration: 4000
  410. });
  411. return false;
  412. }
  413. if (this.status === 2) {
  414. Toast({
  415. message: '当前活动未开启',
  416. position: 'top',
  417. duration: 4000
  418. });
  419. return false;
  420. }
  421. if (this.status === 3) {
  422. Toast({
  423. message: '当前活动已结束',
  424. position: 'top',
  425. duration: 4000
  426. });
  427. return false;
  428. }
  429. if (this.num === 0) {
  430. this.showPay = true
  431. return false;
  432. }
  433. return true;
  434. },
  435. closed() {
  436. this.makePoint('activity_关闭抽奖', 'eventCode传27_抽奖流程')
  437. if (Number(localStorage.getItem('year-15-9')) !== 2) {
  438. this.show = true
  439. localStorage.setItem('year-15-9', 2)
  440. }
  441. if (Number(localStorage.getItem('year-9-9')) !== 2) {
  442. this.show = true
  443. localStorage.setItem('year-9-9', 2)
  444. }
  445. }
  446. }
  447. }
  448. </script>
  449. <style lang="scss" scoped>
  450. .fb {
  451. display: flex;
  452. justify-content: space-between;
  453. width: 286px;
  454. margin: 0 auto;
  455. }
  456. .fw500 {
  457. font-weight: 500;
  458. }
  459. .mt5 {
  460. margin-top: 5px;
  461. }
  462. .mt14 {
  463. margin-top: 14px;
  464. }
  465. .lottery-container {
  466. background-color: #bbe5f2;
  467. background-image: url('../../../assets/image/activity/lottery/bg.png');
  468. background-size: contain;
  469. min-height: 100vh;
  470. overflow: hidden;
  471. margin: 0 auto;
  472. }
  473. .lottery-swipe {
  474. width: 188px;
  475. height: 25px;
  476. background: rgba($color: #000000, $alpha: 0.24);
  477. border-radius: 0px 16px 16px 0px;
  478. position: absolute;
  479. top: 134px;
  480. left: 0;
  481. z-index: 1;
  482. }
  483. .lottery-swipe .van-swipe-item {
  484. color: #ffffff;
  485. font-size: 13px;
  486. line-height: 25px;
  487. text-align: center;
  488. }
  489. .w51h26 {
  490. width: 51px;
  491. height: 26px;
  492. position: absolute;
  493. top: 128px;
  494. right: 0;
  495. z-index: 2;
  496. }
  497. .roulette {
  498. width: 372px;
  499. height: 442px;
  500. background-image: url('../../../assets/image/activity/lottery/roulette.png');
  501. background-size: 100% 100%;
  502. margin: 127px auto 0;
  503. position: relative;
  504. }
  505. .arrow {
  506. width: 122px;
  507. height: 135px;
  508. position: absolute;
  509. top: 110px;
  510. left: 125px;
  511. background-image: url('../../../assets/image/activity/lottery/arrow.png');
  512. background-size: 100% 100%;
  513. z-index: 1;
  514. }
  515. .turntable {
  516. position: absolute;
  517. left: calc(50% - 144px);
  518. top: 163px;
  519. width: 288px;
  520. height: 288px;
  521. }
  522. .turntable-name {
  523. position: absolute;
  524. left: 10px;
  525. top: 20px;
  526. width: calc(100% - 20px);
  527. font-size: 20px;
  528. font-weight: 600;
  529. text-align: center;
  530. color: #b8320d;
  531. }
  532. .fs15 {
  533. font-size: 15px;
  534. }
  535. .turntable-img {
  536. position: relative;
  537. /*要居中就要50% - 宽度 / 2*/
  538. left: calc(50% - 40px / 2);
  539. top: 43px;
  540. width: 52px;
  541. height: 39px;
  542. img {
  543. display: inline-block;
  544. width: 52px;
  545. height: 39px;
  546. }
  547. }
  548. .start-btn {
  549. width: 276px;
  550. height: 55px;
  551. position: absolute;
  552. bottom: 16px;
  553. left: calc(50% - 138px);
  554. }
  555. .num {
  556. margin-top: 8px;
  557. text-align: center;
  558. font-size: 14px;
  559. color: #333333;
  560. line-height: 20px;
  561. }
  562. .popup-view {
  563. width: 324px;
  564. padding: 20px 10px;
  565. box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, 0.1);
  566. background: #ffffff;
  567. text-align: center;
  568. }
  569. .popup-view-rule {
  570. width: 324px;
  571. height: 452px;
  572. box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, 0.1);
  573. box-sizing: border-box;
  574. background: linear-gradient(
  575. 180deg,
  576. rgba(254, 178, 119, 1),
  577. rgba(255, 91, 46, 1)
  578. );
  579. position: relative;
  580. border-radius: 18px;
  581. padding: 6px;
  582. }
  583. .popup-view-rule-box {
  584. width: 312px;
  585. height: 440px;
  586. background: linear-gradient(181deg, #fffffe 0%, #f7f2e5 100%);
  587. border-radius: 18px;
  588. box-sizing: border-box;
  589. padding-top: 38px;
  590. }
  591. .popup-view-rule-title {
  592. width: 220px;
  593. height: 54px;
  594. background-image: url('../../../assets/image/activity/lottery/buy-rule-title.png');
  595. background-size: 100% 100%;
  596. position: absolute;
  597. top: -14px;
  598. left: 52px;
  599. font-size: 18px;
  600. font-weight: 600;
  601. color: #fffefc;
  602. line-height: 54px;
  603. text-align: center;
  604. }
  605. .h330 {
  606. height: 335px;
  607. overflow-y: auto;
  608. padding: 0 16px;
  609. }
  610. .txt1 {
  611. font-size: 18px;
  612. font-weight: 600;
  613. color: #333333;
  614. line-height: 25px;
  615. text-align: center;
  616. }
  617. .coupon-1 {
  618. width: 286px;
  619. height: 106px;
  620. box-sizing: border-box;
  621. margin: 11px auto 0;
  622. position: relative;
  623. border-radius: 13px;
  624. border: 2px solid;
  625. border-color: #e8e8e8;
  626. box-sizing: border-box;
  627. &::before,
  628. &::after {
  629. background-color: white;
  630. border-radius: 50%;
  631. content: '';
  632. width: 20px;
  633. height: 20px;
  634. position: absolute;
  635. top: 43px;
  636. z-index: 1;
  637. }
  638. &::before {
  639. border-right: 2px solid;
  640. border-color: #e8e8e8;
  641. left: -12px;
  642. border-radius: 0 10px 10px 0;
  643. }
  644. &::after {
  645. border-left: 2px solid;
  646. border-color: #e8e8e8;
  647. right: -12px;
  648. border-radius: 10px 0 0 10px;
  649. }
  650. }
  651. .coupon-1.active,
  652. .coupon-2.active {
  653. border-left: 2px solid;
  654. border-color: #d96a57 !important;
  655. &::before {
  656. border-right: 2px solid;
  657. border-color: #d96a57;
  658. }
  659. &::after {
  660. border-left: 2px solid;
  661. border-color: #d96a57;
  662. }
  663. }
  664. .coupon-title {
  665. color: #362113;
  666. font-size: 12px;
  667. text-align: center;
  668. z-index: 1;
  669. position: absolute;
  670. top: 23px;
  671. width: 100%;
  672. }
  673. .txt2 {
  674. font-weight: 600;
  675. font-size: 24px;
  676. }
  677. .txt3 {
  678. color: #db6857;
  679. }
  680. .txt4 {
  681. position: absolute;
  682. top: 68px;
  683. width: 100%;
  684. text-align: center;
  685. font-size: 14px;
  686. font-weight: 600;
  687. color: #ffffff;
  688. line-height: 20px;
  689. z-index: 1;
  690. }
  691. .coupon-select-icon {
  692. width: 34px;
  693. height: 20px;
  694. position: absolute;
  695. top: 0;
  696. right: 0;
  697. z-index: 2;
  698. }
  699. .w253h73 {
  700. width: 253px;
  701. height: 73px;
  702. position: absolute;
  703. top: 15px;
  704. left: 15px;
  705. }
  706. .coupon-2 {
  707. width: 137px;
  708. height: 106px;
  709. box-sizing: border-box;
  710. margin-top: 11px;
  711. position: relative;
  712. border-radius: 13px;
  713. box-sizing: border-box;
  714. border: 2px solid;
  715. border-color: #e8e8e8;
  716. &::before,
  717. &::after {
  718. background-color: white;
  719. border-radius: 50%;
  720. content: '';
  721. width: 20px;
  722. height: 20px;
  723. position: absolute;
  724. top: 43px;
  725. z-index: 1;
  726. }
  727. &::before {
  728. border-right: 2px solid;
  729. border-color: #e8e8e8;
  730. left: -12px;
  731. border-radius: 0 10px 10px 0;
  732. }
  733. &::after {
  734. border-left: 2px solid;
  735. border-color: #e8e8e8;
  736. right: -12px;
  737. border-radius: 10px 0 0 10px;
  738. }
  739. }
  740. .w111h73 {
  741. width: 111px;
  742. height: 73px;
  743. position: absolute;
  744. top: 15px;
  745. left: 12px;
  746. }
  747. .txt5 {
  748. font-size: 16px;
  749. color: #333333;
  750. margin-left: 7px;
  751. }
  752. .icon-pay {
  753. font-size: 26px;
  754. line-height: inherit;
  755. }
  756. .fnc {
  757. display: flex;
  758. align-items: center;
  759. }
  760. .fnbc {
  761. display: flex;
  762. justify-content: space-between;
  763. align-items: center;
  764. height: 50px;
  765. padding: 0 10px;
  766. }
  767. .w304h62 {
  768. width: 304px;
  769. height: 62px;
  770. margin: 0 auto;
  771. }
  772. .txt6 {
  773. color: #333333;
  774. font-size: 11px;
  775. line-height: 16px;
  776. a {
  777. color: #ff7656;
  778. text-decoration: underline;
  779. }
  780. }
  781. .popup-view-leave {
  782. background: linear-gradient(180deg, #ffffff 0%, #f7f1e3 100%);
  783. }
  784. .btn-leave {
  785. width: 140px;
  786. height: 48px;
  787. background: linear-gradient(180deg, #ffdb94 0%, #ff9539 100%);
  788. box-shadow: 0px 2px 7px 0px rgba(237, 76, 0, 0.17),
  789. inset 0px -5px 0px 0px #ff7700;
  790. border-radius: 24px;
  791. font-size: 18px;
  792. font-weight: 600;
  793. color: #ffffff;
  794. text-align: center;
  795. line-height: 43px;
  796. margin-top: 15px;
  797. }
  798. .btn-pay {
  799. width: 140px;
  800. height: 48px;
  801. background: linear-gradient(180deg, #ff9278 0%, #ff562f 100%);
  802. box-shadow: 0px 2px 7px 0px rgba(237, 76, 0, 0.17),
  803. inset 0px -5px 0px 0px #f62e00;
  804. border-radius: 24px;
  805. border-radius: 24px;
  806. font-size: 18px;
  807. font-weight: 600;
  808. color: #ffffff;
  809. text-align: center;
  810. line-height: 43px;
  811. margin-top: 15px;
  812. }
  813. .txt7 {
  814. font-size: 13px;
  815. line-height: 19px;
  816. color: #666666;
  817. text-shadow: 0px 1px 20px rgba(0, 0, 0, 0.1);
  818. }
  819. .txt8 {
  820. font-size: 15px;
  821. font-weight: 500;
  822. line-height: 19px;
  823. color: #333333;
  824. text-shadow: 0px 1px 20px rgba(0, 0, 0, 0.1);
  825. }
  826. .txt9 {
  827. font-size: 13px;
  828. color: #333333;
  829. line-height: 19px;
  830. text-shadow: 0px 1px 20px rgba(0, 0, 0, 0.1);
  831. }
  832. .txt10 {
  833. font-size: 13px;
  834. line-height: 19px;
  835. color: #333;
  836. text-shadow: 0px 1px 20px rgba(0, 0, 0, 0.1);
  837. }
  838. </style>