diff --git a/commons/js/config.js b/commons/js/config.js
index 1839059..f516643 100644
--- a/commons/js/config.js
+++ b/commons/js/config.js
@@ -50,6 +50,7 @@ api = {
appYx: "app/yx", //获取云信虚拟电话
appCustomerlogs: "app/customerlogs", //新增日志
appCustomerData: "app/customers/data", //修改客户基本信息
+ appCustomerUnlockReason: "app/customers/lockReason", //获取不解锁原因
appServicesPackage: "app/services/package", //获取代办包
appSeriesInfo: "app/series/info", //获取车辆价格
appBusiness: "app/business", //获取商务政策
diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js
index 3dba78e..ed94240 100644
--- a/commons/js/utils/apiQuery.js
+++ b/commons/js/utils/apiQuery.js
@@ -1130,4 +1130,9 @@ apiQuery.putAppCustomerLock = function (params) {
HttpRequest(true, Config.api.appCustomerLock, 2, params, "PUT", resolve, reject)
})
}
+apiQuery.getAppCustomerUnlockReason = function (params) {
+ return new Promise(function (resolve, reject) {
+ HttpRequest(false, Config.api.appCustomerUnlockReason, 2, params, "GET", resolve, reject)
+ })
+}
export default apiQuery;
\ No newline at end of file
diff --git a/pages/customer/index.js b/pages/customer/index.js
index e859849..6a40cd2 100644
--- a/pages/customer/index.js
+++ b/pages/customer/index.js
@@ -106,7 +106,10 @@ Page({
isShowLock: false,
cluesTabKey: 1000, //线索tabkey
cluesId: 0, //当前操作线索id
- needShowUnlockConfig: true
+ needShowUnlockConfig: true,
+ isShowNotLock: false, //是否显示不解锁弹窗
+ reasonList: [], //不解锁理由
+ reasonIndex: -1
},
onLoad(options) {
for (let key in options) {
@@ -139,7 +142,8 @@ Page({
this.setData({
needShowUnlockConfig: app.getStorageByKey("needShowUnlockConfig") ? false : true,
})
- console.log("是否显示解锁弹窗:",this.data.needShowUnlockConfig);
+ this.getReasonList()
+ // console.log("是否显示解锁弹窗:",this.data.needShowUnlockConfig);
},
onShow() {
@@ -1147,7 +1151,7 @@ Page({
this.setData({
cluesId: e.currentTarget.dataset.id
})
- this.bindLock();
+ this.bindLock(e);
}
},
hideLock() {
@@ -1155,11 +1159,26 @@ Page({
isShowLock: false
})
},
- //解绑
- bindLock(){
- let that = this;
+ //解锁
+ bindLock(e){
+ let that = this
+ let unlock = 0 //是否不解锁 0否1是
+ let reason = ""
+ if(e.currentTarget.dataset.unlock){
+ unlock = 1
+ if(this.data.reasonIndex==-1){
+ wx.showToast({
+ title: '请选择理由',
+ icon: 'none'
+ })
+ return false
+ }
+ reason = this.data.reasonList[this.data.reasonIndex]
+ }
let params = {
- 'id' : this.data.cluesId
+ 'id' : this.data.cluesId,
+ 'unlock': unlock,
+ 'reason' : reason
};
_.apiQuery.putAppCustomerLock(params).then(res => {
wx.showToast({
@@ -1167,8 +1186,12 @@ Page({
icon: 'success',
duration: 2000
})
- app.setStorage("needShowUnlockConfig", 1);
- that.hideLock();
+ if(unlock){ //不解锁
+ that.hideNotlock()
+ }else{ //解锁
+ app.setStorage("needShowUnlockConfig", 1);
+ that.hideLock();
+ }
that.onPullDownRefresh();
})
},
@@ -1179,5 +1202,32 @@ Page({
if(row.un_lock){
_.$router.openUrlScheme(url);
}
+ },
+ //不解锁弹窗
+ showNotlock(e){
+ this.setData({
+ isShowNotLock: true,
+ cluesId: e.currentTarget.dataset.id
+ })
+ },
+ hideNotlock(){
+ this.setData({
+ isShowNotLock: false
+ })
+ },
+ //获取不解锁原因
+ getReasonList() {
+ _.apiQuery.getAppCustomerUnlockReason().then(res => {
+ this.setData({
+ reasonList: res.data
+ })
+ });
+ },
+ changeReason(e){
+ if(this.data.reasonIndex != e.detail.value && e.detail.value >= 0){
+ this.setData({
+ reasonIndex:e.detail.value
+ })
+ }
}
})
\ No newline at end of file
diff --git a/pages/customer/index.wxml b/pages/customer/index.wxml
index eb61133..1fadd89 100644
--- a/pages/customer/index.wxml
+++ b/pages/customer/index.wxml
@@ -92,9 +92,11 @@
{{item.name}}
({{item.mobile}})
+
@@ -105,10 +107,19 @@
意向车型
{{item.other_data['关注车型']}}
+
+ -->
+
+
+
+
+
+
+
+
@@ -559,5 +570,29 @@
+
+
+
+
+ 确认不解锁线索
+
+
+ 选择理由
+
+ 请选择
+ {{reasonList[reasonIndex]}}
+
+
+
+
+
+
+
+
+
\ No newline at end of file