|
@@ -32,7 +32,7 @@
|
|
|
<tm-listitem v-for="item in libiaoList" @click="sousuo(item.name)" :title="item.name" left-icon="" show-left-icon :show-right-icon="false">
|
|
|
</tm-listitem>
|
|
|
</tm-grouplist>
|
|
|
- <tm-empty v-if="sosotype==1 && libiaoList.length ==0" label="暂无数据" color="white" icon="icon-paperplane-fill"></tm-empty>
|
|
|
+ <tm-empty v-if="sosotype==1 && libiaoList==undefined" label="暂无数据" color="white" icon="icon-paperplane-fill"></tm-empty>
|
|
|
<div class="zhuti" v-if="sosotype==2">
|
|
|
<tm-sheet class="kuang" style="padding-bottom: 30px !important;" v-if="listdata.length!=0">
|
|
|
<view style="width: 94%;margin:0 auto;" class="remen">
|
|
@@ -45,16 +45,16 @@
|
|
|
</view>
|
|
|
<view class="mt-2 flex-between flex-center">
|
|
|
<view class="touxiang mt-30">
|
|
|
- <text class="text-white text-size-m text-weight-b">{{item.market_price}}</text>
|
|
|
+ <text class="text-white text-size-m text-weight-b">{{item.sale_price}}</text>
|
|
|
</view>
|
|
|
<view >
|
|
|
- <image @click="jiarufuFun(item)" class="remenzan" src="/static/img/86.png" mode="widthFix"></image>
|
|
|
+ <image @click.stop="jiarufuFun(item)" class="remenzan" src="/static/img/86.png" mode="widthFix"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style="clear: both;"></view>
|
|
|
- <view style="clear: both;" class="more ma-40 pt-40" @click="gengmore()" v-if="this.listdata.length!=0">
|
|
|
+ <view style="clear: both;" class="more ma-40 pt-40" @click="gengmore()" v-if="listdata.length<total">
|
|
|
<image src="/static/img/30.png" mode="widthFix"></image>
|
|
|
<text class="text-size-s">下拉加载更多~</text>
|
|
|
</view>
|
|
@@ -91,6 +91,7 @@ export default {
|
|
|
sosotype:1,
|
|
|
page:1,
|
|
|
pagesize:8,
|
|
|
+ total:0,
|
|
|
jia:1,
|
|
|
num:1,
|
|
|
};
|
|
@@ -111,21 +112,19 @@ export default {
|
|
|
getlishi(){
|
|
|
var that=this;
|
|
|
myRequest({
|
|
|
- url: "/api/SearchHistory/searchList",
|
|
|
+ url: "/api/ShopGoods/shopSearchList",
|
|
|
method:'get',
|
|
|
data:{}
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
that.libiaoList=res.data.data;
|
|
|
- }else{
|
|
|
-
|
|
|
- }
|
|
|
+ }else{}
|
|
|
})
|
|
|
},
|
|
|
qingkong(){
|
|
|
var that=this;
|
|
|
myRequest({
|
|
|
- url: "/api/SearchHistory/deleteSearch",
|
|
|
+ url: "/api/ShopGoods/deleteShopSearch",
|
|
|
method:'get',
|
|
|
data:{}
|
|
|
}).then(res => {
|
|
@@ -138,6 +137,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
sousuo(name){
|
|
|
+ console.log(name,'nam');
|
|
|
this.soso=name;
|
|
|
this.sosoFun();
|
|
|
},
|
|
@@ -150,11 +150,16 @@ export default {
|
|
|
}).then(res=>{
|
|
|
if(res.data.code==200){
|
|
|
that.listdata=[];
|
|
|
- if(res.data.data.data){
|
|
|
+ if(res.data.data.length!=0){
|
|
|
+ that.total=res.data.data.total;
|
|
|
+ if(res.data.data.data.length>0){
|
|
|
that.listdata=res.data.data.data;
|
|
|
}else{
|
|
|
that.listdata=[];
|
|
|
}
|
|
|
+ }else{
|
|
|
+ that.listdata=[];
|
|
|
+ }
|
|
|
}else{
|
|
|
that.$refs.toast.show({
|
|
|
model: 'error',
|
|
@@ -169,25 +174,38 @@ export default {
|
|
|
// this.randouh()
|
|
|
},
|
|
|
jiarufuFun(data){
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/gouwuche/index",
|
|
|
- })
|
|
|
+ var that=this;
|
|
|
+ console.log(data)
|
|
|
+ // if(data.type==2){
|
|
|
+ myRequest({
|
|
|
+ url: "/api/ShopCart/addShopCart",
|
|
|
+ method:'post',
|
|
|
+ data:{
|
|
|
+ goods_id:data.id,
|
|
|
+ goods_name:data.goods_name,
|
|
|
+ goods_image:data.image,
|
|
|
+ goods_price:data.sale_price,
|
|
|
+ goods_num:1
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.$refs.toast.show({model:'success',label:res.data.msg})
|
|
|
+ // that.getGwc()
|
|
|
+ }else{
|
|
|
+ that.$refs.toast.show({model:'error',label:res.data.msg})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // }else{
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: "/pages/shopdetail/index",
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: "/pages/gouwuche/index",
|
|
|
+ // })
|
|
|
// console.log(data)
|
|
|
// this.gouwuche.push(data)
|
|
|
},
|
|
|
- randouh(){
|
|
|
- let list2 = [],that=this;
|
|
|
- for(let i=0;i<8;i++){
|
|
|
- list2.push({
|
|
|
- image:'../../static/img/90.png',
|
|
|
- text:'帽子',
|
|
|
- jiage:'¥ 359.00',
|
|
|
- xiaol:'128'
|
|
|
- })
|
|
|
- }
|
|
|
- this.listdata=this.listdata.concat(list2)
|
|
|
- console.log(this.listdata)
|
|
|
- },
|
|
|
goindex(){
|
|
|
uni.navigateBack();
|
|
|
},
|
|
@@ -207,6 +225,7 @@ export default {
|
|
|
this.num=2
|
|
|
}
|
|
|
}
|
|
|
+ this.sosoFun()
|
|
|
},
|
|
|
},
|
|
|
}
|