From 65bf2c2ef474432eda7cc2a444e897060958968a Mon Sep 17 00:00:00 2001 From: YXQ Date: Wed, 5 Jul 2023 17:09:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=8D=E9=A6=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=8F=8F=E8=BF=B0=E5=88=A4=E6=96=AD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/feedback/feedback.js | 79 +++++++++++++++++++++++------- pages/feedback/feedback.wxml | 6 ++- pages/index/index.js | 1 + pages/index/index.wxml | 6 +-- pages/meLogistics/meLogistics.js | 26 +++++++--- pages/meLogistics/meLogistics.wxml | 5 +- 6 files changed, 91 insertions(+), 32 deletions(-) diff --git a/pages/feedback/feedback.js b/pages/feedback/feedback.js index a53c5eb..9dfe421 100644 --- a/pages/feedback/feedback.js +++ b/pages/feedback/feedback.js @@ -30,7 +30,7 @@ Page({ } ], index: 0, //问题下标 - problemStr:'', + problemStr: '', //图片数组 addImgBtn: { isBtn: true, @@ -47,36 +47,81 @@ Page({ }) }, + //记录问题 + problemUr(e) { + console.log(e.detail.value); + this.setData({ + problemStr: e.detail.value + }) + }, + //提交数据 goMyorder() { + //判断是否选择问题类型 + if (this.data.index === 0) { wx.showToast({ title: '请选择问题类型', + icon: 'error' }); return; } - var problem = this.data.problemArray[this.data.index]; //问题类型 - var data = { - 'type': this.data.index, - 'describe': this.data.problemStr, - 'imgs':this.data.upImageArr.toString - } - console.log(JSON.stringify(data)) - request.post(`/feedBack/push`, data).then(res => { + + if (this.data.upImageArr.length === 0) { wx.showToast({ - title: 'title', + title: '至少上传一张图片', + icon: 'error' }) - console.log(JSON.stringify(res.data)) - }); - // wx.switchTab({ - // url: '../about/about', - // }) + return; + } - //判断是否选择问题类型 //当没有描述时,弹框提示,但不是强制性。 - //判断是否有上传截图 + if (this.data.problemStr.length === 0) { + wx.showModal({ + title: '提示', + content: '如果有问题描述,可以帮助技术人员更快的解决问题,点击取消添加描述', + complete: (res) => { + if (res.confirm) { + this.submitProblem(); + } + } + }) + } else { + this.submitProblem(); + } + }, + + //提交反馈 + submitProblem() { //提示成功后,点击确定,返回上一页。 + var data = { + 'type': this.data.index, + 'describe': this.data.problemStr, + 'imgs': this.data.upImageArr.join(',') + } + + request.post(`/feedBack/push`, data).then(res => { + if (res.data.code < 400) { + wx.showModal({ + title: '提示', + content: '问题已经提交', + showCancel: false, + complete: (res) => { + if (res.confirm) { + wx.switchTab({ + url: '../about/about', + }) + } + } + }) + + } else { + wx.showToast({ + title: res.data.message, + }) + } + }); }, //添加图片 diff --git a/pages/feedback/feedback.wxml b/pages/feedback/feedback.wxml index ddda8f1..bddf103 100644 --- a/pages/feedback/feedback.wxml +++ b/pages/feedback/feedback.wxml @@ -1,6 +1,5 @@ - @@ -9,7 +8,7 @@ {{array[index]}} - + @@ -23,8 +22,11 @@ + + + \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 70c5b10..fb86a89 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -58,6 +58,7 @@ Page({ ec: { onInit: initChart }, + msg:[], //首页中间消息列表 }, //自建物流 diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 06b0c5d..19dcbd2 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,10 +1,10 @@ @@ -33,4 +33,4 @@ - + \ No newline at end of file diff --git a/pages/meLogistics/meLogistics.js b/pages/meLogistics/meLogistics.js index 2650545..c6b7ea2 100644 --- a/pages/meLogistics/meLogistics.js +++ b/pages/meLogistics/meLogistics.js @@ -1,6 +1,6 @@ // pages/meLogistics/meLogistics.js - var datePicker = require('../../utils/dateSetting') +const http = require('../../utils/http') //设定当前的时间,将其设定为常量 @@ -27,6 +27,7 @@ Page({ } ], pipenum:'', + selfOrderCode:'',//物流单号 ins: ['xx卫生院','xx门诊',], bushList:['私家车','大巴','顺丰','其他'], bush:'', @@ -59,6 +60,7 @@ Page({ }) }, + //样本拍照 phot(){ wx.chooseMedia({ count: 1, @@ -83,6 +85,7 @@ Page({ // }) // }, + //物流车拍照 bushPhot(){ wx.chooseMedia({ count: 1, @@ -96,6 +99,7 @@ Page({ }) }, + //转运箱拍照 boxPhot(){ wx.chooseMedia({ count: 1, @@ -228,24 +232,30 @@ Page({ end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),//当前的时间 //开始 - multiArray: - [ - [year + "年", year + 1 + "年", year + 2 + "年"], + multiArray:[[year + "年", year + 1 + "年", year + 2 + "年"], datePicker.determineMonth(), datePicker.determineDay(year, month), datePicker.determineHour(), datePicker.determineMinute() ], //结束 - multiArray1: - [ - [year + "年", year + 1 + "年", year + 2 + "年"], + multiArray1:[[year + "年", year + 1 + "年", year + 2 + "年"], datePicker.determineMonth(), datePicker.determineDay(year, month), datePicker.determineHour(), datePicker.determineMinute() ], - }) + }), + + //获取物流单号 1.自建物流 2.第三方物流 3.货运物流 + http.get(`/batch/getBatchsNumber?logisticsWay=1`).then(res => { + console.log('getBatchsNumber=' + JSON.stringify(res.data)) + if(res.data.code === 200){ + this.setData({ + selfOrderCode:res.data.data + }) + } + }) }, /** diff --git a/pages/meLogistics/meLogistics.wxml b/pages/meLogistics/meLogistics.wxml index 5e6434c..aa3d4fc 100644 --- a/pages/meLogistics/meLogistics.wxml +++ b/pages/meLogistics/meLogistics.wxml @@ -1,4 +1,4 @@ - + @@ -7,10 +7,11 @@ 扫 码 拍 照 + - +