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
b7e55d83
authored
May 23, 2019
by
肖康
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
想
parent
e2d11126
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
20 deletions
src/api/index.js
src/store/modules/car/index.js
src/views/car/car.vue
src/api/index.js
View file @
b7e55d83
...
...
@@ -65,6 +65,10 @@ export const apis = {
*/
cartCount
:
productionUrlApi
+
'cart/count'
,
/**
* 获取购物车列表
*/
cartList
:
productionUrlApi
+
'cart/lists'
,
/**
* 客服统计处理
*/
customsrService
:
productionUrlApi
+
'public/customsrservice'
,
...
...
@@ -462,6 +466,8 @@ export const services = {
},
defaultClass
(
params
){
return
axios
.
post
(
apis
.
defaultClass
,
params
)
}
},
cartList
(
params
){
return
axios
.
post
(
apis
.
cartList
,
params
)
},
};
\ No newline at end of file
src/store/modules/car/index.js
View file @
b7e55d83
...
...
@@ -5,37 +5,54 @@ import {services as Services} from '../../../api/index'
Vue
.
use
(
Toast
);
var
qs
=
require
(
'qs'
);
const
state
=
{
loading
:
false
loading
:
false
,
ly1
:
false
,
//联营大陆得到数据防止切换多次请求
ly2
:
false
,
//联营香港得到数据防止切换多次请求
zy1
:
false
,
//自营得到数据防止切换多次请求
ly1Data
:[],
//大陆数据
ly2Data
:[],
//香港数据
zy1Data
:[],
//自营数据
}
const
mutations
=
{
cartList
(
state
,
payload
)
{
if
(
payload
.
types_
==
1
){
state
.
ly1
=
true
;
//大陆
}
else
if
(
payload
.
types_
==
2
){
state
.
ly2
=
true
;
//香港
}
else
{
//自营
state
.
zy1
=
true
;
}
}
}
const
actions
=
{
c
hainSmsVerify
({
commit
},
payload
){
c
artList
({
commit
},
payload
){
state
.
loading
=
true
;
state
.
formCodeStatus
=
false
;
var
params
=
{
verify
:
payload
.
verify
,
mobile
:
payload
.
mobile
delivery_place
:
payload
.
delivery_place
,
order_goods_type
:
payload
.
order_goods_type
}
var
types_
=
1
;
if
(
payload
.
order_goods_type
==
1
){
types_
=
3
;
}
else
{
if
(
payload
.
delivery_place
==
2
){
types_
=
2
}
}
Services
.
smsVerify
(
qs
.
stringify
(
params
)).
then
((
res
)
=>
{
Services
.
cartList
(
qs
.
stringify
(
params
)).
then
((
res
)
=>
{
state
.
loading
=
false
;
state
.
formImgShow
=
false
;
let
data
=
res
.
data
;
if
(
data
.
err_code
==
0
)
{
state
.
formCodeStatus
=
true
;
Toast
({
message
:
data
.
err_msg
,
duration
:
2000
});
}
else
if
(
data
.
err_code
==
23019
||
data
.
err_code
==
11008
||
data
.
err_code
==
11011
){
Toast
({
message
:
data
.
err_msg
,
duration
:
2000
commit
({
type
:
'cartList'
,
data
:
data
.
data
,
types_
:
types_
});
state
[
'formImgShow'
]
=
true
;
}
else
{
Toast
({
message
:
data
.
err_msg
,
...
...
src/views/car/car.vue
View file @
b7e55d83
...
...
@@ -523,6 +523,7 @@
<span
class=
"f-blue fr clearbtn"
>
清除失效商品
</span>
</div>
</div>
<van-loading
type=
"spinner"
color=
"#000"
class=
"loading-background"
v-if=
"loading"
/>
</div>
</
template
>
...
...
@@ -550,10 +551,20 @@
}
},
computed
:{
...
mapState
({
loading
:
state
=>
state
.
car
.
loading
,
ly1
:
state
=>
state
.
car
.
ly1
,
ly2
:
state
=>
state
.
car
.
ly2
,
zy1
:
state
=>
state
.
car
.
zy1
,
ly1Data
:
state
=>
state
.
car
.
ly1Data
,
ly2Data
:
state
=>
state
.
car
.
ly2Data
,
zy1Data
:
state
=>
state
.
car
.
zy1Data
,
})
},
created
(){
this
.
loginTip
();
this
.
getData
();
},
watch
:{
...
...
@@ -602,6 +613,13 @@
// }
console
.
log
(
type
)
},
getData
:
function
(){
this
.
$store
.
dispatch
({
type
:
'cartList'
,
delivery_place
:
this
.
delivery
,
order_goods_type
:
this
.
type
})
},
deliveryTab
:
function
(
delivery
){
this
.
delivery
=
delivery
;
}
...
...
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