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
c5b82942
authored
Nov 04, 2020
by
肖康
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
x
parent
70596d0f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
12 deletions
api.js
pages/detail/detail.axml
pages/detail/detail.js
pages/list/list.axml
pages/list/list.js
api.js
View file @
c5b82942
//
const host = 'http://www.photo.com:8000';//开发环境
const
host
=
'http://www.photo.com:8000'
;
//开发环境
const
host
=
'http://smapi.ichunt.net'
;
//线上环境
//
const host = 'http://smapi.ichunt.net';//线上环境
const
axios
=
({
method
=
'GET'
,
url
,
data
=
{},
isLoading
=
true
})
=>
{
...
...
@@ -10,7 +10,6 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
dd
.
showLoading
({
content
:
'加载中...'
,
});
return
new
Promise
((
resolve
,
reject
)
=>
{
dd
.
httpRequest
({
url
:
url_
,
...
...
@@ -19,8 +18,10 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
success
:
function
(
res
)
{
isLoading
&&
dd
.
hideLoading
();
resolve
(
res
)
},
fail
:
function
(
err
)
{
isLoading
&&
dd
.
hideLoading
();
dd
.
showToast
({
type
:
'fail'
,
...
...
pages/detail/detail.axml
View file @
c5b82942
...
...
@@ -6,11 +6,11 @@
</view>
<view class="list-box list-box2">
<text >明细扫码:</text>
<input placeholder="点击输入框扫码 " focus="true" on
Blur
="bindKeyInput2" onFocus="initInput" value="{{inputValue2}}"/>
<input placeholder="点击输入框扫码 " focus="true" on
Input
="bindKeyInput2" onFocus="initInput" value="{{inputValue2}}"/>
<view onTap="saoma">锁定</view>
</view>
<view class="detail-list">
<view hidden="{{item.order_info.isShow ? false : true}}" class="group {{(item.order_info.scanqty==0)?'':(item.order_info.qty==item.order_info.scanqty)?'y':'d'}}" a:for="{{list}}">
<view
id="{{item.order_info.id}}" onTap="tabListDetail"
hidden="{{item.order_info.isShow ? false : true}}" class="group {{(item.order_info.scanqty==0)?'':(item.order_info.qty==item.order_info.scanqty)?'y':'d'}}" a:for="{{list}}">
<view class="g-t">
{{item.order_info.materialname}}
</view>
...
...
pages/detail/detail.js
View file @
c5b82942
...
...
@@ -257,6 +257,23 @@ Page({
// 页面加载完成
getApp
().
setName
(
this
)
},
tabListDetail
(
event
){
//获取明细ID值
let
detail_id
=
event
.
currentTarget
.
id
;
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
()
},
getDateList
()
{
axios
({
...
...
@@ -266,6 +283,7 @@ Page({
res
.
data
.
data
.
forEach
((
item
)
=>
{
item
.
order_info
.
isShow
=
1
});
this
.
setData
({
list
:
res
.
data
.
data
})
...
...
@@ -281,9 +299,14 @@ Page({
})
},
getSaoMaId
(
code
)
{
console
.
log
(
code
)
axios
({
url
:
"/photo_taking/scan_order_detail/"
+
this
.
data
.
inputValue
+
"/"
+
encodeURI
(
code
)
url
:
"/photo_taking/scan_order_detail"
,
method
:
"POST"
,
data
:
{
order_id
:
this
.
data
.
inputValue
,
scan_str
:
code
}
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
0
)
{
//请求得到的ID值
...
...
@@ -322,6 +345,7 @@ Page({
//this.getSaoMaId(code_)
//}
//});
console
.
log
(
this
.
data
.
inputValue2
)
this
.
getSaoMaId
(
this
.
data
.
inputValue2
)
},
...
...
@@ -409,9 +433,15 @@ Page({
});
},
bindKeyInput2
(
e
)
{
let
code_text
=
e
.
detail
.
value
if
(
code_text
.
split
(
"|"
).
length
==
6
)
{
this
.
setData
({
inputValue2
:
e
.
detail
.
value
,
});
this
.
saoma
()
}
},
initInput
(){
...
...
pages/list/list.axml
View file @
c5b82942
...
...
@@ -2,7 +2,7 @@
<view class="list-box">
<text>出库单号:</text>
<view class="inputbox" >
<input placeholder="点击输入框扫码" on
Blur
="bindKeyInput" onFocus="initInput" value="{{inputValue}}" autofocus="autofocus" focus="true"/>
<input placeholder="点击输入框扫码" on
Input
="bindKeyInput" onFocus="initInput" value="{{inputValue}}" autofocus="autofocus" focus="true"/>
</view>
<view class="bl" onTap="gotoDetail">锁定</view>
</view>
\ No newline at end of file
pages/list/list.js
View file @
c5b82942
...
...
@@ -25,18 +25,18 @@ Page({
});
},
initInput
(
e
){
initInput
(
e
)
{
this
.
setData
({
inputValue
:
""
});
},
bindKeyInput
(
e
)
{
let
code_text
=
e
.
detail
.
value
code_text
=
code_text
.
substring
(
code_text
.
length
-
4
);
if
(
code_text
==
"|001"
)
{
this
.
setData
({
inputValue
:
e
.
detail
.
value
,
});
let
code_text
=
e
.
detail
.
value
code_text
=
code_text
.
substring
(
code_text
.
length
-
4
);
if
(
code_text
==
"|001"
){
this
.
gotoDetail
()
}
},
...
...
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