Commit e6ef74ff by 李伟康

commit 2.1权益需求

1 parent 2f54ef0a
...@@ -8,17 +8,18 @@ Component({ ...@@ -8,17 +8,18 @@ Component({
activeIndex: { activeIndex: {
type: Number, type: Number,
observer: function (n) { observer: function (n) {
console.log(this.data.tabIndex,'activeIndex',n); console.log(this.data.tabIndex, 'activeIndex', n);
console.log(this.data.tabIndex!= n); console.log(this.data.tabIndex != n);
if (this.data.tabIndex!= n) { if (this.data.tabIndex != n) {
this.setData({ this.setData({
tabIndex:this.data.activeIndex tabIndex: this.data.activeIndex
}) })
this.setTab(this.data.tabIndex) this.setTab(this.data.tabIndex)
} }
} }
} },
scroll: Boolean
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
...@@ -33,7 +34,7 @@ Component({ ...@@ -33,7 +34,7 @@ Component({
this.setTab(this.data.tabIndex) this.setTab(this.data.tabIndex)
let that = this let that = this
wx.$eventbus.on('page_show', n => { wx.$eventbus.on('page_show', n => {
!that.data.width && that.setTab(that.data.tabIndex) !that.data.width && that.setTab(that.data.tabIndex)
}) })
} }
}, },
...@@ -41,7 +42,7 @@ Component({ ...@@ -41,7 +42,7 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
change(e) { change(e) {
let { let {
index index
...@@ -71,6 +72,7 @@ Component({ ...@@ -71,6 +72,7 @@ Component({
this.setData({ this.setData({
activeStyle: `width: var(--fontSize64);left:${left + (width - 32) / 2}px;background-color:#347BFF;`, activeStyle: `width: var(--fontSize64);left:${left + (width - 32) / 2}px;background-color:#347BFF;`,
tabIndex: index, tabIndex: index,
to: `to-${index}`,
width width
}) })
this.triggerEvent('click', index) this.triggerEvent('click', index)
......
<view class="tab" style="grid-template-columns: repeat({{tabList.length}}, 1fr);font-size:{{tabList.length>5?'var(--fontSize24)':''}} ;">
<block wx:for="{{tabList}}" wx:key="index">
<!-- style="color:{{tabIndex==index?'#347BFF':''}};" -->
<view class="tab-item {{tabIndex==index?'active':''}}" bindtap="change" data-index="{{index}}">
<text id="tab-{{index}}"><text class="tab-item-text">{{item.text || item }}</text><text wx:if="{{item.count >= 0}}" style="font-size: var(--fontSize20);">({{item.count}})</text></text>
</view>
</block>
<view class="active-doc" style="{{activeStyle}}" />
</view>
\ No newline at end of file \ No newline at end of file
<block wx:if="{{scroll}}">
<scroll-view class=" scroll" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}">
<block wx:for="{{tabList}}" wx:key="index">
<view class="tab-item {{tabIndex==index?'active':''}}" bindtap="change" data-index="{{index}}" id="to-{{index}}">
<text id="tab-{{index}}" class="tab-text">
<text class="tab-item-text">{{item.text || item }}</text><text wx:if="{{item.count >= 0}}" style="font-size: var(--fontSize20);">({{item.count}})</text>
</text>
</view>
</block>
<!-- <view class="active-doc" style="{{activeStyle}}" /> -->
</scroll-view>
</block>
<block wx:else>
<view class="tab" style="grid-template-columns: repeat({{tabList.length}}, 1fr);font-size:{{tabList.length>5?'var(--fontSize24)':''}} ;">
<block wx:for="{{tabList}}" wx:key="index">
<!-- style="color:{{tabIndex==index?'#347BFF':''}};" -->
<view class="tab-item {{tabIndex==index?'active':''}}" bindtap="change" data-index="{{index}}">
<text id="tab-{{index}}"><text class="tab-item-text">{{item.text || item }}</text><text wx:if="{{item.count >= 0}}" style="font-size: var(--fontSize20);">({{item.count}})</text></text>
</view>
</block>
<view class="active-doc" style="{{activeStyle}}" />
</view>
</block>
\ No newline at end of file \ No newline at end of file
...@@ -10,6 +10,18 @@ ...@@ -10,6 +10,18 @@
border-bottom: var(--fontSize1) solid #F2F3F5; border-bottom: var(--fontSize1) solid #F2F3F5;
} }
.scroll {
background-color: #fff;
height: var(--fontSize72);
box-sizing: border-box;
color: #999999;
border-bottom: var(--fontSize1) solid #F2F3F5;
width: 100%;
display: flex;
line-height: var(--fontSize72);
font-size: 0;
}
.active { .active {
/* font-size: var(--fontSize32); */ /* font-size: var(--fontSize32); */
font-weight: 600; font-weight: 600;
...@@ -26,4 +38,29 @@ ...@@ -26,4 +38,29 @@
.tab .tab-item { .tab .tab-item {
text-align: center; text-align: center;
}
.scroll .tab-item {
width: fit-content;
min-width: var(--fontSize144);
height: 100%;
flex-shrink: 0;
font-size: var(--fontSize28);
text-align: center;
position: relative;
}
.scroll .active .tab-text {
position: relative;
}
.scroll .active .tab-text::after {
position: absolute;
bottom: calc(-1 * var(--fontSize16));
left: 50%;
transform: translateX(-50%);
width: 100%;
height: var(--fontSize4);
background-color: #347BFF;
content: '';
} }
\ No newline at end of file \ No newline at end of file
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
width: var(--fontSize180); width: var(--fontSize180);
height: var(--fontSize48); height: var(--fontSize48);
background: #FFFFFF; background: #FFFFFF;
border: var(--fontSize2) solid #347BFF; // border: var(--fontSize2) solid #347BFF;
border-radius: var(--fontSize32); border-radius: var(--fontSize32);
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
.pictureIcon { .pictureIcon {
width: var(--fontSize28); width: var(--fontSize28);
height: var(--fontSize28); height: var(--fontSize28);
margin-right: var(--fontSize10);
} }
.text { .text {
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
</block> </block>
<view class="ocrBtn" data-type="idCard" bind:tap="navOcr"> <view class="ocrBtn" data-type="idCard" bind:tap="navOcr">
<image data-type="idCard" data-ocrType="idCard" class="pictureIcon" src="/packageEquity/images/pictureIcon.png" binderror="" bindload="" /> <image data-type="idCard" data-ocrType="idCard" class="pictureIcon" src="/packageEquity/images/pictureIcon.png" binderror="" bindload="" />
<view class="text" data-type="idCard">拍照识别</view>
</view> </view>
</view> </view>
<gl-form disable="{{disable}}" formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{first.customerFormList}}" bindRegionChange="bindRegionChange"> <gl-form disable="{{disable}}" formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{first.customerFormList}}" bindRegionChange="bindRegionChange">
...@@ -45,7 +44,6 @@ ...@@ -45,7 +44,6 @@
<view>车辆信息</view> <view>车辆信息</view>
<view class="ocrBtn" data-type="vehicleCertificate" bind:tap="navOcr"> <view class="ocrBtn" data-type="vehicleCertificate" bind:tap="navOcr">
<image data-type="vehicleCertificate" data-ocrType="car" class="pictureIcon" src="/packageEquity/images/pictureIcon.png" binderror="" bindload="" /> <image data-type="vehicleCertificate" data-ocrType="car" class="pictureIcon" src="/packageEquity/images/pictureIcon.png" binderror="" bindload="" />
<view class="text" data-type="vehicleCertificate">拍照识别</view>
</view> </view>
</view> </view>
<gl-form disable="{{disable}}" formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" bind:inputEvent="inputEvent" formDataList="{{first.carFormList}}"> <gl-form disable="{{disable}}" formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" bind:inputEvent="inputEvent" formDataList="{{first.carFormList}}">
......
...@@ -52,8 +52,16 @@ ...@@ -52,8 +52,16 @@
</view> </view>
</block> </block>
</view> </view>
<view class="search text-center" bindtap="showConfirm">
<view class="text-center">
筛选
<image class="search-filter" src="/images/filter.png" />
</view>
</view>
</view>
<view>
<tab-bar tabList="{{tabList}}" bindclick="tabClick" scroll />
</view> </view>
<tab-bar tabList="{{tabList}}" bindclick="tabClick" />
</view> </view>
<!-- <view class="total-box"> <!-- <view class="total-box">
{{tabIndex == 0 ? '总订单' : tabList[tabIndex]}} · {{total}} {{tabIndex == 0 ? '总订单' : tabList[tabIndex]}} · {{total}}
......
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
width: 100%; width: 100%;
padding: var(--fontSize16) var(--fontSize32) 0; padding: var(--fontSize16) var(--fontSize32) 0;
display: flex; display: flex;
align-items: center;
background-color: #fff; background-color: #fff;
position: sticky; position: sticky;
top: 0; top: 0;
...@@ -115,11 +116,17 @@ ...@@ -115,11 +116,17 @@
.search-box .search-input { .search-box .search-input {
background: #F7F8FA; background: #F7F8FA;
border-radius: var(--fontSize38); border-radius: var(--fontSize38);
width: 100%; width: calc(568 / 750 * 100%);
height: var(--fontSize64); height: var(--fontSize64);
display: flex; display: flex;
align-items: center; align-items: center;
} }
.search-box .filter{
margin-left: auto;
display: flex;
align-items: center;
}
.search-box .search-input .search-icon { .search-box .search-input .search-icon {
width: var(--fontSize28); width: var(--fontSize28);
...@@ -154,11 +161,12 @@ ...@@ -154,11 +161,12 @@
} }
.search-box .search { .search-box .search {
width: var(--fontSize144); width: calc(144 / 750 * 100%);
height: 100%; height: 100%;
color: #666; color: #666;
box-sizing: border-box; box-sizing: border-box;
padding: 0 var(--fontSize24); padding: 0 var(--fontSize24);
margin-left: auto;
} }
.search-box .search .text-center { .search-box .search .text-center {
...@@ -168,6 +176,9 @@ ...@@ -168,6 +176,9 @@
width: 100%; width: 100%;
height: var(--fontSize50); height: var(--fontSize50);
color: #888; color: #888;
display: flex;
align-items: center;
justify-content: center;
} }
.search-box .search .text-center .search-filter { .search-box .search .text-center .search-filter {
...@@ -198,7 +209,7 @@ ...@@ -198,7 +209,7 @@
.list { .list {
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
padding: 0 var(--fontSize20) var(--fontSize20); /* padding: 0 var(--fontSize20) var(--fontSize20); */
padding-bottom: 0; padding-bottom: 0;
/* height: calc(100% - var(--fontSize20)); */ /* height: calc(100% - var(--fontSize20)); */
/* height: calc(100% - var(--fontSize30)); */ /* height: calc(100% - var(--fontSize30)); */
...@@ -210,7 +221,7 @@ ...@@ -210,7 +221,7 @@
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 var(--fontSize6) var(--fontSize16) 0 rgba(205, 205, 209, 0.5); box-shadow: 0 var(--fontSize6) var(--fontSize16) 0 rgba(205, 205, 209, 0.5);
border-radius: var(--fontSize16); border-radius: var(--fontSize16);
margin: 0 var(--fontSize6) var(--fontSize20); margin: 0 var(--fontSize26) var(--fontSize20);
padding-bottom: var(--fontSize20); padding-bottom: var(--fontSize20);
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!