index.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430
  1. <template>
  2. <!-- 阳光签到书城 -->
  3. <view class="sign" >
  4. <image src="../../static/sign_back.png" class="back" mode="widthFix"></image>
  5. <view class="signCenter">
  6. <!-- 个人信息模块 -->
  7. <view class="signTop">
  8. <view class="left">
  9. <view class="avatarView">
  10. <!-- <open-data type="userAvatarUrl" class="avatar"></open-data> -->
  11. <image src="../../static/avatar.png" mode="widthFix"></image>
  12. </view>
  13. <view class="userInfo">
  14. <view class="account">{{signData.mpName || '超多书币享不停'}}</view>
  15. <view class="ID" v-if="mpData.mpAppId">
  16. <text>书币:{{balanceCount}}</text>
  17. <navigator :url="`../extractBookCurr/extractBookCurr?mpAppId=${mpData.mpAppId}&mpOpenId=${mpData.mpOpenId}`" class="extract" hover-class="none">提取</navigator>
  18. </view>
  19. <view class="ID" v-else>ID:{{signData.userId || 564564}}</view>
  20. </view>
  21. </view>
  22. <navigator v-if="mpAppIdShow" :url="'../checkInRecord/checkInRecord?openId=' + openId + '&mpAppId=' + mpData.mpAppId + '&mpOpenId=' + mpData.mpOpenId" class="right">
  23. <image src="../../static/signRecord.png" mode="widthFix"></image>
  24. <text>签到记录</text>
  25. </navigator>
  26. </view>
  27. <view class="signBottom">
  28. <!-- 滚动通知 -->
  29. <view class="notice">
  30. <image src="../../static/horn.png" class="horn" mode="widthFix"></image>
  31. <view class="txts">
  32. <u-notice-bar mode="vertical" :volume-icon="false" color="#FFFFFF" type="none" :list="list"></u-notice-bar>
  33. </view>
  34. </view>
  35. <!-- 签到展示模块 -->
  36. <view class="exhibitionContent" v-if="signData.signInDayVoList.length > 0">
  37. <view class="ts">已连续签到{{signData.sustainDayCount}}天,有{{signData.canSupplement}}次补签机会</view>
  38. <view class="signinExhibition">
  39. <view v-for="(item, index) in signData.signInDayVoList" :key="index" :class="item.signIn ? 'select' : item.canSupplement ? 'repairSign' : ''">
  40. <template v-if="index < 6">
  41. <view class="repair" v-if="item.canSupplement">看视频补签</view>
  42. <text class="day">{{item.dayDescribe}}</text>
  43. <image src="../../static/goldSelect.png" class="goldCoins" style="width: 68rpx;" mode="heightFix" v-if="item.signIn"></image>
  44. <image src="../../static/clickVideo.png" class="goldCoins" mode="heightFix" style="position: relative; z-index: 101;" @click="signatureHandle(2, item)" v-else-if="item.canSupplement"></image>
  45. <image src="../../static/gold.png" class="goldCoins" style="width: 68rpx;" mode="heightFix" v-else></image>
  46. <text class="reward">{{item.bookCoin}}书币</text>
  47. <image src="../../static/signSub.png" class="signSub" mode="widthFix" v-if="item.signIn"></image>
  48. </template>
  49. <template v-else>
  50. <view class="left">
  51. <text class="day">{{item.dayDescribe}}</text>
  52. <text class="reward">{{item.bookCoin}}书币</text>
  53. </view>
  54. <view class="right">
  55. <image src="../../static/giftBag.png" mode="heightFix" v-if="!item.signIn"></image>
  56. <image src="../../static/giftBagSelect.png" mode="heightFix" v-else></image>
  57. </view>
  58. <image src="../../static/signSub.png" class="signSub" mode="widthFix" v-if="item.signIn"></image>
  59. </template>
  60. </view>
  61. </view>
  62. <template v-if="!mpAppIdShow">
  63. <view class="gignBt" @click="tsAccount" v-if="isSignIn" :animation="btAnimationData">签到领书币</view>
  64. <view class="already" v-else>今日已签</view>
  65. </template>
  66. <template v-else>
  67. <!-- <navigator url="../officialAccount/officialAccount" class="gignBt" v-if="!signData.mpName" :animation="btAnimationData">签到领书币</navigator> -->
  68. <view class="gignBt" @click="tsAccount" v-if="!signData.mpName" :animation="btAnimationData">签到领书币</view>
  69. <view class="gignBt" @click="signIn" v-else-if="!isSignIn" :animation="btAnimationData">签到领书币</view>
  70. <!-- <view class="already" v-else>今日已签</view> -->
  71. <view class="gignBt" v-else @click="moreGold" :animation="btAnimationData">去抽奖获更多奖励</view>
  72. </template>
  73. </view>
  74. <!-- 签到提醒模块 -->
  75. <view class="signRemind">
  76. <text>签到提醒</text>
  77. <view class="remindSwitch">
  78. <view :class="signRemind ? 'open' : 'close'" @click="signRemindHandle(true)">
  79. <view class="select"></view>
  80. <text>开启</text>
  81. </view>
  82. <view :class="!signRemind ? 'open' : 'close'" @click="signRemindHandle(false)">
  83. <view class="select"></view>
  84. <text>关闭</text>
  85. </view>
  86. </view>
  87. </view>
  88. <ad-view :unitId="adConfig.bannerAd" adIntervals="200" v-if="adConfig.bannerAd"></ad-view>
  89. <!-- 活动规则模块 -->
  90. <view class="activityRules">
  91. <view class="top" @click="activityRulesHandle">
  92. <text>活动规则</text>
  93. <image :src="!activityRules ? '../../static/unfold.png' : '../../static/retract.png'" mode="widthFix"></image>
  94. </view>
  95. <view class="bottom" v-if="activityRules">
  96. <view>
  97. 1.用户进入小程序后,点击签到按钮即可完成一次签到。
  98. </view>
  99. <view>
  100. 2.签到获得的书币奖励,在提取之日即时生效。连续签到所得书币奖励在周期内稍有变化,非均等分布。连续7日完成签到的用户在第7日可获得更多的奖励。
  101. </view>
  102. <view>
  103. 3.用户每个周期(7天),至多拥有2次补签机会(连续签到2天拥有1次补签机会,一天内只允许补签一次空缺天数),可通过观看小视频获得,连续未签到2天,签到重新开始。
  104. </view>
  105. <view>
  106. 4.连续签到:自首日完成签到开始累计,连续7天签到为一个周期。签到中断,则重新开始计算。
  107. </view>
  108. <view>
  109. 5.每日同一注册用户仅可参与一次。
  110. </view>
  111. <view>
  112. 6.本活动解释权由开发者所有,有任何疑问请联系公众号内客服。
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <!-- 金币飞行组 -->
  118. <view class="fragmentGold" :animation="animationDatas[index]" v-for="(item, index) in goldData" :key="index" :style="{top: item.top, left: item.left}">
  119. <image src="../../static/gold.png" mode="widthFix"></image>
  120. </view>
  121. <!-- 去抽奖路口 -->
  122. <view class="qLuckDraw" @click="moreGold" v-if="mpAppIdShow">
  123. <image src="../../static/1234.gif" mode="widthFix"></image>
  124. </view>
  125. </view>
  126. <!-- -->
  127. <view class="popup" v-if="popupShow">
  128. <view class="popupContent">
  129. <view class="content">
  130. <image src="../../static/popupBack.png"></image>
  131. <view class="textCon">
  132. <text class="ts">签到成功!</text> </br>
  133. <text class="reward">恭喜您获得{{signInDay.bookCoin}}书币</text> </br>
  134. <image src="../../static/doubleBt.png" class="doubleBt" mode="widthFix" :style="{transform: `scale(${scale})`}" @click="lookVideo"></image> </br>
  135. <view :class="['bt', { btTrue: status }]" @click="signInHandle(false)">不了,单倍领取</view>
  136. </view>
  137. </view>view
  138. <image src="../../static/close.png" class="close" mode="widthFix" @click="closeHandle"></image>
  139. </view>
  140. </view>
  141. <!-- 弹窗提示 -->
  142. <view class="receiveTs" :animation="animationDataTs">
  143. {{tsTitle}}
  144. </view>
  145. <!-- 格子广告 -->
  146. <!-- <view class="singleLattice">
  147. <ad-custom-view :unit-id="adConfig.singleLatticeAd" adIntervals="200"></ad-custom-view>
  148. </view> -->
  149. </view>
  150. </template>
  151. <script>
  152. let timer = null, btTimer = null, adTimer = null, powerOnTimer = null
  153. import { config, getHome, getOpenId, signInAjax, getTemplateIDs, setMessage, switchUpdate, getBalance, getState } from '@/api/api.js'
  154. import { bannerAd, urgeVideoAd, insertScreenAd, singleLatticeAd } from '@/utils/ad_config.js'
  155. import adView from '@/components/ad-view/ad-view.vue'
  156. import adCustomView from '@/components/ad-custom-view/ad-custom-view.vue'
  157. export default {
  158. components: {
  159. adView,
  160. adCustomView
  161. },
  162. data() {
  163. return {
  164. adConfig: {
  165. bannerAd,
  166. singleLatticeAd
  167. },
  168. list: [
  169. '恭喜用户 “0016” 成功提现 200书币',
  170. '恭喜用户 “1037” 成功提现 10书币',
  171. '恭喜用户 “9128” 成功提现 20书币',
  172. '恭喜用户 “1873” 成功提现 140书币',
  173. '恭喜用户 “9834” 成功提现 200书币',
  174. '恭喜用户 “5623” 成功提现 10书币',
  175. '恭喜用户 “0934” 成功提现 20书币',
  176. '恭喜用户 “7843” 成功提现 60书币',
  177. '恭喜用户 “1344” 成功提现 20书币',
  178. '恭喜用户 “5464” 成功提现 140书币',
  179. '恭喜用户 “0823” 成功提现 200书币',
  180. '恭喜用户 “8910” 成功提现 10书币',
  181. '恭喜用户 “0714” 成功提现 20书币',
  182. ],
  183. signRemind: false, // 是否开启签到提醒
  184. activityRules: false, // 是否展开活动规则
  185. popupShow: false, // 弹窗控制
  186. signData: {
  187. sustainDayCount: 0,
  188. canSupplement: 0,
  189. userId: null,
  190. mpName: null,
  191. signInDayVoList: [
  192. {
  193. signIn: false,
  194. canSupplement: false,
  195. dayDescribe: '第一天',
  196. bookCoin: 10,
  197. isSignIn: true
  198. },
  199. {
  200. signIn: false,
  201. canSupplement: false,
  202. dayDescribe: '第二天',
  203. bookCoin: 20,
  204. isSignIn: false
  205. },
  206. {
  207. signIn: false,
  208. canSupplement: false,
  209. dayDescribe: '第三天',
  210. bookCoin: 30,
  211. isSignIn: false
  212. },
  213. {
  214. signIn: false,
  215. canSupplement: false,
  216. dayDescribe: '第四天',
  217. bookCoin: 40,
  218. isSignIn: false
  219. },
  220. {
  221. signIn: false,
  222. canSupplement: false,
  223. dayDescribe: '第五天',
  224. bookCoin: 50,
  225. isSignIn: false
  226. },
  227. {
  228. signIn: false,
  229. canSupplement: false,
  230. dayDescribe: '第六天',
  231. bookCoin: 60,
  232. isSignIn: false
  233. },
  234. {
  235. signIn: false,
  236. canSupplement: false,
  237. dayDescribe: '第七天',
  238. bookCoin: 70,
  239. isSignIn: false
  240. },
  241. ]
  242. }, // 签到相关信息
  243. openId: '',
  244. mpData: {}, // 公众号相关
  245. isSignIn: true, // 是否已经签到
  246. userId: undefined, // 用户ID
  247. signIdTemID: [], // 签到提醒模板ID
  248. isMainSwitch: true, // 是否关闭了通知按钮
  249. isAlwaysCancel: false, // 是否点击了总是允许取消
  250. signInDay: {}, // 今天签到信息
  251. scale: 1,
  252. btAnimation: null, // 按钮呼吸动画实例
  253. btAnimationData: {}, // 按钮呼吸动画
  254. btScale: 1,
  255. tsTitle: '+100金币', // 提示文字
  256. durationMath1: 20,
  257. durationMath2: 20,
  258. animationDataTs: {}, // 提示文字动画
  259. goldData: [
  260. {top: '532rpx', left: '82rpx'},
  261. {top: '532rpx', left: '252rpx'},
  262. {top: '532rpx', left: '426rpx'},
  263. {top: '532rpx', left: '600rpx'},
  264. {top: '724rpx', left: '82rpx'},
  265. {top: '724rpx', left: '252rpx'},
  266. {top: '724rpx', left: '426rpx'},
  267. {top: '724rpx', left: '484rpx'}
  268. ],
  269. animationDatas: [null, null, null, null, null, null, null, null], // 金币动画组
  270. getIntoCount: 0,
  271. loading: false,
  272. powerOnTimer: new Date().getTime(), // 保存当前进入页面的时间挫
  273. isVideoType: null, // 1 是否是看视频签到 2 是否是补签
  274. repairSignData: null, // 保存补签的信息
  275. powerOnCount: 0, // 记录开机秒数
  276. balanceCount: 0, // 余额
  277. mpAppIdShow: false,
  278. codeValud: '',
  279. codeImage: null,
  280. status: false
  281. }
  282. },
  283. watch: {
  284. 'signData.signInDayVoList':{
  285. handler(val, oldVal){
  286. if (val.length > 0) {
  287. let signInDay = val.find(item => item.canSign)
  288. if (signInDay) {
  289. this.isSignIn = signInDay.signIn
  290. }
  291. }
  292. },
  293. deep: true
  294. },
  295. popupShow(newVal, oldVal) {
  296. if(newVal) {
  297. timer = setInterval(() => {
  298. if(this.scale === 1) {
  299. this.scale = 0.92
  300. }else {
  301. this.scale = 1
  302. }
  303. }, 500)
  304. } else {
  305. timer && clearInterval(timer)
  306. }
  307. }
  308. },
  309. onLoad(options) {
  310. this.mpData = options
  311. try {
  312. const value = uni.getStorageSync('storage_key');
  313. if (value) { // 内存找到有
  314. this.mpAppIdShow = true
  315. if (options.mpAppId) {
  316. // 链接上带有保存
  317. uni.setStorageSync('storage_key', options.mpAppId);
  318. // uni.setNavigationBarTitle({ title: '签到有礼' })
  319. }
  320. } else {
  321. // 内存没找到
  322. if (options.mpAppId) {
  323. // 链接上带有
  324. this.mpAppIdShow = true
  325. uni.setStorageSync('storage_key', options.mpAppId);
  326. // uni.setNavigationBarTitle({ title: '签到有礼' })
  327. } else {
  328. this.mpAppIdShow = false
  329. // uni.setNavigationBarTitle({ title: '生成二维码' })
  330. }
  331. }
  332. } catch (e) {
  333. // error
  334. console.log(2222222, e);
  335. }
  336. uni.login({
  337. success: async res => {
  338. if (res.code) {
  339. let openIDInfo = await getOpenId({appId: config.appid, code: res.code})
  340. this.openId = openIDInfo.data
  341. this.getList()
  342. }
  343. }
  344. })
  345. getState({appId: config.appid}).then(res => {
  346. this.status = res.data || false
  347. })
  348. },
  349. onShareAppMessage() {},
  350. onReady() {
  351. if (urgeVideoAd) {
  352. this.createInterstitialAd()
  353. this.powerOnShowAd()
  354. }
  355. this.btAnimation = uni.createAnimation({ timingFunction: 'ease' })
  356. this.btBreathAni()
  357. },
  358. onHide() {
  359. console.log('页面隐藏')
  360. timer && clearInterval(timer)
  361. btTimer && clearInterval(btTimer)
  362. adTimer && clearTimeout(adTimer)
  363. powerOnTimer && clearInterval(powerOnTimer)
  364. },
  365. onUnload() {
  366. console.log('onUnload---->')
  367. timer && clearInterval(timer)
  368. btTimer && clearInterval(btTimer)
  369. this.interstitialAd.destroy()
  370. adTimer && clearTimeout(adTimer)
  371. powerOnTimer && clearInterval(powerOnTimer)
  372. },
  373. methods: {
  374. onKeyInput(e) {
  375. this.codeValud = e.target.value
  376. },
  377. load() {
  378. uni.hideLoading();
  379. },
  380. error() {
  381. uni.hideLoading();
  382. },
  383. getCodeImg() {
  384. if (this.codeValud) {
  385. uni.showLoading({
  386. title: '生成中'
  387. });
  388. this.codeImage = `https://api.uomg.com/api/qrcode?url=${this.codeValud}`
  389. } else {
  390. uni.showToast({
  391. title: '请先输入内容~~',
  392. icon: 'none'
  393. })
  394. }
  395. },
  396. getBookCurr() {
  397. getBalance({appId: config.appid, mpAppId: this.mpData.mpAppId, mpOpenId: this.mpData.mpOpenId}).then(res => {
  398. this.balanceCount = res.data || 0
  399. })
  400. },
  401. // 提示关注公众号
  402. tsAccount() {
  403. // uni.showToast({
  404. // title: '请先关注公众号~~',
  405. // icon: 'none'
  406. // })
  407. this.signData = {
  408. sustainDayCount: 1,
  409. canSupplement: 0,
  410. userId: null,
  411. mpName: null,
  412. signInDayVoList: [
  413. {
  414. signIn: true,
  415. canSupplement: false,
  416. dayDescribe: '第一天',
  417. bookCoin: 10,
  418. isSignIn: true
  419. },
  420. {
  421. signIn: false,
  422. canSupplement: false,
  423. dayDescribe: '第二天',
  424. bookCoin: 20,
  425. isSignIn: false
  426. },
  427. {
  428. signIn: false,
  429. canSupplement: false,
  430. dayDescribe: '第三天',
  431. bookCoin: 30,
  432. isSignIn: false
  433. },
  434. {
  435. signIn: false,
  436. canSupplement: false,
  437. dayDescribe: '第四天',
  438. bookCoin: 40,
  439. isSignIn: false
  440. },
  441. {
  442. signIn: false,
  443. canSupplement: false,
  444. dayDescribe: '第五天',
  445. bookCoin: 50,
  446. isSignIn: false
  447. },
  448. {
  449. signIn: false,
  450. canSupplement: false,
  451. dayDescribe: '第六天',
  452. bookCoin: 60,
  453. isSignIn: false
  454. },
  455. {
  456. signIn: false,
  457. canSupplement: false,
  458. dayDescribe: '第七天',
  459. bookCoin: 70,
  460. isSignIn: false
  461. },
  462. ]
  463. }
  464. this.startGold(false)
  465. this.isSignIn = false
  466. uni.showToast({
  467. title: '签到成功~~',
  468. icon: 'none'
  469. })
  470. },
  471. powerOnShowAd() {
  472. // 开机25秒调取弹窗广告 以后没5分钟调取
  473. powerOnTimer = setInterval(() => {
  474. this.powerOnCount += 1
  475. if(this.powerOnCount === 25 || this.powerOnCount % 325 === 0) {
  476. this.showInterstitialAd()
  477. }
  478. }, 1000)
  479. },
  480. // 创建插屏广告 激励视频广告
  481. createInterstitialAd() {
  482. // 创建插屏广告
  483. let interstitialAd = this.interstitialAd = uni.createInterstitialAd({adUnitId: insertScreenAd});
  484. interstitialAd.onLoad(() => {
  485. // 插屏 广告加载成功
  486. console.log("插屏 广告加载成功");
  487. this.loading = false;
  488. });
  489. interstitialAd.onClose(() => {
  490. // 用户点击了关闭或返回键(仅Android有返回键)
  491. console.log("插屏 广告关闭");
  492. });
  493. interstitialAd.onError((err) => {
  494. // 插屏 广告加载失败
  495. console.log("插屏 广告加载失败", err);
  496. this.loading = false;
  497. });
  498. // 广告实例创建成功后默认会执行一次 load,加载广告数据
  499. // 如果界面有 "显示广告" 按钮,需要先禁用掉,防止用户点击,等待广告数据加载成功后在放开
  500. this.loading = true;
  501. // 激励视频广告
  502. this._isLoaded = false
  503. let rewardedVideoAd = this._rewardedVideoAd = uni.createRewardedVideoAd({ adUnitId: urgeVideoAd }) // 仅用于HBuilder基座调试 adpid: '1507000689'
  504. rewardedVideoAd.onLoad(() => {
  505. this._isLoaded = true
  506. console.log('onLoad event')
  507. // 加载激励视频成功
  508. // 当激励视频被关闭时,默认预载下一条数据,加载完成时仍然触发 `onLoad` 事件
  509. })
  510. rewardedVideoAd.onError((err) => {
  511. // 加载激励视频失败
  512. // console.log('onError event', err)
  513. this._isLoaded = false
  514. })
  515. rewardedVideoAd.onClose((res) => {
  516. // 用户点击了【关闭广告】按钮
  517. if (res && res.isEnded) {
  518. // 正常播放结束
  519. if(this.isVideoType === 1){ // 看视频签到
  520. this.signInHandle(true)
  521. } else if (this.isVideoType === 2) { // 看视频补签
  522. this.repairSign(this.repairSignData)
  523. } else if (this.isVideoType === 3) {
  524. this.getCodeImg()
  525. }
  526. } else {
  527. // 播放中途退出
  528. }
  529. })
  530. },
  531. // 显示插屏广告广告
  532. showInterstitialAd() {
  533. // 调用 interstitialAd.show(),如果数据正在加载中不会显示广告,加载成功后才显示
  534. // 在数据没有加载成功时,需要防止用户频繁点击显示广告
  535. if(adTimer) {
  536. clearTimeout(adTimer)
  537. }
  538. if (insertScreenAd) {
  539. let newT = new Date().getTime()
  540. if (((newT / 1000) - (this.powerOnTimer / 1000)) < 15) { // 判断是否开机15秒
  541. adTimer = setTimeout(() => {
  542. if (this.loading == true) {
  543. return
  544. }
  545. this.loading = true;
  546. this.interstitialAd.show().then((res) => {
  547. console.log('插屏广告成功---》', res)
  548. this.loading = false;
  549. }).catch(err => {
  550. console.log('插屏广告错误---》', err)
  551. });
  552. clearTimeout(adTimer)
  553. }, newT - this.powerOnTimer + 1000)
  554. return
  555. }
  556. if (this.loading == true) {
  557. return
  558. }
  559. this.loading = true;
  560. this.interstitialAd.show().then((res) => {
  561. console.log('插屏广告成功---》', res)
  562. this.loading = false;
  563. }).catch(err => {
  564. console.log('插屏广告错误---》', err)
  565. });
  566. }
  567. },
  568. // 补签点击
  569. signatureHandle(type, data) {
  570. if (!urgeVideoAd) { // 判断是否有视频ID
  571. this.repairSign(this.repairSignData)
  572. return
  573. } else {
  574. this.showVideoAd(type, data)
  575. }
  576. },
  577. // 显示激励视频广告
  578. showVideoAd(type, data) {
  579. if (this._isLoaded) {
  580. this.isVideoType = type
  581. this.repairSignData = data
  582. this._rewardedVideoAd.show().catch(() => {
  583. this._rewardedVideoAd && this._rewardedVideoAd.load().then(() => this._rewardedVideoAd && this._rewardedVideoAd.show()).catch(err => {
  584. uni.showToast({
  585. title: '当前无视频广告',
  586. icon: 'none'
  587. })
  588. })
  589. })
  590. } else {
  591. if(type === 1){ // 看视频签到
  592. this.signInHandle(true)
  593. } else if (type === 2) { // 看视频补签
  594. this.repairSign(this.repairSignData)
  595. } else if (type === 3) {
  596. this.getCodeImg()
  597. }
  598. }
  599. },
  600. /** 看视频签到 */
  601. lookVideo() {
  602. if (urgeVideoAd) {
  603. this.showVideoAd(1)
  604. } else {
  605. this.signInHandle(true)
  606. }
  607. },
  608. // 按钮呼吸
  609. btBreathAni() {
  610. btTimer = setInterval(() => {
  611. if(this.btScale === 1) {
  612. this.btScale = 0.92
  613. this.btAnimation.scale(0.92).step({ duration: 600 })
  614. this.btAnimationData = this.btAnimation.export()
  615. } else {
  616. this.btScale = 1
  617. this.btAnimation.scale(1).step({ duration: 600 })
  618. this.btAnimationData = this.btAnimation.export()
  619. }
  620. }, 600)
  621. },
  622. // 提示动画
  623. startTsAni(watchVideos) {
  624. if (watchVideos) {
  625. this.tsTitle = '+' + (this.signInDay.bookCoin * 2) + '书币'
  626. } else {
  627. this.tsTitle = '+' + (this.signInDay.bookCoin || 10) + '书币'
  628. }
  629. if( this.durationMath2 >= 50 ) {
  630. this.durationMath2 = 20
  631. } else {
  632. this.durationMath2 = this.durationMath2 + 1
  633. }
  634. let animation = uni.createAnimation({ timingFunction: 'ease' })
  635. animation.opacity(1).step({ duration: this.durationMath2 })
  636. animation.top('150rpx').step({ duration: 1000, delay: 100 })
  637. animation.opacity(0).top('350rpx').step({ duration: 0 })
  638. this.animationDataTs = animation.export()
  639. },
  640. // 金币组动画
  641. startGold(watchVideos) {
  642. this.startTsAni(watchVideos)
  643. if( this.durationMath1 >= 50 ) {
  644. this.durationMath1 = 20
  645. } else {
  646. this.durationMath1 = this.durationMath1 + 1
  647. }
  648. this.animationDatas = this.goldData.map(item => {
  649. let animation = uni.createAnimation({ timingFunction: 'ease' })
  650. animation.opacity(1).step({ duration: this.durationMath1 })
  651. animation.top('76rpx').left('60rpx').step({ duration: Math.floor(Math.random() * 101) + 650, delay: 100 }) //
  652. animation.opacity(0).top(item.top).left(item.left).step({ duration: 0 })
  653. return animation.export()
  654. })
  655. },
  656. // 更多书币
  657. moreGold() {
  658. let path = 'pages/index/index'
  659. if(Object.keys(this.mpData).length > 0) {
  660. path = path + this.getSerialize(this.mpData)
  661. }
  662. uni.navigateToMiniProgram({
  663. appId: 'wxe1b04d1d8f6df382',
  664. path,
  665. success(res) {
  666. // 打开成功
  667. }
  668. })
  669. },
  670. // 对象序列化成 a=1&b=2
  671. getSerialize(value) {
  672. if(Object.prototype.toString.call(value) === "[object Object]") {
  673. let path = ""
  674. for (const key in value) {
  675. if (Object.prototype.hasOwnProperty.call(value, key)) {
  676. const element = value[key];
  677. if (path === "") {
  678. path = `?${key}=${element}`
  679. }else {
  680. path = path + `&${key}=${element}`
  681. }
  682. }
  683. }
  684. return path
  685. } else {
  686. return ""
  687. }
  688. },
  689. // 判断模板消息是否点击了总是允许
  690. getSetting() {
  691. return new Promise((resolve, reject) => {
  692. uni.getSetting({
  693. withSubscriptions: true,
  694. success: resSetting => {
  695. console.log('订阅消息---->', resSetting)
  696. let { subscriptionsSetting } = resSetting
  697. if (subscriptionsSetting) {
  698. let { mainSwitch, itemSettings, ...data } = subscriptionsSetting
  699. if (data && Object.keys(data).length > 0) {
  700. if (mainSwitch) {
  701. for (const key in data) {
  702. if (Object.prototype.hasOwnProperty.call(data, key)) {
  703. const element = data[key];
  704. if (element === 'accept') {
  705. resolve(200) // 总是允许开启
  706. } else {
  707. resolve(400) // 总是允许取消
  708. }
  709. }
  710. }
  711. } else {
  712. resolve(401) // 后台关闭开关
  713. }
  714. } else {
  715. resolve(402) // 没有点总是允许
  716. }
  717. } else {
  718. resolve(402) // 没有点总是允许
  719. }
  720. }
  721. })
  722. })
  723. },
  724. handleMessage(remindSwitch, allowSwitch = 0) { // 设置签到消息接口
  725. let { mpName, ...mp } = this.mpData
  726. setMessage({appId: config.appid, openId: this.openId, allowSwitch, remindSwitch, ...mp}).then(res => {
  727. this.getList()
  728. this.showInterstitialAd()
  729. })
  730. },
  731. // 获取模板签到ID
  732. getTemplate() {
  733. getTemplateIDs({appId: config.appid, type: 1}).then(res => {
  734. this.signIdTemID = [res.data]
  735. })
  736. },
  737. // 获取首页数据
  738. async getList(signTime) {
  739. let data = {appId: config.appid, userSource: 1, openId: this.openId, ...this.mpData, ...(signTime ? {signTime} : {})}
  740. let res = await getHome(data)
  741. if (res.data) {
  742. this.mpData = {
  743. mpAppId: res.data.mpAppId,
  744. mpName: res.data.mpName,
  745. mpOpenId: res.data.mpOpenId
  746. }
  747. this.signData = res.data
  748. this.signRemind = res.data.loginRemindSwitch === 0 ? false : true
  749. this.getTemplate()
  750. this.getBookCurr()
  751. }
  752. },
  753. /** 补签*/
  754. repairSign(data) {
  755. let { dayTime, dayNum } = data
  756. signInAjax({watchVideo: false, supplement: true, appId: config.appid, openId: this.openId, dayNum, dayTime, ...this.mpData}).then(res => {
  757. this.getList(res.data)
  758. this.startGold(false)
  759. uni.showToast({
  760. title: '补签成功',
  761. icon: 'success'
  762. })
  763. setTimeout(() => {
  764. this.showInterstitialAd()
  765. }, 20000)
  766. })
  767. },
  768. getTimer() { // 获取年月日时分秒
  769. let timestamp = Date.parse(new Date())
  770. let date = new Date(timestamp)
  771. let Y = date.getFullYear()
  772. let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
  773. let D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
  774. return `${Y}${M}${D}`
  775. },
  776. /** 签到提醒按钮 */
  777. signRemindHandle(state) {
  778. if (!this.signData.mpName) {
  779. uni.navigateTo({
  780. url: '../officialAccount/officialAccount'
  781. })
  782. return
  783. }
  784. if(state) { // 点击开启
  785. if (this.signIdTemID.length > 0) {
  786. uni.requestSubscribeMessage({
  787. tmplIds: this.signIdTemID,
  788. success: async res => {
  789. let { errMsg, ...massageData } = res
  790. console.log('------>', res)
  791. let msg = await this.getSetting()
  792. console.log('----2222---->', msg)
  793. if(msg === 400) {
  794. uni.showToast({
  795. title: '签到消息微信关闭,如要开启通知,请到通知管理开启',
  796. icon: 'none',
  797. duration: 2000
  798. })
  799. return
  800. } else if(msg === 401) {
  801. uni.showToast({
  802. title: '通知管理按钮关闭,如要开启通知,请到通知管理开启',
  803. icon: 'none',
  804. duration: 2000
  805. })
  806. } else {
  807. for (const key in massageData) {
  808. if (Object.prototype.hasOwnProperty.call(massageData, key)) {
  809. const element = massageData[key];
  810. if (element === 'accept') { // 允许
  811. console.log('msg--->', msg)
  812. this.handleMessage(1, msg === 200 ? 1 : 0)
  813. } else if (element === 'reject') { // 取消
  814. }
  815. }
  816. }
  817. }
  818. }
  819. })
  820. } else {
  821. uni.showToast({
  822. title: '模板ID为空',
  823. icon: 'none'
  824. })
  825. }
  826. } else { // 点击关闭
  827. this.handleMessage(0, 0)
  828. }
  829. },
  830. /** 活动规则展开和收起 */
  831. activityRulesHandle() {
  832. this.activityRules = !this.activityRules
  833. },
  834. /** 签到 */
  835. signIn() {
  836. if(!this.signData.mpName) {
  837. uni.showToast({
  838. title: '请先关注公众号',
  839. icon: 'none'
  840. })
  841. return
  842. }
  843. this.signInDay = this.signData.signInDayVoList.find(item => item.canSign)
  844. this.popupShow = true
  845. },
  846. /** 关闭弹窗 */
  847. closeHandle() {
  848. this.popupShow = false
  849. this.signInHandle(false)
  850. },
  851. /** 签到 */
  852. signInHandle(watchVideo) {
  853. let signInDay = this.signData.signInDayVoList.find(item => item.canSign)
  854. console.log(signInDay)
  855. if (signInDay) {
  856. let { dayTime, dayNum, signIn } = signInDay
  857. if (!signIn) {
  858. signInAjax({watchVideo, supplement: false, appId: config.appid, openId: this.openId, dayNum, dayTime, ...this.mpData}).then(res => {
  859. this.getList()
  860. this.startGold(watchVideo)
  861. this.popupShow = false
  862. if(!watchVideo) {
  863. this.showInterstitialAd()
  864. } else {
  865. setTimeout(() => {
  866. this.showInterstitialAd()
  867. }, 20000)
  868. }
  869. })
  870. } else {
  871. uni.showToast({
  872. title: '今日已签!',
  873. icon: 'error'
  874. })
  875. }
  876. } else {
  877. uni.showToast({
  878. title: '数据获取失败!',
  879. icon: 'error'
  880. })
  881. }
  882. }
  883. }
  884. }
  885. </script>
  886. <style lang="scss">
  887. page{
  888. background-color: #FC6E53;
  889. }
  890. .sign {
  891. position: relative;
  892. &>.back {
  893. width: 100%;
  894. margin-top: 104rpx;
  895. }
  896. .signCenter {
  897. position: absolute;
  898. top: 0;
  899. margin: 40rpx 0 60rpx;
  900. font-family: PingFangSC-Medium, PingFang SC;
  901. }
  902. .signTop {
  903. padding: 0 28rpx;
  904. height: 104rpx;
  905. display: flex;
  906. justify-content: space-between;
  907. align-items: center;
  908. .left{
  909. display: flex;
  910. justify-content: flex-start;
  911. align-items: center;
  912. .avatarView{
  913. width: 104rpx;
  914. height: 104rpx;
  915. overflow: hidden;
  916. border-radius: 10px;
  917. .avatar {
  918. width: 104rpx;
  919. height: 104rpx;
  920. background: #D8D8D8;
  921. }
  922. &>image {
  923. width: 100%;
  924. height: 100%;
  925. }
  926. }
  927. .userInfo{
  928. margin-left: 28rpx;
  929. &>view{
  930. font-size: 28rpx;
  931. font-weight: 400;
  932. color: #FFFFFF;
  933. &.ID{
  934. margin-top: 4rpx;
  935. display: flex;
  936. justify-content: flex-start;
  937. align-items: center;
  938. }
  939. .extract {
  940. font-size: 30rpx;
  941. margin-left: 30rpx;
  942. background-color: rgb(213, 51, 186);
  943. // background-image: linear-gradient(to right, rgb(66, 83, 216), rgb(213, 51, 186));
  944. padding: 6rpx 16rpx;
  945. border-radius: 26rpx;
  946. }
  947. }
  948. }
  949. }
  950. .right{
  951. width: 212rpx;
  952. height: 68rpx;
  953. background-color: #FFFFFF;
  954. border-radius: 40rpx;
  955. display: flex;
  956. justify-content: center;
  957. align-items: center;
  958. &>image {
  959. width: 28rpx;
  960. height: 32rpx;
  961. }
  962. &>text {
  963. font-size: 28rpx;
  964. font-weight: 400;
  965. color: #FD9C01;
  966. margin-left: 18rpx;
  967. }
  968. }
  969. }
  970. // 滚动通知
  971. .notice {
  972. width: 656rpx;
  973. height: 68rpx;
  974. background: #C7322C;
  975. box-shadow: 0px 4rpx 8rpx 0rpx rgba(49, 49, 49, 0.08);
  976. border-radius: 38rpx;
  977. opacity: 0.53;
  978. margin: 58rpx auto 0;
  979. padding: 0 30rpx;
  980. box-sizing: border-box;
  981. display: flex;
  982. justify-content: flex-start;
  983. align-items: center;
  984. margin-bottom: 30rpx;
  985. .horn {
  986. width: 28rpx;
  987. height: 28rpx;
  988. }
  989. .txts {
  990. // flex: 1;
  991. height: 68rpx;
  992. width: 600rpx;
  993. }
  994. }
  995. .signBottom{
  996. margin: 0 14rpx;
  997. margin-top: 160rpx;
  998. width: 722rpx;
  999. }
  1000. .exhibitionContent{
  1001. padding: 26rpx 26rpx 40rpx;
  1002. box-sizing: border-box;
  1003. background-color: #FFFFFF;
  1004. border-radius: 22rpx;
  1005. box-shadow: 0px 4rpx 8rpx 0rpx rgba(230, 230, 230, 0.5);
  1006. &>.ts {
  1007. font-size: 28rpx;
  1008. font-weight: 400;
  1009. color: #666666;
  1010. }
  1011. &>.signinExhibition {
  1012. margin-top: 18rpx;
  1013. display: flex;
  1014. justify-content: space-between;
  1015. flex-wrap: wrap;
  1016. &>view{
  1017. width: 152rpx;
  1018. height: 168rpx;
  1019. background: #FFF7EF;
  1020. box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(254, 173, 165, 0.26);
  1021. border-radius: 16rpx;
  1022. border: 2rpx solid #FFB35C;
  1023. margin-bottom: 20rpx;
  1024. padding: 12rpx;
  1025. box-sizing: border-box;
  1026. display: flex;
  1027. flex-direction: column;
  1028. justify-content: flex-start;
  1029. align-items: center;
  1030. position: relative;
  1031. .day{
  1032. font-size: 24rpx;
  1033. font-weight: 500;
  1034. color: #FF9011;
  1035. }
  1036. &>.goldCoins {
  1037. height: 68rpx;
  1038. margin: 5rpx 0;
  1039. }
  1040. .reward{
  1041. font-size: 24rpx;
  1042. font-weight: 500;
  1043. color: #FE604F;
  1044. }
  1045. &:last-child{
  1046. width: 322rpx;
  1047. display: flex;
  1048. justify-content: space-between;
  1049. flex-direction: row;
  1050. &>.left {
  1051. display: flex;
  1052. flex-direction: column;
  1053. align-items: flex-start;
  1054. margin-left: 35rpx;
  1055. height: 100%;
  1056. flex: 1;
  1057. .reward{
  1058. margin-top: 28rpx;
  1059. font-size: 32rpx;
  1060. font-weight: 500;
  1061. }
  1062. }
  1063. &>.right {
  1064. width: 115rpx;
  1065. height: 100%;
  1066. display: flex;
  1067. justify-content: center;
  1068. align-items: center;
  1069. &>image{
  1070. width: 108rpx;
  1071. height: 128rpx;
  1072. }
  1073. }
  1074. }
  1075. // 已签到
  1076. &.select {
  1077. overflow: hidden;
  1078. border: 2rpx solid #D2D2D2;
  1079. background: #F2F2F2;
  1080. .day, .reward{
  1081. color: #999999;
  1082. }
  1083. }
  1084. .signSub {
  1085. position: absolute;
  1086. bottom: 0;
  1087. right: 0;
  1088. width: 72rpx;
  1089. }
  1090. // 看视频补签
  1091. &.repairSign {
  1092. position: relative;
  1093. .repair {
  1094. position: absolute;
  1095. width: calc(100% + 2rpx);
  1096. left: -1rpx;
  1097. top: -1rpx;
  1098. text-align: center;
  1099. line-height: 46rpx;
  1100. height: 46rpx;
  1101. background: #FE604F;
  1102. font-size: 24rpx;
  1103. font-weight: 500;
  1104. color: #FFFFFF;
  1105. border-radius: 16rpx 16rpx 0 0;
  1106. }
  1107. }
  1108. }
  1109. }
  1110. &>.gignBt {
  1111. width: 456rpx;
  1112. height: 80rpx;
  1113. line-height: 80rpx;
  1114. text-align: center;
  1115. // background-color: #D8D8D8;
  1116. background: linear-gradient(180deg, #FDC606 0%, #FF8D12 100%);
  1117. box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(241, 139, 11, 0.61);
  1118. margin: 40rpx auto 0;
  1119. font-size: 32rpx;
  1120. font-weight: 500;
  1121. color: #FFFFFF;
  1122. border-radius: 40rpx;
  1123. }
  1124. &>.already{
  1125. margin: 40rpx auto 0;
  1126. width: 456rpx;
  1127. height: 80rpx;
  1128. background: #D8D8D8;
  1129. border-radius: 40rpx;
  1130. font-size: 32rpx;
  1131. font-weight: 500;
  1132. color: #FFFFFF;
  1133. line-height: 80rpx;
  1134. text-align: center;
  1135. }
  1136. }
  1137. .signRemind {
  1138. margin-top: 40rpx;
  1139. height: 92rpx;
  1140. background: rgba(255, 255, 255, 0.15);
  1141. border-radius: 20rpx;
  1142. line-height: 92rpx;
  1143. color: #FFFFFF;
  1144. font-size: 32rpx;
  1145. padding: 0 28rpx;
  1146. box-sizing: border-box;
  1147. display: flex;
  1148. font-weight: 400;
  1149. justify-content: space-between;
  1150. .remindSwitch{
  1151. display: flex;
  1152. justify-content: flex-start;
  1153. align-items: center;
  1154. &>view {
  1155. display: flex;
  1156. justify-content: flex-start;
  1157. align-items: center;
  1158. &>text {
  1159. font-weight: 400;
  1160. font-size: 32rpx;
  1161. margin-left: 12rpx;
  1162. }
  1163. &.open > .select {
  1164. width: 24rpx;
  1165. height: 24rpx;
  1166. background: #FFFFFF;
  1167. border-radius: 24rpx;
  1168. }
  1169. &.close > .select {
  1170. width: 24rpx;
  1171. height: 24rpx;
  1172. border: 2rpx solid #FFFFFF;
  1173. box-sizing: border-box;
  1174. border-radius: 24rpx;
  1175. }
  1176. &:first-child {
  1177. margin-right: 38rpx;
  1178. }
  1179. }
  1180. }
  1181. }
  1182. .activityRules {
  1183. margin-top: 40rpx;
  1184. background: rgba(255, 255, 255, 0.15);
  1185. border-radius: 20rpx;
  1186. color: #FFFFFF;
  1187. font-size: 32rpx;
  1188. font-weight: 400;
  1189. &>.top {
  1190. height: 92rpx;
  1191. padding: 0 28rpx;
  1192. box-sizing: border-box;
  1193. display: flex;
  1194. justify-content: space-between;
  1195. align-items: center;
  1196. &>image {
  1197. width: 40rpx;
  1198. }
  1199. }
  1200. &>.bottom {
  1201. padding: 0 28rpx 30rpx;
  1202. box-sizing: border-box;
  1203. &> view {
  1204. margin-bottom: 12rpx;
  1205. font-size: 28rpx;
  1206. font-weight: 400;
  1207. color: #FFFFFF;
  1208. line-height: 46rpx;
  1209. }
  1210. }
  1211. }
  1212. .popup {
  1213. position: fixed;
  1214. width: 100%;
  1215. height: 100vh;
  1216. background: rgba(0, 0, 0, 0.6);
  1217. top: 0;
  1218. left: 0;
  1219. right: 0;
  1220. bottom: 0;
  1221. .popupContent {
  1222. width: 632rpx;
  1223. position: absolute;
  1224. top: 50%;
  1225. left: 50%;
  1226. transform: translate(-50%, -50%);
  1227. text-align: center;
  1228. &>.content {
  1229. position: relative;
  1230. &>image {
  1231. width: 100%;
  1232. height: 652rpx;
  1233. }
  1234. &>.textCon {
  1235. position: absolute;
  1236. width: 100%;
  1237. top: 0;
  1238. left: 0;
  1239. right: 0;
  1240. bottom: 0;
  1241. padding-top: 192rpx;
  1242. .ts {
  1243. font-size: 60rpx;
  1244. font-weight: 500;
  1245. color: #F5631D;
  1246. }
  1247. .reward {
  1248. height: 60rpx;
  1249. background: #FFD9A2;
  1250. border-radius: 31rpx;
  1251. font-size: 32rpx;
  1252. font-weight: 400;
  1253. display: inline-block;
  1254. padding: 0 32rpx;
  1255. color: #F5631E;
  1256. line-height: 60rpx;
  1257. margin-top: 20rpx;
  1258. }
  1259. .doubleBt {
  1260. width: 456rpx;
  1261. height: 104rpx;
  1262. margin-top: 90rpx;
  1263. transition: all linear .5s;
  1264. }
  1265. .bt {
  1266. margin-top: 14rpx;
  1267. font-size: 32rpx;
  1268. font-weight: 400;
  1269. color: #FCE8CD;
  1270. display: inline-block;
  1271. text-align: center;
  1272. }
  1273. .btTrue {
  1274. width: 300rpx;
  1275. height: 68rpx;
  1276. background-color: #ffd555;
  1277. line-height: 68rpx;
  1278. color: #831902;
  1279. font-size: 36rpx;
  1280. font-weight: 700;
  1281. border-radius: 34rpx;
  1282. }
  1283. }
  1284. }
  1285. &>.close {
  1286. width: 54rpx;
  1287. height: 54rpx;
  1288. margin-top: 76rpx;
  1289. }
  1290. }
  1291. }
  1292. .fragmentGold {
  1293. position: absolute;
  1294. z-index: 100;
  1295. opacity: 0;
  1296. &>image {
  1297. width: 68rpx;
  1298. height: 68rpx;
  1299. }
  1300. }
  1301. .qLuckDraw {
  1302. position: absolute;
  1303. top: 240rpx;
  1304. right: 8rpx;
  1305. z-index: 200;
  1306. animation: lanimation 1.3s linear infinite;
  1307. &>image {
  1308. width: 150rpx;
  1309. height: 150rpx;
  1310. }
  1311. }
  1312. .receiveTs {
  1313. position: absolute;
  1314. border: 2rpx solid rgb(242, 164, 39);
  1315. top: 350rpx;
  1316. z-index: 100;
  1317. color: #FFFFFF;
  1318. left: 50%;
  1319. transform: translateX(-50%);
  1320. padding: 10rpx 20rpx;
  1321. background-color: rgba(195, 106, 106, 0.6);
  1322. border-radius: 5rpx;
  1323. opacity: 0;
  1324. }
  1325. .singleLattice {
  1326. position: fixed;
  1327. top: 200rpx;
  1328. right: 4rpx;
  1329. }
  1330. }
  1331. @-webkit-keyframes lanimation {
  1332. 0% {
  1333. transform: rotate(0deg);
  1334. }
  1335. 8% {
  1336. transform: rotate(12deg);
  1337. }
  1338. 16% {
  1339. transform: rotate(0deg);
  1340. }
  1341. 24% {
  1342. transform: rotate(-12deg);
  1343. }
  1344. 32% {
  1345. transform: rotate(0deg);
  1346. }
  1347. 100% {
  1348. transform: rotate(0deg);
  1349. }
  1350. }
  1351. .code {
  1352. padding: 0 40rpx 40px;
  1353. display: flex;
  1354. flex-direction: column;
  1355. align-items: center;
  1356. .uni-input {
  1357. margin-top: 40rpx;
  1358. border: 1rpx solid #FFFFFF;
  1359. padding: 10rpx;
  1360. border-radius: 8rpx;
  1361. color: #FFFFFF;
  1362. width: 100%;
  1363. }
  1364. .codeBt {
  1365. margin: 60rpx auto 0;
  1366. width: 250rpx;
  1367. padding: 16rpx;
  1368. text-align: center;
  1369. background: #FFFFFF;
  1370. border-radius: 10rpx;
  1371. }
  1372. .codeImg {
  1373. margin-top: 80rpx;
  1374. width: 80%;
  1375. }
  1376. }
  1377. </style>