Commit 363e801d by liangjianmin

js

parent 6ce01c6f
Showing with 20 additions and 16 deletions
...@@ -108,6 +108,7 @@ import w_md5 from '../../js_sdk/zww-md5/w_md5.js'; ...@@ -108,6 +108,7 @@ import w_md5 from '../../js_sdk/zww-md5/w_md5.js';
export default { export default {
data() { data() {
return { return {
noexebshowFalg: true, //控制是否会触发生命周期
array: ['FedEx', 'DHL', 'UPS', '顺丰', 'Air'], array: ['FedEx', 'DHL', 'UPS', '顺丰', 'Air'],
textArr: ['物流', '送货', '上门取货'], textArr: ['物流', '送货', '上门取货'],
unitArr: ['件', '箱'], unitArr: ['件', '箱'],
...@@ -133,9 +134,10 @@ export default { ...@@ -133,9 +134,10 @@ export default {
onLoad(options) { onLoad(options) {
this.id = options.number; this.id = options.number;
}, },
watch: {},
onShow() { onShow() {
this.getData(); if (this.noexebshowFalg) {
this.getData();
}
}, },
methods: { methods: {
getData() { getData() {
...@@ -168,6 +170,7 @@ export default { ...@@ -168,6 +170,7 @@ export default {
}); });
}, },
previewChange(img, index) { previewChange(img, index) {
this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期
uni.previewImage({ uni.previewImage({
current: index, current: index,
urls: img urls: img
...@@ -177,6 +180,7 @@ export default { ...@@ -177,6 +180,7 @@ export default {
this.form.check_in_pic.splice(index, 1); this.form.check_in_pic.splice(index, 1);
}, },
chooseImageChange() { chooseImageChange() {
this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期
var self = this; var self = this;
var time = parseInt(new Date().getTime() / 1000); var time = parseInt(new Date().getTime() / 1000);
uni.chooseImage({ uni.chooseImage({
...@@ -239,10 +243,10 @@ export default { ...@@ -239,10 +243,10 @@ export default {
this.form.delivery_method = index + 1; this.form.delivery_method = index + 1;
} else if (type == 2) { } else if (type == 2) {
this.unitIndex = index; this.unitIndex = index;
if(index == 0){ if (index == 0) {
this.form.unit='件' this.form.unit = '件';
}else if(index == 1){ } else if (index == 1) {
this.form.unit='箱' this.form.unit = '箱';
} }
} }
}, },
...@@ -254,16 +258,16 @@ export default { ...@@ -254,16 +258,16 @@ export default {
this.index = e.target.value; this.index = e.target.value;
this.form.logistics_company = this.array[e.target.value]; this.form.logistics_company = this.array[e.target.value];
}, },
submit() { submit() {
if (!this.form.total_num) { if (!this.form.total_num) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '输入登记数量', content: '输入登记数量',
showCancel: false showCancel: false
}); });
return false; return false;
} }
this.request(API.addCheckIn, 'POST', this.form, true).then(res => { this.request(API.addCheckIn, 'POST', this.form, true).then(res => {
if (res.err_code === 0) { if (res.err_code === 0) {
uni.showToast({ uni.showToast({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment