Commit e99a5b35 by 杨明

Merge branch 'SAAS+V4.51.1-0415' of http://192.168.3.233:8090/saas_plus/dj-car-b…

…outique-work-wechat into SAAS+V4.51.1-0415
2 parents a3b46116 c562da5d
...@@ -4,12 +4,20 @@ Page({ ...@@ -4,12 +4,20 @@ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: {}, data: {
inputHeight: 0,
searchValue: ''
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
wx.$util.getViewInfo('#search-input', res => {
this.setData({
inputHeight: res.height
})
})
if (options.level == 2) this.level = 2 if (options.level == 2) this.level = 2
carLifeApi.getCarBrandList().then(res => { carLifeApi.getCarBrandList().then(res => {
// this.setLocalStorage('wx_scrm_car_brand_list', carInfo) // this.setLocalStorage('wx_scrm_car_brand_list', carInfo)
...@@ -155,11 +163,32 @@ Page({ ...@@ -155,11 +163,32 @@ Page({
}) })
}, },
choose(e) { choose(e) {
const {item} = e.currentTarget.dataset const {
item
} = e.currentTarget.dataset
wx.$router.back(page => { wx.$router.back(page => {
page.changeCarBrand && page.changeCarBrand(item) page.changeCarBrand && page.changeCarBrand(item)
}) })
}, },
search(e) {
try {
let {
value
} = e.detail, {
brandList
} = this.data
brandList.map(i => {
i.list.map(k => {
if (k.name.includes(value)) throw i.letter
})
})
} catch (letter) {
this.setData({
letter
})
}
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
<!--packageEquity/pages/carEquity/carBrands/carBrands.wxml--> <!--packageEquity/pages/carEquity/carBrands/carBrands.wxml-->
<view class="car-brands-box"> <view class="car-brands-box">
<view class="car-brands"> <view class="car-brands">
<scroll-view style="height:100%;" scroll-y scroll-into-view="{{letter}}"> <search-input bindsearch="search" value="{{searchValue}}" id="search-input" />
<scroll-view style="height:calc(100vh - {{inputHeight}}px);" scroll-y scroll-into-view="{{letter}}">
<block wx:if="{{flag}}"> <block wx:if="{{flag}}">
<block wx:if="{{brandList.length}}"> <block wx:if="{{brandList.length}}">
<block wx:for="{{brandList}}" wx:key="index"> <block wx:for="{{brandList}}" wx:key="index">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!