diff --git a/api/public.js b/api/public.js index 13dd3d6..2e31ca1 100644 --- a/api/public.js +++ b/api/public.js @@ -204,3 +204,7 @@ export function userUnionId() { export function getShareImage() { return request.get("/shareImage", {}, {login: false}) } + +export function getXiaoZhi() { + return request.get("/appAdvertising", {}, {login: false}) +} \ No newline at end of file diff --git a/assets/script/global.js b/assets/script/global.js index 77f4c04..41d820a 100644 --- a/assets/script/global.js +++ b/assets/script/global.js @@ -65,6 +65,19 @@ export default { let timestamp = new Date(date).getTime(); let now = new Date().getTime(); return timestamp - now; + }, + + //生成n位数字字母混合字符串 + generateMixed(n) { + let chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; + let res = ""; + for (let i = 0; i < n; i++) { + let id = Math.floor(Math.random() * 36); + res += chars[id]; + } + return res; } } diff --git a/config/index.js b/config/index.js index 49c37ec..e94d2c5 100644 --- a/config/index.js +++ b/config/index.js @@ -1,5 +1,5 @@ -export const VUE_APP_API_URL = "https://shop.xdd618.com/api"; -// export const VUE_APP_API_URL = "https://www.xdd618.com/api"; +// export const VUE_APP_API_URL = "https://shop.xdd618.com/api"; +export const VUE_APP_API_URL = "https://www.xdd618.com/api"; // export const SERVICE_API_URL = "https://service-test.xdd618.com/api"; export const SERVICE_API_URL = "https://service.xdd618.com/api"; diff --git a/pages.json b/pages.json index 28f2352..9fd77d3 100644 --- a/pages.json +++ b/pages.json @@ -555,6 +555,12 @@ "style": { "navigationBarTitleText": "历史会话" } + }, + { + "path": "views/xiaoZhi", + "style": { + "navigationBarTitleText": "" + } } ] }, diff --git a/pages/home/index.vue b/pages/home/index.vue index c15b2c6..1078a2b 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -485,7 +485,7 @@ export default { }, onShareAppMessage() { return { - title: '云南香道滇官方商城', + title: '探寻有趣有味的生活方式', path: '/pages/home/index', imageUrl: this.shareAppImg } diff --git a/pages/shop/GoodSearch/index.vue b/pages/shop/GoodSearch/index.vue index a2d8f34..9c09b0c 100644 --- a/pages/shop/GoodSearch/index.vue +++ b/pages/shop/GoodSearch/index.vue @@ -10,6 +10,19 @@ + + 历史搜索 + + {{ item.word }} + + + + 热门搜索 @@ -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)); } } }; \ No newline at end of file diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue index 9391e13..a336c0c 100644 --- a/pages/shop/GoodsCon/index.vue +++ b/pages/shop/GoodsCon/index.vue @@ -52,11 +52,11 @@ - + diff --git a/pkg_common/views/xiaoZhi.vue b/pkg_common/views/xiaoZhi.vue new file mode 100644 index 0000000..267405b --- /dev/null +++ b/pkg_common/views/xiaoZhi.vue @@ -0,0 +1,71 @@ + + + + + \ No newline at end of file diff --git a/pkg_product/views/season.vue b/pkg_product/views/season.vue index f2a4162..1a3a5ec 100644 --- a/pkg_product/views/season.vue +++ b/pkg_product/views/season.vue @@ -1,6 +1,7 @@ -