分类太丑 修改下
1.修改app.js找到onPageLoad函数 加入以下代码注入systemInfo数据到页面onPageLoad: function (event) {
let pageInstance= this.getAppCurrentPage();
let detail = event.detail || '';
let promotionName = event.promotionName;
let that = this;
pageInstance.sharePageParams = event;
pageInstance.setData({
'systemInfo': that.globalData.systemInfo
})
2.进分类页面找到zcSort 后面追加systemInfo数据<view class="ele-container" wx:if="{{!sort1.hidden}}">
<template is="zcSort" data="{{data:sort1,systemInfo}}"></template>
</view>
3.找到zcSort这个模板,有的时候在本页面下有的时候在components/templates/templates.wxml中 修改:
<template name="zcSort">
<view class="element sort" style="{{data.style}}" bindanimationend="animationEnd" data-compid="{{ data.compId }}">
<scroll-view scroll-x="true" data-selected="{{data.customFeature.selected}}" style="{{data.ul_style}}">
<block wx:for="{{data.content}}" wx:for-index="idx" wx:for-item="itemName" wx:key="">
<block wx:if="{{idx == data.customFeature.selected}}">
<view class="item refresh selected" catchtap="sortListFunc"
data-compid="{{ data.compId }}"
data-listid="{{data.customFeature.sort_object}}"
data-sortkey="{{itemName.customFeature.sort_key}}"
data-sortdirection="{{itemName.customFeature.sort_direction}}"
data-idx="{{idx}}"
style="color:{{data.customFeature.selectedColor}};min-width:{{systemInfo.windowWidth/data.content.length}}px">
<text>{{itemName.text}}</text>
<label class="arr-wrap" wx:if="{{ idx != 0 }}">
<text style="color: {{itemName.customFeature.sort_direction == 0 ? data.customFeature.selectedColor : '#ddd'}};" class="sort-arr arr-up">▲</text>
<text style="color: {{itemName.customFeature.sort_direction == 1 ? data.customFeature.selectedColor : '#ddd'}};" class="sort-arr arr-down">▼</text>
</label>
</view>
</block>
<block wx:else>
<view class="item refresh" catchtap="sortListFunc"
data-compid="{{ data.compId }}"
data-listid="{{data.customFeature.sort_object}}"
data-sortkey="{{itemName.customFeature.sort_key}}"
data-sortdirection="{{itemName.customFeature.sort_direction}}"
data-idx="{{idx}}"
style="min-width:{{systemInfo.windowWidth/data.content.length}}px"
>{{itemName.text}}</view>
</block>
</block>
</scroll-view>
</view>
</template>
这样当只有三个分类的就不会出现分类项 只靠左显示了
我有流量,你有产品,我们就可以合作,有意的个人开发者朋友可以联系微信号jim20180688,详聊
页:
[1]