转介绍

This commit is contained in:
老叶
2021-12-24 15:44:53 +08:00
parent 20c31b2355
commit 7efb6220e6
6 changed files with 256 additions and 106 deletions
File diff suppressed because one or more lines are too long
+4
View File
@@ -97,6 +97,10 @@ api = {
appCusorderCdata:'app/cusorder/cdata', //上传资料
appBrokerageOrders:'app/brokerage/orders', //转介绍列表
appBrokerage:'app/brokerage', //获取佣金设置 /更新佣金设置 /创建佣金设置
}
//远程图片存储地址
+29
View File
@@ -614,4 +614,33 @@ apiQuery.putAppCusorderCdata = function (params) {
})
}
//获取佣金设置
apiQuery.getAppBrokerage = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBrokerage, 2, params, "GET", resolve, reject)
})
}
//创建佣金设置
apiQuery.postAppBrokerage = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appBrokerage, 2, params, "POST", resolve, reject)
})
}
//更新佣金设置
apiQuery.putAppBrokerage = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(true, Config.api.appBrokerage, 2, params, "PUT", resolve, reject)
})
}
//转介绍列表
apiQuery.getAppBrokerageOrders = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appBrokerageOrders, 2, params, "GET", resolve, reject)
})
}
export default apiQuery;
+11 -6
View File
@@ -28,7 +28,6 @@ Page({
title:'账户设置',
url:'/pages/mine/install/index',
},
]
}else if(this.data.source=='shop'){
list = [
@@ -47,11 +46,6 @@ Page({
title:'账户设置',
url:'/pages/mine/install/index',
},
{
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-jieshao2.png',
title:'转介绍',
url:'/pages/mine/install/index',
},
]
}
@@ -82,6 +76,17 @@ Page({
this.setData({
userInfo: res
})
if(res.group_id>1){
let list = this.data.list
list.push({
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-jieshao2.png',
title:'转介绍',
url:'/pages/recommend/index',
})
this.setData({
list,
})
}
});
},
+198 -86
View File
@@ -1,106 +1,218 @@
import _ from '../../commons/js/commons'
const app = getApp()
Page({
data: {
isShowCommission:false,
"list": [
{
"biz_name": "",
"c_time": "调拨时间:2021-12-08 17:14",
"other_data": [{
"title": "品牌车型",
"value": "东风-EX1"
}, {
"title": "颜色型号",
"value": "质行版-白色"
}, {
"title": "车架号",
"value": "LDP42A967M9005393"
}, {
"title": "调拨时间",
"value": "2021-12-08"
}, {
"title": "提车人",
"value": "志伟"
}, {
"title": "接车人",
"value": "jimmy"
}, {
"title": "运输员",
"value": "王红"
}],
},
{
"biz_name": "",
"c_time": "调拨时间:2021-12-08 17:14",
"other_data": [{
"title": "品牌车型",
"value": "东风-EX1"
}, {
"title": "颜色型号",
"value": "质行版-白色"
}, {
"title": "车架号",
"value": "LDP42A967M9005393"
}, {
"title": "调拨时间",
"value": "2021-12-08"
}, {
"title": "提车人",
"value": "志伟"
}, {
"title": "接车人",
"value": "jimmy"
}, {
"title": "运输员",
"value": "王红"
}],
},
{
"biz_name": "",
"c_time": "调拨时间:2021-12-08 17:14",
"other_data": [{
"title": "品牌车型",
"value": "东风-EX1"
}, {
"title": "颜色型号",
"value": "质行版-白色"
}, {
"title": "车架号",
"value": "LDP42A967M9005393"
}, {
"title": "调拨时间",
"value": "2021-12-08"
}, {
"title": "提车人",
"value": "志伟"
}, {
"title": "接车人",
"value": "jimmy"
}, {
"title": "运输员",
"value": "王红"
}],
},
],
list: [],//客户列表
pageNo: 1,
noData: false,
end: false,
load: true,
loading: false,
flag:1,
keyword:'',
id: "",
brokerage_1: 0, //一级佣金
brokerage_2: 0 //二级佣金
},
onLoad: function (options) {
for (let key in options) {
this.setData({
[key]: options[key]
})
}
this.getAppBrokerage()
this.getAppBrokerageOrders()
},
onShow: function () {
},
//转介绍列表
getAppBrokerage(){
_.apiQuery.getAppBrokerage().then(res => {
this.setData({
brokerage:res.data,
id:res.data.id,
brokerage_1:res.data.brokerage_1,
brokerage_2:res.data.brokerage_2,
})
wx.stopPullDownRefresh()
});
},
//转介绍列表
getAppBrokerageOrders() {
this.setData({
load: false,
loading: true,
})
let params = {};
params['page'] = this.data.pageNo;
params['size'] = 10;
if(this.data.keyword != ''){
params['keyword'] = this.data.keyword;
}
_.apiQuery.getAppBrokerageOrders(params).then(res => {
this.setData({
flag: this.data.flag - 1
})
if (!this.data.flag) {
this.setData({
pageNo: this.data.pageNo + 1,
list: this.data.list.concat(res.data.list),
load: true,
loading: false,
})
if (res.data.total == 0) {
this.setData({
noData: true
})
} else if (this.data.list.length == res.data.total) {
this.setData({
end: true
})
}
}
wx.stopPullDownRefresh()
});
},
//提交搜索
searchSubmit(){
this.setData({
list: [],
pageNo: 1,
noData: false,
end: false,
load: true,
loading: false,
flag: this.data.flag + 1
})
this.getAppBrokerageOrders()
},
//显示隐藏配置佣金
optShowCommission(){
this.setData({
isShowCommission:!this.data.isShowCommission,
})
this.getAppBrokerage()
},
onPullDownRefresh: function () {
//更新佣金设置
postAppBrokerage() {
let that = this
if (!(that.data.brokerage_1 > 0)) {
wx.showToast({
title: '请输入一级佣金',
icon: 'none'
})
} else if (!(that.data.brokerage_2 > 0)){
wx.showToast({
title: '请输入二级佣金',
icon: 'none'
})
}else{
that.setData({
submitFlag: true,
})
let params = {};
params['brokerage_1'] = that.data.brokerage_1;
params['brokerage_2'] = that.data.brokerage_2;
_.apiQuery.postAppBrokerage(params).then(res => {
that.getAppBrokerage()
that.setData({
isShowCommission:false,
submitFlag:false,
})
wx.showToast({
title: '设置成功',
icon: 'success'
})
}).catch(res=>{
that.setData({
isShowCommission:false,
submitFlag: false,
})
});
}
},
onReachBottom: function () {
//更新佣金设置
putAppBrokerage() {
let that = this
if(that.data.brokerage.brokerage_1==that.data.brokerage_1&&that.data.brokerage.brokerage_2==that.data.brokerage_2){
that.setData({
isShowCommission:false,
})
}else{
if (!(that.data.brokerage_1 > 0)) {
wx.showToast({
title: '请输入一级佣金',
icon: 'none'
})
} else if (!(that.data.brokerage_2 > 0)){
wx.showToast({
title: '请输入二级佣金',
icon: 'none'
})
}else{
that.setData({
submitFlag: true,
})
let params = {};
params['id'] = that.data.id;
params['brokerage_1'] = that.data.brokerage_1;
params['brokerage_2'] = that.data.brokerage_2;
_.apiQuery.putAppBrokerage(params).then(res => {
that.getAppBrokerage()
that.setData({
isShowCommission:false,
submitFlag:false,
})
wx.showToast({
title: '设置成功',
icon: 'success'
})
}).catch(res=>{
that.setData({
isShowCommission:false,
submitFlag: false,
})
});
}
}
},
//推送链接
pushLink(e){
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh(){
this.setData({
list: [],
pageNo: 1,
noData: false,
end: false,
load: true,
loading: false,
flag: this.data.flag + 1
})
this.getAppBrokerageOrders()
},
//页面上拉触底事件的处理函数
onReachBottom(){
this.getAppBrokerage()
if (this.data.noData || this.data.end||!this.data.load) return;
this.setData({
flag: this.data.flag + 1
})
this.getAppBrokerageOrders()
},
})
+11 -11
View File
@@ -15,19 +15,19 @@
<block wx:for='{{list}}' wx:key='index'>
<view class="relative ulib-r10 box-shadow-000-10-10 mb30 overflowhidden">
<view class="inner40 bbs-1-eb">
<view class="inner40">
<view class="font-32">
<text>林先生</text>
<text class="font-26 color-666">(*382)</text>
<text>{{item.name}}</text>
<text class="font-26 color-666">{{item.mobile}}</text>
</view>
<view class="mt10 font-22 color-999">订单日期:2021-06-23</view>
<view class="mt10 font-22 color-999">报备时间:{{item.b_time}}</view>
</view>
<view class="inner40 ">
<view class="inner40 bts-1-eb" wx:if="{{item.info}}">
<view class="font-32">车辆信息</view>
<block wx:for="{{item.other_data}}" wx:for-index='key' wx:for-item='it' wx:key='i'>
<block wx:for="{{item.info}}" wx:for-index='key' wx:for-item='it' wx:key='i'>
<view class="mt25 fn-clear font-28 color-666">
<view class="fn-fl">{{it.title}}</view>
<view class="fn-fr wp60 text-nowrap text-right">{{it.value}}</view>
<view class="fn-fl">{{key}}</view>
<view class="fn-fr wp60 text-nowrap text-right">{{it}}</view>
</view>
</block>
</view>
@@ -44,18 +44,18 @@
<view class="text-center font-36">配置佣金</view>
<view class="mt30 relative bg-f6 pl200 pr90 font-32 ulib-r10">
<view class="absolute left-0 box-middle ml40">一级</view>
<input class="wp100 bg-f6 text-right font-32 text-center" placeholder-class="color-ccc" type="text" model:value="{{keyword}}" placeholder="请输入金额" style="height:90rpx" />
<input class="wp100 bg-f6 text-right font-32 text-center" placeholder-class="color-ccc" type="number" model:value="{{brokerage_1}}" placeholder="请输入金额" style="height:90rpx" />
<view class="absolute right-0 box-middle mr40">元</view>
</view>
<view class="mt30 relative bg-f6 pl200 pr90 font-32 ulib-r10">
<view class="absolute left-0 box-middle ml40">二级</view>
<input class="wp100 bg-f6 text-right font-32 text-center" placeholder-class="color-ccc" type="text" model:value="{{keyword}}" placeholder="请输入金额" style="height:90rpx" />
<input class="wp100 bg-f6 text-right font-32 text-center" placeholder-class="color-ccc" type="number" model:value="{{brokerage_2}}" placeholder="请输入金额" style="height:90rpx" />
<view class="absolute right-0 box-middle mr40">元</view>
</view>
</view>
<view class="fn-flex pl60 pr60 pb20 text-center font-32 color-666">
<button bindtap="optShowCommission" class="fn-flex-item mr20 bds-2-36afa2 btn-no-bg wp100 font-28 color-36afa2 ulib-r750">取消</button>
<button disabled="{{submitFlag}}" bindtap="postAppSmsCusorder" class="fn-flex-item ml20 btn-36afa2 wp100 font-28 color-fff ulib-r750" hover-class="btn-36afa2-hover">确定</button>
<button disabled="{{submitFlag}}" bindtap="{{id?'putAppBrokerage':'postAppBrokerage'}}" class="fn-flex-item ml20 btn-36afa2 wp100 font-28 color-fff ulib-r750" hover-class="btn-36afa2-hover">确定</button>
</view>
<view class="pb50 text-center font-22 color-999"><i class="iconfont mr5 icon-tishi"></i>请认真编辑相关佣金,会按照佣金配置分佣!</view>
</view>