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';
export default {
data() {
return {
noexebshowFalg: true, //控制是否会触发生命周期
array: ['FedEx', 'DHL', 'UPS', '顺丰', 'Air'],
textArr: ['物流', '送货', '上门取货'],
unitArr: ['件', '箱'],
......@@ -133,9 +134,10 @@ export default {
onLoad(options) {
this.id = options.number;
},
watch: {},
onShow() {
this.getData();
if (this.noexebshowFalg) {
this.getData();
}
},
methods: {
getData() {
......@@ -168,6 +170,7 @@ export default {
});
},
previewChange(img, index) {
this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期
uni.previewImage({
current: index,
urls: img
......@@ -177,6 +180,7 @@ export default {
this.form.check_in_pic.splice(index, 1);
},
chooseImageChange() {
this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期
var self = this;
var time = parseInt(new Date().getTime() / 1000);
uni.chooseImage({
......@@ -239,10 +243,10 @@ export default {
this.form.delivery_method = index + 1;
} else if (type == 2) {
this.unitIndex = index;
if(index == 0){
this.form.unit='件'
}else if(index == 1){
this.form.unit='箱'
if (index == 0) {
this.form.unit = '件';
} else if (index == 1) {
this.form.unit = '箱';
}
}
},
......@@ -254,16 +258,16 @@ export default {
this.index = e.target.value;
this.form.logistics_company = this.array[e.target.value];
},
submit() {
if (!this.form.total_num) {
uni.showModal({
title: '提示',
content: '输入登记数量',
showCancel: false
});
return false;
}
submit() {
if (!this.form.total_num) {
uni.showModal({
title: '提示',
content: '输入登记数量',
showCancel: false
});
return false;
}
this.request(API.addCheckIn, 'POST', this.form, true).then(res => {
if (res.err_code === 0) {
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