Commit b176212b authored by Smile's avatar Smile Committed by wux

app站内信修改支持多语言

parent b869a85c
......@@ -27,6 +27,8 @@ const languageData = {
coverImage: 'coverImageZh',
activityDesc: 'activityDescZh',
startAddress: 'startAddressZh',
msgTitle:'title',
msgContent:'content',
},
'en': {
label: 'labelEn',
......@@ -45,6 +47,8 @@ const languageData = {
coverImage: 'coverImageEn',
activityDesc: 'activityDescEn',
startAddress: 'startAddressEn',
msgTitle:'titleEn',
msgContent:'contentEn',
},
'fr': {
label: 'labelFr',
......@@ -63,6 +67,8 @@ const languageData = {
coverImage: 'coverImageFr',
activityDesc: 'activityDescFr',
startAddress: 'startAddressFr',
msgTitle:'titleFr',
msgContent:'contentFr',
}
};
......@@ -89,6 +95,8 @@ function getLanguageData(local = 'zh') {
coverImage: languageData[local].coverImage,
activityDesc: languageData[local].activityDesc,
startAddress: languageData[local].startAddress,
msgTitle: languageData[local].msgTitle,
msgContent: languageData[local].msgContent,
};
}
......@@ -97,7 +105,6 @@ export default {
locale: uni.getStorageSync('locale') || 'zh',
...getLanguageData(uni.getStorageSync('locale') || 'zh'),
setLang(msg) {
debugger
this.lang = languages[msg] || languages['zh']; // 默认返回中文语言包
this.locale = msg
},
......
......@@ -13,7 +13,7 @@
<view class="notice-list-top">
<image v-if="item.status == 1" src="../../static/img/notice-1.png" mode=""></image>
<image v-else src="../../static/img/notice-2.png" mode=""></image>
<view class="">{{item.title}}</view>
<view class="">{{item[$lang.msgTitle]}}</view>
</view>
<view class="times">
<image src="../../static/img/time.png" mode=""></image>
......
......@@ -4,13 +4,13 @@
<view class="start-bar"></view>
<view class="notice_info">
<view class="notice_title">
<text>{{noticeData.title}}</text>
<text>{{noticeData[$lang.msgTitle]}}</text>
</view>
<view class="notice_tag">
<text>{{getDate(noticeData.createTime)}}</text>
</view>
<view class="notice_content">
<rich-text :nodes="noticeData.content"></rich-text>
<rich-text :nodes="noticeData[$lang.msgContent]"></rich-text>
</view>
</view>
</view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment