Commit dd82e9fa by LJM

Merge branch 'master' of http://git.ichunt.net/xiaokang/H5_2.0

parents f4ccffe9 ae34b9ef
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
height:48rpx; height:48rpx;
line-height: 48rpx; line-height: 48rpx;
margin-bottom: 12rpx; margin-bottom: 12rpx;
navigator{ .itemoneurl{
height:48rpx; height:48rpx;
line-height: 48rpx; line-height: 48rpx;
.goodsName{ .goodsName{
...@@ -189,6 +189,8 @@ ...@@ -189,6 +189,8 @@
position: relative; position: relative;
margin-left: 10rpx; margin-left: 10rpx;
top:10rpx; top:10rpx;
font-size: 22rpx;
font-weight: normal;
} }
} }
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
height:48rpx; height:48rpx;
line-height: 48rpx; line-height: 48rpx;
margin-bottom: 12rpx; margin-bottom: 12rpx;
navigator{ .itemoneurl{
height:48rpx; height:48rpx;
line-height: 48rpx; line-height: 48rpx;
.goodsName{ .goodsName{
...@@ -63,6 +63,8 @@ ...@@ -63,6 +63,8 @@
position: relative; position: relative;
margin-left: 10rpx; margin-left: 10rpx;
top:10rpx; top:10rpx;
font-size: 22rpx;
font-weight: normal;
} }
} }
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
position: relative; position: relative;
margin-left: 10rpx; margin-left: 10rpx;
top:10rpx; top:10rpx;
font-size: 22rpx;
font-weight: normal;
} }
} }
.iconfont{ .iconfont{
...@@ -133,15 +135,9 @@ ...@@ -133,15 +135,9 @@
line-height: 41rpx; line-height: 41rpx;
font-size: 24rpx; font-size: 24rpx;
color:$uni-color999; color:$uni-color999;
.pi1{width:139rpx;} .pi1{flex: 2;}
.pi2{width:318rpx;} .pi2{flex: 3;}
.w140{width:140rpx;} .pi3{flex: 3;}
.w120{width:120rpx;}
.hxj{
color:#C2C4CC!important;
font-weight: normal!important;
text-decoration-line: line-through;
}
&.titso{ &.titso{
color:$uni-color666; color:$uni-color666;
font-weight: 600; font-weight: 600;
...@@ -251,7 +247,7 @@ ...@@ -251,7 +247,7 @@
} }
} }
.kfbtn{ .kfbtn{
border: 2px solid $uni-colorwarning; border: 1px solid $uni-colorwarning;
color:$uni-colorwarning; color:$uni-colorwarning;
} }
} }
......
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
color:#fff; color:#fff;
font-size: 20rpx; font-size: 20rpx;
margin-left: 16rpx; margin-left: 16rpx;
font-size: 22rpx;
font-weight: normal;
} }
.tdbox{ .tdbox{
width: 120rpx; width: 120rpx;
...@@ -175,7 +177,6 @@ ...@@ -175,7 +177,6 @@
} }
.cons{ .cons{
border: 1rpx solid #C6C7CC; border: 1rpx solid #C6C7CC;
.groups{ .groups{
font-size: 24rpx; font-size: 24rpx;
color: $uni-color999; color: $uni-color999;
...@@ -318,6 +319,26 @@ ...@@ -318,6 +319,26 @@
} }
} }
&.act{
.headprice{
background: #FFF8F2!important;
}
.detailfoot .foo1 .checkbox .icon,.detailfoot .foo2 .pr uni-text{
color:#F98119;
}
.detailfoot .foo2 .pr input{
border-left: 1rpx solid #F98119;
border-right: 1rpx solid #F98119;
}
.detailfoot .foo2 .pr{
border: 1px solid #F98119;
}
.detailfoot .btnbox .totalpricebox .addcarbtn{
background: #F98119;
}
}
} }
......
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
height:48rpx; height:48rpx;
line-height: 48rpx; line-height: 48rpx;
margin-bottom: 12rpx; margin-bottom: 12rpx;
navigator{ .itemoneurl{
height:48rpx; height:48rpx;
line-height: 48rpx; line-height: 48rpx;
.goodsName{ .goodsName{
...@@ -159,6 +159,7 @@ ...@@ -159,6 +159,7 @@
position: relative; position: relative;
margin-left: 10rpx; margin-left: 10rpx;
top:10rpx; top:10rpx;
font-size: 22rpx;
} }
} }
......
...@@ -2,64 +2,64 @@ ...@@ -2,64 +2,64 @@
<view> <view>
<uni-popup ref="popup" type="bottom"> <uni-popup ref="popup" type="bottom">
<view class="addcar " > <view class="addcar " >
<view class="addcar-pop "> <view class="addcar-pop " :class="{'actpop':obj.ac_type==10}">
<view class="addcarpopbox" > <view class="addcarpopbox" >
<view class="cons" > <view class="cons" >
<view class="pophead row bothSide"> <view class="pophead row bothSide">
<view class="tits row"> <view class="tits row">
<text class="goodsName elep">lm358asdasdasdasdasdads</text> <text class="goodsName elep">{{obj.goods_name}}</text>
<text class="actag">91折</text> <text class="actag" v-if="obj.ac_type==10">{{obj.activity_info.sign}}</text>
</view> </view>
<text class="icon iconfont icon-xxx" @click="close()"></text> <text class="icon iconfont icon-xxx" @click="close()"></text>
</view> </view>
<view class="popcons"> <view class="popcons">
<view class="infobox"> <view class="infobox" @click.stop="clickbug">
<view class="itemone row bothSide"> <view class="itemone row bothSide">
<view class="il elep"> <view class="il elep">
<text class="label">品牌:</text> <text class="label">品牌:</text>
<text>Rice Lake Weighing</text> <text>{{obj.brand_name}}</text>
</view> </view>
<view class="ir"> <view class="ir">
<text class="label">ECCN:</text> <text class="label">ECCN:</text>
<text>ERA3006</text> <text>{{obj.eccn||'--'}}</text>
</view> </view>
</view> </view>
<view class="itemone row bothSide"> <view class="itemone row bothSide">
<view class="il elep"> <view class="il elep">
<text class="label">供应商:</text> <text class="label">供应商:</text>
<text>Mouser</text> <text>{{obj.supplier_name||'--'}}</text>
</view> </view>
<view class="ir"> <view class="ir">
<text class="label">递增量:</text> <text class="label">递增量:</text>
<text>66666</text> <text>{{obj.multiple||obj.mpl}}</text>
</view> </view>
</view> </view>
<view class="itemone row bothSide"> <view class="itemone row bothSide">
<view class="il elep"> <view class="il elep">
<text class="label">封装:</text> <text class="label">封装:</text>
<text>asdad</text> <text>{{obj.encap||'--'}}</text>
</view> </view>
<view class="ir"> <view class="ir">
<text class="label">起订量:</text> <text class="label">起订量:</text>
<text>500</text> <text>{{obj.min_buy}}</text>
</view> </view>
</view> </view>
<view class="itemone row bothSide"> <view class="itemone row bothSide">
<view class="il elep"> <view class="il elep">
<text class="label">包装:</text> <text class="label">包装:</text>
<text>Cut Tape</text> <text>{{obj.packing_name||'--'}}</text>
</view> </view>
<view class="ir"> <view class="ir">
<text class="label">库存:</text> <text class="label">库存:</text>
<text class="kcty">654564654</text> <text class="kcty">{{obj.goods_number}}</text>
</view> </view>
</view> </view>
<view class="itemone row bothSide"> <view class="itemone row bothSide">
<view class="il elep"> <view class="il elep">
<text class="label">类别:</text> <text class="label">类别:</text>
<text>Cut Tape</text> <text>{{obj.class1_name||obj.class2_name||'--'}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -67,19 +67,19 @@ ...@@ -67,19 +67,19 @@
<view class="pricet row"> <view class="pricet row">
<view class="pl row"> <view class="pl row">
<text class="label">交期:</text> <text class="label">交期:</text>
<view class="row hqitem"> <view class="row hqitem" @click="tabhuoqi(1)" v-if="obj.delivery_cn">
<text class="checkbox checked"><text class="icon iconfont icon-xzs"></text></text> <text class="checkbox " :class="{'checked':isdl==1}"><text class="icon iconfont icon-xzs"></text></text>
<text>大陆3-5日</text> <text>大陆{{obj.delivery_time['1']}}</text>
</view> </view>
<view class="row hqitem"> <view class="row hqitem" @click="tabhuoqi(2)" v-if="obj.delivery_hk">
<text class="checkbox"></text> <text class="checkbox" :class="{'checked':isdl==2}"><text class="icon iconfont icon-xzs"></text></text>
<text>香港3-5日</text> <text>香港{{obj.delivery_time['2']}}</text>
</view> </view>
</view> </view>
<view class="pr row " > <view class="pr row " >
<text>-</text> <text @click.stop="stepgo('small')">-</text>
<input type="number" /> <input type="number" v-model="num" @input="onInput"/>
<text>+</text> <text @click.stop="stepgo('big')">+</text>
</view> </view>
</view> </view>
<view class="priceb"> <view class="priceb">
...@@ -88,33 +88,25 @@ ...@@ -88,33 +88,25 @@
<view class="pi2">大陆交货(含税)</view> <view class="pi2">大陆交货(含税)</view>
<view class="pi3">香港交货</view> <view class="pi3">香港交货</view>
</view> </view>
<view class="pitem row " > <view v-if="pticearr.length>0">
<view class="pi1">50000+:</view> <view class="pitem row " :class="{'act':item.checked}" v-for="(item,index) in pticearr" :key="index">
<view class="pi2 row"><text class="w140">¥130.856</text><text class="hxj">¥130.856</text></view> <view class="pi1">{{item.purchases}}+:</view>
<view class="pi3 row"> <text class="w120">$130.856</text><text class="hxj">$130.856</text></view> <view class="pi2 row"><text class="w140">{{item.price_ac||item.price_cn||'--'}}</text></view>
<view class="pi3 row"> <text class="w120">${{item.price_ac_us||item.price_us||'--'}}</text></view>
</view> </view>
<view class="pitem row " >
<view class="pi1">50000+:</view>
<view class="pi2 row"><text class="w140">¥130.856</text><text class="hxj">¥130.856</text></view>
<view class="pi3 row"> <text class="w120">$130.856</text><text class="hxj">$130.856</text></view>
</view> </view>
<view class="pitem row act" > <view class="noprice" v-if="pticearr.length==0">
<view class="pi1">50000+:</view>
<view class="pi2 row"><text class="w140">¥130.856</text><text class="hxj">¥130.856</text></view>
<view class="pi3 row"> <text class="w120">$130.856</text><text class="hxj">$130.856</text></view>
</view>
<view class="noprice" style="display:none;">
<text class="icon iconfont icon-sanjiaoji"></text> <text class="icon iconfont icon-sanjiaoji"></text>
暂无阶梯价格 暂无阶梯价格
</view> </view>
</view> </view>
</view> </view>
<view class="btnbox"> <view class="btnbox">
<view class="totalpricebox row bothSide" > <view class="totalpricebox row bothSide" v-if="obj.is_buy==1">
<view class="hej">合计:<text class="tje">¥3235.6856</text></view> <view class="hej">合计:<text class="tje">{{isdl==1?'¥':'$'}}{{totalmoney}}</text></view>
<view class="addcarbtn">加入购物车</view> <view class="addcarbtn" @click.stop="addCar">加入购物车</view>
</view> </view>
<a class="kfbtn row verCenter rowCenter" href="#" target="_blank" style="display:none"> <a class="kfbtn row verCenter rowCenter" v-else :href="kfqqurl" target="_blank" >
<text class="icon iconfont icon-qq"></text> <text class="icon iconfont icon-qq"></text>
联系客服 联系客服
</a> </a>
...@@ -142,13 +134,84 @@ ...@@ -142,13 +134,84 @@
}, },
data() { data() {
return { return {
timeout:"",//请求延迟定时器
obj:{},
num:1,
isdl:1,
pticearr:[],
totalmoney:0.00,
kfqqurl:"",
} }
}, },
onLoad: function() { onLoad: function() {
}, },
mounted() {
setTimeout(() => {
this.kfqqurl=this.$globalData.kfqq_xk
}, 500);
},
methods: { methods: {
clickbug(){
return false;
},
onInput(e){
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
let mpl = Number(this.obj.multiple||this.obj.mpl);//倍数 加减的数量基数
let stock = Number(this.obj.goods_number);//库存
let moq = Number(this.obj.min_buy);//起订量
let value_ = Number(e.detail.value);//当前的数量
console.log(value_)
value_ = Math.ceil(value_ / mpl) * mpl;//失去焦点数量
this.num = value_;//最终的数量
if (value_ < moq) {
this.num = moq
}
if (value_ > stock) {
this.num = Math.floor(stock / mpl) * mpl;
}
this.pticeui()
}, 800);
},
stepgo(type){
let mpl = Number(this.obj.multiple||this.obj.mpl);//倍数 加减的数量基数
let stock = Number(this.obj.goods_number);//库存
let moq = Number(this.obj.min_buy);//起订量
let value_ = this.num;//当前的数量
if(type=="small"){
//减法
var down_value = value_ - mpl;//减过后的值
if (down_value < moq) {
this.num = moq;
uni.showToast({
title: '数量不能小于起订量',
duration: 2000,
icon:"none"
})
} else {
this.num = down_value
}
}else{
//加法
var up_value = value_ + mpl;//加过后的值
if (up_value > stock) {
uni.showToast({
title: '数量不能大于库存',
duration: 2000,
icon:"none"
})
this.num = Math.floor(stock / mpl) * mpl;
} else {
this.num = up_value
}
}
this.pticeui()
},
tabhuoqi(guid){
this.isdl=guid;
this.pticeui()
},
open() { open() {
this.$refs.popup.open('bottom'); this.$refs.popup.open('bottom');
}, },
...@@ -160,10 +223,99 @@ ...@@ -160,10 +223,99 @@
this.getData(goods_id) this.getData(goods_id)
} }
}, },
getData:function(goods_id){ addCar(){
let datax={
id:this.obj.goods_id,
num:this.num,
buy:1,
delivery_place:this.isdl,
isZy:(this.obj.goods_type==1||this.obj.goods_type==2)?0:1,
}
this.request(Api_Url + "/cart/add", 'POST', datax,true,true).then(res => {
if (res.err_code == 0) {
uni.showToast({
title: res.err_msg,
duration: 2000,
icon:"success"
})
this.close()
}else{
uni.showToast({
title: res.err_msg,
duration: 2000,
icon:"error"
})
}
});
},
//计算阶梯价格 总价
pticeui(){
if(this.pticearr.length==0){return}
//渲染阶梯价格
this.pticearr.forEach((item,index)=>{
item.checked=false
})
this.pticearr.forEach((item,index)=>{
let value_=this.num
let pus=item.purchases
var next_pus=""
var prev_pus=""
if(index!=this.pticearr.length-1){
next_pus=this.pticearr[index+1].purchases
}
if(index!=0){
prev_pus=this.pticearr[index-1].purchases
}
if (value_ == pus) {
item.checked=true
return false;
}
if(index==0){
if(value_>pus){
item.checked=true
return false;
}
}
if(index==this.pticearr.length-1){
if(value_<pus){
item.checked=true
return false;
}
}
if (value_ < pus && value_ > next_pus) {
this.pticearr[index+1].checked=true
return false;
}
if (value_ > pus && value_ < prev_pus) {
item.checked=true
return false;
}
})
//计算价格
let actitem={};
this.pticearr.forEach((item,index)=>{
if(item.checked){
actitem=item
}
})
let price_=Number(this.isdl==1?(actitem.price_ac||actitem.price_cn||0):(actitem.price_ac_us||actitem.price_us||0));
this.totalmoney=(price_*this.num).toFixed(2)
},
getData(goods_id){
//110225 1168482547080619839
this.request(Api_Url + "/goods/detail", 'POST', {id:goods_id},true,true).then(res => { this.request(Api_Url + "/goods/detail", 'POST', {id:goods_id},true,true).then(res => {
if (res.err_code == 0) { if (res.err_code == 0) {
this.obj=res.data;
this.num=this.obj.min_buy
this.pticearr=res.data.tiered||[]
if((!this.obj.delivery_cn)&&this.obj.delivery_hk){
this.isdl=2
}
this.open() this.open()
this.pticeui()
}else{ }else{
} }
......
...@@ -4,40 +4,38 @@ ...@@ -4,40 +4,38 @@
<text v-back class="icon iconfont icon-arrleft"></text> <text v-back class="icon iconfont icon-arrleft"></text>
<view class="inputbox row verCenter" > <view class="inputbox row verCenter" >
<text class="icon iconfont icon-search "></text> <text class="icon iconfont icon-search "></text>
<input placeholder="在此品牌下搜索型号" @focus="isSearch=!isSearch" @blur="isSearch=!isSearch" /> <input placeholder="在此品牌下搜索型号" v-model="goods_name" @focus="isSearch=!isSearch" @blur="blurinputs" />
</view> </view>
<navigator url="/joincart"> <navigator url="/joincart">
<text class="icon iconfont icon-car"></text> <text class="icon iconfont icon-car"></text>
</navigator> </navigator>
<view class="searchbtn">搜索</view> <view class="searchbtn" @click.stop="searchlistgo()">搜索</view>
</view> </view>
<view class="brandinfo"> <view class="brandinfo">
<view class="tp1 row bothSide verCenter"> <view class="tp1 row bothSide verCenter">
<image src="https://img.ichunt.com/images/brands/174.png"></image> <image :src="brandInfo.brand_logo"></image>
<text>关于ADI</text> <text>关于{{brandInfo.brand_name}}</text>
</view>
<view class="tp2 " :class="{'zazts elep2':!zkshow}">
Analog Devices以追求创新、品质和卓越为使命,是一家历史悠久,成长迅速的技术公司。Analog Devices的客户逾Analog Devices以追求创新、品质和卓越为使命,是一家历史悠久,成长迅速的技术公司。Analog Devices的客户逾……
</view> </view>
<view class="tp2 " :class="{'zazts elep2':!zkshow}" v-html="brandInfo.brand_desc">asddddddddddd</view>
<view class="zkbtnsi row verCenter" v-show="!zkshow" @click="zkshow=!zkshow">展开详情<text class="icon iconfont icon-arrbot"></text></view> <view class="zkbtnsi row verCenter" v-show="!zkshow" @click="zkshow=!zkshow">展开详情<text class="icon iconfont icon-arrbot"></text></view>
<view class="zkbtnsi row verCenter" v-show="zkshow" @click="zkshow=!zkshow">收起详情<text class="icon iconfont icon-arrtop"></text></view> <view class="zkbtnsi row verCenter" v-show="zkshow" @click="zkshow=!zkshow">收起详情<text class="icon iconfont icon-arrtop"></text></view>
</view> </view>
<view class="datasc"> <view class="datasc">
<view class="shiftbox row avarage "> <view class="shiftbox row avarage ">
<view class="rank1 row ">综合</view> <view class="rank1 row " @click="tab(1)" :class="{'act':tabType==1}">综合</view>
<view class="rank2 row sjpx act top">库存</view> <view class="rank2 row sjpx" @click="tab(2)" :class="{'act':tabType==2,'top':stocksort,'bot':(!stocksort)}">库存</view>
<view class="rank3 row sjpx act bot">价格</view> <view class="rank3 row sjpx " @click="tab(3)" :class="{'act':tabType==3,'top':pricesort,'bot':(!pricesort)}">价格</view>
</view> </view>
<view class="databox branddataboxs" > <view class="databox branddataboxs" >
<view class="group" v-for="(item,index) in list" :key="index"> <view class="group" v-for="(item,index) in list" :key="index">
<view class="toprs1 row bothSide"> <view class="toprs1 row bothSide">
<navigator :url="'/item?goods_id='+item.goods_id" class="row"> <a :href="'/#/item/'+item.goods_id" class="row itemoneurl">
<view class="goodsName elep">{{item.goods_name}}</view> <view class="goodsName elep">{{item.goods_name}}</view>
<view class="actag" v-if="item.ac_type==10">{{item.activity_info.sign}}</view> <view class="actag" v-if="item.ac_type==10">{{item.activity_info.sign}}</view>
</navigator> </a>
<view class="addcar" v-if="item.is_buy==1" @click="addcarpopfunc(item.goods_id)">加入购物车</view> <view class="addcar" v-if="item.is_buy==1" @click="addcarpopfunc(item.goods_id)">加入购物车</view>
<view class="kfbtns" v-if="item.is_buy!=1" @click="addcarpopfunc(item.goods_id)">联系客服</view> <a class="kfbtns" v-if="item.is_buy!=1" :href="kfurl">联系客服</a>
</view> </view>
<view class="toprs2 row bothSide"> <view class="toprs2 row bothSide">
<view class="l2 elep"><text class="labelsd">品牌:</text>{{item.brand_name}}</view> <view class="l2 elep"><text class="labelsd">品牌:</text>{{item.brand_name}}</view>
...@@ -85,12 +83,16 @@ ...@@ -85,12 +83,16 @@
zkshow:false, zkshow:false,
kfurl:"", kfurl:"",
list:[], list:[],
brandInfo:{},
isInitLogin:0, isInitLogin:0,
class_id1:"",
class_id2:"",
page:1, page:1,
page_size:10, page_size:10,
isLoadEnd: false // 是否已全部加载完 isLoadEnd: false, // 是否已全部加载完
goods_name:"",
tabType:1,
stocksort:false,//库存升序 false 降序
pricesort:false,//价格升序 false 降序
} }
}, },
onPageScroll(e) { onPageScroll(e) {
...@@ -100,7 +102,11 @@ ...@@ -100,7 +102,11 @@
}, },
onShow() { onShow() {
this.getData(); this.getData();
this.getqqurl() },
mounted() {
setTimeout(() => {
this.kfurl=this.$globalData.kfqq_xk
}, 500);
}, },
onLoad: function(option) { onLoad: function(option) {
this.brand_id = this.$Route.query.brand_id; this.brand_id = this.$Route.query.brand_id;
...@@ -115,25 +121,51 @@ ...@@ -115,25 +121,51 @@
this.getData(); this.getData();
}, },
methods: { methods: {
getqqurl:function(){ blurinputs(){
this.request(Ichunt_Api + "/api/common/data", 'GET', {}, ).then(res => { setTimeout(()=>{
if (res.err_code === 0) { this.isSearch=!this.isSearch
this.kfurl=res.data.kfqq_xk.data },100)
},
searchlistgo(){
console.log(666)
this.page=1
this.getData()
},
tab(type){
this.tabType=type;
if(type==1){
}else if(type==2){
this.stocksort=!this.stocksort;
}else if(type==3){
this.pricesort=!this.pricesort
} }
}); this.page=1
this.getData()
}, },
getData() { getData() {
this.request(Api_Es + "/optimum/goods", 'POST', {class_id1:13396,page:this.page,page_size:this.page_size},true,true).then(res => { let data_={
'standard_brand_id/condition':this.brand_id,
'goods_name/condition':this.goods_name,
'offset':this.page_size,
'p':this.page
}
if(this.tabType==2){
data_['stock_sort']=this.stocksort?"desc":"asc"
}
if(this.tabType==3){
data_['single_sort']=this.pricesort?"asc":"desc"
}
this.request(Api_Es+ "/label/brandInfo", 'POST', data_,true,true).then(res => {
this.isInitLogin=1; this.isInitLogin=1;
if (res.error_code == 0) { if (res.error_code == 0) {
this.class_id1_name=res.data.class_id1_name; this.brandInfo=res.data.brand_info;
this.class_id2_name=res.data.class_id2_name; let newDataList = res.data.goods_info||[];
this.page++;
let newDataList = res.data.goods_lists||[];
this.list = this.list.concat(newDataList); this.list = this.list.concat(newDataList);
if (newDataList.length <this.page_size) { if ((this.page*this.page_size) >=Number(res.data.goods_count)) {
this.isLoadEnd = true; this.isLoadEnd = true;
} }
this.page++;
}else{ }else{
this.list=[] this.list=[]
} }
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
<view class="databox"> <view class="databox">
<view class="group" v-for="(item,index) in list" :key="index"> <view class="group" v-for="(item,index) in list" :key="index">
<view class="toprs1 row bothSide"> <view class="toprs1 row bothSide">
<navigator :url="'/item?goods_id='+item.goods_id" class="row"> <a :href="'/#/item/'+item.goods_id" class="row itemoneurl">
<view class="goodsName elep">{{item.goods_name}}</view> <view class="goodsName elep">{{item.goods_name}}</view>
<view class="actag" v-if="item.ac_type==10">{{item.activity_info.sign}}</view> <view class="actag" v-if="item.ac_type==10">{{item.activity_info.sign}}</view>
</navigator> </a>
<view class="addcar" v-if="item.is_buy==1" @click="addcarpopfunc(item.goods_id)">加入购物车</view> <view class="addcar" v-if="item.is_buy==1" @click="addcarpopfunc(item.goods_id)">加入购物车</view>
<view class="kfbtns" v-if="item.is_buy!=1" @click="addcarpopfunc(item.goods_id)">联系客服</view> <a class="kfbtns" :href="kfurl" target="_blank" v-if="item1.is_buy!=1">联系客服</a>
</view> </view>
<view class="toprs2 row bothSide"> <view class="toprs2 row bothSide">
<view class="l2 elep"><text class="labelsd">品牌:</text>{{item.brand_name}}</view> <view class="l2 elep"><text class="labelsd">品牌:</text>{{item.brand_name}}</view>
...@@ -82,7 +82,12 @@ ...@@ -82,7 +82,12 @@
}, },
onShow() { onShow() {
this.getData(); this.getData();
this.getqqurl() },
mounted() {
setTimeout(() => {
this.kfurl=this.$globalData.kfqq_xk
}, 500);
}, },
onLoad: function(option) { onLoad: function(option) {
this.class_id1 = option.class_id1||""; this.class_id1 = option.class_id1||"";
...@@ -90,25 +95,18 @@ ...@@ -90,25 +95,18 @@
console.log(this.class_id1,this.class_id2) console.log(this.class_id1,this.class_id2)
}, },
methods: { methods: {
getqqurl:function(){
this.request(Ichunt_Api + "/api/common/data", 'GET', {}, ).then(res => {
if (res.err_code === 0) {
this.kfurl=res.data.kfqq_xk.data
}
});
},
getData() { getData() {
this.request(Api_Es + "/optimum/goods", 'POST', {class_id1:13396,page:this.page,page_size:this.page_size},true,true).then(res => { this.request(Api_Es + "/optimum/goods", 'POST', {class_id1:this.class_id1,class_id2:this.class_id2,page:this.page,page_size:this.page_size},true,true).then(res => {
this.isInitLogin=1; this.isInitLogin=1;
if (res.error_code == 0) { if (res.error_code == 0) {
this.class_id1_name=res.data.class_id1_name; this.class_id1_name=res.data.class_id1_name;
this.class_id2_name=res.data.class_id2_name; this.class_id2_name=res.data.class_id2_name;
this.page++;
let newDataList = res.data.goods_lists||[]; let newDataList = res.data.goods_lists||[];
this.list = this.list.concat(newDataList); this.list = this.list.concat(newDataList);
if (newDataList.length <this.page_size) { if ((this.page*this.page_size) >=Number(res.data.page.total)) {
this.isLoadEnd = true; this.isLoadEnd = true;
} }
this.page++;
}else{ }else{
this.list=[] this.list=[]
} }
......
<template> <template>
<view class="detailpage"> <view class="detailpage " :class="{'act':obj.ac_type==10}">
<drag-button-follow follow="left,right" className="drag-button" class="drag-button" :url="kfurl"></drag-button-follow> <drag-button-follow follow="left,right" className="drag-button" class="drag-button" :url="kfurl"></drag-button-follow>
<view class="detailhead row verCenter bothSide"> <view class="detailhead row verCenter bothSide">
<text v-back class="icon iconfont icon-arrleft"></text> <text v-back class="icon iconfont icon-arrleft"></text>
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<view class="cons"> <view class="cons">
<view class="tits row verCenter bothSide"> <view class="tits row verCenter bothSide">
<view class="row verCenter"> <view class="row verCenter">
<text class="goodsName elep">lm358asda</text> <text class="goodsName elep">{{obj.sku_name||obj.goods_name}}</text>
<text class="actag">91折</text> <text class="actag" v-if="obj.ac_type==10">{{obj.activity_info.sign}}</text>
</view> </view>
<view class="tdbox row verCenter" @click="open()"> <view class="tdbox row verCenter" @click="open()">
<view class="round row verCenter rowCenter"><text class="icon iconfont icon-tdzty"></text></view> <view class="round row verCenter rowCenter"><text class="icon iconfont icon-tdzty"></text></view>
...@@ -22,17 +22,17 @@ ...@@ -22,17 +22,17 @@
</view> </view>
<view class="attrbox row"> <view class="attrbox row">
<view class="atl"> <view class="atl">
<view class="item row">品牌:<text class="">Rice Lake Weighing</text></view> <view class="item row">品牌:<text class="">{{obj.standard_brand_name||obj.brand_name}}</text></view>
<view class="item row">供应商:<text class="">Rice Lake Weighing</text></view> <view class="item row">供应商:<text class="">{{obj.supplier_name}}</text></view>
<view class="item row">封装:<text class="">Rice Lake Weighing</text></view> <view class="item row">封装:<text class="">{{obj.encap||'--'}}</text></view>
<view class="item row">包装:<text class="">Rice Lake Weighing</text></view> <view class="item row">包装:<text class="">{{obj.packing||'--'}}</text></view>
<view class="item row">ECCN:<text class="">Rice Lake Weighing</text></view> <view class="item row">ECCN:<text class="">{{obj.eccn||'--'}}</text></view>
<view class="item row">库存:<text class="stock">500</text></view> <view class="item row">库存:<text class="stock">{{obj.stock_raw}}</text></view>
<view class="item row">类别:<text class="">Rice Lake Weighing</text></view> <view class="item row">类别:<text class="">{{obj.class_name||'--'}}</text></view>
</view> </view>
<view class="atr"> <view class="atr">
<image src="https://img.ichunt.com/images/cms/202304/07/9ecd831432bc35dcd9bac28a0136e57d.png"></image> <image :src="obj.goods_images||'https://static.ichunt.com/dist/res/home/images/goods_default.png'"></image>
<a href="" target="_blank" class="row rowCenter verCenter"> <a :href="obj.pdf" target="_blank" class="row rowCenter verCenter" v-if="obj.pdf">
<text class="icon iconfont icon-down"></text> <text class="icon iconfont icon-down"></text>
<text>下载数据手册</text> <text>下载数据手册</text>
</a> </a>
...@@ -45,59 +45,37 @@ ...@@ -45,59 +45,37 @@
<view class="ptiem">香港交货</view> <view class="ptiem">香港交货</view>
</view> </view>
<view class="bodyprice"> <view class="bodyprice">
<view class="pricegroup row"> <view class="pricegroup row" :class="{'act':item.checked}" v-for="(item,index) in pticearr" :key="index" v-show="(jtpricezk)||((!jtpricezk)&&index<3)">
<view class="ptiem ptiemone">5000+:</view> <view class="ptiem ptiemone">{{item.purchases_raw}}+:</view>
<view class="ptiem">¥140.425</view> <view class="ptiem">{{item.price_ac||item.price_cn||'--'}}</view>
<view class="ptiem">$17.2125</view> <view class="ptiem">${{item.price_ac_us||item.price_us||'--'}}</view>
</view>
<view class="pricegroup row">
<view class="ptiem ptiemone">5000+:</view>
<view class="ptiem">¥140.425</view>
<view class="ptiem">$17.2125</view>
</view>
<view class="pricegroup row act">
<view class="ptiem ptiemone">5000+:</view>
<view class="ptiem">¥140.425</view>
<view class="ptiem">$17.2125</view>
</view>
<view class="pricegroup row">
<view class="ptiem ptiemone">5000+:</view>
<view class="ptiem">¥140.425</view>
<view class="ptiem">$17.2125</view>
</view> </view>
</view> </view>
<view class="morebtn row verCenter"> <view class="morebtn row verCenter" @click.stop="jtpricezk=!jtpricezk" v-if="pticearr.length>3">
<text>更少阶梯价格</text> <text>{{jtpricezk?'更少阶梯价格':'更多阶梯价格'}}</text>
<text class="icon iconfont icon-arrtop"></text> <text class="icon iconfont " :class="{'icon-arrtop':jtpricezk,'icon-arrbot':!jtpricezk}"></text>
</view> </view>
<view class="noprice" style="display:none;"> <view class="noprice" v-if="pticearr.length==0&&obj.goods_name">
<text class="icon iconfont icon-sanjiaoji"></text> <text class="icon iconfont icon-sanjiaoji"></text>
暂无阶梯价格 暂无阶梯价格
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="seoattr"> <view class="seoattr" v-if="obj.attrs&&obj.attrs.length>0" :style="!zkattr?'padding-bottom:0px;':''">
<view class="tio row bothSide verCenter"> <view class="tio row bothSide verCenter">
<text>参数</text> <text>参数</text>
<text class="icon iconfont icon-arrtop"></text> <text class="icon iconfont " :class="{'icon-arrtop':zkattr,'icon-arrbot':!zkattr}" @click.stop="zkattr=!zkattr"></text>
</view>
<view class="cons">
<view class="groups row">
<text class="one1">封装规格:</text>
<text>0603</text>
</view>
<view class="groups row">
<text class="one1">封装规格:</text>
<text>0603</text>
</view> </view>
<view class="groups row"> <view class="cons" v-show="zkattr">
<text class="one1">封装规格:</text> <view class="groups row" v-for="(item,index) in obj.attrs" :key="index">
<text>0603</text> <text class="one1">{{item.attr_name}}</text>
<text>{{item.attr_value}}</text>
</view> </view>
<view class="groups row"> <view class="groups row" v-if="obj.spu_brief">
<text class="one1">介绍:</text> <text class="one1">介绍:</text>
<text>ad上帝发誓法师法师地方上帝发誓法师法师地方上帝发誓法师法师地方上帝发誓法师法师地方上帝发誓法师法师地方上帝发誓法师法师地方上帝发誓法师法师地方</text> <text>{{obj.spu_brief}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -107,30 +85,30 @@ ...@@ -107,30 +85,30 @@
<view class="foo1 row bothSide verCenter"> <view class="foo1 row bothSide verCenter">
<view>交期:</view> <view>交期:</view>
<view class="row"> <view class="row">
<view class="row hqitem"> <view class="row hqitem" @click.stop="tabhuoqi(1)" v-if="obj.cn_delivery_time">
<text class="checkbox checked"><text class="icon iconfont icon-xzs"></text></text> <text class="checkbox " :class="{'checked':isdl==1}"><text class="icon iconfont icon-xzs"></text></text>
<text>大陆3-5日</text> <text>大陆3-5日</text>
</view> </view>
<view class="row hqitem"> <view class="row hqitem" @click.stop="tabhuoqi(2)" v-if="obj.hk_delivery_time">
<text class="checkbox"></text> <text class="checkbox" :class="{'checked':isdl==2}"><text class="icon iconfont icon-xzs"></text></text>
<text>香港3-5日</text> <text>香港3-5日</text>
</view> </view>
</view> </view>
</view> </view>
<view class="foo2 row bothSide verCenter"> <view class="foo2 row bothSide verCenter">
<view>数量:<text class="f9">(起订量:</text>400 <text class="f9 ml24">递增量:</text>1<text class="f9">)</text></view> <view @click="clickbug()">数量:<text class="f9">(起订量:</text>{{obj.moq_mip}}<text class="f9 ml24">递增量:</text>{{obj.multiple_mip||obj.mpq_mip}}<text class="f9">)</text></view>
<view class="pr row " > <view class="pr row " >
<text>-</text> <text @click.stop="stepgo('small')">-</text>
<input type="number" value="1"/> <input type="number" v-model="num" @input="onInput"/>
<text>+</text> <text @click.stop="stepgo('big')">+</text>
</view> </view>
</view> </view>
<view class="btnbox"> <view class="btnbox">
<view class="totalpricebox row bothSide verCenter" > <view class="totalpricebox row bothSide verCenter" v-if="obj.is_buy==1">
<view class="hej">合计:<text class="tje">¥3235.6856</text></view> <view class="hej">合计:<text class="tje">{{isdl==1?'¥':'$'}}{{totalmoney}}</text></view>
<view class="addcarbtn">加入购物车</view> <view class="addcarbtn" @click.stop="addCar">加入购物车</view>
</view> </view>
<a class="kfbtn" style="display:none"> <a class="kfbtn" v-else :href="kfurl" target="_blank" >
<text class="icon iconfont icon-qq"></text> <text class="icon iconfont icon-qq"></text>
联系客服 联系客服
</a> </a>
...@@ -161,10 +139,182 @@ ...@@ -161,10 +139,182 @@
export default { export default {
data() { data() {
return { return {
jtpricezk:true,
zkattr:true,
timeout:"",//请求延迟定时器
kfurl:"", kfurl:"",
goods_id:"",
obj:{},
pticearr:[],
num:1,
isdl:1,
totalmoney:0
} }
}, },
mounted() {
setTimeout(() => {
this.kfurl = this.$globalData.kfqq_xk;
}, 500);
},
onShow() {
this.goods_id = this.$Route.query.goods_id;
this.getData();
},
methods: { methods: {
clickbug(){
return false;
},
onInput(e){
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
let mpl = Number(this.obj.multiple_mip||this.obj.mpq_mip);//倍数 加减的数量基数
let stock = Number(this.obj.stock_raw);//库存
let moq = Number(this.obj.moq_mip);//起订量
let value_ = Number(e.detail.value);//当前的数量
console.log(value_)
value_ = Math.ceil(value_ / mpl) * mpl;//失去焦点数量
this.num = value_;//最终的数量
if (value_ < moq) {
this.num = moq
}
if (value_ > stock) {
this.num = Math.floor(stock / mpl) * mpl;
}
this.pticeui()
}, 800);
},
stepgo(type){
let mpl = Number(this.obj.multiple_mip||this.obj.mpq_mip);//倍数 加减的数量基数
let stock = Number(this.obj.stock_raw);//库存
let moq = Number(this.obj.moq_mip);//起订量
let value_ = this.num;//当前的数量
if(type=="small"){
//减法
var down_value = value_ - mpl;//减过后的值
if (down_value < moq) {
this.num = moq;
uni.showToast({
title: '数量不能小于起订量',
duration: 2000,
icon:"none"
})
} else {
this.num = down_value
}
}else{
//加法
var up_value = value_ + mpl;//加过后的值
if (up_value > stock) {
uni.showToast({
title: '数量不能大于库存',
duration: 2000,
icon:"none"
})
this.num = Math.floor(stock / mpl) * mpl;
} else {
this.num = up_value
}
}
this.pticeui()
},
tabhuoqi(guid){
this.isdl=guid;
this.pticeui()
},
addCar(){
let datax={
id:this.obj.goods_id,
num:this.num,
buy:1,
delivery_place:this.isdl,
isZy:(this.obj.goods_type==1||this.obj.goods_type==2)?0:1,
}
this.request(Api_Url + "/cart/add", 'POST', datax,true,true).then(res => {
if (res.err_code == 0) {
uni.showToast({
title: res.err_msg,
duration: 2000,
icon:"success"
})
this.close()
}else{
uni.showToast({
title: res.err_msg,
duration: 2000,
icon:"error"
})
}
});
},
//计算阶梯价格 总价
pticeui(){
if(this.pticearr.length==0){return}
//渲染阶梯价格
this.pticearr.forEach((item,index)=>{
item.checked=false
})
this.pticearr.forEach((item,index)=>{
let value_=this.num
let pus=item.purchases_raw
var next_pus=""
var prev_pus=""
if(index!=this.pticearr.length-1){
next_pus=this.pticearr[index+1].purchases_raw
}
if(index!=0){
prev_pus=this.pticearr[index-1].purchases_raw
}
if (value_ == pus) {
item.checked=true
return false;
}
if(index==0){
if(value_>pus){
item.checked=true
return false;
}
}
if(index==this.pticearr.length-1){
if(value_<pus){
item.checked=true
return false;
}
}
if (value_ < pus && value_ > next_pus) {
this.pticearr[index+1].checked=true
return false;
}
if (value_ > pus && value_ < prev_pus) {
item.checked=true
return false;
}
})
//计算价格
let actitem={};
this.pticearr.forEach((item,index)=>{
if(item.checked){
actitem=item
}
})
let price_=Number(this.isdl==1?(actitem.price_ac||actitem.price_cn||0):(actitem.price_ac_us||actitem.price_us||0));
this.totalmoney=(price_*this.num).toFixed(2)
},
getData(){
this.request(Ichunt_Api + '/api/sku/detail', 'GET', {goods_id:this.goods_id},true).then(res => {
if (res.err_code === 0) {
this.obj=res.data.sku
this.pticearr=this.obj.ladder_price||[]
this.num=this.obj.moq_mip
if((!this.obj.cn_delivery_time)&&this.obj.hk_delivery_time){
this.isdl=2
}
this.pticeui()
}
});
},
open() { open() {
this.$refs.popup.open('bottom'); this.$refs.popup.open('bottom');
}, },
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<view class="goods-box"> <view class="goods-box">
<view class="titg">精选物料</view> <view class="titg">精选物料</view>
<scroll-view class="goods-con" scroll-x="true"> <scroll-view class="goods-con" scroll-x="true">
<navigator :url="'/item?goods_id=' + item.goods_id" class="goods-item" v-for="(item, index) in obj.h5_home_choice_goods" :key="index"> <a :href="'/#/item/' + item.goods_id" class="goods-item" v-for="(item, index) in obj.h5_home_choice_goods" :key="index">
<image :src="item.goods_images"></image> <image :src="item.goods_images"></image>
<view class="xhg elep">{{ item.goods_name }}</view> <view class="xhg elep">{{ item.goods_name }}</view>
<view class="ppg elep"> <view class="ppg elep">
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
价格: 价格:
<text>{{ item.price }}</text> <text>{{ item.price }}</text>
</view> </view>
</navigator> </a>
</scroll-view> </scroll-view>
</view> </view>
<view class="fwbox"> <view class="fwbox">
...@@ -165,7 +165,12 @@ export default { ...@@ -165,7 +165,12 @@ export default {
intervalHandler: null intervalHandler: null
}; };
}, },
mounted() {
setTimeout(() => {
this.pbobj = this.$globalData;
this.kfurl = this.$globalData.kfqq_xk;
}, 500);
},
onShow() { onShow() {
this.getData(); this.getData();
}, },
...@@ -209,12 +214,7 @@ export default { ...@@ -209,12 +214,7 @@ export default {
}, 10000); }, 10000);
} }
}); });
this.request(Ichunt_Api + '/api/common/data', 'GET', {}).then(res => {
if (res.err_code === 0) {
this.pbobj = res.data;
this.kfurl = this.pbobj.kfqq_xk.data;
}
});
this.request(Api_Url + '/msg/allnum', 'POST', {}, false, true).then(res => { this.request(Api_Url + '/msg/allnum', 'POST', {}, false, true).then(res => {
if (res.err_code === 0) { if (res.err_code === 0) {
this.newscount = res.data; this.newscount = res.data;
......
...@@ -65,11 +65,14 @@ ...@@ -65,11 +65,14 @@
console.log(option); console.log(option);
this.searchVal=option.k||"" this.searchVal=option.k||""
}, },
mounted() {
setTimeout(() => {
this.obj = this.$globalData;
}, 500);
},
onShow:function(){ onShow:function(){
//获取历史记录 //获取历史记录
console.log(this.searchVal)
this.getsearchHistory() this.getsearchHistory()
this.getData()
}, },
methods: { methods: {
getListPOI(val_){ getListPOI(val_){
...@@ -79,13 +82,6 @@ ...@@ -79,13 +82,6 @@
} }
}); });
}, },
getData(){
this.request(Ichunt_Api + "/api/common/data", 'GET', {}, ).then(res => {
if (res.err_code === 0) {
this.obj = res.data;
}
});
},
getsearchHistory(){ getsearchHistory(){
let listhis_=uni.getStorageSync('historyItems'); let listhis_=uni.getStorageSync('historyItems');
if(listhis_){ if(listhis_){
......
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
</view> </view>
<view class="group" v-for="(item1,index1) in item.data" :key="index1" v-show="item1.isshow"> <view class="group" v-for="(item1,index1) in item.data" :key="index1" v-show="item1.isshow">
<view class="toprs1 row bothSide"> <view class="toprs1 row bothSide">
<navigator :url="'/item?goods_id='+item1.goods_id" class="row"> <a :href="'/#/item/'+item1.goods_id" class="row itemoneurl">
<view class="goodsName elep">{{item1.goods_name_org||item1.goods_name}}</view> <view class="goodsName elep">{{item1.goods_name_org||item1.goods_name}}</view>
<view class="actag" v-if="item1.ac_type==10">{{item1.activity_info.sign}}</view> <view class="actag" v-if="item1.ac_type==10">{{item1.activity_info.sign}}</view>
</navigator> </a>
<view class="addcar" v-if="item1.is_buy==1" @click="addcarpopfunc(item1.goods_id)">加入购物车</view> <view class="addcar" v-if="item1.is_buy==1" @click="addcarpopfunc(item1.goods_id)">加入购物车</view>
<a class="kfbtns" :href="kfqqurl" target="_blank" v-if="item1.is_buy!=1">联系客服</a> <a class="kfbtns" :href="kfqqurl" target="_blank" v-if="item1.is_buy!=1">联系客服</a>
</view> </view>
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<script> <script>
import {Ichunt_Api,Api_Url,Api_Es,Api_ES_Go} from '@/util/api.js'; import {Ichunt_Api,Api_Url,Api_Es,Api_ES_Go} from '@/util/api.js';
const EsUrl="//so12.ichunt.com" //Api_Es const EsUrl=Api_Es //Api_Es
import addCar from '@/components/addcar.vue'; import addCar from '@/components/addcar.vue';
export default { export default {
data() { data() {
...@@ -140,7 +140,13 @@ ...@@ -140,7 +140,13 @@
onLoad: function(option) { onLoad: function(option) {
this.searchVal = option.k; this.searchVal = option.k;
this.setHistoryItems(this.searchVal) this.setHistoryItems(this.searchVal)
this.getData() },
mounted() {
setTimeout(() => {
this.SEARCH_SUPPLIER_SINGLE=this.$globalData.SEARCH_SUPPLIER_SINGLE;
this.kfqqurl=this.$globalData.kfqq_xk
this.getSupplierData()
}, 500);
}, },
methods: { methods: {
//创建历史搜索缓存 最大10个 //创建历史搜索缓存 最大10个
...@@ -161,22 +167,76 @@ ...@@ -161,22 +167,76 @@
uni.setStorageSync('historyItems', historyItems); uni.setStorageSync('historyItems', historyItems);
} }
}, },
getData() { //综合排序
this.request(Ichunt_Api + "/api/common/data", 'GET', {}, ).then(res => { rankTotal(){
if (res.err_code === 0) { //按供应商排序
this.SEARCH_SUPPLIER_SINGLE=res.data.SEARCH_SUPPLIER_SINGLE; this.list.sort((a, b) => {
this.kfqqurl=res.data.kfqq_xk.data if (a.supplier_name == '国内现货') {
this.getSupplierData() return -1;
} } else if (b.supplier_name == '国内现货') {
return 1;
} else if (a.supplier_name == '国际现货') {
return -1;
} else if (b.supplier_name == '国际现货') {
return 1;
}
return 0;
}); });
//价格排序
this.list.forEach(item=>{
item.data.sort((a, b) => Number(a.ladder_price[0].price_ac||a.ladder_price[0].price_cn) - Number(b.ladder_price[0].price_ac||b.ladder_price[0].price_cn));
})
//完全匹配
this.list.forEach(item=>{
let piarr_=JSON.parse(JSON.stringify(item.data))
let arr1=[]
let arr2=[]
piarr_.forEach((iy,index)=>{
if (iy.goods_name.toLowerCase()==this.searchVal.toLowerCase()) {
arr1.push(iy)
}else{
arr2.push(iy)
}
})
item.data=[]
item.data=item.data.concat(arr1,arr2)
// console.log(piarr_)
// item.data.sort((a, b) => {
// if (a.goods_name.toLowerCase()==this.searchVal.toLowerCase()) {
// return -1;
// } else if (b.goods_name.toLowerCase()==this.searchVal.toLowerCase()) {
// return 1;
// }
// return 0;
// });
})
}, },
tab(type){ tab(type){
this.tabType=type; this.tabType=type;
if(type==2){ if(type==1){
this.stocksort=!this.stocksort this.rankTotal()
}else if(type==2){
this.stocksort=!this.stocksort;
if(this.stocksort){
this.list.forEach(item=>{
item.data.sort((b, a) => Number(a.stock) - Number(b.stock));
})
}else{
this.list.forEach(item=>{
item.data.sort((a, b) => Number(a.stock) - Number(b.stock));
})
} }
if(type==3){ }else if(type==3){
this.pricesort=!this.pricesort this.pricesort=!this.pricesort
if(this.pricesort){
this.list.forEach(item=>{
item.data.sort((b, a) => Number(a.ladder_price[0].price_ac||a.ladder_price[0].price_cn) - Number(b.ladder_price[0].price_ac||b.ladder_price[0].price_cn));
})
}else{
this.list.forEach(item=>{
item.data.sort((a, b) => Number(a.ladder_price[0].price_ac||a.ladder_price[0].price_cn) - Number(b.ladder_price[0].price_ac||b.ladder_price[0].price_cn));
})
}
} }
}, },
//品牌供应商搜索 //品牌供应商搜索
...@@ -285,15 +345,21 @@ ...@@ -285,15 +345,21 @@
name:key, name:key,
checked:false checked:false
} }
if(key=="国内现货"){
this.supplierArr.unshift(is_)
}else if(key=="猎芯期货"){
this.supplierArr.push(is_) this.supplierArr.push(is_)
}else{
this.supplierArr.splice(1, 0, is_);
}
}) })
this.supplierArr.sort((a, b) => {
if (a.name == '国内现货') {
return -1;
} else if (b.name == '国内现货') {
return 1;
} else if (a.name == '国际现货') {
return -1;
} else if (b.name == '国际现货') {
return 1;
}
return 0;
});
//品牌处理 //品牌处理
obj.data.forEach(item=>{ obj.data.forEach(item=>{
let keys_=(item.standard_brand_name||item.brand_name) let keys_=(item.standard_brand_name||item.brand_name)
...@@ -329,19 +395,15 @@ ...@@ -329,19 +395,15 @@
obj_.data.forEach(it=>{ obj_.data.forEach(it=>{
it.isshow=true it.isshow=true
}) })
if(obj_.supplier_name=="国内现货"){
this.list.unshift(obj_)
}else if(obj_.supplier_name=="猎芯期货"){
this.list.push(obj_) this.list.push(obj_)
}else{
this.list.splice(1, 0, obj_);
}
this.getBrandAndSupplier(obj_) this.getBrandAndSupplier(obj_)
} }
//数据加载完 //数据加载完
if(this.loadcount==Object.keys(this.SEARCH_SUPPLIER_SINGLE)){ if(this.loadcount==Object.keys(this.SEARCH_SUPPLIER_SINGLE).length){
if(this.list.length==0){ if(this.list.length==0){
this.isNOdata=1; this.isNOdata=1;
}else{
this.rankTotal()
} }
} }
}); });
...@@ -373,9 +435,12 @@ ...@@ -373,9 +435,12 @@
} }
//数据加载完 //数据加载完
if(this.loadcount==Object.keys(this.SEARCH_SUPPLIER_SINGLE)){ if(this.loadcount==Object.keys(this.SEARCH_SUPPLIER_SINGLE).length){
if(this.list.length==0){ if(this.list.length==0){
this.isNOdata=1; this.isNOdata=1;
}else{
this.rankTotal()
} }
} }
}); });
......
...@@ -60,14 +60,14 @@ const router = new Router({ ...@@ -60,14 +60,14 @@ const router = new Router({
}, },
{ {
path: '/pages/brand/brand', path: '/pages/brand/brand',
aliasPath: '/brand', aliasPath: '/brand/:brand_id',
meta: { meta: {
title: '品牌详情' title: '品牌详情'
} }
}, },
{ {
path: '/pages/detail/detail', path: '/pages/detail/detail',
aliasPath: '/item', aliasPath: '/item/:goods_id',
meta: { meta: {
title: '商品详情' title: '商品详情'
} }
......
...@@ -16,7 +16,7 @@ const request = (url = '', type = 'GET', param = {}, Loading, headertype) => { ...@@ -16,7 +16,7 @@ const request = (url = '', type = 'GET', param = {}, Loading, headertype) => {
pf: 2 pf: 2
}); });
//请求es相关 //请求es相关
if (url.indexOf("so12.ichunt.") != -1 || url.indexOf("/esapi/") != -1 || url.indexOf("/goods/detail") != -1) { if (url.indexOf("so12.ichunt.") != -1 || url.indexOf("/esapi/") != -1 || url.indexOf("/goods/detail") != -1|| url.indexOf("/optimum/goods") != -1) {
params = Object.assign(param, { hkyefgyd: 1 }); params = Object.assign(param, { hkyefgyd: 1 });
} }
......
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