jmash-core-mp 0.1.76 → 0.1.78
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/.gitignore +8 -0
- package/.npmignore +44 -0
- package/README.md +60 -60
- package/babel.config.json +34 -34
- package/eslint.config.mjs +7 -7
- package/lib/api/auth/index.d.ts +22 -22
- package/lib/api/auth/index.js +211 -211
- package/lib/api/auth/types.d.ts +90 -90
- 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 +201 -201
- package/lib/api/cms/types.js +1 -1
- package/lib/api/constant.d.ts +6 -6
- package/lib/api/constant.js +8 -8
- package/lib/api/dict/index.d.ts +24 -24
- package/lib/api/dict/index.js +51 -51
- package/lib/api/dict/types.d.ts +40 -40
- package/lib/api/dict/types.js +1 -1
- package/lib/api/dicts.d.ts +32 -32
- package/lib/api/dicts.js +118 -118
- package/lib/api/files/index.d.ts +25 -25
- package/lib/api/files/index.js +134 -134
- package/lib/api/files/types.d.ts +38 -38
- package/lib/api/files/types.js +1 -1
- package/lib/api/index.d.ts +5 -5
- package/lib/api/index.js +8 -8
- package/lib/api/myorgan/index.d.ts +8 -8
- package/lib/api/myorgan/index.js +24 -24
- 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 +20 -20
- package/lib/api/region/types.d.ts +19 -19
- package/lib/api/region/types.js +1 -1
- package/lib/api/shop/index.d.ts +11 -11
- package/lib/api/shop/index.js +53 -53
- package/lib/api/shop/types.d.ts +123 -123
- package/lib/api/shop/types.js +1 -1
- package/lib/api/storage/index.d.ts +11 -11
- package/lib/api/storage/index.js +53 -53
- package/lib/api/storage/types.d.ts +39 -39
- package/lib/api/storage/types.js +1 -1
- package/lib/api/types.d.ts +43 -43
- package/lib/api/types.js +1 -1
- package/lib/components/organ/browser-organ-list.mpx.d.ts +1 -1
- package/lib/components/organ/my-organ-list.mpx.d.ts +1 -1
- package/lib/components/{auth-user/jmash-update-user.mpx.d.ts → organ/organ-search.mpx.d.ts} +1 -1
- package/lib/components/{auth-user/jmash-user.mpx.d.ts → shop/branch-search.mpx.d.ts} +1 -1
- package/lib/components/{core/jmash-login.mpx.d.ts → shop/shop-search.mpx.d.ts} +1 -1
- package/lib/index.d.ts +28 -28
- package/lib/index.js +23 -23
- package/lib/{packages/pages/auth/setting-page.mpx.d.ts → pages/branch-search.mpx.d.ts} +1 -1
- package/lib/pages/organ-search.mpx.d.ts +1 -0
- package/lib/pages/organ.mpx.d.ts +1 -1
- package/lib/pages/shop-search.mpx.d.ts +1 -0
- package/lib/store/organ.d.ts +19 -19
- package/lib/store/organ.js +83 -83
- package/lib/store/shop.d.ts +18 -18
- package/lib/store/shop.js +104 -104
- package/lib/store/user.d.ts +35 -35
- package/lib/store/user.js +243 -243
- package/lib/utils/common.d.ts +37 -35
- package/lib/utils/common.js +178 -165
- package/lib/utils/config.d.ts +5 -5
- package/lib/utils/config.js +36 -36
- package/lib/utils/db.d.ts +52 -52
- package/lib/utils/db.js +202 -202
- 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 +114 -114
- package/lib/utils/share.d.ts +16 -16
- package/lib/utils/share.js +196 -196
- package/mpx.config.js +38 -38
- package/package.json +1 -1
- package/pnpm-workspace.yaml +5 -0
- 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 +241 -241
- package/src/api/auth/types.ts +173 -173
- package/src/api/cms/index.ts +218 -218
- package/src/api/cms/types.ts +385 -385
- package/src/api/constant.ts +8 -8
- package/src/api/dict/index.ts +68 -68
- package/src/api/dict/types.ts +73 -73
- package/src/api/dicts.ts +132 -132
- package/src/api/files/index.ts +162 -162
- package/src/api/files/types.ts +67 -67
- package/src/api/index.ts +15 -15
- package/src/api/myorgan/index.ts +29 -29
- package/src/api/myorgan/types.ts +42 -42
- package/src/api/region/index.ts +24 -24
- package/src/api/region/types.ts +36 -36
- package/src/api/shop/index.ts +74 -74
- package/src/api/shop/types.ts +244 -244
- package/src/api/storage/index.ts +74 -74
- package/src/api/storage/types.ts +74 -74
- package/src/api/types.ts +74 -74
- package/src/app.mpx +78 -78
- package/src/components/auth-user/jmash-logout.mpx +93 -93
- package/src/components/auth-user/jmash-update-user.mpx +387 -387
- package/src/components/auth-user/jmash-update-user.web.mpx +367 -367
- package/src/components/auth-user/jmash-user.mpx +310 -310
- package/src/components/cms/jmash-cms-activity-item.mpx +207 -207
- package/src/components/cms/jmash-cms-activity-list.mpx +357 -357
- package/src/components/cms/jmash-cms-article-item.mpx +221 -221
- package/src/components/cms/jmash-cms-article-list.mpx +248 -248
- package/src/components/cms/jmash-cms-article-view.mpx +131 -131
- package/src/components/cms/jmash-cms-article.mpx +231 -231
- package/src/components/cms/jmash-cms-like.mpx +151 -151
- package/src/components/cms/jmash-cms-location-list.mpx +286 -286
- package/src/components/cms/jmash-cms-location.mpx +256 -256
- package/src/components/cms/jmash-cms-product-item.mpx +185 -185
- package/src/components/cms/jmash-cms-product-list.mpx +230 -230
- package/src/components/common/jmash-avatar-edit.mpx +154 -154
- package/src/components/common/jmash-cascader-region.mpx +118 -118
- package/src/components/common/jmash-cell-group.mpx +206 -206
- package/src/components/common/jmash-code-interest-popup.mpx +223 -223
- package/src/components/common/jmash-form-cell.mpx +491 -525
- package/src/components/common/jmash-menu.mpx +129 -129
- package/src/components/common/jmash-none-data.mpx +95 -95
- package/src/components/common/jmash-pic-swiper.mpx +72 -72
- package/src/components/common/jmash-popup.mpx +138 -138
- package/src/components/common/jmash-search.mpx +130 -130
- package/src/components/common/jmash-single-btn.mpx +53 -53
- package/src/components/common/jmash-stepper.mpx +236 -236
- package/src/components/common/jmash-swipe-cell.mpx +153 -153
- package/src/components/common/jmash-tab-bar.mpx +58 -58
- 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 +199 -199
- package/src/components/core/jmash-cms-protocol.mpx +72 -72
- package/src/components/core/jmash-login.ali.mpx +284 -284
- package/src/components/core/jmash-login.mpx +378 -378
- package/src/components/core/jmash-login.web.mpx +420 -420
- package/src/components/core/jmash-popup-login.ali.mpx +312 -312
- package/src/components/core/jmash-popup-login.mpx +414 -416
- package/src/components/core/jmash-popup-login.web.mpx +389 -389
- package/src/components/organ/browser-organ-list.mpx +66 -66
- package/src/components/organ/my-organ-list.mpx +67 -67
- package/src/components/organ/organ-item.mpx +124 -124
- package/src/components/organ/organ-search.mpx +148 -148
- package/src/components/organ/organ-selected-item.mpx +88 -88
- package/src/components/shop/branch-item.mpx +111 -111
- package/src/components/shop/branch-search.mpx +142 -142
- package/src/components/shop/shop-item.mpx +112 -112
- package/src/components/shop/shop-search.mpx +142 -142
- package/src/components/shop/shop-selected-item.mpx +89 -89
- package/src/custom-tab-bar/index.mpx +10 -10
- package/src/global.d.ts +11 -11
- package/src/index.ts +94 -94
- package/src/packages/index.mpx +16 -16
- package/src/packages/pages/auth/cms-protocol.mpx +35 -35
- package/src/packages/pages/auth/login.mpx +62 -62
- package/src/packages/pages/auth/setting-page.mpx +134 -134
- package/src/packages/pages/auth/update-user.mpx +17 -17
- package/src/packages/pages/cms/cms-activity-list.mpx +86 -86
- package/src/packages/pages/cms/cms-article-list.mpx +88 -88
- package/src/packages/pages/cms/cms-article.mpx +32 -32
- package/src/packages/pages/cms/cms-location-list.mpx +83 -83
- package/src/packages/pages/cms/cms-location.mpx +32 -32
- package/src/packages/pages/cms/cms-product-list.mpx +88 -88
- package/src/packages/pages/share/scan.mpx +103 -103
- package/src/pages/basic-component.mpx +30 -30
- package/src/pages/branch-search.mpx +60 -60
- package/src/pages/half-home.mpx +58 -58
- package/src/pages/home.mpx +54 -54
- package/src/pages/home2.mpx +45 -45
- package/src/pages/index.mpx +43 -43
- package/src/pages/organ-search.mpx +60 -60
- package/src/pages/organ.mpx +105 -105
- package/src/pages/shop-search.mpx +60 -60
- package/src/pages/tabbar/home.mpx +114 -114
- package/src/pages/tabbar/mall.mpx +87 -87
- package/src/pages/tabbar/my.mpx +79 -79
- package/src/pages/tabbar/organ.mpx +86 -86
- package/src/store/organ.ts +100 -100
- package/src/store/shop.ts +130 -130
- package/src/store/user.ts +288 -288
- package/src/styles/index.scss +20 -20
- package/src/styles/vars.scss +27 -27
- package/src/utils/common.ts +196 -178
- package/src/utils/config.ts +43 -43
- package/src/utils/db.ts +229 -229
- package/src/utils/grpc.ts +21 -21
- package/src/utils/net.ts +18 -18
- package/src/utils/request.ts +126 -126
- package/src/utils/share.ts +194 -194
- 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
- package/lib/packages/pages/share/scan.mpx.d.ts +0 -1
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- 左滑删除单元格 -->
|
|
3
|
-
<view class="swipe-cell" bind:touchstart="onTouchStart" bind:touchmove="onTouchMove" bind:touchend="onTouchEnd">
|
|
4
|
-
<!-- 删除按钮 -->
|
|
5
|
-
<view class="swipe-cell-actions" style="width: {{ actionTotalWidth }}px;">
|
|
6
|
-
<view class="swipe-cell-delete" style="width: {{ actionWidth }}px;" catch:tap="handleDelete">
|
|
7
|
-
{{ deleteText }}
|
|
8
|
-
</view>
|
|
9
|
-
</view>
|
|
10
|
-
<!-- 内容 -->
|
|
11
|
-
<view class="swipe-cell-content" style="transform: translate3d({{ translateX }}px, 0, 0);">
|
|
12
|
-
<slot />
|
|
13
|
-
</view>
|
|
14
|
-
</view>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script lang="ts">
|
|
18
|
-
import mpx, { createComponent, ref } from "@mpxjs/core";
|
|
19
|
-
import { EventBase } from "../../api/types";
|
|
20
|
-
|
|
21
|
-
createComponent({
|
|
22
|
-
options: {
|
|
23
|
-
styleIsolation: "apply-shared",
|
|
24
|
-
},
|
|
25
|
-
properties: {
|
|
26
|
-
// 当前展开项的 key(父组件传入,用于协调一次只展开一个)
|
|
27
|
-
activeKey: {
|
|
28
|
-
type: String,
|
|
29
|
-
value: "",
|
|
30
|
-
observer(newVal: string) {
|
|
31
|
-
if (newVal !== this.itemKey) {
|
|
32
|
-
this.translateX = 0;
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
// 本项唯一 key
|
|
37
|
-
itemKey: {
|
|
38
|
-
type: String,
|
|
39
|
-
value: "",
|
|
40
|
-
},
|
|
41
|
-
// 删除按钮文字
|
|
42
|
-
deleteText: {
|
|
43
|
-
type: String,
|
|
44
|
-
value: "删除",
|
|
45
|
-
},
|
|
46
|
-
// 删除按钮宽度(rpx)
|
|
47
|
-
deleteWidth: {
|
|
48
|
-
type: Number,
|
|
49
|
-
value: 110,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
setup(props) {
|
|
53
|
-
// 滑动偏移量(px)
|
|
54
|
-
let translateX = ref(0);
|
|
55
|
-
// 触摸开始 X 坐标
|
|
56
|
-
let touchStartX = ref(0);
|
|
57
|
-
// 触摸开始偏移量
|
|
58
|
-
let touchStartOffsetX = ref(0);
|
|
59
|
-
// 删除按钮宽度(px)
|
|
60
|
-
const systemInfo = mpx.getSystemInfoSync();
|
|
61
|
-
let actionWidth = ref(Math.round((props.deleteWidth * systemInfo.windowWidth) / 750));
|
|
62
|
-
// 删除按钮总宽度(含间距,px)
|
|
63
|
-
let actionTotalWidth = ref(actionWidth.value + Math.round((2 * systemInfo.windowWidth) / 750));
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
translateX,
|
|
67
|
-
touchStartX,
|
|
68
|
-
touchStartOffsetX,
|
|
69
|
-
actionWidth,
|
|
70
|
-
actionTotalWidth,
|
|
71
|
-
};
|
|
72
|
-
},
|
|
73
|
-
methods: {
|
|
74
|
-
// 触摸开始
|
|
75
|
-
onTouchStart(e: EventBase) {
|
|
76
|
-
const startX = e.touches?.[0]?.clientX ?? 0;
|
|
77
|
-
this.touchStartX = startX;
|
|
78
|
-
this.touchStartOffsetX = this.translateX;
|
|
79
|
-
// 通知父组件本项开始滑动,协调关闭其他项
|
|
80
|
-
this.triggerEvent("open", { key: this.itemKey });
|
|
81
|
-
},
|
|
82
|
-
// 触摸移动
|
|
83
|
-
onTouchMove(e: EventBase) {
|
|
84
|
-
const moveX = e.touches?.[0]?.clientX ?? 0;
|
|
85
|
-
const deltaX = moveX - this.touchStartX;
|
|
86
|
-
const nextOffset = Math.max(
|
|
87
|
-
-this.actionTotalWidth,
|
|
88
|
-
Math.min(0, this.touchStartOffsetX + deltaX)
|
|
89
|
-
);
|
|
90
|
-
this.translateX = nextOffset;
|
|
91
|
-
},
|
|
92
|
-
// 触摸结束
|
|
93
|
-
onTouchEnd() {
|
|
94
|
-
if (this.translateX < -this.actionWidth / 2) {
|
|
95
|
-
this.translateX = -this.actionTotalWidth;
|
|
96
|
-
} else {
|
|
97
|
-
this.translateX = 0;
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
// 点击删除按钮
|
|
101
|
-
handleDelete() {
|
|
102
|
-
this.triggerEvent("delete", { key: this.itemKey });
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
});
|
|
106
|
-
</script>
|
|
107
|
-
|
|
108
|
-
<style lang="scss">
|
|
109
|
-
@use "../../styles/index.scss" as *;
|
|
110
|
-
|
|
111
|
-
.swipe-cell {
|
|
112
|
-
position: relative;
|
|
113
|
-
overflow: hidden;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// 删除按钮区域
|
|
117
|
-
.swipe-cell-actions {
|
|
118
|
-
position: absolute;
|
|
119
|
-
top: 0;
|
|
120
|
-
right: 0;
|
|
121
|
-
height: 100%;
|
|
122
|
-
display: flex;
|
|
123
|
-
justify-content: flex-end;
|
|
124
|
-
align-items: stretch;
|
|
125
|
-
z-index: 1;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// 删除按钮
|
|
129
|
-
.swipe-cell-delete {
|
|
130
|
-
display: flex;
|
|
131
|
-
align-items: center;
|
|
132
|
-
justify-content: center;
|
|
133
|
-
background-color: $red-color;
|
|
134
|
-
color: $white-color;
|
|
135
|
-
font-size: 28rpx;
|
|
136
|
-
border-radius: $border-mini-radius;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// 滑动内容
|
|
140
|
-
.swipe-cell-content {
|
|
141
|
-
position: relative;
|
|
142
|
-
z-index: 2;
|
|
143
|
-
will-change: transform;
|
|
144
|
-
transition: transform 0.15s ease-out;
|
|
145
|
-
}
|
|
146
|
-
</style>
|
|
147
|
-
|
|
148
|
-
<script type="application/json">
|
|
149
|
-
{
|
|
150
|
-
"component": true,
|
|
151
|
-
"usingComponents": {}
|
|
152
|
-
}
|
|
153
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 左滑删除单元格 -->
|
|
3
|
+
<view class="swipe-cell" bind:touchstart="onTouchStart" bind:touchmove="onTouchMove" bind:touchend="onTouchEnd">
|
|
4
|
+
<!-- 删除按钮 -->
|
|
5
|
+
<view class="swipe-cell-actions" style="width: {{ actionTotalWidth }}px;">
|
|
6
|
+
<view class="swipe-cell-delete" style="width: {{ actionWidth }}px;" catch:tap="handleDelete">
|
|
7
|
+
{{ deleteText }}
|
|
8
|
+
</view>
|
|
9
|
+
</view>
|
|
10
|
+
<!-- 内容 -->
|
|
11
|
+
<view class="swipe-cell-content" style="transform: translate3d({{ translateX }}px, 0, 0);">
|
|
12
|
+
<slot />
|
|
13
|
+
</view>
|
|
14
|
+
</view>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
import mpx, { createComponent, ref } from "@mpxjs/core";
|
|
19
|
+
import { EventBase } from "../../api/types";
|
|
20
|
+
|
|
21
|
+
createComponent({
|
|
22
|
+
options: {
|
|
23
|
+
styleIsolation: "apply-shared",
|
|
24
|
+
},
|
|
25
|
+
properties: {
|
|
26
|
+
// 当前展开项的 key(父组件传入,用于协调一次只展开一个)
|
|
27
|
+
activeKey: {
|
|
28
|
+
type: String,
|
|
29
|
+
value: "",
|
|
30
|
+
observer(newVal: string) {
|
|
31
|
+
if (newVal !== this.itemKey) {
|
|
32
|
+
this.translateX = 0;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
// 本项唯一 key
|
|
37
|
+
itemKey: {
|
|
38
|
+
type: String,
|
|
39
|
+
value: "",
|
|
40
|
+
},
|
|
41
|
+
// 删除按钮文字
|
|
42
|
+
deleteText: {
|
|
43
|
+
type: String,
|
|
44
|
+
value: "删除",
|
|
45
|
+
},
|
|
46
|
+
// 删除按钮宽度(rpx)
|
|
47
|
+
deleteWidth: {
|
|
48
|
+
type: Number,
|
|
49
|
+
value: 110,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
setup(props) {
|
|
53
|
+
// 滑动偏移量(px)
|
|
54
|
+
let translateX = ref(0);
|
|
55
|
+
// 触摸开始 X 坐标
|
|
56
|
+
let touchStartX = ref(0);
|
|
57
|
+
// 触摸开始偏移量
|
|
58
|
+
let touchStartOffsetX = ref(0);
|
|
59
|
+
// 删除按钮宽度(px)
|
|
60
|
+
const systemInfo = mpx.getSystemInfoSync();
|
|
61
|
+
let actionWidth = ref(Math.round((props.deleteWidth * systemInfo.windowWidth) / 750));
|
|
62
|
+
// 删除按钮总宽度(含间距,px)
|
|
63
|
+
let actionTotalWidth = ref(actionWidth.value + Math.round((2 * systemInfo.windowWidth) / 750));
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
translateX,
|
|
67
|
+
touchStartX,
|
|
68
|
+
touchStartOffsetX,
|
|
69
|
+
actionWidth,
|
|
70
|
+
actionTotalWidth,
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
// 触摸开始
|
|
75
|
+
onTouchStart(e: EventBase) {
|
|
76
|
+
const startX = e.touches?.[0]?.clientX ?? 0;
|
|
77
|
+
this.touchStartX = startX;
|
|
78
|
+
this.touchStartOffsetX = this.translateX;
|
|
79
|
+
// 通知父组件本项开始滑动,协调关闭其他项
|
|
80
|
+
this.triggerEvent("open", { key: this.itemKey });
|
|
81
|
+
},
|
|
82
|
+
// 触摸移动
|
|
83
|
+
onTouchMove(e: EventBase) {
|
|
84
|
+
const moveX = e.touches?.[0]?.clientX ?? 0;
|
|
85
|
+
const deltaX = moveX - this.touchStartX;
|
|
86
|
+
const nextOffset = Math.max(
|
|
87
|
+
-this.actionTotalWidth,
|
|
88
|
+
Math.min(0, this.touchStartOffsetX + deltaX)
|
|
89
|
+
);
|
|
90
|
+
this.translateX = nextOffset;
|
|
91
|
+
},
|
|
92
|
+
// 触摸结束
|
|
93
|
+
onTouchEnd() {
|
|
94
|
+
if (this.translateX < -this.actionWidth / 2) {
|
|
95
|
+
this.translateX = -this.actionTotalWidth;
|
|
96
|
+
} else {
|
|
97
|
+
this.translateX = 0;
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
// 点击删除按钮
|
|
101
|
+
handleDelete() {
|
|
102
|
+
this.triggerEvent("delete", { key: this.itemKey });
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<style lang="scss">
|
|
109
|
+
@use "../../styles/index.scss" as *;
|
|
110
|
+
|
|
111
|
+
.swipe-cell {
|
|
112
|
+
position: relative;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// 删除按钮区域
|
|
117
|
+
.swipe-cell-actions {
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: 0;
|
|
120
|
+
right: 0;
|
|
121
|
+
height: 100%;
|
|
122
|
+
display: flex;
|
|
123
|
+
justify-content: flex-end;
|
|
124
|
+
align-items: stretch;
|
|
125
|
+
z-index: 1;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// 删除按钮
|
|
129
|
+
.swipe-cell-delete {
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
background-color: $red-color;
|
|
134
|
+
color: $white-color;
|
|
135
|
+
font-size: 28rpx;
|
|
136
|
+
border-radius: $border-mini-radius;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// 滑动内容
|
|
140
|
+
.swipe-cell-content {
|
|
141
|
+
position: relative;
|
|
142
|
+
z-index: 2;
|
|
143
|
+
will-change: transform;
|
|
144
|
+
transition: transform 0.15s ease-out;
|
|
145
|
+
}
|
|
146
|
+
</style>
|
|
147
|
+
|
|
148
|
+
<script type="application/json">
|
|
149
|
+
{
|
|
150
|
+
"component": true,
|
|
151
|
+
"usingComponents": {}
|
|
152
|
+
}
|
|
153
|
+
</script>
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<cube-tab-bar wx:model="{{ selectedLabelDefault }}" wx:model-prop="value" tabs="{{ tabs }}"
|
|
3
|
-
bindclick="clickHandler">
|
|
4
|
-
</cube-tab-bar>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import mpx, { createComponent } from '@mpxjs/core'
|
|
9
|
-
createComponent({
|
|
10
|
-
data: {
|
|
11
|
-
selectedLabelDefault: 'Home',
|
|
12
|
-
tabs: [{
|
|
13
|
-
label: '首页',
|
|
14
|
-
value: 'Home',
|
|
15
|
-
pagePath: '/pages/tabbar/home',
|
|
16
|
-
icon: 'home'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: '组织',
|
|
20
|
-
value: 'Organ',
|
|
21
|
-
pagePath: '/pages/tabbar/organ',
|
|
22
|
-
icon: 'organ'
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: '电商',
|
|
26
|
-
value: 'Mall',
|
|
27
|
-
pagePath: '/pages/tabbar/mall',
|
|
28
|
-
icon: 'mall'
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
label: '我的',
|
|
32
|
-
value: 'My',
|
|
33
|
-
pagePath: '/pages/tabbar/my',
|
|
34
|
-
icon: 'user'
|
|
35
|
-
},]
|
|
36
|
-
},
|
|
37
|
-
methods: {
|
|
38
|
-
clickHandler(tab) {
|
|
39
|
-
const target = this.tabs.find(item => item.value === tab.detail.value)
|
|
40
|
-
if (target) {
|
|
41
|
-
mpx.switchTab({
|
|
42
|
-
url: target.pagePath
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
activeTab(value) {
|
|
47
|
-
this.selectedLabelDefault = value;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
</script>
|
|
52
|
-
<script type="application/json">
|
|
53
|
-
{
|
|
54
|
-
"usingComponents": {
|
|
55
|
-
"cube-tab-bar": "@mpxjs/mpx-cube-ui/lib/components/tab-bar/index.mpx"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<cube-tab-bar wx:model="{{ selectedLabelDefault }}" wx:model-prop="value" tabs="{{ tabs }}"
|
|
3
|
+
bindclick="clickHandler">
|
|
4
|
+
</cube-tab-bar>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import mpx, { createComponent } from '@mpxjs/core'
|
|
9
|
+
createComponent({
|
|
10
|
+
data: {
|
|
11
|
+
selectedLabelDefault: 'Home',
|
|
12
|
+
tabs: [{
|
|
13
|
+
label: '首页',
|
|
14
|
+
value: 'Home',
|
|
15
|
+
pagePath: '/pages/tabbar/home',
|
|
16
|
+
icon: 'home'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: '组织',
|
|
20
|
+
value: 'Organ',
|
|
21
|
+
pagePath: '/pages/tabbar/organ',
|
|
22
|
+
icon: 'organ'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: '电商',
|
|
26
|
+
value: 'Mall',
|
|
27
|
+
pagePath: '/pages/tabbar/mall',
|
|
28
|
+
icon: 'mall'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: '我的',
|
|
32
|
+
value: 'My',
|
|
33
|
+
pagePath: '/pages/tabbar/my',
|
|
34
|
+
icon: 'user'
|
|
35
|
+
},]
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
clickHandler(tab) {
|
|
39
|
+
const target = this.tabs.find(item => item.value === tab.detail.value)
|
|
40
|
+
if (target) {
|
|
41
|
+
mpx.switchTab({
|
|
42
|
+
url: target.pagePath
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
activeTab(value) {
|
|
47
|
+
this.selectedLabelDefault = value;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
</script>
|
|
52
|
+
<script type="application/json">
|
|
53
|
+
{
|
|
54
|
+
"usingComponents": {
|
|
55
|
+
"cube-tab-bar": "@mpxjs/mpx-cube-ui/lib/components/tab-bar/index.mpx"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- 多行文本输入框 -->
|
|
3
|
-
<view class="jmash-textarea">
|
|
4
|
-
<textarea class="jmash-textarea-input" value="{{ textValue }}" placeholder="{{ placeholder }}"
|
|
5
|
-
placeholder-class="jmash-textarea-placeholder" maxlength="{{ maxlength }}" bind:input="getValue" />
|
|
6
|
-
<view wx:if="{{ maxlength > 0 }}" class="jmash-textarea-length"
|
|
7
|
-
style="{{ textValue.length === maxlength ? 'color: red' : '' }}">
|
|
8
|
-
{{ textValue.length }}/{{ maxlength }}
|
|
9
|
-
</view>
|
|
10
|
-
</view>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script lang="ts">
|
|
14
|
-
import { createComponent } from "@mpxjs/core";
|
|
15
|
-
|
|
16
|
-
createComponent({
|
|
17
|
-
/**
|
|
18
|
-
* 组件的属性列表
|
|
19
|
-
*/
|
|
20
|
-
properties: {
|
|
21
|
-
// 输入框的内容
|
|
22
|
-
textValue: {
|
|
23
|
-
type: String,
|
|
24
|
-
value: "",
|
|
25
|
-
},
|
|
26
|
-
// 输入框为空时占位符
|
|
27
|
-
placeholder: {
|
|
28
|
-
type: String,
|
|
29
|
-
value: "",
|
|
30
|
-
},
|
|
31
|
-
// 最大输入长度
|
|
32
|
-
maxlength: {
|
|
33
|
-
type: Number,
|
|
34
|
-
value: -1,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
/**
|
|
38
|
-
* 组件的方法列表
|
|
39
|
-
*/
|
|
40
|
-
methods: {
|
|
41
|
-
// 获取值
|
|
42
|
-
getValue(e: any) {
|
|
43
|
-
this.triggerEvent("getValue", e.detail.value);
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<style lang="scss">
|
|
50
|
-
@use "../../styles/index.scss" as *;
|
|
51
|
-
|
|
52
|
-
.jmash-textarea {
|
|
53
|
-
background-color: $white-color;
|
|
54
|
-
border-radius: 10rpx;
|
|
55
|
-
padding: 30rpx;
|
|
56
|
-
box-sizing: border-box;
|
|
57
|
-
margin: 20rpx 30rpx 0;
|
|
58
|
-
width: 690rpx;
|
|
59
|
-
|
|
60
|
-
.jmash-textarea-input {
|
|
61
|
-
height: 200rpx;
|
|
62
|
-
width: 100%;
|
|
63
|
-
font-size: 28rpx;
|
|
64
|
-
font-weight: 400;
|
|
65
|
-
color: $font-color;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.jmash-textarea-placeholder {
|
|
69
|
-
font-size: 28rpx;
|
|
70
|
-
font-weight: 400;
|
|
71
|
-
color: $font-color-grey-opacity;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.jmash-textarea-length {
|
|
75
|
-
font-size: 24rpx;
|
|
76
|
-
font-weight: 400;
|
|
77
|
-
color: $font-color;
|
|
78
|
-
text-align: right;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
</style>
|
|
82
|
-
|
|
83
|
-
<script type="application/json">
|
|
84
|
-
{
|
|
85
|
-
"component": true,
|
|
86
|
-
"usingComponents": {}
|
|
87
|
-
}
|
|
88
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 多行文本输入框 -->
|
|
3
|
+
<view class="jmash-textarea">
|
|
4
|
+
<textarea class="jmash-textarea-input" value="{{ textValue }}" placeholder="{{ placeholder }}"
|
|
5
|
+
placeholder-class="jmash-textarea-placeholder" maxlength="{{ maxlength }}" bind:input="getValue" />
|
|
6
|
+
<view wx:if="{{ maxlength > 0 }}" class="jmash-textarea-length"
|
|
7
|
+
style="{{ textValue.length === maxlength ? 'color: red' : '' }}">
|
|
8
|
+
{{ textValue.length }}/{{ maxlength }}
|
|
9
|
+
</view>
|
|
10
|
+
</view>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import { createComponent } from "@mpxjs/core";
|
|
15
|
+
|
|
16
|
+
createComponent({
|
|
17
|
+
/**
|
|
18
|
+
* 组件的属性列表
|
|
19
|
+
*/
|
|
20
|
+
properties: {
|
|
21
|
+
// 输入框的内容
|
|
22
|
+
textValue: {
|
|
23
|
+
type: String,
|
|
24
|
+
value: "",
|
|
25
|
+
},
|
|
26
|
+
// 输入框为空时占位符
|
|
27
|
+
placeholder: {
|
|
28
|
+
type: String,
|
|
29
|
+
value: "",
|
|
30
|
+
},
|
|
31
|
+
// 最大输入长度
|
|
32
|
+
maxlength: {
|
|
33
|
+
type: Number,
|
|
34
|
+
value: -1,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* 组件的方法列表
|
|
39
|
+
*/
|
|
40
|
+
methods: {
|
|
41
|
+
// 获取值
|
|
42
|
+
getValue(e: any) {
|
|
43
|
+
this.triggerEvent("getValue", e.detail.value);
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style lang="scss">
|
|
50
|
+
@use "../../styles/index.scss" as *;
|
|
51
|
+
|
|
52
|
+
.jmash-textarea {
|
|
53
|
+
background-color: $white-color;
|
|
54
|
+
border-radius: 10rpx;
|
|
55
|
+
padding: 30rpx;
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
margin: 20rpx 30rpx 0;
|
|
58
|
+
width: 690rpx;
|
|
59
|
+
|
|
60
|
+
.jmash-textarea-input {
|
|
61
|
+
height: 200rpx;
|
|
62
|
+
width: 100%;
|
|
63
|
+
font-size: 28rpx;
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
color: $font-color;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.jmash-textarea-placeholder {
|
|
69
|
+
font-size: 28rpx;
|
|
70
|
+
font-weight: 400;
|
|
71
|
+
color: $font-color-grey-opacity;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.jmash-textarea-length {
|
|
75
|
+
font-size: 24rpx;
|
|
76
|
+
font-weight: 400;
|
|
77
|
+
color: $font-color;
|
|
78
|
+
text-align: right;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
82
|
+
|
|
83
|
+
<script type="application/json">
|
|
84
|
+
{
|
|
85
|
+
"component": true,
|
|
86
|
+
"usingComponents": {}
|
|
87
|
+
}
|
|
88
|
+
</script>
|