dev
xiaowen 3 years ago
parent 9ed287bf6b
commit 3a39258ecc

@ -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": "品牌搜索"

@ -16,7 +16,7 @@ Component({
"text": "洞察"
},
{
"pagePath": "pages/brandSearch/index",
"pagePath": "pages/brandCrisis/index",
"iconPath": "icons/appSearch.png",
"selectedIconPath": "icons/appSearchActive.png",
"text": "",

@ -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() {
}
})

@ -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() {
//页面数据

@ -1,28 +1,44 @@
<view class="view-page">
<view class="navigation nav-top" style="background: #006BFF;">
<!--手机状态栏的高度-->
<view style="height:{{statusBarHeight}}px;width: 100%;"></view>
<view class="bs-top-title" style="height: {{navBarHeight}}px;width: 100%;">硕为思汽车智能洞察</view>
<view class="bs-top">
<van-search style="width: 100%;" background="#006BFF" value="{{ value }}" placeholder="请输入品牌" bind:search="handlerSearch" />
<view class="navigation nav-top" style="background: #006BFF;">
<!--手机状态栏的高度-->
<view style="height:{{statusBarHeight}}px;width: 100%;"></view>
<view class="bs-top-title" style="height: {{navBarHeight}}px;width: 100%;">硕为思汽车智能洞察</view>
<view class="bs-top">
<van-search style="width: 100%;" background="#006BFF" value="{{ value }}" placeholder="请输入品牌" bind:search="handlerSearch" />
</view>
<view class="bs-tabs">
<scroll-view class="bs-tab-sv" scroll-x="true" enable-flex="true">
<view class="bs-tab-sv-item" wx:for="{{navData}}" data-row="{{item}}" wx:key="index" bindtap="handlerChoose">
<image class="userAvatar" src="{{item.img}}" lazy-load="{{true}}" />
<view class="bs-tab-title">{{item.brandname}}</view>
</view>
</scroll-view>
</view>
</view>
<view class="bs-tabs">
<scroll-view class="bs-tab-sv" scroll-x="true" enable-flex="true">
<view class="bs-tab-sv-item" wx:for="{{navData}}" data-row="{{item}}" wx:key="index" bindtap="handlerChoose">
<image class="userAvatar" src="{{item.img}}" />
<view class="bs-tab-title">{{item.brandname}}</view>
</view>
</scroll-view>
</view>
</view>
<view class="bs-block" style="height: {{heightTop}}px;"></view>
<van-index-bar class="bs-bar" sticky-offset-top="{{heightTop}}">
<view wx:for="{{mockData}}" wx:key="idx">
<van-index-anchor index="{{item.name}}" />
<view class="bs-item" wx:for="{{item.data}}" wx:key="idx" wx:for-item="item2">
<image slot="icon" class="bs-item-image" src="{{item2.img}}" lazy-load="{{true}}"/>
<text>{{item2.brandname}}</text>
</view>
</view>
</van-index-bar>
<view class="bs-block" style="height: {{heightTop}}px;"></view>
<van-index-bar class="bs-bar" sticky-offset-top="{{heightTop}}">
<view wx:for="{{mockData}}" wx:key="idx">
<van-index-anchor index="{{item.name}}" />
<view class="bs-item" wx:for="{{item.data}}" wx:key="idx" wx:for-item="item2" data-row="{{item2}}" bindtap="handlerChoose">
<image slot="icon" class="bs-item-image" src="{{item2.img}}" lazy-load="{{true}}" />
<text>{{item2.brandname}}</text>
</view>
</view>
</van-index-bar>
<van-transition show="{{ showPop }}" duration="{{ { enter: 300, leave: 1000 } }}" name="fade-right">
<view class="bs-right-pop" style="top: {{heightTop}}px;height: calc(100% - {{heightTop}}px - 85px);">
<view class="bs-r-inner">
<view class="bs-r-close">
<van-icon name="cross" bindtap="handlerCloseDialog" />
</view>
<view class="bs-r-cont">
<view class="bs-item" wx:for="{{series}}" wx:key="index" wx:for-item="item" data-row="{{item}}" bindtap="handlerChooseS">
<image slot="icon" class="bs-item-image" src="{{item.img}}" lazy-load="{{true}}" />
<text>{{item.name}}</text>
</view>
</view>
</view>
</view>
</van-transition>
</view>

@ -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);
}
Loading…
Cancel
Save