Commit e804b2d7 by 施宇

Merge branch 'h5_zyly_vue_0517' of http://119.23.72.7/liangjianmin/h5 into h5_zyly_vue_0517

# Conflicts:
#	src/api/index.js
parents 93b8acc2 0d63a486
...@@ -65,6 +65,15 @@ export const apis = { ...@@ -65,6 +65,15 @@ export const apis = {
*/ */
cartCount: productionUrlApi + 'cart/count', cartCount: productionUrlApi + 'cart/count',
/** /**
* 获取购物车列表
*/
cartList: productionUrlApi + 'cart/lists',
/**
* 获取购物各种类型数量
*/
allcount: productionUrlApi + 'cart/allcount',
/**
* 客服统计处理 * 客服统计处理
*/ */
customsrService: productionUrlApi + 'public/customsrservice', customsrService: productionUrlApi + 'public/customsrservice',
...@@ -467,6 +476,13 @@ export const services = { ...@@ -467,6 +476,13 @@ export const services = {
}, },
addGood(params){ addGood(params){
return axios.post(apis.addGood,params) return axios.post(apis.addGood,params)
} },
cartList(params){
return axios.post(apis.cartList,params)
},
allcount(params){
return axios.post(apis.allcount,params)
},
}; };
\ No newline at end of file
...@@ -2,35 +2,12 @@ ...@@ -2,35 +2,12 @@
color:#333; color:#333;
.lxBox{ .lxBox{
padding-bottom: 44px; padding-bottom: 44px;
.lyNav{
color:#333;
position: fixed;
left:0px;
top:44px;
right:0px;
height:44px;
border-bottom:1px solid #d6d7dc;
z-index:3;
background-color: #fff;
box-sizing: border-box;
span{
cursor: pointer;
width:50%;
box-sizing: border-box;
font-size: 14px;
text-align: center;
line-height: 44px;
font{color:#333;}
&.act{
color:#1080d0;
}
}
}
.logintip{ .logintip{
top:88px; top:88px;
} }
.dataBox{ .dataBox{
padding-top: 44px; padding-top: 88px;
} }
} }
.zyBox{ .zyBox{
...@@ -48,7 +25,7 @@ ...@@ -48,7 +25,7 @@
} }
.dataBox{ .dataBox{
padding-top: 44px; padding-top: 88px;
} }
} }
...@@ -97,6 +74,30 @@ ...@@ -97,6 +74,30 @@
} }
a{color:#1080d0;font-size: 14px;} a{color:#1080d0;font-size: 14px;}
} }
.lyNav{
color:#333;
position: fixed;
left:0px;
top:44px;
right:0px;
height:44px;
border-bottom:1px solid #d6d7dc;
z-index:3;
background-color: #fff;
box-sizing: border-box;
span{
cursor: pointer;
width:50%;
box-sizing: border-box;
font-size: 14px;
text-align: center;
line-height: 44px;
font{color:#333;}
&.act{
color:#1080d0;
}
}
}
} }
.shop-block{ font-size: 12px;border-bottom: 1px solid #d6d7dc;} .shop-block{ font-size: 12px;border-bottom: 1px solid #d6d7dc;}
...@@ -117,10 +118,8 @@ ...@@ -117,10 +118,8 @@
.shop-block .add-num .mui-numbox input{ height: 28px; background: #fff; color: #333; font-size: 12px;box-sizing: border-box;} .shop-block .add-num .mui-numbox input{ height: 28px; background: #fff; color: #333; font-size: 12px;box-sizing: border-box;}
.shop-block .subtotal{padding: 2% 3%; font-weight: bold; text-align: right; } .shop-block .subtotal{padding: 2% 3%; font-weight: bold; text-align: right; }
.shop-block .morePrice{ margin-bottom: 15px; } .shop-block .morePrice{ margin-bottom: 15px; }
.shop-block .morePrice p{font-size: 12px; color: #999;}
.shop-block .morePrice .list_data{display: none;}
.shop-block .morePrice .list_data.act p.mui-col-xs-4{ color: red!important; }
.shop-block .morePrice .list_data.act p.f-throug{color: red!important;}
.shop-block .more-height{ font-size: 12px; margin-right: 10%; height: 24px;margin-top: 5px; line-height:24px; border: 1px solid #e5e5e5; text-align: center; color: #666; } .shop-block .more-height{ font-size: 12px; margin-right: 10%; height: 24px;margin-top: 5px; line-height:24px; border: 1px solid #e5e5e5; text-align: center; color: #666; }
.shop-block .more-height .iconfont{ font-size: 10px; margin-left: 5px; } .shop-block .more-height .iconfont{ font-size: 10px; margin-left: 5px; }
.shop-lose{ color: #999999; } .shop-lose{ color: #999999; }
...@@ -260,3 +259,28 @@ ...@@ -260,3 +259,28 @@
box-sizing: border-box; box-sizing: border-box;
margin: 2px 8px; margin: 2px 8px;
} }
.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;
}
.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;
}
.dataNo{display: none;}
\ No newline at end of file
...@@ -179,6 +179,7 @@ $imgUrl: '../images/'; ...@@ -179,6 +179,7 @@ $imgUrl: '../images/';
align-items: center; align-items: center;
justify-content: center; justify-content: center;
color:#fff; color:#fff;
a{color:#fff;}
.icon-xiangshang1 { .icon-xiangshang1 {
color: #fff; color: #fff;
font-size: 28px; font-size: 28px;
......
...@@ -5,37 +5,110 @@ import {services as Services} from '../../../api/index' ...@@ -5,37 +5,110 @@ 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:[],//自营数据现货
zy2Data:[],//自营数据期货
ly1Length:0,
ly2Length:0,
zy1Length:0,//自营数据总长度
ly1LoseData:[],
ly2LoseData:[],
zy1LoseData:[],
} }
const mutations = { const mutations = {
cartList(state, payload) {
if(payload.types_==1){
//大陆
var arr_=payload.data.list;
for(var i=0;i<arr_.length;i++){
arr_[i].editState=false;
arr_[i].check=true;
if(arr_[i].status==-1){
state.ly1LoseData.push(arr_[i]);
}else{
state.ly1Data.push(arr_[i])
}
}
}else if(payload.types_==2){
//香港
var arr_=payload.data.list;
for(var i=0;i<arr_.length;i++){
arr_[i].editState=false;
arr_[i].check=true;
if(arr_[i].status==-1){
state.ly2LoseData.push(arr_[i]);
}else{
state.ly2Data.push(arr_[i])
}
}
}else{
//自营
var arr_=payload.data.list;
for(var i=0;i<arr_.length;i++){
arr_[i].editState=false;
if(arr_[i].sale_type==2){
//期货 //默认不勾选
arr_[i].check=false;
}else{
//现货默认勾选
arr_[i].check=true;
}
if(arr_[i].status==-1){
state.zy1LoseData.push(arr_[i]);
}else{
if(arr_[i].sale_type==1){
state.zy1Data.push(arr_[i]);
}else{
state.zy2Data.push(arr_[i])
}
}
}
}
}
} }
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
} }
Services.smsVerify(qs.stringify(params)).then((res) => { var types_;
if(payload.order_goods_type==2){
types_=3;
}else{
types_=payload.delivery_place;
}
Services.cartList(qs.stringify(params)).then((res) => {
console.log(types_)
state.loading=false; state.loading=false;
state.formImgShow=false;
let data = res.data; let data = res.data;
if(types_==1){
//大陆
state.ly1=true;
}else if(types_==2){
//香港
state.ly2=true;
}else{
//自营
state.zy1=true;
}
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,
...@@ -45,7 +118,18 @@ const actions = { ...@@ -45,7 +118,18 @@ const actions = {
}).catch(function (err) { }).catch(function (err) {
state.loading = false; state.loading = false;
}); });
},
allcount({commit},payload){
Services.allcount().then((res) => {
let data = res.data;
if (data.err_code == 0) {
state.ly1Length=Number(data.data['1']['1']||0);
state.ly2Length=Number(data.data['1']['2']||0);
state.zy1Length=Number(data.data['2']['1']||0);
} }
})
}
} }
const getters = {} const getters = {}
......
import Vue from 'vue'
export default new Vue
\ No newline at end of file
...@@ -88,7 +88,17 @@ ...@@ -88,7 +88,17 @@
</div> </div>
</div> </div>
<div class="but-shop"> <div class="but-shop">
<a class="but" @click="placeOrder(itemchild.goods_id)">我要下单</a> <template v-if="isZy">
<a class="but" v-if="itemchild.is_buy==1" @click="placeOrder(itemchild.goods_id)">我要下单</a>
<a class="but but-orange" v-else @click="xunjia">立即询价</a>
</template>
<template v-else="isZy">
<a class="but" v-if="itemchild.is_buy==1" @click="placeOrder(itemchild.goods_id)">我要下单</a>
<a class="but but-orange" v-else-if="itemchild.is_buy==0" @click="xunjia">立即询价</a>
<a class="but but-orange" v-else-if="itemchild.is_buy==3" @click="xunjia">确认库存信息</a>
</template>
</div> </div>
</div> </div>
</div> </div>
...@@ -97,6 +107,7 @@ ...@@ -97,6 +107,7 @@
<script> <script>
import Vue from "vue"; import Vue from "vue";
import { Lazyload } from "vant"; import { Lazyload } from "vant";
import bus from '../../util/bus.js'
Vue.use(Lazyload); Vue.use(Lazyload);
export default { export default {
name: "GoodsOne", name: "GoodsOne",
...@@ -140,6 +151,9 @@ export default { ...@@ -140,6 +151,9 @@ export default {
}, },
placeOrder(id) { placeOrder(id) {
this.$emit("placeOrder", id); this.$emit("placeOrder", id);
},
xunjia(){
bus.$emit('xunjia')
} }
}, },
components: {} components: {}
...@@ -274,7 +288,6 @@ export default { ...@@ -274,7 +288,6 @@ export default {
height: 30px; height: 30px;
float: right; float: right;
line-height: 30px; line-height: 30px;
padding: 0 20px;
width: 100px; width: 100px;
font-size: 14px; font-size: 14px;
display: block; display: block;
...@@ -284,6 +297,9 @@ export default { ...@@ -284,6 +297,9 @@ export default {
cursor: pointer; cursor: pointer;
box-sizing: border-box; box-sizing: border-box;
border-radius: 4px; border-radius: 4px;
&.but-orange{
background: #ffa200;
}
} }
} }
.more-height, .more-height,
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<i class="icon iconfont icon-xiangzuo fl" @click="historyback"></i> <i class="icon iconfont icon-xiangzuo fl" @click="historyback"></i>
<div v-if="isCar"> <div v-if="isCar">
<div class="car-title clr"> <div class="car-title clr">
<span class="fl" :class="{'act':(type==1)}" @click="listTab(1)" v-back-top-window>联营(<font>0</font>)</span> <span class="fl" :class="{'act':(type==1)}" @click="listTab(1)" v-back-top-window>联营(<font>{{ly1Length+ly2Length}}</font>)</span>
<span class="fl" :class="{'act':(type==2)}" @click="listTab(2)" v-back-top-window>自营(<font>0</font>)</span> <span class="fl" :class="{'act':(type==2)}" @click="listTab(2)" v-back-top-window>自营(<font>{{zy1Length}}</font>)</span>
</div> </div>
</div> </div>
<div class="search" v-else-if="inputShow"> <div class="search" v-else-if="inputShow">
...@@ -27,6 +27,18 @@ export default { ...@@ -27,6 +27,18 @@ export default {
type: String, type: String,
default: "" default: ""
}, },
zy1Length: {
type: Number,
default:0
},
ly1Length: {
type: Number,
default: 0
},
ly2Length: {
type: Number,
default:0
},
bgcolor:{ bgcolor:{
type: String, type: String,
default: "#f3f3f3" default: "#f3f3f3"
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
<i class="iconfont icon-kefu"></i> <i class="iconfont icon-kefu"></i>
</div> </div>
<div class="backtop carslide" v-if="carshow"> <div class="backtop carslide" v-if="carshow">
<a href="/v3/joincart" >
<i class="iconfont icon-gouwuche1"></i> <i class="iconfont icon-gouwuche1"></i>
<b class="carNumx">{{cartCount}}</b> <b class="carNumx">{{cartCount}}</b>
</a>
</div> </div>
<template v-if="isWindow"> <template v-if="isWindow">
<div class="backtop " v-backTopWindow v-show="show"> <div class="backtop " v-backTopWindow v-show="show">
...@@ -57,6 +59,7 @@ ...@@ -57,6 +59,7 @@
import { mapState } from "vuex"; import { mapState } from "vuex";
import Vue from "vue"; import Vue from "vue";
import { Dialog } from "vant"; import { Dialog } from "vant";
import bus from '../../util/bus.js'
Vue.use(Dialog); Vue.use(Dialog);
...@@ -76,6 +79,13 @@ export default { ...@@ -76,6 +79,13 @@ export default {
default: false default: false
} }
}, },
created(){
var self=this;
bus.$on('xunjia',function(){
self.recordFn()
})
},
data() { data() {
return { return {
flag: false, flag: false,
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</div> </div>
</div> </div>
<van-loading type="spinner" color="#000" class="loading-background" v-if="loading"/> <van-loading type="spinner" color="#000" class="loading-background" v-if="loading"/>
<SideBar :isWindow="isWindow" :carshow="carshow"></SideBar> <SideBar :isWindow="isWindow" :carshow="carshow" ></SideBar>
<goodsDetail :detailsData="detailsData"></goodsDetail> <goodsDetail :detailsData="detailsData"></goodsDetail>
</section> </section>
</template> </template>
...@@ -213,6 +213,7 @@ ...@@ -213,6 +213,7 @@
} }
} }
} }
}, },
components: { components: {
Header, Header,
......
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