zhoux 1 год назад
Родитель
Сommit
e37c8fc10d
3 измененных файлов с 24 добавлено и 3 удалено
  1. 20 1
      components/dkbase/dk-cell/dk-cell.js
  2. 3 1
      components/dkbase/dk-cell/dk-cell.wxml
  3. 1 1
      config/config.js

+ 20 - 1
components/dkbase/dk-cell/dk-cell.js

@@ -198,6 +198,13 @@ Component({
      */
     errorMessage:{
       type:String,
+    },
+    /**
+     * 小数是否单独显示(字号下一些)
+     */
+    decimalFlag:{
+      type:Boolean,
+      value:true
     }
   },
 
@@ -207,6 +214,8 @@ Component({
   data: {
     displayValue:'',
     titleWidth:'',
+    // 小数部分
+    decimalValue:'',
     // fontSize:14
   },
 
@@ -219,6 +228,7 @@ Component({
      */
     handleDisplayValue(amount,content){
       let displayValue = ''
+      let decimalValue = ''
       if(content){
         // 非数字直接显示
         if(!amount){
@@ -232,11 +242,20 @@ Component({
             displayValue = content;
           }
         }
+        // 如果小数单独显示,需要切出来
+        if(this.data.decimalFlag){
+          let values = displayValue.split('.');
+          displayValue = values[0];
+          if(values.length > 1){
+            decimalValue = '.' + values[1]
+          }
+        }
       }else{
         displayValue = '';
       }
       this.setData({
-        displayValue:displayValue
+        displayValue:displayValue,
+        decimalValue:decimalValue
       })
     }
   },

+ 3 - 1
components/dkbase/dk-cell/dk-cell.wxml

@@ -5,7 +5,9 @@
   <!--错误提示信息-->
   <view wx:if="{{errorMessage}}" class="{{contentRight?'content_class':'content_left_class'}} errMsg_class" style="--contentColor--:{{placeholderColor}};--fontSize--:{{(contentFontSize==0?fontSize:contentFontSize) + 'px'}};--titleWidth--:{{titleWid?titleWid :titleWidth + 'px'}};--fontWeight--:{{contentFontWeight==''?fontWeight:contentFontWeight}};--spaceWidth--:{{title?spaceWidth:''}}">{{errorMessage}}</view>
   <view class="{{contentRight?'content_class':'content_left_class'}}" style="--contentColor--:{{contentColor}};--fontSize--:{{(contentFontSize==0?fontSize:contentFontSize) + 'px'}};--titleWidth--:{{titleWid?titleWid :titleWidth + 'px'}};--fontWeight--:{{contentFontWeight==''?fontWeight:contentFontWeight}};--spaceWidth--:{{title?spaceWidth:''}}">
-    <view wx:if="{{amount && displayValue}}" class="sign-class" style="--fontSize--:{{signSize?signSize:((fontSize - 5 ) + 'px')}};--color--:{{contentColor}}">{{percentSignFlag ? '' :car}}</view>{{displayValue}} <view wx:if="{{tail}}" class="sign-class-tail" style="--fontSize--:{{signSize?signSize:((fontSize - 5 ) + 'px')}};--color--:{{tailColor==''?contentColor:tailColor}};--line--:{{tailLine?'line-through':'none'}};--tailFontWeight--:{{tailFontWeight==''?fontWeight:tailFontWeight}}">{{tail}}</view>
+    <view wx:if="{{amount && displayValue}}" class="sign-class" style="--fontSize--:{{signSize?signSize:((fontSize - 5 ) + 'px')}};--color--:{{contentColor}}">{{percentSignFlag ? '' :car}}</view>{{displayValue}}
+    <view wx:if="{{decimalFlag && decimalValue}}" class="sign-class" style="--fontSize--:{{signSize?signSize:((fontSize - 5 ) + 'px')}};--color--:{{contentColor}}">{{decimalValue}}</view>
+     <view wx:if="{{tail}}" class="sign-class-tail" style="--fontSize--:{{signSize?signSize:((fontSize - 5 ) + 'px')}};--color--:{{tailColor==''?contentColor:tailColor}};--line--:{{tailLine?'line-through':'none'}};--tailFontWeight--:{{tailFontWeight==''?fontWeight:tailFontWeight}}">{{tail}}</view>
   </view>
 
 </view>

+ 1 - 1
config/config.js

@@ -3,7 +3,7 @@ const profiles = 'dev';
 const configListObj = {
   // 北京东科企信软件有限公司 本地开发
   dev: {
-    server_add: 'http://192.168.0.90',     server_port: '7001',
+    server_add: 'http://192.168.0.57',     server_port: '7001',
     upload_url:'https://s.dev01.dkiboss.com:7000/api/mdm-server/file/upload',
     image_url:'https://s.dev01.dkiboss.com:7000/file',
     corpid: 'ww796c5d1684937b2f', //企业微信corpid