diff --git a/commons/js/config.js b/commons/js/config.js index bc9ae3e..ab04cee 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -32,6 +32,9 @@ api = { appSmsCustomer: "app/sms/customer", //发短信 appCustomerlogs: "app/customerlogs", //获取日志 appCustomerData: "app/customers/data", //获取客户详细信息 + + appCusorder: "app/cusorder", //新建订单 /获取订单列表 /获取订单详情 /修改付款方式 + appCusorderTabs: "app/cusorder/tabs", //获取tab } diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index aadeb8e..57093c0 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -117,13 +117,20 @@ apiQuery.getAppCustomersTabs = function (params) { }) } -//获取客户列表 /获取客户详情 -apiQuery.getAppCustomers = function (params) { +//获取客户列表 +apiQuery.getAppCustomersList = function (params) { return new Promise(function (resolve, reject) { HttpRequest(false, Config.api.appCustomers, 2, params, "GET", resolve, reject) }) } +//获取客户详情 +apiQuery.getAppCustomersDetails = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(true, Config.api.appCustomers, 2, params, "GET", resolve, reject) + }) +} + //获取列表筛选条件 apiQuery.getAppCustomersFilter = function (params) { return new Promise(function (resolve, reject) { @@ -166,4 +173,41 @@ apiQuery.getAppCustomerData = function (params) { }) } +//获取订单列表 +apiQuery.getAppCusorderList = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appCusorder, 2, params, "GET", resolve, reject) + }) +} + +//获取订单详情 +apiQuery.getAppCusorderDetails = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(true, Config.api.appCusorder, 2, params, "GET", resolve, reject) + }) +} + +//新建订单 +apiQuery.postAppCusorder = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(true, Config.api.appCusorder, 2, params, "POST", resolve, reject) + }) +} + +//修改付款方式 +apiQuery.putAppCusorder = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(true, Config.api.appCusorder, 2, params, "PUT", resolve, reject) + }) +} + +//获取tab +apiQuery.getAppCusorderTabs = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appCusorderTabs, 2, params, "GET", resolve, reject) + }) +} + + + export default apiQuery; \ No newline at end of file diff --git a/pages/customer/addCard/index.js b/pages/customer/addCard/index.js index 6efdcd9..da26351 100644 --- a/pages/customer/addCard/index.js +++ b/pages/customer/addCard/index.js @@ -19,7 +19,11 @@ Page({ }, //生命周期函数--监听页面加载 onLoad: function (options) { - + for (let key in options) { + this.setData({ + [key]: options[key] + }) + } this.getAppSeriesCars() }, diff --git a/pages/customer/detail/index.js b/pages/customer/detail/index.js index ba9e009..663dfb5 100644 --- a/pages/customer/detail/index.js +++ b/pages/customer/detail/index.js @@ -29,7 +29,7 @@ Page({ }) } - this.getAppCustomers() + this.getAppCustomersDetails() this.getAppCustomerData() this.getAppCustomerlogs() this.getAppCustomersTabs() @@ -40,10 +40,10 @@ Page({ }, //获取客户详情 - getAppCustomers(){ + getAppCustomersDetails(){ let params = {}; params['id'] = this.data.id; - _.apiQuery.getAppCustomers(params).then(res=>{ + _.apiQuery.getAppCustomersDetails(params).then(res=>{ this.setData({ detailinfo:res.data, //statuskey:res.data.status, @@ -248,7 +248,7 @@ Page({ load: true, loading: false, }) - this.getAppCustomers() + this.getAppCustomersDetails() this.getAppCustomerData() this.getAppCustomerlogs() }, diff --git a/pages/customer/index.js b/pages/customer/index.js index 5969fab..d216582 100644 --- a/pages/customer/index.js +++ b/pages/customer/index.js @@ -79,7 +79,7 @@ Page({ key:this.data.key==''?res.data[0].key:this.data.key, }) - this.getAppCustomers() + this.getAppCustomersList() wx.stopPullDownRefresh() }); @@ -119,7 +119,7 @@ Page({ }, //获取客户列表 - getAppCustomers() { + getAppCustomersList() { this.setData({ load: false, loading: true, @@ -152,7 +152,7 @@ Page({ if(this.data.o_type != ''){ params['o_type'] = this.data.o_type; } - _.apiQuery.getAppCustomers(params).then(res => { + _.apiQuery.getAppCustomersList(params).then(res => { this.setData({ flag: this.data.flag - 1 }) @@ -243,7 +243,7 @@ Page({ loading: false, flag: this.data.flag + 1 }) - this.getAppCustomers() + this.getAppCustomersList() }, //排序方式 @@ -495,7 +495,7 @@ Page({ loading: false, flag: this.data.flag + 1 }) - this.getAppCustomers() + this.getAppCustomersList() }, //页面上拉触底事件的处理函数 @@ -504,7 +504,7 @@ Page({ this.setData({ flag: this.data.flag + 1 }) - this.getAppCustomers() + this.getAppCustomersList() }, }) \ No newline at end of file diff --git a/pages/order/index.js b/pages/order/index.js index 193b6b4..1fd0cf4 100644 --- a/pages/order/index.js +++ b/pages/order/index.js @@ -25,18 +25,18 @@ Page({ [key]: options[key] }) } - this.getAppCustomersTabs() + this.getAppCusorderTabs() }, //客户-tab - getAppCustomersTabs() { - _.apiQuery.getAppCustomersTabs().then(res => { + getAppCusorderTabs() { + _.apiQuery.getAppCusorderTabs().then(res => { this.setData({ tab:res.data, key:this.data.key==''?res.data[0].key:this.data.key, }) - this.getAppCustomers() + this.getAppCusorderList() wx.stopPullDownRefresh() }); @@ -51,7 +51,7 @@ Page({ }, //获取客户列表 - getAppCustomers() { + getAppCusorderList() { this.setData({ load: false, loading: true, @@ -63,7 +63,7 @@ Page({ if(this.data.searchInp.value != ''){ params['keyword'] = this.data.searchInp.value; } - _.apiQuery.getAppCustomers(params).then(res => { + _.apiQuery.getAppCusorderList(params).then(res => { this.setData({ flag: this.data.flag - 1 }) @@ -135,7 +135,7 @@ Page({ loading: false, flag: this.data.flag + 1 }) - this.getAppCustomers() + this.getAppCusorderList() }, //显示短信弹框 @@ -209,7 +209,7 @@ Page({ loading: false, flag: this.data.flag + 1 }) - this.getAppCustomers() + this.getAppCusorderList() }, //页面上拉触底事件的处理函数 @@ -218,7 +218,7 @@ Page({ this.setData({ flag: this.data.flag + 1 }) - this.getAppCustomers() + this.getAppCusorderList() }, }) \ No newline at end of file diff --git a/pages/order/index.wxml b/pages/order/index.wxml index dc8f632..d367fde 100644 --- a/pages/order/index.wxml +++ b/pages/order/index.wxml @@ -11,11 +11,13 @@ + {{item.name}} + @@ -38,12 +40,7 @@ ({{item.mobile}}) - - {{tag}} - - - ... - + {{item.status_name}} @@ -73,115 +70,11 @@ -