| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- const app = getApp();
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- transportName:null,
- transport:null,
- driverName:null,
- plateNum:null,
- //运输类型id 10 汽车 20船 30火车 40飞机 50其他
- transportType:[
- {name:'汽车',type:'10'},
- {name:'船运',type:'20'},
- {name:'火车',type:'30'},
- {name:'飞机',type:'40'},
- {name:'其他',type:'50'},
- ],
- },
- setTransportName(e){
- this.setData({
- transportName:e.detail.value
- })
- },
- setDriverName(e){
- this.setData({
- driverName:e.detail.value
- })
- },
- setPlateNum(e){
- this.setData({
- plateNum:e.detail.value
- })
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- const {transportName,transport,driverName,plateNum,code,uid} = options;
- this.setData({
- transportName,driverName,plateNum,code,uid
- })
- this.setOptonsType(transport)
- },
- setOptonsType(transport){
- var transportType = this.data.transportType;
- for(var i=0;i<transportType.length;i++){
- if(transport == transportType[i].name){
- this.setData({
- transport:i
- })
- break;
- }
- }
- },
- setTransportType(e){
- var value = e.detail.value;
- this.setData({
- transport:value+''
- })
- },
- addLabel(){
- const {transportName,transport,driverName,plateNum,code,uid} = this.data;
- this.updteVvmTransportOrder({transportName,transport,driverName,plateNum,code,uid})
- },
- updteVvmTransportOrder(form){
- var that = this;
- app.requestP({
- url: '/transport/updteVvmTransportOrder',
- method: 'post',
- contentType: 'application/json',
- data: form
- }).then(res=>{
- app.showToptip(that, 'success', res.data.msg);
- wx.navigateBack({
- delta: 1,
- })
- }).catch(err=>{
- app.showToptip(that, 'error', err.data.msg)
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- }
- })
|