style:合并

This commit is contained in:
wangsongsole 2022-10-08 14:53:57 +08:00
parent 0288318de1
commit 02f3a8d75d
2 changed files with 98 additions and 5 deletions

View File

@ -5,11 +5,11 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" <meta name="viewport"
content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,viewport-fit=cover"> content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,viewport-fit=cover">
<title>商品页</title> <title>商品列表</title>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=1367936144322" type="text/javascript" <script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=1367936144322" type="text/javascript"
charset="utf-8"></script> charset="utf-8"></script>
<script type="text/javascript" src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144322"> <script type="text/javascript"
</script> src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144322"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/siteqiexchange/js/swiper.min.js"></script> <script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/siteqiexchange/js/swiper.min.js"></script>
<link href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/siteqiexchange/css/swiper.min.css" rel="stylesheet"> <link href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/siteqiexchange/css/swiper.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/loading.css"> <link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/loading.css">
@ -44,7 +44,7 @@
<img class="backpresty" @click="backHandler" v-if="goodsShow&&!isKey" <img class="backpresty" @click="backHandler" v-if="goodsShow&&!isKey"
src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png" src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png"
alt=""> alt="">
<div class="search-box" v-if="viewConfig.search.iswitch==='1'"> <div class="search-box" v-if="viewConfig.search.iswitch==='1'" @click="searchFn">
<input type="text" class="search" :style="{ <input type="text" class="search" :style="{
color:viewConfig.search.fontColor, color:viewConfig.search.fontColor,
textAlign:viewConfig.search.textAlign, textAlign:viewConfig.search.textAlign,
@ -400,6 +400,7 @@
} }
goodsArr.sort(objectArraySort('weight')) goodsArr.sort(objectArraySort('weight'))
self.swiperDataList = goodsArr; self.swiperDataList = goodsArr;
sessionStorage.setItem('goodsCollection', JSON.stringify(goodsArr));
self.goodsShow = goodsArr.length > 1; self.goodsShow = goodsArr.length > 1;
sessionStorage.setItem('goodsCount', goodsArr.length); sessionStorage.setItem('goodsCount', goodsArr.length);
if (goodsArr && goodsArr.length == 1 && goodsArr[0].available == 1) { if (goodsArr && goodsArr.length == 1 && goodsArr[0].available == 1) {
@ -436,6 +437,7 @@
req.axiosPost('/key/products', data).then(res => { req.axiosPost('/key/products', data).then(res => {
if (res.code == 200) { if (res.code == 200) {
self.swiperDataList = res.data; self.swiperDataList = res.data;
sessionStorage.setItem('goodsCollection', JSON.stringify(res.data));
sessionStorage.setItem('goodsCount', res.data.length); sessionStorage.setItem('goodsCount', res.data.length);
self.goodsShow = res.data.length > 1; self.goodsShow = res.data.length > 1;
if (res.data && res.data.length == 1) {//单个商品直接进入详情页面 if (res.data && res.data.length == 1) {//单个商品直接进入详情页面
@ -524,8 +526,12 @@
/* 图片跳转 */ /* 图片跳转 */
autoImgHandle () { autoImgHandle () {
if (this.viewConfig.picture.jumpType === '1') { if (this.viewConfig.picture.jumpType === '1') {
window.location.href = this.viewConfig.jumpUrl window.location.href = this.viewConfig.picture.jumpUrl
} }
},
//搜索
searchFn () {
window.location.href = './searchPage.html'
} }
} }
}) })

87
v1_5_0_C/searchPage.html Normal file
View File

@ -0,0 +1,87 @@
<!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">
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/search.png" alt="" class="search-icon">
<input type="text" class="ipt" v-model="wordSearch" placeholder="请输入关键字搜索" maxlength="12" ref="ipt">
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/cance.png" alt="" class="close-icon" @click="clearFn">
</div>
<span class="cancel" @click="history.go(-1)">取消</span>
</div>
<h4>搜索结果</h4>
<ul class="search-result" v-if="searchResult.length>0">
<li v-for="(item,index) in searchResult" :class="item.stock&&item.stock<0||item.available!=1&&item.available!=2?'changegray':''" @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">
<span>{{item.type==1?item.entity.product_name:item.entity.batch_goods_name}}</span>
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/next.png" alt="" class="next-icon">
</li>
</ul>
<img src="http://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/saleNull.png" alt="" class="empty-record" v-else>
</div>
</body>
<script>
let goodsCollection=[];
new Vue({
el: '#searchPage',
data () {
return {
wordSearch:'',
searchResult:[]
}
},
created () {
goodsCollection=JSON.parse(sessionStorage.getItem('goodsCollection'));
this.searchResult=goodsCollection;
},
mounted () {
this.$refs.ipt.focus()
},
methods: {
clearFn(){
this.wordSearch='';
},
exchangeBtn (row) {
let gstatus = row.available;
if (gstatus == 1) {
// 跳转商品详情页面
if (this.showType == 1) { //白名单
sessionStorage.setItem('token', row.token);
sessionStorage.setItem('key', row.key);
}
sessionStorage.setItem('goodsInfo', JSON.stringify(row));
//type :1 兑换码 2:立减金
window.location.replace("./exchange.html");
}
},
},
watch: {
wordSearch(val){
let filterGoods=[];
goodsCollection.forEach(item=>{
if(item.type==1){ //1兑换码 2立减金
if(item.entity.product_name.includes(val)) filterGoods.push(item);
}
if(item.type==2){ //1兑换码 2立减金
if(item.entity.batch_goods_name.includes(val)) filterGoods.push(item);
}
});
this.searchResult=filterGoods;
}
}
});
</script>
</html>