gxd-uni-library-editx 1.0.135 → 1.0.136-beta2
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/package.json
CHANGED
|
@@ -696,6 +696,9 @@ export default {
|
|
|
696
696
|
|
|
697
697
|
//当前添加的卡信息
|
|
698
698
|
let currAddCard = this.selectedCardList.find(item => item.card_number == cardForm.card_number);
|
|
699
|
+
if(!currAddCard){
|
|
700
|
+
currAddCard = selected_card_list[0];
|
|
701
|
+
}
|
|
699
702
|
this.lastUseUnit = currAddCard.unit == '次' ? '次' : "";
|
|
700
703
|
}
|
|
701
704
|
this.xdDownDrawerNewCard = false;
|
|
@@ -91,7 +91,11 @@
|
|
|
91
91
|
|
|
92
92
|
<script>
|
|
93
93
|
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
94
|
-
import {
|
|
94
|
+
import {
|
|
95
|
+
PLATFORM_PARAM_SETTING,
|
|
96
|
+
getPlatformParamsValue,
|
|
97
|
+
getPlatformParamsForGroup
|
|
98
|
+
} from "@/project";
|
|
95
99
|
import storage from "@/common/storage";
|
|
96
100
|
import {
|
|
97
101
|
getParentsStyle,
|
|
@@ -176,12 +180,18 @@
|
|
|
176
180
|
|
|
177
181
|
//设置活动参数
|
|
178
182
|
let params = [];
|
|
179
|
-
let
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
let xParamsKey = getPlatformParamsForGroup([]);
|
|
184
|
+
xParamsKey.map(key=>{
|
|
185
|
+
let {paramKey, storageKey} = getPlatformParamsValue(key);
|
|
186
|
+
let value = storage.get(storageKey);
|
|
187
|
+
if(value) params.push(`${paramKey}=${value}`);
|
|
188
|
+
})
|
|
189
|
+
// let event = storage.get(PLATFORM_PARAM_SETTING.EVENT_PARAM_SAVE_KEY);
|
|
190
|
+
// let all = storage.get(PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME_SAVE_KEY);
|
|
191
|
+
// let test = storage.get(PLATFORM_PARAM_SETTING.TEST_PARAM_NAME_SAVE_KEY);
|
|
192
|
+
// if (event) params.push(`${PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME}=${event}`);
|
|
193
|
+
// if (all) params.push(`${PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME}=${all}`);
|
|
194
|
+
// if (test) params.push(`${PLATFORM_PARAM_SETTING.TEST_PARAM_NAME}=${test}`);
|
|
185
195
|
this.params = params.join("&");
|
|
186
196
|
|
|
187
197
|
this.init();
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
<script>
|
|
57
57
|
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
58
|
-
import {PLATFORM_PARAM_SETTING} from "@/project";
|
|
58
|
+
import {getPlatformParamsForGroup, getPlatformParamsValue, PLATFORM_PARAM_SETTING} from "@/project";
|
|
59
59
|
import storage from "@/common/storage";
|
|
60
60
|
import { mapState } from 'vuex'
|
|
61
61
|
|
|
@@ -121,14 +121,20 @@
|
|
|
121
121
|
getApp().globalData.footTabbar = true;
|
|
122
122
|
|
|
123
123
|
//设置活动参数
|
|
124
|
-
let
|
|
125
|
-
let
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
let params = [];
|
|
125
|
+
let xParamsKey = getPlatformParamsForGroup([]);
|
|
126
|
+
xParamsKey.map(key=>{
|
|
127
|
+
let {paramKey, storageKey} = getPlatformParamsValue(key);
|
|
128
|
+
let value = storage.get(storageKey);
|
|
129
|
+
if(value) params.push(`${paramKey}=${value}`);
|
|
130
|
+
})
|
|
131
|
+
// let event = storage.get(PLATFORM_PARAM_SETTING.EVENT_PARAM_SAVE_KEY);
|
|
132
|
+
// let all = storage.get(PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME_SAVE_KEY);
|
|
133
|
+
// let test = storage.get(PLATFORM_PARAM_SETTING.TEST_PARAM_NAME_SAVE_KEY);
|
|
134
|
+
// if (event) parmas.push(`${PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME}=${event}`);
|
|
135
|
+
// if (all) parmas.push(`${PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME}=${all}`);
|
|
136
|
+
// if (test) parmas.push(`${PLATFORM_PARAM_SETTING.TEST_PARAM_NAME}=${test}`);
|
|
137
|
+
this.parmas = params.join("&");
|
|
132
138
|
|
|
133
139
|
//设置选中颜色
|
|
134
140
|
this.uiColor = this.webSetting['selectedColor'] || this.$mainColor;
|
package/src/utils/helper.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
import {Base64} from 'js-base64';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
PLATFORM_PARAM_SETTING,
|
|
6
|
+
getPlatformParamsForGroup,
|
|
7
|
+
getPlatformParamsValue
|
|
8
|
+
} from "@/project";
|
|
5
9
|
import store from "@/store";
|
|
6
10
|
import {parseNetworkURL, parsePath} from "@/utils/linkUrl";
|
|
7
11
|
import settings from '../../settings';
|
|
@@ -955,6 +959,7 @@ class Helpers {
|
|
|
955
959
|
*/
|
|
956
960
|
handleTo(obj = {}, redirect, type = true, notHistory = false) {
|
|
957
961
|
|
|
962
|
+
|
|
958
963
|
//#ifdef H5
|
|
959
964
|
if (window['$configProject'] && window['$configProject'].isPreview) {
|
|
960
965
|
if (obj['url'].indexOf('/preview/index/index') === -1
|
|
@@ -992,30 +997,40 @@ class Helpers {
|
|
|
992
997
|
//获取当前页面信息
|
|
993
998
|
let currentPages = this.parseURL();
|
|
994
999
|
let currentPagesParams = currentPages.params || {};
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
uni.
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
if
|
|
1004
|
-
|
|
1005
|
-
) {
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
)
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1000
|
+
let xParamsKey = getPlatformParamsForGroup([]);
|
|
1001
|
+
xParamsKey.map(key=>{
|
|
1002
|
+
let {paramKey, storageKey} = getPlatformParamsValue(key);
|
|
1003
|
+
if(currentPagesParams[paramKey] && !uni.getStorageSync(storageKey)) {
|
|
1004
|
+
uni.setStorageSync(storageKey, currentPagesParams[paramKey])
|
|
1005
|
+
}
|
|
1006
|
+
})
|
|
1007
|
+
|
|
1008
|
+
// if(currentPagesParams[PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME]
|
|
1009
|
+
// && !uni.getStorageSync(PLATFORM_PARAM_SETTING.EVENT_PARAM_SAVE_KEY)
|
|
1010
|
+
// ) {
|
|
1011
|
+
// uni.setStorageSync(
|
|
1012
|
+
// PLATFORM_PARAM_SETTING.EVENT_PARAM_SAVE_KEY,
|
|
1013
|
+
// currentPagesParams[PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME]
|
|
1014
|
+
// )
|
|
1015
|
+
// }
|
|
1016
|
+
//
|
|
1017
|
+
// if (currentPagesParams[PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME]
|
|
1018
|
+
// && !uni.getStorageSync(PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME_SAVE_KEY)
|
|
1019
|
+
// ) {
|
|
1020
|
+
// uni.setStorageSync(
|
|
1021
|
+
// PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME_SAVE_KEY,
|
|
1022
|
+
// currentPagesParams[PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME]
|
|
1023
|
+
// )
|
|
1024
|
+
// }
|
|
1025
|
+
//
|
|
1026
|
+
// if (currentPagesParams[PLATFORM_PARAM_SETTING.TEST_PARAM_NAME]
|
|
1027
|
+
// && !uni.getStorageSync(PLATFORM_PARAM_SETTING.TEST_PARAM_NAME_SAVE_KEY)
|
|
1028
|
+
// ) {
|
|
1029
|
+
// uni.setStorageSync(
|
|
1030
|
+
// PLATFORM_PARAM_SETTING.TEST_PARAM_NAME_SAVE_KEY,
|
|
1031
|
+
// currentPagesParams[PLATFORM_PARAM_SETTING.TEST_PARAM_NAME]
|
|
1032
|
+
// )
|
|
1033
|
+
// }
|
|
1019
1034
|
|
|
1020
1035
|
//检查是否为同应用并生产地址
|
|
1021
1036
|
obj.url = this.replacePathForDir(obj.url);
|
|
@@ -1034,36 +1049,48 @@ class Helpers {
|
|
|
1034
1049
|
|
|
1035
1050
|
//全平台参数设置(当前页面中获取|参数中获取,入口缓存中获取)
|
|
1036
1051
|
let params = [];
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|| uni.getStorageSync(
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
let xdTestProject = currentPagesParams[PLATFORM_PARAM_SETTING.TEST_PARAM_NAME]
|
|
1045
|
-
|| obj[PLATFORM_PARAM_SETTING.TEST_PARAM_NAME]
|
|
1046
|
-
|| uni.getStorageSync(PLATFORM_PARAM_SETTING.TEST_PARAM_NAME_SAVE_KEY);
|
|
1047
|
-
|
|
1048
|
-
//x-params
|
|
1049
|
-
if(xdProject && obj['url'].indexOf(PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME) === -1){
|
|
1050
|
-
params.push(`${PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME}=${encodeURIComponent(xdProject)}`);
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
//x-common
|
|
1054
|
-
if(xdAllProject && obj['url'].indexOf(PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME) === -1){
|
|
1055
|
-
params.push(`${PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME}=${encodeURIComponent(xdAllProject)}`);
|
|
1056
|
-
}
|
|
1052
|
+
xParamsKey.map(key=>{
|
|
1053
|
+
let {paramKey, storageKey} = getPlatformParamsValue(key);
|
|
1054
|
+
let value = currentPagesParams[paramKey] || obj[paramKey] || uni.getStorageSync(storageKey);
|
|
1055
|
+
if(value && obj['url'].indexOf(paramKey) === -1) {
|
|
1056
|
+
params.push(`${paramKey}=${encodeURIComponent(value)}`);
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1057
1059
|
|
|
1058
|
-
//
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1060
|
+
// let xdProject= currentPagesParams[PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME]
|
|
1061
|
+
// || obj[PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME]
|
|
1062
|
+
// || uni.getStorageSync(PLATFORM_PARAM_SETTING.EVENT_PARAM_SAVE_KEY);
|
|
1063
|
+
// let xdAllProject = currentPagesParams[PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME]
|
|
1064
|
+
// || obj[PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME]
|
|
1065
|
+
// || uni.getStorageSync(PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME_SAVE_KEY);
|
|
1066
|
+
//
|
|
1067
|
+
// let xdTestProject = currentPagesParams[PLATFORM_PARAM_SETTING.TEST_PARAM_NAME]
|
|
1068
|
+
// || obj[PLATFORM_PARAM_SETTING.TEST_PARAM_NAME]
|
|
1069
|
+
// || uni.getStorageSync(PLATFORM_PARAM_SETTING.TEST_PARAM_NAME_SAVE_KEY);
|
|
1070
|
+
//
|
|
1071
|
+
// //x-params
|
|
1072
|
+
// if(xdProject && obj['url'].indexOf(PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME) === -1){
|
|
1073
|
+
// params.push(`${PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME}=${encodeURIComponent(xdProject)}`);
|
|
1074
|
+
// }
|
|
1075
|
+
//
|
|
1076
|
+
// //x-common
|
|
1077
|
+
// if(xdAllProject && obj['url'].indexOf(PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME) === -1){
|
|
1078
|
+
// params.push(`${PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME}=${encodeURIComponent(xdAllProject)}`);
|
|
1079
|
+
// }
|
|
1080
|
+
//
|
|
1081
|
+
// //x-test
|
|
1082
|
+
// if (xdTestProject && obj['url'].indexOf(PLATFORM_PARAM_SETTING.TEST_PARAM_NAME) === -1) {
|
|
1083
|
+
// params.push(`${PLATFORM_PARAM_SETTING.TEST_PARAM_NAME}=${encodeURIComponent(xdTestProject)}`);
|
|
1084
|
+
// }
|
|
1062
1085
|
|
|
1063
1086
|
//删除参数中等公告参数
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1087
|
+
xParamsKey.map(key=>{
|
|
1088
|
+
let {paramKey, storageKey} = getPlatformParamsValue(key);
|
|
1089
|
+
if(obj[paramKey]) delete obj[paramKey];
|
|
1090
|
+
});
|
|
1091
|
+
// if (obj[PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME]) delete obj[PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME];
|
|
1092
|
+
// if (obj[PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME]) delete obj[PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME];
|
|
1093
|
+
// if (obj[PLATFORM_PARAM_SETTING.TEST_PARAM_NAME]) delete obj[PLATFORM_PARAM_SETTING.TEST_PARAM_NAME];
|
|
1067
1094
|
|
|
1068
1095
|
//需要设置redirect参数
|
|
1069
1096
|
if (redirect) {
|
package/src/utils/xd.base.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
getPlatformParamsForGroup,
|
|
5
|
+
getPlatformParamsValue
|
|
6
|
+
} from "@/project";
|
|
7
|
+
|
|
3
8
|
const settings = require('./../../settings');
|
|
4
9
|
export const baseEnvTypeReg = /^(localhost)|(192\.168\.)|(sandbox-template)|(sandbox-base).*$/;
|
|
5
10
|
import websetting from "@/websetting";
|
|
@@ -189,37 +194,53 @@ export function baseInArray(sourceArray = [], findArray = []) {
|
|
|
189
194
|
}
|
|
190
195
|
|
|
191
196
|
/**
|
|
192
|
-
* @description 中间键公共处理
|
|
197
|
+
* @description 中间键公共处理(废弃此方法)
|
|
193
198
|
* @param xdApp {XdAppClass}
|
|
194
199
|
* @param PLATFORM_PARAM_SETTING
|
|
195
200
|
*/
|
|
196
201
|
export function baseMiddleware(xdApp, PLATFORM_PARAM_SETTING) {
|
|
197
202
|
xdApp.use('all', 'eventID', (app, next) => {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if (app.$page['params'][PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME]) {
|
|
204
|
-
app.$storage.set(PLATFORM_PARAM_SETTING.EVENT_PARAM_SAVE_KEY, app.$page['params'][PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME]);
|
|
205
|
-
}
|
|
206
|
-
//全局参数
|
|
207
|
-
if (app.$page['params'][PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME]) {
|
|
208
|
-
app.$storage.set(PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME_SAVE_KEY, app.$page['params'][PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME]);
|
|
203
|
+
let xParamsKey = getPlatformParamsForGroup(['TEST_PARAM_NAME','THIRD_PARAM_NAME']);
|
|
204
|
+
xParamsKey.map(key=>{
|
|
205
|
+
let {paramKey, storageKey} = getPlatformParamsValue(key);
|
|
206
|
+
if(app.$page['params'][paramKey]) {
|
|
207
|
+
app.$storage.set(storageKey, app.$page['params'][paramKey]);
|
|
209
208
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
else{
|
|
210
|
+
if(app.$storage.get(storageKey)) {
|
|
211
|
+
app.$storage.remove(storageKey);
|
|
212
|
+
}
|
|
214
213
|
}
|
|
215
|
-
}
|
|
214
|
+
})
|
|
216
215
|
|
|
217
|
-
/**有活动ID=**/
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
216
|
+
// /**有活动ID=**/
|
|
217
|
+
// if(app.$page['params'][PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME]
|
|
218
|
+
// || app.$page['params'][PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME]
|
|
219
|
+
// ) {
|
|
220
|
+
// //活动参数
|
|
221
|
+
// if (app.$page['params'][PLATFORM_PARAM_SETTING.EVENT_PARAM_NAME]) {
|
|
222
|
+
//
|
|
223
|
+
// }
|
|
224
|
+
// //全局参数
|
|
225
|
+
// if (app.$page['params'][PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME]) {
|
|
226
|
+
// app.$storage.set(PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME_SAVE_KEY, app.$page['params'][PLATFORM_PARAM_SETTING.OVER_ALL_PARAM_NAME]);
|
|
227
|
+
// }
|
|
228
|
+
//
|
|
229
|
+
// //全局测试参数
|
|
230
|
+
// if (app.$page['params'][PLATFORM_PARAM_SETTING.TEST_PARAM_NAME]) {
|
|
231
|
+
// app.$storage.set(PLATFORM_PARAM_SETTING.TEST_PARAM_NAME_SAVE_KEY, app.$page['params'][PLATFORM_PARAM_SETTING.TEST_PARAM_NAME]);
|
|
232
|
+
// }
|
|
233
|
+
// }
|
|
234
|
+
//
|
|
235
|
+
// /**有活动ID=**/
|
|
236
|
+
// else {
|
|
237
|
+
// xParamsKey.map(key=>{
|
|
238
|
+
// let {paramKey, storageKey} = getPlatformParamsValue(key);
|
|
239
|
+
// if(app.$storage.get(storageKey)) {
|
|
240
|
+
// app.$storage.remove(storageKey);
|
|
241
|
+
// }
|
|
242
|
+
// })
|
|
243
|
+
// }
|
|
223
244
|
next();
|
|
224
245
|
});
|
|
225
246
|
}
|