pc.vue 32 KB

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