Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
photoStore
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3a53405a
authored
Sep 04, 2020
by
肖康
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
打印日志
parent
a08bab95
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
54 deletions
app.js
pages/detail/detail.axml
pages/detail/detail.js
app.js
View file @
3a53405a
...
@@ -16,7 +16,6 @@ App({
...
@@ -16,7 +16,6 @@ App({
dd
.
getAuthCode
({
dd
.
getAuthCode
({
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
var
code
=
res
.
authCode
;
var
code
=
res
.
authCode
;
dd
.
httpRequest
({
dd
.
httpRequest
({
url
:
"https://oapi.dingtalk.com/gettoken?appkey=dingmwxikbdltarcjlb8&appsecret=GUS0_HylYmPcoPYCshqUI3U2ik3r1eu7SyydOCWzUny7SZwDUQb1E1jnW7vpZCvM"
,
url
:
"https://oapi.dingtalk.com/gettoken?appkey=dingmwxikbdltarcjlb8&appsecret=GUS0_HylYmPcoPYCshqUI3U2ik3r1eu7SyydOCWzUny7SZwDUQb1E1jnW7vpZCvM"
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
...
@@ -24,14 +23,14 @@ App({
...
@@ -24,14 +23,14 @@ App({
dd
.
httpRequest
({
dd
.
httpRequest
({
url
:
'https://oapi.dingtalk.com/user/getuserinfo?access_token='
+
access_token
+
'&code='
+
code
,
url
:
'https://oapi.dingtalk.com/user/getuserinfo?access_token='
+
access_token
+
'&code='
+
code
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
dd
.
httpRequest
({
console
.
log
(
res
)
url
:
'https://oapi.dingtalk.com/user/get?access_token='
+
access_token
+
'&userid='
+
res
.
data
.
userid
,
self
.
personName
=
res
.
data
.
name
success
:
function
(
res
)
{
self
.
personName
=
res
.
data
.
name
}
});
},
},
});
});
},
fail
:
function
(
res
){
console
.
log
(
res
)
}
}
})
})
},
},
...
...
pages/detail/detail.axml
View file @
3a53405a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<view class="list-box list-box2">
<view class="list-box list-box2">
<text class="tl">明细扫码:</text>
<text class="tl">明细扫码:</text>
<text onTap="saoma" class="t2">
<text onTap="saoma" class="t2">
<input placeholder="点击输入框扫码"
disabled="true
"/>
<input placeholder="点击输入框扫码"
disabled="true" value="{{inputValue2}}
"/>
</text>
</text>
<view ></view>
<view ></view>
...
...
pages/detail/detail.js
View file @
3a53405a
...
@@ -18,18 +18,28 @@ Page({
...
@@ -18,18 +18,28 @@ Page({
},
},
onReady
()
{
onReady
()
{
// 页面加载完成
// 页面加载完成
getApp
().
setName
(
this
)
getApp
().
setName
(
this
)
},
},
getDateList
()
{
getDateList
()
{
axios
({
axios
({
url
:
"/photo_taking/get_order_info/"
+
this
.
data
.
inputValue
url
:
"/photo_taking/get_order_info/"
+
this
.
data
.
inputValue
}).
then
(
res
=>
{
}).
then
(
res
=>
{
res
.
data
.
data
.
forEach
((
item
)
=>
{
if
(
res
.
data
.
code
==
0
)
{
item
.
order_info
.
isShow
=
1
res
.
data
.
data
.
forEach
((
item
)
=>
{
});
item
.
order_info
.
isShow
=
1
this
.
setData
({
});
list
:
res
.
data
.
data
this
.
setData
({
})
list
:
res
.
data
.
data
})
}
else
{
dd
.
showToast
({
type
:
'fail'
,
content
:
res
.
data
.
data
,
duration
:
3000
});
}
})
})
},
},
...
@@ -37,22 +47,29 @@ Page({
...
@@ -37,22 +47,29 @@ Page({
axios
({
axios
({
url
:
"/photo_taking/scan_order_detail/"
+
this
.
data
.
inputValue
+
"/"
+
encodeURI
(
code
)
url
:
"/photo_taking/scan_order_detail/"
+
this
.
data
.
inputValue
+
"/"
+
encodeURI
(
code
)
}).
then
(
res
=>
{
}).
then
(
res
=>
{
//请求得到的ID值
if
(
res
.
data
.
code
==
0
)
{
let
detail_id
=
res
.
data
.
data
;
//请求得到的ID值
this
.
data
.
list
.
forEach
((
item
)
=>
{
let
detail_id
=
res
.
data
.
data
;
if
(
item
.
order_info
.
id
==
detail_id
)
{
this
.
data
.
list
.
forEach
((
item
)
=>
{
item
.
order_info
.
isShow
=
1
if
(
item
.
order_info
.
id
==
detail_id
)
{
}
else
{
item
.
order_info
.
isShow
=
1
item
.
order_info
.
isShow
=
0
}
else
{
}
item
.
order_info
.
isShow
=
0
});
}
this
.
setData
({
});
list
:
this
.
data
.
list
,
this
.
setData
({
detailId
:
detail_id
list
:
this
.
data
.
list
,
})
detailId
:
detail_id
this
.
subMxActionShee
()
})
}).
catch
(
err
=>
{
this
.
subMxActionShee
()
console
.
log
(
err
)
}
else
{
dd
.
showToast
({
type
:
'fail'
,
content
:
res
.
data
.
data
,
duration
:
3000
});
}
})
})
},
},
...
@@ -60,7 +77,7 @@ Page({
...
@@ -60,7 +77,7 @@ Page({
dd
.
scan
({
dd
.
scan
({
type
:
'qr'
,
type
:
'qr'
,
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
let
code_
=
res
.
code
let
code_
=
res
.
code
this
.
setData
({
this
.
setData
({
inputValue2
:
code_
inputValue2
:
code_
});
});
...
@@ -70,25 +87,18 @@ Page({
...
@@ -70,25 +87,18 @@ Page({
},
},
clear
()
{
resetsdata
()
{
//提交成功 取消
//提交成功 取消
this
.
data
.
list
.
forEach
((
item
)
=>
{
this
.
data
.
list
.
forEach
((
item
)
=>
{
item
.
order_info
.
isShow
=
1
item
.
order_info
.
isShow
=
1
});
});
this
.
setData
({
this
.
setData
({
inputValue2
:
""
,
inputValue2
:
""
,
detailImages
:
""
,
detailImages
:
[]
,
list
:
this
.
data
.
list
list
:
this
.
data
.
list
});
});
},
},
submitDetail
()
{
submitDetail
()
{
console
.
log
(
{
id
:
this
.
data
.
detailId
,
scan_str
:
this
.
data
.
inputValue2
,
image_src
:
(
this
.
data
.
detailImages
.
join
(
","
))
}
)
axios
({
axios
({
url
:
"/photo_taking/add_order_image"
,
url
:
"/photo_taking/add_order_image"
,
method
:
"POST"
,
method
:
"POST"
,
...
@@ -100,14 +110,19 @@ Page({
...
@@ -100,14 +110,19 @@ Page({
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
code
==
0
)
{
//提交成功
//提交成功
this
.
clear
();
this
.
resetsdata
();
this
.
getDateList
();
this
.
getDateList
();
}
else
{
dd
.
showToast
({
type
:
'fail'
,
content
:
res
.
data
.
data
,
duration
:
3000
});
}
}
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
})
},
},
subMxActionShee
()
{
subMxActionShee
()
{
//提交明细
//提交明细
dd
.
showActionSheet
({
dd
.
showActionSheet
({
items
:
[
'提交'
,
'拍照'
],
items
:
[
'提交'
,
'拍照'
],
...
@@ -120,16 +135,16 @@ Page({
...
@@ -120,16 +135,16 @@ Page({
dd
.
chooseImage
({
dd
.
chooseImage
({
count
:
10
,
count
:
10
,
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
log
(
res
.
filePaths
)
this
.
setData
({
this
.
setData
({
detailImages
:
[...
this
.
data
.
detailImages
,
...
res
.
filePaths
]
detailImages
:
[...
this
.
data
.
detailImages
,
...
res
.
filePaths
]
});
});
console
.
log
(
this
.
data
.
detailImages
)
this
.
subMxActionShee
();
this
.
subMxActionShee
();
},
},
});
});
}
else
{
}
else
{
this
.
clear
()
this
.
resetsdata
()
}
}
}
}
});
});
...
@@ -139,11 +154,7 @@ Page({
...
@@ -139,11 +154,7 @@ Page({
inputValue
:
e
.
detail
.
value
,
inputValue
:
e
.
detail
.
value
,
});
});
},
},
bindKeyInput2
(
e
)
{
this
.
setData
({
inputValue2
:
e
.
detail
.
value
,
});
},
submitGo
()
{
submitGo
()
{
//提交
//提交
...
@@ -155,7 +166,7 @@ Page({
...
@@ -155,7 +166,7 @@ Page({
type
:
'success'
,
type
:
'success'
,
content
:
'整单提交成功'
,
content
:
'整单提交成功'
,
duration
:
3000
duration
:
3000
});
});
setTimeout
(()
=>
{
setTimeout
(()
=>
{
dd
.
navigateTo
({
dd
.
navigateTo
({
url
:
'/pages/index/index'
url
:
'/pages/index/index'
...
@@ -169,7 +180,7 @@ Page({
...
@@ -169,7 +180,7 @@ Page({
});
});
}
}
})
})
},
},
onShareAppMessage
()
{
onShareAppMessage
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment