分佣: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
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
// #endif
import { spreadBanner } from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import { toLogin } from '@/libs/login.js';
import { mapGetters } from "vuex";
// #ifdef MP
import {
base64src
} from '@/utils/base64src.js'
import authorize from '@/components/Authorize';
import {
getQrcode
} from '@/api/api.js';
import { base64src } from '@/utils/base64src.js'
import { getQrcode } from '@/api/api.js';
// #endif
import home from '@/components/home';
import {
imageBase64
} from "@/api/public";
import { imageBase64 } from "@/api/public";
import * as TradeConfigApi from '@/api/trade/config.js';
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
},
data() {
@ -73,8 +59,6 @@
swiperIndex: 0,
spreadList: [],
poster: '',
isAuto: false, //
isShowAuth: false, //
qrcodeSize: 1000,
PromotionCode: '',
base64List: [],
@ -93,12 +77,12 @@
}
},
onLoad() {
if (this.isLogin) {
this.userSpreadBannerList();
} else {
toLogin();
if (!this.isLogin) {
toLogin();
return;
}
},
this.userSpreadBannerList();
},
/**
* 用户点击右上角分享
*/
@ -119,13 +103,20 @@
title: '获取中',
mask: true,
})
spreadBanner({
page: 1,
limit: 5
}).then(res => {
TradeConfigApi.getTradeConfig().then(res => {
uni.hideLoading();
that.$set(that, 'spreadList', res.data);
that.getImageBase64(res.data);
const spreadList = [];
// 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 => {
uni.hideLoading();
});
@ -140,6 +131,7 @@
let spreadList = []
// Promise
images.forEach(item => {
// TODO @imageBase64 base64
const oneApi = imageBase64({
url: item.pic
}).then(res => {