jmash-core-mp 0.1.28 → 0.1.30
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/lib/api/files/index.js +0 -1
- package/lib/components/cms/cms-channel-list.mpx.d.ts +1 -0
- package/lib/components/cms/jmash-cms-acticle-list.mpx.d.ts +1 -0
- package/lib/components/cms/jmash-cms-activity-page.mpx.d.ts +1 -0
- package/lib/components/cms/jmash-cms-location-page.mpx.d.ts +1 -0
- package/lib/components/common/jmash-none-data.mpx.d.ts +1 -0
- package/lib/packages/pages/cms/cms-info.mpx.d.ts +1 -0
- package/lib/packages/pages/cms/cms-list.mpx.d.ts +1 -0
- package/lib/store/user.js +0 -1
- package/lib/utils/common.js +0 -1
- package/lib/utils/request.js +0 -3
- package/package.json +1 -1
- package/src/api/files/index.ts +0 -1
- package/src/components/common/jmash-stepper.mpx +28 -6
- package/src/components/common/jmash-top-navigation.mpx +2 -2
package/lib/api/files/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/store/user.js
CHANGED
|
@@ -115,7 +115,6 @@ export const useUserStore = defineStore("user", {
|
|
|
115
115
|
},
|
|
116
116
|
// 登录处理
|
|
117
117
|
loginProcess(resp) {
|
|
118
|
-
//console.log("miniappLogin", resp);
|
|
119
118
|
if (resp.statusCode === 200 && resp.data.status === true) {
|
|
120
119
|
console.log("login success");
|
|
121
120
|
this.loginSuccess(resp.data.token);
|
package/lib/utils/common.js
CHANGED
|
@@ -151,7 +151,6 @@ export const validateRules = (value, message, rules) => {
|
|
|
151
151
|
* @param {string} message 错误提示信息
|
|
152
152
|
*/
|
|
153
153
|
export const validateRequired = (value, message) => {
|
|
154
|
-
console.log(value, message);
|
|
155
154
|
const valueStr = typeof value === "number" ? String(value) : value;
|
|
156
155
|
if (!valueStr || valueStr.trim() === "") {
|
|
157
156
|
// 显示错误提示
|
package/lib/utils/request.js
CHANGED
|
@@ -12,7 +12,6 @@ mpx.xfetch.interceptors.request.use(function (config) {
|
|
|
12
12
|
const appconfig = getApp().globalData.config;
|
|
13
13
|
config.url = appconfig.baseUrl + config.url;
|
|
14
14
|
}
|
|
15
|
-
//console.log("request:", config);
|
|
16
15
|
// Grpc Gateway 清理默认值,Enum,时间等不能空;
|
|
17
16
|
grpc.clearEmpty(config.params);
|
|
18
17
|
grpc.clearEmpty(config.data);
|
|
@@ -43,7 +42,6 @@ mpx.xfetch.interceptors.request.use(function (config) {
|
|
|
43
42
|
else {
|
|
44
43
|
delete config.header["Grpc-Metadata-Tenant"];
|
|
45
44
|
}
|
|
46
|
-
//console.log("header:", config.header);
|
|
47
45
|
}
|
|
48
46
|
else if (!db.getRefreshToken()) {
|
|
49
47
|
console.log("not token request. ");
|
|
@@ -86,7 +84,6 @@ mpx.xfetch.interceptors.request.use(function (config) {
|
|
|
86
84
|
return config;
|
|
87
85
|
});
|
|
88
86
|
mpx.xfetch.interceptors.response.use(function (res) {
|
|
89
|
-
// console.log(“response:”,res);
|
|
90
87
|
if (res.statusCode === 200) {
|
|
91
88
|
return res;
|
|
92
89
|
}
|
package/package.json
CHANGED
package/src/api/files/index.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
</view>
|
|
9
9
|
|
|
10
10
|
<!-- 数量输入框 -->
|
|
11
|
-
<input class="stepper-input" type="number" value="{{
|
|
12
|
-
bind:input="handleInput" />
|
|
11
|
+
<input class="stepper-input" type="number" value="{{ displayValue + '' }}" disabled="{{ disabled }}"
|
|
12
|
+
bind:input="handleInput" bind:blur="handleBlur" />
|
|
13
13
|
|
|
14
14
|
<!-- 增加按钮 -->
|
|
15
15
|
<view class="stepper-btn {{ disabled || incDisabled ? 'disabled' : '' }}"
|
|
@@ -44,6 +44,7 @@ createComponent({
|
|
|
44
44
|
value: 1,
|
|
45
45
|
observer() {
|
|
46
46
|
this.quantity = this.value;
|
|
47
|
+
this.displayValue = this.value;
|
|
47
48
|
},
|
|
48
49
|
},
|
|
49
50
|
// 是否禁用按钮
|
|
@@ -60,12 +61,14 @@ createComponent({
|
|
|
60
61
|
setup() {
|
|
61
62
|
// 数量
|
|
62
63
|
let quantity = ref(1);
|
|
64
|
+
// 输入框显示值(允许为空字符串)
|
|
65
|
+
let displayValue = ref(1 as number | string);
|
|
63
66
|
// 减少按钮是否禁用
|
|
64
67
|
let decDisabled = ref(false);
|
|
65
68
|
// 增加按钮是否禁用
|
|
66
69
|
let incDisabled = ref(false);
|
|
67
70
|
|
|
68
|
-
return { quantity, decDisabled, incDisabled }
|
|
71
|
+
return { quantity, displayValue, decDisabled, incDisabled }
|
|
69
72
|
},
|
|
70
73
|
lifetimes: {
|
|
71
74
|
ready() {
|
|
@@ -80,6 +83,7 @@ createComponent({
|
|
|
80
83
|
// 处理初始值无效的情况
|
|
81
84
|
if (initValue === null || initValue === undefined) {
|
|
82
85
|
this.quantity = 1;
|
|
86
|
+
this.displayValue = 1;
|
|
83
87
|
this.decDisabled = false;
|
|
84
88
|
this.incDisabled = false;
|
|
85
89
|
return;
|
|
@@ -92,6 +96,7 @@ createComponent({
|
|
|
92
96
|
} else {
|
|
93
97
|
this.quantity = initValue;
|
|
94
98
|
}
|
|
99
|
+
this.displayValue = this.quantity;
|
|
95
100
|
// 更新按钮禁用状态
|
|
96
101
|
this.updateButtonStatus();
|
|
97
102
|
},
|
|
@@ -116,6 +121,7 @@ createComponent({
|
|
|
116
121
|
if (this.quantity < this.minNum) {
|
|
117
122
|
this.quantity = this.minNum;
|
|
118
123
|
}
|
|
124
|
+
this.displayValue = this.quantity;
|
|
119
125
|
// 更新按钮禁用状态
|
|
120
126
|
this.updateButtonStatus();
|
|
121
127
|
this.triggerEvent("quantity", this.quantity);
|
|
@@ -133,6 +139,7 @@ createComponent({
|
|
|
133
139
|
if (this.maxNum >= 0 && this.quantity > this.maxNum) {
|
|
134
140
|
this.quantity = this.maxNum;
|
|
135
141
|
}
|
|
142
|
+
this.displayValue = this.quantity;
|
|
136
143
|
// 更新按钮禁用状态
|
|
137
144
|
this.updateButtonStatus();
|
|
138
145
|
this.triggerEvent("quantity", this.quantity);
|
|
@@ -140,8 +147,14 @@ createComponent({
|
|
|
140
147
|
|
|
141
148
|
// 输入数量处理
|
|
142
149
|
handleInput(e: EventBase) {
|
|
143
|
-
|
|
144
|
-
|
|
150
|
+
const rawVal = e.detail.value;
|
|
151
|
+
// 输入框为空,更新显示值但不触发事件
|
|
152
|
+
if (rawVal === "" || rawVal === undefined || rawVal === null) {
|
|
153
|
+
this.displayValue = "";
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
let value = parseInt(rawVal);
|
|
157
|
+
if (isNaN(value)) return;
|
|
145
158
|
// 确保输入值在 [minNum, maxNum] 范围内
|
|
146
159
|
if (value < this.minNum) {
|
|
147
160
|
value = this.minNum;
|
|
@@ -149,10 +162,19 @@ createComponent({
|
|
|
149
162
|
value = this.maxNum;
|
|
150
163
|
}
|
|
151
164
|
this.quantity = value;
|
|
165
|
+
this.displayValue = value;
|
|
152
166
|
// 更新按钮禁用状态
|
|
153
167
|
this.updateButtonStatus();
|
|
154
168
|
this.triggerEvent("quantity", this.quantity);
|
|
155
|
-
}
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
// 输入框失焦,如果为空则恢复原值
|
|
172
|
+
handleBlur() {
|
|
173
|
+
if (this.displayValue === "" || this.displayValue === undefined || this.displayValue === null) {
|
|
174
|
+
this.displayValue = this.quantity;
|
|
175
|
+
this.triggerEvent("quantity", this.quantity);
|
|
176
|
+
}
|
|
177
|
+
},
|
|
156
178
|
}
|
|
157
179
|
})
|
|
158
180
|
</script>
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
<view class="nav-bar-content"
|
|
5
5
|
style="color: {{ currentTitleColor }}; height: {{ style.height }}px;padding-top: {{ style.paddingTop }}px;">
|
|
6
6
|
<!-- 左侧区域 -->
|
|
7
|
-
<view class="nav-bar-left"
|
|
7
|
+
<view class="nav-bar-left">
|
|
8
8
|
<view class="left-icon" wx:if="{{ leftIcon }}"
|
|
9
9
|
bind:tap="{{ leftIcon === 'home' ? 'handleIndex' : 'handleReturn' }}">
|
|
10
10
|
<cube-icon type="{{ leftIcon === 'home' ? 'home' : 'back' }}" size="30rpx"
|
|
11
11
|
color="{{ currentTitleColor }}" />
|
|
12
12
|
</view>
|
|
13
|
-
<slot />
|
|
13
|
+
<slot name="left" />
|
|
14
14
|
</view>
|
|
15
15
|
|
|
16
16
|
<!-- 标题区域 -->
|