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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
17 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
})
=>
{
const
axios
=
({
method
=
'GET'
,
url
,
data
=
{},
isLoading
=
true
})
=>
{
...
@@ -10,7 +10,6 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
...
@@ -10,7 +10,6 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
dd
.
showLoading
({
dd
.
showLoading
({
content
:
'加载中...'
,
content
:
'加载中...'
,
});
});
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
dd
.
httpRequest
({
dd
.
httpRequest
({
url
:
url_
,
url
:
url_
,
...
@@ -19,8 +18,10 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
...
@@ -19,8 +18,10 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
success
:
function
(
res
)
{
success
:
function
(
res
)
{
isLoading
&&
dd
.
hideLoading
();
isLoading
&&
dd
.
hideLoading
();
resolve
(
res
)
resolve
(
res
)
},
},
fail
:
function
(
err
)
{
fail
:
function
(
err
)
{
isLoading
&&
dd
.
hideLoading
();
isLoading
&&
dd
.
hideLoading
();
dd
.
showToast
({
dd
.
showToast
({
type
:
'fail'
,
type
:
'fail'
,
...
...
pages/detail/detail.axml
View file @
c5b82942
...
@@ -6,11 +6,11 @@
...
@@ -6,11 +6,11 @@
</view>
</view>
<view class="list-box list-box2">
<view class="list-box list-box2">
<text >明细扫码:</text>
<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 onTap="saoma">锁定</view>
</view>
</view>
<view class="detail-list">
<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">
<view class="g-t">
{{item.order_info.materialname}}
{{item.order_info.materialname}}
</view>
</view>
...
...
pages/detail/detail.js
View file @
c5b82942
...
@@ -257,6 +257,23 @@ Page({
...
@@ -257,6 +257,23 @@ Page({
// 页面加载完成
// 页面加载完成
getApp
().
setName
(
this
)
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
()
{
getDateList
()
{
axios
({
axios
({
...
@@ -266,6 +283,7 @@ Page({
...
@@ -266,6 +283,7 @@ Page({
res
.
data
.
data
.
forEach
((
item
)
=>
{
res
.
data
.
data
.
forEach
((
item
)
=>
{
item
.
order_info
.
isShow
=
1
item
.
order_info
.
isShow
=
1
});
});
this
.
setData
({
this
.
setData
({
list
:
res
.
data
.
data
list
:
res
.
data
.
data
})
})
...
@@ -281,9 +299,14 @@ Page({
...
@@ -281,9 +299,14 @@ Page({
})
})
},
},
getSaoMaId
(
code
)
{
getSaoMaId
(
code
)
{
console
.
log
(
code
)
axios
({
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
=>
{
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
code
==
0
)
{
//请求得到的ID值
//请求得到的ID值
...
@@ -322,6 +345,7 @@ Page({
...
@@ -322,6 +345,7 @@ Page({
//this.getSaoMaId(code_)
//this.getSaoMaId(code_)
//}
//}
//});
//});
console
.
log
(
this
.
data
.
inputValue2
)
this
.
getSaoMaId
(
this
.
data
.
inputValue2
)
this
.
getSaoMaId
(
this
.
data
.
inputValue2
)
},
},
...
@@ -409,9 +433,15 @@ Page({
...
@@ -409,9 +433,15 @@ Page({
});
});
},
},
bindKeyInput2
(
e
)
{
bindKeyInput2
(
e
)
{
this
.
setData
({
let
code_text
=
e
.
detail
.
value
if
(
code_text
.
split
(
"|"
).
length
==
6
)
{
this
.
setData
({
inputValue2
:
e
.
detail
.
value
,
inputValue2
:
e
.
detail
.
value
,
});
});
this
.
saoma
()
}
},
},
initInput
(){
initInput
(){
...
...
pages/list/list.axml
View file @
c5b82942
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<view class="list-box">
<view class="list-box">
<text>出库单号:</text>
<text>出库单号:</text>
<view class="inputbox" >
<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>
<view class="bl" onTap="gotoDetail">锁定</view>
<view class="bl" onTap="gotoDetail">锁定</view>
</view>
</view>
\ No newline at end of file
pages/list/list.js
View file @
c5b82942
...
@@ -11,7 +11,7 @@ Page({
...
@@ -11,7 +11,7 @@ Page({
onReady
()
{
onReady
()
{
// 页面加载完成
// 页面加载完成
getApp
().
setName
(
this
)
getApp
().
setName
(
this
)
},
},
saoma
()
{
saoma
()
{
dd
.
scan
({
dd
.
scan
({
...
@@ -25,18 +25,18 @@ Page({
...
@@ -25,18 +25,18 @@ Page({
});
});
},
},
initInput
(
e
){
initInput
(
e
)
{
this
.
setData
({
this
.
setData
({
inputValue
:
""
inputValue
:
""
});
});
},
},
bindKeyInput
(
e
)
{
bindKeyInput
(
e
)
{
this
.
setData
({
let
code_text
=
e
.
detail
.
value
inputValue
:
e
.
detail
.
value
,
code_text
=
code_text
.
substring
(
code_text
.
length
-
4
);
});
if
(
code_text
==
"|001"
)
{
let
code_text
=
e
.
detail
.
value
this
.
setData
({
code_text
=
code_text
.
substring
(
code_text
.
length
-
4
);
inputValue
:
e
.
detail
.
value
,
if
(
code_text
==
"|001"
){
});
this
.
gotoDetail
()
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