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 = {
*/
cartCount: productionUrlApi + 'cart/count',
/**
* 获取购物车列表
*/
cartList: productionUrlApi + 'cart/lists',
/**
* 获取购物各种类型数量
*/
allcount: productionUrlApi + 'cart/allcount',
/**
* 客服统计处理
*/
customsrService: productionUrlApi + 'public/customsrservice',
......@@ -467,6 +476,13 @@ export const services = {
},
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 @@
color:#333;
.lxBox{
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{
top:88px;
}
.dataBox{
padding-top: 44px;
padding-top: 88px;
}
}
.zyBox{
......@@ -48,7 +25,7 @@
}
.dataBox{
padding-top: 44px;
padding-top: 88px;
}
}
......@@ -97,6 +74,30 @@
}
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;}
......@@ -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 .subtotal{padding: 2% 3%; font-weight: bold; text-align: right; }
.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 .iconfont{ font-size: 10px; margin-left: 5px; }
.shop-lose{ color: #999999; }
......@@ -259,4 +258,29 @@
float: right;
box-sizing: border-box;
margin: 2px 8px;
}
\ No newline at end of file
}
.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/';
align-items: center;
justify-content: center;
color:#fff;
a{color:#fff;}
.icon-xiangshang1 {
color: #fff;
font-size: 28px;
......
......@@ -5,37 +5,110 @@ 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:[],//自营数据现货
zy2Data:[],//自营数据期货
ly1Length:0,
ly2Length:0,
zy1Length:0,//自营数据总长度
ly1LoseData:[],
ly2LoseData:[],
zy1LoseData:[],
}
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 = {
chainSmsVerify({commit},payload){
cartList({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_;
if(payload.order_goods_type==2){
types_=3;
}else{
types_=payload.delivery_place;
}
Services.smsVerify(qs.stringify(params)).then((res) => {
Services.cartList(qs.stringify(params)).then((res) => {
console.log(types_)
state.loading=false;
state.formImgShow=false;
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) {
state.formCodeStatus=true;
Toast({
message: data.err_msg,
duration: 2000
commit({
type: 'cartList',
data: data.data,
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 {
Toast({
message: data.err_msg,
......@@ -45,7 +118,18 @@ const actions = {
}).catch(function (err) {
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 = {}
......
import Vue from 'vue'
export default new Vue
\ No newline at end of file
......@@ -88,7 +88,17 @@
</div>
</div>
<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>
......@@ -97,6 +107,7 @@
<script>
import Vue from "vue";
import { Lazyload } from "vant";
import bus from '../../util/bus.js'
Vue.use(Lazyload);
export default {
name: "GoodsOne",
......@@ -140,6 +151,9 @@ export default {
},
placeOrder(id) {
this.$emit("placeOrder", id);
},
xunjia(){
bus.$emit('xunjia')
}
},
components: {}
......@@ -274,7 +288,6 @@ export default {
height: 30px;
float: right;
line-height: 30px;
padding: 0 20px;
width: 100px;
font-size: 14px;
display: block;
......@@ -284,6 +297,9 @@ export default {
cursor: pointer;
box-sizing: border-box;
border-radius: 4px;
&.but-orange{
background: #ffa200;
}
}
}
.more-height,
......
......@@ -4,8 +4,8 @@
<i class="icon iconfont icon-xiangzuo fl" @click="historyback"></i>
<div v-if="isCar">
<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==2)}" @click="listTab(2)" 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>{{zy1Length}}</font>)</span>
</div>
</div>
<div class="search" v-else-if="inputShow">
......@@ -27,6 +27,18 @@ export default {
type: String,
default: ""
},
zy1Length: {
type: Number,
default:0
},
ly1Length: {
type: Number,
default: 0
},
ly2Length: {
type: Number,
default:0
},
bgcolor:{
type: String,
default: "#f3f3f3"
......
......@@ -5,8 +5,10 @@
<i class="iconfont icon-kefu"></i>
</div>
<div class="backtop carslide" v-if="carshow">
<i class="iconfont icon-gouwuche1"></i>
<b class="carNumx">{{cartCount}}</b>
<a href="/v3/joincart" >
<i class="iconfont icon-gouwuche1"></i>
<b class="carNumx">{{cartCount}}</b>
</a>
</div>
<template v-if="isWindow">
<div class="backtop " v-backTopWindow v-show="show">
......@@ -57,6 +59,7 @@
import { mapState } from "vuex";
import Vue from "vue";
import { Dialog } from "vant";
import bus from '../../util/bus.js'
Vue.use(Dialog);
......@@ -76,6 +79,13 @@ export default {
default: false
}
},
created(){
var self=this;
bus.$on('xunjia',function(){
self.recordFn()
})
},
data() {
return {
flag: false,
......
......@@ -52,7 +52,7 @@
</div>
</div>
<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>
</section>
</template>
......@@ -213,6 +213,7 @@
}
}
}
},
components: {
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