Commit dd82e9fa by LJM

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

parents f4ccffe9 ae34b9ef
......@@ -170,7 +170,7 @@
height:48rpx;
line-height: 48rpx;
margin-bottom: 12rpx;
navigator{
.itemoneurl{
height:48rpx;
line-height: 48rpx;
.goodsName{
......@@ -189,6 +189,8 @@
position: relative;
margin-left: 10rpx;
top:10rpx;
font-size: 22rpx;
font-weight: normal;
}
}
......
......@@ -44,7 +44,7 @@
height:48rpx;
line-height: 48rpx;
margin-bottom: 12rpx;
navigator{
.itemoneurl{
height:48rpx;
line-height: 48rpx;
.goodsName{
......@@ -63,6 +63,8 @@
position: relative;
margin-left: 10rpx;
top:10rpx;
font-size: 22rpx;
font-weight: normal;
}
}
......
......@@ -32,6 +32,8 @@
position: relative;
margin-left: 10rpx;
top:10rpx;
font-size: 22rpx;
font-weight: normal;
}
}
.iconfont{
......@@ -133,15 +135,9 @@
line-height: 41rpx;
font-size: 24rpx;
color:$uni-color999;
.pi1{width:139rpx;}
.pi2{width:318rpx;}
.w140{width:140rpx;}
.w120{width:120rpx;}
.hxj{
color:#C2C4CC!important;
font-weight: normal!important;
text-decoration-line: line-through;
}
.pi1{flex: 2;}
.pi2{flex: 3;}
.pi3{flex: 3;}
&.titso{
color:$uni-color666;
font-weight: 600;
......@@ -251,7 +247,7 @@
}
}
.kfbtn{
border: 2px solid $uni-colorwarning;
border: 1px solid $uni-colorwarning;
color:$uni-colorwarning;
}
}
......
......@@ -46,6 +46,8 @@
color:#fff;
font-size: 20rpx;
margin-left: 16rpx;
font-size: 22rpx;
font-weight: normal;
}
.tdbox{
width: 120rpx;
......@@ -175,7 +177,6 @@
}
.cons{
border: 1rpx solid #C6C7CC;
.groups{
font-size: 24rpx;
color: $uni-color999;
......@@ -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 @@
height:48rpx;
line-height: 48rpx;
margin-bottom: 12rpx;
navigator{
.itemoneurl{
height:48rpx;
line-height: 48rpx;
.goodsName{
......@@ -159,6 +159,7 @@
position: relative;
margin-left: 10rpx;
top:10rpx;
font-size: 22rpx;
}
}
......
......@@ -4,40 +4,38 @@
<text v-back class="icon iconfont icon-arrleft"></text>
<view class="inputbox row verCenter" >
<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>
<navigator url="/joincart">
<text class="icon iconfont icon-car"></text>
</navigator>
<view class="searchbtn">搜索</view>
<view class="searchbtn" @click.stop="searchlistgo()">搜索</view>
</view>
<view class="brandinfo">
<view class="tp1 row bothSide verCenter">
<image src="https://img.ichunt.com/images/brands/174.png"></image>
<text>关于ADI</text>
</view>
<view class="tp2 " :class="{'zazts elep2':!zkshow}">
Analog Devices以追求创新、品质和卓越为使命,是一家历史悠久,成长迅速的技术公司。Analog Devices的客户逾Analog Devices以追求创新、品质和卓越为使命,是一家历史悠久,成长迅速的技术公司。Analog Devices的客户逾……
<image :src="brandInfo.brand_logo"></image>
<text>关于{{brandInfo.brand_name}}</text>
</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-arrtop"></text></view>
</view>
<view class="datasc">
<view class="shiftbox row avarage ">
<view class="rank1 row ">综合</view>
<view class="rank2 row sjpx act top">库存</view>
<view class="rank3 row sjpx act bot">价格</view>
<view class="rank1 row " @click="tab(1)" :class="{'act':tabType==1}">综合</view>
<view class="rank2 row sjpx" @click="tab(2)" :class="{'act':tabType==2,'top':stocksort,'bot':(!stocksort)}">库存</view>
<view class="rank3 row sjpx " @click="tab(3)" :class="{'act':tabType==3,'top':pricesort,'bot':(!pricesort)}">价格</view>
</view>
<view class="databox branddataboxs" >
<view class="group" v-for="(item,index) in list" :key="index">
<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="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="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 class="toprs2 row bothSide">
<view class="l2 elep"><text class="labelsd">品牌:</text>{{item.brand_name}}</view>
......@@ -85,12 +83,16 @@
zkshow:false,
kfurl:"",
list:[],
brandInfo:{},
isInitLogin:0,
class_id1:"",
class_id2:"",
page:1,
page_size:10,
isLoadEnd: false // 是否已全部加载完
isLoadEnd: false, // 是否已全部加载完
goods_name:"",
tabType:1,
stocksort:false,//库存升序 false 降序
pricesort:false,//价格升序 false 降序
}
},
onPageScroll(e) {
......@@ -100,7 +102,11 @@
},
onShow() {
this.getData();
this.getqqurl()
},
mounted() {
setTimeout(() => {
this.kfurl=this.$globalData.kfqq_xk
}, 500);
},
onLoad: function(option) {
this.brand_id = this.$Route.query.brand_id;
......@@ -115,25 +121,51 @@
this.getData();
},
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
}
});
blurinputs(){
setTimeout(()=>{
this.isSearch=!this.isSearch
},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() {
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;
if (res.error_code == 0) {
this.class_id1_name=res.data.class_id1_name;
this.class_id2_name=res.data.class_id2_name;
this.page++;
let newDataList = res.data.goods_lists||[];
this.brandInfo=res.data.brand_info;
let newDataList = res.data.goods_info||[];
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.page++;
}else{
this.list=[]
}
......
......@@ -8,12 +8,12 @@
<view class="databox">
<view class="group" v-for="(item,index) in list" :key="index">
<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="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="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 class="toprs2 row bothSide">
<view class="l2 elep"><text class="labelsd">品牌:</text>{{item.brand_name}}</view>
......@@ -82,7 +82,12 @@
},
onShow() {
this.getData();
this.getqqurl()
},
mounted() {
setTimeout(() => {
this.kfurl=this.$globalData.kfqq_xk
}, 500);
},
onLoad: function(option) {
this.class_id1 = option.class_id1||"";
......@@ -90,25 +95,18 @@
console.log(this.class_id1,this.class_id2)
},
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() {
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;
if (res.error_code == 0) {
this.class_id1_name=res.data.class_id1_name;
this.class_id2_name=res.data.class_id2_name;
this.page++;
let newDataList = res.data.goods_lists||[];
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.page++;
}else{
this.list=[]
}
......
......@@ -76,7 +76,7 @@
<view class="goods-box">
<view class="titg">精选物料</view>
<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>
<view class="xhg elep">{{ item.goods_name }}</view>
<view class="ppg elep">
......@@ -87,7 +87,7 @@
价格:
<text>{{ item.price }}</text>
</view>
</navigator>
</a>
</scroll-view>
</view>
<view class="fwbox">
......@@ -165,7 +165,12 @@ export default {
intervalHandler: null
};
},
mounted() {
setTimeout(() => {
this.pbobj = this.$globalData;
this.kfurl = this.$globalData.kfqq_xk;
}, 500);
},
onShow() {
this.getData();
},
......@@ -209,12 +214,7 @@ export default {
}, 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 => {
if (res.err_code === 0) {
this.newscount = res.data;
......
......@@ -65,11 +65,14 @@
console.log(option);
this.searchVal=option.k||""
},
mounted() {
setTimeout(() => {
this.obj = this.$globalData;
}, 500);
},
onShow:function(){
//获取历史记录
console.log(this.searchVal)
this.getsearchHistory()
this.getData()
},
methods: {
getListPOI(val_){
......@@ -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(){
let listhis_=uni.getStorageSync('historyItems');
if(listhis_){
......
......@@ -31,10 +31,10 @@
</view>
<view class="group" v-for="(item1,index1) in item.data" :key="index1" v-show="item1.isshow">
<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="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>
<a class="kfbtns" :href="kfqqurl" target="_blank" v-if="item1.is_buy!=1">联系客服</a>
</view>
......@@ -117,7 +117,7 @@
<script>
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';
export default {
data() {
......@@ -140,7 +140,13 @@
onLoad: function(option) {
this.searchVal = option.k;
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: {
//创建历史搜索缓存 最大10个
......@@ -161,22 +167,76 @@
uni.setStorageSync('historyItems', historyItems);
}
},
getData() {
this.request(Ichunt_Api + "/api/common/data", 'GET', {}, ).then(res => {
if (res.err_code === 0) {
this.SEARCH_SUPPLIER_SINGLE=res.data.SEARCH_SUPPLIER_SINGLE;
this.kfqqurl=res.data.kfqq_xk.data
this.getSupplierData()
}
//综合排序
rankTotal(){
//按供应商排序
this.list.sort((a, b) => {
if (a.supplier_name == '国内现货') {
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){
this.tabType=type;
if(type==2){
this.stocksort=!this.stocksort
}
if(type==3){
if(type==1){
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));
})
}
}else if(type==3){
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 @@
name:key,
checked:false
}
if(key=="国内现货"){
this.supplierArr.unshift(is_)
}else if(key=="猎芯期货"){
this.supplierArr.push(is_)
}else{
this.supplierArr.splice(1, 0, is_);
}
this.supplierArr.push(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=>{
let keys_=(item.standard_brand_name||item.brand_name)
......@@ -329,19 +395,15 @@
obj_.data.forEach(it=>{
it.isshow=true
})
if(obj_.supplier_name=="国内现货"){
this.list.unshift(obj_)
}else if(obj_.supplier_name=="猎芯期货"){
this.list.push(obj_)
}else{
this.list.splice(1, 0, obj_);
}
this.list.push(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){
this.isNOdata=1;
}else{
this.rankTotal()
}
}
});
......@@ -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){
this.isNOdata=1;
}else{
this.rankTotal()
}
}
});
......
......@@ -60,14 +60,14 @@ const router = new Router({
},
{
path: '/pages/brand/brand',
aliasPath: '/brand',
aliasPath: '/brand/:brand_id',
meta: {
title: '品牌详情'
}
},
{
path: '/pages/detail/detail',
aliasPath: '/item',
aliasPath: '/item/:goods_id',
meta: {
title: '商品详情'
}
......
......@@ -16,7 +16,7 @@ const request = (url = '', type = 'GET', param = {}, Loading, headertype) => {
pf: 2
});
//请求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 });
}
......
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