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
af5e403c
Commit
af5e403c
authored
Jun 24, 2020
by
ziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 优化奖品列表
parent
42097f7b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
22 deletions
+39
-22
wxRequest.js
src/common/wxRequest.js
+8
-2
goloading.wpy
src/components/custom/goloading.wpy
+5
-5
goodsList.wpy
src/components/custom/goodsList.wpy
+1
-2
video.wpy
src/components/custom/video.wpy
+18
-5
prize.wpy
src/pages/prize.wpy
+1
-1
raffle.wpy
src/pages/raffle.wpy
+1
-1
search.wpy
src/pages/search.wpy
+5
-6
No files found.
src/common/wxRequest.js
View file @
af5e403c
...
@@ -8,8 +8,14 @@ if (env === 'test') {
...
@@ -8,8 +8,14 @@ if (env === 'test') {
// baseUrl = 'https://luckiiapi.q-gp.com/yapi/mock/325';
// baseUrl = 'https://luckiiapi.q-gp.com/yapi/mock/325';
}
}
const
request
=
async
(
url
,
options
)
=>
{
const
request
=
async
(
url
,
options
)
=>
{
const
pages
=
getCurrentPages
();
const
pages
=
getCurrentPages
()
||
[];
const
safeAreaInsetTop
=
pages
&&
pages
.
length
>
0
?
pages
[
pages
.
length
-
1
].
route
===
'
pages/index
'
:
false
;
let
safeAreaInsetTop
=
false
;
if
(
pages
.
length
===
0
)
{
// 如果页面还没加载出来,只能说明现在刚进入首页
safeAreaInsetTop
=
true
;
}
else
if
(
pages
[
pages
.
length
-
1
].
route
===
'
pages/index
'
)
{
safeAreaInsetTop
=
true
;
}
const
defaultOptions
=
{
const
defaultOptions
=
{
method
:
'
post
'
,
method
:
'
post
'
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
}
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
}
...
...
src/components/custom/goloading.wpy
View file @
af5e403c
<template>
<template>
<div class="loading-wrapper">
<div class="loading-wrapper">
<van-popup show="{{show}}"
overlay="{{showoverLay}}" close-on-click-overlay="{{fals
e}}" round>
<van-popup show="{{show}}"
close-on-click-overlay="{{false}}" overlay-style="{{overLayStyl
e}}" round>
<view class="loading" v-show="
showoverLay
">
<view class="loading" v-show="
!overLayStyle
">
<van-loading type="spinner">跳转中...</van-loading>
<van-loading type="spinner">跳转中...</van-loading>
</view>
</view>
</van-popup>
</van-popup>
...
@@ -18,14 +18,14 @@
...
@@ -18,14 +18,14 @@
}
}
},
},
data: {
data: {
showoverLay: false
,
overLayStyle: 'background-color:transparent'
,
},
},
watch: {
watch: {
show(val) {
show(val) {
if(val){
if(val){
this.
showoverLay = false
;
this.
overLayStyle = 'background-color:transparent'
;
setTimeout(()=>{
setTimeout(()=>{
this.
showoverLay = true
;
this.
overLayStyle = ''
;
},500)
},500)
}
}
}
}
...
...
src/components/custom/goodsList.wpy
View file @
af5e403c
...
@@ -103,9 +103,8 @@
...
@@ -103,9 +103,8 @@
},
},
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;
this.showLoading = true;
getGoodsUrl({skuId:item.sourceId}).then(data=>{
getGoodsUrl({skuId:item.sourceId
,couponUrl:item.couponUrl||null
}).then(data=>{
this.showLoading = false;
this.showLoading = false;
wx.navigateToMiniProgram({
wx.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74',
appId: 'wx91d27dbf599dff74',
...
...
src/components/custom/video.wpy
View file @
af5e403c
...
@@ -15,8 +15,7 @@
...
@@ -15,8 +15,7 @@
class="video-item"
class="video-item"
id="video_{{index}}"
id="video_{{index}}"
loop
loop
enable-play-gesture
enable-progress-gesture="{{false}}"
enable-progress-gesture
show-center-play-btn="{{false}}"
show-center-play-btn="{{false}}"
controls="{{false}}"
controls="{{false}}"
src="{{item.videoUrl}}"
src="{{item.videoUrl}}"
...
@@ -43,6 +42,7 @@
...
@@ -43,6 +42,7 @@
</view>
</view>
</swiper-item>
</swiper-item>
</swiper>
</swiper>
<van-popup show="{{showPopup}}" close-on-click-overlay="{{false}}" overlay-style="background-color:transparent"></van-popup>
</view>
</view>
</template>
</template>
<script>
<script>
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
_videoContexts: [],
_videoContexts: [],
currentIndex:1,
currentIndex:1,
videoPause: false,
videoPause: false,
videoLoading
: false,
showPopup
: false,
},
},
watch: {
watch: {
videoList (list) {
videoList (list) {
...
@@ -140,6 +140,10 @@
...
@@ -140,6 +140,10 @@
moveSwiper(e) {
moveSwiper(e) {
this.videoPause = false;
this.videoPause = false;
if (e.$wx.detail.source === 'touch') {
if (e.$wx.detail.source === 'touch') {
this.showPopup = true;
setTimeout(()=>{
this.showPopup = false
},500);
const current = e.$wx.detail.current;
const current = e.$wx.detail.current;
this.currentIndex = current;
this.currentIndex = current;
//如果next中如果就剩下4个了,请求下一页
//如果next中如果就剩下4个了,请求下一页
...
@@ -213,7 +217,12 @@
...
@@ -213,7 +217,12 @@
//滑动到当前元素时,其他video都暂停,只播放当前video
//滑动到当前元素时,其他video都暂停,只播放当前video
this._videoContexts.forEach(function (ctx, index) {
this._videoContexts.forEach(function (ctx, index) {
if(ctx) {
if(ctx) {
index !== current ? ctx.pause() : ctx.play();
if(index !== current) {
ctx.pause()
}else {
ctx.seek(0);
ctx.play();
}
}
}
});
});
this.updateAwardsInfo(current)
this.updateAwardsInfo(current)
...
@@ -269,7 +278,8 @@
...
@@ -269,7 +278,8 @@
'video-loading': '~@/components/custom/loading',
'video-loading': '~@/components/custom/loading',
"van-loading": "~@/components/vant/loading/index",
"van-loading": "~@/components/vant/loading/index",
"van-image": "~@/components/vant/image/index",
"van-image": "~@/components/vant/image/index",
"image-loading":"~@/components/custom/loading"
"image-loading":"~@/components/custom/loading",
'van-popup':'~@/components/vant/popup/index',
},
},
}
}
</config>
</config>
...
@@ -340,5 +350,8 @@
...
@@ -340,5 +350,8 @@
background-color: rgba(0,0,0,0.7);
background-color: rgba(0,0,0,0.7);
}
}
}
}
.container .van-overlay {
background-color: transparent;
}
</style>
</style>
src/pages/prize.wpy
View file @
af5e403c
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
<view class="prize-info">中奖概率: {{chance}}</view>
<view class="prize-info">中奖概率: {{chance}}</view>
<view class="prize-info">中奖结果: <text class="red">已中奖</text></view>
<view class="prize-info">中奖结果: <text class="red">已中奖</text></view>
</view>
</view>
<view class="prize-address" v-show="!prize.cash">
<view class="prize-address" v-show="!prize.cash
&&prize.cash!==undefined
">
<view class="address-title">添加收货地址</view>
<view class="address-title">添加收货地址</view>
<view class="address-cont">
<view class="address-cont">
<van-field value="{{name}}" data-form="name" placeholder="收货人" bind:input ="setValue"></van-field>
<van-field value="{{name}}" data-form="name" placeholder="收货人" bind:input ="setValue"></van-field>
...
...
src/pages/raffle.wpy
View file @
af5e403c
...
@@ -291,7 +291,7 @@
...
@@ -291,7 +291,7 @@
updateUserPhone(detail).then(() => {
updateUserPhone(detail).then(() => {
wx.setStorageSync('hasPhone', true);
wx.setStorageSync('hasPhone', true);
that.btnfont = '立即参与';
that.btnfont = '立即参与';
th
is
.hasPhone = true;
th
at
.hasPhone = true;
that.joinin();
that.joinin();
}).catch(() => {
}).catch(() => {
that.btnfont = '立即参与';
that.btnfont = '立即参与';
...
...
src/pages/search.wpy
View file @
af5e403c
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<view class="search-cancel" bindtap="backUrl">取消</view>
<view class="search-cancel" bindtap="backUrl">取消</view>
</view>
</view>
<view class="search-list" v-show="list.length">
<view class="search-list" v-show="list.length">
<view class="search-item" wx:for="{{list}}" wx:key="index" bindtap="toJingdong" data-i
d="{{item.sourceId
}}">
<view class="search-item" wx:for="{{list}}" wx:key="index" bindtap="toJingdong" data-i
tem="{{item
}}">
<view class="image-left">
<view class="image-left">
<van-image use-loading-slot src="{{item.images}}" class="img" width="240rpx" height="240rpx" radius="10rpx" fit="cover">
<van-image use-loading-slot src="{{item.images}}" class="img" width="240rpx" height="240rpx" radius="10rpx" fit="cover">
<van-loading slot="loading" type="spinner" size="20" vertical />
<van-loading slot="loading" type="spinner" size="20" vertical />
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
{{item.title}}
{{item.title}}
</view>
</view>
<view class="cont-price"><text class="dollar">¥</text>{{item.price}}</view>
<view class="cont-price"><text class="dollar">¥</text>{{item.price}}</view>
<view class="cont-count">{{item.shopName}}</view>
<view class="cont-count">{{item.shopName
|| '京东自营店'
}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -70,11 +70,10 @@
...
@@ -70,11 +70,10 @@
});
});
},
},
toJingdong(event) {
toJingdong(event) {
const sourceId = event.$wx.currentTarget.dataset.id;
const item = event.$wx.currentTarget.dataset.item;
if(sourceId === undefined) return;
if(item === undefined) return;
if(this.showLoading) return;
this.showLoading = true;
this.showLoading = true;
getGoodsUrl({skuId:
sourceId
}).then(data=>{
getGoodsUrl({skuId:
item.sourceId,couponUrl:item.couponUrl||null
}).then(data=>{
this.showLoading = false;
this.showLoading = false;
wx.navigateToMiniProgram({
wx.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74',
appId: 'wx91d27dbf599dff74',
...
...
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