From b65b9a995ce0e61e567f513845a813fa801d5d77 Mon Sep 17 00:00:00 2001
From: huliyong <2783385703@qq.com>
Date: Tue, 17 Jun 2025 23:45:15 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=A4=9A=E8=AF=AD?=
=?UTF-8?q?=E8=A8=80=E5=9B=BD=E9=99=85=E5=8C=96=E6=94=AF=E6=8C=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
refactor: 重构代码以支持i18n国际化
feat(locale): 添加多语言配置文件
feat(components): 国际化组件文本
feat(pages): 国际化页面文本
feat(store): 更新用户信息获取逻辑
docs: 添加国际化配置文档
---
.cursor/rules/index.mdc | 60 ++++
api/api.js | 3 +
api/http.js | 5 +-
components/active/active-item.vue | 10 +-
components/base/tabbar.vue | 64 ++--
components/cart/CardList.vue | 42 ++-
components/cart/signInQrcodePopup.vue | 2 +-
components/travel/travelList.vue | 10 +-
components/userShop/userShopCommission.vue | 130 --------
components/zhaomu/zhaomu-item.vue | 14 +-
components/zhaomu/zlx-item.vue | 8 +-
config.js | 3 +
locale/en.json | 389 ++++++++++++++++++++++
locale/index.js | 76 +++++
locale/objectLangMap.js | 65 ++++
locale/zh-Hans.json | 389 ++++++++++++++++++++++
main.js | 2 +
pages.json | 9 +-
pages/index/cart.vue | 12 +-
pages/index/center.vue | 63 ++--
pages/index/index.vue | 57 ++--
pages/index/order.vue | 131 --------
pages_login/fuwutiaokuan.vue | 2 +-
pages_login/wxLogin.vue | 10 +-
pages_login/wxUserInfo.vue | 30 +-
pages_login/yinsixieyi.vue | 8 +-
pages_my/activeList.vue | 16 +-
pages_my/collection.vue | 414 ++++++++++++------------
pages_my/guanyuwomen.vue | 2 +-
pages_my/qiandao-list.vue | 35 +-
pages_my/travelList.vue | 12 +-
pages_my/user-info.vue | 44 +--
pages_my/user-msg.vue | 80 +++--
pages_my/zlx-qiandao.vue | 6 +-
pages_my/zlx-xieyi.vue | 2 +-
pages_order/huodong-detail.vue | 54 ++--
pages_order/invoiceIssuance.vue | 28 +-
pages_order/invoiceRecords.vue | 17 +-
pages_order/lvyou-detail.vue | 44 +--
pages_order/orderDetails.vue | 76 +++--
pages_order/orderEvaluation.vue | 22 +-
pages_order/payOrder.vue | 496 ++++++++++++++---------------
pages_zlx/zlx-form.vue | 59 ++--
store/store.js | 35 +-
44 files changed, 1926 insertions(+), 1110 deletions(-)
create mode 100644 .cursor/rules/index.mdc
delete mode 100644 components/userShop/userShopCommission.vue
create mode 100644 locale/en.json
create mode 100644 locale/index.js
create mode 100644 locale/objectLangMap.js
create mode 100644 locale/zh-Hans.json
delete mode 100644 pages/index/order.vue
diff --git a/.cursor/rules/index.mdc b/.cursor/rules/index.mdc
new file mode 100644
index 0000000..99da546
--- /dev/null
+++ b/.cursor/rules/index.mdc
@@ -0,0 +1,60 @@
+---
+description:
+globs:
+alwaysApply: true
+---
+## 当前项目是uniapp开发微信小程序
+
+在你修改locale下的json文件需要根据文件路径进行国际化配置
+
+例如:
+
+文件路径
+/components/active/active-item
+/pages/index/index
+/pages/index/center
+/pages_login/wxLogin
+
+en.json
+{
+ "components" : {
+ "active" : {
+ "active_item" : {
+ ...
+ }
+ }
+ },
+ "pages" : {
+ "index" : {
+ ...
+ },
+ "center" : {
+ ...
+ },
+ },
+ "pages_login" : {
+ "wxLogin" : {
+ ...
+ },
+ },
+}
+
+
+并且在国际化替换内容的位置需要留有中文版的注释内容
+
+国际化对象需要在objectLangMap.json中配置,将后端对象多个不同语言的字段进行关联,而不是国际化成中文
+
+例如:
+{
+ //国际化活动
+ "active" : {
+ "title" : {
+ "zh-Hans" : "title",
+ "en" : "enTitle",
+ },
+ ...
+ }
+}
+
+使用方式
+$ot(item, 'active', 'title')
\ No newline at end of file
diff --git a/api/api.js b/api/api.js
index dcfd220..7c4ab0a 100644
--- a/api/api.js
+++ b/api/api.js
@@ -48,6 +48,9 @@ export function api(key, data, callback, loadingTitle) {
if (req.auth) {
if (!uni.getStorageSync('token')) {
utils.toLogin()
+ store.state.userInfo = {}
+ store.state.token = ""
+ uni.removeStorageSync('token')
console.error('需要登录')
return Promise.reject('必须登录')
}
diff --git a/api/http.js b/api/http.js
index 6c3da63..06a0e40 100644
--- a/api/http.js
+++ b/api/http.js
@@ -35,7 +35,10 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
if(res.statusCode == 401 ||
res.data.message == '操作失败,token非法无效!' ||
res.data.message == '操作失败,用户不存在!'){
- store.commit('logout')
+ // store.commit('logout')
+ store.state.userInfo = {}
+ store.state.token = ""
+ uni.removeStorageSync('token')
console.error('登录过期');
utils.toLogin()
}
diff --git a/components/active/active-item.vue b/components/active/active-item.vue
index d56c134..b5dfdd9 100644
--- a/components/active/active-item.vue
+++ b/components/active/active-item.vue
@@ -5,18 +5,18 @@
v-for="(item, index) in cardListData" :key="index">
-
+
- {{item.title}}
+ {{$ot(item, 'active', 'title')}}
{{ $dayjs(item.startTime).format('YYYY-MM-DD') }}
- {{item.address}}
+ {{$ot(item, 'active', 'address')}}
{{item.num || 0}}/{{item.sum || 0}}
- 立即报名
- 已结束
+ {{$t('components.active.activeItem.signUp')}}
+ {{$t('components.active.activeItem.ended')}}
diff --git a/components/base/tabbar.vue b/components/base/tabbar.vue
index 5880be7..97b6534 100644
--- a/components/base/tabbar.vue
+++ b/components/base/tabbar.vue
@@ -30,38 +30,42 @@
},
data() {
return {
- list : [
- {
- "selectedIconPath": "/static/image/tabbar/home-a.png",
- "iconPath": "/static/image/tabbar/home.png",
- "pagePath": "/pages/index/index",
- "title": "首页",
- key : 'home',
- },
- {
- "selectedIconPath": "/static/image/tabbar/zhaomu-a.png",
- "iconPath": "/static/image/tabbar/zhaomu.png",
- "pagePath": "/pages/index/member",
- "title": "招募",
- key : 'member',
- },
- {
- "selectedIconPath": "/static/image/tabbar/order-a.png",
- "iconPath": "/static/image/tabbar/order.png",
- "pagePath": "/pages/index/cart",
- "title": "订单",
- key : 'cart',
- },
- {
- "selectedIconPath": "/static/image/tabbar/center-a.png",
- "iconPath": "/static/image/tabbar/center.png",
- "pagePath": "/pages/index/center",
- "title": "我的",
- key : 'center',
- }
- ]
+ list : []
};
},
+ mounted() {
+ // 初始化国际化的 tabbar 数据
+ this.list = [
+ {
+ "selectedIconPath": "/static/image/tabbar/home-a.png",
+ "iconPath": "/static/image/tabbar/home.png",
+ "pagePath": "/pages/index/index",
+ "title": this.$t('components.base.tabbar.home'), // 首页
+ key : 'home',
+ },
+ {
+ "selectedIconPath": "/static/image/tabbar/zhaomu-a.png",
+ "iconPath": "/static/image/tabbar/zhaomu.png",
+ "pagePath": "/pages/index/member",
+ "title": this.$t('components.base.tabbar.member'), // 招募
+ key : 'member',
+ },
+ {
+ "selectedIconPath": "/static/image/tabbar/order-a.png",
+ "iconPath": "/static/image/tabbar/order.png",
+ "pagePath": "/pages/index/cart",
+ "title": this.$t('components.base.tabbar.cart'), // 订单
+ key : 'cart',
+ },
+ {
+ "selectedIconPath": "/static/image/tabbar/center-a.png",
+ "iconPath": "/static/image/tabbar/center.png",
+ "pagePath": "/pages/index/center",
+ "title": this.$t('components.base.tabbar.center'), // 我的
+ key : 'center',
+ }
+ ]
+ },
methods : {
toPath(item, index){
if(item.key == this.select){
diff --git a/components/cart/CardList.vue b/components/cart/CardList.vue
index 56958c6..1b18824 100644
--- a/components/cart/CardList.vue
+++ b/components/cart/CardList.vue
@@ -2,21 +2,23 @@
- 下单时间:{{item.createTime}}
+ {{$t('components.cart.cardList.orderTime')}}:{{item.createTime}}
{{ stateText[item.state] }}
-
+
- {{item.title}}
+ {{ getTitle(item) }}
+
{{item.startTime}}
- {{item.address}}
+ {{ getAddress(item) }}
+
- 总计¥{{item.payPrice}}
+ {{$t('components.cart.cardList.total')}}¥{{item.payPrice}}
@@ -25,18 +27,18 @@
class="mini-btn" size="mini">立即支付 -->
+ class="mini-btn" size="mini">{{$t('components.cart.cardList.cancelActivity')}}
+ class="mini-btn" size="mini">{{$t('components.cart.cardList.signIn')}}
+ class="mini-btn" size="mini">{{$t('components.cart.cardList.evaluate')}}
+ class="mini-btn" size="mini">{{$t('components.cart.cardList.invoice')}}
@@ -52,7 +54,7 @@
},
data() {
return {
- stateText : ['', '待参加', '已完成', '已取消'],
+ stateText : ['', this.$t('components.cart.cardList.states.pending'), this.$t('components.cart.cardList.states.completed'), this.$t('components.cart.cardList.states.cancelled')],
};
},
components: {
@@ -76,6 +78,26 @@
getImage(item){
return item.image && item.image.split(',')[0]
},
+ getTitle(item) {
+ // 根据订单类型决定使用哪种对象类型进行国际化
+ if (item.type == 0) {
+ // 活动订单
+ return this.$ot(item.activity, 'active', 'title')
+ } else {
+ // 旅行订单
+ return this.$ot(item.travel, 'travel', 'title')
+ }
+ },
+ getAddress(item) {
+ // 根据订单类型决定使用哪种对象类型进行国际化
+ if (item.type == 0) {
+ // 活动订单
+ return this.$ot(item.activity, 'active', 'address')
+ } else {
+ // 旅行订单
+ return this.$ot(item.travel, 'travel', 'address')
+ }
+ },
}
};
diff --git a/components/cart/signInQrcodePopup.vue b/components/cart/signInQrcodePopup.vue
index f3c508f..de3bf0d 100644
--- a/components/cart/signInQrcodePopup.vue
+++ b/components/cart/signInQrcodePopup.vue
@@ -30,7 +30,7 @@
{{adminUserInfo.nickName}}
- 主理人
+ {{$t('components.cart.signInQrcodePopup.organizer')}}
-
+
- {{item.title}}
+ {{$ot(item, 'travel', 'title')}}
{{ $dayjs(item.startTime).format('YYYY-MM-DD') }}
- {{item.address}}
+ {{$ot(item, 'travel', 'address')}}
¥{{item.price}}
{{item.num || 0}}/{{item.sum || 0}}
- 报名中
- 已结束
+ {{$t('components.travel.travelList.enrolling')}}
+ {{$t('components.travel.travelList.ended')}}
diff --git a/components/userShop/userShopCommission.vue b/components/userShop/userShopCommission.vue
deleted file mode 100644
index be66e89..0000000
--- a/components/userShop/userShopCommission.vue
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
- 总佣金(元)
-
-
- 7890.34元
-
-
-
-
-
-
- 提现
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components/zhaomu/zhaomu-item.vue b/components/zhaomu/zhaomu-item.vue
index d1a9284..21345e1 100644
--- a/components/zhaomu/zhaomu-item.vue
+++ b/components/zhaomu/zhaomu-item.vue
@@ -7,13 +7,13 @@
- {{item.title}}
+ {{$ot(item, 'active', 'title')}}
{{item.startTime}}
- {{item.address}}
+ {{$ot(item, 'active', 'address')}}
@@ -30,23 +30,23 @@
- 参与招募
+ {{$t('components.zhaomu.zhaomuItem.joinRecruit')}}
- 不通过
+ {{$t('components.zhaomu.zhaomuItem.rejected')}}
- {{ ['审核中', '已参加'][item.openState - 1] }}
+ {{ [$t('components.zhaomu.zhaomuItem.reviewing'), $t('components.zhaomu.zhaomuItem.joined')][item.openState - 1] }}
- {{item == 1? '保证成行' : '已成行'}}
+ {{item == 1? $t('components.zhaomu.zhaomuItem.guaranteed') : $t('components.zhaomu.zhaomuItem.confirmed')}}
@@ -95,7 +95,7 @@
this.$api('shopUserAuth',params,res=>{
this.$emit('getData')
if(res.code == 200) {
- this.$Toast('参与成功')
+ this.$Toast(this.$t('components.zhaomu.zhaomuItem.joinSuccess'))
}
})
}
diff --git a/components/zhaomu/zlx-item.vue b/components/zhaomu/zlx-item.vue
index 0272aad..53fbac3 100644
--- a/components/zhaomu/zlx-item.vue
+++ b/components/zhaomu/zlx-item.vue
@@ -2,18 +2,18 @@
-
+
- {{item.title}}
+ {{$ot(item, 'active', 'title')}}
{{item.createTime}}
- {{item.address}}
+ {{$ot(item, 'active', 'address')}}
{{ item.doNum || 0 }}/{{ item.num || 0 }}
开始签到
+ >{{$t('components.zhaomu.zlxItem.startSignIn')}}
diff --git a/config.js b/config.js
index 28ad995..905a727 100644
--- a/config.js
+++ b/config.js
@@ -12,6 +12,9 @@ const type = 'prod'
// 环境配置
const config = {
+ local : {
+ baseUrl : 'http://127.0.0.1:8001/popularize-admin',
+ },
dev : {
// baseUrl : 'http://test-lzx.natapp1.cc/popularize-admin',
baseUrl : 'http://h5.xzaiyp.top/popularize-admin',
diff --git a/locale/en.json b/locale/en.json
new file mode 100644
index 0000000..c7f3d5e
--- /dev/null
+++ b/locale/en.json
@@ -0,0 +1,389 @@
+{
+ "pages": {
+ "index": {
+ "index": {
+ "uv_search_placeholder": "Search for relevant content",
+ "nav_title": "Home",
+ "moments_title": "Joy Moments",
+ "sign_in_activity": "Sign-in Activity",
+ "sign_in_desc": "Get rewards by signing in",
+ "view_now": "View Now",
+ "activity": "Activity",
+ "travel": "Travel",
+ "recent": "Recent",
+ "past": "Past",
+ "select_area": "Select Area",
+ "confirm": "Confirm"
+ },
+ "cart": {
+ "title": "My Orders",
+ "tabs": {
+ "all": "All",
+ "pending": "Pending",
+ "completed": "Completed",
+ "cancelled": "Cancelled"
+ },
+ "confirmCancel": "Cancel this order?"
+ },
+ "center": {
+ "nav_title": "Profile",
+ "please_login": "Please click to login",
+ "my_activities": "My Activities",
+ "pending": "Pending",
+ "completed": "Completed",
+ "cancelled": "Cancelled",
+ "my_tools": "My Tools",
+ "invoice_records": "Invoice Records",
+ "my_favorites": "My Favorites",
+ "about_us": "About Us",
+ "user_agreement": "User Agreement",
+ "privacy_policy": "Privacy Policy",
+ "organizer_agreement": "Organizer Agreement",
+ "organizer_checkin": "Organizer Check-in",
+ "logout": "Logout"
+ }
+ }
+ },
+ "pages_login": {
+ "wxLogin": {
+ "wechatLogin": "WeChat Authorization Login",
+ "cancelLogin": "Cancel Login",
+ "agreed": "Agreed to ",
+ "privacyPolicy": "Privacy Policy",
+ "userAgreement": "User Agreement",
+ "pleaseAgree": "Please check the privacy agreement"
+ },
+ "wxUserInfo": {
+ "requestInfo": "Request your avatar and nickname",
+ "avatar": "Avatar",
+ "nickname": "Nickname",
+ "gender": "Gender",
+ "phone": "Phone",
+ "enterNickname": "Please enter nickname",
+ "selectGender": "Please select gender",
+ "enterPhone": "Please enter phone number",
+ "getPhone": "Get Phone Number",
+ "confirm": "Confirm",
+ "male": "Male",
+ "female": "Female",
+ "pleaseSelectAvatar": "Please select avatar",
+ "pleaseEnterNickname": "Please enter nickname",
+ "pleaseEnterPhone": "Please enter phone number",
+ "pleaseSelectGender": "Please select gender"
+ },
+ "fuwutiaokuan": {
+ "title": "User Agreement"
+ },
+ "yinsixieyi": {
+ "defaultTitle": "Privacy Policy",
+ "travelGuide": "Travel Guide",
+ "paymentGuide": "Payment Guide",
+ "organizerAgreement": "Organizer Agreement"
+ }
+ },
+ "pages_my": {
+ "zlx_xieyi": {
+ "title": "Organizer Agreement"
+ },
+ "zlx_qiandao": {
+ "title": "Organizer Check-in",
+ "activity": "Activity",
+ "travel": "Travel"
+ },
+ "user_msg": {
+ "title": "Edit Profile",
+ "basic_info": "Basic Information",
+ "username": "Username",
+ "email": "Email",
+ "phone": "Phone",
+ "gender": "Gender",
+ "nationality": "Nationality",
+ "birthday": "Birthday",
+ "address": "Current Address",
+ "personal_status": "Personal Status",
+ "education": "Education",
+ "degree": "Degree",
+ "school": "School",
+ "work": "Work",
+ "industry": "Industry",
+ "about_me": "About Me",
+ "save": "Save",
+ "enter_username": "Please enter username",
+ "enter_email": "Please enter email",
+ "enter_phone": "Please enter phone number",
+ "select_gender": "Please select gender",
+ "enter_nationality": "Please enter nationality",
+ "enter_birthday": "Please enter birthday",
+ "enter_address": "Please enter current address",
+ "enter_status": "Please enter personal status",
+ "enter_industry": "Please enter industry",
+ "enter_about_me": "Please enter self introduction...",
+ "male": "Male",
+ "female": "Female",
+ "bachelor": "Bachelor",
+ "master": "Master",
+ "doctor": "Doctor",
+ "other": "Other",
+ "save_success": "Save successfully"
+ },
+ "user_info": {
+ "title": "Profile",
+ "change_avatar": "Click to change avatar",
+ "nationality": "Nationality",
+ "degree": "Degree",
+ "industry": "Industry",
+ "phone": "Phone",
+ "gender": "Gender",
+ "tags": "Tags",
+ "about_me": "About Me",
+ "edit_info": "Edit Information",
+ "not_set": "Not Set",
+ "years_old": "years old"
+ },
+ "travelList": {
+ "title": "Travel List",
+ "all": "All",
+ "enrolling": "Enrolling",
+ "ended": "Ended",
+ "time": "Time"
+ },
+ "activeList": {
+ "title": "Activity List",
+ "all_area": "All Areas",
+ "enrolling": "Enrolling",
+ "ended": "Ended",
+ "time": "Time"
+ },
+ "guanyuwomen": {
+ "title": "About Us"
+ },
+ "qiandao_list": {
+ "title": "Check-in List",
+ "scan_checkin": "Scan to Check-in",
+ "early_bird": "Early Bird",
+ "single_ticket": "Single Ticket",
+ "premium_ticket": "Premium Ticket"
+ },
+ "collection": {
+ "title": "My Favorites",
+ "tabs": {
+ "activity": "Activity",
+ "travel": "Travel"
+ },
+ "confirm_cancel_collection": "Are you sure to cancel the collection?",
+ "sign_up_now": "Sign Up Now",
+ "ended": "Ended"
+ }
+ },
+ "pages_order": {
+ "huodong_detail": {
+ "title": "Activity Details",
+ "start_time": "Start Time: ",
+ "activity_address": "Activity Address: ",
+ "navigation": "Navigation",
+ "organizer": "Organizer",
+ "add_wechat": "Add WeChat",
+ "activity_description": "Activity Description",
+ "precautions": "Precautions",
+ "registration_fee": "Registration Fee",
+ "collect": "Collect",
+ "collected": "Collected",
+ "forward": "Forward",
+ "sign_up_now": "Sign Up Now",
+ "ended": "Ended",
+ "select_activity_status": "Select Activity Status",
+ "confirm": "Confirm",
+ "early_bird": "Early Bird",
+ "single_ticket": "Single Ticket",
+ "premium_ticket": "Premium Ticket",
+ "complete_info_required": "Please complete the required information first"
+ },
+ "invoice_issuance": {
+ "title": "Apply for Invoice",
+ "total": "Total",
+ "individual": "Individual",
+ "enterprise": "Enterprise",
+ "name": "Name",
+ "enterprise_name": "Enterprise Name",
+ "id_number": "ID Number",
+ "tax_number": "Tax Number",
+ "email": "Email",
+ "apply": "Apply",
+ "please_enter": "Please enter content"
+ },
+ "invoice_records": {
+ "title": "Invoice Records",
+ "standard_ticket": "Standard Ticket",
+ "states": {
+ "invoicing": "Invoicing",
+ "invoiced": "Invoiced",
+ "failed": "Failed"
+ }
+ },
+ "lvyou_detail": {
+ "title": "Travel Details",
+ "start_time": "Start Time: ",
+ "tour_guide": "Tour Guide",
+ "add_wechat": "Add WeChat",
+ "travel_description": "Travel Description",
+ "registration_fee": "Registration Fee",
+ "collect": "Collect",
+ "collected": "Collected",
+ "forward": "Forward",
+ "sign_up_now": "Sign Up Now",
+ "ended": "Ended",
+ "complete_info_required": "Please complete the required information first",
+ "tabs": {
+ "introduction": "Introduction",
+ "route": "Route",
+ "cost": "Cost",
+ "notice": "Notice",
+ "agent": "Agent"
+ }
+ },
+ "order_details": {
+ "title": "Order Details",
+ "total": "Total",
+ "order_info": "Order Information",
+ "order_number": "Order Number",
+ "order_time": "Order Time",
+ "order_amount": "Order Amount",
+ "order_status": "Order Status",
+ "payment_notice": "Payment Notice",
+ "activity_notice": "Activity Notice",
+ "travel_notice": "Travel Notice",
+ "activity_checkin": "Activity Check-in",
+ "status": {
+ "unpaid": "Unpaid",
+ "pending": "Pending",
+ "completed": "Completed",
+ "cancelled": "Cancelled"
+ }
+ },
+ "order_evaluation": {
+ "title": "Activity Evaluation",
+ "organizer_evaluation": "Organizer Evaluation",
+ "activity_evaluation": "Activity Evaluation",
+ "please_enter_content": "Please enter content",
+ "submit_comment": "Submit Comment",
+ "please_rate_first": "Please rate before submitting!"
+ },
+ "pay_order": {
+ "title": "Payment Details",
+ "pending_payment": "Pending Payment",
+ "price": "Price",
+ "order_info": "Order Information",
+ "ticket_quantity": "Ticket Quantity",
+ "ticket_content": "Ticket Content",
+ "order_total": "Order Total",
+ "order_status": "Order Status",
+ "invitation_code": "Invitation Code",
+ "enter_invitation_code": "Please enter invitation code",
+ "payment_notice": "Payment Notice",
+ "pay_order": "Pay Order",
+ "payment_success": "Payment Successful",
+ "status": {
+ "unpaid": "Unpaid",
+ "pending": "Pending",
+ "completed": "Completed",
+ "cancelled": "Cancelled"
+ },
+ "ticket_types": {
+ "early_bird": "Early Bird",
+ "single_ticket": "Single Ticket",
+ "premium_ticket": "Premium Ticket"
+ }
+ }
+ },
+ "pages_zlx": {
+ "zlx_form": {
+ "title": "Organizer Certification",
+ "basic_info": "Basic Information",
+ "real_name": "Real Name",
+ "enter_real_name": "Please enter real name",
+ "contact_info": "Contact Information",
+ "enter_contact_info": "Please enter contact information",
+ "id_card": "ID Card Number",
+ "enter_id_card": "Please enter ID card number",
+ "resume_attachment": "Resume Attachment",
+ "upload_resume": "Upload Resume",
+ "wechat_qr_code": "WeChat QR Code",
+ "upload_image": "Upload Image",
+ "personal_photos_title": "Personal Photos (Including Full Body Shot)",
+ "agreement_title": "Read and Agree to Agreement",
+ "agreement_text": "I have read and agree to",
+ "agreement_link": "Organizer Agreement",
+ "save": "Save",
+ "approved": "Approved",
+ "copy": "Copy",
+ "copy_success": "Copy Successful",
+ "save_success": "Save Successful",
+ "submit_success": "Submit Successful",
+ "please_agree_agreement": "Please read and agree to the Organizer Agreement first",
+ "please_enter_name": "Please enter name",
+ "please_enter_contact": "Please enter contact information",
+ "please_enter_correct_contact": "Please enter correct contact information",
+ "please_enter_id_card": "Please enter ID card number",
+ "please_enter_correct_id_card": "Please enter correct ID card number"
+ }
+ },
+ "common": {
+ "confirm_logout": "Confirm logout?",
+ "logging_in": "Logging in...",
+ "all": "All"
+ },
+ "components": {
+ "base": {
+ "tabbar": {
+ "home": "Home",
+ "member": "Recruit",
+ "cart": "Orders",
+ "center": "Mine"
+ }
+ },
+ "active": {
+ "activeItem": {
+ "signUp": "Sign Up Now",
+ "ended": "Ended"
+ }
+ },
+ "travel": {
+ "travelList": {
+ "enrolling": "Enrolling",
+ "ended": "Ended"
+ }
+ },
+ "cart": {
+ "cardList": {
+ "orderTime": "Order Time",
+ "total": "Total",
+ "cancelActivity": "Cancel Activity",
+ "signIn": "Sign In",
+ "evaluate": "Evaluate",
+ "invoice": "Invoice",
+ "states": {
+ "pending": "Pending",
+ "completed": "Completed",
+ "cancelled": "Cancelled"
+ }
+ },
+ "signInQrcodePopup": {
+ "organizer": "Organizer"
+ }
+ },
+ "zhaomu": {
+ "zlxItem": {
+ "startSignIn": "Start Sign In"
+ },
+ "zhaomuItem": {
+ "joinRecruit": "Join Recruitment",
+ "rejected": "Rejected",
+ "reviewing": "Under Review",
+ "joined": "Joined",
+ "guaranteed": "Guaranteed",
+ "confirmed": "Confirmed",
+ "joinSuccess": "Successfully Joined"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/locale/index.js b/locale/index.js
new file mode 100644
index 0000000..66483a9
--- /dev/null
+++ b/locale/index.js
@@ -0,0 +1,76 @@
+import en from './en.json'//英语语言包
+import zhHans from './zh-Hans.json'//英语语言包
+import Vue from 'vue'
+import VueI18n from 'vue-i18n'
+
+// 国际化字段映射
+import objectLangMap from './objectLangMap'
+Vue.use(VueI18n)
+
+
+// 获取系统语言
+const systemInfo = uni.getSystemInfoSync();
+const systemLang = 'en';
+// const systemLang = systemInfo.language || 'en';
+
+console.log(systemInfo.language, systemLang);
+
+// 语言映射,将系统语言映射到我们支持的语言包
+const langMap = {
+ 'zh': 'zh-Hans',
+ 'zh_CN': 'zh-Hans',
+ 'zh-Hans': 'zh-Hans',
+ 'zh-Hant': 'zh-Hans', // 暂时都映射到简体中文
+ 'zh-TW': 'zh-Hans',
+ 'zh-HK': 'zh-Hans',
+ 'en': 'en',
+ 'en-US': 'en',
+ 'en-GB': 'en'
+};
+
+
+// 获取语言:优先缓存 -> 系统语言 -> 默认英语
+const lang = uni.getStorageSync('language') || langMap[systemLang] || 'en';
+// const lang = 'en';
+// VueI18n构造函数所需要的配置
+const i18nConfig = {
+ locale: lang,//当前语言
+ // 所需要用的语言包
+ messages:{
+ en,
+ 'zh-Hans' : zhHans,
+ }
+}
+
+
+
+//将对象国际化
+Vue.prototype.$ot = (obj, type, key) => {
+ // 如果对象不存在,返回空字符串
+ if (!obj) return '';
+
+ // 获取当前语言
+ const currentLang = i18n.locale;
+
+ // 获取字段映射配置
+ const typeConfig = objectLangMap[type];
+ if (!typeConfig) return obj[key] || '';
+
+ const fieldConfig = typeConfig[key];
+ if (!fieldConfig) return obj[key] || '';
+
+ // 获取当前语言对应的字段名
+ const fieldName = fieldConfig[currentLang];
+ if (!fieldName) return obj[key] || '';
+
+ // 返回对象中对应字段的值,如果不存在则返回默认字段的值
+ return obj[fieldName] || obj[key] || '';
+}
+
+
+
+
+
+
+const i18n = new VueI18n(i18nConfig)
+export default i18n
\ No newline at end of file
diff --git a/locale/objectLangMap.js b/locale/objectLangMap.js
new file mode 100644
index 0000000..7c1a553
--- /dev/null
+++ b/locale/objectLangMap.js
@@ -0,0 +1,65 @@
+/**
+ * 对象字段国际化映射配置
+ * 用于 $ot 函数根据当前语言环境自动选择对应的字段名
+ *
+ * 使用方式: $ot(对象, 对象类型, 字段名)
+ * 例如: $ot(activity, 'active', 'title')
+ * - 中文环境下会取 activity.title
+ * - 英文环境下会取 activity.enTitle
+ */
+export default {
+ // 活动对象字段映射
+ "active" : {
+ "title" : { // 活动标题
+ "zh-Hans" : "title",
+ "en" : "enTitle",
+ },
+ "address" : { // 活动地址
+ "zh-Hans" : "address",
+ "en" : "enAddress",
+ },
+ "details" : { // 活动描述/详情
+ "zh-Hans" : "details",
+ "en" : "enDetails",
+ },
+ "precautions" : { // 活动注意事项
+ "zh-Hans" : "precautions",
+ "en" : "enPrecautions",
+ },
+ "orderDetails" : { // 订单详情中的活动须知
+ "zh-Hans" : "orderDetails",
+ "en" : "orderDetails",
+ }
+ },
+ // 旅行对象字段映射
+ "travel" : {
+ "title" : { // 旅行标题
+ "zh-Hans" : "title",
+ "en" : "enTitle",
+ },
+ "address" : { // 旅行地址
+ "zh-Hans" : "address",
+ "en" : "enAddress",
+ },
+ "js" : { // 旅行介绍
+ "zh-Hans" : "js",
+ "en" : "enJs",
+ },
+ "lx" : { // 旅行路线
+ "zh-Hans" : "lx",
+ "en" : "enLx",
+ },
+ "fy" : { // 旅行费用
+ "zh-Hans" : "fy",
+ "en" : "enFy",
+ },
+ "xz" : { // 旅行须知
+ "zh-Hans" : "xz",
+ "en" : "enXz",
+ },
+ "dl" : { // 旅行代理
+ "zh-Hans" : "dl",
+ "en" : "enDl",
+ }
+ }
+}
\ No newline at end of file
diff --git a/locale/zh-Hans.json b/locale/zh-Hans.json
new file mode 100644
index 0000000..46dc252
--- /dev/null
+++ b/locale/zh-Hans.json
@@ -0,0 +1,389 @@
+{
+ "pages": {
+ "index": {
+ "index": {
+ "uv_search_placeholder": "搜索相关内容",
+ "nav_title": "首页",
+ "moments_title": "悦动时刻",
+ "sign_in_activity": "活动签到",
+ "sign_in_desc": "签到有好礼",
+ "view_now": "立即查看",
+ "activity": "活动",
+ "travel": "旅行",
+ "recent": "近期",
+ "past": "往期",
+ "select_area": "选择地区",
+ "confirm": "确定"
+ },
+ "cart": {
+ "title": "我的订单",
+ "tabs": {
+ "all": "全部",
+ "pending": "待参加",
+ "completed": "已完成",
+ "cancelled": "已取消"
+ },
+ "confirmCancel": "是否取消订单?"
+ },
+ "center": {
+ "nav_title": "个人中心",
+ "please_login": "请点击登录",
+ "my_activities": "我的活动",
+ "pending": "待参加",
+ "completed": "已完成",
+ "cancelled": "已取消",
+ "my_tools": "我的工具",
+ "invoice_records": "开票记录",
+ "my_favorites": "我的收藏",
+ "about_us": "关于我们",
+ "user_agreement": "用户协议",
+ "privacy_policy": "隐私协议",
+ "organizer_agreement": "主理人协议",
+ "organizer_checkin": "主理人签到",
+ "logout": "退出登录"
+ }
+ }
+ },
+ "pages_login": {
+ "wxLogin": {
+ "wechatLogin": "微信授权登录",
+ "cancelLogin": "取消登录",
+ "agreed": "已同意",
+ "privacyPolicy": "《隐私政策》",
+ "userAgreement": "《用户协议》",
+ "pleaseAgree": "请勾选隐私协议"
+ },
+ "wxUserInfo": {
+ "requestInfo": "申请获取你的头像、昵称",
+ "avatar": "头像",
+ "nickname": "昵称",
+ "gender": "性别",
+ "phone": "手机号",
+ "enterNickname": "请输入昵称",
+ "selectGender": "请选择性别",
+ "enterPhone": "请输入手机号",
+ "getPhone": "获取电话号码",
+ "confirm": "确认",
+ "male": "男",
+ "female": "女",
+ "pleaseSelectAvatar": "请选择头像",
+ "pleaseEnterNickname": "请填写昵称",
+ "pleaseEnterPhone": "请填写手机号",
+ "pleaseSelectGender": "请选择性别"
+ },
+ "fuwutiaokuan": {
+ "title": "用户协议"
+ },
+ "yinsixieyi": {
+ "defaultTitle": "隐私协议",
+ "travelGuide": "旅行需知",
+ "paymentGuide": "支付需知",
+ "organizerAgreement": "主理人协议"
+ }
+ },
+ "pages_my": {
+ "zlx_xieyi": {
+ "title": "主理人协议"
+ },
+ "zlx_qiandao": {
+ "title": "主理人签到",
+ "activity": "活动",
+ "travel": "旅行"
+ },
+ "user_msg": {
+ "title": "编辑资料",
+ "basic_info": "基础信息",
+ "username": "用户名称",
+ "email": "邮箱",
+ "phone": "手机号",
+ "gender": "性别",
+ "nationality": "国籍",
+ "birthday": "生日",
+ "address": "现居住址",
+ "personal_status": "个人状态",
+ "education": "教育",
+ "degree": "学历",
+ "school": "院校",
+ "work": "工作",
+ "industry": "行业",
+ "about_me": "关于我",
+ "save": "保存",
+ "enter_username": "请输入用户名称",
+ "enter_email": "请输入邮箱",
+ "enter_phone": "请输入手机号",
+ "select_gender": "请选择性别",
+ "enter_nationality": "请输入国籍",
+ "enter_birthday": "请输入生日",
+ "enter_address": "请输入现居住址",
+ "enter_status": "请输入个人状态",
+ "enter_industry": "请输入行业",
+ "enter_about_me": "请输入自我介绍...",
+ "male": "男",
+ "female": "女",
+ "bachelor": "本科",
+ "master": "硕士",
+ "doctor": "博士",
+ "other": "其他",
+ "save_success": "保存成功"
+ },
+ "user_info": {
+ "title": "个人资料",
+ "change_avatar": "点击更换头像",
+ "nationality": "国籍",
+ "degree": "学历",
+ "industry": "行业",
+ "phone": "电话",
+ "gender": "性别",
+ "tags": "标签",
+ "about_me": "关于我",
+ "edit_info": "编辑信息",
+ "not_set": "未设置",
+ "years_old": "岁"
+ },
+ "travelList": {
+ "title": "旅行列表",
+ "all": "全部",
+ "enrolling": "报名中",
+ "ended": "已结束",
+ "time": "时间"
+ },
+ "activeList": {
+ "title": "活动列表",
+ "all_area": "全部地区",
+ "enrolling": "报名中",
+ "ended": "已结束",
+ "time": "时间"
+ },
+ "guanyuwomen": {
+ "title": "关于我们"
+ },
+ "qiandao_list": {
+ "title": "签到列表",
+ "scan_checkin": "扫码签到",
+ "early_bird": "早鸟票",
+ "single_ticket": "单人票",
+ "premium_ticket": "尊享票"
+ },
+ "collection": {
+ "title": "我的收藏",
+ "tabs": {
+ "activity": "活动",
+ "travel": "旅行"
+ },
+ "confirm_cancel_collection": "确认取消收藏吗?",
+ "sign_up_now": "立即报名",
+ "ended": "已结束"
+ }
+ },
+ "pages_order": {
+ "huodong_detail": {
+ "title": "活动详情",
+ "start_time": "开始时间:",
+ "activity_address": "活动地址:",
+ "navigation": "导航",
+ "organizer": "主理人",
+ "add_wechat": "添加微信",
+ "activity_description": "活动描述",
+ "precautions": "注意事项",
+ "registration_fee": "报名费用",
+ "collect": "收藏",
+ "collected": "已收藏",
+ "forward": "转发",
+ "sign_up_now": "立即报名",
+ "ended": "已结束",
+ "select_activity_status": "选择活动状态",
+ "confirm": "确定",
+ "early_bird": "早鸟票",
+ "single_ticket": "单人票",
+ "premium_ticket": "尊享票",
+ "complete_info_required": "请您先完善必要信息"
+ },
+ "invoice_issuance": {
+ "title": "申请开票",
+ "total": "总计",
+ "individual": "个人",
+ "enterprise": "企业",
+ "name": "姓名",
+ "enterprise_name": "企业名称",
+ "id_number": "身份证号",
+ "tax_number": "税号",
+ "email": "邮箱",
+ "apply": "申请",
+ "please_enter": "请输入内容"
+ },
+ "invoice_records": {
+ "title": "开票记录",
+ "standard_ticket": "标准票",
+ "states": {
+ "invoicing": "开票中",
+ "invoiced": "已开票",
+ "failed": "开票失败"
+ }
+ },
+ "lvyou_detail": {
+ "title": "旅行详情",
+ "start_time": "开始时间:",
+ "tour_guide": "领队",
+ "add_wechat": "添加微信",
+ "travel_description": "旅行描述",
+ "registration_fee": "报名费用",
+ "collect": "收藏",
+ "collected": "已收藏",
+ "forward": "转发",
+ "sign_up_now": "立即报名",
+ "ended": "已结束",
+ "complete_info_required": "请您先完善必要信息",
+ "tabs": {
+ "introduction": "介绍",
+ "route": "路线",
+ "cost": "费用",
+ "notice": "须知",
+ "agent": "代理"
+ }
+ },
+ "order_details": {
+ "title": "订单详情",
+ "total": "总计",
+ "order_info": "订单信息",
+ "order_number": "订单编号",
+ "order_time": "下单时间",
+ "order_amount": "订单金额",
+ "order_status": "订单状态",
+ "payment_notice": "支付须知",
+ "activity_notice": "活动须知",
+ "travel_notice": "旅行须知",
+ "activity_checkin": "活动签到",
+ "status": {
+ "unpaid": "未付款",
+ "pending": "待参加",
+ "completed": "已完成",
+ "cancelled": "已取消"
+ }
+ },
+ "order_evaluation": {
+ "title": "活动评价",
+ "organizer_evaluation": "主理人评价",
+ "activity_evaluation": "活动评价",
+ "please_enter_content": "请输入内容",
+ "submit_comment": "提交评论",
+ "please_rate_first": "请评分之后再提交!"
+ },
+ "pay_order": {
+ "title": "支付详情",
+ "pending_payment": "待支付",
+ "price": "价格",
+ "order_info": "订单信息",
+ "ticket_quantity": "购票数量",
+ "ticket_content": "购票内容",
+ "order_total": "订单总金额",
+ "order_status": "订单状态",
+ "invitation_code": "邀请码",
+ "enter_invitation_code": "请输入邀请码",
+ "payment_notice": "支付须知",
+ "pay_order": "支付订单",
+ "payment_success": "支付成功",
+ "status": {
+ "unpaid": "未付款",
+ "pending": "待参加",
+ "completed": "已完成",
+ "cancelled": "已取消"
+ },
+ "ticket_types": {
+ "early_bird": "早鸟票",
+ "single_ticket": "单人票",
+ "premium_ticket": "尊享票"
+ }
+ }
+ },
+ "pages_zlx": {
+ "zlx_form": {
+ "title": "主理人认证",
+ "basic_info": "基础信息",
+ "real_name": "真实姓名",
+ "enter_real_name": "请输入真实姓名",
+ "contact_info": "联系方式",
+ "enter_contact_info": "请输入联系方式",
+ "id_card": "身份证号",
+ "enter_id_card": "请输入身份证号",
+ "resume_attachment": "简历附件",
+ "upload_resume": "上传简历",
+ "wechat_qr_code": "微信二维码",
+ "upload_image": "上传图片",
+ "personal_photos_title": "个人生活照片(含全身照)",
+ "agreement_title": "阅读并同意协议",
+ "agreement_text": "我已经阅读并同意",
+ "agreement_link": "《主理人协议》",
+ "save": "保存",
+ "approved": "已审核通过",
+ "copy": "复制",
+ "copy_success": "复制成功",
+ "save_success": "保存成功",
+ "submit_success": "提交成功",
+ "please_agree_agreement": "请先阅读并同意《主理人协议》",
+ "please_enter_name": "请输入姓名",
+ "please_enter_contact": "请输入联系方式",
+ "please_enter_correct_contact": "请输入正确的联系方式",
+ "please_enter_id_card": "请输入身份证号",
+ "please_enter_correct_id_card": "请输入正确的身份证号"
+ }
+ },
+ "common": {
+ "confirm_logout": "确认退出登录吗",
+ "logging_in": "登录中...",
+ "all": "全部"
+ },
+ "components": {
+ "base": {
+ "tabbar": {
+ "home": "首页",
+ "member": "招募",
+ "cart": "订单",
+ "center": "我的"
+ }
+ },
+ "active": {
+ "activeItem": {
+ "signUp": "立即报名",
+ "ended": "已结束"
+ }
+ },
+ "travel": {
+ "travelList": {
+ "enrolling": "报名中",
+ "ended": "已结束"
+ }
+ },
+ "cart": {
+ "cardList": {
+ "orderTime": "下单时间",
+ "total": "总计",
+ "cancelActivity": "取消活动",
+ "signIn": "活动签到",
+ "evaluate": "评价活动",
+ "invoice": "开具发票",
+ "states": {
+ "pending": "待参加",
+ "completed": "已完成",
+ "cancelled": "已取消"
+ }
+ },
+ "signInQrcodePopup": {
+ "organizer": "主理人"
+ }
+ },
+ "zhaomu": {
+ "zlxItem": {
+ "startSignIn": "开始签到"
+ },
+ "zhaomuItem": {
+ "joinRecruit": "参与招募",
+ "rejected": "不通过",
+ "reviewing": "审核中",
+ "joined": "已参加",
+ "guaranteed": "保证成行",
+ "confirmed": "已成行",
+ "joinSuccess": "参与成功"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/main.js b/main.js
index d74721b..2b8044a 100644
--- a/main.js
+++ b/main.js
@@ -10,6 +10,7 @@ Vue.config.productionTip = false
App.mpType = 'app'
import store from '@/store/store'
+import i18n from '@/locale/index.js'
import './config'
import './utils/index.js'
@@ -33,6 +34,7 @@ Vue.prototype.$Toast = function(title) {
const app = new Vue({
...App,
store,
+ i18n,
})
app.$mount()
// #endif
diff --git a/pages.json b/pages.json
index 2867f13..29e6b57 100644
--- a/pages.json
+++ b/pages.json
@@ -7,13 +7,6 @@
"enablePullDownRefresh": true
}
},
- {
- "path": "pages/index/order",
- "style": {
- "navigationBarTitleText": "",
- "enablePullDownRefresh": true
- }
- },
{
"path": "pages/index/center",
"style": {
@@ -220,7 +213,7 @@
}],
"globalStyle": {
"navigationBarTextStyle": "black",
- "navigationBarTitleText": "酒店桌布",
+ "navigationBarTitleText": "",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationStyle": "custom"
diff --git a/pages/index/cart.vue b/pages/index/cart.vue
index 8d4382b..d9fd089 100644
--- a/pages/index/cart.vue
+++ b/pages/index/cart.vue
@@ -1,7 +1,7 @@
-
+
{
if(res.confirm){
this.confirm()
diff --git a/pages/index/center.vue b/pages/index/center.vue
index 66e0250..56dc521 100644
--- a/pages/index/center.vue
+++ b/pages/index/center.vue
@@ -1,7 +1,8 @@
-
+
+
@@ -10,7 +11,8 @@
- {{isLogin ? userInfo.nickName : '请点击登录'}}
+ {{isLogin ? userInfo.nickName : $t('pages.index.center.please_login')}}
+
{{ userInfo.phone || '' }}
@@ -23,7 +25,8 @@
- 我的活动
+ {{ $t('pages.index.center.my_activities') }}
+
@@ -32,23 +35,27 @@
- 待参加
+ {{ $t('pages.index.center.pending') }}
+
- 已完成
+ {{ $t('pages.index.center.completed') }}
+
- 已取消
+ {{ $t('pages.index.center.cancelled') }}
+
- 我的工具
+ {{ $t('pages.index.center.my_tools') }}
+
@@ -89,60 +96,62 @@
data() {
return {
bgColor:'transparent',
- cellList:[
+ cellList:[],
+ vipType : ['普通会员', '黄金会员', '渠道商'],
+ vipImage : ['vip_vip', 'vip_user', 'vip_shop']
+ }
+ },
+ onShow() {
+ if(this.isLogin) {
+ this.$store.commit('getUserInfo')
+ }
+ },
+ onLoad() {
+ // 初始化国际化的菜单列表
+ this.cellList = [
{
src:require('@/static/image/center/line-1.png'),
- name:'开票记录',
+ name: this.$t('pages.index.center.invoice_records'), // 开票记录
url:'/pages_order/invoiceRecords'
},
{
src:require('@/static/image/center/line-2.png'),
- name:'我的收藏',
+ name: this.$t('pages.index.center.my_favorites'), // 我的收藏
url:'/pages_my/collection'
},
{
src:require('@/static/image/center/line-3.png'),
- name:'关于我们',
+ name: this.$t('pages.index.center.about_us'), // 关于我们
url:'/pages_my/guanyuwomen'
},
{
src:require('@/static/image/center/line-4.png'),
- name:'用户协议',
+ name: this.$t('pages.index.center.user_agreement'), // 用户协议
url:'/pages_login/fuwutiaokuan'
},
{
src:require('@/static/image/center/line-5.png'),
- name:'隐私协议',
+ name: this.$t('pages.index.center.privacy_policy'), // 隐私协议
url:'/pages_login/yinsixieyi'
},
{
src:require('@/static/image/center/line-6.png'),
- name:'主理人协议',
+ name: this.$t('pages.index.center.organizer_agreement'), // 主理人协议
url:'/pages_my/zlx-xieyi'
},
{
src:require('@/static/image/center/line-7.png'),
- name:'主理人签到',
+ name: this.$t('pages.index.center.organizer_checkin'), // 主理人签到
url:'/pages_my/zlx-qiandao',
role : true,
},
{
src: '/static/image/center/line-5.png',
- name:'退出登录',
+ name: this.$t('pages.index.center.logout'), // 退出登录
commit : 'logout',
auth : true,
}
- ],
- vipType : ['普通会员', '黄金会员', '渠道商'],
- vipImage : ['vip_vip', 'vip_user', 'vip_shop']
- }
- },
- onShow() {
- if(this.isLogin) {
- this.$store.commit('getUserInfo')
- }
- },
- onLoad() {
+ ]
},
onPageScroll(e) {
if(e.scrollTop > 50) {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index cdc1482..b0a5c71 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -11,7 +11,8 @@
-
+
+
@@ -24,15 +25,19 @@
- 悦动时刻
+ {{ $t('pages.index.index.moments_title') }}
+
- 活动签到
- 签到有好礼
+ {{ $t('pages.index.index.sign_in_activity') }}
+
+ {{ $t('pages.index.index.sign_in_desc') }}
+
- 立即查看
+ {{ $t('pages.index.index.view_now') }}
+
@@ -41,9 +46,11 @@
- 活动
+ {{ $t('pages.index.index.activity') }}
+
- 立即查看
+ {{ $t('pages.index.index.view_now') }}
+
@@ -51,9 +58,11 @@
- 旅行
+ {{ $t('pages.index.index.travel') }}
+
- 立即查看
+ {{ $t('pages.index.index.view_now') }}
+
@@ -111,7 +120,8 @@
@@ -171,14 +182,8 @@
navTitle:'',
keyword:'',
list: [],
- hdList: [
- { id: 0, name: '近期' },
- { id: 1, name: '往期' },
- ],
- typeList: [
- { id: 0, name: '活动' },
- { id: 1, name: '旅行' },
- ],
+ hdList: [],
+ typeList: [],
type : 0,
lineBg: require('@/static/image/cart/tabIcon.png'),
cardListData: [],
@@ -189,7 +194,7 @@
onPageScroll(e) {
if(e.scrollTop > 50) {
this.bgColor = '#49070c'
- this.navTitle = '首页'
+ this.navTitle = this.$t('pages.index.index.nav_title') // 首页
}else{
this.bgColor = 'transparent'
this.navTitle = ''
@@ -201,9 +206,19 @@
this.getActivityPageList()
},
computed : {
- ...mapState(['areaList']),
+ ...mapState(['areaList', 'selectArea']),
},
onLoad() {
+ // 初始化国际化数据
+ this.hdList = [
+ { id: 0, name: this.$t('pages.index.index.recent') }, // 近期
+ { id: 1, name: this.$t('pages.index.index.past') }, // 往期
+ ]
+ this.typeList = [
+ { id: 0, name: this.$t('pages.index.index.activity') }, // 活动
+ { id: 1, name: this.$t('pages.index.index.travel') }, // 旅行
+ ]
+
this.getBanner()
// this.getLocationDetail()
this.$store.commit('getArea', list => {
diff --git a/pages/index/order.vue b/pages/index/order.vue
deleted file mode 100644
index 08619ca..0000000
--- a/pages/index/order.vue
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages_login/fuwutiaokuan.vue b/pages_login/fuwutiaokuan.vue
index 1b526d7..9d270dd 100644
--- a/pages_login/fuwutiaokuan.vue
+++ b/pages_login/fuwutiaokuan.vue
@@ -1,7 +1,7 @@
-
+
diff --git a/pages_login/wxLogin.vue b/pages_login/wxLogin.vue
index 03d263f..4eae40e 100644
--- a/pages_login/wxLogin.vue
+++ b/pages_login/wxLogin.vue
@@ -11,12 +11,12 @@
- 微信授权登录
+ {{$t('pages_login.wxLogin.wechatLogin')}}
- 取消登录
+ {{$t('pages_login.wxLogin.cancelLogin')}}
@@ -26,8 +26,8 @@
- 已同意《隐私政策》
- 《用户协议》
+ {{$t('pages_login.wxLogin.agreed')}}{{$t('pages_login.wxLogin.privacyPolicy')}}
+ {{$t('pages_login.wxLogin.userAgreement')}}
@@ -51,7 +51,7 @@
if(this.consent.length <= 0){
return uni.showToast({
icon: "none",
- title: "请勾选隐私协议"
+ title: this.$t('pages_login.wxLogin.pleaseAgree')
})
}
this.$store.commit('login')
diff --git a/pages_login/wxUserInfo.vue b/pages_login/wxUserInfo.vue
index e6aff09..c7ef5e2 100644
--- a/pages_login/wxUserInfo.vue
+++ b/pages_login/wxUserInfo.vue
@@ -7,13 +7,13 @@
{{ configList.logo_name }}
- 申请获取你的头像、昵称
+ {{$t('pages_login.wxUserInfo.requestInfo')}}
@@ -70,7 +70,7 @@
- 确认
+ {{$t('pages_login.wxUserInfo.confirm')}}
@@ -86,7 +86,7 @@
sex : '',
},
sexcolumns:[
- ['男','女']
+ [this.$t('pages_login.wxUserInfo.male'), this.$t('pages_login.wxUserInfo.female')]
],
};
},
@@ -150,10 +150,10 @@
self.userInfoForm.nickName = nickName
if (self.$utils.verificationAll(self.userInfoForm, {
- headImage: '请选择头像',
- nickName: '请填写昵称',
- phone: '请填写昵称',
- sex: '请选择性别',
+ headImage: self.$t('pages_login.wxUserInfo.pleaseSelectAvatar'),
+ nickName: self.$t('pages_login.wxUserInfo.pleaseEnterNickname'),
+ phone: self.$t('pages_login.wxUserInfo.pleaseEnterPhone'),
+ sex: self.$t('pages_login.wxUserInfo.pleaseSelectGender'),
})) {
return
}
diff --git a/pages_login/yinsixieyi.vue b/pages_login/yinsixieyi.vue
index 93e4691..817f8a8 100644
--- a/pages_login/yinsixieyi.vue
+++ b/pages_login/yinsixieyi.vue
@@ -2,7 +2,7 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item[typeKey[item.type]].title}}
- {{item[typeKey[item.type]].startTime}}
- {{item[typeKey[item.type]].address}}
-
-
- {{item[typeKey[item.type]].num}}/{{item[typeKey[item.type]].sum}}
- 立即报名
- 已结束
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $ot(item[typeKey[item.type]], typeKey2[item.type], 'title') }}
+ {{ item[typeKey[item.type]].startTime }}
+ {{ $ot(item[typeKey[item.type]], typeKey2[item.type], 'address') }}
+
+
+
+ {{ item[typeKey[item.type]].num }}/{{ item[typeKey[item.type]].sum }}
+ {{ $t('pages_my.collection.sign_up_now') }}
+ {{ $t('pages_my.collection.ended') }}
+
+
+
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/pages_my/guanyuwomen.vue b/pages_my/guanyuwomen.vue
index fe180e1..316bc5d 100644
--- a/pages_my/guanyuwomen.vue
+++ b/pages_my/guanyuwomen.vue
@@ -1,7 +1,7 @@
-
+
diff --git a/pages_my/qiandao-list.vue b/pages_my/qiandao-list.vue
index 2310b16..bc6f7df 100644
--- a/pages_my/qiandao-list.vue
+++ b/pages_my/qiandao-list.vue
@@ -1,7 +1,7 @@
-
+
-
+
@@ -44,20 +44,7 @@
detail : {
activityInfo : {},
},
- typeList:[
- {
- name:'早鸟票',
- price:168
- },
- {
- name:'单人票',
- price:198.01
- },
- {
- name:'尊享票',
- price:268
- }
- ],
+ typeList:[],
type : 0,
}
},
@@ -69,6 +56,22 @@
}
},
onLoad({id, type}) {
+ // 初始化国际化数据
+ this.typeList = [
+ {
+ name: this.$t('pages_my.qiandao_list.early_bird'),
+ price: 168
+ },
+ {
+ name: this.$t('pages_my.qiandao_list.single_ticket'),
+ price: 198.01
+ },
+ {
+ name: this.$t('pages_my.qiandao_list.premium_ticket'),
+ price: 268
+ }
+ ]
+
this.queryParams.recruitId = id
this.queryParams.pageSize = 20
this.queryParams.type = type
diff --git a/pages_my/travelList.vue b/pages_my/travelList.vue
index ba9c02d..0bc3e6b 100644
--- a/pages_my/travelList.vue
+++ b/pages_my/travelList.vue
@@ -1,7 +1,7 @@
-
+
-
+
- 国籍
+ {{ $t('pages_my.user_info.nationality') }}
- {{info.city || '未设置'}}
+ {{info.city || $t('pages_my.user_info.not_set')}}
- 学历
+ {{ $t('pages_my.user_info.degree') }}
- {{info.shcool || '未设置'}}
+ {{info.shcool || $t('pages_my.user_info.not_set')}}
- 行业
+ {{ $t('pages_my.user_info.industry') }}
- {{info.workValue || '未设置'}}
+ {{info.workValue || $t('pages_my.user_info.not_set')}}
- 电话
+ {{ $t('pages_my.user_info.phone') }}
- {{info.phone || '未设置'}}
+ {{info.phone || $t('pages_my.user_info.not_set')}}
- 性别
+ {{ $t('pages_my.user_info.gender') }}
- {{info.sex || '未设置'}}
+ {{info.sex || $t('pages_my.user_info.not_set')}}
- 标签
+ {{ $t('pages_my.user_info.tags') }}
{{val}}
@@ -89,12 +89,12 @@
-
- {{info.details || '未设置'}}
+
+ {{info.details || $t('pages_my.user_info.not_set')}}
-
+
@@ -158,10 +158,10 @@
self.info.headImage = url
this.$api('updateInfo',this.info, res => {
if (res.code == 200) {
- uni.showToast({
- title:'保存成功',
- icon:'none'
- })
+ uni.showToast({
+ title: this.$t('pages_my.user_msg.save_success'),
+ icon:'none'
+ })
}
})
})
diff --git a/pages_my/user-msg.vue b/pages_my/user-msg.vue
index cee6a42..e6ff3eb 100644
--- a/pages_my/user-msg.vue
+++ b/pages_my/user-msg.vue
@@ -1,90 +1,90 @@
-
+
- 基础信息
+ {{ $t('pages_my.user_msg.basic_info') }}
- 用户名称
+ {{ $t('pages_my.user_msg.username') }}
-
+
- 邮箱
+ {{ $t('pages_my.user_msg.email') }}
-
+
- 手机号
+ {{ $t('pages_my.user_msg.phone') }}
-
+
- 性别
+ {{ $t('pages_my.user_msg.gender') }}
-
+
- 国籍
+ {{ $t('pages_my.user_msg.nationality') }}
-
+
- 生日
+ {{ $t('pages_my.user_msg.birthday') }}
-
+
- 现居住址
+ {{ $t('pages_my.user_msg.address') }}
-
+
- 个人状态
+ {{ $t('pages_my.user_msg.personal_status') }}
-
+
- 教育
+ {{ $t('pages_my.user_msg.education') }}
- 学历
+ {{ $t('pages_my.user_msg.degree') }}
{{item}}
- 院校
+ {{ $t('pages_my.user_msg.school') }}
{{item.title}}
- 工作
+ {{ $t('pages_my.user_msg.work') }}
- 行业
+ {{ $t('pages_my.user_msg.industry') }}
-
+
- 关于我
+ {{ $t('pages_my.user_msg.about_me') }}
-
+
-
+
@@ -117,11 +117,9 @@
},
xueliIndex:0,
yuanxiaoIndex:0,
- xueliList:['本科','硕士','博士','其他'],
+ xueliList:[],
yuanxiaoList:[],
- sexcolumns:[
- ['男','女']
- ],
+ sexcolumns:[],
citycolumns:[],
maxDate:new Date().getTime(),
value: Number(new Date())
@@ -135,6 +133,18 @@
}
},
onLoad() {
+ // 初始化国际化数据
+ this.xueliList = [
+ this.$t('pages_my.user_msg.bachelor'),
+ this.$t('pages_my.user_msg.master'),
+ this.$t('pages_my.user_msg.doctor'),
+ this.$t('pages_my.user_msg.other')
+ ]
+ this.sexcolumns = [[
+ this.$t('pages_my.user_msg.male'),
+ this.$t('pages_my.user_msg.female')
+ ]]
+
this.getUserInfo()
this.getnationalityPageList()
this.getlabelPageList()
@@ -171,10 +181,10 @@
}
this.$api('updateInfo',this.info, res => {
if (res.code == 200) {
- uni.showToast({
- title:'保存成功',
- icon:'none'
- })
+ uni.showToast({
+ title: this.$t('pages_my.user_msg.save_success'),
+ icon:'none'
+ })
setTimeout(()=>{
uni.navigateBack()
},1500)
diff --git a/pages_my/zlx-qiandao.vue b/pages_my/zlx-qiandao.vue
index a8e6346..399a82a 100644
--- a/pages_my/zlx-qiandao.vue
+++ b/pages_my/zlx-qiandao.vue
@@ -1,7 +1,7 @@
-
+
-
+
diff --git a/pages_order/huodong-detail.vue b/pages_order/huodong-detail.vue
index d34b087..cc45b6a 100644
--- a/pages_order/huodong-detail.vue
+++ b/pages_order/huodong-detail.vue
@@ -1,7 +1,7 @@
-
+
@@ -14,13 +14,13 @@
- {{activityDetails.title}}
- 开始时间:{{activityDetails.startTime}}
+ {{$ot(activityDetails, 'active', 'title')}}
+ {{$t('pages_order.huodong_detail.start_time')}}{{activityDetails.startTime}}
- 活动地址:{{activityDetails.address}}
+ {{$t('pages_order.huodong_detail.activity_address')}}{{$ot(activityDetails, 'active', 'address')}}
- 导航
+ {{$t('pages_order.huodong_detail.navigation')}}
@@ -28,7 +28,7 @@
{{adminUserInfo.nickName}}
- 主理人
+ {{$t('pages_order.huodong_detail.organizer')}}
- 添加微信
+ {{$t('pages_order.huodong_detail.add_wechat')}}
- 活动描述
+ {{$t('pages_order.huodong_detail.activity_description')}}
-
+
@@ -53,10 +53,10 @@
当金黄的落叶轻柔地铺满了小城的每个角落,我们知道,最温柔的季节已悄然而至。在这个收获的季节里,我们诚挚邀请您加入我们的秋日私旅
-->
- 注意事项
+ {{$t('pages_order.huodong_detail.precautions')}}
-
+
@@ -64,7 +64,7 @@
¥{{activityDetails.price}}
- 报名费用
+ {{$t('pages_order.huodong_detail.registration_fee')}}
@@ -73,20 +73,20 @@
v-if="!isCollect">
- 收藏
+ {{$t('pages_order.huodong_detail.collect')}}
- 已收藏
+ {{$t('pages_order.huodong_detail.collected')}}
@@ -95,18 +95,18 @@
立即报名
+ @click="toBaoming">{{$t('pages_order.huodong_detail.sign_up_now')}}
已结束
+ >{{$t('pages_order.huodong_detail.ended')}}
-
+
@@ -178,7 +178,7 @@
if (res.from === 'button') {
// 来自详情页页面内分享按
return {
- title:this.activityDetails.title,
+ title: this.$ot(this.activityDetails, 'active', 'title'),
path: `/pages_order/huodong-detail?activityId=${this.activityId}`,
imageUrl: this.imageArr[0],
success: function(res) {
@@ -192,7 +192,7 @@
}
// 设置转发的参数
return {
- title:this.activityDetails.title,
+ title: this.$ot(this.activityDetails, 'active', 'title'),
path: `/pages_order/huodong-detail?activityId=${this.activityId}`,
imageUrl: this.imageArr[0],
success: function(res) {
@@ -226,6 +226,8 @@
uni.openLocation({
latitude: Number(this.activityDetails.latitude),
longitude: Number(this.activityDetails.longitude),
+ name: this.$ot(this.activityDetails, 'active', 'title'),
+ address: this.$ot(this.activityDetails, 'active', 'address'),
success: function () {
console.log('success');
},
@@ -255,21 +257,21 @@
if(res.result.activityInfo.birdPrice){
this.typeList.push({
price : res.result.activityInfo.birdPrice,
- name : '早鸟票',
+ name : this.$t('pages_order.huodong_detail.early_bird'), // 早鸟票
type : 0,
})
}
if(res.result.activityInfo.personPrice){
this.typeList.push({
price : res.result.activityInfo.personPrice,
- name : '单人票',
+ name : this.$t('pages_order.huodong_detail.single_ticket'), // 单人票
type : 1,
})
}
if(res.result.activityInfo.expensivePrice){
this.typeList.push({
price : res.result.activityInfo.expensivePrice,
- name : '尊享票',
+ name : this.$t('pages_order.huodong_detail.premium_ticket'), // 尊享票
type : 2,
})
}
@@ -307,7 +309,7 @@
!this.userInfo.phone ||
!this.userInfo.sex){
uni.showToast({
- title: '请您先完善必要信息',
+ title: this.$t('pages_order.huodong_detail.complete_info_required'), // 请您先完善必要信息
icon: 'none'
})
setTimeout(uni.navigateTo, 800, {
@@ -493,7 +495,7 @@
}
}
.lv-miaoshu {
- margin-top: 440rpx;
+ margin-top: 480rpx;
.value-box {
background: #1B1713;
border-radius: 27rpx;
diff --git a/pages_order/invoiceIssuance.vue b/pages_order/invoiceIssuance.vue
index 7458ae2..19db641 100644
--- a/pages_order/invoiceIssuance.vue
+++ b/pages_order/invoiceIssuance.vue
@@ -1,19 +1,19 @@
-
+
-
+
- {{activityItem.title}}
+ {{$ot(activityItem, 'active', 'title')}}
{{activityItem.startTime}}
- {{activityItem.address}}
+ {{$ot(activityItem, 'active', 'address')}}
- 总计¥{{activityItem.price}}
+ {{$t('pages_order.invoice_issuance.total')}}¥{{activityItem.price}}
@@ -27,23 +27,23 @@
labelColor="#fff"
activeColor="#FF4546"
iconPlacement="right">
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
diff --git a/pages_order/invoiceRecords.vue b/pages_order/invoiceRecords.vue
index a923c5e..0ac7ee8 100644
--- a/pages_order/invoiceRecords.vue
+++ b/pages_order/invoiceRecords.vue
@@ -1,26 +1,26 @@
-
+
+ item.activityList[0].image.split(',')[0]" alt=""/>
+ item.travelList[0].image.split(',')[0]" alt=""/>
- {{item.activityList[0] && item.activityList[0].title}}
+ {{item.activityList[0] && $ot(item.activityList[0], 'active', 'title')}}
- {{item.travelList[0] && item.travelList[0].title}}
+ {{item.travelList[0] && $ot(item.travelList[0], 'travel', 'title')}}
{{item.createTime}}
{{item.emil}}
- 标准票
+ {{$t('pages_order.invoice_records.standard_ticket')}}
×1
- {{ state[item.state] }}
+ {{ $t(`pages_order.invoice_records.states.${stateKeys[item.state]}`) }}
@@ -51,7 +51,8 @@ export default {
data() {
return {
mixinsListApi : 'getInvoicePageList',
- state : ['开票中', '已开票', '开票失败'],
+ state : ['开票中', '已开票', '开票失败'], // 保留原有数组以兼容
+ stateKeys : ['invoicing', 'invoiced', 'failed'], // 新增状态键数组用于国际化
};
},
components: {
diff --git a/pages_order/lvyou-detail.vue b/pages_order/lvyou-detail.vue
index ccc085a..529ff29 100644
--- a/pages_order/lvyou-detail.vue
+++ b/pages_order/lvyou-detail.vue
@@ -1,7 +1,7 @@
-
+
@@ -15,14 +15,14 @@
- {{travelDetails.travel.title}}
- 开始时间:{{travelDetails.travel.startTime}}
+ {{$ot(travelDetails.travel, 'travel', 'title')}}
+ {{$t('pages_order.lvyou_detail.start_time')}}{{travelDetails.travel.startTime}}
{{travelDetails.adminUserInfo.nickName}}
- 领队
+ {{$t('pages_order.lvyou_detail.tour_guide')}}
- 添加微信
+ {{$t('pages_order.lvyou_detail.add_wechat')}}
@@ -40,7 +40,7 @@
- 旅行描述
+ {{$t('pages_order.lvyou_detail.travel_description')}}
@@ -54,7 +54,7 @@
¥{{travelDetails.travel.price}}
- 报名费用
+ {{$t('pages_order.lvyou_detail.registration_fee')}}
- 收藏
+ {{$t('pages_order.lvyou_detail.collect')}}
- 已收藏
+ {{$t('pages_order.lvyou_detail.collected')}}
立即报名
+ @click="toBaoming">{{$t('pages_order.lvyou_detail.sign_up_now')}}
已结束
+ >{{$t('pages_order.lvyou_detail.ended')}}
@@ -109,23 +109,23 @@
current:0,
list:[
{
- name:'介绍',
+ name: this.$t('pages_order.lvyou_detail.tabs.introduction'), // 介绍
key:'js'
},
{
- name:'路线',
+ name: this.$t('pages_order.lvyou_detail.tabs.route'), // 路线
key:'lx'
},
{
- name:'费用',
+ name: this.$t('pages_order.lvyou_detail.tabs.cost'), // 费用
key:'fy'
},
{
- name:'须知',
+ name: this.$t('pages_order.lvyou_detail.tabs.notice'), // 须知
key:'xz'
},
{
- name:'代理',
+ name: this.$t('pages_order.lvyou_detail.tabs.agent'), // 代理
key:'dl'
},
],
@@ -138,7 +138,7 @@
if (res.from === 'button') {
// 来自详情页页面内分享按
return {
- title:this.travelDetails.travel.title,
+ title: this.$ot(this.travelDetails.travel, 'travel', 'title'),
path: `/pages_order/lvyou-detail?travelId=${this.travelId}`,
imageUrl: this.travelDetails.travel.image,
success: function(res) {
@@ -152,7 +152,7 @@
}
// 设置转发的参数
return {
- title:this.travelDetails.title,
+ title: this.$ot(this.travelDetails.travel, 'travel', 'title'),
path: `/pages_order/lvyou-detail?travelId=${this.travelId}`,
imageUrl: this.travelDetails.travel.image,
success: function(res) {
@@ -191,7 +191,7 @@
!this.userInfo.sex){
uni.showToast({
- title: '请您先完善必要信息',
+ title: this.$t('pages_order.lvyou_detail.complete_info_required'), // 请您先完善必要信息
icon: 'none'
})
@@ -243,7 +243,7 @@
},
tabsClick(val) {
this.current = val.index
- this.content = this.travelDetails.travel[this.list[this.current].key]
+ this.content = this.$ot(this.travelDetails.travel, 'travel', this.list[this.current].key)
},
travelInfo(travelId) {
let data = {travelId}
@@ -254,7 +254,7 @@
if(res.code==200) {
this.travelDetails = res.result
this.isCollect = res.result.collect
- this.content = res.result.travel[this.list[this.current].key]
+ this.content = this.$ot(res.result.travel, 'travel', this.list[this.current].key)
}
})
}
diff --git a/pages_order/orderDetails.vue b/pages_order/orderDetails.vue
index 5dbe521..18984a3 100644
--- a/pages_order/orderDetails.vue
+++ b/pages_order/orderDetails.vue
@@ -1,7 +1,7 @@
-
+
@@ -10,51 +10,53 @@
-
+
- {{dataInfo.title}}
+ {{getTitle()}}
{{dataInfo.startTime}}
- {{dataInfo.address}}
+ {{getAddress()}}
- 总计¥{{dataInfo.payPrice}}
+ {{$t('pages_order.order_details.total')}}¥{{dataInfo.payPrice}}
- 订单信息
+ {{$t('pages_order.order_details.order_info')}}
-
-
-
-
+
+
+
+
- 支付须知
+ {{$t('pages_order.order_details.payment_notice')}}
- 活动须知
+ {{$t('pages_order.order_details.activity_notice')}}
-
+
+
- 旅行须知
+ {{$t('pages_order.order_details.travel_notice')}}
-
+
+
-
+
@@ -80,7 +82,8 @@
dataInfo: {},
customStyle:{
color:'#FF5858'
- }
+ },
+ detail : {},
}
},
onLoad(e) {
@@ -89,18 +92,16 @@
},
computed:{
orderStatus() {
- let text = ""
let state = this.dataInfo.state
if( state == 0) {
- text = '未付款'
+ return this.$t('pages_order.order_details.status.unpaid') // 未付款
}else if(state == 1) {
- text = '待参加'
+ return this.$t('pages_order.order_details.status.pending') // 待参加
}else if(state == 2) {
- text = '已完成'
+ return this.$t('pages_order.order_details.status.completed') // 已完成
}else{
- text = '已取消'
+ return this.$t('pages_order.order_details.status.cancelled') // 已取消
}
- return text
},
showOrderId() {//0活动 1旅行
let id = ""
@@ -120,12 +121,39 @@
this.$api('orderInfo',{orderId:this.orderId},res=>{
if(res.code == 200) {
this.dataInfo = res.result.orderDetails
+ this.detail = res.result
}
})
},
open(){
this.$refs.signInQrcodePopup.open(this.orderId)
},
+ getTitle() {
+ // 根据订单类型决定使用哪种对象类型进行国际化
+ if (this.dataInfo.type == 0) {
+ // 活动订单
+ return this.$ot(this.detail.activity, 'active', 'title')
+ } else {
+ // 旅行订单
+ return this.$ot(this.detail.travel, 'travel', 'title')
+ }
+ },
+ getAddress() {
+ // 根据订单类型决定使用哪种对象类型进行国际化
+ if (this.dataInfo.type == 0) {
+ // 活动订单
+ return this.$ot(this.detail.activity, 'active', 'address')
+ } else {
+ // 旅行订单
+ return this.$ot(this.detail.travel, 'travel', 'address')
+ }
+ },
+ getHuodongText() {
+ return this.$ot(this.detail.activity, 'active', 'orderDetails')
+ },
+ getLvyouText() {
+ return this.$ot(this.detail.travel, 'travel', 'xz')
+ },
}
}
diff --git a/pages_order/orderEvaluation.vue b/pages_order/orderEvaluation.vue
index 0c016d1..8c9c7a4 100644
--- a/pages_order/orderEvaluation.vue
+++ b/pages_order/orderEvaluation.vue
@@ -1,19 +1,19 @@
+ />
- 主理人评价
+ {{$t('pages_order.order_evaluation.organizer_evaluation')}}
@@ -25,14 +25,14 @@
border="none"
v-model="evaluate"
:maxlength="-1"
- placeholder="请输入内容"
- >
+ :placeholder="$t('pages_order.order_evaluation.please_enter_content')"
+ >
- 活动评价
+ {{$t('pages_order.order_evaluation.activity_evaluation')}}
@@ -48,8 +48,8 @@
border="none"
v-model="userEvaluate"
:maxlength="-1"
- placeholder="请输入内容"
- >
+ :placeholder="$t('pages_order.order_evaluation.please_enter_content')"
+ >
@@ -60,8 +60,8 @@
type="primary"
shape="circle"
color="#381615"
- text="提交评论"
- >
+ :text="$t('pages_order.order_evaluation.submit_comment')"
+ >
@@ -94,7 +94,7 @@ export default {
this.$refs.toast.show({
type: 'error',
icon: false,
- message: '请评分之后再提交!'
+ message: this.$t('pages_order.order_evaluation.please_rate_first') // 请评分之后再提交!
})
return;
}
diff --git a/pages_order/payOrder.vue b/pages_order/payOrder.vue
index f356e1e..3a50a5a 100644
--- a/pages_order/payOrder.vue
+++ b/pages_order/payOrder.vue
@@ -1,273 +1,269 @@
-
-
-
-
-
-
- 待支付
-
-
-
-
-
-
-
- {{dataInfo.title}}
- {{dataInfo.startTime}}
- {{dataInfo.address}}
-
- 价格¥{{dataInfo.payPrice}}
-
-
-
-
- 订单信息
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ {{ $t('pages_order.pay_order.pending_payment') }}
+
+
+
+
+
+
+
+ {{ getTitle() }}
+ {{ dataInfo.startTime }}
+ {{ getAddress() }}
+
+ {{ $t('pages_order.pay_order.price') }}¥{{ dataInfo.payPrice }}
+
+
+
+
+
+ {{ $t('pages_order.pay_order.order_info') }}
+
-
-
- 支付须知
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('pages_order.pay_order.payment_notice') }}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages_zlx/zlx-form.vue b/pages_zlx/zlx-form.vue
index e20c52b..6eb3e24 100644
--- a/pages_zlx/zlx-form.vue
+++ b/pages_zlx/zlx-form.vue
@@ -2,11 +2,11 @@
+ :titleStyle="{color:'#fff'}">
@@ -18,34 +18,34 @@
ID:{{userInfo.id}}
- 复制
+ {{$t('pages_zlx.zlx_form.copy')}}
- 基础信息
+ {{$t('pages_zlx.zlx_form.basic_info')}}
- 真实姓名
+ {{$t('pages_zlx.zlx_form.real_name')}}
-
+
- 联系方式
+ {{$t('pages_zlx.zlx_form.contact_info')}}
-
+
- 身份证号
+ {{$t('pages_zlx.zlx_form.id_card')}}
-
+
- 简历附件
+ {{$t('pages_zlx.zlx_form.resume_attachment')}}
- 微信二维码
+ {{$t('pages_zlx.zlx_form.wechat_qr_code')}}
- 上传图片
+ {{$t('pages_zlx.zlx_form.upload_image')}}
- 个人生活照片(含全身照)
+ {{$t('pages_zlx.zlx_form.personal_photos_title')}}
@@ -91,12 +90,12 @@
- 阅读并同意协议
+ {{$t('pages_zlx.zlx_form.agreement_title')}}
- 我已经阅读并同意
+ {{$t('pages_zlx.zlx_form.agreement_text')}}
《主理人协议》
+ @click="$utils.navigateTo('/pages_login/yinsixieyi?key=vip_text')">{{$t('pages_zlx.zlx_form.agreement_link')}}
@@ -107,11 +106,11 @@
-
+
-
+
@@ -199,7 +198,7 @@
this.$api('updateInfo',this.info, res => {
if (res.code == 200) {
uni.showToast({
- title:'保存成功',
+ title: this.$t('pages_zlx.zlx_form.save_success'), // 保存成功
icon:'none'
})
}
@@ -233,19 +232,19 @@
data:this.userInfo.id,
success: () => {
uni.showToast({
- title:'复制成功',
+ title: this.$t('pages_zlx.zlx_form.copy_success'), // 复制成功
icon:'none'
})
}
})
},
confrim() {
- if(!this.isAgree) return this.$Toast('请先阅读并同意《主理人协议》')
- if(!this.info.name) return this.$Toast('请输入姓名')
- if(!this.info.phone) return this.$Toast('请输入联系方式')
- if(!this.$utils.verificationPhone(this.info.phone)) return this.$Toast('请输入正确的联系方式')
- if(!this.info.cardNo) return this.$Toast('请输入身份证号')
- if(this.info.cardNo.length != 18) return this.$Toast('请输入正确的身份证号')
+ if(!this.isAgree) return this.$Toast(this.$t('pages_zlx.zlx_form.please_agree_agreement')) // 请先阅读并同意《主理人协议》
+ if(!this.info.name) return this.$Toast(this.$t('pages_zlx.zlx_form.please_enter_name')) // 请输入姓名
+ if(!this.info.phone) return this.$Toast(this.$t('pages_zlx.zlx_form.please_enter_contact')) // 请输入联系方式
+ if(!this.$utils.verificationPhone(this.info.phone)) return this.$Toast(this.$t('pages_zlx.zlx_form.please_enter_correct_contact')) // 请输入正确的联系方式
+ if(!this.info.cardNo) return this.$Toast(this.$t('pages_zlx.zlx_form.please_enter_id_card')) // 请输入身份证号
+ if(this.info.cardNo.length != 18) return this.$Toast(this.$t('pages_zlx.zlx_form.please_enter_correct_id_card')) // 请输入正确的身份证号
let params = {
name:this.info.name,
phone:this.info.phone,
@@ -258,7 +257,7 @@
// if(!this.info.image) return this.$Toast('请输入姓名')
this.$api('joinRecruit',params,res=>{
if(res.code == 200) {
- this.$Toast('提交成功')
+ this.$Toast(this.$t('pages_zlx.zlx_form.submit_success')) // 提交成功
setTimeout(uni.navigateBack, 800, -1)
}
})
diff --git a/store/store.js b/store/store.js
index 78a5e4a..e5dd708 100644
--- a/store/store.js
+++ b/store/store.js
@@ -4,6 +4,7 @@ import Vuex from 'vuex'
Vue.use(Vuex); //vue的插件机制
import api from '@/api/api.js'
+import i18n from '@/locale/index.js'
//Vuex.Store 构造器选项
const store = new Vuex.Store({
@@ -42,7 +43,7 @@ const store = new Vuex.Store({
},
login(state,commit){
uni.showLoading({
- title: '登录中...'
+ title: i18n.t('common.logging_in') // 登录中...
})
uni.login({
success(res) {
@@ -87,17 +88,17 @@ const store = new Vuex.Store({
uni.setStorageSync('userInfo',JSON.stringify(res.result))
state.userInfo = res.result
- // if(!state.userInfo.nickName ||
- // !state.userInfo.headImage ||
- // !state.userInfo.phone ||
- // !state.userInfo.sex){
- // uni.showToast({
- // title: '请您先完善必要信息'
- // })
- // uni.navigateTo({
- // url: '/pages_login/wxUserInfo'
- // })
- // }
+ if(!state.userInfo.nickName ||
+ !state.userInfo.headImage ||
+ !state.userInfo.phone ||
+ !state.userInfo.sex){
+ uni.showToast({
+ title: i18n.t('pages_order.huodong_detail.complete_info_required') // 请您先完善必要信息
+ })
+ uni.navigateTo({
+ url: '/pages_login/wxUserInfo'
+ })
+ }
}
})
},
@@ -113,7 +114,7 @@ const store = new Vuex.Store({
// 退出登录
logout(state){
uni.showModal({
- title: '确认退出登录吗',
+ title: i18n.t('common.confirm_logout'), // 确认退出登录吗
success(r) {
if (r.confirm) {
state.userInfo = {}
@@ -131,10 +132,10 @@ const store = new Vuex.Store({
api('getArea', res => {
if(res.code == 200){
- res.result.unshift({
- city : '全部',
- id : '',
- })
+ res.result.unshift({
+ city : i18n.t('common.all'), // 全部
+ id : '',
+ })
state.areaList = res.result
fn && fn(res.result)