Commit 418d49cc by 肖康

分类修改

parent 0e306cd7
......@@ -170,7 +170,7 @@
height:48rpx;
line-height: 48rpx;
margin-bottom: 12rpx;
navigator{
.itemoneurl{
height:48rpx;
line-height: 48rpx;
.goodsName{
......
......@@ -44,7 +44,7 @@
height:48rpx;
line-height: 48rpx;
margin-bottom: 12rpx;
navigator{
.itemoneurl{
height:48rpx;
line-height: 48rpx;
.goodsName{
......
......@@ -245,7 +245,7 @@
}
}
.kfbtn{
border: 2px solid $uni-colorwarning;
border: 1px solid $uni-colorwarning;
color:$uni-colorwarning;
}
}
......
......@@ -140,7 +140,7 @@
height:48rpx;
line-height: 48rpx;
margin-bottom: 12rpx;
navigator{
.itemoneurl{
height:48rpx;
line-height: 48rpx;
.goodsName{
......
......@@ -104,9 +104,9 @@
<view class="btnbox">
<view class="totalpricebox row bothSide" v-if="obj.is_buy==1">
<view class="hej">合计:<text class="tje">{{isdl==1?'¥':'$'}}{{totalmoney}}</text></view>
<view class="addcarbtn">加入购物车</view>
<view class="addcarbtn" @click="addCar">加入购物车</view>
</view>
<a class="kfbtn row verCenter rowCenter" v-else 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>
联系客服
</a>
......@@ -140,11 +140,17 @@
isdl:1,
pticearr:[],
totalmoney:0.00,
kfqqurl:"",
}
},
onLoad: function() {
},
mounted() {
setTimeout(() => {
this.kfqqurl=this.$globalData.kfqq_xk
}, 500);
},
methods: {
onInput(e){
clearTimeout(this.timeout);
......@@ -214,6 +220,31 @@
this.getData(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}
......@@ -269,9 +300,10 @@
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:function(goods_id){
//110225
this.request(Api_Url + "/goods/detail", 'POST', {id:"1168482547080619839"},true,true).then(res => {
getData(goods_id){
//110225 1168482547080619839
this.request(Api_Url + "/goods/detail", 'POST', {id:goods_id},true,true).then(res => {
if (res.err_code == 0) {
this.obj=res.data;
this.num=this.obj.min_buy
......
......@@ -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">
......
......@@ -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() {
......
......@@ -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