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"
> >
更多梯度价格 更多梯度价格
...@@ -96,9 +102,7 @@ ...@@ -96,9 +102,7 @@
<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> <!-- 购物车添加成功 -->
<addCarAlert></addCarAlert>
<!-- 购物车添加成功 -->
<Header :meaushow="meaushow" :inputShow="inputShow" @toSearch="toSearchp"></Header>
<div class="lxshop-content"> <div class="lxshop-content">
<!--固定供应商--> <!--固定供应商-->
<div class="sosoarr layer-fix" v-if="popdetailbool">{{confirmSupplierNames}}</div> <div class="sosoarr layer-fix" v-if="popdetailbool">{{confirmSupplierNames}}</div>
<!--供应商--> <!--供应商-->
<div class="search-sift" > <div class="search-sift">
<div class="sift-box pool-sift"> <div class="sift-box pool-sift">
<dl :class="{'p_act':supplierShow}"> <dl :class="{'p_act':supplierShow}">
<dt @click="supplierShit()" :class="{'f-blue':supplierIsBlue}">{{confirmSupplierNames}}</dt> <dt @click="supplierShit()" :class="{'f-blue':supplierIsBlue}">{{confirmSupplierNames}}</dt>
<dd > <dd>
<ul class="sift-ul" > <ul class="sift-ul">
<li class="fl" :class="{'check':item.isCheck}" v-for="item in supplierListLocal" @click="supplierCheck(item.ids)" :supplierId="item.ids"> <li
class="fl"
:class="{'check':item.isCheck}"
v-for="item in supplierListLocal"
@click="supplierCheck(item.ids)"
:supplierId="item.ids"
>
<span :supplierId="item.ids">{{item.name}}</span> <span :supplierId="item.ids">{{item.name}}</span>
</li> </li>
</ul> </ul>
...@@ -25,19 +34,28 @@ ...@@ -25,19 +34,28 @@
</div> </div>
<!--数据渲染部分--> <!--数据渲染部分-->
<div class="search-list-box" v-if="lyData"> <div class="search-list-box" v-if="lyData">
<div class="data-group-supplier" v-for="item in lyData"> <div class="data-group-supplier" v-for="item in lyData">
<div class="name-shop" > <div class="name-shop">
<img :src="item.supplier_logo||'https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png'" class="name-img" alt="aipco"> <img
<a v-if="item.supplier_ad" :href="item.supplier_ad.url" class="ad">{{item.supplier_ad.ad}}</a> :src="item.supplier_logo||'https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png'"
class="name-img"
alt="aipco"
>
<a
v-if="item.supplier_ad"
:href="item.supplier_ad.url"
class="ad"
>{{item.supplier_ad.ad}}</a>
<a v-else class="ad"></a> <a v-else class="ad"></a>
</div> </div>
<GoodsOne :dataList="item.data" @placeOrder="placeOrder"></GoodsOne> <GoodsOne :dataList="item.data" @placeOrder="placeOrder"></GoodsOne>
<div class="more-number" v-if="item.fished"> <div class="more-number" v-if="item.fished">
为您找到<span>{{item.total}}</span>个商品,已全部显示 为您找到
<span>{{item.total}}</span>个商品,已全部显示
</div> </div>
<div class="more-number" v-else> <div class="more-number" v-else>
还有<span class="f-blue">{{item.updateLength}}</span>个商品未显示, 还有
<span class="f-blue">{{item.updateLength}}</span>个商品未显示,
<span class="hhs_load_more cup flag_two" @click="moreData(item.k,item.p)"> <span class="hhs_load_more cup flag_two" @click="moreData(item.k,item.p)">
点击加载更多 点击加载更多
<i></i> <i></i>
...@@ -45,66 +63,69 @@ ...@@ -45,66 +63,69 @@
</div> </div>
</div> </div>
<div class="data-group-supplier data-group-supplier-no" style="display:none;"> <div class="data-group-supplier data-group-supplier-no" style="display:none;">
<div class="toisx"> <div class="toisx">暂时没有数据,换个供应商看看吧</div>
暂时没有数据,换个供应商看看吧
</div>
</div> </div>
</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>
<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';
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';
Vue.use(Loading);
export default {
name: 'news',
data() { data() {
return { return {
detailsData: { isShow: false, id: "" }, detailsData: { isShow: false, id: "" },
carshow:true, carshow: true,
isWindow:true, isWindow: true,
inputShow:true, inputShow: true,
meaushow:true, meaushow: true,
supplierShow:false, supplierShow: false,
confirmSupplierNames:"全部供应商", confirmSupplierNames: "全部供应商",
confirmSuppliers:"", confirmSuppliers: "",
supplierListLocal:[], supplierListLocal: [],
supplierIsBlue:false, supplierIsBlue: false,
popdetailbool:false popdetailbool: false
} };
}, },
computed: { computed: {
...mapState({ ...mapState({
loading:state=>state.lxshop.loading, loading: state => state.lxshop.loading,
supplierList: state => state.lxshop.supplierList, supplierList: state => state.lxshop.supplierList,
supplierIds: state => state.lxshop.supplierIds, supplierIds: state => state.lxshop.supplierIds,
isLyData: state => state.lxshop.isLyData, isLyData: state => state.lxshop.isLyData,
lyData:state => state.lxshop.lyData, lyData: state => state.lxshop.lyData,
isHaveData:state => state.lxshop.isHaveData, isHaveData: state => state.lxshop.isHaveData,
isShowAlert: state => state.gooddetail.isShowAlert
}) })
}, },
watch: { watch: {
supplierList(val){ isShowAlert(now) {
this.supplierListLocal=val if (now) {
this.detailsData = { isShow: false, id: "" };
}
},
supplierList(val) {
this.supplierListLocal = val;
}, },
supplierIds(val){ supplierIds(val) {
this.confirmSuppliers=val this.confirmSuppliers = val;
}, },
isLyData(val){ isLyData(val) {
if(val){ if (val) {
this.getData(); this.getData();
} }
} }
...@@ -112,87 +133,86 @@ ...@@ -112,87 +133,86 @@
created() { created() {
this.allSUpplier(); this.allSUpplier();
this.scrollFns(); this.scrollFns();
},
mounted() {
}, },
mounted() {},
methods: { methods: {
...mapMutations([ ...mapMutations(["resetData"]),
'resetData',
]),
//所有供应商 //所有供应商
allSUpplier:function(){ allSUpplier: function() {
this.$store.dispatch({ this.$store.dispatch({
type: 'supplierApi' type: "supplierApi"
}) });
}, },
getData:function(reset){ getData: function(reset) {
var ids_=[]; var ids_ = [];
if(this.confirmSuppliers){ if (this.confirmSuppliers) {
ids_=this.confirmSuppliers.split(","); ids_ = this.confirmSuppliers.split(",");
}
if (reset) {
this.resetData();
} }
if(reset){this.resetData()} if (ids_.length > 0) {
if(ids_.length>0){ for (var i = 0; i < ids_.length; i++) {
for(var i=0;i<ids_.length;i++){
this.$store.dispatch({ this.$store.dispatch({
type: 'searchLyEsData', type: "searchLyEsData",
k:ids_[i] k: ids_[i]
}) });
} }
} }
}, },
toSearchp:function(){ toSearchp: function() {
window.location.href="/v3/search/search_index.html?ptag=lxshop-topnav" window.location.href = "/v3/search/search_index.html?ptag=lxshop-topnav";
}, },
supplierShit:function(){ supplierShit: function() {
this.supplierShow=!this.supplierShow this.supplierShow = !this.supplierShow;
}, },
supplierCheck:function(ids){ supplierCheck: function(ids) {
var self=this; var self = this;
for(var i=0;i<self.supplierListLocal.length;i++){ for (var i = 0; i < self.supplierListLocal.length; i++) {
if(self.supplierListLocal[i].ids==ids){ if (self.supplierListLocal[i].ids == ids) {
self.supplierListLocal[i].isCheck=!self.supplierListLocal[i].isCheck; self.supplierListLocal[i].isCheck = !self.supplierListLocal[i]
.isCheck;
} }
} }
}, },
reset:function(){ reset: function() {
var self=this; var self = this;
for(var i=0;i<self.supplierListLocal.length;i++){ for (var i = 0; i < self.supplierListLocal.length; i++) {
self.supplierListLocal[i].isCheck=false; self.supplierListLocal[i].isCheck = false;
} }
}, },
confirm:function(){ confirm: function() {
var self=this; var self = this;
self.confirmSuppliers=""; self.confirmSuppliers = "";
self.confirmSupplierNames=""; self.confirmSupplierNames = "";
for(var i=0;i<self.supplierListLocal.length;i++){ for (var i = 0; i < self.supplierListLocal.length; i++) {
if(self.supplierListLocal[i].isCheck){ if (self.supplierListLocal[i].isCheck) {
self.confirmSuppliers+=','+self.supplierListLocal[i].ids; self.confirmSuppliers += "," + self.supplierListLocal[i].ids;
self.confirmSupplierNames+=','+self.supplierListLocal[i].name; self.confirmSupplierNames += "," + self.supplierListLocal[i].name;
} }
} }
self.confirmSuppliers=self.confirmSuppliers.slice(1); self.confirmSuppliers = self.confirmSuppliers.slice(1);
self.confirmSupplierNames=self.confirmSupplierNames.slice(1); self.confirmSupplierNames = self.confirmSupplierNames.slice(1);
if(!self.confirmSupplierNames){ if (!self.confirmSupplierNames) {
self.confirmSupplierNames="全部供应商"; self.confirmSupplierNames = "全部供应商";
this.supplierIsBlue=false; this.supplierIsBlue = false;
}else{ } else {
this.supplierIsBlue=true; this.supplierIsBlue = true;
} }
this.supplierShow=!this.supplierShow; this.supplierShow = !this.supplierShow;
if(this.confirmSuppliers==""){ if (this.confirmSuppliers == "") {
this.confirmSuppliers=this.supplierIds this.confirmSuppliers = this.supplierIds;
} }
this.getData(1); this.getData(1);
}, },
moreData:function(id_,p){ moreData: function(id_, p) {
console.log(id_) console.log(id_);
this.$store.dispatch({ this.$store.dispatch({
type: 'searchLyEsData', type: "searchLyEsData",
k:id_, k: id_,
p:p, p: p,
isMore:1 isMore: 1
}) });
}, },
placeOrder(id) { placeOrder(id) {
this.detailsData = { this.detailsData = {
...@@ -201,31 +221,30 @@ ...@@ -201,31 +221,30 @@
}; };
}, },
scrollFns() { scrollFns() {
var self=this; var self = this;
window.onscroll= function(){ window.onscroll = function() {
var t = document.documentElement.scrollTop||document.body.scrollTop; var t = document.documentElement.scrollTop || document.body.scrollTop;
if (t >= 200) { if (t >= 200) {
if(self.confirmSupplierNames!='全部供应商'){ if (self.confirmSupplierNames != "全部供应商") {
self.popdetailbool = true; self.popdetailbool = true;
} }
}else{ } else {
self.popdetailbool = false; self.popdetailbool = false;
} }
};
} }
}
}, },
components: { components: {
Header, Header,
GoodsOne, GoodsOne,
SideBar, SideBar,
goodsDetail 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