Commit 7e9f6105 authored by ziyu's avatar ziyu

docs: 修改

parent fed94c40
{"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/common/api.js":{"size":1456,"mtime":1591152013873,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/common/api.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/common/eventHub.js":{"size":85,"mtime":1589859265146,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/common/eventHub.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/china.js":{"size":98459,"mtime":1591152013874,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/china.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/loading.wpy":{"size":546,"mtime":1590668180981,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/loading.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/network.wpy":{"size":1393,"mtime":1590668180982,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/network.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/openAnimation.wpy":{"size":16975,"mtime":1590668180983,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/openAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/popup.wpy":{"size":4193,"mtime":1590668180984,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/popup.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/sharedPopup.wpy":{"size":7796,"mtime":1590748788488,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/sharedPopup.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/sign.wpy":{"size":11289,"mtime":1591009136706,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/sign.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/starAnimation.wpy":{"size":3928,"mtime":1590668180988,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/starAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/videolist.wpy":{"size":10575,"mtime":1591152013874,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/videolist.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/videoPause.wpy":{"size":898,"mtime":1589859265147,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/components/custom/videoPause.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/mixins/test.js":{"size":322,"mtime":1589859265230,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/mixins/test.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/help.wpy":{"size":2955,"mtime":1591152013874,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/help.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/morehelp.wpy":{"size":253,"mtime":1590668181078,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/morehelp.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/myraffles.wpy":{"size":3338,"mtime":1591152013874,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/myraffles.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/prize.wpy":{"size":7816,"mtime":1591152530875,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/prize.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/store/index.js":{"size":539,"mtime":1590668181080,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/store/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/app.wpy":{"size":1303,"mtime":1591152044593,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/app.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/common/raffleProbability.js":{"size":708,"mtime":1591152141364,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/common/raffleProbability.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/common/wxRequest.js":{"size":1780,"mtime":1590748788487,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/common/wxRequest.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/raffle.wpy":{"size":7289,"mtime":1591153023372,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/raffle.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/index.wpy":{"size":24127,"mtime":1591153127282,"hashOfConfig":"2o995l","results":{"filePath":"/Users/xuezhijie/workspace/quant/mini-program-wepy/src/pages/index.wpy","messages":[],"errorCount":0,"warningCount":0}}}
\ No newline at end of file
{"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/app.wpy":{"size":1313,"mtime":1591252796981,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/app.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/api.js":{"size":1456,"mtime":1591238093270,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/api.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/eventHub.js":{"size":85,"mtime":1589422331949,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/eventHub.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/raffleProbability.js":{"size":708,"mtime":1591238093271,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/raffleProbability.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/wxRequest.js":{"size":1910,"mtime":1591325891351,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/wxRequest.js","messages":[],"errorCount":0,"warningCount":0,"output":"import wepy from '@wepy/core';\nimport Notify from '../components/vant/notify/notify';\n\nconst env = 'test'; // 每次上线手动切换成 prod/test\nlet baseUrl = 'https://api-luckii.q-gp.com';\nif (env === 'test') {\n baseUrl = 'https://luckii-qa.liangkebang.net';\n}\nconst request = async (url, options) => {\n const pages = getCurrentPages();\n const safeAreaInsetTop = pages && pages.length > 0 ? pages[pages.length - 1].route === 'pages/index' : false;\n const defaultOptions = {\n method: 'post',\n header: { 'content-type': 'application/x-www-form-urlencoded' }\n };\n options = { ...defaultOptions, ...options };\n options.header = {\n ...options.header,\n openid: wx.getStorageSync('openId') || ''\n };\n\n url = baseUrl + url;\n\n const isConnected = wx.getStorageSync('onNetworkStatusChange');\n if (!isConnected) {\n wx.showToast({\n title: '无网络',\n icon: 'loading',\n duration: 2000\n });\n return;\n }\n\n return wepy.wx.request({\n url: url,\n data: options.data,\n method: options.method,\n header: options.header\n }).then(res => {\n if (res.statusCode === 200) {\n if (res.data.code === 2000) {\n return res.data.data;\n }\n Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop });\n throw new Error(res.data.msg || '服务器异常,请求url:' + url);\n }\n Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop });\n throw new Error(res.data.msg || '服务器异常,请求url:' + url);\n });\n};\n\nconst post = (url, data, header) => {\n const options = {\n method: 'post',\n data,\n header\n };\n if (!header) delete options.header;\n return request(url, options);\n};\n\nconst get = (url, data) => {\n const options = {\n method: 'get',\n data\n };\n return request(url, options);\n};\n\nmodule.exports = {\n post: post,\n get: get,\n request\n};\n"}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/china.js":{"size":98459,"mtime":1591238093273,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/china.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/loading.wpy":{"size":546,"mtime":1590134820731,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/loading.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/network.wpy":{"size":1393,"mtime":1590498072416,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/network.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/openAnimation.wpy":{"size":16975,"mtime":1590665931744,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/openAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/popup.wpy":{"size":4193,"mtime":1590645030605,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/popup.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sharedPopup.wpy":{"size":7796,"mtime":1590977785792,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sharedPopup.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sign.wpy":{"size":11289,"mtime":1590977785793,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sign.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/starAnimation.wpy":{"size":3928,"mtime":1590659119391,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/starAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/videolist.wpy":{"size":10581,"mtime":1591344401542,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/videolist.wpy","messages":[],"errorCount":0,"warningCount":0,"output":"<style lang=\"less\">\n .container,.video-swiper{\n width:100%;\n height:100%;\n }\n .video-item{\n height:100%;\n width:100%;\n position: absolute;\n z-index: 1;\n display: flex;\n align-items: center;\n }\n .video-wrapper {\n width: 100%;\n }\n .rightcont {\n font-size: 24rpx;\n position: absolute;\n z-index: 9;\n bottom: 415rpx;\n width:30%;\n right: 30rpx;\n color: #fff;\n .info {\n line-height: 40rpx;\n }\n }\n .progress {\n width: 180rpx;\n height: 20rpx;\n background-color: #fff;\n margin-top: 10rpx;\n color: #666;\n position: relative;\n .text {\n position: absolute;\n top:0;\n left:0;\n width:100%;\n height:100%;\n z-index: 2;\n text-align: center;\n line-height:20rpx;\n background-color: transparent;\n font-size: 18rpx;\n }\n .orange {\n width: 0;\n height:100%;\n transition:all .6s;\n background-color: #FF5D15;\n }\n }\n .images {\n width: 100%;\n }\n</style>\n<template>\n <view class=\"container\">\n <swiper\n class=\"video-swiper\"\n :duration= \"800\"\n circular=\"{{circular}}\"\n vertical\n current=\"1\"\n bindchange=\"bindchange\"\n >\n <!-- curQueue 循环会导致video重新插入,objectFit 不可变更 -->\n <swiper-item class=\"video-item\" v-for=\"(item, idx) in curQueue\" :key=\"item.id\">\n <view class=\"video-wrapper\">\n <!-- <video\n id=\"video_{{index}}\"\n class=\"video_item\"\n loop\n show-center-play-btn=\"{{false}}\"\n controls=\"{{false}}\"\n src=\"{{item.url}}\"\n data-id=\"{{item.id}}\"\n object-fit=\"{{item.objectFit || 'contain'}}\"\n data-index=\"{{index}}\"\n binderror=\"onError\"\n bindwaiting=\"onWaiting\"\n bindloadedmetadata=\"onLoadedMetaData\"\n bindtimeupdate=\"onTimeUpdate\"\n @tap=\"videoTap\"\n >\n <video-pause :pause=\"pause\"></video-pause>\n </video> < !-->\n <view class=\"rightcont\">\n <view class=\"info\">奖品库存: {{item.stock}}/{{item.totalStock}}</view>\n <view class=\"info\">中奖概率: {{item.probability}}</view>\n <view class=\"progress\">\n <view class=\"text\">{{item.progress}}</view>\n <view class=\"orange\" style=\"{{item.progressStyle}}\"></view>\n </view>\n </view>\n <!-- <van-image lazy-load custom-class=\"images\" :src=\"item.photoUrl\" mode=\"contain\" /> -->\n <image class=\"images\" :src=\"item.photoUrl\" mode=\"widthFix\"></image>\n <!-- <video-loading v-if=\"item.time === 0\"/> -->\n </view>\n </swiper-item>\n </swiper>\n </view>\n</template>\n<script>\n import wepy from '@wepy/core';\n import { getProbability } from '../../common/raffleProbability';\n import { getAwardsDetail } from '../../common/api.js';\n\n const fn = async function(time) {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve();\n }, time);\n });\n };\n\n wepy.component({\n props: {\n videoList: {\n type: Array,\n value: []\n },\n loading: {\n type: Boolean,\n default: false\n },\n duration: {\n type: Number,\n value: 800\n },\n total: {\n type: Number,\n value: 0\n },\n userAccount: {\n type: Number,\n value: 0\n }\n },\n data: {\n pause: false,\n nextQueue: [],\n prevQueue: [],\n curQueue: [],\n circular: false,\n _last: 1,\n _change: -1,\n _invalidUp: 0,\n _invalidDown: 0,\n _videoContexts: [],\n loading: false,\n isFirstUp: true\n },\n watch: {\n videoList () {\n const newVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n this.loading = false;\n if (!newVal.length) return;\n this._videoListChanged(newVal);\n// this.compute(this.userAccount);\n },\n userAccount(newVal) {\n this.compute(newVal);\n }\n },\n attached() {\n // this._videoContexts = [\n // wx.createVideoContext('video_0', this.$wx),\n // wx.createVideoContext('video_1', this.$wx),\n // wx.createVideoContext('video_2', this.$wx)\n // ];\n },\n created() {\n this.compute(this.userAccount);\n },\n methods: {\n compute (newVal) {\n if (!this.curQueue.length) return;\n this.nextQueue.forEach(v => {\n v.probability = getProbability(+newVal, +v.coinQuantity);\n });\n\n this.curQueue.forEach(v => {\n v.probability = getProbability(+newVal, +v.coinQuantity);\n });\n\n this.prevQueue.forEach(v => {\n v.probability = getProbability(+newVal, +v.coinQuantity);\n });\n\n this.curQueue = [...this.curQueue];\n this.nextQueue = [...this.nextQueue];\n this.prevQueue = [...this.prevQueue];\n },\n async getProgress(id) {\n let detail = await getAwardsDetail({ prizeId: id });\n detail = detail || {};\n const progress = Math.round((detail.join / detail.quantity) * 100) + '%';\n this.nextQueue.forEach(v => {\n if (v.id === id) {\n if (v.id === id) {\n v.progress = progress;\n v.batchId = detail.id;\n v.progressStyle = 'width:' + progress;\n }\n }\n });\n\n this.curQueue.forEach(v => {\n if (v.id === id) {\n v.progress = progress;\n v.batchId = detail.id;\n v.progressStyle = 'width:' + progress;\n }\n });\n\n this.prevQueue.forEach(v => {\n if (v.id === id) {\n v.progress = progress;\n v.batchId = detail.id;\n v.progressStyle = 'width:' + progress;\n }\n });\n\n this.curQueue = [...this.curQueue];\n this.nextQueue = [...this.nextQueue];\n this.prevQueue = [...this.prevQueue];\n },\n _videoListChanged (newVal) {\n newVal.forEach((item, index) => {\n item.time = 0;\n this.nextQueue.push(item);\n });\n if (!this.curQueue.length) {\n this.curQueue = this.nextQueue.splice(0, 3);\n this.compute(this.userAccount);\n this.playCurrent(1);\n }\n },\n async bindchange(e) {\n const current = e.$wx.detail.current;\n const diff = current - this._last;\n if (diff === 0) return;\n this._last = current;\n this.playCurrent(current);\n this.$emit('change', { activeId: this.curQueue[current].id });\n this.loading = true;\n\n if (current === 2 && this.isFirstUp) {\n this.isFirstUp = false;\n await fn(700);\n }\n\n const direction = diff === 1 || diff === -2 ? 'up' : 'down';\n if (direction === 'up') {\n if (this._invalidDown === 0) {\n const change = (this._change + 1) % 3;\n const add = this.nextQueue.shift();\n const remove = this.curQueue[change];\n if (add) {\n this.prevQueue.push(remove);\n this.curQueue[change] = add;\n this._change = change;\n if (this.nextQueue.length === 0) this.nextQueue.push(this.prevQueue.shift());\n } else {\n this._invalidUp += 1;\n }\n } else {\n this._invalidDown -= 1;\n }\n }\n if (direction === 'down') {\n if (this._invalidUp === 0) {\n const _change2 = this._change;\n const _remove = this.curQueue[_change2];\n const _add = this.prevQueue.pop();\n if (_add) {\n this.curQueue[_change2] = _add;\n this.nextQueue.unshift(_remove);\n this._change = (_change2 - 1 + 3) % 3;\n if (this.prevQueue.length === 0) this.prevQueue.push(this.nextQueue.pop());\n } else {\n this._invalidDown += 1;\n }\n } else {\n this._invalidUp -= 1;\n }\n }\n this.curQueue = [...this.curQueue];\n this.nextQueue = [...this.nextQueue];\n this.prevQueue = [...this.prevQueue];\n this.circular = true;\n\n if (this.nextQueue.length === 0 && current !== 0) {\n this.circular = false;\n }\n if (this.prevQueue.length === 0 && current !== 2) {\n this.circular = false;\n }\n },\n onWaiting (e) {\n this.trigger(e, 'wait');\n },\n onLoadedMetaData (e) {\n this.trigger(e, 'loadedmetadata');\n },\n onError(e) {\n this.trigger(e, 'error');\n },\n onTimeUpdate(e) {\n const currentTime = e.$wx.detail.currentTime;\n if (currentTime > 0 && currentTime < 10) {\n const id = e.target.dataset.id;\n this.curQueue.forEach((v, i) => {\n if (v.id === id && v.time === 0) {\n this.curQueue[i].time = currentTime;\n }\n });\n this.curQueue = [...this.curQueue];\n }\n },\n playCurrent(current) {\n if (!this.curQueue || this.curQueue.length <= 1) return;\n this.getProgress(this.curQueue[current].id);\n const { id, photoUrl, name, probability } = this.curQueue[current];\n this.$emit('getAwardsInfo', {\n id,\n photoUrl,\n quantity: this.userAccount,\n name,\n chance: probability\n });\n // this._videoContexts.forEach((ctx, index) => {\n // if (index !== current) {\n // ctx.pause();\n // } else {\n // ctx.play();\n // }\n // });\n },\n trigger(e, type) {\n var ext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var detail = e.$wx.detail;\n var activeId = e.target.dataset.id;\n this.$emit(type, Object.assign(Object.assign(Object.assign({}, detail), { activeId: activeId }), ext));\n },\n videoTap(e) {\n const current = e.currentTarget.dataset.index;\n this._videoContexts.forEach((ctx, index) => {\n if (index === current) {\n this.pause ? ctx.play() : ctx.pause();\n }\n });\n this.pause = !this.pause;\n },\n cancelPause() {\n // console.log('bindchange');\n this.pause = false;\n }\n }\n });\n</script>\n<config>\n{\n usingComponents: {\n 'video-pause': '\\x7e@/components/custom/videoPause',\n 'video-loading': '~@/components/custom/loading',\n \"van-image\": \"~@/components/vant/image/index\"\n }\n}\n</config>\n"}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/videoPause.wpy":{"size":898,"mtime":1589889870499,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/videoPause.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/mixins/test.js":{"size":322,"mtime":1589422332026,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/mixins/test.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/help.wpy":{"size":2930,"mtime":1591238093274,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/help.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/index.wpy":{"size":24513,"mtime":1591345798954,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/index.wpy","messages":[],"errorCount":0,"warningCount":0,"output":"<style lang=\"less\">\n page{\n height: 100%;\n background-color: #000;\n }\n .video-wrapper{\n width: 100%;\n height: 100%;\n }\n #myvideo{\n width: 100%;\n height: 100%;\n position: absolute;\n z-index: 0;\n background-color:rgba(0, 0, 0, 0.7);\n }\n .userInfo{\n position: fixed;\n z-index: 10;\n top:100rpx;\n left: 30rpx;\n }\n .userinfo-button {\n width: 80rpx;\n height: 80rpx;\n padding: 0;\n border: none;\n background-color: transparent;\n &::after {\n border: none;\n };\n .userinfo-image {\n width: 80rpx;\n height: 80rpx;\n border-radius: 50%;\n }\n }\n\n .userimage{\n width: 80rpx;\n height: 80rpx;\n border-radius: 50%;\n }\n @-webkit-keyframes fadeout {\n 0% {\n opacity:1 ;\n }\n 100% {\n opacity: 0;\n }\n }\n .content{\n position: absolute;\n z-index: 9;\n bottom: 400rpx;\n width: 100%;\n color: white;\n clear: both;\n &.anima {\n animation:fadeout 2s;\n }\n &.hide {\n display: none;\n }\n }\n .leftcont {\n width: 44%;\n float: left;\n font-size: 24rpx;\n margin-left: 30rpx;\n }\n .list-wrapper {\n height: 120rpx;\n }\n .leftcont .img {\n width: 40rpx;\n height: 40rpx;\n border-radius: 50%;\n vertical-align: middle;\n }\n .leftcont .text {\n max-width: 200rpx;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-left: 10rpx;\n vertical-align: middle;\n border-radius: 20rpx;\n display: inline-block;\n font-size: 20rpx;\n box-sizing: border-box;\n padding:6rpx 15rpx;\n background-color:rgba(238, 238, 238, 0.2);\n }\n\n .footer {\n position: absolute;\n z-index: 9;\n bottom: 20rpx;\n width: 100%;\n }\n .footswiper {\n height: 360rpx;\n }\n .list-item{\n width:220rpx;\n /*height: 330rpx;*/\n background-color:#fff;\n border-radius: 10rpx;\n transform: scale(0.7,0.7) translateY(65rpx);\n transition: all 0.5s;\n padding:10rpx 10rpx 5rpx 10rpx;\n margin:0 auto;\n margin-top: 2rpx;\n position: relative;\n }\n .list-item image {\n width: 210rpx;\n display: block;\n height: 210rpx;\n margin:0 auto;\n border-radius: 10rpx;\n }\n .list-item .text {\n font-size: 20rpx;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2; //行数\n -webkit-box-orient: vertical;\n overflow: hidden;\n line-height:24rpx;\n margin-top:10rpx;\n }\n .list-item .price{\n color:#FF5D15;\n font-size:22rpx;\n margin-top:2rpx;\n }\n .list-item .buy{\n font-size: 16rpx;\n color:#AAA;\n }\n .list-item.subright {\n transform: scale(0.85,0.85) translateY(26rpx) translateX(25rpx);\n }\n .list-item.subleft {\n transform: scale(0.85,0.85) translateY(26rpx) translateX(-25rpx);\n }\n .list-item.select{\n transform: scale(1,1);\n bottom: 2rpx;\n }\n .list-item.delete {\n opacity:0;\n transform:translateY(-220rpx)\n }\n .authmodal{\n width:100%;\n height:100%;\n background-color: rgba(0,0,0,0.7);\n position: fixed;\n z-index:20;\n .wrap {\n width: 90%;\n margin:0 auto;\n position: relative;\n top:200px;\n padding: 50rpx 0;\n background-color: #fff;\n border-radius: 20rpx;\n .text {\n color:#333;\n text-align: center;\n padding-top:30rpx;\n padding-bottom: 60rpx;\n }\n button {\n width:80%;\n }\n }\n }\n</style>\n<wxs module=\"tools\">\n // 无限循环当current为最后一个的时候,select就应该是0 例如长度为10,当current为9时,select就应该是0\n // if(current+1==index || (current==length-1 && index==0) ) allclass = \"select\";\n // 无限循环当current为最后一个/两个的时候的时候,例如长度为10,当current为8/9时,select就应该是1/0\n //if(current+2 == index|| (current>=length-2 && index==current-length+2))\n //allclass='subright';\n\n function computClass (current,index,length) {\n var allclass = \"\";\n if(current-1 == index||(current == 0&&index==length-1))\n allclass='subleft';\n if(current==index)\n allclass='select';\n if(current+1==index || (current==length-1 && index==0) )\n allclass = \"subright\";\n return allclass;\n };\n module.exports = {\n computClass:computClass\n }\n</wxs>\n<template>\n <view class=\"video-wrapper\">\n <view id=\"myvideo\">\n <van-notify id=\"van-notify\" />\n <video-list v-if=\"videoList && videoList.length\" :videoList.sync=\"videoList\" :userAccount=\"mainInfo && mainInfo.account && mainInfo.account.quantity || 0\" :total=\"total\" bindchange=\"changeVideo\" @getAwardsInfo=\"getAwardsInfo\">\n </video-list>\n </view>\n <view class=\"userInfo\" style=\"{{userImgStyle}}\">\n <button v-if=\"authmodal\" open-type=\"getUserInfo\" bindgetuserinfo=\"getUserInfo\" class=\"userinfo-button\">\n <image class=\"userinfo-image\" src=\"{{userInfo.avatarUrl || '/static/images/user@2x.png'}}\"></image>\n </button>\n <image v-if=\"!authmodal\" @tap=\"showMenu(!showMenus)\" src=\"{{userInfo.avatarUrl || '/static/images/user@2x.png'}}\" mode=\"cover\" class=\"userimage\"></image>\n </view>\n <view>\n <video-gold type=\"gold\" :des=\"mainInfo && mainInfo.account && mainInfo.account.quantity || 0\" :gold=\"sign\" :isReceive=\"isReceive\"></video-gold>\n <video-sign type=\"sign\" des=\"签到\" :sign=\"sign\" @sign-in=\"signIn\"></video-sign>\n <video-lottery type=\"lottery\" des=\"抽奖\" @getAwards=\"getAwards\" @getUserInfo=\"getUserInfo\" :authmodal=\"authmodal\"></video-lottery>\n <video-share type=\"share\" des=\"分享\"></video-share>\n </view>\n <view class=\"content {{isActiveDone}}\" >\n <view class=\"leftcont\">\n <swiper\n class=\"list-wrapper\"\n vertical=\"{{true}}\"\n circular=\"{{true}}\"\n display-multiple-items=\"{{activityDisplayItems}}\"\n bindchange=\"onActivityChange\"\n autoplay=\"{{true}}\"\n interval=\"1500\">\n <swiper-item wx:for=\"{{activityList}}\" wx:key=\"index\" catch:touchmove>\n <view class=\"imgwrap\">\n <image class=\"img\" src=\"{{item.avatarUrl}}\"></image>\n <view class=\"text\">{{item.content}}</view>\n </view>\n </swiper-item>\n </swiper>\n </view>\n </view>\n <!-- <view class=\"footer\">\n <swiper\n class=\"footswiper\"\n display-multiple-items=\"{{swiperItem}}\"\n current=\"{{current}}\"\n bindchange=\"moveSwiper\"\n bindanimationfinish=\"swipermoveDone\"\n circular=\"{{circular}}\"\n previous-margin=\"140rpx\"\n next-margin=\"120rpx\"\n catch:touchmove\n >\n bindtouchstart=\"touchStart\"\n bindtouchend=\"touchEnd\"\n <swiper-item wx:for=\"{{list}}\" wx:key=\"index\">\n <view\n data-itemid=\"{{index}}\"\n bindtap=\"toViewPage\"\n data-item=\"{{item}}\"\n class=\"list-item {{item.select?'delete':''}} {{tools.computClass(currentIndex,index,list.length)}}\"\n >\n <image src=\"{{item.imgsrc}}\"></image>\n <view class=\"text\">{{item.text}}</view>\n <p class=\"price\">{{item.price}}</p>\n <p class=\"buy\">{{item.people}}人购买</p>\n </view>\n </swiper-item>\n </swiper>\n </view> -->\n <!-- <view class=\"authmodal\" v-show=\"authmodal\">\n <view class=\"wrap\">\n <view class=\"text\">来到luckii,再平凡的人,<br>也有幸运的权利!</view>\n <button open-type=\"getUserInfo\" bindgetuserinfo=\"getUserInfo\">授权并进入</button>\n </view>\n </view> -->\n <network v-if=\"isConnected === false\"></network>\n <open-animation v-if=\"showAwardsModal\" :joinRecord=\"mainInfo && mainInfo.joinRecord\"></open-animation>\n <shared-popup v-if=\"showShareModal\" :inviteinfo=\"mainInfo && mainInfo.inviteRecord\" @getSharedGold=\"getSharedGold\"></shared-popup>\n <popup @showMenu=\"showMenu\" :showMenus=\"showMenus\"></popup>\n <van-dialog id=\"van-dialog\" confirmButtonColor=\"#FF5D15\"/>\n </view>\n</template>\n\n<script>\n let touchDotX = 0;\n let touchDotY = 0;\n import store from '../store';\n import { mapState, mapActions } from '@wepy/x';\n import wepy from '@wepy/core';\n import Notify from '../components/vant/notify/notify';\n import Dialog from '../components/vant/dialog/dialog';\n import { login, register, getUserInfo, addGold, getPrizeList, signIn, getActivityFeed } from '../common/api.js';\n wepy.page({\n store,\n hooks: {\n\n },\n\n data: {\n list: [], // 商品list\n // 活动信息\n activityList: [],\n activityDisplayItems: 2,\n current: 5, // 商品列表初次展示第几个\n swiperItem: 2,\n videoList: [],\n length: 4,\n circular: false, // 商品是否无限循环\n topPage: 0,\n lastPage: 0,\n currentIndex: 5, // 商品当前滑动到第几个\n authmodal: false,\n sign: true,\n showAnimation: false,\n userImgStyle: '',\n goldStyle: '',\n goldNum: 50000,\n awards: false,\n showMenus: false,\n loading: false,\n inviter: '',\n mainInfo: null,\n showShareModal: false,\n showAwardsModal: false,\n awardsInfo: {},\n isReceive: false,\n isActiveDone: ''\n },\n\n computed: {\n ...mapState([ 'isConnected', 'userInfo' ])\n },\n\n methods: {\n ...mapActions([ 'setIsConnected', 'setUserInfo' ]),\n moveSwiper(e) {\n if (e.$wx.detail.source === 'touch') {\n let current = e.$wx.detail.current;\n this.currentIndex = current;\n }\n },\n swipermoveDone(e) {\n function debounce(func, wait) {\n let timeout;\n return function () {\n if (timeout) clearTimeout(timeout);\n\n let callNow = !timeout;\n timeout = setTimeout(func, wait);\n\n if (callNow) func();\n };\n }\n\n if (e.$wx.detail.source === 'touch') {\n let current = e.$wx.detail.current;\n let totalPage = 3;\n let nextlist = [\n {value: 11, text: '白色条纹马克杯,马克吐温同款11', imgsrc: '/static/images/test1.jpg', price: '¥9.89', people: 2200, sku: '100004549235'},\n {value: 12, text: '白色条纹马克杯,马克吐温同款12', imgsrc: '/static/images/test2.png', price: '¥19.20', people: '2200', sku: '100004549235'},\n {value: 13, text: '白色条纹马克杯,马克吐温同款13', imgsrc: '/static/images/peo1.jpg', price: '¥39.08', people: 2200, sku: '100004549235'},\n {value: 14, text: '白色条纹马克杯,马克吐温同款14', imgsrc: '/static/images/peo2.jpg', price: '¥599.20', people: 2200, sku: '100004549235'},\n {value: 15, text: '白色条纹马克杯,马克吐温同款15', imgsrc: '/static/images/peo3.jpg', price: '¥2399.01', people: 2200, sku: '100004549235'}\n ];\n let that = this;\n\n /* if(current <= 2) {\n debounce(setTimeout(function(){\n that.topPage +=1;\n if(that.lastPage+that.topPage >= totalPage) {\n that.circular = true;\n return;\n }\n that.list = [...newlist, ...that.list];\n// that.current = current+1;\n// that.currentIndex = current+1;\n },1000),500);\n } */\n if (current >= this.list.length - 3) {\n debounce(setTimeout(function() {\n that.lastPage += 1;\n if (that.lastPage + that.topPage >= totalPage) {\n that.circular = true;\n return;\n }\n that.list = [...that.list, ...nextlist];\n }, 1000), 500);\n }\n }\n },\n toViewPage(e) {\n let item = e.$wx.currentTarget.dataset.item;\n // 解决长按触发tap事件的bug\n wx.navigateToMiniProgram({\n appId: 'wx91d27dbf599dff74',\n path: 'pages/item/detail/detail?sku=' + item.sku, // 跳转小程序的路径\n // 有效值 develop(开发版),trial(体验版),release(正式版)\n envVersion: 'release',\n success(res) {\n// console.log('跳转成功');\n }\n });\n /* wx.navigateTo({\n url: '/pages/auth'\n }); */\n },\n touchStart (event) {\n touchDotX = event.touches[0].pageX; // 获取触摸时的原点\n touchDotY = event.touches[0].pageY;\n // console.log(\"起始点的坐标X:\" + touchDotX);\n // console.log(\"起始点的坐标Y:\" + touchDotY);\n },\n touchMove(event) {\n let touchX = event.touches[0].pageX;\n let touchY = event.touches[0].pageY;\n // 如果元素拖动到购物车范围\n let {left, top, bottom, right} = this.shopcarPosition;\n if (touchX > left - 10 && touchX < right + 10) {\n if (touchY > top - 10 && touchY < bottom + 10) {\n this.bigshop = true;\n }\n }\n },\n // 移动结束处理动画\n touchEnd(event) {\n // 手指离开屏幕时记录的坐标\n let touchMoveX = event.changedTouches[0].pageX;\n let touchMoveY = event.changedTouches[0].pageY;\n let current = event.currentTarget.dataset;\n // 起始点的坐标(x0,y0)和手指离开时的坐标(x1,y1)之差\n let tmX = touchMoveX - touchDotX;\n let tmY = touchMoveY - touchDotY;\n // 两点横纵坐标差的绝对值\n let absX = Math.abs(tmX);\n let absY = Math.abs(tmY);\n // 起始点的坐标(x0,y0)和手指离开时的坐标(x1,y1)之间的距离\n let delta = Math.sqrt(absX * absX + absY * absY);\n // console.log('起始点和离开点距离:' + delta + 'px');\n // 如果delta超过60px(可以视情况自己微调),判定为手势触发\n if (delta >= 40) {\n // 如果 |x0-x1|<|y0-y1|,即absX<abxY,判定为上下滑动\n if (absX < absY) {\n // 如更tmX<0,即(离开点的X)-(起始点X)小于0 ,判定为下滑\n if (tmY < 0) {\n this.deleteAnimation(current);\n // console.log(\"上滑=====\");\n // 如更tmX>0,即(离开点的X)-(起始点X)大于0 ,判定为上滑\n } else {\n // console.log(\"下滑=====\");\n }\n }\n } else {\n // console.log(\"手势未触发=====\");\n }\n },\n async getUserInfo (e, isFromLottery) {\n if (e.$wx.detail.userInfo) {\n this.setUserInfo(e.$wx.detail.userInfo);\n this.authmodal = false;\n await this.registUser(e.$wx.detail.userInfo);\n if (isFromLottery) {\n this.getAwards();\n }\n }\n },\n changeVideo(e) {\n this.setIsConnected();\n // if (this.length - e.activeId === 1) {\n // this.videoList = [{id: e.activeId + 2, url: 'https://ip1707952229.mobgslb.tbcache.com/youku/6974c3708c0337150e1743b1c/03000801005EA2A6C8FB4C2003E8807282A547-8207-4F52-9663-969096765248.mp4?sid=158960247500010009412_00_Bac09720260d484f23ac2ccebe5206930&sign=b76f4099e108fc306d3db993d1bec0a8&ctype=50&ali_redirect_domain=vali.cp31.ott.cibntv.net&ali_redirect_ex_ftag=5898cd25832bbff232de6d9fa668e8ddf8bacc5fef3f2e7b&ali_redirect_ex_tmining_ts=1589602477&ali_redirect_ex_tmining_expire=3600&ali_redirect_ex_hot=111'}];\n // this.length += 1;\n // console.log('add video');\n // }\n },\n deleteAnimation (current) {\n if (current && current.itemid !== undefined) {\n let list = this.list;\n list = list.map((item, index) => {\n item.select = '';\n if (index === +current.itemid) {\n item.select = true;\n }\n return item;\n });\n this.list = list;\n let that = this;\n // 如果剩下4个就不让他循环了,这时候就一屏显示出来了\n if (list.length <= 4) {\n this.circular = false;\n }\n if (current.itemid >= list.length - 1) {\n this.current = this.currentIndex - 1;\n }\n setTimeout(function() {\n let newlist = that.list.filter((item, index) => index !== +current.itemid);\n // 正常情况下,current.itemid都会比current大一个,因为current有个隐藏元素,当相等或小于的时候就有问题,要重新设置current,最小不能超过0\n if (current.itemid <= that.current) {\n that.current = Math.max(that.current - 1, 0);\n }\n that.list = newlist;\n }, 500);\n }\n },\n signIn: async function() {\n let that = this;\n const tmplIds = [\n 'xbA7XopO2j0V0Ne0F61UzSxoyfKrf92GQk6Z4pQvnd4',\n '_yZWJYT-3lGCQG6g7Wa7F-0zxvGaPe4zwAI9D4zW4EY',\n '7YzXgiVNGXiRvXNmR6WUtH_WplUyo97eAy45dsyviKQ'\n ];\n\n const { subscriptionsSetting } = await wepy.wx.getSetting({ withSubscriptions: true });\n if (subscriptionsSetting && (!subscriptionsSetting.mainSwitch || subscriptionsSetting.itemSettings)) {\n let isAlwaysAgree = true;\n if (subscriptionsSetting.itemSettings) {\n const itemKeys = Object.keys(subscriptionsSetting.itemSettings);\n isAlwaysAgree = itemKeys.every(v => subscriptionsSetting.itemSettings[v] === 'accept');\n }\n if (!isAlwaysAgree || !subscriptionsSetting.mainSwitch) {\n try {\n await Dialog.alert({\n message: '点击右上角“...” - 设置 - 消息订阅,开启接收订阅消息并选择所有消息',\n showCancelButton: true,\n confirmButtonText: '去设置'\n });\n await wepy.wx.openSetting();\n } catch (e) {\n console.log(e || e.message);\n }\n return;\n }\n }\n\n wx.requestSubscribeMessage({\n tmplIds: [\n 'xbA7XopO2j0V0Ne0F61UzSxoyfKrf92GQk6Z4pQvnd4',\n '_yZWJYT-3lGCQG6g7Wa7F-0zxvGaPe4zwAI9D4zW4EY',\n '7YzXgiVNGXiRvXNmR6WUtH_WplUyo97eAy45dsyviKQ'\n ],\n success (res) {\n console.log('requestSubscribeMessage success', res);\n if (res.errMsg === 'requestSubscribeMessage:ok') {\n // 兼容写法,有时响应中的模板id不是3个\n const rs = tmplIds.every(v => res[v] === undefined || res[v] === 'accept');\n if (rs) {\n that.sign = true;\n setTimeout(async () => {\n const innerAudioContext = wx.createInnerAudioContext();\n innerAudioContext.autoplay = true;\n innerAudioContext.src = '/static/audio/supermarie.mp3';\n innerAudioContext.onPlay(() => {});\n innerAudioContext.onError((res) => {\n console.log(res.errMsg);\n console.log(res.errCode);\n });\n const { coins } = await signIn();\n if (coins === 0) return;\n that.mainInfo.account.quantity = coins;\n }, 1500);\n }\n }\n },\n fail (res) {\n console.log('requestSubscribeMessage fail', res);\n }\n });\n },\n onShareAppMessage: function(res) {\n if (res.from === 'button') {\n console.log('onShareAppMessage2', res.target);\n }\n const openid = wx.getStorageSync('openId');\n return {\n title: `${(this.$wepy.userInfo && this.$wepy.userInfo.nickName) || '您的好朋友'}邀请您来抽奖啦~`,\n path: `/pages/index?openid=${openid}`,\n imageUrl: this.$wepy.awardsInfo.photoUrl,\n success: function(res) {\n let shareId = res.shareTickets[0];\n console.log('shareId', shareId);\n },\n fail: function(res) {\n console.log(res);\n }\n };\n },\n getAwards: function() {\n const { id, photoUrl, quantity, name, chance } = this.awardsInfo;\n if (!id || !this.mainInfo || !this.mainInfo.account) {\n Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop: true });\n return;\n }\n if (this.mainInfo && this.mainInfo.account && this.mainInfo.account.quantity === 0) {\n Notify({ message: '您的克币数为0, 无法参与抽奖', background: '#FF5D15', safeAreaInsetTop: true });\n return;\n }\n wx.navigateTo({\n url: `/pages/raffle?prizeId=${id}&chance=${chance}&photoUrl=${photoUrl}&quantity=${quantity}&name=${name}`\n });\n },\n getAwardsInfo: function(v) {\n this.awardsInfo = v;\n },\n showMenu: function(v) {\n this.showMenus = v;\n },\n getSharedGold: async function(v) {\n this.showShareModal = false;\n await addGold(v);\n let account = this.mainInfo.account || {};\n let quantity = account.quantity || 0;\n this.mainInfo.account.quantity = quantity + v.quantity;\n this.isReceive = true;\n setTimeout(() => {\n if (this.mainInfo.joinRecord && this.mainInfo.joinRecord.id) {\n this.showAwardsModal = true;\n }\n }, 1000);\n },\n getMainInfo: async function() {\n this.mainInfo = await getUserInfo(wx.getStorageSync('openId'));\n this.sign = this.mainInfo && this.mainInfo.signin;\n wx.setStorageSync('hasPhone', this.mainInfo.phone);\n if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {\n this.showShareModal = true;\n } else if (this.mainInfo.joinRecord && this.mainInfo.joinRecord.id) {\n this.showAwardsModal = true;\n }\n },\n async registUser(userInfo) {\n if (wx.getStorageSync('isRegister') === false) {\n const params = {\n ...userInfo,\n inviter: this.inviter\n };\n await register(params);\n wx.setStorageSync('isRegister', true);\n }\n },\n async showActivity() {\n // 1期方案先一次取50\n const list = await getActivityFeed({ count: 50 });\n this.activityList = list;\n },\n onActivityChange(e) {\n const lastIndex = this.activityList.length - this.activityDisplayItems;\n if (e.$wx.detail.current === lastIndex) {\n this.isActiveDone = 'anima';\n setTimeout(() => {\n this.isActiveDone = 'anima hide';\n }, 2000);\n }\n }\n },\n async onLoad (options) {\n if (options.openid) {\n this.inviter = options.openid;\n }\n let statusHeight = this.$app.$options.globalData.statusBarHeight || '';\n statusHeight && (this.userImgStyle = 'top:' + statusHeight + 'px');\n },\n async onShow() {\n this.videoList = [];\n\n if (!wx.getStorageSync('openId')) {\n const { code } = await wepy.wx.login();\n let userInfo = await login(code);\n userInfo = userInfo || {};\n wx.setStorageSync('openId', userInfo.openid);\n wx.setStorageSync('isRegister', userInfo.register);\n }\n if (store.state.userInfo) {\n this.userInfo = store.state.userInfo;\n this.registUser(this.userInfo);\n } else {\n const setting = await wepy.wx.getSetting();\n if (setting.authSetting['scope.userInfo']) {\n const { userInfo } = await wepy.wx.getUserInfo();\n this.setUserInfo(userInfo);\n this.registUser(userInfo);\n } else {\n this.authmodal = true;\n }\n }\n await this.getMainInfo();\n this.videoList = await getPrizeList();\n this.showActivity();\n }\n\n });\n</script>\n<config>\n{\n navigationBarTitleText: '主页',\n usingComponents: {\n 'van-button': '../components/vant/button/index',\n 'video-list': '\\x7e@/components/custom/videolist',\n 'van-icon': '../components/vant/icon/index',\n 'video-sign': '~@/components/custom/sign',\n 'video-gold': '~@/components/custom/sign',\n 'video-share': '~@/components/custom/sign',\n 'video-lottery': '~@/components/custom/sign',\n 'network': '~@/components/custom/network',\n 'open-animation': '~@/components/custom/openAnimation',\n 'popup': '~@/components/custom/popup',\n 'van-notify': '~@/components/vant/notify/index',\n 'shared-popup': '~@/components/custom/sharedPopup',\n 'video-loading': '~@/components/custom/loading',\n 'van-dialog': '~@/components/vant/dialog/index'\n },\n navigationStyle: \"custom\",\n }\n</config>\n"}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/morehelp.wpy":{"size":253,"mtime":1590498072492,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/morehelp.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/myraffles.wpy":{"size":3338,"mtime":1591238093275,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/myraffles.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/prize.wpy":{"size":7784,"mtime":1591345651189,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/prize.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/raffle.wpy":{"size":7700,"mtime":1591345651178,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/raffle.wpy","messages":[],"errorCount":0,"warningCount":0,"output":"<style lang=\"less\">\n .raffle-wrapper {\n width:100%;\n height:100%;\n background-color:#F1F1F1;\n padding-top:40rpx;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n .raffle-content {\n background-color: #fff;\n width: 94%;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n margin:0 auto;\n padding:50rpx 50rpx 40rpx 50rpx;\n border-radius: 10rpx;\n box-shadow:0px 2rpx 20rpx 0px rgba(188,188,188,0.75);\n .img .van-image {\n box-shadow:0px 3rpx 13rpx 1rpx rgba(163,163,163,0.38);\n }\n }\n .goodsinfo {\n margin-top:15rpx;\n overflow: hidden;\n .text {\n font-size: 28rpx;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2; //行数\n -webkit-box-orient: vertical;\n overflow: hidden;\n float: left;\n text-align: left;\n width: 65%;\n color: #333;\n }\n .money{\n float: right;\n width:30%;\n color:#FF5D15;\n font-size: 30rpx;\n text-align: right;\n font-weight:bold;\n }\n }\n .raffle-chance {\n font-size: 24rpx;\n color:#666;\n margin-top:20rpx;\n }\n .raffle-progress {\n font-size: 24rpx;\n color:#666;\n }\n .progress {\n width: 298rpx;\n height:18rpx;\n background-color:#fff;\n border:1px solid #FF5D15;\n border-radius: 4rpx;\n color:#666;\n display: inline-block;\n position: relative;\n top:3rpx;\n .orange {\n height:100%;\n transition:all 1s;\n background-color: #FF5D15;\n }\n }\n .pronumber{\n font-size: 20rpx;\n color:#666;\n margin-left:10rpx;\n position: relative;\n top:-3rpx;\n }\n .user-wish {\n padding-left:35rpx;\n font-size: 24rpx;\n color:#aaa;\n margin-top:25rpx;\n height:50rpx;\n line-height: 50rpx;\n .checkimg{\n display: inline-block;\n width:24rpx;\n height:24rpx;\n border:3rpx solid #aaa;\n border-radius: 4rpx;\n vertical-align: middle;\n position: relative;\n &.checked{\n background-color: #FF5D15;\n border:3rpx solid #FF5D15;\n }\n }\n .checkicon {\n position: absolute;\n top:0;\n left:0;\n right:0;bottom:0;margin:0 auto;\n &.hide {\n display: none;\n }\n }\n .checktext{\n margin-left:10rpx;\n position: relative;\n top:3rpx;\n }\n }\n .joinin {\n width:380rpx;\n height:70rpx;\n line-height: 70rpx;\n background-color: #FF5D15;\n border-radius:10rpx;\n margin:0 auto;\n margin-top:80rpx;\n font-size: 34rpx;\n color:#fff;\n }\n</style>\n<template>\n <view class=\"raffle-wrapper\">\n <view class=\"raffle-content\">\n <van-image use-loading-slot src=\"{{photoUrl}}\" class=\"img\" width=\"610rpx\" height=\"610rpx\" radius=\"10rpx\" fit=\"cover\">\n <van-loading slot=\"loading\" type=\"spinner\" size=\"20\" vertical />\n </van-image>\n <view class=\"goodsinfo\">\n <text class=\"text\">{{name}}</text>\n <text class=\"money\">{{quantity}}克币</text>\n </view>\n <view class=\"raffle-chance\">中奖概率: {{chance}}</view>\n <view class=\"raffle-progress\">开奖进度:\n <view class=\"progress\">\n <view class=\"orange\" style=\"{{progressStyle}}\"></view>\n </view>\n <text class=\"pronumber\">{{progress}}</text>\n </view>\n </view>\n <view class=\"user-wish\" bindtap=\"check\">\n <view class=\"checkimg {{isCheck?'checked':''}}\">\n <van-icon name=\"success\" color=\"#fff\" size=\"24rpx\" class=\"checkicon {{isCheck?'':'hide'}}\"/>\n </view>\n <text class=\"checktext\">我同意花费所有克币参与抽奖,并承诺商品不退货。</text>\n </view>\n <button class=\"joinin\" open-type=\"{{opentype}}\" bindtap=\"joinin\" bindgetphonenumber=\"getPhoneNumber\">{{btnfont}}</button>\n <van-notify id=\"van-notify\" />\n <van-dialog id=\"van-dialog\" confirmButtonColor=\"#FF5D15\"/>\n </view>\n</template>\n<script>\n import wepy from '@wepy/core';\n import Notify from '../components/vant/notify/notify';\n import Dialog from '../components/vant/dialog/dialog';\n import { updateUserPhone, confirmRaffle, register, login, getAwardsDetail } from '../common/api';\n import store from '../store';\n wepy.page({\n store,\n data: {\n progress: '0%',\n progressStyle: '',\n isCheck: true,\n batchId: null,\n quantity: '',\n name: '',\n chance: '',\n photoUrl: '',\n btnfont: '立即参与',\n hasPhone: false\n },\n methods: {\n check() {\n this.isCheck = !this.isCheck;\n },\n async getPhoneNumber(e) {\n if (this.btnfont !== '立即参与') { return; }\n let that = this;\n let detail = e.$wx.detail || {};\n function goprize() {\n updateUserPhone(detail).then(() => {\n that.confirmRaff();\n wx.setStorageSync('hasPhone', true);\n that.hasPhone = true;\n }).catch(() => {\n that.btnfont = '立即参与';\n });\n }\n if (detail.encryptedData) {\n this.btnfont = '提交中...';\n const { code } = await wepy.wx.login();\n await login(code);\n goprize();\n } else {\n Notify({message: '参与失败,请重新授权!', background: '#FF5D15'});\n }\n },\n async confirmRaff() {\n let title = ['参与成功!', '参与失败!', '参与失败!'];\n let message = ['参与成功,坐等开奖。', '当前抽奖已结束。', '当前奖品已经没有库存了。'];\n // 如果用户还未注册\n let isRegister = wx.getStorageSync('isRegister');\n if (isRegister === false) {\n await register(store.state.userInfo);\n wx.setStorageSync('isRegister', true);\n }\n this.btnfont = '提交中...';\n confirmRaffle({batchId: this.batchId}).then(data => {\n this.btnfont = '立即参与';\n let code = data.joinCode;\n if (code === undefined) code = 3;\n Dialog.alert({\n title: title[code],\n message: message[code]\n }).then(() => {\n wx.reLaunch({url: '/pages/index'});\n });\n }).catch(() => {\n this.btnfont = '立即参与';\n });\n },\n joinin() {\n if (!this.isCheck) {\n Notify({message: '勾选同意后才可以抽奖!', background: '#FF5D15'});\n return;\n }\n if (this.hasPhone) {\n this.confirmRaff();\n }\n },\n async getProgress(id) {\n let detail = await getAwardsDetail({ prizeId: id });\n detail = detail || {};\n this.batchId = detail.id;\n if (detail.quantity) {\n this.progress = Math.round((detail.join / detail.quantity) * 100) + '%';\n this.progressStyle = 'width:' + this.progress;\n }\n }\n },\n computed: {\n opentype() {\n if (this.isCheck && !this.hasPhone) {\n return 'getPhoneNumber';\n } else {\n return '';\n }\n }\n },\n onLoad (query) {\n let {prizeId, quantity, name, chance, photoUrl} = query;\n this.getProgress(prizeId);\n this.hasPhone = wx.getStorageSync('hasPhone');\n this.quantity = quantity || '';\n this.name = name;\n this.chance = chance;\n this.photoUrl = photoUrl;\n }\n });\n</script>\n<config>\n {\n navigationBarTitleText: '参与抽奖',\n \"usingComponents\": {\n \"van-notify\": \"../components/vant/notify/index\",\n \"van-image\": \"../components/vant/image/index\",\n \"van-loading\": \"../components/vant/loading/index\",\n \"van-dialog\": \"../components/vant/dialog/index\",\n \"van-icon\": \"../components/vant/icon/index\",\n }\n }\n</config>\n"}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/store/index.js":{"size":539,"mtime":1590568729968,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/store/index.js","messages":[],"errorCount":0,"warningCount":0}}}
\ No newline at end of file
......@@ -43,7 +43,7 @@
<view class="help-info">
<view>1.打卡:每次可获得1克币,每天仅限打卡一次;</view>
<view>2.分享:通过分享每次邀请1名新的好友参加,即可获得10克币;</view>
<!--<view>3.购买:通过在Luckii购买产品即可获得克币,克币数量根据购买产品价格而定。</view>-->
<view>3.购买:通过在Luckii购买产品即可获得克币,克币数量根据购买产品价格而定。</view>
</view>
<view class="help-title">如何使用克币?</view>
<view class="help-info">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment