index.vue 29 KB

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