Commit 09f1c7a7 authored by ziyu's avatar ziyu

improvement: 优化

parent 1739e3ce
......@@ -109,7 +109,6 @@
if(this.showLoading) return;
this.showLoading = true;
getGoodsUrl({skuId:item.sourceId,couponUrl:item.couponUrl||null}).then(data=>{
this.showLoading = false;
wx.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74',
path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(data), // 跳转小程序的路径
......@@ -118,6 +117,7 @@
success(res) {
}
});
this.showLoading = false;
}).catch(()=>{
this.showLoading = false;
})
......
......@@ -24,8 +24,11 @@
@tap="videoTap"
custom-cache="{{false}}"
wx:if="{{item.showType && item.showType.value ==2}}"
bindplay="loadMedia"
bindloadedmetadata="loadMedia"
>
<video-pause :pause="videoPause"></video-pause>
<van-loading type="spinner" size="40" v-if="videoLoading" custom-class="video-loading"/>
<!--<video-loading v-if="videoLoading" :snapshot="item.videoSnapUrl"/>-->
</video>
<van-image wx:if="{{item.showType && item.showType.value ==1}}" use-loading-slot src="{{item.photoUrl}}" class="images" radius="10rpx" fit="contain" width="100%" height="100%">
......@@ -75,6 +78,7 @@
currentIndex:1,
videoPause: false,
showPopup: false,
videoLoading: true,
},
watch: {
videoList (list) {
......@@ -141,6 +145,7 @@
},
moveSwiper(e) {
this.videoPause = false;
this.videoLoading = true;
if (e.$wx.detail.source === 'touch') {
//增加一个透明遮罩层,控制用户滑动速度,500ms内只能滑动一次,解决用户滑动过快,不触发animationfinish的bug
this.showPopup = true;
......@@ -270,6 +275,10 @@
this.curQueue = [...this.curQueue];
},
loadMedia() {
//如果只是视频数据加载完触发,则当再滑到这个视频的视频loading还在,如果只是paly的时候触发,初始化的时候会有问题
this.videoLoading = false;
},
}
});
</script>
......@@ -298,7 +307,14 @@
background-color: #000;
z-index: 1;
}
.video-loading {
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
margin:0 auto;
}
.image-item{
height:100%;
width:100%;
......
......@@ -92,6 +92,7 @@
border-radius: 4rpx;
vertical-align: middle;
position: relative;
margin-right:10rpx;
&.checked{
background-color: @maincolor;
border:3rpx solid @maincolor;
......@@ -107,7 +108,6 @@
}
}
.checktext{
margin-left:10rpx;
position: relative;
top:3rpx;
&.red {
......
......@@ -32,7 +32,7 @@
<script>
import wepy from '@wepy/core';
import { getSearchList, getGoodsUrl } from '../common/api'
let page = 1, keyword = '' ;
let page = 1;
wepy.page({
data: {
list:[],
......@@ -46,19 +46,14 @@
this.value = event.$wx.detail || '';
},
search() {
if(keyword !== '') {
page = 1;
}
keyword = this.value;
if(page === 1) {
this.list = [];
}
this.getList(this.value);
page = 1;
this.list = [];
this.getList();
},
getList(val) {
getList() {
this.isLoading = true;
this.isDone = false;
getSearchList({keyword:val,page:page}).then(data=>{
getSearchList({keyword:this.value,page:page}).then(data=>{
this.isLoading = false;
if(!data.hasMore) {
this.isDone = true;
......@@ -75,7 +70,6 @@
if(this.showLoading) return;
this.showLoading = true;
getGoodsUrl({skuId:item.sourceId,couponUrl:item.couponUrl||null}).then(data=>{
this.showLoading = false;
wx.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74',
path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(data), // 跳转小程序的路径
......@@ -84,6 +78,7 @@
success(res) {
}
});
this.showLoading = false;
}).catch(()=>{
this.showLoading = false;
})
......@@ -92,7 +87,7 @@
onReachBottom() {
if(this.isDone) return;
page++;
this.getList(keyword);
this.getList();
},
});
</script>
......
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