分佣:spreadList 改成 posterUrls

pull/1/MERGE
YunaiV 2023-09-09 19:52:17 +08:00
parent 81c8285016
commit e9019e9d39
1 changed files with 12 additions and 12 deletions

View File

@ -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) {
// H5tempFilePath base64 // H5tempFilePath 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)