wui-components-v2 1.1.69 → 1.1.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/core/index.ts +74 -74
- package/api/feishu.ts +20 -20
- package/api/index.ts +4 -4
- package/api/login.ts +51 -51
- package/api/menu.ts +45 -45
- package/api/page.ts +114 -114
- package/api/sys.ts +12 -12
- package/api/tree.ts +28 -28
- package/components/action-popup/action-popup.vue +116 -116
- package/components/add-address-list/add-address-list.vue +187 -187
- package/components/add-address-page/add-address-page.vue +77 -77
- package/components/add-address-page/config.ts +297 -297
- package/components/audio-play/audio-play.vue +220 -220
- package/components/batch-upload-file/batch-upload-file.vue +75 -75
- package/components/card-botom-buttons/card-botom-buttons.vue +279 -279
- package/components/custom-date-picker/custom-date-picker.vue +106 -106
- package/components/custom-select-picker/custom-select-picker.vue +95 -95
- package/components/demo-block/demo-block.vue +63 -63
- package/components/demo-card/demo-card.vue +44 -44
- package/components/detail-popup/detail-popup.vue +99 -99
- package/components/evaluation-page/evaluation-page.vue +196 -196
- package/components/fold-card/fold-card.vue +171 -171
- package/components/form-control/form-control.vue +661 -661
- package/components/global-loading/GlobalLoading.md +366 -366
- package/components/global-loading/global-loading.vue +55 -55
- package/components/global-message/GlobalMessage.md +570 -570
- package/components/global-message/global-message.vue +68 -68
- package/components/global-toast/GlobalToast.md +261 -261
- package/components/global-toast/global-toast.vue +56 -56
- package/components/label-value/label-value.vue +144 -144
- package/components/label-value/open-value-more.vue +56 -56
- package/components/list-top-buttons/list-top-buttons.vue +19 -19
- package/components/loading/loading.vue +5 -5
- package/components/login-form/login-form.vue +126 -126
- package/components/login-form-box/login-form-box.vue +65 -65
- package/components/mulselect-picker/mulselect-picker.vue +86 -86
- package/components/phone-login-form/phone-login-form.vue +204 -204
- package/components/privacy-popup/privacy-popup.vue +191 -191
- package/components/product-card/product-card.vue +201 -201
- package/components/scan-input/scan-input.vue +406 -406
- package/components/search/search.vue +128 -128
- package/components/select-col-picker/select-col-picker.vue +168 -168
- package/components/tab-search/tab-search.vue +73 -73
- package/components/tree-select/components/TreeNode.vue +200 -200
- package/components/tree-select/components/index.vue +471 -471
- package/components/tree-select/components/tree-select.vue +56 -56
- package/components/tree-select/index.vue +93 -93
- package/components/user-choose/user-choose.vue +169 -151
- package/components/video-play/video-play.vue +56 -56
- package/components/wui-auto-update-component/wui-auto-update-component.vue +132 -132
- package/components/wui-default/wui-default.vue +49 -49
- package/components/wui-details-page/wui-details-page.vue +147 -147
- package/components/wui-edit-page/wui-edit-page-copy.vue +757 -757
- package/components/wui-edit-page/wui-edit-page.vue +793 -793
- package/components/wui-enume-select-control/wui-enume-select-control.vue +92 -92
- package/components/wui-list/wui-list.vue +235 -235
- package/components/wui-login/wui-login.vue +43 -43
- package/components/wui-login1/wui-login.vue +41 -41
- package/components/wui-menus/wui-menus-top.vue +137 -137
- package/components/wui-menus/wui-menus-top1.vue +8 -8
- package/components/wui-menus/wui-menus.vue +247 -247
- package/components/wui-menus1/components/banner-carousel.vue +320 -320
- package/components/wui-menus1/components/navbar.vue +43 -43
- package/components/wui-menus1/components/quick-panel.vue +55 -55
- package/components/wui-menus1/components/search-bar.vue +49 -49
- package/components/wui-menus1/components/section-menus.vue +208 -208
- package/components/wui-menus1/wui-menus-top.vue +718 -718
- package/components/wui-menus1/wui-menus-top1.vue +398 -398
- package/components/wui-menus1/wui-menus.vue +564 -564
- package/components/wui-notify-info/notify-handle.vue +53 -53
- package/components/wui-notify-info/wui-notify-info.vue +280 -280
- package/components/wui-scan-binding-sensor/wui-scan-binding-sensor.vue +75 -75
- package/components/wui-search-history-babbar/components/SearchBar.vue +70 -70
- package/components/wui-search-history-babbar/wui-search-history-babbar.vue +204 -204
- package/components/wui-select-list/wui-select-list.vue +310 -310
- package/components/wui-select-popup/wui-select-popup.vue +613 -612
- package/components/wui-system-settings/wui-system-settings.vue +144 -144
- package/components/wui-tabbar/wui-tabbar.vue +106 -106
- package/components/wui-tree-page/components/tree-item.vue +238 -238
- package/components/wui-tree-page/wui-tree-page.vue +297 -297
- package/components/wui-update-component/wui-update-component.vue +221 -221
- package/components/wui-user/wui-user.vue +202 -202
- package/composables/types/theme.ts +65 -65
- package/composables/types/user.ts +5 -5
- package/composables/useColorGenerator.ts +221 -221
- package/composables/useCompanyFieldFilter.ts +91 -91
- package/composables/useEnumes.ts +43 -43
- package/composables/useEventBus.ts +37 -37
- package/composables/useGlobalLoading.ts +47 -47
- package/composables/useGlobalMessage.ts +53 -53
- package/composables/useGlobalToast.ts +63 -63
- package/composables/useLocale.ts +54 -54
- package/composables/useManualTheme.ts +179 -179
- package/composables/useMenus.ts +193 -193
- package/composables/useSectionMenus.ts +120 -120
- package/composables/useTabbar.ts +50 -50
- package/composables/useTheme.ts +74 -74
- package/composables/useUser.ts +24 -24
- package/index.d.ts +90 -90
- package/index.ts +83 -83
- package/package.json +24 -24
- package/static/iconfont/iconfont.css +63 -63
- package/store/language.ts +151 -151
- package/store/manualThemeStore.ts +143 -143
- package/store/persist.ts +41 -41
- package/store/themeStore.ts +74 -74
- package/store/userStore.ts +22 -22
- package/styles/dark-mode.css +523 -523
- package/styles/dark-mode.min.css +1 -1
- package/styles/dark-mode.scss +498 -498
- package/type.ts +154 -154
- package/utils/control-tree.ts +353 -353
- package/utils/control-type-supportor.ts +148 -148
- package/utils/eventBus.ts +36 -36
- package/utils/idata-scan.ts +99 -99
- package/utils/index.ts +979 -979
- package/utils/rsaEncrypt.ts +10 -10
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { defineOptions, defineProps, reactive, ref } from 'vue'
|
|
3
|
-
import { useRouter } from 'uni-mini-router'
|
|
4
|
-
import { useGlobalToast } from '../../composables/useGlobalToast'
|
|
5
|
-
import { getUserConfig, login } from '../../api/login'
|
|
6
|
-
import { useUser } from '../../composables/useUser'
|
|
7
|
-
import { useTabbar } from '../../composables/useTabbar'
|
|
8
|
-
import type { TabbarItem } from '../../composables/useTabbar'
|
|
9
|
-
|
|
10
|
-
defineOptions({
|
|
11
|
-
name: 'LoginForm',
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
const props = defineProps<Props>()
|
|
15
|
-
// 定义 Props 类型
|
|
16
|
-
interface Props {
|
|
17
|
-
tabbarItems: TabbarItem[]
|
|
18
|
-
}
|
|
19
|
-
const subloading = ref(false)
|
|
20
|
-
const router = useRouter()
|
|
21
|
-
const toast = useGlobalToast()
|
|
22
|
-
const { setUserInfo } = useUser()
|
|
23
|
-
const model = reactive<{
|
|
24
|
-
name: string
|
|
25
|
-
password: string
|
|
26
|
-
remember: boolean
|
|
27
|
-
}>({
|
|
28
|
-
name: uni.getStorageSync('USER_NAME') || '',
|
|
29
|
-
password: uni.getStorageSync('USER_PASSWORD') || '',
|
|
30
|
-
remember: uni.getStorageSync('REMEMBER') || false,
|
|
31
|
-
})
|
|
32
|
-
const { setTabbarItemActive } = useTabbar(props.tabbarItems)
|
|
33
|
-
const form = ref()
|
|
34
|
-
|
|
35
|
-
// 提交登录表单
|
|
36
|
-
function handleSubmit() {
|
|
37
|
-
form.value
|
|
38
|
-
.validate()
|
|
39
|
-
.then(async ({ valid, errors }: any) => {
|
|
40
|
-
if (valid) {
|
|
41
|
-
try {
|
|
42
|
-
subloading.value = true
|
|
43
|
-
// 登录
|
|
44
|
-
const res = await login(model.name, model.password)
|
|
45
|
-
|
|
46
|
-
if (res.token) {
|
|
47
|
-
// 保存token
|
|
48
|
-
uni.setStorageSync('TOKEN', res.token)
|
|
49
|
-
// 获取用户配置
|
|
50
|
-
const res1 = await getUserConfig()
|
|
51
|
-
if (res1.status === 'success') {
|
|
52
|
-
// 保存用户信息
|
|
53
|
-
setUserInfo(res1.user)
|
|
54
|
-
|
|
55
|
-
// 记住账号密码
|
|
56
|
-
if (model.remember) {
|
|
57
|
-
uni.setStorageSync('USER_NAME', model.name)
|
|
58
|
-
uni.setStorageSync('USER_PASSWORD', model.password)
|
|
59
|
-
uni.setStorageSync('REMEMBER', model.remember)
|
|
60
|
-
} else {
|
|
61
|
-
// 删除账号密码
|
|
62
|
-
uni.removeStorageSync('USER_NAME')
|
|
63
|
-
uni.removeStorageSync('USER_PASSWORD')
|
|
64
|
-
uni.removeStorageSync('REMEMBER')
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// 跳转首页
|
|
68
|
-
router.pushTab('/pages/index/index')
|
|
69
|
-
setTabbarItemActive('index')
|
|
70
|
-
toast.success({ msg: '登录成功!' })
|
|
71
|
-
}
|
|
72
|
-
} else {
|
|
73
|
-
toast.error({ msg: res.message })
|
|
74
|
-
}
|
|
75
|
-
} catch (error: any) {
|
|
76
|
-
console.log(error, 'error')
|
|
77
|
-
}
|
|
78
|
-
} else {
|
|
79
|
-
toast.error({ msg: '请填写登录信息' })
|
|
80
|
-
console.log(errors, 'errors')
|
|
81
|
-
}
|
|
82
|
-
subloading.value = false
|
|
83
|
-
})
|
|
84
|
-
.catch((error: any) => {
|
|
85
|
-
toast.error({ msg: error })
|
|
86
|
-
console.log(error, 'error')
|
|
87
|
-
})
|
|
88
|
-
}
|
|
89
|
-
</script>
|
|
90
|
-
|
|
91
|
-
<template>
|
|
92
|
-
<view class="bg-white pa-3 dark:bg-[var(--wot-dark-background2)]">
|
|
93
|
-
<!-- //账号登录 -->
|
|
94
|
-
<wd-form ref="form" :model="model">
|
|
95
|
-
<view class="rounded-2 overflow-hidden">
|
|
96
|
-
<wd-cell-group border>
|
|
97
|
-
<wd-input
|
|
98
|
-
v-model="model.name"
|
|
99
|
-
label="用户名"
|
|
100
|
-
label-width="100px"
|
|
101
|
-
prop="name"
|
|
102
|
-
clearable
|
|
103
|
-
placeholder="请输入用户名"
|
|
104
|
-
:rules="[{ required: true, message: '请填写用户名' }]"
|
|
105
|
-
/>
|
|
106
|
-
<wd-input
|
|
107
|
-
v-model="model.password"
|
|
108
|
-
label="密码"
|
|
109
|
-
label-width="100px"
|
|
110
|
-
prop="password"
|
|
111
|
-
clearable
|
|
112
|
-
show-password
|
|
113
|
-
placeholder="请输入密码"
|
|
114
|
-
:rules="[{ required: true, message: '请填写密码' }]"
|
|
115
|
-
/>
|
|
116
|
-
<view class="p-4 pb-0 pt-0 dark:bg-[#1b1b1e]">
|
|
117
|
-
<wd-checkbox v-model="model.remember" shape="square">记住密码</wd-checkbox>
|
|
118
|
-
</view>
|
|
119
|
-
</wd-cell-group>
|
|
120
|
-
</view>
|
|
121
|
-
<view class="p-4">
|
|
122
|
-
<wd-button block :loading="subloading" :round="false" @click="handleSubmit">登录</wd-button>
|
|
123
|
-
</view>
|
|
124
|
-
</wd-form>
|
|
125
|
-
</view>
|
|
126
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineOptions, defineProps, reactive, ref } from 'vue'
|
|
3
|
+
import { useRouter } from 'uni-mini-router'
|
|
4
|
+
import { useGlobalToast } from '../../composables/useGlobalToast'
|
|
5
|
+
import { getUserConfig, login } from '../../api/login'
|
|
6
|
+
import { useUser } from '../../composables/useUser'
|
|
7
|
+
import { useTabbar } from '../../composables/useTabbar'
|
|
8
|
+
import type { TabbarItem } from '../../composables/useTabbar'
|
|
9
|
+
|
|
10
|
+
defineOptions({
|
|
11
|
+
name: 'LoginForm',
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
const props = defineProps<Props>()
|
|
15
|
+
// 定义 Props 类型
|
|
16
|
+
interface Props {
|
|
17
|
+
tabbarItems: TabbarItem[]
|
|
18
|
+
}
|
|
19
|
+
const subloading = ref(false)
|
|
20
|
+
const router = useRouter()
|
|
21
|
+
const toast = useGlobalToast()
|
|
22
|
+
const { setUserInfo } = useUser()
|
|
23
|
+
const model = reactive<{
|
|
24
|
+
name: string
|
|
25
|
+
password: string
|
|
26
|
+
remember: boolean
|
|
27
|
+
}>({
|
|
28
|
+
name: uni.getStorageSync('USER_NAME') || '',
|
|
29
|
+
password: uni.getStorageSync('USER_PASSWORD') || '',
|
|
30
|
+
remember: uni.getStorageSync('REMEMBER') || false,
|
|
31
|
+
})
|
|
32
|
+
const { setTabbarItemActive } = useTabbar(props.tabbarItems)
|
|
33
|
+
const form = ref()
|
|
34
|
+
|
|
35
|
+
// 提交登录表单
|
|
36
|
+
function handleSubmit() {
|
|
37
|
+
form.value
|
|
38
|
+
.validate()
|
|
39
|
+
.then(async ({ valid, errors }: any) => {
|
|
40
|
+
if (valid) {
|
|
41
|
+
try {
|
|
42
|
+
subloading.value = true
|
|
43
|
+
// 登录
|
|
44
|
+
const res = await login(model.name, model.password)
|
|
45
|
+
|
|
46
|
+
if (res.token) {
|
|
47
|
+
// 保存token
|
|
48
|
+
uni.setStorageSync('TOKEN', res.token)
|
|
49
|
+
// 获取用户配置
|
|
50
|
+
const res1 = await getUserConfig()
|
|
51
|
+
if (res1.status === 'success') {
|
|
52
|
+
// 保存用户信息
|
|
53
|
+
setUserInfo(res1.user)
|
|
54
|
+
|
|
55
|
+
// 记住账号密码
|
|
56
|
+
if (model.remember) {
|
|
57
|
+
uni.setStorageSync('USER_NAME', model.name)
|
|
58
|
+
uni.setStorageSync('USER_PASSWORD', model.password)
|
|
59
|
+
uni.setStorageSync('REMEMBER', model.remember)
|
|
60
|
+
} else {
|
|
61
|
+
// 删除账号密码
|
|
62
|
+
uni.removeStorageSync('USER_NAME')
|
|
63
|
+
uni.removeStorageSync('USER_PASSWORD')
|
|
64
|
+
uni.removeStorageSync('REMEMBER')
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 跳转首页
|
|
68
|
+
router.pushTab('/pages/index/index')
|
|
69
|
+
setTabbarItemActive('index')
|
|
70
|
+
toast.success({ msg: '登录成功!' })
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
toast.error({ msg: res.message })
|
|
74
|
+
}
|
|
75
|
+
} catch (error: any) {
|
|
76
|
+
console.log(error, 'error')
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
toast.error({ msg: '请填写登录信息' })
|
|
80
|
+
console.log(errors, 'errors')
|
|
81
|
+
}
|
|
82
|
+
subloading.value = false
|
|
83
|
+
})
|
|
84
|
+
.catch((error: any) => {
|
|
85
|
+
toast.error({ msg: error })
|
|
86
|
+
console.log(error, 'error')
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<template>
|
|
92
|
+
<view class="bg-white pa-3 dark:bg-[var(--wot-dark-background2)]">
|
|
93
|
+
<!-- //账号登录 -->
|
|
94
|
+
<wd-form ref="form" :model="model">
|
|
95
|
+
<view class="rounded-2 overflow-hidden">
|
|
96
|
+
<wd-cell-group border>
|
|
97
|
+
<wd-input
|
|
98
|
+
v-model="model.name"
|
|
99
|
+
label="用户名"
|
|
100
|
+
label-width="100px"
|
|
101
|
+
prop="name"
|
|
102
|
+
clearable
|
|
103
|
+
placeholder="请输入用户名"
|
|
104
|
+
:rules="[{ required: true, message: '请填写用户名' }]"
|
|
105
|
+
/>
|
|
106
|
+
<wd-input
|
|
107
|
+
v-model="model.password"
|
|
108
|
+
label="密码"
|
|
109
|
+
label-width="100px"
|
|
110
|
+
prop="password"
|
|
111
|
+
clearable
|
|
112
|
+
show-password
|
|
113
|
+
placeholder="请输入密码"
|
|
114
|
+
:rules="[{ required: true, message: '请填写密码' }]"
|
|
115
|
+
/>
|
|
116
|
+
<view class="p-4 pb-0 pt-0 dark:bg-[#1b1b1e]">
|
|
117
|
+
<wd-checkbox v-model="model.remember" shape="square">记住密码</wd-checkbox>
|
|
118
|
+
</view>
|
|
119
|
+
</wd-cell-group>
|
|
120
|
+
</view>
|
|
121
|
+
<view class="p-4">
|
|
122
|
+
<wd-button block :loading="subloading" :round="false" @click="handleSubmit">登录</wd-button>
|
|
123
|
+
</view>
|
|
124
|
+
</wd-form>
|
|
125
|
+
</view>
|
|
126
|
+
</template>
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { defineOptions, defineProps, ref } from 'vue'
|
|
3
|
-
import { useRouter } from 'uni-mini-router'
|
|
4
|
-
import type { TabbarItem } from '../../composables/useTabbar'
|
|
5
|
-
import loginForm from '../login-form/login-form.vue'
|
|
6
|
-
import phoneLoginForm from '../phone-login-form/phone-login-form.vue'
|
|
7
|
-
|
|
8
|
-
defineOptions({
|
|
9
|
-
name: 'LoginFormBox',
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
const props = defineProps<Props>()
|
|
13
|
-
// 定义 Props 类型
|
|
14
|
-
interface Props {
|
|
15
|
-
tabbarItems: TabbarItem[]
|
|
16
|
-
showRagister?: boolean
|
|
17
|
-
gurl?: string// 获取验证码接口
|
|
18
|
-
url?: string// 手机号登录接口
|
|
19
|
-
}
|
|
20
|
-
const router = useRouter()
|
|
21
|
-
|
|
22
|
-
// 登录模式
|
|
23
|
-
const loginMode = ref('account')
|
|
24
|
-
|
|
25
|
-
// 注册
|
|
26
|
-
function handleRe() {
|
|
27
|
-
router.push('/pages/register/register')
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// 切换登录模式
|
|
31
|
-
function changeLoginMode(mode: string) {
|
|
32
|
-
loginMode.value = mode
|
|
33
|
-
}
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<template>
|
|
37
|
-
<view class="bg-white pa-3 dark:bg-[var(--wot-dark-background2)]">
|
|
38
|
-
<!-- //手机登录 -->
|
|
39
|
-
<phoneLoginForm v-if="loginMode === 'phone'" :tabbar-items="props.tabbarItems" :url="props.url" :gurl="props.gurl" />
|
|
40
|
-
<!-- //账号登录 -->
|
|
41
|
-
<loginForm v-if="loginMode === 'account'" :tabbar-items="props.tabbarItems" />
|
|
42
|
-
|
|
43
|
-
<view v-if="props.gurl" class="pa-3 pt-0">
|
|
44
|
-
<wd-divider>
|
|
45
|
-
或
|
|
46
|
-
</wd-divider>
|
|
47
|
-
<view v-if="props.gurl" class="p-4 pt-0">
|
|
48
|
-
<wd-button v-show="loginMode === 'account'" block :round="false" type="info" @click="changeLoginMode('phone')">
|
|
49
|
-
手机短信登录
|
|
50
|
-
</wd-button>
|
|
51
|
-
<wd-button v-show="loginMode === 'phone'" block :round="false" type="info" @click="changeLoginMode('account')">
|
|
52
|
-
账号登录
|
|
53
|
-
</wd-button>
|
|
54
|
-
</view>
|
|
55
|
-
<view v-if="showRagister" class="p-4 pt-0">
|
|
56
|
-
<view class="flex items-center justify-center text-size-24rpx">
|
|
57
|
-
<text>还没有账户?</text>
|
|
58
|
-
<wd-button block :round="false" type="text" size="small" @click="handleRe">
|
|
59
|
-
立即注册
|
|
60
|
-
</wd-button>
|
|
61
|
-
</view>
|
|
62
|
-
</view>
|
|
63
|
-
</view>
|
|
64
|
-
</view>
|
|
65
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineOptions, defineProps, ref } from 'vue'
|
|
3
|
+
import { useRouter } from 'uni-mini-router'
|
|
4
|
+
import type { TabbarItem } from '../../composables/useTabbar'
|
|
5
|
+
import loginForm from '../login-form/login-form.vue'
|
|
6
|
+
import phoneLoginForm from '../phone-login-form/phone-login-form.vue'
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: 'LoginFormBox',
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const props = defineProps<Props>()
|
|
13
|
+
// 定义 Props 类型
|
|
14
|
+
interface Props {
|
|
15
|
+
tabbarItems: TabbarItem[]
|
|
16
|
+
showRagister?: boolean
|
|
17
|
+
gurl?: string// 获取验证码接口
|
|
18
|
+
url?: string// 手机号登录接口
|
|
19
|
+
}
|
|
20
|
+
const router = useRouter()
|
|
21
|
+
|
|
22
|
+
// 登录模式
|
|
23
|
+
const loginMode = ref('account')
|
|
24
|
+
|
|
25
|
+
// 注册
|
|
26
|
+
function handleRe() {
|
|
27
|
+
router.push('/pages/register/register')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 切换登录模式
|
|
31
|
+
function changeLoginMode(mode: string) {
|
|
32
|
+
loginMode.value = mode
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<view class="bg-white pa-3 dark:bg-[var(--wot-dark-background2)]">
|
|
38
|
+
<!-- //手机登录 -->
|
|
39
|
+
<phoneLoginForm v-if="loginMode === 'phone'" :tabbar-items="props.tabbarItems" :url="props.url" :gurl="props.gurl" />
|
|
40
|
+
<!-- //账号登录 -->
|
|
41
|
+
<loginForm v-if="loginMode === 'account'" :tabbar-items="props.tabbarItems" />
|
|
42
|
+
|
|
43
|
+
<view v-if="props.gurl" class="pa-3 pt-0">
|
|
44
|
+
<wd-divider>
|
|
45
|
+
或
|
|
46
|
+
</wd-divider>
|
|
47
|
+
<view v-if="props.gurl" class="p-4 pt-0">
|
|
48
|
+
<wd-button v-show="loginMode === 'account'" block :round="false" type="info" @click="changeLoginMode('phone')">
|
|
49
|
+
手机短信登录
|
|
50
|
+
</wd-button>
|
|
51
|
+
<wd-button v-show="loginMode === 'phone'" block :round="false" type="info" @click="changeLoginMode('account')">
|
|
52
|
+
账号登录
|
|
53
|
+
</wd-button>
|
|
54
|
+
</view>
|
|
55
|
+
<view v-if="showRagister" class="p-4 pt-0">
|
|
56
|
+
<view class="flex items-center justify-center text-size-24rpx">
|
|
57
|
+
<text>还没有账户?</text>
|
|
58
|
+
<wd-button block :round="false" type="text" size="small" @click="handleRe">
|
|
59
|
+
立即注册
|
|
60
|
+
</wd-button>
|
|
61
|
+
</view>
|
|
62
|
+
</view>
|
|
63
|
+
</view>
|
|
64
|
+
</view>
|
|
65
|
+
</template>
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, defineOptions, defineProps, ref, toRaw } from 'vue'
|
|
3
|
-
import { useRouter } from 'uni-mini-router'
|
|
4
|
-
import { generateHighResolutionID } from '../../utils/index'
|
|
5
|
-
import type { FoldCardModel } from '../../type'
|
|
6
|
-
|
|
7
|
-
defineOptions({
|
|
8
|
-
name: 'MulselectPicker',
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
const props = defineProps<{
|
|
12
|
-
extControlType: string // 选择模式,例如:单选:relselect、多选
|
|
13
|
-
sourceId: string
|
|
14
|
-
title?: string
|
|
15
|
-
modelValue: string | Array<string>
|
|
16
|
-
readonly: boolean
|
|
17
|
-
clearable: boolean
|
|
18
|
-
foldCardModel?: FoldCardModel // 折叠面板模式
|
|
19
|
-
}>()
|
|
20
|
-
const emits = defineEmits<{
|
|
21
|
-
(e: 'update:modelValue', value: string | string[]): void
|
|
22
|
-
}>()
|
|
23
|
-
const selectData = ref<string | string[]>(props.modelValue)
|
|
24
|
-
const selectformatData = computed(() => {
|
|
25
|
-
if (Array.isArray(selectData.value)) {
|
|
26
|
-
return selectData.value.map(item => item.split('@R@')[1]).join(',')
|
|
27
|
-
}
|
|
28
|
-
return selectData.value?.split('@R@')[1] || ''
|
|
29
|
-
})
|
|
30
|
-
const router = useRouter()
|
|
31
|
-
// 全局事件名称
|
|
32
|
-
const SELECTEVENT = generateHighResolutionID()
|
|
33
|
-
const SENDSELECTEVENT = generateHighResolutionID()
|
|
34
|
-
function gotoSlect() {
|
|
35
|
-
if (props.readonly) return
|
|
36
|
-
router.push(
|
|
37
|
-
`/pages/select-list/index?sourceId=${props.sourceId}&title=${props.title}&selectEvent=${SELECTEVENT}&sendSelectEvent=${SENDSELECTEVENT}&extControlType=${props.extControlType}&foldCardModel=${props.foldCardModel}`
|
|
38
|
-
)
|
|
39
|
-
// 发送数据给选择页面,延迟发送防止页面不刷新
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
uni.$emit(SENDSELECTEVENT, toRaw(selectData.value))
|
|
42
|
-
}, 100)
|
|
43
|
-
|
|
44
|
-
// 接收勾选页面发送过来的数据
|
|
45
|
-
uni.$once(SELECTEVENT, (data: any) => {
|
|
46
|
-
selectData.value = data
|
|
47
|
-
emits('update:modelValue', data)
|
|
48
|
-
})
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// 清空勾选
|
|
52
|
-
function clearSelect() {
|
|
53
|
-
// 清空单选
|
|
54
|
-
if (props.extControlType === 'relselect') {
|
|
55
|
-
selectData.value = ''
|
|
56
|
-
emits('update:modelValue', '')
|
|
57
|
-
} else {
|
|
58
|
-
selectData.value = []
|
|
59
|
-
emits('update:modelValue', [])
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
</script>
|
|
63
|
-
|
|
64
|
-
<template>
|
|
65
|
-
<view class="relative" @click="gotoSlect">
|
|
66
|
-
<view class="flex justify-between text-left">
|
|
67
|
-
<view class="flex-1">
|
|
68
|
-
<text v-if="selectformatData">
|
|
69
|
-
{{ selectformatData }}
|
|
70
|
-
</text>
|
|
71
|
-
<text v-else class="text-gray-400">请选择{{ title }}</text>
|
|
72
|
-
</view>
|
|
73
|
-
<view class="h-3px w-17px" />
|
|
74
|
-
</view>
|
|
75
|
-
<view v-if="clearable" class="absolute bottom-0 right-0 top-0">
|
|
76
|
-
<wd-icon v-if="selectformatData" name="close-circle" size="17px" @click.stop="clearSelect" />
|
|
77
|
-
<wd-icon v-else name="right" size="17px" />
|
|
78
|
-
</view>
|
|
79
|
-
</view>
|
|
80
|
-
</template>
|
|
81
|
-
|
|
82
|
-
<style scoped>
|
|
83
|
-
:deep(.wd-tag__close) {
|
|
84
|
-
line-height: 0.6;
|
|
85
|
-
}
|
|
86
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, defineOptions, defineProps, ref, toRaw } from 'vue'
|
|
3
|
+
import { useRouter } from 'uni-mini-router'
|
|
4
|
+
import { generateHighResolutionID } from '../../utils/index'
|
|
5
|
+
import type { FoldCardModel } from '../../type'
|
|
6
|
+
|
|
7
|
+
defineOptions({
|
|
8
|
+
name: 'MulselectPicker',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const props = defineProps<{
|
|
12
|
+
extControlType: string // 选择模式,例如:单选:relselect、多选
|
|
13
|
+
sourceId: string
|
|
14
|
+
title?: string
|
|
15
|
+
modelValue: string | Array<string>
|
|
16
|
+
readonly: boolean
|
|
17
|
+
clearable: boolean
|
|
18
|
+
foldCardModel?: FoldCardModel // 折叠面板模式
|
|
19
|
+
}>()
|
|
20
|
+
const emits = defineEmits<{
|
|
21
|
+
(e: 'update:modelValue', value: string | string[]): void
|
|
22
|
+
}>()
|
|
23
|
+
const selectData = ref<string | string[]>(props.modelValue)
|
|
24
|
+
const selectformatData = computed(() => {
|
|
25
|
+
if (Array.isArray(selectData.value)) {
|
|
26
|
+
return selectData.value.map(item => item.split('@R@')[1]).join(',')
|
|
27
|
+
}
|
|
28
|
+
return selectData.value?.split('@R@')[1] || ''
|
|
29
|
+
})
|
|
30
|
+
const router = useRouter()
|
|
31
|
+
// 全局事件名称
|
|
32
|
+
const SELECTEVENT = generateHighResolutionID()
|
|
33
|
+
const SENDSELECTEVENT = generateHighResolutionID()
|
|
34
|
+
function gotoSlect() {
|
|
35
|
+
if (props.readonly) return
|
|
36
|
+
router.push(
|
|
37
|
+
`/pages/select-list/index?sourceId=${props.sourceId}&title=${props.title}&selectEvent=${SELECTEVENT}&sendSelectEvent=${SENDSELECTEVENT}&extControlType=${props.extControlType}&foldCardModel=${props.foldCardModel}`
|
|
38
|
+
)
|
|
39
|
+
// 发送数据给选择页面,延迟发送防止页面不刷新
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
uni.$emit(SENDSELECTEVENT, toRaw(selectData.value))
|
|
42
|
+
}, 100)
|
|
43
|
+
|
|
44
|
+
// 接收勾选页面发送过来的数据
|
|
45
|
+
uni.$once(SELECTEVENT, (data: any) => {
|
|
46
|
+
selectData.value = data
|
|
47
|
+
emits('update:modelValue', data)
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 清空勾选
|
|
52
|
+
function clearSelect() {
|
|
53
|
+
// 清空单选
|
|
54
|
+
if (props.extControlType === 'relselect') {
|
|
55
|
+
selectData.value = ''
|
|
56
|
+
emits('update:modelValue', '')
|
|
57
|
+
} else {
|
|
58
|
+
selectData.value = []
|
|
59
|
+
emits('update:modelValue', [])
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<view class="relative" @click="gotoSlect">
|
|
66
|
+
<view class="flex justify-between text-left">
|
|
67
|
+
<view class="flex-1">
|
|
68
|
+
<text v-if="selectformatData">
|
|
69
|
+
{{ selectformatData }}
|
|
70
|
+
</text>
|
|
71
|
+
<text v-else class="text-gray-400">请选择{{ title }}</text>
|
|
72
|
+
</view>
|
|
73
|
+
<view class="h-3px w-17px" />
|
|
74
|
+
</view>
|
|
75
|
+
<view v-if="clearable" class="absolute bottom-0 right-0 top-0">
|
|
76
|
+
<wd-icon v-if="selectformatData" name="close-circle" size="17px" @click.stop="clearSelect" />
|
|
77
|
+
<wd-icon v-else name="right" size="17px" />
|
|
78
|
+
</view>
|
|
79
|
+
</view>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<style scoped>
|
|
83
|
+
:deep(.wd-tag__close) {
|
|
84
|
+
line-height: 0.6;
|
|
85
|
+
}
|
|
86
|
+
</style>
|