index.vue 29 KB

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