From 3a39258eccb6a734db30cb78a380427796f67ed3 Mon Sep 17 00:00:00 2001 From: xiaowen <372193233@qq.com> Date: Wed, 13 Jul 2022 17:52:36 +0800 Subject: [PATCH] cxw-010023 --- app.json | 2 +- custom-tab-bar/index.js | 2 +- pages/brandCrisis/index.js | 7 ++-- pages/brandSearch/index.js | 47 +++++++++++++++++++++++-- pages/brandSearch/index.wxml | 66 ++++++++++++++++++++++-------------- pages/brandSearch/index.wxss | 49 ++++++++++++++++++++++++++ 6 files changed, 142 insertions(+), 31 deletions(-) diff --git a/app.json b/app.json index a6ba4a7..b6045a6 100644 --- a/app.json +++ b/app.json @@ -46,7 +46,7 @@ "text": "洞察" }, { - "pagePath": "pages/brandSearch/index", + "pagePath": "pages/brandCrisis/index", "iconPath": "/custom-tab-bar/icons/appSearch.png", "selectedIconPath": "/custom-tab-bar/icons/appSearchActive.png", "text": "品牌搜索" diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index 457430d..831cd10 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -16,7 +16,7 @@ Component({ "text": "洞察" }, { - "pagePath": "pages/brandSearch/index", + "pagePath": "pages/brandCrisis/index", "iconPath": "icons/appSearch.png", "selectedIconPath": "icons/appSearchActive.png", "text": "", diff --git a/pages/brandCrisis/index.js b/pages/brandCrisis/index.js index 243d43a..5a0a76d 100644 --- a/pages/brandCrisis/index.js +++ b/pages/brandCrisis/index.js @@ -2,6 +2,9 @@ const app = getApp(); Page({ data: { imageUrl: getApp().globalData.imageUrl, - healthCrisis:"background-image: url(./img/health-crisis.png); background-color: #FF463C;height: 834rpx;" - } + healthCrisis:"background-image: url(" + getApp().globalData.imageUrl + "/health-crisis.png); background-color: #FF463C;height: 834rpx;" + }, + onShow() { + + } }) \ No newline at end of file diff --git a/pages/brandSearch/index.js b/pages/brandSearch/index.js index aaf97c0..676d667 100644 --- a/pages/brandSearch/index.js +++ b/pages/brandSearch/index.js @@ -11,7 +11,10 @@ Page({ navData: [], sourceData: [], mockData: [], - heightTop: 210 + heightTop: 210, + lastTime: 0, + showPop: false, + series: [] }, onLaunch() { wx.getSystemInfo({ @@ -48,8 +51,48 @@ Page({ }) }, handlerChoose(e) { + let thisTime = e.timeStamp; + let lastTime = this.data.lastTime; const row = e.currentTarget.dataset.row; - wx.setStorageSync('sBrand', row.brandname); + wx.setStorageSync('sBrand', row.brandname); + if (lastTime != 0 && thisTime - lastTime < 500) { + this.setData({ + showPop: false + }) + wx.switchTab({ + url: "/pages/brandCrisis/index" + }) + } else { + this.setData({ + lastTime: thisTime, + showPop: true + }) + this.getSeries(row.brandname); + } + }, + handlerCloseDialog() { + this.setData({ + showPop: false + }) + }, + handlerChooseS(e) { + const row = e.currentTarget.dataset.row; + wx.setStorageSync('sSeriesName', row.name); + wx.switchTab({ + url: "/pages/brandCrisis/index" + }) + }, + getSeries(brandname) { + let obj = { + action: 'getUserSeriesName', + token: wx.getStorageSync('token') || 't%2BrswgjvzGM=', + sBrandName: brandname + } + app.globalData.request(obj).then(res => { + this.setData({ + series: res + }) + }) }, getData() { //页面数据 diff --git a/pages/brandSearch/index.wxml b/pages/brandSearch/index.wxml index e19ce99..578ff6c 100644 --- a/pages/brandSearch/index.wxml +++ b/pages/brandSearch/index.wxml @@ -1,28 +1,44 @@ - - - - 硕为思汽车智能洞察 - - + + + + 硕为思汽车智能洞察 + + + + + + + + {{item.brandname}} + + + - - - - - {{item.brandname}} - - - - - - - - - - - {{item2.brandname}} - - - + + + + + + + {{item2.brandname}} + + + + + + + + + + + + + {{item.name}} + + + + + + \ No newline at end of file diff --git a/pages/brandSearch/index.wxss b/pages/brandSearch/index.wxss index 2bab5d2..731a797 100644 --- a/pages/brandSearch/index.wxss +++ b/pages/brandSearch/index.wxss @@ -77,6 +77,8 @@ .bs-tab-sv-item { text-align: center; padding: 0rpx 36rpx; + height: 140rpx; + } .userAvatar{ width: 78rpx; @@ -85,4 +87,51 @@ } .bs-tab-title{ font-size: 27rpx; +} +.bs-right-pop { + position: fixed; + width: 100%; + height: calc(100% - 210px - 85px); + top: 210px; + left: 0px; + background: rgba(0,0,0, 0.5); + z-index: 2800; + overflow: hidden; +} +.bs-r-inner { + position: absolute; + height: calc(100% - 14px); + width: 68%; + top: 0px; + right: 0px; + background: #fff; + box-shadow: 2px 0px 2px 2px #ccc; + padding: 7px 10px; +} +.bs-r-close { + position: absolute; + text-align: right; + font-size: 16px; + color: #6E6E6E; + width: 26px; + height: 26px; + top: 0px; + right: 10px; +} +.bs-r-cont { + position: absolute; + top: 26px; + 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