From fa7e637363cfcd7c909e9a54e8addcbc50f41c8c Mon Sep 17 00:00:00 2001 From: zhangxingye <892562066@qq.com> Date: Sat, 22 Feb 2025 17:53:03 +0800 Subject: [PATCH] 1.5.0 --- .../components/area-select/area-select.vue | 27 +- .../components/bind-mobile/bind-mobile.vue | 42 ++- .../information-filling.vue | 147 ++++++---- .../mescroll-uni/components/mescroll-down.vue | 47 --- .../mescroll-uni/components/mescroll-up.vue | 39 --- .../mescroll-uni/mixins/mescroll-comp.js | 47 --- .../mescroll-uni/mixins/mescroll-more-item.js | 66 ----- .../mescroll-uni/mixins/mescroll-more.js | 74 ----- .../src/components/nc-contact/nc-contact.vue | 1 - .../components/select-date/select-date.vue | 2 +- .../components/share-popup/share-popup.vue | 237 +++++++++++++++ uni-app/src/components/sow-show/sow-show.vue | 59 ++++ uni-app/src/components/tabbar/tabbar.vue | 111 ++++--- .../src/components/top-tabbar/top-tabbar.vue | 60 ++-- uni-app/src/hooks/useDiy.ts | 42 +-- uni-app/src/hooks/useDiyForm.ts | 277 ++++++++++++++++++ uni-app/src/hooks/useLogin.ts | 34 ++- uni-app/src/locale/zh-Hans.json | 102 +++++-- uni-app/src/locale/zh-Hans/common.json | 243 ++++++++------- 19 files changed, 1070 insertions(+), 587 deletions(-) delete mode 100644 uni-app/src/components/mescroll/mescroll-uni/components/mescroll-down.vue delete mode 100644 uni-app/src/components/mescroll/mescroll-uni/components/mescroll-up.vue delete mode 100644 uni-app/src/components/mescroll/mescroll-uni/mixins/mescroll-comp.js delete mode 100644 uni-app/src/components/mescroll/mescroll-uni/mixins/mescroll-more-item.js delete mode 100644 uni-app/src/components/mescroll/mescroll-uni/mixins/mescroll-more.js create mode 100644 uni-app/src/components/share-popup/share-popup.vue create mode 100644 uni-app/src/components/sow-show/sow-show.vue create mode 100644 uni-app/src/hooks/useDiyForm.ts diff --git a/uni-app/src/components/area-select/area-select.vue b/uni-app/src/components/area-select/area-select.vue index a072d610e..675f727aa 100644 --- a/uni-app/src/components/area-select/area-select.vue +++ b/uni-app/src/components/area-select/area-select.vue @@ -2,7 +2,6 @@ 请选择地区 - {{ selected.province.name }} @@ -40,14 +39,14 @@ - \ No newline at end of file + diff --git a/uni-app/src/components/bind-mobile/bind-mobile.vue b/uni-app/src/components/bind-mobile/bind-mobile.vue index 5c69905a9..2335e4e49 100644 --- a/uni-app/src/components/bind-mobile/bind-mobile.vue +++ b/uni-app/src/components/bind-mobile/bind-mobile.vue @@ -13,7 +13,7 @@ + @@ -41,9 +41,11 @@ import { ref, reactive, computed, onMounted } from 'vue' import { t } from '@/locale' import { bindMobile } from '@/app/api/member' + import { mobileLogin } from '@/app/api/auth' import useMemberStore from '@/stores/member' import useConfigStore from '@/stores/config' import { redirect } from '@/utils/common' + import { useLogin } from '@/hooks/useLogin' const show = ref(false) const memberStore = useMemberStore() @@ -64,15 +66,17 @@ const real_name_input = ref(true); onMounted(() => { - // 防止浏览器自动填充 - setTimeout(()=>{ - real_name_input.value = false; - },800) + // 防止浏览器自动填充 + setTimeout(() => { + real_name_input.value = false; + }, 800) - uni.getStorageSync('openid') && (Object.assign(formData, { openid: uni.getStorageSync('openid') })) uni.getStorageSync('pid') && (Object.assign(formData, { pid: uni.getStorageSync('pid') })) + uni.getStorageSync('openid') && (Object.assign(formData, { openid: uni.getStorageSync('openid') })) uni.getStorageSync('unionid') && (Object.assign(formData, { unionid: uni.getStorageSync('unionid') })) - }); + uni.getStorageSync('nickname') && (Object.assign(formData, { nickname: uni.getStorageSync('nickname') })) + uni.getStorageSync('avatar') && (Object.assign(formData, { headimg: uni.getStorageSync('avatar') })) + }); const rules = { 'mobile': [ @@ -84,8 +88,7 @@ }, { validator(rule: any, value: any, callback: any) { - let mobile = /^1[3-9]\d{9}$/; - if (!mobile.test(value)){ + if (!uni.$u.test.mobile(value)){ callback(new Error('请输入正确的手机号')) } else { callback() @@ -115,14 +118,21 @@ uni.showToast({ title: t('isAgreeTips'), icon: 'none' }) return } - + if (loading.value) return loading.value = true - bindMobile(formData).then((res) => { - memberStore.getMemberInfo() - if(info.value.mobile){ - uni.removeStorageSync('isbindmobile'); + const request = info.value ? bindMobile : mobileLogin; + + request(formData).then((res: any) => { + if (info.value) { + memberStore.getMemberInfo() + if (info.value.mobile) { + uni.removeStorageSync('isbindmobile'); + } + } else { + memberStore.setToken(res.data.token) + useLogin().handleLoginBack() } show.value = false }).catch(() => { @@ -134,7 +144,7 @@ const open = ()=> { show.value = true } - + defineExpose({ open }) @@ -148,4 +158,4 @@ :deep(.u-checkbox){ margin:0 !important; } - \ No newline at end of file + diff --git a/uni-app/src/components/information-filling/information-filling.vue b/uni-app/src/components/information-filling/information-filling.vue index a0b47a85b..2d96ee1cc 100644 --- a/uni-app/src/components/information-filling/information-filling.vue +++ b/uni-app/src/components/information-filling/information-filling.vue @@ -1,33 +1,41 @@