pc.vue 32 KB

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