|
|
@ -2,14 +2,14 @@ |
|
|
|
<view> |
|
|
|
<view> |
|
|
|
<view class="input-box"> |
|
|
|
<view class="input-box"> |
|
|
|
<view class="icon search"></view> |
|
|
|
<view class="icon search"></view> |
|
|
|
<input placeholder="搜索卡券" v-model="couponName" placeholder-style="color:#c0c0c0;" @input="toSearch()" /> |
|
|
|
<input placeholder="搜索商品" v-model="couponName" placeholder-style="color:#c0c0c0;" @input="toSearch()" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="swiper"> |
|
|
|
<view class="swiper"> |
|
|
|
<view class="swiper-box"> |
|
|
|
<view class="swiper-box"> |
|
|
|
<swiper circular="true" autoplay="true" @change="swiperChange"> |
|
|
|
<swiper circular="true" autoplay="true" @change="swiperChange"> |
|
|
|
<swiper-item v-for="swiper in swiperList" :key="swiper.id"> |
|
|
|
<swiper-item v-for="swiper in swiperList" :key="swiper.id"> |
|
|
|
<image :src="imageUrl+swiper.imgData" ></image> |
|
|
|
<image :src="imageUrl+swiper.imgData"></image> |
|
|
|
</swiper-item> |
|
|
|
</swiper-item> |
|
|
|
</swiper> |
|
|
|
</swiper> |
|
|
|
<view class="indicator"> |
|
|
|
<view class="indicator"> |
|
|
@ -30,18 +30,17 @@ |
|
|
|
|
|
|
|
|
|
|
|
<view class="info mart10"> |
|
|
|
<view class="info mart10"> |
|
|
|
<view class="price" v-if="typeId == 2"> |
|
|
|
<view class="price" v-if="typeId == 2"> |
|
|
|
<image style="width: 15px;height: 15px;vertical-align: sub;" |
|
|
|
<image style="width: 15px;height: 15px;vertical-align: sub;" src="../../../static/img/jfx.png"> |
|
|
|
src="../../../static/img/jfx.png"> |
|
|
|
|
|
|
|
</image> {{ row.discountPrice*100}} |
|
|
|
</image> {{ row.discountPrice*100}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="price" v-if="typeId == 1"> |
|
|
|
<view class="price" v-if="typeId == 1 || typeId == 3"> |
|
|
|
¥ {{ row.discountPrice*100}} |
|
|
|
¥ {{ row.discountPrice*100}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- v-if="product.discountPrice !== product.salesPrice" --> |
|
|
|
<!-- v-if="product.discountPrice !== product.salesPrice" --> |
|
|
|
<view class="slogan" v-if="row.discountPrice !== row.salesPrice"> |
|
|
|
<view class="slogan" v-if="row.discountPrice !== row.salesPrice"> |
|
|
|
<image v-if="typeId == 2" style="width: 15px;height: 15px;vertical-align: sub;" |
|
|
|
<image v-if="typeId == 2" style="width: 15px;height: 15px;vertical-align: sub;" |
|
|
|
src="../../../static/img/jfh.png"> |
|
|
|
src="../../../static/img/jfh.png"> |
|
|
|
</image> <text v-if="typeId == 1">¥</text>{{ row.salesPrice*100}} |
|
|
|
</image> <text v-if="typeId == 1 || typeId == 3">¥</text>{{ row.salesPrice*100}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -53,7 +52,8 @@ |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { |
|
|
|
import { |
|
|
|
getCouponList, |
|
|
|
getCouponList, |
|
|
|
getCmsContent |
|
|
|
getCmsContent, |
|
|
|
|
|
|
|
getBrandCouponList |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
let app = getApp(); |
|
|
|
let app = getApp(); |
|
|
|
export default { |
|
|
|
export default { |
|
|
@ -61,7 +61,7 @@ |
|
|
|
return { |
|
|
|
return { |
|
|
|
goodsList: [], |
|
|
|
goodsList: [], |
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
imgadres:'noorder.png', |
|
|
|
imgadres: 'noorder.png', |
|
|
|
imageUrl: app.globalData.imgUrl, |
|
|
|
imageUrl: app.globalData.imgUrl, |
|
|
|
// 轮播图片 |
|
|
|
// 轮播图片 |
|
|
|
swiperList: [{ |
|
|
|
swiperList: [{ |
|
|
@ -80,38 +80,55 @@ |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
isNoMoreData: false, |
|
|
|
isNoMoreData: false, |
|
|
|
typeId: '', |
|
|
|
typeId: '', |
|
|
|
couponName: '' |
|
|
|
couponName: '', |
|
|
|
|
|
|
|
brandid : '', |
|
|
|
|
|
|
|
goodtyid: '' |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数 |
|
|
|
onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数 |
|
|
|
this.typeId = option.id; |
|
|
|
this.typeId = option.id; |
|
|
|
|
|
|
|
this.brandid = option.brandId; |
|
|
|
|
|
|
|
this.goodtyid = option.goodsId; |
|
|
|
if (option.id == 1) { |
|
|
|
if (option.id == 1) { |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: '商品列表' |
|
|
|
title: '商品列表' |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
this.getCouponListArea(); |
|
|
|
|
|
|
|
this.getCmsContent('CMS_WX_APPLETS_GOODS_LIST'); |
|
|
|
} |
|
|
|
} |
|
|
|
if (option.id == 2) { |
|
|
|
if (option.id == 2) { |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: '积分列表' |
|
|
|
title: '积分列表' |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
this.getCouponListArea(); |
|
|
|
this.getCouponListArea(); |
|
|
|
this.getCmsContent(); |
|
|
|
this.getCmsContent('CMS_WX_APPLETS_GOODS_LIST'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (option.id == 3) { |
|
|
|
|
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
|
|
|
|
title: '优选商品' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.getCmsContent('CMS_PRE_LIST'); |
|
|
|
|
|
|
|
this.getBrandCouponList(); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onPageScroll(e) { |
|
|
|
onPageScroll(e) { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
//上拉加载,需要自己在page.json文件中配置"onReachBottomDistance" |
|
|
|
//上拉加载,需要自己在page.json文件中配置"onReachBottomDistance" |
|
|
|
onReachBottom() { |
|
|
|
onReachBottom() { |
|
|
|
|
|
|
|
if(this.typeId == 3){ |
|
|
|
|
|
|
|
this.getBrandCouponList(); |
|
|
|
|
|
|
|
}else{ |
|
|
|
this.getCouponListArea(); |
|
|
|
this.getCouponListArea(); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
//获取弹出或者弹窗 |
|
|
|
//获取弹出或者弹窗 |
|
|
|
getCmsContent() { |
|
|
|
getCmsContent(item) { |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
regionId: app.globalData.cityId, |
|
|
|
regionId: app.globalData.cityId, |
|
|
|
categoryCode: 'CMS_WX_APPLETS_GOODS_LIST' |
|
|
|
categoryCode: item |
|
|
|
} |
|
|
|
} |
|
|
|
getCmsContent(params).then(res => { |
|
|
|
getCmsContent(params).then(res => { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
@ -154,12 +171,48 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//优选商品列表 |
|
|
|
|
|
|
|
getBrandCouponList() { |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
|
|
title: '加载中...' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
if (this.isNoMoreData) { |
|
|
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let pagenum = this.pageNum; |
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
|
|
regionId: app.globalData.cityId, |
|
|
|
|
|
|
|
pageNum: pagenum, |
|
|
|
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
|
|
|
brandId: this.brandid, |
|
|
|
|
|
|
|
goodsTypeId: this.goodtyid, |
|
|
|
|
|
|
|
couponName: this.couponName |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
getBrandCouponList(params).then(res => { |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true; |
|
|
|
|
|
|
|
this.goodsList = this.goodsList.concat(res.return_data.list); |
|
|
|
|
|
|
|
if (res.return_data.total == (this.pageNum * this.pageSize)) { |
|
|
|
|
|
|
|
this.isNoMoreData = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.goodsList = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
toSearch() { |
|
|
|
toSearch() { |
|
|
|
this.pageNum = 1; |
|
|
|
this.pageNum = 1; |
|
|
|
this.pageSize = 10; |
|
|
|
this.pageSize = 10; |
|
|
|
this.isNoMoreData = false; |
|
|
|
this.isNoMoreData = false; |
|
|
|
this.goodsList = []; |
|
|
|
this.goodsList = []; |
|
|
|
|
|
|
|
if(this.typeId == 3){ |
|
|
|
|
|
|
|
this.getBrandCouponList(); |
|
|
|
|
|
|
|
}else{ |
|
|
|
this.getCouponListArea(); |
|
|
|
this.getCouponListArea(); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
//商品跳转 |
|
|
|
//商品跳转 |
|
|
|
toGoods(e) { |
|
|
|
toGoods(e) { |
|
|
|