From 7434edda769483a1aa203d1d3050dc701e810f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=8F=B6?= Date: Mon, 20 Jun 2022 16:39:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=E5=B0=8F=E8=AE=B0?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/js/config.js | 4 +- commons/js/utils/apiQuery.js | 8 ++++ pages/customer/detail/index.js | 80 ++++++++++++++++++++++++++++++++ pages/customer/detail/index.wxml | 27 +++++------ pages/index/index.js | 3 +- 5 files changed, 103 insertions(+), 19 deletions(-) diff --git a/commons/js/config.js b/commons/js/config.js index dd26cfa..0efab01 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -1,4 +1,4 @@ -const env = "d"; +const env = "p"; const version = 1, @@ -141,6 +141,8 @@ api = { appIdcardInfo:'app/idcard/info', //识别身份证号码 + appCustomersComments:'app/customers/comments', //用户评论 + diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index 27f780b..544c359 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -854,4 +854,12 @@ apiQuery.getAppIdcardInfo = function (params) { } +//用户评论 +apiQuery.postAppCustomersComments = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(true, Config.api.appCustomersComments, 2, params, "POST", resolve, reject) + }) +} + + export default apiQuery; \ No newline at end of file diff --git a/pages/customer/detail/index.js b/pages/customer/detail/index.js index 00f13b9..211507f 100644 --- a/pages/customer/detail/index.js +++ b/pages/customer/detail/index.js @@ -45,6 +45,9 @@ Page({ weekList:['日','一','二','三','四','五','六'], dateList:[], nextIndex:-1,//计划回访时间 + + comment:'',//评论内容 + isShowComment:false,//是否显示用户评论弹窗 }, onLoad(options) { for (let key in options) { @@ -252,6 +255,41 @@ Page({ }); }, + //更新获取日志 + getAppCustomerlogsRefresh(){ + this.setData({ + load: false, + loading: true, + }) + let params = {}; + params['page'] = 1; + params['size'] = (this.data.pageNo-1)*10; + params['id'] = this.data.id; + _.apiQuery.getAppCustomerlogs(params).then(res => { + + let list = res.data.list + list.forEach(item => { + if(item.record_url){ + item.alltime=this.format(item.second) + } + }) + this.setData({ + logslist:list, + load: true, + loading: false, + }) + if (res.data.total == 0) { + this.setData({ + noData: true + }) + } else if (this.data.logslist.length == res.data.total) { + this.setData({ + end: true + }) + } + }); + }, + //切换tab changeTab(e){ this.setData({ @@ -813,6 +851,48 @@ Page({ } }, + //显示隐藏用户评论 + optShowComment(e){ + this.setData({ + commentId:e.currentTarget.dataset.id?e.currentTarget.dataset.id:'', + isShowComment:!this.data.isShowComment, + comment:'', + }) + }, + + //用户评论 + postAppCustomersComments(){ + if (this.data.submitFlag) return; + if (this.data.comment == '') { + wx.showToast({ + title: '请填写评论内容', + icon: 'none' + }) + } else { + this.setData({ + submitFlag: true, + }) + let params = {}; + params['id'] = this.data.commentId; + params['content'] = this.data.comment; + _.apiQuery.postAppCustomersComments(params).then(res=>{ + this.setData({ + submitFlag:false, + isShowComment:false, + comment:'', + }) + wx.showToast({ + title: res.msg, + icon: 'none' + }) + + this.getAppCustomerlogsRefresh()() + + }) + } + }, + + //页面相关事件处理函数--监听用户下拉动作 onPullDownRefresh(){ this.setData({ diff --git a/pages/customer/detail/index.wxml b/pages/customer/detail/index.wxml index 6db7333..5f4f1fb 100644 --- a/pages/customer/detail/index.wxml +++ b/pages/customer/detail/index.wxml @@ -68,8 +68,8 @@ {{item.c_time}} - · - 试驾/下定 + {{item.content}} @@ -100,19 +100,14 @@ - - + + - 店长: - 提醒客户签字并定金 - - - - 店长: - 提醒客户签字并定金 + {{comment.uname}}: + {{comment.content}} - + 评论 @@ -328,17 +323,17 @@ - + 小记评论 -