jmash-core-mp 0.1.21 → 0.1.22
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/.editorconfig +9 -9
- package/README.md +60 -60
- package/babel.config.json +34 -34
- package/eslint.config.mjs +7 -7
- package/lib/api/auth/index.d.ts +21 -21
- package/lib/api/auth/index.js +199 -199
- package/lib/api/auth/types.d.ts +86 -86
- package/lib/api/auth/types.js +9 -9
- package/lib/api/cms/index.d.ts +20 -20
- package/lib/api/cms/index.js +161 -161
- package/lib/api/cms/types.d.ts +200 -200
- package/lib/api/cms/types.js +1 -1
- package/lib/api/constant.d.ts +5 -5
- package/lib/api/constant.js +6 -6
- package/lib/api/dict/index.d.ts +18 -18
- package/lib/api/dict/index.js +34 -34
- package/lib/api/dict/types.d.ts +28 -28
- package/lib/api/dict/types.js +1 -1
- package/lib/api/dicts.d.ts +18 -18
- package/lib/api/dicts.js +67 -67
- package/lib/api/files/index.d.ts +25 -25
- package/lib/api/files/index.js +135 -135
- package/lib/api/files/types.d.ts +38 -38
- package/lib/api/files/types.js +1 -1
- package/lib/api/index.d.ts +4 -4
- package/lib/api/index.js +6 -6
- package/lib/api/myorgan/types.d.ts +22 -22
- package/lib/api/myorgan/types.js +1 -1
- package/lib/api/region/index.d.ts +7 -7
- package/lib/api/region/index.js +19 -19
- package/lib/api/region/types.d.ts +19 -19
- package/lib/api/region/types.js +1 -1
- package/lib/api/storage/index.d.ts +10 -10
- package/lib/api/storage/index.js +43 -43
- package/lib/api/storage/types.d.ts +28 -28
- package/lib/api/storage/types.js +1 -1
- package/lib/api/types.d.ts +42 -42
- package/lib/api/types.js +1 -1
- package/lib/app.mpx.d.ts +1 -1
- package/lib/components/auth-user/jmash-update-user.mpx.d.ts +1 -1
- package/lib/components/auth-user/jmash-user.mpx.d.ts +1 -1
- package/lib/components/cms/jmash-cms-acticle-list.mpx.d.ts +1 -1
- package/lib/components/cms/jmash-cms-article-item.mpx.d.ts +1 -1
- package/lib/components/cms/jmash-cms-article-view.mpx.d.ts +1 -0
- package/lib/components/cms/jmash-cms-article.mpx.d.ts +1 -1
- package/lib/components/cms/jmash-cms-like.mpx.d.ts +1 -1
- package/lib/components/common/jmash-upload-picture.mpx.d.ts +1 -0
- package/lib/components/core/jmash-login.mpx.d.ts +1 -0
- package/lib/index.d.ts +21 -21
- package/lib/index.js +14 -14
- package/lib/packages/pages/cms/cms-article-list.mpx.d.ts +1 -1
- package/lib/pages/index.mpx.d.ts +1 -0
- package/lib/store/user.d.ts +31 -31
- package/lib/store/user.js +227 -227
- package/lib/utils/common.d.ts +35 -35
- package/lib/utils/common.js +166 -166
- package/lib/utils/config.d.ts +5 -5
- package/lib/utils/config.js +29 -29
- package/lib/utils/db.d.ts +21 -21
- package/lib/utils/db.js +84 -84
- package/lib/utils/grpc.d.ts +5 -5
- package/lib/utils/grpc.js +20 -20
- package/lib/utils/net.d.ts +7 -7
- package/lib/utils/net.js +15 -15
- package/lib/utils/request.d.ts +2 -2
- package/lib/utils/request.js +123 -123
- package/mpx.config.js +27 -27
- package/package.json +1 -1
- package/postcss.config.js +11 -11
- package/project.config.json +24 -24
- package/project.private.config.json +13 -13
- package/public/index.html +15 -15
- package/src/api/auth/index.ts +227 -227
- package/src/api/auth/types.ts +166 -166
- package/src/api/cms/index.ts +218 -218
- package/src/api/cms/types.ts +379 -379
- package/src/api/constant.ts +6 -6
- package/src/api/dict/index.ts +44 -44
- package/src/api/dict/types.ts +49 -49
- package/src/api/dicts.ts +72 -72
- package/src/api/files/index.ts +163 -163
- package/src/api/files/types.ts +67 -67
- package/src/api/index.ts +11 -11
- package/src/api/myorgan/types.ts +42 -42
- package/src/api/region/index.ts +23 -23
- package/src/api/region/types.ts +36 -36
- package/src/api/storage/index.ts +62 -62
- package/src/api/storage/types.ts +54 -54
- package/src/api/types.ts +72 -72
- package/src/app.mpx +71 -71
- package/src/components/auth-user/jmash-logout.mpx +91 -91
- package/src/components/auth-user/jmash-update-user.mpx +386 -386
- package/src/components/auth-user/jmash-update-user.web.mpx +366 -366
- package/src/components/auth-user/jmash-user.mpx +359 -359
- package/src/components/cms/jmash-cms-acticle-list.mpx +182 -182
- package/src/components/cms/jmash-cms-article-item.mpx +241 -241
- package/src/components/cms/jmash-cms-article-view.mpx +131 -131
- package/src/components/cms/jmash-cms-article.mpx +68 -68
- package/src/components/cms/jmash-cms-like.mpx +151 -151
- package/src/components/common/jmash-avatar-edit.mpx +153 -153
- package/src/components/common/jmash-cascader-region.mpx +112 -112
- package/src/components/common/jmash-menu.mpx +129 -129
- package/src/components/common/jmash-none-data.mpx +82 -82
- package/src/components/common/jmash-pic-swiper.mpx +71 -71
- package/src/components/common/jmash-popup.mpx +137 -137
- package/src/components/common/jmash-search.mpx +126 -126
- package/src/components/common/jmash-single-btn.mpx +53 -53
- package/src/components/common/jmash-stepper.mpx +214 -214
- package/src/components/common/jmash-tab-bar.mpx +50 -50
- package/src/components/common/jmash-textarea.mpx +88 -88
- package/src/components/common/jmash-top-navigation.mpx +203 -203
- package/src/components/common/jmash-upload-picture.mpx +129 -126
- package/src/components/core/jmash-cms-protocol.mpx +66 -66
- package/src/components/core/jmash-login.ali.mpx +284 -284
- package/src/components/core/jmash-login.mpx +348 -348
- package/src/components/core/jmash-login.web.mpx +421 -421
- package/src/components/core/jmash-popup-login.ali.mpx +311 -311
- package/src/components/core/jmash-popup-login.mpx +415 -415
- package/src/components/core/jmash-popup-login.web.mpx +389 -389
- package/src/custom-tab-bar/index.mpx +10 -10
- package/src/global.d.ts +11 -11
- package/src/index.ts +71 -71
- package/src/packages/index.mpx +10 -10
- package/src/packages/pages/auth/cms-protocol.mpx +31 -31
- package/src/packages/pages/auth/login.mpx +59 -59
- package/src/packages/pages/auth/update-user.mpx +17 -17
- package/src/packages/pages/cms/cms-article-list.mpx +164 -164
- package/src/packages/pages/cms/cms-article.mpx +32 -32
- package/src/pages/basic-component.mpx +30 -30
- package/src/pages/half-home.mpx +58 -58
- package/src/pages/home.mpx +52 -52
- package/src/pages/home2.mpx +47 -47
- package/src/pages/index.mpx +13 -3
- package/src/pages/tabbar/home.mpx +77 -77
- package/src/pages/tabbar/my.mpx +80 -80
- package/src/store/user.ts +270 -270
- package/src/styles/index.scss +20 -20
- package/src/styles/vars.scss +27 -27
- package/src/utils/common.ts +179 -179
- package/src/utils/config.ts +35 -35
- package/src/utils/db.ts +100 -100
- package/src/utils/grpc.ts +21 -21
- package/src/utils/net.ts +18 -18
- package/src/utils/request.ts +134 -134
- package/static/ali/mini.project.json +4 -4
- package/static/dd/project.config.json +15 -15
- package/static/swan/project.swan.json +14 -14
- package/static/tt/project.config.json +11 -11
- package/static/wx/project.config.json +40 -40
- package/uno.config.js +9 -9
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- 地区级联选择弹窗 -->
|
|
3
|
-
<cube-cascade-picker-popup wx:ref="cascadeRegion" title="请选择所在地区" list="{{ regionOption }}"
|
|
4
|
-
bind:cancel="handleRegionClose" bind:confirm="handleConfirm" />
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script lang="ts">
|
|
8
|
-
import { createComponent, ref } from "@mpxjs/core";
|
|
9
|
-
import { EventBase } from "../../api/types";
|
|
10
|
-
import { regionApi } from "../../api/region/index";
|
|
11
|
-
import { DictRegionModel } from "../../api/region/types";
|
|
12
|
-
|
|
13
|
-
createComponent({
|
|
14
|
-
options: {
|
|
15
|
-
styleIsolation: "apply-shared",
|
|
16
|
-
},
|
|
17
|
-
properties: {
|
|
18
|
-
// 是否显示弹框
|
|
19
|
-
show: {
|
|
20
|
-
type: Boolean,
|
|
21
|
-
value: false,
|
|
22
|
-
observer() {
|
|
23
|
-
if (this.show) {
|
|
24
|
-
this.$refs.cascadeRegion?.show();
|
|
25
|
-
} else {
|
|
26
|
-
this.$refs.cascadeRegion?.hide();
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
setup() {
|
|
32
|
-
// 地区选项
|
|
33
|
-
let regionOption = ref([] as DictRegionModel[]);
|
|
34
|
-
// 选中的地区值
|
|
35
|
-
let cascaderValue = ref("");
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
regionOption,
|
|
39
|
-
cascaderValue,
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
lifetimes: {
|
|
43
|
-
ready() {
|
|
44
|
-
// 初始化加载地区
|
|
45
|
-
this.regionOption.length = 0;
|
|
46
|
-
this.fetchRegionData("");
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
methods: {
|
|
50
|
-
// 关闭弹框
|
|
51
|
-
handleRegionClose() {
|
|
52
|
-
this.$refs.cascadeRegion?.hide();
|
|
53
|
-
this.triggerEvent("close", false);
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
// 确认选择
|
|
57
|
-
handleConfirm(e: EventBase) {
|
|
58
|
-
const selectedOptions = e.detail;
|
|
59
|
-
this.triggerEvent("cascaderValue", selectedOptions.selectedText);
|
|
60
|
-
// 关闭弹框
|
|
61
|
-
this.handleRegionClose();
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
// 异步加载数据
|
|
65
|
-
async fetchRegionData(regionId: string = "") {
|
|
66
|
-
try {
|
|
67
|
-
const res = await regionApi.findList({
|
|
68
|
-
parentId: regionId,
|
|
69
|
-
enable: true,
|
|
70
|
-
});
|
|
71
|
-
// 递归加载并转换子级数据
|
|
72
|
-
const regionData = await Promise.all(
|
|
73
|
-
res.data.results.map(async (item) => {
|
|
74
|
-
const regionItem: Record<string, any> = {
|
|
75
|
-
id: item.regionId,
|
|
76
|
-
text: item.regionName,
|
|
77
|
-
value: item.regionCode,
|
|
78
|
-
hasChildren: item.hasChildren,
|
|
79
|
-
regionType: item.regionType,
|
|
80
|
-
};
|
|
81
|
-
// 如果有子节点且不是最后级别,递归加载
|
|
82
|
-
if (item.hasChildren && item.regionType !== "town") {
|
|
83
|
-
const childrenData = await this.fetchRegionData(item.regionId);
|
|
84
|
-
if (childrenData.length > 0) {
|
|
85
|
-
regionItem.children = childrenData;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return regionItem;
|
|
89
|
-
})
|
|
90
|
-
);
|
|
91
|
-
if (!regionId) {
|
|
92
|
-
this.regionOption = [...this.regionOption, ...regionData];
|
|
93
|
-
}
|
|
94
|
-
console.log("级联地区数组==>", this.regionOption);
|
|
95
|
-
return regionData;
|
|
96
|
-
} catch (error) {
|
|
97
|
-
return [];
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
});
|
|
102
|
-
</script>
|
|
103
|
-
|
|
104
|
-
<script type="application/json">
|
|
105
|
-
{
|
|
106
|
-
"component": true,
|
|
107
|
-
"usingComponents": {
|
|
108
|
-
"cube-cascade-picker": "@mpxjs/mpx-cube-ui/src/components/cascade-picker/index",
|
|
109
|
-
"cube-cascade-picker-popup": "@mpxjs/mpx-cube-ui/src/components/cascade-picker-popup/index"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 地区级联选择弹窗 -->
|
|
3
|
+
<cube-cascade-picker-popup wx:ref="cascadeRegion" title="请选择所在地区" list="{{ regionOption }}"
|
|
4
|
+
bind:cancel="handleRegionClose" bind:confirm="handleConfirm" />
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { createComponent, ref } from "@mpxjs/core";
|
|
9
|
+
import { EventBase } from "../../api/types";
|
|
10
|
+
import { regionApi } from "../../api/region/index";
|
|
11
|
+
import { DictRegionModel } from "../../api/region/types";
|
|
12
|
+
|
|
13
|
+
createComponent({
|
|
14
|
+
options: {
|
|
15
|
+
styleIsolation: "apply-shared",
|
|
16
|
+
},
|
|
17
|
+
properties: {
|
|
18
|
+
// 是否显示弹框
|
|
19
|
+
show: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
value: false,
|
|
22
|
+
observer() {
|
|
23
|
+
if (this.show) {
|
|
24
|
+
this.$refs.cascadeRegion?.show();
|
|
25
|
+
} else {
|
|
26
|
+
this.$refs.cascadeRegion?.hide();
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
setup() {
|
|
32
|
+
// 地区选项
|
|
33
|
+
let regionOption = ref([] as DictRegionModel[]);
|
|
34
|
+
// 选中的地区值
|
|
35
|
+
let cascaderValue = ref("");
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
regionOption,
|
|
39
|
+
cascaderValue,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
lifetimes: {
|
|
43
|
+
ready() {
|
|
44
|
+
// 初始化加载地区
|
|
45
|
+
this.regionOption.length = 0;
|
|
46
|
+
this.fetchRegionData("");
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
// 关闭弹框
|
|
51
|
+
handleRegionClose() {
|
|
52
|
+
this.$refs.cascadeRegion?.hide();
|
|
53
|
+
this.triggerEvent("close", false);
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
// 确认选择
|
|
57
|
+
handleConfirm(e: EventBase) {
|
|
58
|
+
const selectedOptions = e.detail;
|
|
59
|
+
this.triggerEvent("cascaderValue", selectedOptions.selectedText);
|
|
60
|
+
// 关闭弹框
|
|
61
|
+
this.handleRegionClose();
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
// 异步加载数据
|
|
65
|
+
async fetchRegionData(regionId: string = "") {
|
|
66
|
+
try {
|
|
67
|
+
const res = await regionApi.findList({
|
|
68
|
+
parentId: regionId,
|
|
69
|
+
enable: true,
|
|
70
|
+
});
|
|
71
|
+
// 递归加载并转换子级数据
|
|
72
|
+
const regionData = await Promise.all(
|
|
73
|
+
res.data.results.map(async (item) => {
|
|
74
|
+
const regionItem: Record<string, any> = {
|
|
75
|
+
id: item.regionId,
|
|
76
|
+
text: item.regionName,
|
|
77
|
+
value: item.regionCode,
|
|
78
|
+
hasChildren: item.hasChildren,
|
|
79
|
+
regionType: item.regionType,
|
|
80
|
+
};
|
|
81
|
+
// 如果有子节点且不是最后级别,递归加载
|
|
82
|
+
if (item.hasChildren && item.regionType !== "town") {
|
|
83
|
+
const childrenData = await this.fetchRegionData(item.regionId);
|
|
84
|
+
if (childrenData.length > 0) {
|
|
85
|
+
regionItem.children = childrenData;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return regionItem;
|
|
89
|
+
})
|
|
90
|
+
);
|
|
91
|
+
if (!regionId) {
|
|
92
|
+
this.regionOption = [...this.regionOption, ...regionData];
|
|
93
|
+
}
|
|
94
|
+
console.log("级联地区数组==>", this.regionOption);
|
|
95
|
+
return regionData;
|
|
96
|
+
} catch (error) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<script type="application/json">
|
|
105
|
+
{
|
|
106
|
+
"component": true,
|
|
107
|
+
"usingComponents": {
|
|
108
|
+
"cube-cascade-picker": "@mpxjs/mpx-cube-ui/src/components/cascade-picker/index",
|
|
109
|
+
"cube-cascade-picker-popup": "@mpxjs/mpx-cube-ui/src/components/cascade-picker-popup/index"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
</script>
|
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="jmash-menu">
|
|
3
|
-
<view class="menu-group" wx:for="{{ menuGroups }}" wx:key="id" wx:for-item="group">
|
|
4
|
-
<view class="menu-item" wx:for="{{ group.items }}" wx:key="key" bind:tap="handleItemClick" data-item="{{ item }}">
|
|
5
|
-
<view class="menu-icon-wrapper" style="background: {{item.iconBg}}">
|
|
6
|
-
<text class="menu-icon">{{ item.icon }}</text>
|
|
7
|
-
</view>
|
|
8
|
-
<text class="menu-title">{{ item.title }}</text>
|
|
9
|
-
<view class="menu-badge" wx:if="{{ item.badge }}">
|
|
10
|
-
<text class="badge-text">{{ item.badge }}</text>
|
|
11
|
-
</view>
|
|
12
|
-
<text class="menu-arrow">›</text>
|
|
13
|
-
</view>
|
|
14
|
-
</view>
|
|
15
|
-
</view>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
import { createComponent } from '@mpxjs/core'
|
|
20
|
-
|
|
21
|
-
createComponent({
|
|
22
|
-
properties: {
|
|
23
|
-
// 菜单配置数组,格式和my页面里的menuGroups一致
|
|
24
|
-
menuGroups: {
|
|
25
|
-
type: Array,
|
|
26
|
-
value: []
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
methods: {
|
|
30
|
-
handleItemClick(e) {
|
|
31
|
-
const item = e.currentTarget.dataset.item
|
|
32
|
-
// 触发点击事件,把当前菜单项传给父组件
|
|
33
|
-
this.triggerEvent('itemClick', { item })
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<style lang="scss">
|
|
40
|
-
$text-1: #111111;
|
|
41
|
-
$text-3: #999999;
|
|
42
|
-
$border: #f0f0f0;
|
|
43
|
-
$bg-card: #ffffff;
|
|
44
|
-
|
|
45
|
-
.jmash-menu {
|
|
46
|
-
.menu-group {
|
|
47
|
-
background: $bg-card;
|
|
48
|
-
border-radius: 20rpx;
|
|
49
|
-
margin: 0 16rpx 16rpx;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
|
52
|
-
|
|
53
|
-
.menu-item {
|
|
54
|
-
display: flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
padding: 32rpx 24rpx;
|
|
57
|
-
position: relative;
|
|
58
|
-
transition: background 0.2s;
|
|
59
|
-
|
|
60
|
-
&:active {
|
|
61
|
-
background: #fafafa;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&:not(:last-child)::after {
|
|
65
|
-
content: '';
|
|
66
|
-
position: absolute;
|
|
67
|
-
left: 96rpx;
|
|
68
|
-
right: 0;
|
|
69
|
-
bottom: 0;
|
|
70
|
-
height: 1rpx;
|
|
71
|
-
background: $border;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.menu-icon-wrapper {
|
|
75
|
-
width: 48rpx;
|
|
76
|
-
height: 48rpx;
|
|
77
|
-
border-radius: 12rpx;
|
|
78
|
-
display: flex;
|
|
79
|
-
align-items: center;
|
|
80
|
-
justify-content: center;
|
|
81
|
-
margin-right: 20rpx;
|
|
82
|
-
flex-shrink: 0;
|
|
83
|
-
|
|
84
|
-
.menu-icon {
|
|
85
|
-
font-size: 26rpx;
|
|
86
|
-
line-height: 1;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.menu-title {
|
|
91
|
-
flex: 1;
|
|
92
|
-
font-size: 28rpx;
|
|
93
|
-
color: $text-1;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.menu-badge {
|
|
97
|
-
min-width: 32rpx;
|
|
98
|
-
height: 32rpx;
|
|
99
|
-
background: #ff4d4f;
|
|
100
|
-
border-radius: 16rpx;
|
|
101
|
-
display: flex;
|
|
102
|
-
align-items: center;
|
|
103
|
-
justify-content: center;
|
|
104
|
-
padding: 0 6rpx;
|
|
105
|
-
margin-right: 8rpx;
|
|
106
|
-
|
|
107
|
-
.badge-text {
|
|
108
|
-
font-size: 20rpx;
|
|
109
|
-
color: #fff;
|
|
110
|
-
line-height: 1;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.menu-arrow {
|
|
115
|
-
font-size: 28rpx;
|
|
116
|
-
color: $text-3;
|
|
117
|
-
font-weight: 300;
|
|
118
|
-
line-height: 1;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
</style>
|
|
124
|
-
|
|
125
|
-
<script type="application/json">
|
|
126
|
-
{
|
|
127
|
-
"component": true
|
|
128
|
-
}
|
|
129
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="jmash-menu">
|
|
3
|
+
<view class="menu-group" wx:for="{{ menuGroups }}" wx:key="id" wx:for-item="group">
|
|
4
|
+
<view class="menu-item" wx:for="{{ group.items }}" wx:key="key" bind:tap="handleItemClick" data-item="{{ item }}">
|
|
5
|
+
<view class="menu-icon-wrapper" style="background: {{item.iconBg}}">
|
|
6
|
+
<text class="menu-icon">{{ item.icon }}</text>
|
|
7
|
+
</view>
|
|
8
|
+
<text class="menu-title">{{ item.title }}</text>
|
|
9
|
+
<view class="menu-badge" wx:if="{{ item.badge }}">
|
|
10
|
+
<text class="badge-text">{{ item.badge }}</text>
|
|
11
|
+
</view>
|
|
12
|
+
<text class="menu-arrow">›</text>
|
|
13
|
+
</view>
|
|
14
|
+
</view>
|
|
15
|
+
</view>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import { createComponent } from '@mpxjs/core'
|
|
20
|
+
|
|
21
|
+
createComponent({
|
|
22
|
+
properties: {
|
|
23
|
+
// 菜单配置数组,格式和my页面里的menuGroups一致
|
|
24
|
+
menuGroups: {
|
|
25
|
+
type: Array,
|
|
26
|
+
value: []
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
handleItemClick(e) {
|
|
31
|
+
const item = e.currentTarget.dataset.item
|
|
32
|
+
// 触发点击事件,把当前菜单项传给父组件
|
|
33
|
+
this.triggerEvent('itemClick', { item })
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style lang="scss">
|
|
40
|
+
$text-1: #111111;
|
|
41
|
+
$text-3: #999999;
|
|
42
|
+
$border: #f0f0f0;
|
|
43
|
+
$bg-card: #ffffff;
|
|
44
|
+
|
|
45
|
+
.jmash-menu {
|
|
46
|
+
.menu-group {
|
|
47
|
+
background: $bg-card;
|
|
48
|
+
border-radius: 20rpx;
|
|
49
|
+
margin: 0 16rpx 16rpx;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
|
52
|
+
|
|
53
|
+
.menu-item {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
padding: 32rpx 24rpx;
|
|
57
|
+
position: relative;
|
|
58
|
+
transition: background 0.2s;
|
|
59
|
+
|
|
60
|
+
&:active {
|
|
61
|
+
background: #fafafa;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:not(:last-child)::after {
|
|
65
|
+
content: '';
|
|
66
|
+
position: absolute;
|
|
67
|
+
left: 96rpx;
|
|
68
|
+
right: 0;
|
|
69
|
+
bottom: 0;
|
|
70
|
+
height: 1rpx;
|
|
71
|
+
background: $border;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.menu-icon-wrapper {
|
|
75
|
+
width: 48rpx;
|
|
76
|
+
height: 48rpx;
|
|
77
|
+
border-radius: 12rpx;
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
margin-right: 20rpx;
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
|
|
84
|
+
.menu-icon {
|
|
85
|
+
font-size: 26rpx;
|
|
86
|
+
line-height: 1;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.menu-title {
|
|
91
|
+
flex: 1;
|
|
92
|
+
font-size: 28rpx;
|
|
93
|
+
color: $text-1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.menu-badge {
|
|
97
|
+
min-width: 32rpx;
|
|
98
|
+
height: 32rpx;
|
|
99
|
+
background: #ff4d4f;
|
|
100
|
+
border-radius: 16rpx;
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
padding: 0 6rpx;
|
|
105
|
+
margin-right: 8rpx;
|
|
106
|
+
|
|
107
|
+
.badge-text {
|
|
108
|
+
font-size: 20rpx;
|
|
109
|
+
color: #fff;
|
|
110
|
+
line-height: 1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.menu-arrow {
|
|
115
|
+
font-size: 28rpx;
|
|
116
|
+
color: $text-3;
|
|
117
|
+
font-weight: 300;
|
|
118
|
+
line-height: 1;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
124
|
+
|
|
125
|
+
<script type="application/json">
|
|
126
|
+
{
|
|
127
|
+
"component": true
|
|
128
|
+
}
|
|
129
|
+
</script>
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="auth-none-data" style="margin-top: {{ marginTop }}rpx; padding-top: {{ paddingTop }}rpx;">
|
|
3
|
-
<image src="{{ resourceUrl + imgUrl }}" mode="heightFix" style="width: {{ imgWidth }};height: {{ imgHeight }};" />
|
|
4
|
-
<view class="holder-text" style="color: {{ contentColor }};margin-top: {{ imgTextGap }}rpx;">{{ content }}</view>
|
|
5
|
-
</view>
|
|
6
|
-
</template>
|
|
7
|
-
<script lang="ts">
|
|
8
|
-
import { createComponent } from "@mpxjs/core"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
createComponent({
|
|
12
|
-
properties: {
|
|
13
|
-
// 图片与文本之间的间距
|
|
14
|
-
imgTextGap: {
|
|
15
|
-
type: Number,
|
|
16
|
-
value: 0
|
|
17
|
-
},
|
|
18
|
-
// 上外边距
|
|
19
|
-
marginTop: {
|
|
20
|
-
type: Number,
|
|
21
|
-
value: 300
|
|
22
|
-
},
|
|
23
|
-
// 上内边距
|
|
24
|
-
paddingTop: {
|
|
25
|
-
type: Number,
|
|
26
|
-
value: 0
|
|
27
|
-
},
|
|
28
|
-
// 文本内容
|
|
29
|
-
content: {
|
|
30
|
-
type: String,
|
|
31
|
-
value: "暂无数据"
|
|
32
|
-
},
|
|
33
|
-
// 图片的宽
|
|
34
|
-
imgWidth: {
|
|
35
|
-
type: String,
|
|
36
|
-
value: "auto"
|
|
37
|
-
},
|
|
38
|
-
// 图片的高
|
|
39
|
-
imgHeight: {
|
|
40
|
-
type: String,
|
|
41
|
-
value: "125px"
|
|
42
|
-
},
|
|
43
|
-
// 图片的路径
|
|
44
|
-
imgUrl: {
|
|
45
|
-
type: String,
|
|
46
|
-
value: "/components/contacts_nomore2x.png"
|
|
47
|
-
},
|
|
48
|
-
contentColor: {
|
|
49
|
-
type: String,
|
|
50
|
-
value: "#b6b6b6"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
setup() {
|
|
54
|
-
let config = getApp().globalData.config;
|
|
55
|
-
let resourceUrl = config.resourceUrl + "/images/"
|
|
56
|
-
return {
|
|
57
|
-
resourceUrl
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<style lang="scss">
|
|
64
|
-
@use "../../styles/index.scss" as *;
|
|
65
|
-
|
|
66
|
-
.auth-none-data {
|
|
67
|
-
display: flex;
|
|
68
|
-
align-items: center;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
flex-direction: column;
|
|
71
|
-
|
|
72
|
-
.holder-text {
|
|
73
|
-
font-size: $font-size;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
</style>
|
|
77
|
-
|
|
78
|
-
<script type="application/json">
|
|
79
|
-
{
|
|
80
|
-
"component": true
|
|
81
|
-
}
|
|
82
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="auth-none-data" style="margin-top: {{ marginTop }}rpx; padding-top: {{ paddingTop }}rpx;">
|
|
3
|
+
<image src="{{ resourceUrl + imgUrl }}" mode="heightFix" style="width: {{ imgWidth }};height: {{ imgHeight }};" />
|
|
4
|
+
<view class="holder-text" style="color: {{ contentColor }};margin-top: {{ imgTextGap }}rpx;">{{ content }}</view>
|
|
5
|
+
</view>
|
|
6
|
+
</template>
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { createComponent } from "@mpxjs/core"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
createComponent({
|
|
12
|
+
properties: {
|
|
13
|
+
// 图片与文本之间的间距
|
|
14
|
+
imgTextGap: {
|
|
15
|
+
type: Number,
|
|
16
|
+
value: 0
|
|
17
|
+
},
|
|
18
|
+
// 上外边距
|
|
19
|
+
marginTop: {
|
|
20
|
+
type: Number,
|
|
21
|
+
value: 300
|
|
22
|
+
},
|
|
23
|
+
// 上内边距
|
|
24
|
+
paddingTop: {
|
|
25
|
+
type: Number,
|
|
26
|
+
value: 0
|
|
27
|
+
},
|
|
28
|
+
// 文本内容
|
|
29
|
+
content: {
|
|
30
|
+
type: String,
|
|
31
|
+
value: "暂无数据"
|
|
32
|
+
},
|
|
33
|
+
// 图片的宽
|
|
34
|
+
imgWidth: {
|
|
35
|
+
type: String,
|
|
36
|
+
value: "auto"
|
|
37
|
+
},
|
|
38
|
+
// 图片的高
|
|
39
|
+
imgHeight: {
|
|
40
|
+
type: String,
|
|
41
|
+
value: "125px"
|
|
42
|
+
},
|
|
43
|
+
// 图片的路径
|
|
44
|
+
imgUrl: {
|
|
45
|
+
type: String,
|
|
46
|
+
value: "/components/contacts_nomore2x.png"
|
|
47
|
+
},
|
|
48
|
+
contentColor: {
|
|
49
|
+
type: String,
|
|
50
|
+
value: "#b6b6b6"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
setup() {
|
|
54
|
+
let config = getApp().globalData.config;
|
|
55
|
+
let resourceUrl = config.resourceUrl + "/images/"
|
|
56
|
+
return {
|
|
57
|
+
resourceUrl
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="scss">
|
|
64
|
+
@use "../../styles/index.scss" as *;
|
|
65
|
+
|
|
66
|
+
.auth-none-data {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
|
|
72
|
+
.holder-text {
|
|
73
|
+
font-size: $font-size;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
77
|
+
|
|
78
|
+
<script type="application/json">
|
|
79
|
+
{
|
|
80
|
+
"component": true
|
|
81
|
+
}
|
|
82
|
+
</script>
|