Browse Source

通用翻译

xiaohaizhao 1 năm trước cách đây
mục cha
commit
08d8319f05

+ 6 - 1
components/Yl_Detail/index.js

@@ -6,5 +6,10 @@ Component({
     },
     options: {
         multipleSlots: true
-    }
+    },
+    lifetimes: {
+        attached() {
+            getApp().globalData.Language.getLanguagePackage(this)
+        }
+    },
 })

+ 2 - 2
components/Yl_Detail/index.wxml

@@ -1,8 +1,8 @@
 <view class="box" wx:if="{{list}}">
     <slot name='top' />
     <view class="row" wx:for="{{list}}" wx:key="index">
-        <view class="label">{{item.label}}:</view>
-        <view class="value">{{item.value||'--'}}</view>
+        <view class="label">{{language[item.label]||item.label}}:</view>
+        <view class="value">{{language[item.item.label]||item.value||'--'}}</view>
     </view>
     <slot name='bottom' />
 </view>

+ 5 - 0
components/Yl_ReportForms/index.js

@@ -11,6 +11,11 @@ Component({
             type: Function
         }
     },
+    lifetimes: {
+        attached() {
+            getApp().globalData.Language.getLanguagePackage(this)
+        }
+    },
     options: {
         multipleSlots: true
     },

+ 2 - 2
components/Yl_ReportForms/index.wxml

@@ -1,8 +1,8 @@
 <block wx:for="{{list}}" wx:key="index">
     <van-transition show="{{ showAll || item.value }}" name="fade" custom-class="block">
         <navigator url="#" class="box" bindtap="clickItem" data-item="{{item}}">
-            <view class="label">{{item.label}}</view>
-            <view class="value" style="color:{{item.color||'#333'}} ;">{{item.value||'--'}}</view>
+            <view class="label">{{language[item.label]||item.label}}</view>
+            <view class="value" style="color:{{item.color||'#333'}} ;">{{language[item.value]||item.value||'--'}}</view>
             <view class="replenish" catchtap="clickRep" data-item="{{item}}" wx:if="{{item.slot}}">
                 <slot name='{{item.slot}}' />
             </view>