diff --git a/app.json b/app.json index 1bc33e5..8cab319 100644 --- a/app.json +++ b/app.json @@ -22,7 +22,9 @@ "pages/debitNoteList/debitNoteList", "pages/debitNoteList/debitNoteDetail/debitNoteDetail", "pages/debitNoteList/debitNoteQuery/debitNoteQuery", - "pages/goodaNameChooseTemplate/goodaNameChooseTemplate" + "pages/goodaNameChooseTemplate/goodaNameChooseTemplate", + "pages/sendTheDetails/creatNewCar/creatNewCar" + ], "window": { "backgroundTextStyle": "light", diff --git a/imgs/longOrangeBtn.png b/imgs/longOrangeBtn.png new file mode 100644 index 0000000..fbd12f9 Binary files /dev/null and b/imgs/longOrangeBtn.png differ diff --git a/imgs/orangeBtn.png b/imgs/orangeBtn.png new file mode 100644 index 0000000..1af4cbd Binary files /dev/null and b/imgs/orangeBtn.png differ diff --git a/pages/sendTheDetails/creatNewCar/creatNewCar.js b/pages/sendTheDetails/creatNewCar/creatNewCar.js new file mode 100644 index 0000000..677e6ea --- /dev/null +++ b/pages/sendTheDetails/creatNewCar/creatNewCar.js @@ -0,0 +1,75 @@ +// pages/myCars/creatNewCar/creatNewCar.js +const app = getApp(); +var network = require("../../../utils/net.js"); +var insert = "/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/CarRpc/Insert"; +var carNum = null; +var driverName = null; +var driverPhone = null; + +Page({ + + // 车牌号 + getCarNum: function(event) { + carNum = event.detail.value; + }, + + // 司机姓名 + getDriverName: function(event) { + driverName = event.detail.value; + }, + + // 司机电话 + getDriverPhoneNum: function(event) { + driverPhone = event.detail.value; + }, + + // 确认按钮 + submitNewCarsInfo: function(event) { + if (!carNum) { + wx.showToast({ + title: '车牌号不能为空', + }) + return false; + } + if (!driverName) { + wx.showToast({ + title: '司机姓名不能为空', + }) + return false; + } + if (driverPhone == "") { + wx.showToast({ + title: '请输入手机号码', + }) + return false; + } else if (!(/^1[34578]\d{9}$/.test(driverPhone))){ + wx.showToast({ + title: '号码不正确', + }) + return false; + } + + var pages = getCurrentPages(); + var currPage = pages[pages.length - 1]; //当前页面 + var prevPage = pages[pages.length - 2]; //上一个页面 + + prevPage.setData({ + carNumber: carNum, + driverName: driverName, + driverPhone: driverPhone, + isNewCar: true, + }); + + wx.showToast({ + title: '创建成功', + success: function(res) { + wx.navigateBack({ + delta: 1 + }) + } + }) + + + }, + +}) \ No newline at end of file diff --git a/pages/sendTheDetails/creatNewCar/creatNewCar.json b/pages/sendTheDetails/creatNewCar/creatNewCar.json new file mode 100644 index 0000000..bbd05c0 --- /dev/null +++ b/pages/sendTheDetails/creatNewCar/creatNewCar.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "车辆申请" +} \ No newline at end of file diff --git a/pages/sendTheDetails/creatNewCar/creatNewCar.wxml b/pages/sendTheDetails/creatNewCar/creatNewCar.wxml new file mode 100644 index 0000000..529cc90 --- /dev/null +++ b/pages/sendTheDetails/creatNewCar/creatNewCar.wxml @@ -0,0 +1,34 @@ + + + + 车牌号 + + + + + + + + 司机姓名 + + + + + + + + 联系方式 + + + + + + + + + + 确认 + + + + diff --git a/pages/sendTheDetails/creatNewCar/creatNewCar.wxss b/pages/sendTheDetails/creatNewCar/creatNewCar.wxss new file mode 100644 index 0000000..269acd1 --- /dev/null +++ b/pages/sendTheDetails/creatNewCar/creatNewCar.wxss @@ -0,0 +1,61 @@ +/* pages/myCars/creatNewCar/creatNewCar.wxss */ + +.baseitem { + height: 100rpx; + line-height: 100rpx; + display: flex; + flex-direction: row; + align-items: center; + padding-left: 20rpx; + padding-right: 20rpx; + font-size: 16px; + /* border-bottom: 0.1px solid #dbdbdb; */ +} + +.baseitem_key { + color: #666; + width: 40%; +} + +.baseitem_value { + color: rgb(48, 48, 48); + margin-left: 20rpx; + width: 60%; + text-align: right; +} + +.lineView { + height: 1rpx; + background-color: #dbdbdb; + margin-left: 20rpx; +} + +.imageView { + position: absolute; + bottom: 20px; + height: 80px; + width: 100%; + /* margin-top: 20%; + position: relative; */ + align-items: center; + justify-content: center; + box-sizing: content-box; +} + +.currentImage { + width: 100%; + height: 100%; +} + +.btnTextView { + position: absolute; + width: 100%; + top:0; + line-height: 65px; + text-align: center; +} + +.btnText { + color: white; + font-size: 34rpx; +} diff --git a/pages/sendTheDetails/sendTheDetails.js b/pages/sendTheDetails/sendTheDetails.js index c8abecd..63551f3 100644 --- a/pages/sendTheDetails/sendTheDetails.js +++ b/pages/sendTheDetails/sendTheDetails.js @@ -2,195 +2,179 @@ const app = getApp(); var baseUrl = app.globalData.baseUrl; var network = require("../../utils/net.js"); var timechage = require("../../utils/dateTimeUtil.js"); -var ID = 0; -var ID1; -var LoadTime1; -var Number; -var SecondNumber; -var Phone; -var ID4; + +// var LoadTime1; +// var Number; +// var SecondNumber; +// var Phone; Page({ data: { - name1: [], - countsArraydrug: [], - index: null, - btnnum: 1 - }, - - phoneNum: function(e) { - Phone = e.detail.value - var that = this; - var method2 = '/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetDriver'; - var params2 = [{ - "InputValue": Phone, - "PageIndex": 0, - "PageSize": 100 - }]; - - network.transfer_request(method2, params2, function(res) { - that.setData({ - name1: res.result, - }) - }) + orderID: null, + carNumber: '请选择运输车辆', + carID: null, + driverName: '', + driverID: null, + driverPhone: null, + carList: [], + isNewCar: false, }, onLoad: function(options) { var that = this; - ID = parseInt(options.ID); - var num = this.data.btnnum; - this.setData({ - btnnum: num, - obj: { - 1: { - "yaopin": "请选择司机", - num: num, - countsArraydrug: [], - } - }, - }) - + var orderID = parseInt(options.ID); var method1 = '/MainSystem/B3MiniProgramRpc/XuRpcs/Customer/OrderRpc/LoadForDriver'; - var params1 = [ID]; - + var params1 = [orderID]; network.transfer_request(method1, params1, function(res) { that.setData({ - ID1: res.result.ID, + orderID: res.result.ID, LoadTime1: timechage.formatTimeTwo(res.result.LoadTime.substring(6, 19), "Y/M/D"), - Number: res.result.Number, SecondNumber: res.result.SecondNumber, - }) }) }, - powerDrawer1: function(e) { + searchCarByInput: function(event) { + var searchStr = event.detail.value; var that = this; - var method2 = '/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetDriver'; + var method2 = '/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetCar'; var params2 = [{ - "InputValue": Phone, + "InputValue": searchStr, "PageIndex": 0, "PageSize": 100 }]; - network.transfer_request(method2, params2, function(res) { - //res就是我们请求接口返回的数据 that.setData({ - name1: res.result, - - countsArraydrug: res.result, - obj: { - 1: { - "yaopin": "请选择司机", - } - } + carList: res.result, + }) + }) + }, + findCar: function(searchString) { + var that = this; + var method2 = '/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetCar'; + var params2 = [{ + "InputValue": '', + "PageIndex": 0, + "PageSize": 100 + }]; + network.transfer_request(method2, params2, function(res) { + that.setData({ + carList: res.result, }) }) - var currentStatu = e.currentTarget.dataset.statu; - var i = e.currentTarget.dataset.index; - this.util(currentStatu) + this.util(); + }, + + // 点击弹出选项值 + itemclick: function(event) { + var carID = event.currentTarget.dataset.carid; + var carName = event.currentTarget.dataset.carname; + // 新增通过车辆ID获取司机信息 + this.getDriverInfo(carID); this.setData({ - thatIndex: i + carID: carID, + carNumber: carName, }) + this.util(); }, - a: function(event) { - var ID3; + getDriverInfo: function(carID) { var that = this; - var index = event.currentTarget.dataset.index - - let indexNum = this.data.thatIndex; - let obj = this.data.obj; - ID3 = that.data.name1[index].ID - ID4 = ID3; - obj[indexNum] = { - - "yaopin": that.data.name1[index].Name, - - indexNum: indexNum, - - } - - that.setData({ - obj: obj, - showModalStatus: false, + var method = '/MainSystem/B3MiniProgramRpc/XuRpcs/Customer/OrderRpc/GetCarDriver'; + var params = [carID]; + network.transfer_request(method, params, function(res) { + that.setData({ + driverName: res.result.Name, + driverID: res.result.ID, + }) }) - }, + creatNewCar: function(event) { + this.util(); + wx.navigateTo({ + url: 'creatNewCar/creatNewCar', + }) + }, paiche: function(event) { var that = this; - that.setData({ - ID4:ID4, - }) - if (ID4 == null) { + if (this.data.orderID == null) { wx.showModal({ title: '提示', - content: '不能为空', + content: '单据ID不能为空', }) + return false; + } + if (this.data.carNumber == null) { + wx.showModal({ + title: '提示', + content: '运输车辆不能为空', + }) + return false; + } else if (this.data.driverName == null) { + wx.showModal({ + title: '提示', + content: '车辆对应司机为空', + }) + return false; } else { var method = '/MainSystem/B3MiniProgramRpc/XuRpcs/Customer/OrderRpc/SetDriverToOrder'; - var params = [ID, ID4]; + if (this.data.isNewCar) { + var params = [{ + Order_ID: this.data.orderID, + Car_Name: this.data.carNumber, + Driver_Name: this.data.driverName, + Dreiver_Phone: this.data.driverPhone, + }] + } else { + var params = [{ + Order_ID: this.data.orderID, + Car_ID: this.data.carID, + Driver_ID: this.data.driverID, + }] + } + network.transfer_request(method, params, function(res) { - if (ID4 != null) { - wx.navigateBack({ - delta: "/pages/theDriverSend/theDriverSend" - }) - } + wx.showToast({ + title: '派车成功', + complete: function() { + wx.navigateBack({ + delta: "/pages/theDriverSend/theDriverSend" + }) + } + }) }) } }, - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function() { - ID4=null - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function() { - - }, - /** * 用户点击右上角分享 */ onShareAppMessage: function() { var that = this - var ID5=ID; return { title: '', - path: "/pages/fenxiang/fenxiang?ID=" + ID5, + path: "/pages/fenxiang/fenxiang?ID=" + this.data.orderID, //分享成功后执行 success: function(res) { wx.showModal({ - showCancel : false, + showCancel: false, title: '转发成功', }) }, - fail: function(res) { - } + fail: function(res) {} } }, powerDrawer: function(e) { var currentStatu = e.currentTarget.dataset.statu; - this.util(currentStatu) + this.util(); }, - util: function(currentStatu) { + + util: function() { /* 动画部分 */ // 第1步:创建动画实例 var animation = wx.createAnimation({ @@ -198,18 +182,14 @@ Page({ timingFunction: "linear", //线性 delay: 0 //0则不延迟 }); - // 第2步:这个动画实例赋给当前的动画实例 this.animation = animation; - // 第3步:执行第一组动画 animation.opacity(0).rotateX(-100).step(); - // 第4步:导出动画对象赋给数据对象储存 this.setData({ animationData: animation.export() }) - // 第5步:设置定时器到指定时候后,执行第二组动画 setTimeout(function() { // 执行第二组动画 @@ -220,20 +200,11 @@ Page({ }) //关闭 - if (currentStatu == "close") { - this.setData({ - showModalStatus: false - }); - } - }.bind(this), 200) - - // 显示 - if (currentStatu == "open") { this.setData({ - showModalStatus: true + showModalStatus: !this.data.showModalStatus, }); - } - }, + }.bind(this), 200) + }, }) \ No newline at end of file diff --git a/pages/sendTheDetails/sendTheDetails.wxml b/pages/sendTheDetails/sendTheDetails.wxml index 7dcac93..f8fac3b 100644 --- a/pages/sendTheDetails/sendTheDetails.wxml +++ b/pages/sendTheDetails/sendTheDetails.wxml @@ -2,7 +2,7 @@ 订单: - {{ID1}} + {{orderID}} @@ -25,32 +25,42 @@ - 司机: + 车辆: - - - {{item.yaopin}} + + {{carNumber}} - - - - - - - - - - {{name1[index].Name}} - - + + 司机: + {{driverName}} + - 取消 + + + + + + + + 新建车辆 + + + + + + {{item.Name}} + + + + 取消 + + - + \ No newline at end of file diff --git a/pages/sendTheDetails/sendTheDetails.wxss b/pages/sendTheDetails/sendTheDetails.wxss index a43effc..28662b3 100644 --- a/pages/sendTheDetails/sendTheDetails.wxss +++ b/pages/sendTheDetails/sendTheDetails.wxss @@ -44,7 +44,6 @@ page { } -/*mask*/ .drawer_screen { width: 100%; height: 100%; @@ -57,28 +56,12 @@ page { overflow: hidden; } -/*content*/ - -.drawer_screen { - width: 100%; - height: 100%; - position: fixed; - top: 0; - left: 0; - z-index: 1000; - background: #000; - opacity: 0.5; - overflow: hidden; -} - -.sousuo { - /* margin-right: 10%; - margin-left: 10%; */ +/* .sousuo { text-align: center; background: #d6d8da; height: 40px; font-size: 28rpx; -} +} */ .drawer_content { height: 500rpx; @@ -93,7 +76,7 @@ page { left: 0; z-index: 1001; background: #fafafa; - margin: -150px 50rpx 0 50rpx; + margin: -200px 50rpx 0 50rpx; border-radius: 3px; } @@ -102,13 +85,42 @@ page { font: 20px "microsoft yahei"; text-align: center; border-top: 1px solid #e8e8ea; - color: #2e8cf5; + color: #2788f8; } -.top { +/* .top { height: 20%; justify-content: center; align-items: center; +} */ +.searchView{ + /* margin: 10rpx 10rpx; */ + padding: 5rpx 10rpx; + width: 100%; + height: 40px; + align-items: center; + justify-content: center; + display: flex; + flex-direction: row; + background-color: orange; +} + +.imput_goodsName{ + border: 1rpx solid rgb(236, 231, 231); + height: 30px; + width: 67%; + border-radius: 10rpx; + background-color: #fff; + text-align: center; +} + +.storageView{ + width: 30%; + color: #fff; + font-size: 18px; + justify-content: center; + align-items: center; + text-align: center; } .grid1 {