Commit 3a53405a by 肖康

打印日志

parent a08bab95
......@@ -16,7 +16,6 @@ App({
dd.getAuthCode({
success: (res) => {
var code = res.authCode;
dd.httpRequest({
url: "https://oapi.dingtalk.com/gettoken?appkey=dingmwxikbdltarcjlb8&appsecret=GUS0_HylYmPcoPYCshqUI3U2ik3r1eu7SyydOCWzUny7SZwDUQb1E1jnW7vpZCvM",
success: function (res) {
......@@ -24,14 +23,14 @@ App({
dd.httpRequest({
url: 'https://oapi.dingtalk.com/user/getuserinfo?access_token=' + access_token + '&code=' + code,
success: function (res) {
dd.httpRequest({
url: 'https://oapi.dingtalk.com/user/get?access_token=' + access_token + '&userid=' + res.data.userid,
success: function (res) {
self.personName = res.data.name
}
});
console.log(res)
self.personName = res.data.name
},
});
},
fail:function(res){
console.log(res)
}
})
},
......
......@@ -7,7 +7,7 @@
<view class="list-box list-box2">
<text class="tl">明细扫码:</text>
<text onTap="saoma" class="t2">
<input placeholder="点击输入框扫码" disabled="true"/>
<input placeholder="点击输入框扫码" disabled="true" value="{{inputValue2}}"/>
</text>
<view ></view>
......
......@@ -18,18 +18,28 @@ Page({
},
onReady() {
// 页面加载完成
getApp().setName(this)
getApp().setName(this)
},
getDateList() {
axios({
url: "/photo_taking/get_order_info/" + this.data.inputValue
}).then(res => {
res.data.data.forEach((item) => {
item.order_info.isShow = 1
});
this.setData({
list: res.data.data
})
if (res.data.code == 0) {
res.data.data.forEach((item) => {
item.order_info.isShow = 1
});
this.setData({
list: res.data.data
})
} else {
dd.showToast({
type: 'fail',
content: res.data.data,
duration: 3000
});
}
})
},
......@@ -37,22 +47,29 @@ Page({
axios({
url: "/photo_taking/scan_order_detail/" + this.data.inputValue + "/" + encodeURI(code)
}).then(res => {
//请求得到的ID值
let detail_id = res.data.data;
this.data.list.forEach((item) => {
if (item.order_info.id == detail_id) {
item.order_info.isShow = 1
} else {
item.order_info.isShow = 0
}
});
this.setData({
list: this.data.list,
detailId: detail_id
})
this.subMxActionShee()
}).catch(err=>{
console.log(err)
if (res.data.code == 0) {
//请求得到的ID值
let detail_id = res.data.data;
this.data.list.forEach((item) => {
if (item.order_info.id == detail_id) {
item.order_info.isShow = 1
} else {
item.order_info.isShow = 0
}
});
this.setData({
list: this.data.list,
detailId: detail_id
})
this.subMxActionShee()
} else {
dd.showToast({
type: 'fail',
content: res.data.data,
duration: 3000
});
}
})
},
......@@ -60,7 +77,7 @@ Page({
dd.scan({
type: 'qr',
success: (res) => {
let code_=res.code
let code_ = res.code
this.setData({
inputValue2: code_
});
......@@ -70,25 +87,18 @@ Page({
},
clear() {
resetsdata() {
//提交成功 取消
this.data.list.forEach((item) => {
item.order_info.isShow = 1
});
this.setData({
inputValue2: "",
detailImages: "",
detailImages: [],
list: this.data.list
});
},
submitDetail() {
console.log(
{
id: this.data.detailId,
scan_str: this.data.inputValue2,
image_src: (this.data.detailImages.join(","))
}
)
axios({
url: "/photo_taking/add_order_image",
method: "POST",
......@@ -100,14 +110,19 @@ Page({
}).then(res => {
if (res.data.code == 0) {
//提交成功
this.clear();
this.resetsdata();
this.getDateList();
} else {
dd.showToast({
type: 'fail',
content: res.data.data,
duration: 3000
});
}
}).catch(err=>{
console.log(err)
})
},
subMxActionShee() {
//提交明细
dd.showActionSheet({
items: ['提交', '拍照'],
......@@ -120,16 +135,16 @@ Page({
dd.chooseImage({
count: 10,
success: (res) => {
console.log(res.filePaths)
this.setData({
detailImages: [...this.data.detailImages, ...res.filePaths]
});
console.log(this.data.detailImages)
this.subMxActionShee();
},
});
} else {
this.clear()
this.resetsdata()
}
}
});
......@@ -139,11 +154,7 @@ Page({
inputValue: e.detail.value,
});
},
bindKeyInput2(e) {
this.setData({
inputValue2: e.detail.value,
});
},
submitGo() {
//提交
......@@ -155,7 +166,7 @@ Page({
type: 'success',
content: '整单提交成功',
duration: 3000
});
});
setTimeout(() => {
dd.navigateTo({
url: '/pages/index/index'
......@@ -169,7 +180,7 @@ Page({
});
}
})
},
onShareAppMessage() {
......
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