| | |
| | | }, |
| | | onLoad() { |
| | | let that = this |
| | | this.baseUrl = uni.getStorageSync('baseUrl'); |
| | | this.token = uni.getStorageSync('token'); |
| | | // const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | |
| | |
| | | eventChannel.on('item', function(data) { |
| | | console.log(data); |
| | | that.orderId = data.item.orderId |
| | | console.log(data.item.id); |
| | | uni.setNavigationBarTitle({ |
| | | title: data.item.orderNo |
| | | title: data.item.orderNo, |
| | | |
| | | }) |
| | | that.getOrderDetl(data.item.id) |
| | | |
| | | }) |
| | | }, |
| | | onShow() { |
| | | this.baseUrl = uni.getStorageSync('baseUrl'); |
| | | this.token = uni.getStorageSync('token'); |
| | | if (this.dataList.length > 0) { |
| | | this.oldDataList = [...this.dataList] |
| | | } |
| | | this.getOrderDetl(this.orderId) |
| | | // this.getOrderDetl(this.orderId) |
| | | }, |
| | | methods: { |
| | | // 订单明细 |
| | | getOrderDetl(id) { |
| | | let _this = this |
| | | console.log(id); |
| | | uni.request({ |
| | | url: `${_this.baseUrl}/orderDetl/list/auth`, |
| | | header: {'token': uni.getStorageSync('token')}, |
| | |
| | | this.dataList = [...this.oldDataList] |
| | | }, |
| | | combConfirm(type) { |
| | | |
| | | let _this = this |
| | | let combList = [] |
| | | for (let k of _this.dataList) { |
| | | if (k.checked) { |
| | | combList.push(k) |
| | | } |
| | | } |
| | | if (combList.length == 0) { |
| | | uni.showToast({ title: '请选择组托商品', icon: "error", position: 'top' |
| | | }) |
| | | return |
| | | } |
| | | uni.navigateTo({ |
| | | url: "../AGV/AGVPakin2", |
| | | success: function(res) { |
| | | // 通过eventChannel向被打开页面传送数据 向另外一个页面传递值的 |
| | | res.eventChannel.emit('mats', { |
| | | mats: combList |
| | | }) |
| | | }, |
| | | }); |
| | | }, |
| | | } |
| | | } |