Commit d2018dc7 by 施宇

h5zyly

parent e804b2d7
<template> <template>
<div id="app"> <div id="app">
<keep-alive exclude="newsDetail,pointchange,wallet,walletRetrieve,walletDetail,walletRecord,walletStatus,walletWithdraw,walletRecharge"> <keep-alive exclude="newsDetail,pointchange,wallet,walletRetrieve,walletDetail,walletRecord,walletStatus,walletWithdraw,walletRecharge,xianhuo">
<router-view class="router-view"></router-view> <router-view class="router-view"></router-view>
</keep-alive> </keep-alive>
</div> </div>
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</a> </a>
</dl> </dl>
<div class="mui-row block-but"> <div class="mui-row block-but">
<div class="morePrice"> <div class="morePrice" :id="'morePrice'+itemchild.goods_id">
<template v-if="isZy"> <template v-if="isZy">
<div <div
class="mui-row list_data" class="mui-row list_data"
...@@ -56,7 +56,10 @@ ...@@ -56,7 +56,10 @@
<p class="mui-col-sm-6 mui-col-xs-6" v-html="itemPrice.purchases+'+'"></p> <p class="mui-col-sm-6 mui-col-xs-6" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-6 mui-col-xs-6">{{itemPrice.price_cn}}</p> <p class="mui-col-sm-6 mui-col-xs-6">{{itemPrice.price_cn}}</p>
</div> </div>
<div class="mui-row list_data f-fff" v-if="itemchild.ladder_price&&itemchild.ladder_price.length==0"> <div
class="mui-row list_data f-fff"
v-if="itemchild.ladder_price&&itemchild.ladder_price.length==0"
>
<p class="mui-col-sm-6 mui-col-xs-6">- -</p> <p class="mui-col-sm-6 mui-col-xs-6">- -</p>
<p class="mui-col-sm-6 mui-col-xs-6">- -</p> <p class="mui-col-sm-6 mui-col-xs-6">- -</p>
</div> </div>
...@@ -71,7 +74,10 @@ ...@@ -71,7 +74,10 @@
<p class="mui-col-sm-4 mui-col-xs-4">{{itemPrice.price_cn}}</p> <p class="mui-col-sm-4 mui-col-xs-4">{{itemPrice.price_cn}}</p>
<p class="mui-col-sm-4 mui-col-xs-4">${{itemPrice.price_us}}</p> <p class="mui-col-sm-4 mui-col-xs-4">${{itemPrice.price_us}}</p>
</div> </div>
<div class="mui-row list_data f-fff" v-if="itemchild.ladder_price&&itemchild.ladder_price.length==0"> <div
class="mui-row list_data f-fff"
v-if="itemchild.ladder_price&&itemchild.ladder_price.length==0"
>
<p class="mui-col-sm-4 mui-col-xs-4">- -</p> <p class="mui-col-sm-4 mui-col-xs-4">- -</p>
<p class="mui-col-sm-4 mui-col-xs-4">- -</p> <p class="mui-col-sm-4 mui-col-xs-4">- -</p>
<p class="mui-col-sm-4 mui-col-xs-4">- -</p> <p class="mui-col-sm-4 mui-col-xs-4">- -</p>
...@@ -80,7 +86,7 @@ ...@@ -80,7 +86,7 @@
<div <div
class="more-height" class="more-height"
v-if="itemchild.ladder_price&&itemchild.ladder_price.length>limitLength" v-if="itemchild.ladder_price&&itemchild.ladder_price.length>limitLength"
@click="priceRow(indexdata)" @click="priceRow(indexdata,itemchild.goods_id)"
v-html="itemchild.checkBtn||defaultBtn" v-html="itemchild.checkBtn||defaultBtn"
> >
更多梯度价格 更多梯度价格
...@@ -90,15 +96,13 @@ ...@@ -90,15 +96,13 @@
<div class="but-shop"> <div class="but-shop">
<template v-if="isZy"> <template v-if="isZy">
<a class="but" v-if="itemchild.is_buy==1" @click="placeOrder(itemchild.goods_id)">我要下单</a> <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> <a class="but but-orange" v-else @click="xunjia">立即询价</a>
</template> </template>
<template v-else="isZy"> <template v-else="isZy">
<a class="but" v-if="itemchild.is_buy==1" @click="placeOrder(itemchild.goods_id)">我要下单</a> <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==0" @click="xunjia">立即询价</a>
<a class="but but-orange" v-else-if="itemchild.is_buy==3" @click="xunjia">确认库存信息</a> <a class="but but-orange" v-else-if="itemchild.is_buy==3" @click="xunjia">确认库存信息</a>
</template> </template>
</div> </div>
</div> </div>
</div> </div>
...@@ -107,7 +111,7 @@ ...@@ -107,7 +111,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' import bus from "../../util/bus.js";
Vue.use(Lazyload); Vue.use(Lazyload);
export default { export default {
name: "GoodsOne", name: "GoodsOne",
...@@ -132,7 +136,9 @@ export default { ...@@ -132,7 +136,9 @@ export default {
watch: {}, watch: {},
mounted() {}, mounted() {},
methods: { methods: {
priceRow: function(index) { priceRow: function(index, id) {
let dom = document.getElementById("morePrice" + id);
let arrLength = this.dataList[index].ladder_price.length;
if (this.dataList[index]["check"]) { if (this.dataList[index]["check"]) {
this.$set(this.dataList[index], "check", false); this.$set(this.dataList[index], "check", false);
this.$set( this.$set(
...@@ -140,6 +146,7 @@ export default { ...@@ -140,6 +146,7 @@ export default {
"checkBtn", "checkBtn",
'更多梯度价格<i class="icon-bot"></i>' '更多梯度价格<i class="icon-bot"></i>'
); );
dom.style.height = "81px";
} else { } else {
this.$set(this.dataList[index], "check", true); this.$set(this.dataList[index], "check", true);
this.$set( this.$set(
...@@ -147,13 +154,14 @@ export default { ...@@ -147,13 +154,14 @@ export default {
"checkBtn", "checkBtn",
'收起梯度价格<i class="icon-top"></i>' '收起梯度价格<i class="icon-top"></i>'
); );
dom.style.height = "200px";
} }
}, },
placeOrder(id) { placeOrder(id) {
this.$emit("placeOrder", id); this.$emit("placeOrder", id);
}, },
xunjia(){ xunjia() {
bus.$emit('xunjia') bus.$emit("xunjia");
} }
}, },
components: {} components: {}
...@@ -259,6 +267,8 @@ export default { ...@@ -259,6 +267,8 @@ export default {
color: #666; color: #666;
font-size: 12px; font-size: 12px;
width: 100%; width: 100%;
height: 81px;
transition: all 2s ease-in ;
.list_data { .list_data {
height: 19px; height: 19px;
&.dataNo { &.dataNo {
...@@ -297,7 +307,7 @@ export default { ...@@ -297,7 +307,7 @@ export default {
cursor: pointer; cursor: pointer;
box-sizing: border-box; box-sizing: border-box;
border-radius: 4px; border-radius: 4px;
&.but-orange{ &.but-orange {
background: #ffa200; background: #ffa200;
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="details-head"> <div class="details-head">
<div class="head_top clr"> <div class="head_top clr">
<div class="head_top_left fl"> <div class="head_top_left fl">
<img :src="goodDetail.brand_logo" @error="imgErr"> <img :src="goodDetail.brand_logo" @error="imgErr" @click="showImagePreview">
</div> </div>
<div class="head_top_right"> <div class="head_top_right">
<h4> <h4>
...@@ -183,6 +183,9 @@ ...@@ -183,6 +183,9 @@
</template> </template>
<script> <script>
import util from "../../util/index"; import util from "../../util/index";
import Vue from 'vue'
import { ImagePreview } from 'vant';
Vue.use(ImagePreview);
export default { export default {
props: { props: {
goodDetail: { goodDetail: {
...@@ -282,6 +285,19 @@ export default { ...@@ -282,6 +285,19 @@ export default {
} }
}, },
methods: { methods: {
showImagePreview(position, timer) {
let images = [this.goodDetail.brand_logo];
const instance = ImagePreview({
images,
asyncClose: !!timer,
showIndex: false
});
if (timer) {
setTimeout(() => {
instance.close();
}, timer);
}
},
imgErr() { imgErr() {
this.goodDetail.brand_logo = this.goodDetail.brand_logo =
"https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png"; "https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png";
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="details-head"> <div class="details-head">
<div class="head_top clr"> <div class="head_top clr">
<div class="head_top_left fl"> <div class="head_top_left fl">
<img :src="goodDetail.brand_logo" @onerror="imgErr"> <img :src="goodDetail.brand_logo" @onerror="imgErr" @click="showImagePreview">
</div> </div>
<div class="head_top_right"> <div class="head_top_right">
<h4> <h4>
...@@ -199,6 +199,10 @@ ...@@ -199,6 +199,10 @@
</template> </template>
<script> <script>
import util from "../../util/index"; import util from "../../util/index";
import Vue from 'vue'
import { ImagePreview } from 'vant';
Vue.use(ImagePreview);
export default { export default {
props: { props: {
goodDetail: { goodDetail: {
...@@ -210,6 +214,7 @@ export default { ...@@ -210,6 +214,7 @@ export default {
}, },
data() { data() {
return { return {
images:[],
isShowMore: false, isShowMore: false,
ypNum: 0, //组 ypNum: 0, //组
singlePrice: 0, //单价 singlePrice: 0, //单价
...@@ -301,6 +306,19 @@ export default { ...@@ -301,6 +306,19 @@ export default {
} }
}, },
methods: { methods: {
showImagePreview(position, timer) {
let images = [this.goodDetail.brand_logo]
const instance = ImagePreview({
images,
asyncClose: !!timer,
showIndex:false
});
if (timer) {
setTimeout(() => {
instance.close();
}, timer);
}
},
imgErr() { imgErr() {
this.goodDetail.brand_logo = this.goodDetail.brand_logo =
"https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png"; "https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png";
......
<template> <template>
<section class="lxshop"> <section class="lxshop">
<Header :meaushow='meaushow' :inputShow="inputShow" @toSearch="toSearchp"></Header> <!-- 购物车添加成功 -->
<div class="lxshop-content"> <addCarAlert></addCarAlert>
<!--固定供应商--> <!-- 购物车添加成功 -->
<div class="sosoarr layer-fix" v-if="popdetailbool">{{confirmSupplierNames}}</div> <Header :meaushow="meaushow" :inputShow="inputShow" @toSearch="toSearchp"></Header>
<!--供应商--> <div class="lxshop-content">
<div class="search-sift" > <!--固定供应商-->
<div class="sift-box pool-sift"> <div class="sosoarr layer-fix" v-if="popdetailbool">{{confirmSupplierNames}}</div>
<dl :class="{'p_act':supplierShow}"> <!--供应商-->
<dt @click="supplierShit()" :class="{'f-blue':supplierIsBlue}">{{confirmSupplierNames}}</dt> <div class="search-sift">
<dd > <div class="sift-box pool-sift">
<ul class="sift-ul" > <dl :class="{'p_act':supplierShow}">
<li class="fl" :class="{'check':item.isCheck}" v-for="item in supplierListLocal" @click="supplierCheck(item.ids)" :supplierId="item.ids"> <dt @click="supplierShit()" :class="{'f-blue':supplierIsBlue}">{{confirmSupplierNames}}</dt>
<span :supplierId="item.ids">{{item.name}}</span> <dd>
</li> <ul class="sift-ul">
</ul> <li
<div class="button"> class="fl"
<a href="javascript:void(0)" class="but font cancel" @click="reset()">重置</a> :class="{'check':item.isCheck}"
<a href="javascript:void(0)" class="but-blue confirm" @click="confirm()">确定</a> v-for="item in supplierListLocal"
</div> @click="supplierCheck(item.ids)"
</dd> :supplierId="item.ids"
</dl> >
</div> <span :supplierId="item.ids">{{item.name}}</span>
</div> </li>
<!--数据渲染部分--> </ul>
<div class="search-list-box" v-if="lyData"> <div class="button">
<a href="javascript:void(0)" class="but font cancel" @click="reset()">重置</a>
<div class="data-group-supplier" v-for="item in lyData"> <a href="javascript:void(0)" class="but-blue confirm" @click="confirm()">确定</a>
<div class="name-shop" > </div>
<img :src="item.supplier_logo||'https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png'" class="name-img" alt="aipco"> </dd>
<a v-if="item.supplier_ad" :href="item.supplier_ad.url" class="ad">{{item.supplier_ad.ad}}</a> </dl>
<a v-else class="ad"></a> </div>
</div> </div>
<GoodsOne :dataList="item.data" @placeOrder="placeOrder"></GoodsOne> <!--数据渲染部分-->
<div class="more-number" v-if="item.fished"> <div class="search-list-box" v-if="lyData">
为您找到<span>{{item.total}}</span>个商品,已全部显示 <div class="data-group-supplier" v-for="item in lyData">
</div> <div class="name-shop">
<div class="more-number" v-else> <img
还有<span class="f-blue">{{item.updateLength}}</span>个商品未显示, :src="item.supplier_logo||'https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png'"
<span class="hhs_load_more cup flag_two" @click="moreData(item.k,item.p)"> class="name-img"
点击加载更多 alt="aipco"
<i></i> >
</span> <a
</div> v-if="item.supplier_ad"
</div> :href="item.supplier_ad.url"
<div class="data-group-supplier data-group-supplier-no" style="display:none;"> class="ad"
<div class="toisx"> >{{item.supplier_ad.ad}}</a>
暂时没有数据,换个供应商看看吧 <a v-else class="ad"></a>
</div> </div>
</div> <GoodsOne :dataList="item.data" @placeOrder="placeOrder"></GoodsOne>
</div> <div class="more-number" v-if="item.fished">
为您找到
<span>{{item.total}}</span>个商品,已全部显示
</div>
<div class="more-number" v-else>
还有
<span class="f-blue">{{item.updateLength}}</span>个商品未显示,
<span class="hhs_load_more cup flag_two" @click="moreData(item.k,item.p)">
点击加载更多
<i></i>
</span>
</div>
</div>
<div class="data-group-supplier data-group-supplier-no" style="display:none;">
<div class="toisx">暂时没有数据,换个供应商看看吧</div>
</div> </div>
<van-loading type="spinner" color="#000" class="loading-background" v-if="loading"/> </div>
<SideBar :isWindow="isWindow" :carshow="carshow" ></SideBar> </div>
<goodsDetail :detailsData="detailsData"></goodsDetail> <van-loading type="spinner" color="#000" class="loading-background" v-if="loading"/>
</section> <SideBar :isWindow="isWindow" :carshow="carshow"></SideBar>
<goodsDetail :detailsData="detailsData"></goodsDetail>
</section>
</template> </template>
<script> <script>
import Vue from "vue";
import { mapState, mapMutations } from "vuex";
import { Loading } from "vant";
import Header from "@/views/common/Header.vue";
import GoodsOne from "@/views/common/GoodsOne.vue";
import goodsDetail from "@/views/common/goodsDetail.vue";
import SideBar from "@/views/common/SideBar.vue";
import addCarAlert from "@/views/common/addCarAlert";
Vue.use(Loading);
import Vue from 'vue'; export default {
import {mapState,mapMutations} from 'vuex' name: "news",
import {Loading} from 'vant'; data() {
import Header from '@/views/common/Header.vue'; return {
import GoodsOne from '@/views/common/GoodsOne.vue'; detailsData: { isShow: false, id: "" },
import goodsDetail from '@/views/common/goodsDetail.vue'; carshow: true,
import SideBar from '@/views/common/SideBar.vue'; isWindow: true,
Vue.use(Loading); inputShow: true,
meaushow: true,
export default { supplierShow: false,
name: 'news', confirmSupplierNames: "全部供应商",
data() { confirmSuppliers: "",
return { supplierListLocal: [],
detailsData: { isShow: false, id: "" }, supplierIsBlue: false,
carshow:true, popdetailbool: false
isWindow:true, };
inputShow:true, },
meaushow:true, computed: {
supplierShow:false, ...mapState({
confirmSupplierNames:"全部供应商", loading: state => state.lxshop.loading,
confirmSuppliers:"", supplierList: state => state.lxshop.supplierList,
supplierListLocal:[], supplierIds: state => state.lxshop.supplierIds,
supplierIsBlue:false, isLyData: state => state.lxshop.isLyData,
popdetailbool:false lyData: state => state.lxshop.lyData,
} isHaveData: state => state.lxshop.isHaveData,
}, isShowAlert: state => state.gooddetail.isShowAlert
computed: { })
...mapState({ },
loading:state=>state.lxshop.loading, watch: {
supplierList: state => state.lxshop.supplierList, isShowAlert(now) {
supplierIds: state => state.lxshop.supplierIds, if (now) {
isLyData: state => state.lxshop.isLyData, this.detailsData = { isShow: false, id: "" };
lyData:state => state.lxshop.lyData, }
isHaveData:state => state.lxshop.isHaveData, },
supplierList(val) {
}) this.supplierListLocal = val;
}, },
watch: { supplierIds(val) {
supplierList(val){ this.confirmSuppliers = val;
this.supplierListLocal=val },
}, isLyData(val) {
supplierIds(val){ if (val) {
this.confirmSuppliers=val this.getData();
}, }
isLyData(val){ }
if(val){ },
this.getData(); created() {
} this.allSUpplier();
} this.scrollFns();
}, },
created() { mounted() {},
this.allSUpplier(); methods: {
this.scrollFns(); ...mapMutations(["resetData"]),
//所有供应商
}, allSUpplier: function() {
mounted() { this.$store.dispatch({
}, type: "supplierApi"
methods: { });
...mapMutations([ },
'resetData', getData: function(reset) {
]), var ids_ = [];
//所有供应商 if (this.confirmSuppliers) {
allSUpplier:function(){ ids_ = this.confirmSuppliers.split(",");
this.$store.dispatch({ }
type: 'supplierApi' if (reset) {
}) this.resetData();
}, }
getData:function(reset){ if (ids_.length > 0) {
var ids_=[]; for (var i = 0; i < ids_.length; i++) {
if(this.confirmSuppliers){ this.$store.dispatch({
ids_=this.confirmSuppliers.split(","); type: "searchLyEsData",
} k: ids_[i]
if(reset){this.resetData()} });
if(ids_.length>0){ }
for(var i=0;i<ids_.length;i++){ }
this.$store.dispatch({ },
type: 'searchLyEsData', toSearchp: function() {
k:ids_[i] window.location.href = "/v3/search/search_index.html?ptag=lxshop-topnav";
}) },
} supplierShit: function() {
} this.supplierShow = !this.supplierShow;
}, },
toSearchp:function(){ supplierCheck: function(ids) {
window.location.href="/v3/search/search_index.html?ptag=lxshop-topnav" var self = this;
}, for (var i = 0; i < self.supplierListLocal.length; i++) {
supplierShit:function(){ if (self.supplierListLocal[i].ids == ids) {
this.supplierShow=!this.supplierShow self.supplierListLocal[i].isCheck = !self.supplierListLocal[i]
}, .isCheck;
supplierCheck:function(ids){ }
var self=this; }
for(var i=0;i<self.supplierListLocal.length;i++){ },
if(self.supplierListLocal[i].ids==ids){ reset: function() {
self.supplierListLocal[i].isCheck=!self.supplierListLocal[i].isCheck; var self = this;
} for (var i = 0; i < self.supplierListLocal.length; i++) {
} self.supplierListLocal[i].isCheck = false;
}, }
reset:function(){ },
var self=this; confirm: function() {
for(var i=0;i<self.supplierListLocal.length;i++){ var self = this;
self.supplierListLocal[i].isCheck=false; self.confirmSuppliers = "";
} self.confirmSupplierNames = "";
}, for (var i = 0; i < self.supplierListLocal.length; i++) {
confirm:function(){ if (self.supplierListLocal[i].isCheck) {
var self=this; self.confirmSuppliers += "," + self.supplierListLocal[i].ids;
self.confirmSuppliers=""; self.confirmSupplierNames += "," + self.supplierListLocal[i].name;
self.confirmSupplierNames=""; }
for(var i=0;i<self.supplierListLocal.length;i++){ }
if(self.supplierListLocal[i].isCheck){ self.confirmSuppliers = self.confirmSuppliers.slice(1);
self.confirmSuppliers+=','+self.supplierListLocal[i].ids; self.confirmSupplierNames = self.confirmSupplierNames.slice(1);
self.confirmSupplierNames+=','+self.supplierListLocal[i].name; if (!self.confirmSupplierNames) {
} self.confirmSupplierNames = "全部供应商";
} this.supplierIsBlue = false;
self.confirmSuppliers=self.confirmSuppliers.slice(1); } else {
self.confirmSupplierNames=self.confirmSupplierNames.slice(1); this.supplierIsBlue = true;
if(!self.confirmSupplierNames){ }
self.confirmSupplierNames="全部供应商"; this.supplierShow = !this.supplierShow;
this.supplierIsBlue=false; if (this.confirmSuppliers == "") {
}else{ this.confirmSuppliers = this.supplierIds;
this.supplierIsBlue=true; }
} this.getData(1);
this.supplierShow=!this.supplierShow; },
if(this.confirmSuppliers==""){ moreData: function(id_, p) {
this.confirmSuppliers=this.supplierIds console.log(id_);
} this.$store.dispatch({
this.getData(1); type: "searchLyEsData",
}, k: id_,
moreData:function(id_,p){ p: p,
console.log(id_) isMore: 1
this.$store.dispatch({ });
type: 'searchLyEsData', },
k:id_, placeOrder(id) {
p:p, this.detailsData = {
isMore:1 isShow: true,
}) id: id
}, };
placeOrder(id) { },
this.detailsData = { scrollFns() {
isShow: true, var self = this;
id: id window.onscroll = function() {
}; var t = document.documentElement.scrollTop || document.body.scrollTop;
}, if (t >= 200) {
scrollFns() { if (self.confirmSupplierNames != "全部供应商") {
var self=this; self.popdetailbool = true;
window.onscroll= function(){ }
var t = document.documentElement.scrollTop||document.body.scrollTop; } else {
if (t >= 200) { self.popdetailbool = false;
if(self.confirmSupplierNames!='全部供应商'){
self.popdetailbool = true;
}
}else{
self.popdetailbool = false;
}
}
}
},
components: {
Header,
GoodsOne,
SideBar,
goodsDetail
} }
};
} }
},
components: {
Header,
GoodsOne,
SideBar,
goodsDetail,
addCarAlert
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/lxshop/lxshop.min.css"; @import "../../assets/css/lxshop/lxshop.min.css";
</style> </style>
\ No newline at end of file
...@@ -243,6 +243,7 @@ export default { ...@@ -243,6 +243,7 @@ export default {
}, },
created() { created() {
this.getDefaultClass(); this.getDefaultClass();
this.$store.commit("closeAlert");
}, },
computed: { computed: {
...mapState({ ...mapState({
......
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