From ba2ba87551d38a9c7962cebbb60a49d7ca2a5a34 Mon Sep 17 00:00:00 2001 From: xiaowen <372193233@qq.com> Date: Mon, 18 Jul 2022 14:20:11 +0800 Subject: [PATCH] cxm-010203 --- pages/brandSearch/index.js | 35 ++++++++++++++++++----------------- pages/brandSearch/index.wxml | 20 +++++--------------- pages/brandSearch/index.wxss | 14 ++------------ pages/detail/index.js | 25 +++++++++++++++++++++---- pages/detail/index.wxml | 11 +++++------ project.private.config.json | 9 ++++++++- 6 files changed, 59 insertions(+), 55 deletions(-) diff --git a/pages/brandSearch/index.js b/pages/brandSearch/index.js index 676d667..ae40ac8 100644 --- a/pages/brandSearch/index.js +++ b/pages/brandSearch/index.js @@ -12,9 +12,9 @@ Page({ sourceData: [], mockData: [], heightTop: 210, - lastTime: 0, showPop: false, - series: [] + series: [], + type: 2 }, onLaunch() { wx.getSystemInfo({ @@ -29,8 +29,15 @@ Page({ } }) }, + onLoad() { + let pages = getCurrentPages(); + let currentPage = pages[pages.length-1] + let options = currentPage.options + this.setData({ + type: options.type || 2 + }) + }, onShow() { - this.getTabBar().init(); this.getData(); this.createSelectorQuery().select(".nav-top").boundingClientRect(res => { if (res) { @@ -51,24 +58,18 @@ Page({ }) }, handlerChoose(e) { - let thisTime = e.timeStamp; - let lastTime = this.data.lastTime; const row = e.currentTarget.dataset.row; wx.setStorageSync('sBrand', row.brandname); - if (lastTime != 0 && thisTime - lastTime < 500) { - this.setData({ - showPop: false - }) + if(this.data.type === 1) { wx.switchTab({ url: "/pages/brandCrisis/index" - }) - } else { - this.setData({ - lastTime: thisTime, - showPop: true - }) - this.getSeries(row.brandname); - } + }) + return; + } + this.setData({ + showPop: true + }) + this.getSeries(row.brandname); }, handlerCloseDialog() { this.setData({ diff --git a/pages/brandSearch/index.wxml b/pages/brandSearch/index.wxml index 578ff6c..ac50a80 100644 --- a/pages/brandSearch/index.wxml +++ b/pages/brandSearch/index.wxml @@ -25,20 +25,10 @@ - - - - - - - - - - {{item.name}} - - - + + + + {{item.name}} - - + \ No newline at end of file diff --git a/pages/brandSearch/index.wxss b/pages/brandSearch/index.wxss index 731a797..0e6731e 100644 --- a/pages/brandSearch/index.wxss +++ b/pages/brandSearch/index.wxss @@ -53,7 +53,7 @@ background: #F9F9F9; } .bs-bar .van-index-bar__sidebar { - top: 63% !important; + top: 56% !important; } /*横向列表项*/ .bs-tabs { @@ -69,7 +69,7 @@ } .bs-tab-sv { width: 100%; - width: 100%; + height: 150rpx; white-space: nowrap; display: flex; justify-content: flex-start; @@ -124,14 +124,4 @@ height: calc(100% - 26px); width: 100%; overflow: auto; -} -.van-enter-active-class, -.van-leave-active-class { - transition-property: background-color, transform; -} - -.van-enter-class, -.van-leave-to-class { - background-color: red; - transform: rotate(-360deg) translate3d(-100%, -100%, 0); } \ No newline at end of file diff --git a/pages/detail/index.js b/pages/detail/index.js index d147b41..c4945f1 100644 --- a/pages/detail/index.js +++ b/pages/detail/index.js @@ -2,7 +2,12 @@ const app = getApp(); Page({ data: { imageUrl: getApp().globalData.imageUrl, - id: '' + id: "", + source: "", + user_author: "", + sourcetime: "", + title: "", + content: "" }, onLoad() { wx.setNavigationBarTitle({ @@ -20,11 +25,23 @@ Page({ }, getData() { app.globalData.request({ - action: 'getSwsQyQuartz', - id: this.data.id, + action: 'getDataById', + sId: this.data.id, + sType: 'ZhuTiFenXiBl', token: wx.getStorageSync('token') || 't%2BrswgjvzGM=' }).then(res => { - console.log(res) + let arr = res || []; + if(arr.length > 0) { + let data = arr[0]; + console.log(data) + this.setData({ + source: data._source.source, + user_author: data._source.user_author, + sourcetime: data._source.sourcetime, + title: data._source.title, + content: data._source.content + }) + } }) } }) \ No newline at end of file diff --git a/pages/detail/index.wxml b/pages/detail/index.wxml index f8150d7..e5469c0 100644 --- a/pages/detail/index.wxml +++ b/pages/detail/index.wxml @@ -11,21 +11,21 @@ - 哈弗大狗追猎顶配版上市发布会即将耀目登场 + {{title}} 发布时间 - 2022-06-10 01:00:49 + {{sourcetime}} 来源 - 汽车之家 + {{source}} 作者 - 小猪说车 + {{user_author}} @@ -33,8 +33,7 @@ - 在沙漠中驾驶极易迷失方向,以下那种驾驶行为是正确的?A一直走直线;B手机有信号就随便开;C开启循迹导航功能。能做这道题的,是哈弗大狗追猎版。因为它新增了8种驾驶模式、循迹导航、人脸识别、遥控泊车、驾驶模式记忆、座椅记忆、外后视镜记忆、座舱清洁和等离子发生器等功能,而8种驾驶模式中的沙地模式+循迹导航,将能让这台车驰骋沙海。 -6月6日,哈弗大狗追猎版深入中国第七大沙漠——库布齐的茫茫沙海成功打卡,并宣布上市,哈弗大狗1.5T 马犬追猎版、哈弗大狗2.0T 中华田园犬追猎版和哈弗大狗2.0T 哮天犬追猎版三款车型分别售价:14.89万元、16.19万元和16.79万元。我觉得, 刻度座驾,一直是哈弗大狗的产品属性。而追猎版的到来,让这台车的属性更靠越野一些,可能来到了4/5,确实够劲。 + {{content}} 相似信息 diff --git a/project.private.config.json b/project.private.config.json index 3f95e94..861593a 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -25,7 +25,14 @@ { "name": "详情", "pathName": "pages/detail/index", - "query": "id=10&mod=0", + "query": "id=452949383c124d65a4b315b64309d29e&mod=0", + "launchMode": "default", + "scene": null + }, + { + "name": "品牌车型搜索", + "pathName": "pages/brandSearch/index", + "query": "", "launchMode": "default", "scene": null }