Commit 42097f7b authored by ziyu's avatar ziyu

improvement: 规则视频不分享

parent bcd08d37
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="container"> <view class="container">
<swiper <swiper
class="video-swiper" class="video-swiper"
duration="700" duration="600"
circular="{{circular}}" circular="{{circular}}"
vertical vertical
current="1" current="1"
...@@ -142,6 +142,12 @@ ...@@ -142,6 +142,12 @@
if (e.$wx.detail.source === 'touch') { if (e.$wx.detail.source === 'touch') {
const current = e.$wx.detail.current; const current = e.$wx.detail.current;
this.currentIndex = current; this.currentIndex = current;
//如果next中如果就剩下4个了,请求下一页
if(this.nextQueue.length === 4) {
getPrizeList().then(data=>{
this._videoListChanged(data);
})
}
} }
}, },
animationfinish (e) { animationfinish (e) {
...@@ -191,12 +197,6 @@ ...@@ -191,12 +197,6 @@
this._invalidUp -= 1; this._invalidUp -= 1;
} }
} }
//如果next中如果就剩下4个了,请求下一页
if(nextQueue.length === 4) {
getPrizeList().then(data=>{
this._videoListChanged(data);
})
}
//当滑动到头时,circular改成false //当滑动到头时,circular改成false
let circular = true; let circular = true;
if (nextQueue.length === 0 && current !== 0) { if (nextQueue.length === 0 && current !== 0) {
......
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
<gold type="gold" :des="mainInfo && mainInfo.account && mainInfo.account.quantity || 0" :gold="sign" :isReceive="isReceive" @resetAddGold="resetAddGold" @showCorn="cornModalShow"></gold> <gold type="gold" :des="mainInfo && mainInfo.account && mainInfo.account.quantity || 0" :gold="sign" :isReceive="isReceive" @resetAddGold="resetAddGold" @showCorn="cornModalShow"></gold>
<sign type="sign" des="签到" :sign="sign" @sign-in="signIn"></sign> <sign type="sign" des="签到" :sign="sign" @sign-in="signIn"></sign>
<lottery type="lottery" des="抽奖" @getAwards="getAwards" @getUserInfo="getUserInfo" :authmodal="authmodal"></lottery> <lottery type="lottery" des="抽奖" @getAwards="getAwards" @getUserInfo="getUserInfo" :authmodal="authmodal"></lottery>
<share type="share" des="分享"></share> <share type="share" des="分享" v-if="awardsInfo.id == undefined || awardsInfo.id >0"></share>
</view> </view>
<activity-list :activityList="activityList"></activity-list> <activity-list :activityList="activityList"></activity-list>
<network v-if="isConnected === false"/> <network v-if="isConnected === false"/>
...@@ -237,7 +237,6 @@ ...@@ -237,7 +237,6 @@
import Dialog from '../components/vant/dialog/dialog'; import Dialog from '../components/vant/dialog/dialog';
import { login, register, getMainInfo, addGold, getPrizeList, signIn, getActivityFeed, checkCornCode } from '../common/api.js'; import { login, register, getMainInfo, addGold, getPrizeList, signIn, getActivityFeed, checkCornCode } from '../common/api.js';
let flag = false; let flag = false;
let awardsInfo = {};
wepy.page({ wepy.page({
store, store,
data: { data: {
...@@ -256,6 +255,7 @@ ...@@ -256,6 +255,7 @@
cornTextShow: true, cornTextShow: true,
searchStyle:'', searchStyle:'',
avtivityModal: false, //展示活动弹窗 avtivityModal: false, //展示活动弹窗
awardsInfo:{},
}, },
computed: { computed: {
...@@ -348,8 +348,8 @@ ...@@ -348,8 +348,8 @@
const openid = wx.getStorageSync('openId'); const openid = wx.getStorageSync('openId');
return { return {
title: `${(this.$wepy.userInfo && this.$wepy.userInfo.nickName) || '您的好朋友'}邀请您来抽奖啦~`, title: `${(this.$wepy.userInfo && this.$wepy.userInfo.nickName) || '您的好朋友'}邀请您来抽奖啦~`,
path: `/pages/index?openid=${openid}&prizeId=${awardsInfo.id}`, path: `/pages/index?openid=${openid}&prizeId=${this.$wepy.awardsInfo.id}`,
imageUrl: decodeURIComponent(awardsInfo.photoUrl), imageUrl: decodeURIComponent(this.$wepy.awardsInfo.photoUrl),
success: function(res) { success: function(res) {
let shareId = res.shareTickets[0]; let shareId = res.shareTickets[0];
console.log('shareId', shareId); console.log('shareId', shareId);
...@@ -360,7 +360,7 @@ ...@@ -360,7 +360,7 @@
}; };
}, },
getAwards: function() { getAwards: function() {
const { id, photoUrl, name, chance } = awardsInfo; const { id, photoUrl, name, chance } = this.awardsInfo;
if ((!id && id !== 0) || !this.mainInfo || !this.mainInfo.account) { if ((!id && id !== 0) || !this.mainInfo || !this.mainInfo.account) {
Notify({ message: '服务器异常,请稍后重试', safeAreaInsetTop: true }); Notify({ message: '服务器异常,请稍后重试', safeAreaInsetTop: true });
return; return;
...@@ -379,7 +379,7 @@ ...@@ -379,7 +379,7 @@
}); });
}, },
getAwardsInfo: function(v) { getAwardsInfo: function(v) {
awardsInfo = v; this.awardsInfo = v;
}, },
showMenu: function(v) { showMenu: function(v) {
this.showModal = v ? 3 : 0; this.showModal = v ? 3 : 0;
......
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