2022-10-11 09:43:31 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport"
|
|
|
|
content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,viewport-fit=cover">
|
|
|
|
<title>权益兑换页</title>
|
|
|
|
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=1367936144322" type="text/javascript"
|
|
|
|
charset="utf-8"></script>
|
|
|
|
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/searchPage.css">
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<div id="searchPage">
|
|
|
|
<div class="search">
|
|
|
|
<div class="search-ipt">
|
2022-10-12 14:08:25 +08:00
|
|
|
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/search.png" alt=""
|
|
|
|
class="search-icon">
|
2022-10-11 09:43:31 +08:00
|
|
|
<input type="text" class="ipt" v-model="wordSearch" placeholder="请输入关键字搜索" maxlength="12" ref="ipt">
|
2022-10-12 14:08:25 +08:00
|
|
|
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/cance.png" alt=""
|
|
|
|
class="close-icon" @click="clearFn">
|
2022-10-11 09:43:31 +08:00
|
|
|
</div>
|
|
|
|
<span class="cancel" @click="history.go(-1)">取消</span>
|
|
|
|
</div>
|
|
|
|
<h4>搜索结果</h4>
|
|
|
|
<ul class="search-result" v-if="searchResult.length>0">
|
2022-10-12 14:08:25 +08:00
|
|
|
<li v-for="(item,index) in searchResult"
|
2022-11-07 17:34:11 +08:00
|
|
|
:class="item.stock&&item.stock<0||item.available!=1&&item.available!=2&&item.available!=22?'changegray':''"
|
2022-10-12 14:08:25 +08:00
|
|
|
@click="exchangeBtn(item)">
|
|
|
|
<img :src="item.type==1?item.entity.show_url:(item.entity.channel==1?'https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/zfbreduce.png':'https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/wxreduce.png')"
|
|
|
|
alt="" class="good-pic">
|
2022-10-11 09:43:31 +08:00
|
|
|
<span>{{item.type==1?item.entity.product_name:item.entity.batch_goods_name}}</span>
|
2022-10-12 14:08:25 +08:00
|
|
|
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/next.png" alt=""
|
|
|
|
class="next-icon">
|
2022-10-11 09:43:31 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
2022-10-12 14:08:25 +08:00
|
|
|
<img src="http://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/saleNull.png" alt=""
|
|
|
|
class="empty-record" v-else>
|
2022-10-11 09:43:31 +08:00
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
<script>
|
2022-10-12 14:08:25 +08:00
|
|
|
let goodsCollection = [];
|
2022-10-11 09:43:31 +08:00
|
|
|
new Vue({
|
|
|
|
el: '#searchPage',
|
|
|
|
data () {
|
|
|
|
return {
|
2022-10-12 14:08:25 +08:00
|
|
|
wordSearch: '',
|
|
|
|
searchResult: []
|
2022-10-11 09:43:31 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
created () {
|
2022-10-12 14:08:25 +08:00
|
|
|
goodsCollection = JSON.parse(localStorage.getItem('goodsCollection'));
|
|
|
|
this.searchResult = goodsCollection;
|
2022-10-11 09:43:31 +08:00
|
|
|
},
|
|
|
|
mounted () {
|
|
|
|
this.$refs.ipt.focus()
|
|
|
|
},
|
|
|
|
methods: {
|
2022-10-12 14:08:25 +08:00
|
|
|
clearFn () {
|
|
|
|
this.wordSearch = '';
|
2022-10-11 09:43:31 +08:00
|
|
|
},
|
|
|
|
exchangeBtn (row) {
|
|
|
|
let gstatus = row.available;
|
2022-11-07 17:34:11 +08:00
|
|
|
if (gstatus == 1||gstatus == 22) {
|
2022-10-11 09:43:31 +08:00
|
|
|
// 跳转商品详情页面
|
|
|
|
if (this.showType == 1) { //白名单
|
|
|
|
localStorage.setItem('token', row.token);
|
|
|
|
localStorage.setItem('key', row.key);
|
|
|
|
}
|
2022-11-07 17:34:11 +08:00
|
|
|
localStorage.setItem('goodsInfo', JSON.stringify(row));
|
2022-10-11 09:43:31 +08:00
|
|
|
//type :1 兑换码 2:立减金
|
2022-10-12 14:08:25 +08:00
|
|
|
window.location.replace("./details.html");
|
2022-10-11 09:43:31 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
2022-10-12 14:08:25 +08:00
|
|
|
wordSearch (val) {
|
|
|
|
let filterGoods = [];
|
|
|
|
goodsCollection.forEach(item => {
|
|
|
|
if (item.type == 1) { //1兑换码 2立减金
|
|
|
|
if (item.entity.product_name.includes(val)) filterGoods.push(item);
|
2022-10-11 09:43:31 +08:00
|
|
|
}
|
2022-10-12 14:08:25 +08:00
|
|
|
if (item.type == 2) { //1兑换码 2立减金
|
|
|
|
if (item.entity.batch_goods_name.includes(val)) filterGoods.push(item);
|
2022-10-11 09:43:31 +08:00
|
|
|
}
|
|
|
|
});
|
2022-10-12 14:08:25 +08:00
|
|
|
this.searchResult = filterGoods;
|
2022-10-11 09:43:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</html>
|