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