From bb4c2676e763154736b8ea660ee8d38f0bd2cd72 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Thu, 20 Nov 2025 15:55:50 +0800
Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=EF=BC=8C?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=82=B9=E5=8D=95=E6=99=BA=E8=83=BD=E6=8E=A8?=
=?UTF-8?q?=E8=8D=90=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
http/api/market/suggest.js | 41 +++++++++
.../components/fenxiao-user-list.vue | 12 ++-
.../distribution/components/open-list.vue | 4 +-
pageMarket/distribution/index.vue | 54 +++++++++---
pageMarket/distribution/level-list.vue | 86 ++++++++++++++++---
pageMarket/distribution/money-recoders.vue | 2 +-
pageMarket/newUserDiscount/index.vue | 19 +++-
pageMarket/orderRecommendation/index.vue | 3 +
pages.json | 7 ++
pages/appliccation/marketing.vue | 2 +-
store/market.js | 11 ++-
11 files changed, 201 insertions(+), 40 deletions(-)
create mode 100644 http/api/market/suggest.js
create mode 100644 pageMarket/orderRecommendation/index.vue
diff --git a/http/api/market/suggest.js b/http/api/market/suggest.js
new file mode 100644
index 0000000..6068458
--- /dev/null
+++ b/http/api/market/suggest.js
@@ -0,0 +1,41 @@
+import http from "@/http/http.js";
+const request = http.request;
+const urlType = "market";
+
+export function suggestPage(params) {
+ return request({
+ url: urlType + `/admin/suggest/page`,
+ method: "get",
+ params: {
+ ...params,
+ },
+ });
+}
+export function addSuggest(params) {
+ return request({
+ url: urlType + `/admin/suggest`,
+ method: "POST",
+ params: {
+ ...params,
+ },
+ });
+}
+export function editSuggest(params) {
+ return request({
+ url: urlType + `/admin/suggest`,
+ method: "PUT",
+ params: {
+ ...params,
+ },
+ });
+}
+export function deleteSuggest(params) {
+ return request({
+ url: urlType + `/admin/suggest`,
+ method: "DELETE",
+ params: {
+ ...params,
+ },
+ });
+}
+
diff --git a/pageMarket/distribution/components/fenxiao-user-list.vue b/pageMarket/distribution/components/fenxiao-user-list.vue
index 4a20196..f3906d5 100644
--- a/pageMarket/distribution/components/fenxiao-user-list.vue
+++ b/pageMarket/distribution/components/fenxiao-user-list.vue
@@ -3,9 +3,9 @@
- 用户昵称
+ {{ item.shopUserName }}
- {{ item.shopUserName }}
+ {{ item.shopUserPhone }}
@@ -82,7 +82,7 @@
>是否确认重置分销组 重置后将会按照用户的实际数据匹配分销组
-
+
是否确认取消分销员
@@ -179,6 +179,8 @@ async function handleConfirm() {
id: modalData.data.id,
shopId: uni.getSystemInfoSync("shopInfo").id || "",
});
+ emits("refresh");
+
}
if (modalData.key == "change-group") {
const level=distributionStore.config.levelConfigList.find((item) => item.id == group.value)
@@ -204,6 +206,10 @@ async function handleConfirm() {
});
emits("refresh");
}
+ uni.showToast({
+ title:'操作成功',
+ icon:'none'
+ })
group.value = "";
modalData.show = false;
}
diff --git a/pageMarket/distribution/components/open-list.vue b/pageMarket/distribution/components/open-list.vue
index 4aef715..8719104 100644
--- a/pageMarket/distribution/components/open-list.vue
+++ b/pageMarket/distribution/components/open-list.vue
@@ -12,9 +12,9 @@
- 用户昵称
+ {{item.nickName}}
- {{ item.nickName }}
+ {{ item.phone }}
{{ item.changeAmount }}
diff --git a/pageMarket/distribution/index.vue b/pageMarket/distribution/index.vue
index d674c54..862e804 100644
--- a/pageMarket/distribution/index.vue
+++ b/pageMarket/distribution/index.vue
@@ -11,7 +11,7 @@
分销
允许客户充值并使用余额支付
+ >用户成为业务员,可促进消费
+
+
+
+
请选择日期范围
@@ -66,14 +70,13 @@
class="u-font-28 filter-box u-flex u-row-between"
@click="showActions = true"
>
-
+
{{ selActions.name }}
全部
-
@@ -97,6 +100,9 @@
{{ userComponentQuery.startTime }} -
{{ userComponentQuery.endTime }}
+
+
+
请选择日期
@@ -115,7 +121,7 @@
{{
listRes.totalAmount
}}
- 支付开通人数
+ 已支付金额(元)
@@ -137,7 +143,9 @@
}}
运营余额(元)
- 充值{{'>'}}
+ 充值{{ ">" }}
@@ -229,10 +237,18 @@ const actions = [
value: "refund",
},
];
-const selActions=ref('')
+function clearKeyWord() {
+ keyWord.value = "";
+ userComponentQuery.user = "";
+}
+function clearTime() {
+ userComponentQuery.startTime = "";
+ userComponentQuery.endTime = "";
+}
+const selActions = ref("");
const showActions = ref(false);
function handleSelect(e) {
- selActions.value = e;
+ selActions.value = e;
}
const distributionStore = useDistributionStore();
@@ -360,7 +376,7 @@ async function getList() {
page: pageNum.value,
size: 10,
key: userComponentQuery.user,
- status: selActions.value.value,
+ status: selActions.value?.value || "",
startTime: userComponentQuery.startTime
? userComponentQuery.startTime + " 00:00:00"
: "",
@@ -391,6 +407,9 @@ const active = ref(0);
watch(
() => active.value,
(newval) => {
+ userComponentQuery.startTime = "";
+ userComponentQuery.endTime = "";
+ keyWord.value = "";
console.log(newval);
pageNum.value = 1;
getList();
@@ -399,21 +418,28 @@ watch(
watch(
() => active.value,
(newval) => {
+
+ refresh();
+ }
+);
+watch(
+ () => selActions.value,
+ () => {
refresh();
}
);
-watch(()=>selActions.value,()=>{
- refresh()
-})
onReachBottom(() => {
if (!isEnd.value) {
pageNum.value++;
getList();
}
});
-watch(()=>distributionStore.config.isEnable,()=>{
- distributionStore.editConfig()
-})
+watch(
+ () => distributionStore.config.isEnable,
+ () => {
+ distributionStore.editConfig();
+ }
+);
onShow(() => {
pageNum.value = 1;
getList();
diff --git a/pageMarket/distribution/level-list.vue b/pageMarket/distribution/level-list.vue
index 806ad97..2a61107 100644
--- a/pageMarket/distribution/level-list.vue
+++ b/pageMarket/distribution/level-list.vue
@@ -33,7 +33,7 @@
名称
-
+
分成比例
@@ -50,8 +50,10 @@
%
-
- 有效人数
+
+
+
+ 有效人数
人
+
有效人数:被邀请人在店铺消费过,即有一笔订单完成
+
+
+
+ 消费金额达
+
+
+
+ 元
+
+
+ 消费金额:分销员和被邀请人在店铺订单消费总金额(不包含退款)
+
+
+
+
+
{{index==0? '添加':'继续添加'}}
-
+
删除
@@ -124,15 +149,19 @@ let timer=null
//全部的分成比例加起来不能超过100%
function checkNumberCommission(e,index){
const value=e.detail.value
+ clearInterval(timer)
+
if(value>100){
uni.showToast({
title:'分成比例不能超过100',
icon:'none'
})
- form.levelConfigList[index].levelOneCommission=''
+ timer= setTimeout(()=>{
+ form.levelConfigList[index].levelOneCommission=''
+ },30)
+
return false
}
- clearInterval(timer)
//输入最多两位小数,两位小数点后的去除掉不让输入
if(value.indexOf('.')!=-1){
const arr=value.split('.')
@@ -144,6 +173,21 @@ function checkNumberCommission(e,index){
}
}
+
+function checkName(e,index){
+ const value=e.detail.value
+ if(value.length>10){
+ uni.showToast({
+ title:'名称最多10个字符',
+ icon:'none'
+ })
+ timer= setTimeout(()=>{
+ form.levelConfigList[index].name=value.substring(0,10)
+
+ },30)
+ return false
+ }
+}
function remove(index){
form.levelConfigList.splice(index,1)
showDetailListSwitch.value.splice(index,1)
@@ -152,7 +196,8 @@ function addLevelConfig(){
form.levelConfigList.push({
name:'',
levelOneCommission:'',
- inviteCount:''
+ inviteCount:'',
+ costAmount:''
})
showDetailListSwitch.value.push(true)
}
@@ -175,13 +220,28 @@ function addLevelConfig(){
})
return false
}
- if(item.inviteCount===''){
- uni.showToast({
- title:'请输入有效人数',
- icon:'none'
- })
- return false
+ if(form.upgradeType==='not_upgrade'){
+ continue
}
+ if(form.upgradeType==='cost'){
+ if(item.costAmount===''||item.costAmount===null){
+ uni.showToast({
+ title:'请输入消费金额',
+ icon:'none'
+ })
+ return false
+ }
+ }else{
+ if(item.inviteCount===''||item.inviteCount===null){
+ uni.showToast({
+ title:'请输入有效人数',
+ icon:'none'
+ })
+ return false
+ }
+
+ }
+
}
return true
}
diff --git a/pageMarket/distribution/money-recoders.vue b/pageMarket/distribution/money-recoders.vue
index 1f63020..5af701c 100644
--- a/pageMarket/distribution/money-recoders.vue
+++ b/pageMarket/distribution/money-recoders.vue
@@ -70,7 +70,7 @@
- 关联订单:WX1987787224197300224
+ 关联订单:{{item.orderNo}}
diff --git a/pageMarket/newUserDiscount/index.vue b/pageMarket/newUserDiscount/index.vue
index d9d0b58..e8959bd 100644
--- a/pageMarket/newUserDiscount/index.vue
+++ b/pageMarket/newUserDiscount/index.vue
@@ -54,7 +54,7 @@
placeholder="请输入内容"
placeholder-class="color-999 u-font-28"
type="number"
- v-model="form.payAmount"
+ v-model="form.discountAmount"
/>
元
@@ -225,6 +225,7 @@ const form = reactive({
discountType: "FIXED",
useTypeList: [],
randomDiscountList: [],
+ discountAmount: "",
});
function cancel() {
@@ -243,6 +244,13 @@ function save() {
});
return;
}
+ if(form.discountType == "FIXED" && form.discountAmount == ""){
+ uni.showToast({
+ title:'请填写减免金额',
+ icon:'none'
+ })
+ return;
+ }
newUserDiscountStore
.editConfig(
{
@@ -266,7 +274,14 @@ function save() {
watch(
() => newUserDiscountStore.config.isEnable,
(newVal) => {
- save();
+ newUserDiscountStore.editConfig().then((res) => {
+ if (res) {
+ uni.showToast({
+ title: "操作成功",
+ icon: "none",
+ });
+ }
+ });
}
);
diff --git a/pageMarket/orderRecommendation/index.vue b/pageMarket/orderRecommendation/index.vue
new file mode 100644
index 0000000..46c1fa3
--- /dev/null
+++ b/pageMarket/orderRecommendation/index.vue
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/pages.json b/pages.json
index c26d5ef..6fd44d8 100644
--- a/pages.json
+++ b/pages.json
@@ -698,6 +698,13 @@
"style": {
"navigationBarTitleText": "新客立减"
}
+ },
+ {
+ "pageId": "PAGES_MARKET_ORDER_RECOMMENDATION",
+ "path": "orderRecommendation/index",
+ "style": {
+ "navigationBarTitleText": "点餐智能推荐"
+ }
}
]
},
diff --git a/pages/appliccation/marketing.vue b/pages/appliccation/marketing.vue
index 7f2c782..70f09fd 100644
--- a/pages/appliccation/marketing.vue
+++ b/pages/appliccation/marketing.vue
@@ -100,7 +100,7 @@ const menuList = ref([
{
title: '点餐智能推荐',
icon: '',
- pageUrl: '',
+ pageUrl: 'PAGES_MARKET_ORDER_RECOMMENDATION',
intro: '进入点单页X秒未点自动推荐商品,此推荐设置启用即生效'
},
{
diff --git a/store/market.js b/store/market.js
index af8b1d5..e7b0b0e 100644
--- a/store/market.js
+++ b/store/market.js
@@ -69,13 +69,16 @@ export const useNewUserDiscountStore = defineStore("newUserDiscount", {
this.config = data;
return this.config;
},
- async editConfig(data,isAutoResrefresh = true) {
- const res = await consumeDiscountApi.editConfig({ ...this.config, ...data });
- if(isAutoResrefresh){
+ async editConfig(data, isAutoResrefresh = true) {
+ const res = await consumeDiscountApi.editConfig({
+ ...this.config,
+ ...data,
+ });
+ if (isAutoResrefresh) {
this.getConfig();
}
return res;
},
},
unistorage: true, // 开启后对 state 的数据读写都将持久化
-});
\ No newline at end of file
+});