diff --git a/commons/js/config.js b/commons/js/config.js index f123caf..3d8b64f 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -30,8 +30,8 @@ api = { appCustomersTabs: "app/customers/tabs", //获取tab appCustomers: "app/customers", //获取客户列表 /新建客户 /修改状态和到店次数、试驾次数 /获取客户详情 appCustomersFilter: "app/customers/filter", //获取列表筛选条件 - appSmsCustomer: "app/sms/customer", //发短信 - appSmsCusorder: "app/sms/cusorder", //发短信 + appSmsCustomer: "app/sms/customer", //客户发短信 + appSmsCusorder: "app/sms/cusorder", //订单发短信 appCustomerlogs: "app/customerlogs", //获取日志 appCustomerData: "app/customers/data", //获取客户详细信息 diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index 035c781..30efbbc 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -152,13 +152,20 @@ apiQuery.putAppCustomers = function (params) { }) } -//发短信 +//客户发短信 apiQuery.postAppSmsCustomer = function (params) { return new Promise(function (resolve, reject) { HttpRequest(true, Config.api.appSmsCustomer, 2, params, "POST", resolve, reject) }) } +//订单发短信 +apiQuery.postAppSmsCusorder = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(true, Config.api.appSmsCusorder, 2, params, "POST", resolve, reject) + }) +} + //获取日志 apiQuery.getAppCustomerlogs = function (params) { return new Promise(function (resolve, reject) { diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index 5960d63..7d02c02 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -105,6 +105,21 @@ Page({ }) }, + //显示短信弹框 + showMessage(e){ + this.setData({ + isShowMessage:true, + content:'', + }) + }, + + //关闭短信弹框 + hideMessage(e){ + this.setData({ + isShowMessage:false, + }) + }, + // 输入 inputTx(e) { this.setData({ @@ -112,6 +127,36 @@ Page({ }) }, + //发短信 + postAppSmsCusorder(){ + if (this.data.submitFlag) return; + if (this.data.content == '') { + wx.showToast({ + title: '请填写短信内容', + icon: 'none' + }) + } else { + this.setData({ + submitFlag: true, + }) + let params = {}; + params['id'] = this.data.id; + params['content'] = this.data.content; + _.apiQuery.postAppSmsCusorder(params).then(res=>{ + this.setData({ + isShowMessage:false, + submitFlag:false, + content:'', + }) + wx.showToast({ + title: res.msg, + icon: 'none' + }) + + }) + } + }, + //单选 radioPicker(e){ if(e.currentTarget.dataset.id != this.data.payway){ diff --git a/pages/order/detail/index.wxml b/pages/order/detail/index.wxml index 8553c23..6e05737 100644 --- a/pages/order/detail/index.wxml +++ b/pages/order/detail/index.wxml @@ -9,11 +9,11 @@ {{info.name}} 手机号:{{info.mobile}} - - + + - + @@ -169,8 +169,20 @@ 邀请客户扫码签名 - - + + + + + + + + + +