新增三码适配
This commit is contained in:
@@ -11,9 +11,6 @@
|
||||
// 注意:语言初始化已移至 main.js,确保每次 reLaunch 都能正确加载新语言
|
||||
},
|
||||
onShow: async function() {
|
||||
console.log('========================================')
|
||||
console.log('=== App onShow 被调用 ===')
|
||||
console.log('时间戳:', new Date().toLocaleTimeString())
|
||||
|
||||
// 检查启动路径,如果设置了启动路径则跳转
|
||||
try {
|
||||
@@ -81,8 +78,6 @@
|
||||
} catch (e) {
|
||||
console.error('App onShow - 语言检查失败:', e)
|
||||
}
|
||||
|
||||
console.log('========================================')
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide')
|
||||
|
||||
+20
-6
@@ -36,7 +36,9 @@ const request = (option) => {
|
||||
method: option.method,
|
||||
data: option.data,
|
||||
header: {
|
||||
"Content-Type": option.headers && option.headers["Content-Type"] ? option.headers["Content-Type"] : (option.method && option.method.toUpperCase() === 'POST' ? 'application/json' : 'application/x-www-form-urlencoded'),
|
||||
"Content-Type": option.headers && option.headers["Content-Type"] ? option.headers[
|
||||
"Content-Type"] : (option.method && option.method.toUpperCase() === 'POST' ?
|
||||
'application/json' : 'application/x-www-form-urlencoded'),
|
||||
...option.headers,
|
||||
'appid': platformAppid,
|
||||
'Authorization': "Bearer " + uni.getStorageSync('token'),
|
||||
@@ -56,7 +58,9 @@ const request = (option) => {
|
||||
return
|
||||
}
|
||||
|
||||
reject({msg: `请求失败,状态码:${res.statusCode}`})
|
||||
reject({
|
||||
msg: `请求失败,状态码:${res.statusCode}`
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -68,12 +72,22 @@ const request = (option) => {
|
||||
// 计算重定向地址
|
||||
const pages = getCurrentPages()
|
||||
const current = pages && pages.length ? pages[pages.length - 1] : null
|
||||
const route = current && current.route ? ('/' + current.route) : '/pages/index/index'
|
||||
const query = current && current.options ? Object.keys(current.options).map(k => `${k}=${encodeURIComponent(current.options[k])}`).join('&') : ''
|
||||
const route = current && current.route ? ('/' + current.route) :
|
||||
'/pages/index/index'
|
||||
const query = current && current.options ? Object.keys(current.options).map(
|
||||
k => `${k}=${encodeURIComponent(current.options[k])}`).join('&') :
|
||||
''
|
||||
const redirect = encodeURIComponent(query ? `${route}?${query}` : route)
|
||||
// console.log(redirect, "===========");
|
||||
// 跳转到登录页
|
||||
uni.reLaunch({ url: `/subPackages/user/login/index?redirect=${redirect}` })
|
||||
} catch (e) {}
|
||||
uni.reLaunch({
|
||||
url: "/subPackages/user/login/index"
|
||||
})
|
||||
} catch (e) {
|
||||
uni.reLaunch({
|
||||
url: "/subPackages/user/login/index"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 检查业务状态码
|
||||
|
||||
@@ -71,10 +71,6 @@ function getI18nInstance() {
|
||||
// 每次都重新读取当前语言
|
||||
const currentLang = getSavedLanguage()
|
||||
|
||||
console.log('=== getI18nInstance 被调用 ===')
|
||||
console.log('缓存中的语言:', currentLang)
|
||||
console.log('当前 i18n 实例存在?', !!i18nInstance)
|
||||
console.log('当前 i18n.global.locale:', i18nInstance?.global?.locale)
|
||||
|
||||
// 检查是否需要更新语言
|
||||
if (i18nInstance && i18nInstance.global.locale !== currentLang) {
|
||||
@@ -85,18 +81,11 @@ function getI18nInstance() {
|
||||
// 直接更新 locale(这应该会触发所有组件重新渲染)
|
||||
i18nInstance.global.locale = currentLang
|
||||
|
||||
console.log('i18n.global.locale 已更新为:', i18nInstance.global.locale)
|
||||
console.log('测试翻译 (common.loading):', i18nInstance.global.t('common.loading'))
|
||||
console.log('测试翻译 (home.title):', i18nInstance.global.t('home.title'))
|
||||
console.log('===================================')
|
||||
|
||||
return i18nInstance
|
||||
}
|
||||
|
||||
// 首次创建实例
|
||||
if (!i18nInstance) {
|
||||
console.log('=== 首次创建 i18n 实例 ===')
|
||||
|
||||
i18nInstance = createI18n({
|
||||
legacy: true, // 使用 Legacy API 模式,支持全局 $t
|
||||
locale: currentLang,
|
||||
@@ -110,20 +99,12 @@ function getI18nInstance() {
|
||||
silentFallbackWarn: true
|
||||
})
|
||||
|
||||
console.log('i18n 实例已创建,语言:', currentLang)
|
||||
console.log('测试翻译 (common.loading):', i18nInstance.global.t('common.loading'))
|
||||
console.log('测试翻译 (home.title):', i18nInstance.global.t('home.title'))
|
||||
console.log('============================')
|
||||
}
|
||||
|
||||
return i18nInstance
|
||||
}
|
||||
|
||||
export function createApp() {
|
||||
console.log('========================================')
|
||||
console.log('=== createApp 被调用 ===')
|
||||
console.log('时间戳:', new Date().toLocaleTimeString())
|
||||
console.log('========================================')
|
||||
|
||||
const app = createSSRApp(App)
|
||||
|
||||
@@ -153,13 +134,6 @@ export function createApp() {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('=== Vue 3 应用创建完成 ===')
|
||||
console.log('最终 locale:', i18n.global.locale)
|
||||
console.log('app.config.globalProperties.$t 存在?', !!app.config.globalProperties.$t)
|
||||
console.log('app.config.globalProperties.$i18n 存在?', !!app.config.globalProperties.$i18n)
|
||||
console.log('测试 $t 调用:', i18n.global.t('common.loading'))
|
||||
console.log('===========================')
|
||||
|
||||
return {
|
||||
app
|
||||
}
|
||||
|
||||
+4
-3
@@ -93,9 +93,10 @@
|
||||
}
|
||||
},
|
||||
"router" : {
|
||||
"mode" : "hash",
|
||||
"base" : "./"
|
||||
}
|
||||
"mode" : "history",
|
||||
"base" : "/"
|
||||
},
|
||||
"title" : "FDZPower"
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
|
||||
@@ -61,6 +61,12 @@
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "toProgram",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
|
||||
+5
-10
@@ -181,7 +181,6 @@
|
||||
|
||||
// 生命周期 onLoad 钩子
|
||||
onLoad(async (options) => {
|
||||
console.log('options', options)
|
||||
|
||||
// 普通链接二维码进入时,参数通常在 options.q(且为编码后的完整 URL)
|
||||
if (!options.deviceNo && options.q) {
|
||||
@@ -232,11 +231,6 @@
|
||||
isAlipayMiniProgram.value = false
|
||||
isH5.value = true
|
||||
// #endif
|
||||
console.log('当前运行环境:', {
|
||||
isWechatMiniProgram: isWechatMiniProgram.value,
|
||||
isAlipayMiniProgram: isAlipayMiniProgram.value,
|
||||
isH5: isH5.value
|
||||
})
|
||||
await checkUserPhone()
|
||||
await fetchDeviceInfo()
|
||||
})
|
||||
@@ -366,7 +360,7 @@
|
||||
const fetchDeviceInfo = async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
console.log(deviceId.value);
|
||||
// console.log(deviceId.value);
|
||||
const res = await getDeviceInfo(deviceId.value)
|
||||
if (res.code == 200) {
|
||||
deviceInfo.value = res.data.device || {}
|
||||
@@ -404,9 +398,10 @@
|
||||
}
|
||||
}
|
||||
}else{
|
||||
uni.reLaunch({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
|
||||
// uni.reLaunch({
|
||||
// url:'/pages/index/index'
|
||||
// })
|
||||
}
|
||||
}catch(error){
|
||||
console.error('获取设备信息失败:', error)
|
||||
|
||||
+43
-25
@@ -21,18 +21,18 @@
|
||||
<!-- 全屏地图组件 -->
|
||||
<!-- 支付宝小程序使用专用组件 -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<MapComponentAlipay v-if="!isLoading && userLocation && !locationPermissionDenied" ref="mapRef" :userLocation="userLocation"
|
||||
:positionList="positionList" :filteredPositions="filteredPositions" :searchKeyword="searchKeyword"
|
||||
:enableMarkers="true" :bannerImages="bannerImages"
|
||||
<MapComponentAlipay v-if="!isLoading && userLocation && !locationPermissionDenied" ref="mapRef"
|
||||
:userLocation="userLocation" :positionList="positionList" :filteredPositions="filteredPositions"
|
||||
:searchKeyword="searchKeyword" :enableMarkers="true" :bannerImages="bannerImages"
|
||||
:hideMapOverlays="showGuidePopup || showNoticePopup || showActivityPopup" @relocate="handleRelocate"
|
||||
@scan="handleScan" @showList="showLocationList" @markerTap="selectPosition"
|
||||
@mapCenterChange="onMapCenterChange" @bannerClick="handleBannerClick" @guide="openGuidePopup" />
|
||||
<!-- #endif -->
|
||||
<!-- 非支付宝小程序使用通用组件 -->
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<MapComponent v-if="!isLoading && userLocation && !locationPermissionDenied" ref="mapRef" :userLocation="userLocation"
|
||||
:positionList="positionList" :filteredPositions="filteredPositions" :searchKeyword="searchKeyword"
|
||||
:enableMarkers="true" :bannerImages="bannerImages"
|
||||
<MapComponent v-if="!isLoading && userLocation && !locationPermissionDenied" ref="mapRef"
|
||||
:userLocation="userLocation" :positionList="positionList" :filteredPositions="filteredPositions"
|
||||
:searchKeyword="searchKeyword" :enableMarkers="true" :bannerImages="bannerImages"
|
||||
:hideMapOverlays="showGuidePopup || showNoticePopup || showActivityPopup" @relocate="handleRelocate"
|
||||
@scan="handleScan" @showList="showLocationList" @markerTap="selectPosition"
|
||||
@mapCenterChange="onMapCenterChange" @bannerClick="handleBannerClick" @guide="openGuidePopup" />
|
||||
@@ -125,13 +125,8 @@
|
||||
|
||||
<!-- 支付宝:先授权 phoneNumber,再调用 my.getPhoneNumber,上报后端解密并校验一致性 -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<button
|
||||
class="auth-btn"
|
||||
open-type="getAuthorize"
|
||||
scope="phoneNumber"
|
||||
@getAuthorize="onAliAuthorizePhoneNumber"
|
||||
@error="onAliAuthorizePhoneNumberError"
|
||||
>
|
||||
<button class="auth-btn" open-type="getAuthorize" scope="phoneNumber"
|
||||
@getAuthorize="onAliAuthorizePhoneNumber" @error="onAliAuthorizePhoneNumberError">
|
||||
<text>{{ $t('auth.getPhoneNumber') }}</text>
|
||||
</button>
|
||||
<!-- #endif -->
|
||||
@@ -314,11 +309,15 @@
|
||||
const navbarStyle = computed(() => {
|
||||
// #ifdef MP-ALIPAY
|
||||
// 支付宝小程序:不设置 paddingTop
|
||||
return { paddingTop: '0px' }
|
||||
return {
|
||||
paddingTop: '0px'
|
||||
}
|
||||
// #endif
|
||||
// #ifndef MP-ALIPAY
|
||||
// 非支付宝小程序:设置 statusBarHeight
|
||||
return { paddingTop: statusBarHeight.value + 'px' }
|
||||
return {
|
||||
paddingTop: statusBarHeight.value + 'px'
|
||||
}
|
||||
// #endif
|
||||
})
|
||||
|
||||
@@ -326,21 +325,29 @@
|
||||
const topInfoSectionStyle = computed(() => {
|
||||
// #ifdef MP-ALIPAY
|
||||
// 支付宝小程序:使用 paddingTop
|
||||
return { top: ( navBarHeight.value) + 'px' }
|
||||
return {
|
||||
top: (navBarHeight.value) + 'px'
|
||||
}
|
||||
// #endif
|
||||
// #ifndef MP-ALIPAY
|
||||
// 非支付宝小程序:使用 top
|
||||
return { top: (statusBarHeight.value + navBarHeight.value) + 'px' }
|
||||
return {
|
||||
top: (statusBarHeight.value + navBarHeight.value) + 'px'
|
||||
}
|
||||
// #endif
|
||||
})
|
||||
|
||||
// 主内容区域样式:不同端适配不同的 paddingTop
|
||||
const mainContentStyle = computed(() => {
|
||||
// #ifdef MP-ALIPAY
|
||||
return { paddingTop: (navBarHeight.value + noticeHeight.value) + 'px' }
|
||||
return {
|
||||
paddingTop: (navBarHeight.value + noticeHeight.value) + 'px'
|
||||
}
|
||||
// #endif
|
||||
// #ifndef MP-ALIPAY
|
||||
return { paddingTop: (statusBarHeight.value + navBarHeight.value + noticeHeight.value) + 'px' }
|
||||
return {
|
||||
paddingTop: (statusBarHeight.value + navBarHeight.value + noticeHeight.value) + 'px'
|
||||
}
|
||||
// #endif
|
||||
})
|
||||
|
||||
@@ -372,7 +379,7 @@
|
||||
`${k}=${encodeURIComponent(current.options[k])}`).join('&') : ''
|
||||
const redirect = encodeURIComponent(query ? `${route}?${query}` : route)
|
||||
uni.reLaunch({
|
||||
url: `/subPackages/user/login/index?redirect=${redirect}`
|
||||
url: redirect
|
||||
})
|
||||
} catch (e) {
|
||||
uni.reLaunch({
|
||||
@@ -1336,19 +1343,25 @@
|
||||
uni.navigateBack({
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({ url });
|
||||
uni.navigateTo({
|
||||
url
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({ url });
|
||||
uni.navigateTo({
|
||||
url
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
if (deviceInfo.feeConfig) {
|
||||
try {
|
||||
const feeConfig = JSON.parse(deviceInfo.feeConfig)
|
||||
closeScanPageAndNavigate(`/pages/device/detail?deviceNo=${deviceNo}&feeConfig=${encodeURIComponent(deviceInfo.feeConfig)}`);
|
||||
closeScanPageAndNavigate(
|
||||
`/pages/device/detail?deviceNo=${deviceNo}&feeConfig=${encodeURIComponent(deviceInfo.feeConfig)}`
|
||||
);
|
||||
} catch (e) {
|
||||
closeScanPageAndNavigate(`/pages/device/detail?deviceNo=${deviceNo}`);
|
||||
}
|
||||
@@ -1435,7 +1448,9 @@
|
||||
// #ifdef MP-ALIPAY
|
||||
try {
|
||||
console.log('[ALIPAY] getAuthorize(phoneNumber) event:', e)
|
||||
uni.showLoading({ title: t('common.processing') })
|
||||
uni.showLoading({
|
||||
title: t('common.processing')
|
||||
})
|
||||
const res = await getAlipayUserPhoneNumber()
|
||||
const aliPhone = res?.data?.phoneNumber || res?.data?.phone || res?.phoneNumber || ''
|
||||
if (!aliPhone) {
|
||||
@@ -1453,7 +1468,10 @@
|
||||
}
|
||||
|
||||
// 缓存本次校验结果(避免每次扫码都弹)
|
||||
uni.setStorageSync('alipay_phone_verified', { phone: aliPhone, ts: Date.now() })
|
||||
uni.setStorageSync('alipay_phone_verified', {
|
||||
phone: aliPhone,
|
||||
ts: Date.now()
|
||||
})
|
||||
|
||||
showPhoneAuthPopup.value = false
|
||||
if (pendingScan.value) {
|
||||
|
||||
@@ -182,7 +182,9 @@
|
||||
if (opts && opts.redirect) {
|
||||
try {
|
||||
redirect.value = decodeURIComponent(opts.redirect)
|
||||
} catch (_) {}
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
}
|
||||
// #ifdef H5
|
||||
isHTML5.value = true
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<view class="my-page">
|
||||
<view class="user-card" @click="navigateTo('/subPackages/user/userProfile/index')">
|
||||
<view class="avatar-box">
|
||||
<image class="avatar" v-if="userInfo.avatar" :src="userInfo.avatar" mode="aspectFill" lazy-load="true"></image>
|
||||
<image class="avatar" v-if="userInfo.avatar" :src="userInfo.avatar" mode="aspectFill" lazy-load="true">
|
||||
</image>
|
||||
<image v-else class="avatar" src="@/static/head.png" mode="aspectFill" lazy-load="true"></image>
|
||||
</view>
|
||||
<view class="user-text">
|
||||
@@ -29,7 +30,8 @@
|
||||
<swiper class="banner-swiper" :indicator-dots="bannerImages.length > 1"
|
||||
:autoplay="bannerImages.length > 1" :circular="true" :interval="3000">
|
||||
<swiper-item v-for="(image, index) in bannerImages" :key="index">
|
||||
<image class="banner-image" :src="image" mode="aspectFill" @click="handleBannerClick(index)" lazy-load="true">
|
||||
<image class="banner-image" :src="image" mode="aspectFill" @click="handleBannerClick(index)"
|
||||
lazy-load="true">
|
||||
</image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
@@ -78,7 +80,8 @@
|
||||
</view>
|
||||
<view class="list-item" @click="navigateTo('/subPackages/service/help/index')">
|
||||
<view class="left">
|
||||
<image class="icon" src="/static/customer-service.png" mode="aspectFit" lazy-load="true"></image>
|
||||
<image class="icon" src="/static/customer-service.png" mode="aspectFit" lazy-load="true">
|
||||
</image>
|
||||
<text class="title">{{ $t('user.customerService') }}</text>
|
||||
</view>
|
||||
<uv-icon name="arrow-right" size="16" color="#c8c8c8"></uv-icon>
|
||||
@@ -118,9 +121,11 @@
|
||||
|
||||
<view class="footer-agreements">
|
||||
<view class="link-box">
|
||||
<text class="link" @click="navigateTo('/subPackages/other/legal/agreement')">{{ $t('user.userAgreement') }}</text>
|
||||
<text class="link"
|
||||
@click="navigateTo('/subPackages/other/legal/agreement')">{{ $t('user.userAgreement') }}</text>
|
||||
<text class="sep">|</text>
|
||||
<text class="link" @click="navigateTo('/subPackages/other/legal/privacy')">{{ $t('user.privacyPolicy') }}</text>
|
||||
<text class="link"
|
||||
@click="navigateTo('/subPackages/other/legal/privacy')">{{ $t('user.privacyPolicy') }}</text>
|
||||
</view>
|
||||
<view class="version">{{ $t('user.version') }}{{ appVersion }}</view>
|
||||
</view>
|
||||
@@ -267,7 +272,7 @@
|
||||
uni.setNavigationBarTitle({
|
||||
title: t('user.personalCenter')
|
||||
})
|
||||
getInfo();
|
||||
// getInfo();
|
||||
initVersion();
|
||||
getBannerImages(); // 加载广告
|
||||
});
|
||||
@@ -340,11 +345,12 @@
|
||||
const query = current && current.options ? Object.keys(current.options).map(k =>
|
||||
`${k}=${encodeURIComponent(current.options[k])}`).join('&') : ''
|
||||
const redirect = encodeURIComponent(query ? `${route}?${query}` : route)
|
||||
uni.reLaunch({
|
||||
url: `/subPackages/user/login/index?redirect=${redirect}`
|
||||
console.log(redirect);
|
||||
uni.redirectTo({
|
||||
url: redirect
|
||||
})
|
||||
} catch (e) {
|
||||
uni.reLaunch({
|
||||
uni.redirectTo({
|
||||
url: '/subPackages/user/login/index'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -45,8 +45,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserInfo } from '@/util/index.js'
|
||||
import { URL } from '@/config/url'
|
||||
import {
|
||||
getUserInfo
|
||||
} from '@/util/index.js'
|
||||
import {
|
||||
URL
|
||||
} from '@/config/url'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -74,11 +78,17 @@ export default {
|
||||
const pages = getCurrentPages()
|
||||
const current = pages && pages.length ? pages[pages.length - 1] : null
|
||||
const route = current && current.route ? ('/' + current.route) : '/pages/index/index'
|
||||
const query = current && current.options ? Object.keys(current.options).map(k => `${k}=${encodeURIComponent(current.options[k])}`).join('&') : ''
|
||||
const query = current && current.options ? Object.keys(current.options).map(k =>
|
||||
`${k}=${encodeURIComponent(current.options[k])}`).join('&') : ''
|
||||
const redirect = encodeURIComponent(query ? `${route}?${query}` : route)
|
||||
uni.reLaunch({ url: `/subPackages/user/login/index?redirect=${redirect}` })
|
||||
console.log(redirect);
|
||||
uni.reLaunch({
|
||||
url: redirect
|
||||
})
|
||||
} catch (e) {
|
||||
uni.reLaunch({ url: '/subPackages/user/login/index' })
|
||||
uni.reLaunch({
|
||||
url: '/subPackages/user/login/index'
|
||||
})
|
||||
}
|
||||
} else if (res.code === 200) {
|
||||
this.userInfo = res.data
|
||||
@@ -92,7 +102,9 @@ export default {
|
||||
}
|
||||
},
|
||||
navigateTo(url) {
|
||||
uni.navigateTo({ url })
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
},
|
||||
handleLogout() {
|
||||
uni.showModal({
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<view class="profile-page">
|
||||
<view class="avatar-section">
|
||||
<view class="avatar-container">
|
||||
<image class="avatar" v-if="userInfo.avatar" :src="userInfo.avatar" mode="aspectFill" lazy-load="true"></image>
|
||||
<image class="avatar" v-if="userInfo.avatar" :src="userInfo.avatar" mode="aspectFill" lazy-load="true">
|
||||
</image>
|
||||
<image v-else class="avatar" src="@/static/head.png" mode="aspectFill" lazy-load="true"></image>
|
||||
<!-- 覆盖在头像上的微信选择头像授权按钮,仅小程序生效 -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
@@ -27,13 +28,8 @@
|
||||
|
||||
<!-- 昵称编辑输入框(展开状态) -->
|
||||
<view class="nickname-edit-area" v-if="isEditingNickname">
|
||||
<input
|
||||
class="nickname-input"
|
||||
v-model="newNickname"
|
||||
:placeholder="$t('userProfile.enterNickname')"
|
||||
maxlength="20"
|
||||
:focus="true"
|
||||
/>
|
||||
<input class="nickname-input" v-model="newNickname" :placeholder="$t('userProfile.enterNickname')"
|
||||
maxlength="20" :focus="true" />
|
||||
<view class="edit-buttons">
|
||||
<button class="cancel-btn" @click="cancelEditNickname">{{ $t('common.cancel') }}</button>
|
||||
<button class="save-btn" @click="saveNickname">{{ $t('common.save') }}</button>
|
||||
@@ -43,7 +39,8 @@
|
||||
<view class="form-item">
|
||||
<view class="label">{{ $t('userProfile.phone') }}</view>
|
||||
<view class="value">
|
||||
<text class="value-text">{{ userInfo.phone ? maskPhone(userInfo.phone) : $t('userProfile.notBound') }}</text>
|
||||
<text
|
||||
class="value-text">{{ userInfo.phone ? maskPhone(userInfo.phone) : $t('userProfile.notBound') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -58,11 +55,23 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { getMyIndexInfo, uploadUserAvatar, updateUserInfo } from '@/config/api/user.js';
|
||||
import { useI18n } from '@/utils/i18n.js'
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted
|
||||
} from 'vue';
|
||||
import {
|
||||
getMyIndexInfo,
|
||||
uploadUserAvatar,
|
||||
updateUserInfo
|
||||
} from '@/config/api/user.js';
|
||||
import {
|
||||
useI18n
|
||||
} from '@/utils/i18n.js'
|
||||
|
||||
const { t } = useI18n()
|
||||
const {
|
||||
t
|
||||
} = useI18n()
|
||||
|
||||
// 响应式状态
|
||||
const userInfo = ref({
|
||||
@@ -121,7 +130,7 @@ const redirectToLogin = () => {
|
||||
`${k}=${encodeURIComponent(current.options[k])}`).join('&') : '';
|
||||
const redirect = encodeURIComponent(query ? `${route}?${query}` : route);
|
||||
uni.reLaunch({
|
||||
url: `/subPackages/user/login/index?redirect=${redirect}`
|
||||
url: redirect
|
||||
});
|
||||
} catch (e) {
|
||||
uni.reLaunch({
|
||||
@@ -301,6 +310,7 @@ function maskPhone(phone) {
|
||||
opacity: 0;
|
||||
border-radius: 80rpx;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
.avatar-tip {
|
||||
@@ -368,6 +378,7 @@ function maskPhone(phone) {
|
||||
opacity: 0;
|
||||
transform: translateY(-20rpx);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
@@ -415,4 +426,3 @@ function maskPhone(phone) {
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import { onMounted } from 'vue';
|
||||
|
||||
onLoad((options) => {
|
||||
let deviceNo;
|
||||
if (options) {
|
||||
deviceNo = options.deviceNo;
|
||||
uni.reLaunch({
|
||||
url: `/pages/device/detail?deviceNo=${deviceNo}`
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// onMounted((options)=>{
|
||||
// let deviceNo;
|
||||
// if (options) {
|
||||
// deviceNo = options.deviceNo;
|
||||
// uni.reLaunch({
|
||||
// url: `/pages/device/detail?deviceNo=${deviceNo}`
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user