mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-08-06 10:57:25 +08:00
feat(distribution): 实现分销员中心完整功能
- 新增分销业绩统计页面,包含时间范围筛选和自定义日期选择功能 - 重构分销认证页面,改为跳转至招募页面申请分销员身份 - 添加分销商品访问记录功能,支持分享追踪和佣金计算 - 更新分销历史记录页面,优化数据结构和显示字段 - 完全重写分销员首页,包含用户信息、收益统计、等级系统等功能
This commit is contained in:
@@ -317,7 +317,8 @@
|
||||
/************接口API***************/
|
||||
import { ref, reactive, computed, watch, nextTick, getCurrentInstance } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { getGoods, getGoodsList, getMpScene, getGoodsDistribution } from '@/api/goods.js'
|
||||
import { getGoods, getGoodsList, getMpScene } from '@/api/goods.js'
|
||||
import { recordDistributionGoodsVisit } from '@/api/distribution.js'
|
||||
import * as API_trade from '@/api/trade.js'
|
||||
import * as API_Members from '@/api/members.js'
|
||||
import * as API_store from '@/api/store.js'
|
||||
@@ -461,10 +462,15 @@ onShow(async () => {
|
||||
const res = await getMpScene(routerVal.value.scene)
|
||||
if (res.data.success) {
|
||||
let data = res.data.result.split(",")
|
||||
init(data[0], data[1], data[2])
|
||||
init(data[0], data[1], data[2], data[3] || '')
|
||||
}
|
||||
} else {
|
||||
init(routerVal.value.id, routerVal.value.goodsId, routerVal.value.distributionId)
|
||||
init(
|
||||
routerVal.value.id,
|
||||
routerVal.value.goodsId,
|
||||
routerVal.value.distributionId,
|
||||
routerVal.value.shareId || ''
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -494,7 +500,7 @@ function selectSku(idObj: any) {
|
||||
init(idObj.skuId, idObj.goodsId)
|
||||
}
|
||||
|
||||
async function init(id: any, goodsId: any, distributionId = "") {
|
||||
async function init(id: any, goodsId: any, distributionId = "", shareId = "") {
|
||||
isGroup.value = false
|
||||
productId.value = id
|
||||
|
||||
@@ -511,11 +517,18 @@ async function init(id: any, goodsId: any, distributionId = "") {
|
||||
return
|
||||
}
|
||||
|
||||
if ((distributionId || store.state.distributionId) && isLogin("auth")) {
|
||||
let disResult = await getGoodsDistribution(distributionId)
|
||||
if (!disResult?.data?.success || disResult.statusCode == 403) {
|
||||
store.state.distributionId = distributionId
|
||||
}
|
||||
const distId = distributionId || store.state.distributionId
|
||||
if (distId && goodsId && id) {
|
||||
recordDistributionGoodsVisit({
|
||||
skuId: id,
|
||||
goodsId,
|
||||
distributionId: distId,
|
||||
shareId: shareId || undefined,
|
||||
}).then((res) => {
|
||||
if (res?.data?.success) {
|
||||
store.state.distributionId = distId
|
||||
}
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
const resultData = response.data.result?.data
|
||||
|
||||
Reference in New Issue
Block a user