Commit b7e55d83 by 肖康

parent e2d11126
...@@ -65,6 +65,10 @@ export const apis = { ...@@ -65,6 +65,10 @@ export const apis = {
*/ */
cartCount: productionUrlApi + 'cart/count', cartCount: productionUrlApi + 'cart/count',
/** /**
* 获取购物车列表
*/
cartList: productionUrlApi + 'cart/lists',
/**
* 客服统计处理 * 客服统计处理
*/ */
customsrService: productionUrlApi + 'public/customsrservice', customsrService: productionUrlApi + 'public/customsrservice',
...@@ -462,6 +466,8 @@ export const services = { ...@@ -462,6 +466,8 @@ export const services = {
}, },
defaultClass(params){ defaultClass(params){
return axios.post(apis.defaultClass,params) return axios.post(apis.defaultClass,params)
} },
cartList(params){
return axios.post(apis.cartList,params)
},
}; };
\ No newline at end of file
...@@ -5,37 +5,54 @@ import {services as Services} from '../../../api/index' ...@@ -5,37 +5,54 @@ import {services as Services} from '../../../api/index'
Vue.use(Toast); Vue.use(Toast);
var qs = require('qs'); var qs = require('qs');
const state = { const state = {
loading:false loading:false,
ly1:false,//联营大陆得到数据防止切换多次请求
ly2:false,//联营香港得到数据防止切换多次请求
zy1:false,//自营得到数据防止切换多次请求
ly1Data:[],//大陆数据
ly2Data:[],//香港数据
zy1Data:[],//自营数据
} }
const mutations = { 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 = { const actions = {
chainSmsVerify({commit},payload){ cartList({commit},payload){
state.loading=true; state.loading=true;
state.formCodeStatus=false;
var params = { var params = {
verify: payload.verify, delivery_place: payload.delivery_place,
mobile: payload.mobile 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.loading=false;
state.formImgShow=false;
let data = res.data; let data = res.data;
if (data.err_code == 0) { if (data.err_code == 0) {
state.formCodeStatus=true; commit({
Toast({ type: 'cartList',
message: data.err_msg, data: data.data,
duration: 2000 types_:types_
});
}else if(data.err_code==23019||data.err_code==11008||data.err_code==11011){
Toast({
message: data.err_msg,
duration: 2000
}); });
state['formImgShow']=true;
}else { }else {
Toast({ Toast({
message: data.err_msg, message: data.err_msg,
......
...@@ -523,6 +523,7 @@ ...@@ -523,6 +523,7 @@
<span class="f-blue fr clearbtn">清除失效商品</span> <span class="f-blue fr clearbtn">清除失效商品</span>
</div> </div>
</div> </div>
<van-loading type="spinner" color="#000" class="loading-background" v-if="loading"/>
</div> </div>
</template> </template>
...@@ -550,10 +551,20 @@ ...@@ -550,10 +551,20 @@
} }
}, },
computed:{ 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(){ created(){
this.loginTip(); this.loginTip();
this.getData();
}, },
watch:{ watch:{
...@@ -602,6 +613,13 @@ ...@@ -602,6 +613,13 @@
// } // }
console.log(type) console.log(type)
}, },
getData:function(){
this.$store.dispatch({
type: 'cartList',
delivery_place:this.delivery,
order_goods_type: this.type
})
},
deliveryTab:function(delivery){ deliveryTab:function(delivery){
this.delivery=delivery; this.delivery=delivery;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment