Explorar el Código

添加funtabs样式

xiaohaizhao hace 3 semanas
padre
commit
c9e16afb2d

+ 1 - 1
E-service/serviceBillList/detail.wxml

@@ -54,7 +54,7 @@
 	</view>
 </view>
 <view style="height: 20rpx;" />
-<Yl_FunTabs list='{{tabsList}}' showIcon='{{false}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+<Yl_FunTabs mode='flat' list='{{tabsList}}' showIcon='{{false}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
 	<ServiceProduct slot='服务商品' id="ServiceProduct" sa_orderid='{{detail.sa_orderid}}' disabled='{{detail.status!="新建"}}' />
 	<ServicePview1 id='ServicePview1' slot='申请信息' />
 	<ServicePview2 id='ServicePview2' slot='受理信息' />

+ 1 - 1
E-service/serviceBillList/insert.js

@@ -198,7 +198,7 @@ Page({
             "pageNumber": 1,
             "where": {
               "condition": "",
-              "type": 17
+              "type": 23
             }
           },
         },

+ 1 - 1
E-service/serviceImprovement/detail.wxml

@@ -44,7 +44,7 @@
 	</view>
 </view>
 <view style="height: 20rpx;" />
-<Yl_FunTabs list='{{tabsList}}' showIcon='{{false}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+<Yl_FunTabs mode='flat' list='{{tabsList}}' showIcon='{{false}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
 	<Analysis detail='{{detail}}' id="Analysis" slot='真因分析' disabled="{{!(user_analysis && detail.status == '新建')}}" />
 	<Scheme id="Scheme" slot='改善方案' disabled="{{!(user_charge && detail.status == '分析已提交')}}" departmentid='{{detail.departmentid}}' sa_service_improvementid="{{detail.sa_service_improvementid}}" />
 	<Execute id="Execute" slot='方案执行' disabled="{{detail.status != '方案已发布'}}" departmentid='{{detail.departmentid}}' sa_service_improvementid="{{detail.sa_service_improvementid}}" />

+ 1 - 1
Eservice/saler/agentList/index.js

@@ -10,7 +10,7 @@ Page({
         "pageNumber": 1,
         "where": {
           "condition": "",
-          type: 9
+          type: 23
         }
       }
     },

+ 1 - 1
Eservice/workerLeader/agentList/index.js

@@ -9,7 +9,7 @@ Page({
         "pageNumber": 1,
         "where": {
           "condition": "",
-          type: 17
+          type: 23
         }
       }
     },

+ 4 - 0
components/Yl_FunTabs/index.js

@@ -21,6 +21,10 @@ Component({
         anchor: {
             type: Number,
             value: 0.4 // 锚点位置,0-1,表示选中项中心在容器宽度的比例位置
+        },
+        mode: {
+            type: String,
+            value: 'scroll' // 'scroll' 滚动模式, 'flat' 平铺模式
         }
     },
     data: {

+ 22 - 11
components/Yl_FunTabs/index.wxml

@@ -1,15 +1,26 @@
-<scroll-view scroll-x enable-flex class="scroll" style="height: {{showIcon?'120':'90'}}rpx;" scroll-left='{{scrollLeft}}' scroll-with-animation enable-passive>
-    <view class="item {{active==index?'active':''}}" style="border-color:{{item.color || '#3874F6'}};" id="{{active==index?'active'+index:''}}" wx:for="{{list}}" wx:key="index" data-index="{{index}}" bindtap="tabsChenge">
-        <block wx:if="{{showIcon}}">
-            {{item.color}}
-            <view class="icon" wx:if="{{item.icon}}">
-                <text class="iconfont {{item.icon}}" />
-            </view>
-            <view wx:else class="num line-1">{{item.num}}</view>
-        </block>
-        <view class="label line-1 {{item.icon?'':'overstriking'}}" style="color: {{active == index ? item.color || '#999' : '#999'}};">{{language[item.label]||item.label}}</view>
+<!-- 滚动模式 -->
+<block wx:if="{{mode=='scroll'}}">
+    <scroll-view scroll-x enable-flex class="scroll" style="height: {{showIcon?'120':'90'}}rpx;" scroll-left='{{scrollLeft}}' scroll-with-animation enable-passive>
+        <view class="item {{active==index?'active':''}}" style="border-color:{{item.color || '#3874F6'}};" id="{{active==index?'active'+index:''}}" wx:for="{{list}}" wx:key="index" data-index="{{index}}" bindtap="tabsChenge">
+            <block wx:if="{{showIcon}}">
+                {{item.color}}
+                <view class="icon" wx:if="{{item.icon}}">
+                    <text class="iconfont {{item.icon}}" />
+                </view>
+                <view wx:else class="num line-1">{{item.num}}</view>
+            </block>
+            <view class="label line-1 {{item.icon?'':'overstriking'}}" style="color: {{active == index ? item.color || '#999' : '#999'}};">{{language[item.label]||item.label}}</view>
+        </view>
+    </scroll-view>
+</block>
+<!-- 平铺模式 -->
+<block wx:if="{{mode=='flat'}}">
+    <view class="flat-container">
+        <view class="item1 {{active==index?'active':''}}" style="{{active==index ? 'background-color:'+(item.color||'#FAE5E5')+';border-color:'+(item.color||'#FAE5E5') : ''}}" wx:for="{{list}}" wx:key="index" data-index="{{index}}" bindtap="tabsChenge">
+            <view class="label1">{{language[item.label]||item.label}}</view>
+        </view>
     </view>
-</scroll-view>
+</block>
 <view class="slot-box" bindtouchstart="myTouchStart" bindtouchmove="myTouchMove">
     <slot name='padtop' />
     <slot name='{{list[active].label}}' />

+ 28 - 0
components/Yl_FunTabs/index.wxss

@@ -71,4 +71,32 @@
 
 .overstriking{
     font-size: 28rpx !important;
+}
+
+/* 平铺模式样式 */
+.flat-container {
+    display: flex;
+    flex-wrap: wrap;
+    margin-top: -10rpx;
+    padding-left: 20rpx;
+    box-sizing: border-box;
+}
+
+.flat-container .item1 {
+    flex-shrink: 0;
+    background: #FFFFFF;
+    border-radius: 8rpx;
+    border: 1rpx solid #E0E0E0;
+    box-sizing: border-box;
+    font-family: PingFang SC, PingFang SC;
+    font-size: 24rpx;
+    color: #333333;
+    padding: 6rpx 12rpx;
+    margin: 10rpx 10rpx 0 0;
+}
+
+.flat-container  .active {
+    background-color: #FAE5E5;
+    border-color: #FAE5E5;
+    color: #fff;
 }