Commit 93b62ee1 authored by youjie's avatar youjie

no message

parent c67f19ad
...@@ -243,6 +243,9 @@ export default { ...@@ -243,6 +243,9 @@ export default {
discount: '折', discount: '折',
noCoupon: '暂无优惠券', noCoupon: '暂无优惠券',
noCollection: '暂无收藏', noCollection: '暂无收藏',
photoSize: '图片大小不能超过{size}MB',
uploadComplete: '图片上传完成',
uploadFailed: '上传失败',
}, },
// HTTP 错误状态码 // HTTP 错误状态码
httpError: { httpError: {
......
<template>
<div class="fixed-center text-center">
<p>
<img
src="~assets/sad.svg"
style="width:30vw;max-width:150px;"
>
</p>
<p class="text-faded">
Sorry, nothing here...<strong>(404)</strong>
</p>
<q-btn
color="secondary"
style="width:200px;"
to="/"
label="Go back"
/>
</div>
</template>
<script >
</script>
...@@ -218,9 +218,10 @@ const loginWithLine = () => { ...@@ -218,9 +218,10 @@ const loginWithLine = () => {
} }
// line登录 // line登录
const useLineLogin = async(code:string) => { const useLineLogin = async(code:string) => {
const redirectUri = window.location.origin+window.location.pathname
loading.value = true loading.value = true
try { try {
const response = await userStore.setUserLineLoginAsync(loginMsg.tenantId?.toString() || '', code, loginMsg.distributorId,loginMsg.parentId,loginMsg.redirectUri) const response = await userStore.setUserLineLoginAsync(loginMsg.tenantId?.toString() || '', code, loginMsg.distributorId,loginMsg.parentId,redirectUri)
if (response.status == 'SUCCESS') { if (response.status == 'SUCCESS') {
userStore.setLoginType(loginMsg.reType || 0) userStore.setLoginType(loginMsg.reType || 0)
Message.success(t('login.loginSuccess')) Message.success(t('login.loginSuccess'))
......
...@@ -238,9 +238,10 @@ const loginWithLine = () => { ...@@ -238,9 +238,10 @@ const loginWithLine = () => {
} }
// line绑定 // line绑定
const useLineBind = async(code:string) => { const useLineBind = async(code:string) => {
loading.value = true const redirectUri = window.location.origin+window.location.pathname
loading.value = true
try { try {
const response = await userStore.setUserLineBindAsync(systemConfig.tenantId?.toString() || '', code, systemConfig.distributorId,null,'') const response = await userStore.setUserLineBindAsync(systemConfig.tenantId?.toString() || '', code, systemConfig.distributorId,null,redirectUri)
if (response.status == 'SUCCESS') { if (response.status == 'SUCCESS') {
Message.success(t('personal.bindWechatSuccess')) Message.success(t('personal.bindWechatSuccess'))
getPersonalInfor() getPersonalInfor()
......
...@@ -97,7 +97,24 @@ ...@@ -97,7 +97,24 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"></a-col> <a-col :span="8">
<a-form-item field="wechatId" :label="t('login.bindingWechat')" required>
<a-input class="formData-input !w-[289px] mr-[30px]"
v-model="formData.wechatId"
size="large"
:placeholder="t('login.lineIdOrWechat')">
</a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item field="lineId" label="Line" required>
<a-input class="formData-input !w-[289px] mr-[30px]"
v-model="formData.lineId"
size="large"
:placeholder="t('login.lineIdOrWechat')">
</a-input>
</a-form-item>
</a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item field="phoneCode" :label="t('login.phoneCode')"> <a-form-item field="phoneCode" :label="t('login.phoneCode')">
<a-select class="formData-input !w-[289px] mr-[30px]" <a-select class="formData-input !w-[289px] mr-[30px]"
...@@ -197,11 +214,11 @@ const AreaCodeList = ref([]) ...@@ -197,11 +214,11 @@ const AreaCodeList = ref([])
const genderOptions = ref([ const genderOptions = ref([
{ {
label: t('ORDER.GENDER_MALE'), label: t('ORDER.GENDER_MALE'),
value: 'MALE' value: 1
}, },
{ {
label: t('ORDER.GENDER_FEMALE'), label: t('ORDER.GENDER_FEMALE'),
value: 'FEMALE' value: 2
}, },
]) ])
const tenantId = systemConfigStore.tenantId const tenantId = systemConfigStore.tenantId
...@@ -216,6 +233,7 @@ const formData = reactive({ ...@@ -216,6 +233,7 @@ const formData = reactive({
residentialArea: null as any,//国籍 residentialArea: null as any,//国籍
sex: null as any,//性别 1男 2女 sex: null as any,//性别 1男 2女
wechatId: null as any,//微信ID wechatId: null as any,//微信ID
lineId: null as any,//微信ID
}) })
...@@ -262,7 +280,7 @@ const getPersonalInfor = async () => { ...@@ -262,7 +280,7 @@ const getPersonalInfor = async () => {
const validateFileSize = (file: File): boolean => { const validateFileSize = (file: File): boolean => {
const sizeMB = file.size / 1024 / 1024 const sizeMB = file.size / 1024 / 1024
if (sizeMB > maxSize) { if (sizeMB > maxSize) {
Message.error(`图片大小不能超过 ${maxSize}MB`) Message.error(t('personal.photoSize', { size: maxSize }))
return false return false
} }
return true return true
...@@ -271,7 +289,7 @@ const validateFileSize = (file: File): boolean => { ...@@ -271,7 +289,7 @@ const validateFileSize = (file: File): boolean => {
// 处理图片预览 // 处理图片预览
const handlePreview = (fileItem: FileItem) => { const handlePreview = (fileItem: FileItem) => {
if (!fileItem.url) { if (!fileItem.url) {
Message.warning('图片还未上传完成') Message.warning(t('personal.uploadComplete'))
return return
} }
previewUrl.value = fileItem.url previewUrl.value = fileItem.url
...@@ -315,11 +333,11 @@ const uploadFile = async (fileItem: FileItem) => { ...@@ -315,11 +333,11 @@ const uploadFile = async (fileItem: FileItem) => {
formData.photo = url formData.photo = url
} else { } else {
fileItem.status = 'error' fileItem.status = 'error'
Message.error('上传失败') Message.error(t('personal.uploadFailed'))
} }
} catch (error) { } catch (error) {
fileItem.status = 'error' fileItem.status = 'error'
Message.error('上传失败') Message.error(t('personal.uploadFailed'))
console.error('上传失败:', error) console.error('上传失败:', error)
} }
} }
...@@ -350,6 +368,10 @@ const verification = () => { ...@@ -350,6 +368,10 @@ const verification = () => {
if (msg==''&&(formData.name==''||!formData.name||userInfor.value.surName==''||!formData.surName)) { if (msg==''&&(formData.name==''||!formData.name||userInfor.value.surName==''||!formData.surName)) {
msg = t('login.pleaseComplete') msg = t('login.pleaseComplete')
} }
if (msg==''&&(formData.lineId==''||!formData.lineId)
&&(userInfor.value.wechatId==''||!formData.wechatId)) {
msg = t('login.lineIdOrWechat')
}
return msg return msg
} }
...@@ -384,7 +406,6 @@ const getUserDetail = async () => { ...@@ -384,7 +406,6 @@ const getUserDetail = async () => {
formData.name = response.name || '' formData.name = response.name || ''
formData.surName = response.surName || '' formData.surName = response.surName || ''
formData.birthday = response.birthday || null formData.birthday = response.birthday || null
formData.isReceivePush = response.isReceivePush || null
formData.lineId = response.lineId || null formData.lineId = response.lineId || null
formData.phone = response.phone || null formData.phone = response.phone || null
formData.phoneCode = response.phoneCode || null formData.phoneCode = response.phoneCode || null
......
...@@ -194,11 +194,11 @@ const loading = ref(true) ...@@ -194,11 +194,11 @@ const loading = ref(true)
const genderOptions = ref([ const genderOptions = ref([
{ {
label: t('ORDER.GENDER_MALE'), label: t('ORDER.GENDER_MALE'),
value: 'MALE' value: 1
}, },
{ {
label: t('ORDER.GENDER_FEMALE'), label: t('ORDER.GENDER_FEMALE'),
value: 'FEMALE' value: 2
}, },
]) ])
const formData = reactive({ const formData = reactive({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment