Commit d70b25ad by 施宇

h5zy

parent d5954be2
...@@ -39,6 +39,8 @@ switch (window.location.hostname) { ...@@ -39,6 +39,8 @@ switch (window.location.hostname) {
urlPc = 'http://www.liexin.com/v3/'; urlPc = 'http://www.liexin.com/v3/';
zyApi = 'http://soso12.ichunt.com'; zyApi = 'http://soso12.ichunt.com';
lyApi = 'http://soso12.ichunt.com'; lyApi = 'http://soso12.ichunt.com';
// zyApi = 'https://szso.ichunt.com';
// lyApi = 'https://szso.ichunt.com';
break; break;
default: default:
//本地proxy配置参考vue.config.js //本地proxy配置参考vue.config.js
...@@ -288,7 +290,10 @@ export const apis = { ...@@ -288,7 +290,10 @@ export const apis = {
searchLyEs: lyApi + '/search/es/index', searchLyEs: lyApi + '/search/es/index',
/**供应商接口**/ /**供应商接口**/
supplierApi: productionUrl + 'api/supplierApi', supplierApi: productionUrl + 'api/supplierApi',
/****获取弹出商品信息 */
goodDetail: productionUrlApi + '/goods/detail',
/****获取zy默认class查询 */
defaultClass:productionUrl+'api/defaultClass'
}; };
...@@ -440,17 +445,23 @@ export const services = { ...@@ -440,17 +445,23 @@ export const services = {
orderInfo(params) { orderInfo(params) {
return axios.post(apis.orderInfo, params) return axios.post(apis.orderInfo, params)
}, },
getZyData(params){ getZyData(params) {
return axios.post(apis.searchZy,params) return axios.post(apis.searchZy, params)
},
getLyData(params) {
return axios.post(apis.searchLy, params)
},
getLyEsData(params) {
return axios.post(apis.searchLyEs, params)
}, },
getLyData(params){ supplierApi(params) {
return axios.post(apis.searchLy,params) return axios.post(apis.supplierApi, params)
}, },
getLyEsData(params){ goodDetail(params) {
return axios.post(apis.searchLyEs,params) return axios.post(apis.goodDetail, params)
}, },
supplierApi(params){ defaultClass(params){
return axios.post(apis.supplierApi,params) return axios.post(apis.defaultClass,params)
} }
}; };
\ No newline at end of file
import Vue from 'vue'
import {
Toast
} from 'vant';
import {
services as Services
} from '../../../api/index'
import util
from '../../../util/index';
var qs = require('qs');
Vue.use(Toast);
const state = {
goodDetail: {},
startNum: 1, //起订量
multipleNum: 1, //倍数
aggregateNum: 0, //一组的数量
stockNum: 0, //库存,
zyladderArr: [] //阶梯价
}
const mutations = {
changGoodDetai(state, payload) {
let data = payload.data
state.goodDetail = data;
if (data.min_buy) {
state.startNum = util.aggxde(data.min_buy)
}
if (data.mpl) {
state.multipleNum = util.aggxde(data.mpl)
}
if (data.min_mpq) {
state.aggregateNum = util.aggxde(data.min_mpq)
}
if (data.goods_number) {
state.stockNum = util.aggxde(data.goods_number)
}
if(data.tiered){
for(let i=0;i<data.tiered.length;i++){
}
}
}
}
const actions = {
getDetailData({
commit
}, payload) {
const toast = Toast.loading({
message: '加载中...',
duration: 0
});
state.goodDetail = {};
Services.goodDetail(qs.stringify(payload.data)).then((res) => {
toast.clear()
let data = res.data;
if (data.err_code == 0) {
commit("changGoodDetai", { //过滤数据
data: data.data
})
} else {
}
}).catch(function (err) {
toast.clear()
});
}
}
export default {
state,
actions,
mutations
}
\ No newline at end of file
import Vue from 'vue' import Vue from 'vue'
import {
Toast
} from 'vant';
import { import {
services as Services services as Services
} from '../../../api/index' } from '../../../api/index'
var qs = require('qs'); var qs = require('qs');
Vue.use(Toast);
const state = { const state = {
zyFilter: false, zyFilter: false,
zyClass: false, zyClass: false,
......
...@@ -18,6 +18,7 @@ import aboutus from './modules/aboutUs/index' ...@@ -18,6 +18,7 @@ import aboutus from './modules/aboutUs/index'
import chain from './modules/chain/chain' import chain from './modules/chain/chain'
import xianhuo from './modules/xianhuo/xianhuo' import xianhuo from './modules/xianhuo/xianhuo'
import lxshop from './modules/lxshop/lxshop' import lxshop from './modules/lxshop/lxshop'
import gooddetail from './modules/gooddetail/gooddetail'
Vue.use(Vuex) Vue.use(Vuex)
...@@ -41,6 +42,7 @@ export default new Vuex.Store({ ...@@ -41,6 +42,7 @@ export default new Vuex.Store({
aboutus, aboutus,
chain, chain,
xianhuo, xianhuo,
lxshop lxshop,
gooddetail
} }
}) })
<template> <template>
<div class="details-pop" v-if="detailsData.isShow"> <div class="details-pop" v-if="detailsData.isShow">
<div class="mui-backdrop" style="opacity:1"></div> <div class="mui-backdrop" style="opacity:1" @click="detailsData.isShow = false"></div>
<div class="mui-poppicker mui-active"> <div class="mui-poppicker mui-active">
<div class="close"> <div class="close" @click="detailsData.isShow = false">
<i class="icon iconfont icon-guanbi"></i> <i class="icon iconfont icon-guanbi"></i>
</div> </div>
<zy></zy> <zy v-if="goodDetail.goods_type==3||goodDetail.goods_type==4"></zy>
<ly v-if="goodDetail.goods_type==1||goodDetail.goods_type==2"></ly>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import zy from "@/views/common/zyDetail"; import zy from "@/views/common/zyDetail";
import ly from "@/views/common/lyDetail"; import ly from "@/views/common/lyDetail";
import { mapState } from "vuex";
export default { export default {
props:{ props: {
detailsData:{ detailsData: {
type:Object, type: Object,
default(){ default() {
return {} return {};
} }
},
test1: {
type: String,
default: "1"
} }
}, },
components: { components: {
zy, zy,
ly ly
},
computed: {
...mapState({
goodDetail: state => state.gooddetail.goodDetail
})
},
watch: {
detailsData: {
handler(newV, oldV) {
if (newV.isShow) {
this.$store.dispatch({
type: "getDetailData",
data: { id: newV.id }
});
}
},
deep: true
},
} }
}; };
</script> </script>
......
<template>
<div>111111</div>
</template>
...@@ -151,8 +151,14 @@ ...@@ -151,8 +151,14 @@
</div> </div>
</div> </div>
<div class="content_scroll" @scroll="scrollEvent" :style="{'top':isScrollShow?'44px':'80px'}"> <div class="content_scroll" @scroll="scrollEvent" :style="{'top':isScrollShow?'44px':'80px'}">
<van-list v-model="loadingXh" :finished="finished" finished-text="我是有底线的噢" @load="onLoad"> <van-list
<GoodsOne :dataList="zyData" :isZy="isZy"></GoodsOne> v-model="loadingXh"
:finished="finished"
finished-text="我是有底线的噢"
@load="onLoad"
:immediate-check="false"
>
<GoodsOne :dataList="zyData" :isZy="isZy" @placeOrder="placeOrder"></GoodsOne>
</van-list> </van-list>
</div> </div>
</div> </div>
...@@ -179,6 +185,8 @@ import { mapState } from "vuex"; ...@@ -179,6 +185,8 @@ import { mapState } from "vuex";
import rightSelect from "./rightSelect"; import rightSelect from "./rightSelect";
import GoodsOne from "@/views/common/GoodsOne.vue"; import GoodsOne from "@/views/common/GoodsOne.vue";
import goodsDetail from "@/views/common/goodsDetail.vue"; import goodsDetail from "@/views/common/goodsDetail.vue";
import SideBar from "@/views/common/SideBar.vue";
import { services as Services } from "../../api/index";
export default { export default {
name: "xianhuo", name: "xianhuo",
components: { components: {
...@@ -187,14 +195,15 @@ export default { ...@@ -187,14 +195,15 @@ export default {
rightSelect, rightSelect,
"van-list": List, "van-list": List,
GoodsOne, GoodsOne,
goodsDetail goodsDetail,
SideBar
}, },
data() { data() {
return { return {
detailsData:{isShow:false,id:""}, detailsData: { isShow: false, id: "" },
isWindow:true, isWindow: true,
carshow:true, carshow: true,
isZy:true, isZy: true,
zyFilterInit: -1, zyFilterInit: -1,
zyRankInit: 0, //0综合 1库存多到少 2//库存少到多 3//价格高到低 4//价格低到高 zyRankInit: 0, //0综合 1库存多到少 2//库存少到多 3//价格高到低 4//价格低到高
classFilter: "", classFilter: "",
...@@ -214,7 +223,7 @@ export default { ...@@ -214,7 +223,7 @@ export default {
isShowRight: false, //是否展示右侧 isShowRight: false, //是否展示右侧
list: [], list: [],
loadingXh: false, loadingXh: false,
p: 0, p: 1,
rightFilterData: {}, rightFilterData: {},
navTopStr: { navTopStr: {
classStr: "", classStr: "",
...@@ -226,7 +235,9 @@ export default { ...@@ -226,7 +235,9 @@ export default {
isScrollShow: false isScrollShow: false
}; };
}, },
created() {}, created() {
this.getDefaultClass();
},
computed: { computed: {
...mapState({ ...mapState({
zyFilter: state => state.xianhuo.zyFilter, zyFilter: state => state.xianhuo.zyFilter,
...@@ -250,7 +261,7 @@ export default { ...@@ -250,7 +261,7 @@ export default {
this.getZyData(); this.getZyData();
}, },
classLight(now) { classLight(now) {
this.secondClass = now.class_id2_list; this.secondClass = now.class_id2_list || [];
this.firstCheckId = now.class_id1; this.firstCheckId = now.class_id1;
this.firstClassName = now.class_id1_name; this.firstClassName = now.class_id1_name;
let index = this.secondClass.findIndex((val, index, arr) => { let index = this.secondClass.findIndex((val, index, arr) => {
...@@ -268,11 +279,37 @@ export default { ...@@ -268,11 +279,37 @@ export default {
} }
}, },
methods: { methods: {
getDefaultClass() {
Services.defaultClass()
.then(res => {
if (res.data.err_code == 0) {
this.classStr = res.data.data;
this.addClassStr = res.data.data;
this.getZyData();
} else {
}
})
.catch(err => {});
},
placeOrder(id) {
this.detailsData = {
isShow: true,
id: id
};
},
scrollEvent(e) { scrollEvent(e) {
if (e.target.scrollTop > 40) { if (
this.isScrollShow = true; this.navTopStr.classStr ||
} else { this.navTopStr.brandStr ||
this.isScrollShow = false; this.navTopStr.encapStr ||
this.navTopStr.packingStr ||
this.navTopStr.rightStr
) {
if (e.target.scrollTop > 40) {
this.isScrollShow = true;
} else {
this.isScrollShow = false;
}
} }
}, },
onLoad() { onLoad() {
...@@ -372,7 +409,7 @@ export default { ...@@ -372,7 +409,7 @@ export default {
} }
} }
str = str.slice(1); str = str.slice(1);
console.log(str) console.log(str);
this.navTopStr.rightStr = str; this.navTopStr.rightStr = str;
} }
if (this.rightFilterData.isyh) { if (this.rightFilterData.isyh) {
......
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