From 4bbf91e9412a80d913d7d7edeafa36aba56b27bf Mon Sep 17 00:00:00 2001
From: dragon <3013557874@qq.com>
Date: Fri, 31 May 2024 16:28:15 +0800
Subject: [PATCH] =?UTF-8?q?=E5=85=85=E5=80=BC=E6=9A=82=E5=AD=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
view/molistar/modules/pay/index.html | 19 ++++--
view/molistar/modules/pay/js/index.js | 82 ++++++++++++++++--------
view/molistar/modules/pay/local/ar.js | 15 -----
view/molistar/modules/pay/local/en.js | 15 -----
view/molistar/modules/pay/local/in.js | 21 ------
view/molistar/modules/pay/local/zh-CN.js | 21 ------
view/molistar/modules/pay/local/zh-TW.js | 21 ------
view/molistar/modules/pay/local/zh.js | 28 ++++++++
8 files changed, 96 insertions(+), 126 deletions(-)
delete mode 100644 view/molistar/modules/pay/local/in.js
delete mode 100644 view/molistar/modules/pay/local/zh-CN.js
delete mode 100644 view/molistar/modules/pay/local/zh-TW.js
create mode 100644 view/molistar/modules/pay/local/zh.js
diff --git a/view/molistar/modules/pay/index.html b/view/molistar/modules/pay/index.html
index 09cd16a..d5fd857 100644
--- a/view/molistar/modules/pay/index.html
+++ b/view/molistar/modules/pay/index.html
@@ -5,7 +5,8 @@
-
充值
+
+
@@ -18,11 +19,11 @@
@@ -30,8 +31,8 @@
@@ -39,7 +40,7 @@
昵称
molistar ID: 123456
- 切換ID
+
@@ -171,4 +172,8 @@
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/view/molistar/modules/pay/js/index.js b/view/molistar/modules/pay/js/index.js
index 1a131f7..4e610ad 100644
--- a/view/molistar/modules/pay/js/index.js
+++ b/view/molistar/modules/pay/js/index.js
@@ -3,12 +3,14 @@ const urlPrefix = getUrlPrefix();
var getUrl = getQueryString();
// 封裝layer消息提醒框
let layerIndex
-const showLoading = (content = '加載中...') => {
+var langReplace;
+var localLang;
+const showLoading = (content = langReplace(localLang.demoModule.layerIndex1)) => {
layer.open({
type: 2,
shadeClose: false,
content,
- success (e) {
+ success(e) {
layerIndex = $(e).attr('index')
}
})
@@ -16,7 +18,7 @@ const showLoading = (content = '加載中...') => {
const hideLoading = (index) => {
layer.close(index)
}
-const toastMsg = (content = '操作完成', time = 2) => {
+const toastMsg = (content = langReplace(localLang.demoModule.layerIndex2), time = 2) => {
layer.open({
content,
time,
@@ -43,6 +45,7 @@ $(function () {
new VConsole();
}
getInfoFromClient();//请求依赖
+ fuzzyMatchUpdateQueryStringParameterFun(); // 判断语言
setTimeout(function () {
if (browser.app) {
erbanNo = null;
@@ -52,14 +55,41 @@ $(function () {
} else {
}
channelType = getUrl.channelType;
+ fuzzyMatchUpdateQueryStringParameterFun(); // 判断语言
+ langReplace = window.lang.replace;
+ localLang = window.lang;
+ translateFun();
getArea();
}, 100)
setTimeout(function () {
$('.box_box').show()
}, 800)
})
+function translateFun() {
+ var langReplace = window.lang.replace;
+ var localLang = window.lang;
+ $('.text1').text(langReplace(localLang.demoModule.text1));
+ $('.text2').text(langReplace(localLang.demoModule.text2));
+ $('.text3').attr("placeholder", langReplace(localLang.demoModule.text3));
+ $('.text4').text(langReplace(localLang.demoModule.text4));
+ $('.text5').text(langReplace(localLang.demoModule.text5));
+ $('.text6').text(langReplace(localLang.demoModule.text6));
+ $('.text7').text(langReplace(localLang.demoModule.text7));
+ $('.text8').text(langReplace(localLang.demoModule.text8));
+ $('.text9').text(langReplace(localLang.demoModule.text9));
+ $('.text10').text(langReplace(localLang.demoModule.text10));
+ $('.text11').text(langReplace(localLang.demoModule.text11));
+ $('.text12').text(langReplace(localLang.demoModule.text12));
+ $('.text13').text(langReplace(localLang.demoModule.text13));
+ $('.text14').text(langReplace(localLang.demoModule.text14));
+ $('.text15').text(langReplace(localLang.demoModule.text15));
+ $('.text16').text(langReplace(localLang.demoModule.text16));
+ $('.text17').text(langReplace(localLang.demoModule.text17));
+ $('.text18').text(langReplace(localLang.demoModule.text18));
+ $('.text19').text(langReplace(localLang.demoModule.text19));
+}
// 请求地区列表
-function getArea () {
+function getArea() {
$('.area .area_in p').remove();
$('.selectAddress .selectAddress_in .list_in p').remove();
showLoading();
@@ -102,9 +132,9 @@ function getArea () {
toastMsg(res.message);
}
},
- error (err) {
+ error(err) {
hideLoading(layerIndex);
- toastMsg('網絡錯誤');
+ toastMsg(langReplace(localLang.demoModule.layerIndex3));
}
});
}
@@ -142,7 +172,7 @@ $('.guidd').click(function () {
bodyScroolFun(false);
})
// 渲染档位列表
-function getChargePageInfoForH5 () {
+function getChargePageInfoForH5() {
showLoading();
networkRequest({
type: 'GET',
@@ -161,14 +191,14 @@ function getChargePageInfoForH5 () {
}
hideLoading(layerIndex);
},
- error (err) {
+ error(err) {
hideLoading(layerIndex);
- toastMsg('網絡錯誤');
+ toastMsg(langReplace(localLang.demoModule.layerIndex3));
}
});
}
// 渲染h5
-function getChargePageInfoForH5Html (res, id, bool) {
+function getChargePageInfoForH5Html(res, id, bool) {
// 处理充值方式
if (bool) {
$('.page1 .way div').remove();
@@ -218,7 +248,7 @@ $('.page1 .position').on('click', 'div', function () {
chargeProdId = $(this).attr('chargeProdId');
})
// 充值接口
-function apply2New () {
+function apply2New() {
apply2NewLock = false;
showLoading();
networkRequest({
@@ -234,9 +264,9 @@ function apply2New () {
hideLoading(layerIndex);
}
},
- error (err) {
+ error(err) {
hideLoading(layerIndex);
- toastMsg('網絡錯誤');
+ toastMsg(langReplace(localLang.demoModule.layerIndex3));
apply2NewLock = true;
}
@@ -291,7 +321,7 @@ $('.bindingBox .binding .but').click(function () {
getSimpleUser($('.bindingBox .binding input').val());
})
// 确认绑定接口
-function getSimpleUser (erbanNo) {
+function getSimpleUser(erbanNo) {
showLoading();
networkRequest({
type: 'GET',
@@ -312,15 +342,15 @@ function getSimpleUser (erbanNo) {
}
hideLoading(layerIndex);
},
- error (err) {
+ error(err) {
hideLoading(layerIndex);
- toastMsg('網絡錯誤');
+ toastMsg(langReplace(localLang.demoModule.layerIndex3));
}
});
}
// 自动绑定接口
-function getSimpleUserByUid (uid) {
+function getSimpleUserByUid(uid) {
showLoading();
networkRequest({
type: 'GET',
@@ -346,9 +376,9 @@ function getSimpleUserByUid (uid) {
}
hideLoading(layerIndex);
},
- error (err) {
+ error(err) {
hideLoading(layerIndex);
- toastMsg('網絡錯誤');
+ toastMsg(langReplace(localLang.demoModule.layerIndex3));
}
});
@@ -384,7 +414,7 @@ $('.userNull .userNull_in .but').click(function () {
$('.userNull').hide();
})
// 代充列表接口
-function rechargeUserList (regionCode) {
+function rechargeUserList(regionCode) {
showLoading();
networkRequest({
type: 'GET',
@@ -419,9 +449,9 @@ function rechargeUserList (regionCode) {
}
hideLoading(layerIndex);
},
- error (err) {
+ error(err) {
hideLoading(layerIndex);
- toastMsg('網絡錯誤');
+ toastMsg(langReplace(localLang.demoModule.layerIndex3));
}
});
@@ -432,7 +462,7 @@ $('.page2 ul').on('click', 'li .copy', function () {
copyToClipboard(erbanNo);
})
// 关注接口
-function fansLike (likedUid) {
+function fansLike(likedUid) {
// showLoading();
networkRequest({
type: 'POST',
@@ -452,9 +482,9 @@ function fansLike (likedUid) {
}
hideLoading(layerIndex);
},
- error (err) {
+ error(err) {
hideLoading(layerIndex);
- toastMsg('網絡錯誤');
+ toastMsg(langReplace(localLang.demoModule.layerIndex3));
}
});
@@ -483,7 +513,7 @@ $('.toastMasge .toastMasge_in .but').click(function () {
bodyScroolFun(false);
})
//复制方法
-function copyToClipboard (text) {
+function copyToClipboard(text) {
if (text.indexOf('-') !== -1) {
let arr = text.split('-');
text = arr[0] + arr[1];
diff --git a/view/molistar/modules/pay/local/ar.js b/view/molistar/modules/pay/local/ar.js
index 39323bc..8a3d531 100644
--- a/view/molistar/modules/pay/local/ar.js
+++ b/view/molistar/modules/pay/local/ar.js
@@ -2,20 +2,5 @@
langAr = {
// 模块
demoModule: {
- wx_skip_img: './images/wx_skip_en.png',
- // 国际化内容对应的数据项:
- pay_title: `recharge`,
- pay_header_t_l: `HABU Recharge Center`,
- pay_header_t_r: `Taiwan`,
- pay_method_p: `Please select a recharge method:`,
- pay_number_sd: `Please select your recharge amount:`,
- pay_but: `Pay now`,
- pop_up_in_b: `Please select a recharge area`,
- pop_up_in_p1: `Taiwan`,
- pop_up_in_p2: `China`,
- pay_stance_picture: `The recharge service is about to open, please be patient`,
- wait_a_minute: 'Please wait',
- gold_id: 'gold coins',
- pay_user_id: 'Please enter your HABU account ID',
}
}
\ No newline at end of file
diff --git a/view/molistar/modules/pay/local/en.js b/view/molistar/modules/pay/local/en.js
index d5e2f1a..0add40c 100644
--- a/view/molistar/modules/pay/local/en.js
+++ b/view/molistar/modules/pay/local/en.js
@@ -2,20 +2,5 @@
langEn = {
// 模块
demoModule: {
- wx_skip_img: './images/wx_skip_en.png',
- // 国际化内容对应的数据项:
- pay_title: `recharge`,
- pay_header_t_l: `HABU Recharge Center`,
- pay_header_t_r: `Taiwan`,
- pay_method_p: `Please select a recharge method:`,
- pay_number_sd: `Please select your recharge amount:`,
- pay_but: `Pay now`,
- pop_up_in_b: `Please select a recharge area`,
- pop_up_in_p1: `Taiwan`,
- pop_up_in_p2: `China`,
- pay_stance_picture: `The recharge service is about to open, please be patient`,
- wait_a_minute: 'Please wait',
- gold_id: 'gold coins',
- pay_user_id: 'Please enter your HABU account ID',
}
}
\ No newline at end of file
diff --git a/view/molistar/modules/pay/local/in.js b/view/molistar/modules/pay/local/in.js
deleted file mode 100644
index 176c26c..0000000
--- a/view/molistar/modules/pay/local/in.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// 印尼语
-langIn = {
- // 模块
- demoModule: {
- wx_skip_img: './images/wx_skip_en.png',
- // 国际化内容对应的数据项:
- pay_title: `recharge`,
- pay_header_t_l: `HABU Recharge Center`,
- pay_header_t_r: `Taiwan`,
- pay_method_p: `Please select a recharge method:`,
- pay_number_sd: `Please select your recharge amount:`,
- pay_but: `Pay now`,
- pop_up_in_b: `Please select a recharge area`,
- pop_up_in_p1: `Taiwan`,
- pop_up_in_p2: `China`,
- pay_stance_picture: `The recharge service is about to open, please be patient`,
- wait_a_minute: 'Please wait',
- gold_id: 'gold coins',
- pay_user_id: 'Please enter your HABU account ID',
- }
-}
\ No newline at end of file
diff --git a/view/molistar/modules/pay/local/zh-CN.js b/view/molistar/modules/pay/local/zh-CN.js
deleted file mode 100644
index e3cb87b..0000000
--- a/view/molistar/modules/pay/local/zh-CN.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// 简体中文
-langZhCN = {
- // 模块
- demoModule: {
- wx_skip_img: './images/wx_skip_en.png',
- // 国际化内容对应的数据项:
- pay_title: `recharge`,
- pay_header_t_l: `HABU Recharge Center`,
- pay_header_t_r: `Taiwan`,
- pay_method_p: `Please select a recharge method:`,
- pay_number_sd: `Please select your recharge amount:`,
- pay_but: `Pay now`,
- pop_up_in_b: `Please select a recharge area`,
- pop_up_in_p1: `Taiwan`,
- pop_up_in_p2: `China`,
- pay_stance_picture: `The recharge service is about to open, please be patient`,
- wait_a_minute: 'Please wait',
- gold_id: 'gold coins',
- pay_user_id: 'Please enter your HABU account ID',
- }
-}
\ No newline at end of file
diff --git a/view/molistar/modules/pay/local/zh-TW.js b/view/molistar/modules/pay/local/zh-TW.js
deleted file mode 100644
index 3a9d90e..0000000
--- a/view/molistar/modules/pay/local/zh-TW.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// 繁体中文
-langZhTW = {
- // 模块
- demoModule: {
- wx_skip_img: './images/wx_skip_en.png',
- // 国际化内容对应的数据项:
- pay_title: `recharge`,
- pay_header_t_l: `HABU Recharge Center`,
- pay_header_t_r: `Taiwan`,
- pay_method_p: `Please select a recharge method:`,
- pay_number_sd: `Please select your recharge amount:`,
- pay_but: `Pay now`,
- pop_up_in_b: `Please select a recharge area`,
- pop_up_in_p1: `Taiwan`,
- pop_up_in_p2: `China`,
- pay_stance_picture: `The recharge service is about to open, please be patient`,
- wait_a_minute: 'Please wait',
- gold_id: 'gold coins',
- pay_user_id: 'Please enter your HABU account ID',
- }
-}
\ No newline at end of file
diff --git a/view/molistar/modules/pay/local/zh.js b/view/molistar/modules/pay/local/zh.js
new file mode 100644
index 0000000..cf15244
--- /dev/null
+++ b/view/molistar/modules/pay/local/zh.js
@@ -0,0 +1,28 @@
+// 简体中文
+langZh = {
+ // 模块
+ demoModule: {
+ layerIndex1:`加载中...`,
+ layerIndex2:`操作完成`,
+ layerIndex3:`網絡錯誤`,
+ text1:`充值`,
+ text2:`MoliStar儲值中心`,
+ text3:`請輸入要儲值的molistar ID`,
+ text4:`確定`,
+ text5:`切換ID`,
+ text6:``,
+ text7:``,
+ text7:``,
+ text9:``,
+ text10:``,
+ text11:``,
+ text12:``,
+ text13:``,
+ text14:``,
+ text15:``,
+ text16:``,
+ text17:``,
+ text18:``,
+ text19:``,
+ }
+}
\ No newline at end of file