Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
mini-program-wepy
Commits
f436acd5
Commit
f436acd5
authored
Jul 17, 2020
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"docs: isFirstRoll补丁注释"
parent
2092a104
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
.eslintcache
.eslintcache
+1
-1
video.wpy
src/components/custom/video.wpy
+4
-4
No files found.
.eslintcache
View file @
f436acd5
{"D:\\project\\mini-program-wepy\\src\\app.wpy":{"size":1610,"mtime":1594721970257,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\app.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\api.js":{"size":1949,"mtime":1594112587014,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\api.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\eventHub.js":{"size":90,"mtime":1594112587015,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\eventHub.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\raffleProbability.js":{"size":1792,"mtime":1594112587015,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\raffleProbability.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\wxRequest.js":{"size":2675,"mtime":1594721970258,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\wxRequest.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\activityList.wpy":{"size":2613,"mtime":1594721970259,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\activityList.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\china.js":{"size":102261,"mtime":1594112587017,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\china.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\goloading.wpy":{"size":1103,"mtime":1594112587017,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\goloading.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\goodsList.wpy":{"size":9486,"mtime":1594112587018,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\goodsList.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\loading.wpy":{"size":1260,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\loading.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\network.wpy":{"size":1517,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\network.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\openAnimation.wpy":{"size":17653,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\openAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\popup.wpy":{"size":4977,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\popup.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\sharedPopup.wpy":{"size":8545,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\sharedPopup.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\sign.wpy":{"size":12207,"mtime":1594721970259,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\sign.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\starAnimation.wpy":{"size":4063,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\starAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\videoPause.wpy":{"size":941,"mtime":1594112587022,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\videoPause.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\agreement.wpy":{"size":225,"mtime":1594112587148,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\agreement.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\help.wpy":{"size":3183,"mtime":1594112587148,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\help.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\index.wpy":{"size":19975,"mtime":1594796428652,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\index.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\morehelp.wpy":{"size":269,"mtime":1594112587149,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\morehelp.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\myraffles.wpy":{"size":3271,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\myraffles.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\prize.wpy":{"size":7951,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\prize.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\raffle.wpy":{"size":13368,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\raffle.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\search.wpy":{"size":5690,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\search.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\store\\index.js":{"size":850,"mtime":1594112587151,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\store\\index.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\utils.js":{"size":1334,"mtime":1594721970258,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\utils.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\video.wpy":{"size":11505,"mtime":1594966976763,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\video.wpy","messages":[],"errorCount":0,"warningCount":0,"output":"<template>\n <view class=\"container\">\n <swiper\n class=\"video-swiper\"\n duration=\"300\"\n circular=\"{{circular}}\"\n vertical\n current=\"0\"\n bindchange=\"moveSwiper\"\n bindanimationfinish=\"animationfinish\">\n <swiper-item wx:for=\"{{curQueue}}\" wx:key=\"index\">\n <view class=\"video-swiper\">\n <video\n class=\"video-item\"\n v-show=\"item.showType && item.showType.value == 2\"\n id=\"video_{{index}}\"\n loop\n enable-progress-gesture=\"{{false}}\"\n show-center-play-btn=\"{{false}}\"\n controls=\"{{false}}\"\n src=\"{{item.videoUrl}}\"\n data-id=\"{{item.id}}\"\n object-fit=\"contain\"\n data-index=\"{{index}}\"\n @tap=\"videoTap\"\n custom-cache=\"{{false}}\"\n bindplay=\"loadMedia\"\n bindloadedmetadata=\"loadMedia\"\n >\n <video-pause :pause=\"videoPause\"></video-pause>\n <van-loading type=\"spinner\" size=\"40\" v-if=\"videoLoading\" custom-class=\"video-loading\"/>\n <!--<video-loading v-if=\"videoLoading\" :snapshot=\"item.videoSnapUrl\"/>-->\n </video>\n <van-image wx:if=\"{{item.showType && item.showType.value ==1}}\" use-loading-slot src=\"{{item.photoUrl || item.videoSnapUrl}}\" class=\"images\" radius=\"10rpx\" fit=\"contain\" width=\"100%\" height=\"100%\">\n <van-loading slot=\"loading\" type=\"spinner\" size=\"20\" vertical/>\n </van-image>\n <view class=\"rightcont\" v-show=\"item.id > 0\">\n <view class=\"info\">奖品剩余: {{item.stock}}</view>\n <view class=\"info\">中奖概率: {{rp.getProbability(userAccount, item.coinQuantity)}}</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 </view>\n </swiper-item>\n </swiper>\n <van-popup show=\"{{showPopup}}\" close-on-click-overlay=\"{{false}}\" overlay-style=\"background-color:transparent\"></van-popup>\n </view>\n</template>\n<wxs module=\"rp\" src=\"../../common/raffleProbability.wxs\"></wxs>\n<script>\n import wepy from '@wepy/core';\n import { getAwardsDetail, getPrizeList } from '../../common/api.js';\n wepy.component({\n props: {\n videoList: {\n type: Array,\n value: []\n },\n userAccount: {\n type: Number,\n value: 0\n }\n },\n options: {\n styleIsolation: 'shared'\n },\n data: {\n nextQueue: [],\n prevQueue: [],\n curQueue: [],\n circular: false,\n _last: 1,\n _invalidUp: 0,\n _invalidDown: 0,\n _videoContexts: [],\n videoPause: false,\n showPopup: false,\n videoLoading: true,\n isFirstRole: true\n },\n watch: {\n videoList (list) {\n const newVal = list || [];\n this._videoListChanged(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 methods: {\n _videoListChanged (newVal) {\n const _this = this;\n if (this.curQueue.length === 0) {\n // 因为列表默认展示1的位置,而后端逻辑会把要展示的放在0的位置,所以交换位置,展示出来\n // 同时展示的元素只有三个,curQueue中始终只有三个元素,用来解决吧video过多时,资源加载问题\n // 当前的资源加载解决方案是参考小程序的video-swiper源码\n newVal.forEach(function (item, index) {\n if (index === 0) {\n _this.curQueue[0] = item;\n } else if (index === 1) {\n _this.curQueue[1] = item;\n } else if (index === 2) {\n _this.curQueue[2] = item;\n } else {\n _this.nextQueue.push(item);\n }\n });\n this.playCurrent(0);\n } else {\n // 新进入的数组要去重,新进入的数组去重是需求的逻辑\n const curIds = this.curQueue.map(item => item.id);\n const nextIds = _this.nextQueue.map(item => item.id);\n const allIds = [...curIds, ...nextIds];\n const theList = newVal.filter(item => (allIds.indexOf(item.id) === -1));\n theList.forEach(function (item) {\n _this.nextQueue.push(item);\n });\n }\n },\n moveSwiper(e) {\n this.videoPause = false;\n this.videoLoading = true;\n if (e.$wx.detail.source === 'touch') {\n // 增加一个透明遮罩层,控制用户滑动速度,400ms内只能滑动一次,解决用户滑动过快,不触发animationfinish的bug\n this.showPopup = true;\n\n // 如果next中如果就剩下4个了,请求下一页\n if (this.nextQueue.length === 4) {\n getPrizeList().then(data => {\n this._videoListChanged(data);\n });\n }\n }\n },\n animationfinish (e) {\n this.showPopup = false;\n let { _last, curQueue, prevQueue, nextQueue } = this;\n // 一共三个数组,curQueue是要显示的数组,prevQueue放上滑过去的元素,nextQueue放即将进入的元素\n // 一次最多只展示3个video标签,提高加载视频的速度\n const current = e.$wx.detail.current;\n const diff = current - _last;\n if (this.isFirstRole && current === 1) {\n this.playCurrent(1);\n this.isFirstRole = false;\n }\n if (diff === 0) return;\n this.isFirstRole = false;\n this._last = current;\n this.playCurrent(current);\n // 如果上滑的时候,当前滑动到第0元素,那么被划走,放入prevQueue是第一个元素,这个要自己画图才会更理解\n const upChange = [1, 2, 0];\n const downChange = [2, 0, 1];\n this.$emit('change', { activeId: curQueue[current].id });\n const direction = (diff === 1 || diff === -2) ? 'up' : 'down';\n if (direction === 'up') {\n if (this._invalidDown === 0) {\n const uchange = upChange[current];\n const add = nextQueue.shift();\n const remove = curQueue[uchange];\n if (add) {\n prevQueue.push(remove);\n curQueue[uchange] = add;\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 dchange = downChange[current];\n const _remove = curQueue[dchange];\n const _add = prevQueue.pop();\n if (_add) {\n curQueue[dchange] = _add;\n nextQueue.unshift(_remove);\n } else {\n this._invalidDown += 1;\n }\n } else {\n this._invalidUp -= 1;\n }\n }\n // 当滑动到头时,circular改成false\n let circular = true;\n if (nextQueue.length === 0 && current !== 0) {\n circular = false;\n }\n if (prevQueue.length === 0 && current !== 2) {\n circular = false;\n }\n this.curQueue = [...curQueue];\n this.circular = circular;\n },\n playCurrent (current) {\n const that = this;\n this.curQueue[current] && this.getProgress(this.curQueue[current].id);\n // 滑动到当前元素时,其他video都暂停,只播放当前video\n this._videoContexts.forEach(function (ctx, index) {\n if (ctx) {\n const showType = that.curQueue[current] && that.curQueue[current].showType && that.curQueue[current].showType.value === 2;\n if (index === current && showType) {\n ctx.play();\n } else {\n ctx.pause();\n ctx.seek(0);\n }\n }\n });\n this.updateAwardsInfo(current);\n },\n videoTap(e) {\n const current = e.currentTarget.dataset.index;\n const ctx = this._videoContexts[current];\n if (this.videoPause) {\n ctx.play();\n this.videoPause = false;\n } else {\n ctx.pause();\n this.videoPause = true;\n }\n },\n updateAwardsInfo(current) {\n if (this.curQueue[current]) {\n const { id, photoUrl, name, probability } = this.curQueue[current];\n this.$emit('getAwardsInfo', {\n id,\n photoUrl: encodeURIComponent(photoUrl),\n name,\n chance: probability\n });\n }\n },\n async getProgress(id) {\n if (id <= 0) return;\n let detail = await getAwardsDetail({ prizeId: id });\n detail = detail || {};\n if (detail.join > detail.quantity) detail.join = detail.quantity;\n const progressFloat = detail.join / detail.quantity * 100;\n let progress = Math.round(progressFloat) + '%';\n if (progressFloat > 0 && progressFloat < 1) progress = '1%';\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.curQueue = [...this.curQueue];\n },\n loadMedia() {\n // 如果只是视频数据加载完触发,则当再滑到这个视频的视频loading还在,如果只是paly的时候触发,初始化的时候会有问题\n this.videoLoading = 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-loading\": \"~@/components/vant/loading/index\",\n \"van-image\": \"~@/components/vant/image/index\",\n \"image-loading\":\"~@/components/custom/loading\",\n 'van-popup':'~@/components/vant/popup/index',\n },\n }\n</config>\n<style lang=\"less\">\n @import \"../../style/common\";\n .container,.video-swiper{\n width:100%;\n height:100%;\n }\n .video-item {\n height:100%;\n width:100%;\n position: absolute;\n background-color: #000;\n z-index: 1;\n }\n .video-loading {\n position: absolute;\n top:0;\n left:0;\n right:0;\n bottom:0;\n margin:0 auto;\n }\n .image-item{\n height:100%;\n width:100%;\n position: absolute;\n z-index: 1;\n display: flex;\n align-items: center;\n }\n .rightcont {\n font-size: @font-normal;\n position: absolute;\n z-index: 9;\n bottom: 415rpx;\n width:30%;\n right: 30rpx;\n color: @whitecolor;\n will-change: transform;\n .info {\n line-height: 40rpx;\n }\n }\n .progress {\n width: 180rpx;\n height: 20rpx;\n background-color: @whiteback;\n margin-top: 10rpx;\n color: @greycolor;\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: @maincolor;\n }\n }\n .images {\n width: 100%;\n position: relative;\n z-index: 3;\n .van-image__loading {\n background-color: rgba(0,0,0,0.7);\n }\n }\n .container .van-overlay {\n background-color: transparent;\n }\n</style>\n"}}}
\ No newline at end of file
{"D:\\project\\mini-program-wepy\\src\\app.wpy":{"size":1610,"mtime":1594721970257,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\app.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\api.js":{"size":1949,"mtime":1594112587014,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\api.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\eventHub.js":{"size":90,"mtime":1594112587015,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\eventHub.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\raffleProbability.js":{"size":1792,"mtime":1594112587015,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\raffleProbability.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\wxRequest.js":{"size":2675,"mtime":1594721970258,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\wxRequest.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\activityList.wpy":{"size":2613,"mtime":1594721970259,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\activityList.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\china.js":{"size":102261,"mtime":1594112587017,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\china.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\goloading.wpy":{"size":1103,"mtime":1594112587017,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\goloading.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\goodsList.wpy":{"size":9486,"mtime":1594112587018,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\goodsList.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\loading.wpy":{"size":1260,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\loading.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\network.wpy":{"size":1517,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\network.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\openAnimation.wpy":{"size":17653,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\openAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\popup.wpy":{"size":4977,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\popup.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\sharedPopup.wpy":{"size":8545,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\sharedPopup.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\sign.wpy":{"size":12207,"mtime":1594721970259,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\sign.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\starAnimation.wpy":{"size":4063,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\starAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\videoPause.wpy":{"size":941,"mtime":1594112587022,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\videoPause.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\agreement.wpy":{"size":225,"mtime":1594112587148,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\agreement.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\help.wpy":{"size":3183,"mtime":1594112587148,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\help.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\index.wpy":{"size":19975,"mtime":1594796428652,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\index.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\morehelp.wpy":{"size":269,"mtime":1594112587149,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\morehelp.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\myraffles.wpy":{"size":3271,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\myraffles.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\prize.wpy":{"size":7951,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\prize.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\raffle.wpy":{"size":13368,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\raffle.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\search.wpy":{"size":5690,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\search.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\store\\index.js":{"size":850,"mtime":1594112587151,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\store\\index.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\utils.js":{"size":1334,"mtime":1594721970258,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\utils.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\video.wpy":{"size":11506,"mtime":1594968110826,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\video.wpy","messages":[],"errorCount":0,"warningCount":0}}}
\ No newline at end of file
src/components/custom/video.wpy
View file @
f436acd5
...
...
@@ -78,7 +78,7 @@
videoPause: false,
showPopup: false,
videoLoading: true,
isFirstRol
e: true
isFirstRol
l: true // 是否是首次加载。_last设置为1时,会出现首次加载的第二个视频不自动播放,设置为其他的值时会出现后续乱序的问题。此处为补丁
},
watch: {
videoList (list) {
...
...
@@ -145,12 +145,12 @@
// 一次最多只展示3个video标签,提高加载视频的速度
const current = e.$wx.detail.current;
const diff = current - _last;
if (this.isFirstRol
e
&& current === 1) {
if (this.isFirstRol
l
&& current === 1) {
this.playCurrent(1);
this.isFirstRol
e
= false;
this.isFirstRol
l
= false;
}
if (diff === 0) return;
this.isFirstRol
e
= false;
this.isFirstRol
l
= false;
this._last = current;
this.playCurrent(current);
// 如果上滑的时候,当前滑动到第0元素,那么被划走,放入prevQueue是第一个元素,这个要自己画图才会更理解
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment