w-ui-v1 1.0.15 → 1.0.17

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/index.ts CHANGED
@@ -8,6 +8,7 @@ import wSelectPicker from './w-select-picker/w-select-picker.vue'
8
8
  import wDetail from './w-detail/w-detail.vue'
9
9
  import wAdd from './w-add/w-add.vue'
10
10
  import WSearch from './w-search/w-search.vue'
11
+ import WUser from './w-user/w-user.vue'
11
12
  const coms: any[] = [
12
13
  wTest,
13
14
  wLogin,
@@ -17,7 +18,8 @@ const coms: any[] = [
17
18
  wSelectPicker,
18
19
  wDetail,
19
20
  wAdd,
20
- WSearch
21
+ WSearch,
22
+ WUser
21
23
  ]
22
24
  // 批量组件注册
23
25
  function install(Vue: App) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-ui-v1",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "w-ui",
5
5
  "author": "wgxshh",
6
6
  "license": "ISC",
@@ -29,7 +29,7 @@ onLoad((option: any) => {
29
29
  sourceId.value = props.sourceId || option.sourceId
30
30
  code.value = option.code||props.code
31
31
  getPageData()
32
-
32
+ uni.setNavigationBarTitle({ title: "详情" })
33
33
  })
34
34
  // 获取页面配置
35
35
  function getPageConfig() {
@@ -50,6 +50,9 @@ function handleLogin() {
50
50
  }
51
51
  showSuccess('登录成功')
52
52
  uni.setStorageSync('token', data.token)
53
+ uni.setStorageSync('userInfo', {
54
+ usernamse:model.username
55
+ })
53
56
  uni.reLaunch({
54
57
  url: '/pages/index/index',
55
58
  })
package/w-menu/w-menu.vue CHANGED
@@ -47,7 +47,7 @@ function sheetGotoPage(item: any) {
47
47
  function goto(item: any) {
48
48
  if (item.pageType) {
49
49
  uni.navigateTo({
50
- url: `/pages/table/table?sourceId=${item.id}&pageType=${item.pageType}`,
50
+ url: `/pages/table/table?sourceId=${item.id}&pageTitle=${item.title}`,
51
51
  })
52
52
  return true
53
53
  }
@@ -31,6 +31,7 @@ const pageData = ref<{
31
31
  }>({ criterias: [], buttons: [] })
32
32
  onLoad((option: any) => {
33
33
  sourceId.value = props.sourceId || option.sourceId
34
+ uni.setNavigationBarTitle({ title: option.pageTitle })
34
35
  getPageConfig()
35
36
  })
36
37
 
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <view class="user">
3
+ <view class="top">
4
+ <view class="circle">
5
+ <wd-icon name="user-circle" size="120rpx" color="#bababa"></wd-icon>
6
+ </view>
7
+ <view class="username">
8
+ <view class="name">
9
+ <text>{{ userInfo['用户名'] }}</text>
10
+ </view>
11
+ </view>
12
+ </view>
13
+ <wd-cell-group>
14
+ <wd-cell title="退出登录" icon="logout" :is-link="true" :clickable="true" @click="quit" />
15
+ </wd-cell-group>
16
+ <wd-message-box />
17
+ </view>
18
+ </template>
19
+
20
+ <script setup lang="ts">
21
+ import { ref } from 'vue';
22
+ import {
23
+ useMessage
24
+ } from 'wot-design-uni'
25
+ defineOptions({
26
+ name: 'WUser'
27
+ })
28
+ const message = useMessage()
29
+ const userInfo = ref({
30
+ '用户名':uni.getStorageSync('userInfo').username,
31
+ })
32
+ const quit = () => {
33
+ message
34
+ .confirm({
35
+ // msg: '提示文案',
36
+ title: '退出登录'
37
+ })
38
+ .then(() => {
39
+ uni.removeStorageSync('token')
40
+ uni.reLaunch({
41
+ url: '/pages/login/login'
42
+ })
43
+ })
44
+ .catch(() => {
45
+ console.log('点击了取消按钮')
46
+ })
47
+
48
+ }
49
+ </script>
50
+
51
+ <style scoped lang="scss">
52
+ .user {
53
+ background-color: #f5f5f5;
54
+ height: 100vh;
55
+
56
+ .top {
57
+ display: flex;
58
+ align-items: center;
59
+ padding: 25rpx;
60
+ background-color: #fff;
61
+
62
+ .circle {
63
+ background-color: #efefef;
64
+ border-radius: 100%;
65
+ margin-right: 20rpx;
66
+ }
67
+
68
+ .username {
69
+ font-size: 40rpx;
70
+
71
+ .name {
72
+ margin-bottom: 10rpx;
73
+ }
74
+
75
+ .ic {
76
+ font-size: 30rpx;
77
+ color: #ccc;
78
+ }
79
+ }
80
+ }
81
+ }
82
+ </style>