分佣:user_spread_code 迁移
parent
25538f7a82
commit
34d222dc36
|
@ -0,0 +1,6 @@
|
||||||
|
import request from "@/utils/request.js";
|
||||||
|
|
||||||
|
// 获得配送配置
|
||||||
|
export function getTradeConfig() {
|
||||||
|
return request.get("app-api/trade/config/get");
|
||||||
|
}
|
|
@ -35,31 +35,17 @@
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
|
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
|
||||||
// #endif
|
// #endif
|
||||||
import { spreadBanner } from '@/api/user.js';
|
import { toLogin } from '@/libs/login.js';
|
||||||
import {
|
import { mapGetters } from "vuex";
|
||||||
toLogin
|
|
||||||
} from '@/libs/login.js';
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
import {
|
import { base64src } from '@/utils/base64src.js'
|
||||||
base64src
|
import { getQrcode } from '@/api/api.js';
|
||||||
} from '@/utils/base64src.js'
|
|
||||||
import authorize from '@/components/Authorize';
|
|
||||||
import {
|
|
||||||
getQrcode
|
|
||||||
} from '@/api/api.js';
|
|
||||||
// #endif
|
// #endif
|
||||||
import home from '@/components/home';
|
import home from '@/components/home';
|
||||||
import {
|
import { imageBase64 } from "@/api/public";
|
||||||
imageBase64
|
import * as TradeConfigApi from '@/api/trade/config.js';
|
||||||
} from "@/api/public";
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
// #ifdef MP
|
|
||||||
authorize,
|
|
||||||
// #endif
|
|
||||||
home
|
home
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
@ -73,8 +59,6 @@
|
||||||
swiperIndex: 0,
|
swiperIndex: 0,
|
||||||
spreadList: [],
|
spreadList: [],
|
||||||
poster: '',
|
poster: '',
|
||||||
isAuto: false, //没有授权的不会自动授权
|
|
||||||
isShowAuth: false, //是否隐藏授权
|
|
||||||
qrcodeSize: 1000,
|
qrcodeSize: 1000,
|
||||||
PromotionCode: '',
|
PromotionCode: '',
|
||||||
base64List: [],
|
base64List: [],
|
||||||
|
@ -93,12 +77,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
if (this.isLogin) {
|
if (!this.isLogin) {
|
||||||
this.userSpreadBannerList();
|
toLogin();
|
||||||
} else {
|
return;
|
||||||
toLogin();
|
|
||||||
}
|
}
|
||||||
},
|
this.userSpreadBannerList();
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 用户点击右上角分享
|
* 用户点击右上角分享
|
||||||
*/
|
*/
|
||||||
|
@ -119,13 +103,20 @@
|
||||||
title: '获取中',
|
title: '获取中',
|
||||||
mask: true,
|
mask: true,
|
||||||
})
|
})
|
||||||
spreadBanner({
|
|
||||||
page: 1,
|
TradeConfigApi.getTradeConfig().then(res => {
|
||||||
limit: 5
|
|
||||||
}).then(res => {
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
that.$set(that, 'spreadList', res.data);
|
const spreadList = [];
|
||||||
that.getImageBase64(res.data);
|
// TODO @芋艿:这里后续可以优化下;直接使用 brokeragePosterUrls 数组,而不是要搞 pic 元素
|
||||||
|
if (res.data.brokeragePosterUrls) {
|
||||||
|
res.data.brokeragePosterUrls.forEach(item => {
|
||||||
|
spreadList.push({
|
||||||
|
pic: item
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.$set(that, 'spreadList', spreadList);
|
||||||
|
that.getImageBase64(spreadList);
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
});
|
});
|
||||||
|
@ -140,6 +131,7 @@
|
||||||
let spreadList = []
|
let spreadList = []
|
||||||
// 生成一个Promise对象的数组
|
// 生成一个Promise对象的数组
|
||||||
images.forEach(item => {
|
images.forEach(item => {
|
||||||
|
// TODO @芋艿:imageBase64 这里是为了下载图片的 base64;后续看看可以前端直接操作不;
|
||||||
const oneApi = imageBase64({
|
const oneApi = imageBase64({
|
||||||
url: item.pic
|
url: item.pic
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
Loading…
Reference in New Issue