分佣:user_spread_code 迁移

pull/1/MERGE
YunaiV 2023-09-06 22:41:17 +08:00
parent 25538f7a82
commit 34d222dc36
2 changed files with 31 additions and 33 deletions

6
api/trade/config.js Normal file
View File

@ -0,0 +1,6 @@
import request from "@/utils/request.js";
// 获得配送配置
export function getTradeConfig() {
return request.get("app-api/trade/config/get");
}

View File

@ -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 => {