分佣:spreadList 改成 posterUrls
parent
81c8285016
commit
e9019e9d39
|
@ -3,7 +3,7 @@
|
||||||
<view class='distribution-posters'>
|
<view class='distribution-posters'>
|
||||||
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :circular="circular" :interval="interval"
|
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :circular="circular" :interval="interval"
|
||||||
:duration="duration" @change="bindchange" previous-margin="40px" next-margin="40px">
|
:duration="duration" @change="bindchange" previous-margin="40px" next-margin="40px">
|
||||||
<block v-for="(item,index) in spreadList" :key="index">
|
<block v-for="(item,index) in posterUrls" :key="index">
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
<image :src="item.pic" class="slide-image" :class="swiperIndex == index ? 'active' : 'quiet'"
|
<image :src="item.pic" class="slide-image" :class="swiperIndex == index ? 'active' : 'quiet'"
|
||||||
mode='aspectFill' />
|
mode='aspectFill' />
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
interval: 3000,
|
interval: 3000,
|
||||||
duration: 500,
|
duration: 500,
|
||||||
swiperIndex: 0,
|
swiperIndex: 0,
|
||||||
spreadList: [],
|
posterUrls: [],
|
||||||
poster: '',
|
poster: '',
|
||||||
qrcodeSize: 1000,
|
qrcodeSize: 1000,
|
||||||
PromotionCode: '',
|
PromotionCode: '',
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
onShareAppMessage: function() {
|
onShareAppMessage: function() {
|
||||||
return {
|
return {
|
||||||
title: this.userInfo.nickname + '-分销海报',
|
title: this.userInfo.nickname + '-分销海报',
|
||||||
imageUrl: this.spreadList[0].pic,
|
imageUrl: this.posterUrls[0].pic,
|
||||||
path: '/pages/index/index?spid=' + this.uid,
|
path: '/pages/index/index?spid=' + this.uid,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -106,17 +106,17 @@
|
||||||
|
|
||||||
TradeConfigApi.getTradeConfig().then(res => {
|
TradeConfigApi.getTradeConfig().then(res => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
const spreadList = [];
|
const posterUrls = [];
|
||||||
// TODO @芋艿:这里后续可以优化下;直接使用 brokeragePosterUrls 数组,而不是要搞 pic 元素
|
// TODO @芋艿:这里后续可以优化下;直接使用 brokeragePosterUrls 数组,而不是要搞 pic 元素
|
||||||
if (res.data.brokeragePosterUrls) {
|
if (res.data.brokeragePosterUrls) {
|
||||||
res.data.brokeragePosterUrls.forEach(item => {
|
res.data.brokeragePosterUrls.forEach(item => {
|
||||||
spreadList.push({
|
posterUrls.push({
|
||||||
pic: item
|
pic: item
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
that.$set(that, 'spreadList', spreadList);
|
that.$set(that, 'posterUrls', posterUrls);
|
||||||
that.getImageBase64(spreadList);
|
that.getImageBase64(posterUrls);
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
});
|
});
|
||||||
|
@ -128,7 +128,7 @@
|
||||||
});
|
});
|
||||||
let that = this;
|
let that = this;
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
let spreadList = []
|
let posterUrls = []
|
||||||
// 生成一个Promise对象的数组
|
// 生成一个Promise对象的数组
|
||||||
images.forEach(item => {
|
images.forEach(item => {
|
||||||
// TODO @芋艿:imageBase64 这里是为了下载图片的 base64;后续看看可以前端直接操作不;
|
// TODO @芋艿:imageBase64 这里是为了下载图片的 base64;后续看看可以前端直接操作不;
|
||||||
|
@ -137,9 +137,9 @@
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
return res.data.code;
|
return res.data.code;
|
||||||
})
|
})
|
||||||
spreadList.push(oneApi)
|
posterUrls.push(oneApi)
|
||||||
})
|
})
|
||||||
Promise.all(spreadList).then(result => {
|
Promise.all(posterUrls).then(result => {
|
||||||
that.$set(that, 'base64List', result);
|
that.$set(that, 'base64List', result);
|
||||||
that.make();
|
that.make();
|
||||||
that.setShareInfoStatus();
|
that.setShareInfoStatus();
|
||||||
|
@ -237,7 +237,7 @@
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
// 在H5平台下,tempFilePath 为 base64
|
// 在H5平台下,tempFilePath 为 base64
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
that.spreadList[index].pic = res
|
that.posterUrls[index].pic = res
|
||||||
.tempFilePath;
|
.tempFilePath;
|
||||||
that.$set(that, 'poster', res
|
that.$set(that, 'poster', res
|
||||||
.tempFilePath);
|
.tempFilePath);
|
||||||
|
@ -332,7 +332,7 @@
|
||||||
desc: '分销海报',
|
desc: '分销海报',
|
||||||
title: this.userInfo.nickname + '-分销海报',
|
title: this.userInfo.nickname + '-分销海报',
|
||||||
link: '/pages/index/index?spread=' + this.uid,
|
link: '/pages/index/index?spread=' + this.uid,
|
||||||
imgUrl: this.spreadList[0].pic
|
imgUrl: this.posterUrls[0].pic
|
||||||
};
|
};
|
||||||
this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
|
this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
|
||||||
configAppMessage)
|
configAppMessage)
|
||||||
|
|
Loading…
Reference in New Issue