index.vue 28 KB

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