Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
h5
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
74d48874
authored
Dec 26, 2020
by
肖康
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
x
parent
e1afbf5a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
105 additions
and
7 deletions
src/store/modules/user/order.js
src/store/modules/user/shiplist.js
src/store/store.js
src/views/user/order.vue
src/views/user/shiplist.vue
view/46.js
view/app.js
src/store/modules/user/order.js
View file @
74d48874
...
@@ -31,7 +31,6 @@ const actions = {
...
@@ -31,7 +31,6 @@ const actions = {
var
params
=
{
var
params
=
{
order_id
:
payload
.
order_id
order_id
:
payload
.
order_id
}
}
state
.
againBuy
.
isShow
=
0
Services
.
rebuy
(
qs
.
stringify
(
params
)).
then
((
res
)
=>
{
Services
.
rebuy
(
qs
.
stringify
(
params
)).
then
((
res
)
=>
{
state
.
loading
=
false
;
state
.
loading
=
false
;
...
...
src/store/modules/user/shiplist.js
0 → 100644
View file @
74d48874
import
Vue
from
'vue'
import
{
services
as
Services
,
productionUrlApi
}
from
'../../../api/index'
import
{
Dialog
,
Toast
}
from
'vant'
import
Util
from
"../../../util"
Vue
.
use
(
Dialog
);
var
qs
=
require
(
'qs'
);
const
state
=
{
loading
:
false
,
lists
:
{},
currentList
:
[],
isUpdateList
:
false
,
}
const
mutations
=
{
orderLists
(
state
,
payload
)
{
state
.
lists
[
payload
.
status
]
=
payload
.
data
state
.
currentList
=
payload
.
data
}
}
const
actions
=
{
//确认收货
sureSend1
({
commit
},
payload
)
{
state
.
loading
=
true
;
var
params
=
{
order_id
:
payload
.
order_id
}
Services
.
sureSend
(
qs
.
stringify
(
params
)).
then
((
res
)
=>
{
state
.
loading
=
false
;
Toast
(
res
.
data
.
err_msg
)
if
(
res
.
data
.
err_code
==
0
)
{
state
.
isUpdateList
=
true
}
}).
catch
(
function
(
err
)
{
state
.
loading
=
false
;
});
},
//获取订单列表
orderLists1
({
commit
},
payload
)
{
//当前状态数据加载过 且没有强制更新
//参数变动 数据清空
if
(
payload
.
isGet
)
{
this
.
state
.
lists
=
{}
}
if
(
state
.
lists
[
payload
.
status
]
&&
!
payload
.
isGet
)
{
//已经加载过
state
.
currentList
=
state
.
lists
[
payload
.
status
];
return
}
state
.
loading
=
true
;
var
params
=
{
p
:
1
,
limit
:
100
}
Object
.
keys
(
payload
).
forEach
((
item
)
=>
{
if
(
item
!=
"type"
&&
item
!=
"isGet"
)
{
params
[
item
]
=
payload
[
item
]
}
})
Services
.
orderLists
(
qs
.
stringify
(
params
)).
then
((
res
)
=>
{
let
data
=
res
.
data
;
state
.
loading
=
false
;
state
.
isUpdateList
=
false
commit
(
"orderLists"
,
{
data
:
data
.
data
.
list
||
[],
status
:
payload
.
status
,
})
}).
catch
(
function
(
err
)
{
state
.
loading
=
false
;
});
},
}
const
getters
=
{}
export
default
{
state
,
mutations
,
actions
,
getters
}
src/store/store.js
View file @
74d48874
...
@@ -24,6 +24,7 @@ import user from './modules/user/index'
...
@@ -24,6 +24,7 @@ import user from './modules/user/index'
import
coupon
from
'./modules/user/coupon'
import
coupon
from
'./modules/user/coupon'
import
userInfo
from
'./modules/user/userInfo'
import
userInfo
from
'./modules/user/userInfo'
import
userOrder
from
'./modules/user/order'
import
userOrder
from
'./modules/user/order'
import
shiplist
from
'./modules/user/shiplist'
import
orderDetail
from
'./modules/user/orderDetail'
import
orderDetail
from
'./modules/user/orderDetail'
import
message
from
'./modules/user/message'
import
message
from
'./modules/user/message'
...
@@ -73,6 +74,7 @@ export default new Vuex.Store({
...
@@ -73,6 +74,7 @@ export default new Vuex.Store({
coupon
,
coupon
,
address
,
address
,
userOrder
,
userOrder
,
shiplist
,
orderDetail
,
orderDetail
,
message
,
message
,
history
,
history
,
...
...
src/views/user/order.vue
View file @
74d48874
...
@@ -237,6 +237,7 @@
...
@@ -237,6 +237,7 @@
if
(
val
)
{
if
(
val
)
{
this
.
isGet
=
true
this
.
isGet
=
true
this
.
getData
()
this
.
getData
()
}
}
},
},
currentList
(
item
)
{
currentList
(
item
)
{
...
...
src/views/user/shiplist.vue
View file @
74d48874
...
@@ -101,10 +101,10 @@
...
@@ -101,10 +101,10 @@
},
},
computed
:
{
computed
:
{
...
mapState
({
...
mapState
({
loading
:
state
=>
state
.
userOrder
.
loading
,
loading
:
state
=>
state
.
shiplist
.
loading
,
lists
:
state
=>
state
.
userOrder
.
lists
,
lists
:
state
=>
state
.
shiplist
.
lists
,
currentList
:
state
=>
state
.
userOrder
.
currentList
,
currentList
:
state
=>
state
.
shiplist
.
currentList
,
isUpdateList
:
state
=>
state
.
userOrder
.
isUpdateList
,
isUpdateList
:
state
=>
state
.
shiplist
.
isUpdateList
,
}),
}),
...
@@ -223,7 +223,7 @@
...
@@ -223,7 +223,7 @@
.
then
(()
=>
{
.
then
(()
=>
{
// on confirm
// on confirm
var
datap
=
{
var
datap
=
{
type
:
'sureSend'
,
type
:
'sureSend
1
'
,
order_id
:
order_id
,
order_id
:
order_id
,
}
}
this
.
$store
.
dispatch
(
datap
)
this
.
$store
.
dispatch
(
datap
)
...
@@ -252,7 +252,7 @@
...
@@ -252,7 +252,7 @@
getData
()
{
getData
()
{
var
datap
=
{
var
datap
=
{
type
:
'orderLists'
,
type
:
'orderLists
1
'
,
status
:
this
.
orderStatus
,
status
:
this
.
orderStatus
,
isGet
:
this
.
isGet
||
""
//是否强制更新接口
isGet
:
this
.
isGet
||
""
//是否强制更新接口
...
...
view/46.js
View file @
74d48874
This diff is collapsed.
Click to expand it.
view/app.js
View file @
74d48874
This diff is collapsed.
Click to expand it.
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