Commit d2018dc7 by 施宇

h5zyly

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