Commit d70b25ad by 施宇

h5zy

parent d5954be2
......@@ -39,6 +39,8 @@ switch (window.location.hostname) {
urlPc = 'http://www.liexin.com/v3/';
zyApi = 'http://soso12.ichunt.com';
lyApi = 'http://soso12.ichunt.com';
// zyApi = 'https://szso.ichunt.com';
// lyApi = 'https://szso.ichunt.com';
break;
default:
//本地proxy配置参考vue.config.js
......@@ -288,7 +290,10 @@ export const apis = {
searchLyEs: lyApi + '/search/es/index',
/**供应商接口**/
supplierApi: productionUrl + 'api/supplierApi',
/****获取弹出商品信息 */
goodDetail: productionUrlApi + '/goods/detail',
/****获取zy默认class查询 */
defaultClass:productionUrl+'api/defaultClass'
};
......@@ -440,17 +445,23 @@ export const services = {
orderInfo(params) {
return axios.post(apis.orderInfo, params)
},
getZyData(params){
return axios.post(apis.searchZy,params)
getZyData(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){
return axios.post(apis.searchLy,params)
supplierApi(params) {
return axios.post(apis.supplierApi, params)
},
getLyEsData(params){
return axios.post(apis.searchLyEs,params)
goodDetail(params) {
return axios.post(apis.goodDetail, params)
},
supplierApi(params){
return axios.post(apis.supplierApi,params)
defaultClass(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 {
Toast
} from 'vant';
import {
services as Services
} from '../../../api/index'
var qs = require('qs');
Vue.use(Toast);
const state = {
zyFilter: false,
zyClass: false,
......
......@@ -18,6 +18,7 @@ import aboutus from './modules/aboutUs/index'
import chain from './modules/chain/chain'
import xianhuo from './modules/xianhuo/xianhuo'
import lxshop from './modules/lxshop/lxshop'
import gooddetail from './modules/gooddetail/gooddetail'
Vue.use(Vuex)
......@@ -41,6 +42,7 @@ export default new Vuex.Store({
aboutus,
chain,
xianhuo,
lxshop
lxshop,
gooddetail
}
})
<template>
<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="close">
<div class="close" @click="detailsData.isShow = false">
<i class="icon iconfont icon-guanbi"></i>
</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>
</template>
<script>
import zy from "@/views/common/zyDetail";
import ly from "@/views/common/lyDetail";
import { mapState } from "vuex";
export default {
props:{
detailsData:{
type:Object,
default(){
return {}
props: {
detailsData: {
type: Object,
default() {
return {};
}
},
test1: {
type: String,
default: "1"
}
},
components: {
zy,
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>
......
<template>
<div>111111</div>
</template>
......@@ -151,8 +151,14 @@
</div>
</div>
<div class="content_scroll" @scroll="scrollEvent" :style="{'top':isScrollShow?'44px':'80px'}">
<van-list v-model="loadingXh" :finished="finished" finished-text="我是有底线的噢" @load="onLoad">
<GoodsOne :dataList="zyData" :isZy="isZy"></GoodsOne>
<van-list
v-model="loadingXh"
:finished="finished"
finished-text="我是有底线的噢"
@load="onLoad"
:immediate-check="false"
>
<GoodsOne :dataList="zyData" :isZy="isZy" @placeOrder="placeOrder"></GoodsOne>
</van-list>
</div>
</div>
......@@ -179,6 +185,8 @@ import { mapState } from "vuex";
import rightSelect from "./rightSelect";
import GoodsOne from "@/views/common/GoodsOne.vue";
import goodsDetail from "@/views/common/goodsDetail.vue";
import SideBar from "@/views/common/SideBar.vue";
import { services as Services } from "../../api/index";
export default {
name: "xianhuo",
components: {
......@@ -187,14 +195,15 @@ export default {
rightSelect,
"van-list": List,
GoodsOne,
goodsDetail
goodsDetail,
SideBar
},
data() {
return {
detailsData:{isShow:false,id:""},
isWindow:true,
carshow:true,
isZy:true,
detailsData: { isShow: false, id: "" },
isWindow: true,
carshow: true,
isZy: true,
zyFilterInit: -1,
zyRankInit: 0, //0综合 1库存多到少 2//库存少到多 3//价格高到低 4//价格低到高
classFilter: "",
......@@ -214,7 +223,7 @@ export default {
isShowRight: false, //是否展示右侧
list: [],
loadingXh: false,
p: 0,
p: 1,
rightFilterData: {},
navTopStr: {
classStr: "",
......@@ -226,7 +235,9 @@ export default {
isScrollShow: false
};
},
created() {},
created() {
this.getDefaultClass();
},
computed: {
...mapState({
zyFilter: state => state.xianhuo.zyFilter,
......@@ -250,7 +261,7 @@ export default {
this.getZyData();
},
classLight(now) {
this.secondClass = now.class_id2_list;
this.secondClass = now.class_id2_list || [];
this.firstCheckId = now.class_id1;
this.firstClassName = now.class_id1_name;
let index = this.secondClass.findIndex((val, index, arr) => {
......@@ -268,11 +279,37 @@ export default {
}
},
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) {
if (e.target.scrollTop > 40) {
this.isScrollShow = true;
} else {
this.isScrollShow = false;
if (
this.navTopStr.classStr ||
this.navTopStr.brandStr ||
this.navTopStr.encapStr ||
this.navTopStr.packingStr ||
this.navTopStr.rightStr
) {
if (e.target.scrollTop > 40) {
this.isScrollShow = true;
} else {
this.isScrollShow = false;
}
}
},
onLoad() {
......@@ -372,7 +409,7 @@ export default {
}
}
str = str.slice(1);
console.log(str)
console.log(str);
this.navTopStr.rightStr = str;
}
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