Commit 5269f0ae by 肖康

购物车联营商城自营商城 H5迁移完成

parent cc3d423e
...@@ -65,15 +65,26 @@ export const apis = { ...@@ -65,15 +65,26 @@ export const apis = {
*/ */
cartCount: productionUrlApi + 'cart/count', cartCount: productionUrlApi + 'cart/count',
/** /**
* 去结算行为统计
*/
confirmBehavior: productionUrlApi + '/public/confirmBehavior',
/**
* 获取购物车列表 * 获取购物车列表
*/ */
cartList: productionUrlApi + 'cart/lists', cartList: productionUrlApi + 'cart/lists',
/**
* 删除购物车
*/
cartDelete: productionUrlApi + 'cart/delete',
/** /**
* 获取购物各种类型数量 * 获取购物各种类型数量
*/ */
allcount: productionUrlApi + 'cart/allcount', allcount: productionUrlApi + 'cart/allcount',
/** /**
* 改变购物车商品数量
*/
changenum: productionUrlApi + '/cart/changenum',
/**
* 客服统计处理 * 客服统计处理
*/ */
customsrService: productionUrlApi + 'public/customsrservice', customsrService: productionUrlApi + 'public/customsrservice',
...@@ -480,9 +491,19 @@ export const services = { ...@@ -480,9 +491,19 @@ export const services = {
cartList(params){ cartList(params){
return axios.post(apis.cartList,params) return axios.post(apis.cartList,params)
}, },
cartDelete(params){
return axios.post(apis.cartDelete,params)
},
allcount(params){ allcount(params){
return axios.post(apis.allcount,params) return axios.post(apis.allcount,params)
}, },
confirmBehavior(params){
return axios.post(apis.confirmBehavior,params)
},
changenum(params){
return axios.post(apis.changenum,params)
},
}; };
\ No newline at end of file
...@@ -136,6 +136,7 @@ ...@@ -136,6 +136,7 @@
.shop-but .sum p{ font-size: 12px; line-height: 16px;} .shop-but .sum p{ font-size: 12px; line-height: 16px;}
.shop-but .button{position: relative;} .shop-but .button{position: relative;}
.shop-but .button a{display: block; height: 44px; line-height: 44px; font-size: 16px; border-radius: 0; text-align: center; color: #fff; background:red} .shop-but .button a{display: block; height: 44px; line-height: 44px; font-size: 16px; border-radius: 0; text-align: center; color: #fff; background:red}
.shop-but .button.dis a{background: #ccc;}
.shop-but .button span{ font-size: 12px; } .shop-but .button span{ font-size: 12px; }
.shop-but .button .sxx{position: absolute;color:#1080d0;line-height: 44px;top:0px;left:-113%;background: #fff;display:none;} .shop-but .button .sxx{position: absolute;color:#1080d0;line-height: 44px;top:0px;left:-113%;background: #fff;display:none;}
.shop-but .checkallbox{line-height: 40px;padding-left:10px;box-sizing: border-box;} .shop-but .checkallbox{line-height: 40px;padding-left:10px;box-sizing: border-box;}
...@@ -283,4 +284,12 @@ ...@@ -283,4 +284,12 @@
border-width: 4px; border-width: 4px;
margin-left: 5px; margin-left: 5px;
} }
.dataNo{display: none;} .dataNo{display: none;}
\ No newline at end of file
/*微信购物车-空*/
.shop-empty{ padding: 25% 3% 10% 3%; text-align: center; }
.shop-empty dt{}
.shop-empty dt i{ font-size: 34px; }
.shop-empty dd{ padding-top: 5%; }
.shop-empty dd h4{ font-size: 16px; padding-bottom: 10%; font-weight: bold;}
.shop-empty dd p a{ font-size: 14px;color:#1080d0; }
\ No newline at end of file
.zl_Detail *{box-sizing:border-box;font-family:"Helvetica Neue", Helvetica, sans-serif}.zl_Detail .details-head .head_top{border-bottom:1px solid #d6d7dc;padding:10px}.zl_Detail .details-head .head_top .head_top_left{width:56px}.zl_Detail .details-head .head_top .head_top_left img{display:block;width:56px;height:56px;border:1px solid #e5e5e5}.zl_Detail .details-head .head_top .head_top_right{padding-left:66px}.zl_Detail .details-head .head_top .head_top_right h4{padding-bottom:10px;font-size:18px;color:#333333}.zl_Detail .details-head .head_bottom{border-bottom:1px solid #d6d7dc;padding:5px 10px}.zl_Detail .details-head .head_bottom li{width:50%;line-height:20px;height:20px;font-size:12px;color:#999}.zl_Detail .details-head .head_bottom li b{display:block;float:left;line-height:20px;height:20px;font-weight:400}.zl_Detail .details-head .head_bottom li span{color:#333;line-height:20px;height:20px;display:block;padding:0 5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zl_Detail .details-head .head_bottom li .f-orange{color:#ffa200;margin-left:5px}.zl_Detail .details-cont{position:absolute;top:149px;bottom:44px;width:100%;padding:10px;overflow-y:auto}.zl_Detail .details-cont .gradient{width:100%}.zl_Detail .details-cont .gradient table{width:100%;line-height:32px;font-size:12px;text-align:center;color:#666666;border:1px solid #d9d9d9}.zl_Detail .details-cont .gradient table .xs-6{width:50%}.zl_Detail .details-cont .gradient table .xs-4{width:33.33%}.zl_Detail .details-cont .gradient table .xs-3{width:25%}.zl_Detail .details-cont .gradient table th{border:1px solid #d9d9d9;font-weight:400;color:#666}.zl_Detail .details-cont .gradient table td{border:1px solid #d9d9d9;color:#333}.zl_Detail .details-cont .gradient .zkxk{font-size:12px;height:24px;line-height:24px;border:1px solid #e5e5e5;border-top:none;text-align:center;color:#666}.zl_Detail .details-cont .gradient .zkxk .icon-top{bottom:9px;position:relative;content:"";height:0;width:0;pointer-events:none;border:solid transparent;border-bottom-color:#4d4d4d;border-width:4px;margin-left:5px}.zl_Detail .details-cont .gradient .zkxk .icon-bot{top:9px;position:relative;content:"";height:0;width:0;pointer-events:none;border:solid transparent;border-top-color:#4d4d4d;border-width:4px;margin-left:5px}.zl_Detail .details-cont .price{padding-top:10px}.zl_Detail .details-cont .price .zyqhc{position:absolute;width:4.5333333333rem;height:.9333333333rem;color:#999;font-size:.2666666667rem;border:1px solid #ffa200;left:130px;line-height:.3733333333rem;padding:.0666666667rem;box-shadow:0px 0px 3px #ffd07f;border-radius:3px}.zl_Detail .details-cont .price .zyqhc .lfldiv{width:.4rem}.zl_Detail .details-cont .price .zyqhc .lfldiv font{position:relative;font-size:.2933333333rem;margin-right:.0666666667rem}.zl_Detail .details-cont .price .zyqhc .lfrdiv{width:3.8666666667rem}.zl_Detail .details-cont .price .bbiu{display:inline-block;position:absolute;border-width:6px;border-style:solid;border-color:transparent #ffa200 transparent transparent;left:118px;top:.2rem}.zl_Detail .details-cont .price .bbiu1{display:inline-block;position:absolute;border-width:6px;border-style:solid;border-color:transparent #fff transparent transparent;left:120px;top:.2rem}.zl_Detail .details-cont .price .em1{padding:0 0.5em}.zl_Detail .details-cont .price dl{font-size:12px}.zl_Detail .details-cont .price dl dt{width:5em;color:#999;float:left;line-height:30px}.zl_Detail .details-cont .price dl dd{padding-left:5em;color:#333;line-height:30px}.zl_Detail .details-cont .price dl dd.onePrice{font-size:14px}.zl_Detail .details-cont .price dl dd.totalPrice{font-weight:bold;color:red;font-size:14px}.zl_Detail .details-cont .price dl dd.tab span{display:block;float:left;margin:2px 10px 0 0;color:#333;height:23px;line-height:22px;padding:0 10px;border:1px solid #d9d9d9;border-radius:3px;background:#fff}.zl_Detail .details-cont .price dl dd.tab span.act{color:#e10601;border-color:#e10601}.zl_Detail .details-cont .price dl dd.tab span.act-blue{color:#1080d0;border-color:#1080d0}.zl_Detail .details-cont .price dl dd .number{float:left;width:118px;height:30px;border:1px solid #d9d9d9;border-radius:3px;background:#fff;position:relative}.zl_Detail .details-cont .price dl dd .number i{cursor:pointer;height:28px;width:28px;text-align:center;line-height:28px;display:block;float:left;background:none;color:#999999;font-size:18px}.zl_Detail .details-cont .price dl dd .number input{text-align:center;float:left;padding:4px 5px;line-height:20px;height:28px;width:60px;background:none;color:#333333;font-size:12px;border:none;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5}.zl_Detail .details-foot{height:43px;border-top:1px solid #d6d7dc;width:100%;position:absolute;bottom:0}.zl_Detail .details-foot span{width:50%;display:block;float:left;height:43px;line-height:43px;font-size:14px;color:#fff;text-decoration:none;text-align:center;border:none}.zl_Detail .details-foot span.but-blue{background:#1080d0}.zl_Detail .details-foot span.but-red{background:#e10601}
/*# sourceMappingURL=zyly.min.css.map */
{
"version": 3,
"mappings": "AAKE,YAAE,CACA,UAAU,CAAE,UAAU,CACtB,WAAW,CAAE,uCAAuC,CAIpD,kCAAU,CACR,aAAa,CAAE,iBAAiB,CAChC,OAAO,CAAE,IAAI,CAEb,iDAAe,CACb,KAAK,CAAE,IAAI,CAEX,qDAAI,CACF,OAAO,CAAE,KAAK,CACd,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,IAAI,CACZ,MAAM,CAAE,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=> { ...@@ -55,3 +55,35 @@ export const dateTimeFormate = (value, params) => {
var s = time.getSeconds(); var s = time.getSeconds();
return y + '-' + timeAdd0(m) + '-' + timeAdd0(d) + ' ' + timeAdd0(h) + ':' + timeAdd0(mm) + ':' + timeAdd0(s); return y + '-' + timeAdd0(m) + '-' + timeAdd0(d) + ' ' + timeAdd0(h) + ':' + timeAdd0(mm) + ':' + timeAdd0(s);
} }
/**数字编码**/
export const numberCode = (value, params) => {
var str=String(value);
if (str && str.indexOf("font") != -1) {
var sff = (str.split('class="'));
sff.shift();
var numb = "";
var listb = [
['asfgdqwer', 'asfgdtyhg', 'asfgdpolk', 'asfgdpoqw'],
['asfgdrfdf', 'asfgderfd', 'asfgdwdsa', 'asfgdpoer'],
['asfgdasde', 'asfgdqwsz', 'asfgdrtgd', 'asfgdpovv'],
['asfgdwsxc', 'asfgdwsxz', 'asfgdrfvb', 'asfgdpoee'],
['asfgdqazs', 'asfgdqasd', 'asfgdqwag', 'asfgdpogh'],
['asfgdrtyh', 'asfgdyutr', 'asfgdeews', 'asfgdpotg'],
['asfgdpluj', 'asfgdikjf', 'asfgdesgj', 'asfgdpfff'],
['asfgdtrdb', 'asfgdiksf', 'asfgdsgkp', 'asfgdprty'],
['asfgdpehl', 'asfgdstgb', 'asfgderll', 'asfgdpokf'],
['asfgdpehg', 'asfgdstgf', 'asfgderlf', 'asfgdpogk']
];
for (var i = 0; i < sff.length; i++) {
var ghjk = sff[i].split(" ")[0];
for (var j = 0; j < listb.length; j++) {
if (listb[j].indexOf(ghjk) != -1) {
numb += j;
}
}
}
return Number(numb)
}else{
return Number(str)
}
}
import {dateTimeFormate, urlParams,urlPatg,urlEncode} from './formate'; import {dateTimeFormate, urlParams,urlPatg,urlEncode,numberCode} from './formate';
export default { export default {
dateTimeFormate, dateTimeFormate,
urlParams, urlParams,
urlPatg, urlPatg,
urlEncode urlEncode,
numberCode
}; };
...@@ -6,6 +6,7 @@ Vue.use(Toast); ...@@ -6,6 +6,7 @@ Vue.use(Toast);
var qs = require('qs'); var qs = require('qs');
const state = { const state = {
loading:false, loading:false,
loading1:false,
ly1:false,//联营大陆得到数据防止切换多次请求 ly1:false,//联营大陆得到数据防止切换多次请求
ly2:false,//联营香港得到数据防止切换多次请求 ly2:false,//联营香港得到数据防止切换多次请求
zy1:false,//自营得到数据防止切换多次请求 zy1:false,//自营得到数据防止切换多次请求
...@@ -19,7 +20,8 @@ const state = { ...@@ -19,7 +20,8 @@ const state = {
ly1LoseData:[], ly1LoseData:[],
ly2LoseData:[], ly2LoseData:[],
zy1LoseData:[], zy1LoseData:[],
priceInit:false,
totlaMState:false
} }
const mutations = { const mutations = {
...@@ -53,19 +55,16 @@ const mutations = { ...@@ -53,19 +55,16 @@ const mutations = {
var arr_=payload.data.list; var arr_=payload.data.list;
for(var i=0;i<arr_.length;i++){ for(var i=0;i<arr_.length;i++){
arr_[i].editState=false; arr_[i].editState=false;
if(arr_[i].sale_type==2){
//期货 //默认不勾选
arr_[i].check=false;
}else{
//现货默认勾选
arr_[i].check=true;
}
if(arr_[i].status==-1){ if(arr_[i].status==-1){
state.zy1LoseData.push(arr_[i]); state.zy1LoseData.push(arr_[i]);
}else{ }else{
if(arr_[i].sale_type==1){ if(arr_[i].sale_type==1){
//现货默认勾选
arr_[i].check=true;
state.zy1Data.push(arr_[i]); state.zy1Data.push(arr_[i]);
}else{ }else{
//期货 //默认不勾选
arr_[i].check=false;
state.zy2Data.push(arr_[i]) state.zy2Data.push(arr_[i])
} }
...@@ -73,12 +72,105 @@ const mutations = { ...@@ -73,12 +72,105 @@ const mutations = {
} }
} }
},
cartDelete(state,payload){
var ids=payload.cart_id.split(",");
if(payload.types==1){
//联营
if(payload.act=='normal'){
//删除操作
var datalistp=payload.delivery==1?state.ly1Data:state.ly2Data;
for(var i=0;i<datalistp.length;i++){
for(var j=0;j<ids.length;j++){
if(datalistp[i].cart_id==ids[j]){
datalistp.splice(i,1);
}
}
}
if(payload.delivery==1){
state.ly1Data=datalistp;
state.ly1Length=Number(state.ly1Length)-ids.length;
}else{
state.ly2Data=datalistp;
state.ly2Length=Number(state.ly2Length)-ids.length;
}
}else{
//清除过期数据
if(payload.delivery==1){
state.ly1LoseData=[];
}else{
state.ly2LoseData=[];
}
}
}else{
//自营
if(payload.act=='normal'){
//删除
for(var i=0;i<state.zy1Data.length;i++){
for(var j=0;j<ids.length;j++){
if(state.zy1Data[i].cart_id==ids[j]){
state.zy1Data.splice(i,1);
}
}
}
for(var ii=0;ii<state.zy2Data.length;i++){
for(var jj=0;jj<ids.length;jj++){
if(state.zy2Data[ii].cart_id==ids[jj]){
state.zy2Data.splice(ii,1);
}
}
}
state.zy1Length=Number(state.zy1Length)-ids.length;
}else{
//清除过期数据
state.zy1LoseData=[];
}
}
},
changenum(state,payload){
if(payload.delivery_place==1||payload.delivery_place==2){
//大陆//香港
var list_=payload.delivery_place==1?state.ly1Data:state.ly2Data;
for(var i=0;i<list_.length;i++){
if(list_[i].cart_id==payload.cart_id){
list_[i].goods_number=payload.data.num;
list_[i].goods_amount=payload.data.goods_amount;
list_[i].goods_amount_format=payload.data.goods_amount_format;
list_[i].goods_price=payload.data.goods_price;
list_[i].goods_price_format=payload.data.goods_price_format;
}
}
}else{
//自营
var list_1=state.zy1Data,list_2=state.zy2Data;
for(var i=0;i<list_1.length;i++){
if(list_1[i].cart_id==payload.cart_id){
list_1[i].goods_number=payload.data.num;
list_1[i].goods_amount=payload.data.goods_amount;
list_1[i].goods_amount_format=payload.data.goods_amount_format;
list_1[i].goods_price=payload.data.goods_price;
list_1[i].goods_price_format=payload.data.goods_price_format;
}
}
for(var j=0;j<list_2.length;j++){
if(list_2[j].cart_id==payload.cart_id){
list_2[j].goods_number=payload.data.num;
list_2[j].goods_amount=payload.data.goods_amount;
list_2[j].goods_amount_format=payload.data.goods_amount_format;
list_2[j].goods_price=payload.data.goods_price;
list_2[j].goods_price_format=payload.data.goods_price_format;
}
}
}
state.totlaMState=true;
} }
} }
const actions = { const actions = {
cartList({commit},payload){ cartList({commit},payload){
state.loading=true; state.loading=true;
state.loading1=true;
var params = { var params = {
delivery_place: payload.delivery_place, delivery_place: payload.delivery_place,
order_goods_type: payload.order_goods_type order_goods_type: payload.order_goods_type
...@@ -90,8 +182,8 @@ const actions = { ...@@ -90,8 +182,8 @@ const actions = {
types_=payload.delivery_place; types_=payload.delivery_place;
} }
Services.cartList(qs.stringify(params)).then((res) => { Services.cartList(qs.stringify(params)).then((res) => {
console.log(types_)
state.loading=false; state.loading=false;
state.loading1=false;
let data = res.data; let data = res.data;
if(types_==1){ if(types_==1){
//大陆 //大陆
...@@ -110,13 +202,14 @@ const actions = { ...@@ -110,13 +202,14 @@ const actions = {
types_:types_ types_:types_
}); });
}else { }else {
Toast({ // Toast({
message: data.err_msg, // message: data.err_msg,
duration: 3000 // duration: 3000
}); // });
} }
}).catch(function (err) { }).catch(function (err) {
state.loading = false; state.loading = false;
state.loading1=false;
}); });
}, },
allcount({commit},payload){ allcount({commit},payload){
...@@ -128,7 +221,76 @@ const actions = { ...@@ -128,7 +221,76 @@ const actions = {
state.zy1Length=Number(data.data['2']['1']||0); state.zy1Length=Number(data.data['2']['1']||0);
} }
}) })
} },
cartDelete({commit},payload){
state.loading=true;
var params = {
cart_id: payload.cart_id,
act: payload.act
}
Services.cartDelete(qs.stringify(params)).then((res) => {
state.loading=false;
let data = res.data;
if (data.err_code == 0) {
commit({
type: 'cartDelete',
data: data.data,
act:payload.act,
cart_id:payload.cart_id,
types:payload.types,
delivery:payload.delivery
});
}else {
Toast({
message: data.err_msg,
duration: 3000
});
}
}).catch(function (err) {
state.loading = false;
});
},
confirmBehavior({commit},payload){
state.loading=true;
Services.confirmBehavior().then((res) => {
state.loading=false;
window.location.href=payload.url_;
}).catch(function (err) {
state.loading = false;
});
},
changenum({commit},payload){
//state.loading=true;
var params = {
cart_id: payload.cart_id,
num: payload.num,
delivery_place: payload.delivery_place
}
state.totlaMState=false;
Services.changenum(qs.stringify(params)).then((res) => {
//state.loading=false;
let data = res.data;
if (data.err_code == 0) {
commit({
type: 'changenum',
data: data.data,
cart_id: payload.cart_id,
delivery_place: payload.delivery_place
});
}else {
Toast({
message: data.err_msg,
duration: 3000
});
}
}).catch(function (err) {
state.loading = false;
});
},
} }
......
...@@ -170,6 +170,7 @@ export default { ...@@ -170,6 +170,7 @@ export default {
* / * /
*/ */
aggxde(str){ aggxde(str){
var str=String(str);
if (str && str.indexOf("font") != -1) { if (str && str.indexOf("font") != -1) {
var sff = (str.split('class="')); var sff = (str.split('class="'));
sff.shift(); sff.shift();
...@@ -195,6 +196,8 @@ export default { ...@@ -195,6 +196,8 @@ export default {
} }
} }
return Number(numb) return Number(numb)
}else{
return Number(str)
} }
} }
......
...@@ -106,6 +106,13 @@ export default { ...@@ -106,6 +106,13 @@ export default {
this.scrollFn(); this.scrollFn();
} }
}, },
created(){
if(this.carshow){
this.$store.dispatch({
type: 'cartCount'
})
}
},
methods: { methods: {
customsrService() { customsrService() {
this.$store.dispatch({ this.$store.dispatch({
......
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