问题修复,增加点单智能推荐页面

This commit is contained in:
2025-11-20 15:55:50 +08:00
parent 8fa21b3404
commit bb4c2676e7
11 changed files with 201 additions and 40 deletions

View File

@@ -33,7 +33,7 @@
<view class="u-m-t-60">
<view class="title">名称</view>
<view class="u-p-t-16 u-p-b-24">
<input placeholder="请输入名称" placeholder-class="color-999 u-font-28" v-model="item.name"></input>
<input placeholder="请输入名称" placeholder-class="color-999 u-font-28" v-model="item.name" @input="checkName($event, index)"></input>
</view>
<up-line></up-line>
<view class="title u-m-t-24">分成比例</view>
@@ -50,8 +50,10 @@
<view class="unit">%</view>
</view>
</view>
<up-line></up-line>
<view class="title u-m-t-24">有效人数</view>
<template v-if="form.upgradeType!='not_upgrade'">
<up-line></up-line>
<template v-if="form.upgradeType!='cost'">
<view class="title u-m-t-24">有效人数</view>
<view class="u-m-t-16 u-p-b-8">
<view class="u-flex u-m-t-16">
<input
@@ -64,13 +66,36 @@
<view class="unit"></view>
</view>
</view>
<view class="color-999 u-font-24">有效人数被邀请人在店铺消费过即有一笔订单完成</view>
</template>
<template v-else>
<view class="title u-m-t-24">消费金额达</view>
<view class="u-m-t-16 u-p-b-8">
<view class="u-flex u-m-t-16">
<input
class="number-box"
placeholder="请输入"
placeholder-class="color-999 u-font-28"
type="digit"
v-model="item.costAmount"
/>
<view class="unit"></view>
</view>
</view>
<view class="color-999 u-font-24">消费金额分销员和被邀请人在店铺订单消费总金额不包含退款</view>
</template>
</template>
<view class="u-m-t-24 u-flex u-row-right" style="gap: 40rpx;">
<view class="u-flex" v-if="index==0||index==form.levelConfigList.length-1" @click="addLevelConfig">
<up-icon name="plus-circle-fill" color="#318AFE" ></up-icon>
<text class="u-m-l-16">{{index==0? '添加':'继续添加'}}</text>
</view>
<view class="u-flex" @click="remove(index)">
<view class="u-flex" @click="remove(index)" v-if="index!=0">
<up-icon name="minus-circle-fill" color="#EB4F4F" ></up-icon>
<text class="u-m-l-16">删除</text>
</view>
@@ -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
}