Feat:香小智对接
This commit is contained in:
@@ -485,7 +485,7 @@ export default {
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: '云南香道滇官方商城',
|
||||
title: '探寻有趣有味的生活方式',
|
||||
path: '/pages/home/index',
|
||||
imageUrl: this.shareAppImg
|
||||
}
|
||||
|
||||
@@ -10,6 +10,19 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="page-content" v-if="historyKey.length">
|
||||
<view class="title">历史搜索</view>
|
||||
<view class="list acea-row limit-box">
|
||||
<view
|
||||
class="item"
|
||||
v-for="item of historyKey"
|
||||
:key="item.id"
|
||||
@click="toSearch(item.word)"
|
||||
>{{ item.word }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="page-content" v-if="keywords.length">
|
||||
<view class="title">热门搜索</view>
|
||||
<view class="list acea-row">
|
||||
@@ -37,16 +50,25 @@ export default {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
keywords: [],
|
||||
search: ""
|
||||
search: "",
|
||||
historyKey: []
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
this.getData();
|
||||
},
|
||||
onShow() {
|
||||
this.getHistory();
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
const search = trim(this.search) || "";
|
||||
if (!search) return;
|
||||
|
||||
this.historyKey.unshift({id: this.$global.generateMixed(10), word: search});
|
||||
this.setHistory();
|
||||
this.search = "";
|
||||
|
||||
this.toSearch(search);
|
||||
},
|
||||
toSearch(s) {
|
||||
@@ -56,18 +78,22 @@ export default {
|
||||
getSearchKeyword().then(res => {
|
||||
this.keywords = res.data;
|
||||
});
|
||||
},
|
||||
getHistory() {
|
||||
let temp = JSON.parse(uni.getStorageSync("historyKey")) || [];
|
||||
this.historyKey = temp.slice(0, 30);
|
||||
},
|
||||
setHistory() {
|
||||
uni.setStorageSync("historyKey", JSON.stringify(this.historyKey));
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
page {
|
||||
.good-search {
|
||||
min-height: 100vh;
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
.good-search {
|
||||
|
||||
.header {
|
||||
padding: 40rpx 32rpx 32rpx;
|
||||
@@ -81,7 +107,8 @@ page {
|
||||
border-radius: 36rpx;
|
||||
background: #fff;
|
||||
font-size: 24rpx;
|
||||
input{
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -117,7 +144,7 @@ page {
|
||||
.item {
|
||||
height: 48rpx;
|
||||
box-sizing: border-box;
|
||||
margin-right: 24rpx;
|
||||
margin: 0 24rpx 20rpx 0;
|
||||
padding: 0 24rpx;
|
||||
border-radius: 28rpx;
|
||||
background: #F1F0EE;
|
||||
@@ -126,6 +153,11 @@ page {
|
||||
line-height: 48rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.limit-box {
|
||||
max-height: 260rpx;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -52,11 +52,11 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 文玩 -->
|
||||
<view class="wenwan-info flex jc-between ai-center" v-if="isWenwan===1">
|
||||
<!-- <view class="wenwan-info flex jc-between ai-center" v-if="isWenwan===1">
|
||||
<text>产地:{{ storeInfo.origin }}</text>
|
||||
<text>单位:{{ storeInfo.unitName }}</text>
|
||||
<text>规格:{{ storeInfo.storeInfo }}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- v4 特产 -->
|
||||
|
||||
Reference in New Issue
Block a user