diff --git a/app.json b/app.json index 4b57ac9..baf6f9b 100644 --- a/app.json +++ b/app.json @@ -1,8 +1,8 @@ { "pages": [ + "pages/login/index", "pages/index/index", "pages/customer/index", - "pages/login/index", "pages/order/index", "pages/web-view/index", "pages/mine/index", @@ -11,7 +11,9 @@ "pages/order/register/index", "pages/order/detail/index", "pages/mine/install/index", - "pages/mine/install/staff/index" + "pages/mine/install/staff/index", + "pages/customer/filterList/index", + "pages/order/filterList/index" ], "echarts": [ { diff --git a/commons/css/custom/coupon.wxss b/commons/css/custom/coupon.wxss index 5fafa74..dbf937d 100644 --- a/commons/css/custom/coupon.wxss +++ b/commons/css/custom/coupon.wxss @@ -35,13 +35,13 @@ border:#e6e6e6 2rpx solid; } -.xhb-coupon{ +.lcb-coupon{ overflow: hidden; background-image: url('https://qs.haodian.cn/wechat_app/xiaohongbangV2/coupon/coupon-bg.png'); background-size: 100% auto; background-repeat: repeat-y; } -.xhb-coupon::before,.xhb-coupon::after{ +.lcb-coupon::before,.lcb-coupon::after{ content: ''; position: absolute; z-index: 1; @@ -53,26 +53,26 @@ background-color: #fff; border-radius: 100%; } -.xhb-coupon::before{ +.lcb-coupon::before{ top: -9rpx; } -.xhb-coupon::after{ +.lcb-coupon::after{ bottom: -9rpx; } -.xhb-coupon-info{ +.lcb-coupon-info{ width: 467rpx; height: 168rpx; border-top: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; border-right: 1px dashed #e8e8e8; } -.xhb-coupon-opt{ +.lcb-coupon-opt{ width: 223rpx; height: 168rpx; border-top: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; } -.xhb-coupon-opt .btn{ +.lcb-coupon-opt .btn{ width: 162rpx; height: 60rpx; line-height: 60rpx; diff --git a/commons/js/config.js b/commons/js/config.js index 3d8b64f..c3f0dbb 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -44,7 +44,7 @@ api = { appIdcard: "app/idcard", //创建申请开票信息 - + appUserCal: "app/user/cal", //获取用户统计 } diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index 30efbbc..ad9f68d 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -278,4 +278,11 @@ apiQuery.putAppIdcard = function (params) { }) } +//获取用户统计 +apiQuery.getAppUserCal = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(true, Config.api.appUserCal, 2, params, "GET", resolve, reject) + }) +} + export default apiQuery; \ No newline at end of file diff --git a/commons/js/utils/router.js b/commons/js/utils/router.js index 117b2da..7f173c4 100644 --- a/commons/js/utils/router.js +++ b/commons/js/utils/router.js @@ -238,9 +238,9 @@ export default class Router { openUrlScheme(url = null, title = '', openMode = 'navigateTo') { if (url.indexOf('http') > -1) { this.webviewRedirect(url, title, openMode) - }else if(url.indexOf('xhb://navigateToMiniProgram')>-1){ + }else if(url.indexOf('lcb://navigateToMiniProgram')>-1){ this.navigateToMiniProgramRedirect(url) - } else if (url.indexOf('xhb://switchTab')>-1) { + } else if (url.indexOf('lcb://switchTab')>-1) { this.switchTab(url.split('switchTab')[1]) // } else if(url.indexOf('ixm://reLaunch')>-1) { // this.reLaunch(url.split('reLaunch')[1]) diff --git a/components/footer/footer.wxml b/components/footer/footer.wxml index bb90f07..7771b5c 100644 --- a/components/footer/footer.wxml +++ b/components/footer/footer.wxml @@ -1,8 +1,8 @@ Powered by - - 好店云 + + 狸车 \ No newline at end of file diff --git a/components/footer/footer.wxss b/components/footer/footer.wxss index cef8ab7..e3d12c0 100644 --- a/components/footer/footer.wxss +++ b/components/footer/footer.wxss @@ -1,5 +1,5 @@ .footer {padding:30rpx 0;text-align:center; grid-row-start:2;grid-row-end:3;} -.img-30-21{width:30rpx;height:21rpx;vertical-align:middle} +.img-30x30{width:30rpx;height:30rpx;vertical-align:middle} .support-tx{margin:0 8rpx;font-size:20rpx;color:#bbb;vertical-align:middle} .inline-block{display:inline-block} .foot-del{font-size:18rpx;color:#bbb;} \ No newline at end of file diff --git a/components/listMore/index.wxss b/components/listMore/index.wxss index 2126229..3c2eb84 100644 --- a/components/listMore/index.wxss +++ b/components/listMore/index.wxss @@ -3,7 +3,7 @@ .noData { width: 220rpx; height: 142rpx; - background: url(https://qs.haodian.cn/wechat_app/haodianyun/none.png?v=200413) no-repeat; + background: url(https://qs.haodian.cn/wechat_app/liche/common/none.png?v=191231) no-repeat; background-size:100% auto; background-position: top center; } \ No newline at end of file diff --git a/components/navBar/navBar.json b/components/navBar/navBar.json index 3b851b2..93ec454 100644 --- a/components/navBar/navBar.json +++ b/components/navBar/navBar.json @@ -1,6 +1,6 @@ { "component": true, "usingComponents": { - "xhb-searchBar": "/components/searchBar/index" + "lcb-searchBar": "/components/searchBar/index" } } \ No newline at end of file diff --git a/components/navBar/navBar.wxml b/components/navBar/navBar.wxml index 422c00c..625ede5 100644 --- a/components/navBar/navBar.wxml +++ b/components/navBar/navBar.wxml @@ -5,23 +5,23 @@ {{city}} - + {{titleText}} - + - + {{titleText}} diff --git a/pages/customer/addCard/index.js b/pages/customer/addCard/index.js index da26351..4b319d3 100644 --- a/pages/customer/addCard/index.js +++ b/pages/customer/addCard/index.js @@ -191,6 +191,17 @@ Page({ params['buy_time'] = this.data.buy_time; } _.apiQuery.postAppCustomers(params).then(res => { + + //刷新列表页 + let pages = getCurrentPages(); + let prevPage = null; //上一个页面 + if (pages.length >= 2) { + prevPage = pages[pages.length - 2]; //上一个页面 + if(prevPage.route == 'pages/customer/index'){ + prevPage.onPullDownRefresh() + } + } + wx.showModal({ title: '创建成功', content: '', @@ -220,13 +231,6 @@ Page({ }) } - let pages = getCurrentPages(); - let prevPage = null; //上一个页面 - if (pages.length >= 2) { - prevPage = pages[pages.length - 2]; //上一个页面 - prevPage.onPullDownRefresh() - } - } }) }).catch(res=>{ diff --git a/pages/customer/filterList/index.js b/pages/customer/filterList/index.js new file mode 100644 index 0000000..bb835a2 --- /dev/null +++ b/pages/customer/filterList/index.js @@ -0,0 +1,214 @@ +import _ from '../../../commons/js/commons' +import popularData from '../../../commons/js/lib/popularData'; +const app = getApp() +Page({ + data: { + key:'',//tab状态值 + list: [],//客户列表 + pageNo: 1, + noData: false, + end: false, + load: true, + loading: false, + content:'',//短信内容 + istop:'',//置顶 + iscall:'',//联系 + s_time:'',//开始时间 + e_time:'',//结束时间 + if_driver:'',//是否试驾 + level:'',//客户顶级 + s_id:'',//车型id + v_id:'',//车型级别id + cfrom:'',//客户来源 + o_type:'',//排序类型 + }, + onLoad(options) { + for (let key in options) { + this.setData({ + [key]: options[key] + }) + } + this.getAppCustomersList() + + wx.setNavigationBarTitle({ + title: this.data.title||'客户' + }) + }, + + onShow(){ + + }, + + //获取客户列表 + getAppCustomersList() { + this.setData({ + load: false, + loading: true, + }) + let params = {}; + params['page'] = this.data.pageNo; + params['size'] = 10; + if(this.data.istop != ''){ + params['istop'] = this.data.istop; + } + if(this.data.iscall != ''){ + params['iscall'] = this.data.iscall; + } + if(this.data.key != ''){ + params['status'] = this.data.key; + } + if(this.data.s_time != ''){ + params['s_time'] = this.data.s_time; + } + if(this.data.e_time != ''){ + params['e_time'] = this.data.e_time; + } + if(this.data.if_driver != ''){ + params['if_driver'] = this.data.if_driver; + } + if(this.data.level != ''){ + params['level'] = this.data.level; + } + if(this.data.s_id != ''){ + params['s_id'] = this.data.s_id; + } + if(this.data.v_id != ''){ + params['v_id'] = this.data.v_id; + } + if(this.data.cfrom != ''){ + params['cfrom'] = this.data.cfrom; + } + if(this.data.o_type != ''){ + params['o_type'] = this.data.o_type; + } + _.apiQuery.getAppCustomersList(params).then(res => { + this.setData({ + total: res.data.total, + 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() + }); + }, + + //置顶操作 + optTop(e){ + let params = {}; + params['id'] = this.data.list[e.currentTarget.dataset.index].id; + params['is_top'] = this.data.list[e.currentTarget.dataset.index].is_top==1?0:1; + _.apiQuery.putAppCustomers(params).then(res=>{ + this.setData({ + ['list['+e.currentTarget.dataset.index+'].is_top']:this.data.list[e.currentTarget.dataset.index].is_top==1?0:1, + }) + }) + }, + + //拨打客户电话Yx + call(e) { + let params = {}; + params['id'] = e.currentTarget.dataset.id; + _.apiQuery.getAppYx(params).then(res=>{ + if(!!res.data.service_msg){ + this.setData({ + isShowNote:true, + notemsg:res.data.service_msg, + }) + }else{ + wx.makePhoneCall({ + phoneNumber: res.data.mobile, + }) + } + }) + }, + + //显示短信弹框 + showMessage(e){ + this.setData({ + messageId:e.currentTarget.dataset.id, + isShowMessage:true, + content:'', + }) + }, + + //关闭短信弹框 + hideMessage(e){ + this.setData({ + isShowMessage:false, + }) + }, + + //输入 + inputTx(e) { + this.setData({ + submitFlag: false, + [e.currentTarget.dataset.key]: e.detail.value + }) + }, + + //发短信 + postAppSmsCustomer(){ + 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.messageId; + params['content'] = this.data.content; + _.apiQuery.postAppSmsCustomer(params).then(res=>{ + this.setData({ + isShowMessage:false, + submitFlag:false, + content:'', + }) + wx.showToast({ + title: res.msg, + icon: 'none' + }) + }) + } + }, + + //推送链接 + 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, + }) + this.getAppCustomersList() + }, + + //页面上拉触底事件的处理函数 + onReachBottom(){ + if (this.data.noData || this.data.end||!this.data.load) return; + this.getAppCustomersList() + }, + +}) \ No newline at end of file diff --git a/pages/customer/filterList/index.json b/pages/customer/filterList/index.json new file mode 100644 index 0000000..7c5f319 --- /dev/null +++ b/pages/customer/filterList/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "客户", + "enablePullDownRefresh": true, + "usingComponents": { + + } +} \ No newline at end of file diff --git a/pages/customer/filterList/index.wxml b/pages/customer/filterList/index.wxml new file mode 100644 index 0000000..0e33a19 --- /dev/null +++ b/pages/customer/filterList/index.wxml @@ -0,0 +1,56 @@ + + + + + + + + + {{item.name}} + ({{item.mobile}}) + + + + + {{tag}} + + + ... + + + + + + + + + + + + + + + {{key}} + {{value}} + + + + + + + + + + + + + + +