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
163d32b4
Commit
163d32b4
authored
Jun 23, 2020
by
ziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 商品点击增加loading
parent
b047f4b7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
33 deletions
+102
-33
goloading.wpy
src/components/custom/goloading.wpy
+53
-0
goodsList.wpy
src/components/custom/goodsList.wpy
+39
-31
video.wpy
src/components/custom/video.wpy
+2
-2
search.wpy
src/pages/search.wpy
+8
-0
No files found.
src/components/custom/goloading.wpy
0 → 100644
View file @
163d32b4
<template>
<div class="loading-wrapper">
<van-popup show="{{show}}" overlay="{{showoverLay}}" close-on-click-overlay="{{false}}" round>
<view class="loading" v-show="showoverLay">
<van-loading type="spinner">跳转中...</van-loading>
</view>
</van-popup>
</div>
</template>
<script>
import wepy from '@wepy/core';
wepy.component({
props: {
show:{
type:Boolean,
default: false,
}
},
data: {
showoverLay: false,
},
watch: {
show(val) {
if(val){
this.showoverLay = false;
setTimeout(()=>{
this.showoverLay = true;
},500)
}
}
},
created() {
},
methods: {
}
});
</script>
<style lang="less">
.loading{
padding:40rpx;
}
</style>
<config>
{
usingComponents: {
'van-popup':'~@/components/vant/popup/index',
'van-loading': '~@/components/vant/loading/index'
}
}
</config>
src/components/custom/goodsList.wpy
View file @
163d32b4
<wxs module="tools" src="../../common/common.wxs"></wxs>
<wxs module="tools" src="../../common/common.wxs"></wxs>
<template>
<template>
<view>
<view class="footer">
<view class="footer">
<swiper
<swiper
class="footswiper"
class="footswiper"
...
@@ -31,6 +32,8 @@
...
@@ -31,6 +32,8 @@
</swiper-item>
</swiper-item>
</swiper>
</swiper>
</view>
</view>
<go-loading show="{{showLoading}}"></go-loading>
</view>
</template>
</template>
<script>
<script>
import wepy from '@wepy/core';
import wepy from '@wepy/core';
...
@@ -100,7 +103,10 @@
...
@@ -100,7 +103,10 @@
},
},
toViewPage(e) {
toViewPage(e) {
let item = e.$wx.currentTarget.dataset.item;
let item = e.$wx.currentTarget.dataset.item;
if(this.showLoading) return;
this.showLoading = true;
getGoodsUrl({skuId:item.sourceId}).then(data=>{
getGoodsUrl({skuId:item.sourceId}).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), // 跳转小程序的路径
...
@@ -109,6 +115,8 @@
...
@@ -109,6 +115,8 @@
success(res) {
success(res) {
}
}
});
});
}).catch(()=>{
this.showLoading = false;
})
})
},
},
touchStart (event) {
touchStart (event) {
...
@@ -264,7 +272,7 @@
...
@@ -264,7 +272,7 @@
<config>
<config>
{
{
"usingComponents": {
"usingComponents": {
'goods-loading': '~@/components/custom/loading',
"go-loading": "~@/components/custom/goloading"
}
}
}
}
</config>
</config>
src/components/custom/video.wpy
View file @
163d32b4
...
@@ -67,12 +67,12 @@
...
@@ -67,12 +67,12 @@
nextQueue: [],
nextQueue: [],
prevQueue: [],
prevQueue: [],
curQueue: [],
curQueue: [],
circular:
tru
e,
circular:
fals
e,
_last: 1,
_last: 1,
_invalidUp: 0,
_invalidUp: 0,
_invalidDown: 0,
_invalidDown: 0,
_videoContexts: [],
_videoContexts: [],
currentIndex:
0
,
currentIndex:
1
,
videoPause: false,
videoPause: false,
videoLoading: false,
videoLoading: false,
},
},
...
...
src/pages/search.wpy
View file @
163d32b4
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
</view>
</view>
<view class="search-last" v-show="isLoading"><van-loading type="spinner" text-size="26rpx">加载中</van-loading></view>
<view class="search-last" v-show="isLoading"><van-loading type="spinner" text-size="26rpx">加载中</van-loading></view>
<view class="search-last" v-show="isDone">没有更多了~</view>
<view class="search-last" v-show="isDone">没有更多了~</view>
<go-loading show="{{showLoading}}"></go-loading>
</view>
</view>
</template>
</template>
<script>
<script>
...
@@ -37,6 +38,7 @@
...
@@ -37,6 +38,7 @@
list:[],
list:[],
isDone:false,
isDone:false,
isLoading:false,
isLoading:false,
showLoading:false,
},
},
methods:{
methods:{
backUrl() {
backUrl() {
...
@@ -70,7 +72,10 @@
...
@@ -70,7 +72,10 @@
toJingdong(event) {
toJingdong(event) {
const sourceId = event.$wx.currentTarget.dataset.id;
const sourceId = event.$wx.currentTarget.dataset.id;
if(sourceId === undefined) return;
if(sourceId === undefined) return;
if(this.showLoading) return;
this.showLoading = true;
getGoodsUrl({skuId:sourceId}).then(data=>{
getGoodsUrl({skuId:sourceId}).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), // 跳转小程序的路径
...
@@ -79,6 +84,8 @@
...
@@ -79,6 +84,8 @@
success(res) {
success(res) {
}
}
});
});
}).catch(()=>{
this.showLoading = false;
})
})
}
}
},
},
...
@@ -96,6 +103,7 @@
...
@@ -96,6 +103,7 @@
"van-field": "../components/vant/field/index",
"van-field": "../components/vant/field/index",
"van-image": "../components/vant/image/index",
"van-image": "../components/vant/image/index",
"van-loading": "../components/vant/loading/index",
"van-loading": "../components/vant/loading/index",
"go-loading": "~@/components/custom/goloading",
}
}
}
}
</config>
</config>
...
...
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