分佣:商品详情增加绑定用户

pull/1/MERGE
YunaiV 2023-09-09 22:19:12 +08:00
parent 15b7e3d94c
commit ad4eb04f49
5 changed files with 30 additions and 15 deletions

View File

@ -27,7 +27,7 @@ export function wechatAuth(code, spread) {
/**
* 获取登录授权login
*
*
*/
export function getLogo()
{
@ -113,4 +113,4 @@ export function appleLogin(data) {
*/
export function iosBinding(data) {
return request.post("ios/binding/phone", data, { noAuth : true });
}
}

View File

@ -51,3 +51,10 @@ export function createBrokerageWithdraw(data) {
export function getBrokerageRecordPage(data) {
return request.get('app-api/trade/brokerage-record/page', data);
}
// 获得商品的分销金额
export function getProductBrokeragePrice(spuId) {
return request.get('app-api/trade/brokerage-record/get-product-brokerage-price', {
spuId
});
}

View File

@ -1,5 +1,5 @@
<template>
<view class='sharing-packets' :class='sharePacket.isState ? "on":""'>
<view class='sharing-packets' :class='!sharePacket.enabled ? "on":""'>
<view class='iconfont icon-guanbi' @click="closeShare"></view>
<view class='line'></view>
<view class='sharing-con' @click='goShare'>
@ -21,7 +21,7 @@
type: Object,
default: function() {
return {
isState: true,
enabled: true,
priceName:'' //
}
}

View File

@ -1,6 +1,6 @@
// let domain = 'http://apif.java.crmeb.net'
let domain = 'http://127.0.0.1:48080'
let domain = 'http://apif.java.crmeb.net'
// let domain = 'http://127.0.0.1:48080'
module.exports = {
// 请求域名 格式: https://您的域名

View File

@ -293,6 +293,7 @@
import * as CouponApi from '@/api/promotion/coupon.js';
import * as PromotionActivityApi from '@/api/promotion/activity.js';
import * as TradeCartApi from '@/api/trade/cart.js';
import * as BrokerageAPI from '@/api/trade/brokerage.js'
import * as Util from '@/utils/util.js';
import * as ProductUtil from '@/utils/product.js';
// #ifdef MP
@ -372,7 +373,7 @@
posterbackgd: '/static/images/posterbackgd.png', //
storeImage: '', //
sharePacket: { //
isState: true, //
enabled: true, //
},
actionSheetHidden: true, //
@ -421,11 +422,11 @@
// #ifdef MP || APP-PLUS
// id
// TODO
//
setTimeout(()=>{
if(options.spread){
app.globalData.spread = options.spread;
spread(options.spread).then(res => {})
BrokerageAPI.bindBrokerageUser(options.spread).then(res => {})
}
},2000)
// #endif
@ -448,9 +449,9 @@
let mapeMpQrCodeValue = this.$util.formatMpQrCodeData(qrCodeValue);
app.globalData.spread = mapeMpQrCodeValue.spread;
this.id = mapeMpQrCodeValue.id;
// TODO code
//
setTimeout(()=>{
spread(mapeMpQrCodeValue.spread).then(res => {}).catch(res => {})
BrokerageAPI.bindBrokerageUser(mapeMpQrCodeValue.spread).then(res => {}).catch(res => {})
},2000)
} else {
this.id = options.id;
@ -513,8 +514,8 @@
this.$set(this, 'skuMap', ProductUtil.convertProductSkuMap(skus));
// // TODO
this.$set(this.sharePacket, 'priceName', res.data.priceName);
this.$set(this.sharePacket, 'isState', Math.floor(res.data.priceName) === 0);
// this.$set(this.sharePacket, 'priceName', res.data.priceName);
// this.$set(this.sharePacket, 'enabled', Math.floor(res.data.priceName) === 0);
//
PromotionActivityApi.getActivityListBySpuId(this.id).then(res => {
@ -532,6 +533,7 @@
if (this.isLogin) {
this.getCartCount();
this.isFavoriteExists();
this.getBrokeragePrice();
// #ifdef H5
this.make();
this.ShareInfo();
@ -566,6 +568,13 @@
});
})
},
getBrokeragePrice: function() {
BrokerageAPI.getProductBrokeragePrice(this.id).then(res => {
// this.sharePacket = res.data
// console.log(this.sharePacket)
this.$set(this.sharePacket, 'isState', false);
});
},
/**
* 查找默认选中的 sku设置到 attr.productSelect
*
@ -698,7 +707,6 @@
TradeCartApi.addCart({
count: sku.cart_num,
skuId: sku.id,
addStatus: true // TODO addStatus
}).then(res => {
// attr
this.attr.cartAttr = false;
@ -1191,7 +1199,7 @@
* 关闭分销的弹窗
*/
closeChange: function() {
this.$set(this.sharePacket, 'isState', true);
this.$set(this.sharePacket, 'enabled', false);
},
// ========== nav ==========