jufubao-base 1.0.158 → 1.0.159-beta10
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 +1 -1
- package/src/common/authorize.js +201 -70
- package/src/components/JfbBaseAddress/JfbBaseAddress.vue +7 -6
- package/src/components/JfbBaseAfterOrderDetail/JfbBaseAfterOrderDetail.vue +5 -3
- package/src/components/JfbBaseAfterOrderList/JfbBaseAfterOrderList.vue +3 -2
- package/src/components/JfbBaseBack/JfbBaseBack.vue +10 -8
- package/src/components/JfbBaseBackground/JfbBaseBackground.vue +3 -2
- package/src/components/JfbBaseBlock/JfbBaseBlock.vue +3 -2
- package/src/components/JfbBaseCard/JfbBaseCard.vue +10 -6
- package/src/components/JfbBaseCardBindV2/JfbBaseCardBindV2.vue +57 -26
- package/src/components/JfbBaseCardDetail/JfbBaseCardDetail.vue +14 -15
- package/src/components/JfbBaseCardDetailEntry/Attr.js +22 -0
- package/src/components/JfbBaseCardDetailEntry/JfbBaseCardDetailEntry.vue +393 -424
- package/src/components/JfbBaseCardDisabled/JfbBaseCardDisabled.vue +4 -4
- package/src/components/JfbBaseCardDisabledEntry/JfbBaseCardDisabledEntry.vue +7 -9
- package/src/components/JfbBaseCardEntry/Attr.js +22 -1
- package/src/components/JfbBaseCardEntry/JfbBaseCardEntry.vue +90 -35
- package/src/components/JfbBaseCardInfo/JfbBaseCardInfo.vue +39 -22
- package/src/components/JfbBaseCardInfoEntry/Attr.js +22 -0
- package/src/components/JfbBaseCardInfoEntry/JfbBaseCardInfoEntry.vue +287 -263
- package/src/components/JfbBaseCardMerge/JfbBaseCardMerge.vue +4 -3
- package/src/components/JfbBaseCardMergeEntry/JfbBaseCardMergeEntry.vue +23 -18
- package/src/components/JfbBaseCardShift/JfbBaseCardShift.vue +4 -11
- package/src/components/JfbBaseCardShiftEntry/JfbBaseCardShiftEntry.vue +16 -19
- package/src/components/JfbBaseCardSweepInfo/JfbBaseCardSweepInfo.vue +3 -2
- package/src/components/JfbBaseCardV2/JfbBaseCardV2.vue +34 -18
- package/src/components/JfbBaseCardV3/JfbBaseCardV3.vue +14 -14
- package/src/components/JfbBaseCity/JfbBaseCity.vue +3 -2
- package/src/components/JfbBaseClear/JfbBaseClear.vue +3 -2
- package/src/components/JfbBaseConList/JfbBaseConList.vue +4 -5
- package/src/components/JfbBaseConPhone/JfbBaseConPhone.vue +3 -2
- package/src/components/JfbBaseEntry/Attr.js +22 -0
- package/src/components/JfbBaseEntry/JfbBaseEntry.vue +80 -16
- package/src/components/JfbBaseExpressDetail/JfbBaseExpressDetail.vue +3 -4
- package/src/components/JfbBaseFastLink/JfbBaseFastLink.vue +31 -20
- package/src/components/JfbBaseFastLink/XdFastNav.vue +2 -2
- package/src/components/JfbBaseFooter/JfbBaseFooter.vue +0 -1
- package/src/components/JfbBaseHeader/JfbBaseHeader.vue +3 -2
- package/src/components/JfbBaseLogin/JfbBaseLogin.vue +28 -11
- package/src/components/JfbBaseLoginForgetPwd/JfbBaseLoginForgetPwd.vue +7 -9
- package/src/components/JfbBaseLoginSetPwd/JfbBaseLoginSetPwd.vue +9 -6
- package/src/components/JfbBaseMapOverlay/JfbBaseMapOverlay.vue +19 -5
- package/src/components/JfbBaseMapOverlay/XdMapOverlay.vue +52 -37
- package/src/components/JfbBaseMapSearch/JfbBaseMapSearch.vue +3 -2
- package/src/components/JfbBaseMergeUserCard/JfbBaseMergeUserCard.vue +28 -27
- package/src/components/JfbBaseMultipleExpress/JfbBaseMultipleExpress.vue +5 -5
- package/src/components/JfbBaseMy/JfbBaseMy.vue +3 -3
- package/src/components/JfbBaseMySetting/JfbBaseMySetting.vue +6 -4
- package/src/components/JfbBaseNotice/Attr.js +0 -2
- package/src/components/JfbBaseNotice/JfbBaseNotice.vue +36 -14
- package/src/components/JfbBaseNotice/XdNoticeBar.vue +17 -1
- package/src/components/JfbBaseNoticeBottom/JfbBaseNoticeBottom.vue +3 -2
- package/src/components/JfbBaseNoticeTop/JfbBaseNoticeTop.vue +3 -2
- package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +20 -31
- package/src/components/JfbBaseOrderList/JfbBaseOrderList.vue +9 -4
- package/src/components/JfbBasePay/JfbBasePay.vue +3 -2
- package/src/components/JfbBasePhoneCollect/JfbBasePhoneCollect.vue +22 -7
- package/src/components/JfbBasePhoneLogin/JfbBasePhoneLogin.vue +23 -7
- package/src/components/JfbBasePoster/JfbBasePoster.vue +118 -18
- package/src/components/JfbBasePoster/MoreScreen.vue +155 -37
- package/src/components/JfbBasePosterBigSmall/Attr.js +1 -4
- package/src/components/JfbBasePosterBigSmall/JfbBasePosterBigSmall.vue +191 -67
- package/src/components/JfbBasePosterEntry/JfbBasePosterEntry.vue +90 -20
- package/src/components/JfbBasePosterType/FourScreen.vue +162 -18
- package/src/components/JfbBasePosterType/JfbBasePosterType.vue +0 -35
- package/src/components/JfbBaseRecharge/JfbBaseRecharge.vue +4 -4
- package/src/components/JfbBaseRechargeOrder/JfbBaseRechargeOrder.vue +3 -4
- package/src/components/JfbBaseRechargeOrderDetail/JfbBaseRechargeOrderDetail.vue +4 -7
- package/src/components/JfbBaseRechargeSuccess/JfbBaseRechargeSuccess.vue +6 -9
- package/src/components/JfbBaseSearch/JfbBaseSearch.vue +3 -2
- package/src/components/JfbBaseSuccess/JfbBaseSuccess.vue +5 -4
- package/src/components/JfbBaseUserCenter/JfbBaseUserCenter.vue +3 -2
- package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +5 -3
- package/src/components/JfbBaseUserOrder/JfbBaseUserOrder.vue +4 -3
- package/src/components/JfbBaseVideo/JfbBaseVideo.vue +14 -11
- package/src/components/JfbBaseVideo/XdVideo.vue +0 -4
- package/src/components/JfbBaseWallet/JfbBaseWallet.vue +3 -2
- package/src/components/JfbBaseWalletDetail/JfbBaseWalletDetail.vue +5 -8
- package/src/components/JfbBaseWalletEffective/JfbBaseWalletEffective.vue +5 -8
- package/src/components/JfbBaseWalletIndex/JfbBaseWalletIndex.vue +7 -17
- package/src/components/JfbBaseWalletItem/JfbBaseWalletItem.vue +13 -21
- package/src/components/JfbBaseWebview/JfbBaseWebview.vue +4 -3
- package/src/components/JfbBaseWxAuthorize/JfbBaseWxAuthorize.vue +5 -4
- package/src/components/JfbBaseWxAuthorizeError/JfbBaseWxAuthorizeError.vue +3 -4
- package/src/mixins/colorCardMixins.js +1 -1
package/package.json
CHANGED
package/src/common/authorize.js
CHANGED
|
@@ -4,13 +4,9 @@
|
|
|
4
4
|
import cookie from "@/common/cookie";
|
|
5
5
|
//#endif
|
|
6
6
|
import storage from "@/common/storage";
|
|
7
|
-
|
|
8
7
|
const settings = require('./../../settings');
|
|
9
|
-
import Vue from 'vue';
|
|
10
|
-
|
|
11
8
|
let __jfbAuthorize = null;
|
|
12
9
|
import store from "@/store";
|
|
13
|
-
|
|
14
10
|
import {Base64} from 'js-base64';
|
|
15
11
|
|
|
16
12
|
class JfbAuthorize {
|
|
@@ -30,14 +26,25 @@ class JfbAuthorize {
|
|
|
30
26
|
this.jumpToTimer = null;
|
|
31
27
|
this.maxTime = 10;
|
|
32
28
|
|
|
29
|
+
//从地址栏中获取登录链接(webview)
|
|
30
|
+
//#ifdef H5
|
|
31
|
+
this.jfbLoginPath = cookie.get(`jfb-login-path-${this.siteId}`);
|
|
32
|
+
this.jfbCardPath = cookie.get(`jfb-card-path-${this.siteId}`);
|
|
33
|
+
this.jfbHost = cookie.get(`jfb-host-${this.siteId}`);
|
|
34
|
+
this.jfbDir = cookie.get(`jfb-dir-${this.siteId}`);
|
|
35
|
+
this.jfbAppType= cookie.get(`jfb-app-type-${this.siteId}`) || '';
|
|
36
|
+
//#endif
|
|
37
|
+
|
|
38
|
+
|
|
33
39
|
this.config = Object.assign({}, {
|
|
34
40
|
'user': 'JFB-CSRF-TOKEN-{siteID}',
|
|
35
|
-
'card': 'JFB-CARD-TOKEN-{siteID}',
|
|
36
41
|
'refresh': 'JFB-REFRESH-TOKEN-{siteID}',
|
|
37
42
|
'access': 'JFB-ACCESS-TOKEN',
|
|
38
|
-
'bizCode': 'JFB-CARD-CODE-{siteID}',
|
|
39
43
|
'userAll':'JFB-USER-ALL-{siteID}',
|
|
40
|
-
|
|
44
|
+
'card': 'JFB-CARD-TOKEN-{siteID}',
|
|
45
|
+
'bizCode': 'JFB-CARD-CODE-{siteID}',
|
|
46
|
+
'cardExpire': 'JFB-CARD-EXPIRE-{siteID}',
|
|
47
|
+
}, settings.token ? settings.token : {}) ;
|
|
41
48
|
}
|
|
42
49
|
|
|
43
50
|
doMain() {
|
|
@@ -102,7 +109,7 @@ class JfbAuthorize {
|
|
|
102
109
|
cookie.remove(codeKey, {domain: this.doMain()});
|
|
103
110
|
//#endif
|
|
104
111
|
storage.remove(key);
|
|
105
|
-
storage.remove(codeKey);
|
|
112
|
+
if(key === 'card') storage.remove(codeKey);
|
|
106
113
|
}
|
|
107
114
|
|
|
108
115
|
/**
|
|
@@ -136,103 +143,205 @@ class JfbAuthorize {
|
|
|
136
143
|
}
|
|
137
144
|
|
|
138
145
|
/**
|
|
139
|
-
* @description
|
|
140
|
-
* @
|
|
141
|
-
* @param callbackUrl {String} 返回参数
|
|
146
|
+
* @description 检查是否在微信小程序webview环境下面
|
|
147
|
+
* @return {boolean}
|
|
142
148
|
*/
|
|
149
|
+
checkEnv(){
|
|
150
|
+
return window['__wxjs_environment'] === 'miniprogram'
|
|
151
|
+
}
|
|
143
152
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
if (store.state.configProject.platform === 'h5') {
|
|
150
|
-
redirect_url = $vm.$route.fullPath;
|
|
151
|
-
}
|
|
153
|
+
isCheckJfbWxDir(path){
|
|
154
|
+
path = path.replace('@site_domain@', '').split('/');
|
|
155
|
+
return path.length === 5 && path[1] === this.jfbDir;
|
|
156
|
+
}
|
|
152
157
|
|
|
158
|
+
/**
|
|
159
|
+
* @description 判断当前传入地址是否当前应用下面地址
|
|
160
|
+
* @param url
|
|
161
|
+
* @return {boolean} true =>不同应用 false=>相同应用
|
|
162
|
+
*/
|
|
163
|
+
checkUrlIsNotCameDir(url) {
|
|
164
|
+
const urlArr = url.replace('@site_domain@', '').split('/');//pages/loading/loading | @site_domain@/$dir/main/mall/index
|
|
165
|
+
console.log('checkUrlIsNotCameDir.url', url,urlArr)
|
|
166
|
+
console.log('checkUrlIsNotCameDir.project', store.state.brandInfo)
|
|
167
|
+
return urlArr.length === 5 && urlArr[1] !== store.state.brandInfo.deploy_dir;
|
|
168
|
+
}
|
|
153
169
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
170
|
+
//#ifdef MP-WEIXIN
|
|
171
|
+
wxJumpToPath($vm,redirect_url, path, type = 'login'){
|
|
172
|
+
//微信小程序只能跳转应用内的地址
|
|
173
|
+
if(this.checkUrlIsNotCameDir(path)) {
|
|
174
|
+
let message = '请设置正确设置用户登录地址,微信小程序只能使用应用内地址';
|
|
175
|
+
if(type === 'card') message = '请设置正确设置用户票券登录地址,微信小程序只能使用应用内地址'
|
|
176
|
+
$vm.$xdAlert({content: message,time:4000})
|
|
177
|
+
throw new Error(message);
|
|
158
178
|
}
|
|
159
|
-
//#endif
|
|
160
179
|
|
|
161
|
-
|
|
180
|
+
let key = 'redirect_url';
|
|
181
|
+
let business_code = '';
|
|
162
182
|
|
|
163
|
-
if
|
|
164
|
-
|
|
165
|
-
$vm.$xdAlert({
|
|
166
|
-
content: "请设置卡登陆页面地址"
|
|
167
|
-
})
|
|
168
|
-
throw new Error('请设置卡登陆页面地址');
|
|
169
|
-
}
|
|
183
|
+
if(type === 'card'){
|
|
184
|
+
key = 'inCallback';
|
|
170
185
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
186
|
+
//设置过滤业务线
|
|
187
|
+
if(store.state.pageBusinessCode) {
|
|
188
|
+
business_code = `&jfb_business_code=${store.state.pageBusinessCode}`;
|
|
189
|
+
}
|
|
175
190
|
}
|
|
176
191
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
192
|
+
let dir = store.state.brandInfo.deploy_dir;
|
|
193
|
+
let newPath = path.replace(`@site_domain@/${dir}/`, '/');
|
|
194
|
+
|
|
195
|
+
return newPath + `?${key}=${Base64.encodeURI(redirect_url)}${business_code}`;
|
|
196
|
+
}
|
|
197
|
+
//#endif
|
|
198
|
+
|
|
199
|
+
delPathSpParams($vm,redirect_url){
|
|
200
|
+
redirect_url = redirect_url.replace(`@site_domain@`, '')
|
|
201
|
+
let project = store.state.brandInfo;
|
|
202
|
+
let newPath = $vm.$xdUniHelper.parseURL(redirect_url);
|
|
203
|
+
let newParams = newPath.params;
|
|
204
|
+
if(newParams.ts) delete newParams.ts;
|
|
205
|
+
if(newParams.vs) delete newParams.vs;
|
|
206
|
+
if(newParams['lcdh']) delete newParams.lcdh;
|
|
207
|
+
if($vm.$xdUniHelper.isEmpty(newParams)) return `https://${project.host}${newPath.path}`
|
|
208
|
+
return `https://${project.host}${newPath.path}?${$vm.$xdUniHelper.jsonToParams(newParams)}`
|
|
180
209
|
}
|
|
181
210
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
console.log('checkUrlIsCameDir', url)
|
|
185
|
-
console.log('checkUrlIsCameDir', store.state.brandInfo)
|
|
186
|
-
return url.length === 5 && url[1] === store.state.brandInfo.deploy_dir;
|
|
211
|
+
getCardPath(CardPath,redirect_url,business_code){
|
|
212
|
+
return CardPath + `?inCallback=${Base64.encodeURI(redirect_url)}${business_code}`;
|
|
187
213
|
}
|
|
188
214
|
|
|
215
|
+
|
|
189
216
|
/**
|
|
190
217
|
* @description 跳转到用户登陆页面
|
|
191
218
|
* @param $vm {Vue}
|
|
192
219
|
* @param isRedirect {boolean}
|
|
193
220
|
*/
|
|
194
221
|
jumpToUserLogin($vm,isRedirect = true) {
|
|
222
|
+
|
|
195
223
|
let redirect_url = '';
|
|
196
|
-
|
|
197
|
-
|
|
224
|
+
let LoginPath = '';
|
|
225
|
+
|
|
226
|
+
//设置登录成功回跳地址
|
|
227
|
+
if(isRedirect) {
|
|
228
|
+
if (store.state.configProject.platform === 'mp.weixin') redirect_url = $vm['$xdUniHelper'].parseURL().source;
|
|
229
|
+
if (store.state.configProject.platform === 'h5') redirect_url = $vm.$route.fullPath;
|
|
198
230
|
}
|
|
199
|
-
|
|
200
|
-
|
|
231
|
+
|
|
232
|
+
//无配置登录地址地址提示
|
|
233
|
+
if (!this.LoginPath) {
|
|
234
|
+
$vm.$xdAlert({content: "请设置用户登陆页面地址"})
|
|
235
|
+
throw new Error('请设置用户登陆页面地址');
|
|
201
236
|
}
|
|
202
|
-
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
//#ifdef MP-WEIXIN
|
|
240
|
+
LoginPath = this.wxJumpToPath($vm,redirect_url, this.LoginPath);
|
|
241
|
+
//#endif
|
|
203
242
|
|
|
204
243
|
//#ifdef H5
|
|
205
244
|
//登陆地址与当前项目不再同一个app中处理
|
|
206
|
-
if(!this.
|
|
207
|
-
if(redirect_url) {
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
redirect_url = `@site_domain@/${store.state.brandInfo.deploy_dir}/`;
|
|
212
|
-
}
|
|
245
|
+
if(!this.checkUrlIsNotCameDir(this.LoginPath)) {
|
|
246
|
+
if(redirect_url) redirect_url = `@site_domain@/${store.state.brandInfo.deploy_dir}${redirect_url}`;
|
|
247
|
+
else redirect_url = `@site_domain@/${store.state.brandInfo.deploy_dir}/`;
|
|
213
248
|
}
|
|
214
|
-
//#endif
|
|
215
249
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
if (LoginPath.indexOf(this.LoginPath) === -1) {
|
|
250
|
+
//判断redirect_url是否为登陆地址?
|
|
251
|
+
if (redirect_url.indexOf(this.LoginPath) === -1) {
|
|
219
252
|
LoginPath = this.LoginPath + `?redirect_url=${Base64.encodeURI(redirect_url)}`;
|
|
220
253
|
}
|
|
221
254
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
255
|
+
//微信小程序webview环境直接返回小程序进行登录
|
|
256
|
+
if(this.checkEnv() && this.jfbLoginPath) {
|
|
257
|
+
//返回链接处理
|
|
258
|
+
if(redirect_url){
|
|
259
|
+
redirect_url = this.delPathSpParams($vm,redirect_url)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
LoginPath = this.jfbLoginPath.replace(`@site_domain@/${this.jfbDir}/`, '/');
|
|
263
|
+
const jumpTo = LoginPath + `?redirect_url=${Base64.encodeURI(redirect_url)}`;
|
|
264
|
+
$vm['$xdUniHelper'].redirectTo({
|
|
265
|
+
url: `/pages/jumptomp/jumptomp?callback=${Base64.encodeURI(jumpTo)}`
|
|
266
|
+
});
|
|
267
|
+
return
|
|
228
268
|
}
|
|
269
|
+
//#endif
|
|
229
270
|
|
|
230
|
-
console.warn(`jumpToUserLogin.redirect.url: ${redirect_url} , login: ${LoginPath}`)
|
|
231
271
|
$vm['$xdUniHelper'].redirectTo({
|
|
232
272
|
url: LoginPath,
|
|
233
273
|
});
|
|
234
274
|
}
|
|
235
275
|
|
|
276
|
+
/**
|
|
277
|
+
* @description 跳转到卡登陆页面
|
|
278
|
+
* @param $vm {Vue}
|
|
279
|
+
* @param callbackUrl {String} 返回参数
|
|
280
|
+
*/
|
|
281
|
+
jumpToCardLogin($vm, callbackUrl) {
|
|
282
|
+
let redirect_url = '';
|
|
283
|
+
let CardPath = ''; //登录地址
|
|
284
|
+
let jumpPath = ''; //跳转地址
|
|
285
|
+
|
|
286
|
+
//设置返回地址
|
|
287
|
+
if (store.state.configProject.platform === 'mp.weixin') redirect_url = $vm['$xdUniHelper'].parseURL().source;
|
|
288
|
+
if (store.state.configProject.platform === 'h5') redirect_url = $vm.$route.fullPath;
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
//#ifdef MP-WEIXIN
|
|
292
|
+
if (callbackUrl) redirect_url = callbackUrl;
|
|
293
|
+
jumpPath = this.wxJumpToPath($vm, redirect_url, this.cardPath, 'card');
|
|
294
|
+
//#endif
|
|
295
|
+
|
|
296
|
+
//#ifdef H5
|
|
297
|
+
CardPath = this.cardPath;
|
|
298
|
+
|
|
299
|
+
//当有callbackUrl参数时候,redirect_url地址直接使用callbackUrl参数
|
|
300
|
+
if (callbackUrl) redirect_url = callbackUrl;
|
|
301
|
+
|
|
302
|
+
//设置过滤业务线
|
|
303
|
+
let business_code = ''
|
|
304
|
+
if(store.state.pageBusinessCode) {
|
|
305
|
+
business_code = `&jfb_business_code=${store.state.pageBusinessCode}`;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
//微信小程序webview模式处理(需要跳回微信小程序进行登录)
|
|
309
|
+
if(this.checkEnv()) {
|
|
310
|
+
if(this.jfbAppType === 'wxmp') {
|
|
311
|
+
const jumpTo = this.getCardPath(this.jfbCardPath, redirect_url, business_code)
|
|
312
|
+
$vm['$xdUniHelper'].redirectTo({
|
|
313
|
+
url: `/pages/jumptomp/jumptomp?callback=${Base64.encodeURI(jumpTo)}`
|
|
314
|
+
})
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
else if(this.jfbAppType === 'h5') {
|
|
318
|
+
CardPath = this.jfbCardPath;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
//无配置卡券登录页面
|
|
323
|
+
if (!CardPath) {
|
|
324
|
+
$vm.$xdAlert({content: "请设置卡登陆页面地址"})
|
|
325
|
+
throw new Error('请设置卡登陆页面地址');
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
//登陆地址与当前项目不再同一个app中处理
|
|
329
|
+
if (!this.checkEnv()) {
|
|
330
|
+
if(!this.checkUrlIsNotCameDir(this.cardPath)) {
|
|
331
|
+
redirect_url = `@site_domain@/${store.state.brandInfo.deploy_dir}${redirect_url}`
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
jumpPath = this.getCardPath(CardPath, redirect_url, business_code)
|
|
336
|
+
//#endif
|
|
337
|
+
|
|
338
|
+
//跳转到其他应用
|
|
339
|
+
console.warn(`jumpToCardLogin.path=${jumpPath}`);
|
|
340
|
+
$vm['$xdUniHelper'].redirectTo({
|
|
341
|
+
url: jumpPath,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
|
|
236
345
|
/**
|
|
237
346
|
* @description 用户是否已登录卡信息
|
|
238
347
|
* @param canCard {Boolean} 检查是否用登录购物车信息 默认:false
|
|
@@ -275,7 +384,7 @@ class JfbAuthorize {
|
|
|
275
384
|
}
|
|
276
385
|
return false;
|
|
277
386
|
}
|
|
278
|
-
|
|
387
|
+
//当前登录卡券有业务线线
|
|
279
388
|
else{
|
|
280
389
|
let bizCodeArr = bizCode.split(',');
|
|
281
390
|
let currentBizCode = store.state.xnamespace;
|
|
@@ -367,7 +476,6 @@ class JfbAuthorize {
|
|
|
367
476
|
* @param cb {Function|null}
|
|
368
477
|
*/
|
|
369
478
|
setAllToken(result, cb = null) {
|
|
370
|
-
|
|
371
479
|
//#ifdef MP-WEIXIN
|
|
372
480
|
if(result['csrf_token_expire_in']) result['csrf_token_expire_in'] = Number(result['csrf_token_expire_in']);
|
|
373
481
|
if(result['access_token_expire_in']) result['access_token_expire_in'] = Number(result['access_token_expire_in']);
|
|
@@ -380,14 +488,23 @@ class JfbAuthorize {
|
|
|
380
488
|
//#endif
|
|
381
489
|
}
|
|
382
490
|
|
|
491
|
+
/**
|
|
492
|
+
* @description 客户端设置所有卡登录信息
|
|
493
|
+
* @param result
|
|
494
|
+
* @param cb {Function|null}
|
|
495
|
+
*/
|
|
383
496
|
setCardToken(result,cb){
|
|
384
497
|
//#ifdef MP-WEIXIN
|
|
498
|
+
if(result['card_expire_in']) result['card_expire_in'] = Number(result['card_expire_in']);
|
|
499
|
+
this.setToken('card',result['card_token'],{expires: result['card_expire_in'] / 60 / 60})
|
|
500
|
+
this.setToken('bizCode',result['business_codes'],{expires: result['card_expire_in'] / 60 / 60})
|
|
501
|
+
this.setToken('cardExpire',result['card_expire_time'],{expires: result['card_expire_in'] / 60 / 60})
|
|
385
502
|
if (typeof cb === 'function') cb();
|
|
386
503
|
//#endif
|
|
387
504
|
}
|
|
388
505
|
|
|
389
506
|
/**
|
|
390
|
-
* @description
|
|
507
|
+
* @description 客户端删除用户所有token
|
|
391
508
|
* @param cb {Function|null}
|
|
392
509
|
*/
|
|
393
510
|
removeAllToken(cb = null) {
|
|
@@ -396,8 +513,22 @@ class JfbAuthorize {
|
|
|
396
513
|
this.removeToken('access');
|
|
397
514
|
this.removeToken('refresh');
|
|
398
515
|
this.removeToken('userAll');
|
|
516
|
+
if (typeof cb === 'function') cb();
|
|
399
517
|
//#endif
|
|
400
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* @description 客户端删除用户所卡券信息
|
|
521
|
+
* @param cb {Function|null}
|
|
522
|
+
*/
|
|
523
|
+
removeAllCardToken(cb=null){
|
|
524
|
+
//#ifdef MP-WEIXIN
|
|
525
|
+
this.removeToken('card');
|
|
526
|
+
this.removeToken('bizCode');
|
|
527
|
+
this.removeToken('cardExpire');
|
|
528
|
+
if (typeof cb === 'function') cb();
|
|
529
|
+
//#endif
|
|
530
|
+
}
|
|
531
|
+
|
|
401
532
|
}
|
|
402
533
|
|
|
403
534
|
/**
|
|
@@ -193,8 +193,9 @@ export default {
|
|
|
193
193
|
},
|
|
194
194
|
},
|
|
195
195
|
watch: {
|
|
196
|
-
container(value) {
|
|
197
|
-
|
|
196
|
+
container(value,oldValue) {
|
|
197
|
+
if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
|
|
198
|
+
if (this.$configProject['isPreview']) this.init(value)
|
|
198
199
|
},
|
|
199
200
|
showAddress(val) {
|
|
200
201
|
if (val === false) this.defaultValue = null;
|
|
@@ -327,7 +328,7 @@ export default {
|
|
|
327
328
|
// cancel: false,
|
|
328
329
|
// showClose: false,
|
|
329
330
|
// confirmText: "我知道了",
|
|
330
|
-
//
|
|
331
|
+
// styles: this.styles,
|
|
331
332
|
// });
|
|
332
333
|
// return
|
|
333
334
|
// }
|
|
@@ -458,7 +459,7 @@ export default {
|
|
|
458
459
|
cancel: false,
|
|
459
460
|
showClose: false,
|
|
460
461
|
confirmText: "我知道了",
|
|
461
|
-
|
|
462
|
+
styles: this.styles,
|
|
462
463
|
});
|
|
463
464
|
return;
|
|
464
465
|
}
|
|
@@ -469,7 +470,7 @@ export default {
|
|
|
469
470
|
data: {
|
|
470
471
|
address_nnid: item.address_nnid,
|
|
471
472
|
is_select: "Y",
|
|
472
|
-
version: this.version
|
|
473
|
+
version: this.version
|
|
473
474
|
},
|
|
474
475
|
})
|
|
475
476
|
.then((res) => {
|
|
@@ -525,7 +526,7 @@ export default {
|
|
|
525
526
|
handleDel(item) {
|
|
526
527
|
console.log("handleDel", item);
|
|
527
528
|
this.$xdConfirm({
|
|
528
|
-
|
|
529
|
+
styles: this.styles,
|
|
529
530
|
content: "确定删除当前配送地址吗?",
|
|
530
531
|
width: "80%",
|
|
531
532
|
success: (res) => {
|
|
@@ -178,8 +178,9 @@ export default {
|
|
|
178
178
|
};
|
|
179
179
|
},
|
|
180
180
|
watch: {
|
|
181
|
-
container(value) {
|
|
182
|
-
|
|
181
|
+
container(value,oldValue) {
|
|
182
|
+
if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
|
|
183
|
+
if (this.$configProject['isPreview']) this.init(value)
|
|
183
184
|
},
|
|
184
185
|
},
|
|
185
186
|
computed: {
|
|
@@ -274,8 +275,9 @@ export default {
|
|
|
274
275
|
// #ifndef H5
|
|
275
276
|
uni.setClipboardData({
|
|
276
277
|
data: text,
|
|
278
|
+
showToast: false,
|
|
277
279
|
success: () => {
|
|
278
|
-
this.$xdAlert({ content: "复制成功" });
|
|
280
|
+
//this.$xdAlert({ content: "复制成功" });
|
|
279
281
|
},
|
|
280
282
|
});
|
|
281
283
|
// #endif
|
|
@@ -162,8 +162,9 @@ export default {
|
|
|
162
162
|
};
|
|
163
163
|
},
|
|
164
164
|
watch: {
|
|
165
|
-
container(value) {
|
|
166
|
-
|
|
165
|
+
container(value,oldValue) {
|
|
166
|
+
if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
|
|
167
|
+
if (this.$configProject['isPreview']) this.init(value)
|
|
167
168
|
},
|
|
168
169
|
},
|
|
169
170
|
computed: {
|
|
@@ -55,8 +55,9 @@
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
watch: {
|
|
58
|
-
container(value) {
|
|
59
|
-
|
|
58
|
+
container(value,oldValue) {
|
|
59
|
+
if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
|
|
60
|
+
if (this.$configProject['isPreview']) this.init(value)
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
63
|
created() {
|
|
@@ -66,7 +67,7 @@
|
|
|
66
67
|
this.init(this.container);
|
|
67
68
|
},
|
|
68
69
|
methods: {
|
|
69
|
-
|
|
70
|
+
|
|
70
71
|
/**
|
|
71
72
|
* @description 监听事件变化
|
|
72
73
|
* @param container {object} 业务组件对象自己
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
this.shadow = (e.scrollTop > this.height ? this.height : e.scrollTop)/100;
|
|
81
82
|
this.opacity = opacity < this.minOpacity ? this.minOpacity : opacity;
|
|
82
83
|
},
|
|
83
|
-
|
|
84
|
+
|
|
84
85
|
onJfbBack() {
|
|
85
86
|
this.$xdUniHelper.navigateBack();
|
|
86
87
|
}
|
|
@@ -102,7 +103,7 @@
|
|
|
102
103
|
height: unit(90, rpx);
|
|
103
104
|
padding: 0 unit(10, rpx);
|
|
104
105
|
position: relative;
|
|
105
|
-
|
|
106
|
+
|
|
106
107
|
&-icon {
|
|
107
108
|
width: 1em;
|
|
108
109
|
height: 1em;
|
|
@@ -112,12 +113,13 @@
|
|
|
112
113
|
display: flex;
|
|
113
114
|
justify-content: center;
|
|
114
115
|
align-content: center;
|
|
116
|
+
align-items: center;
|
|
115
117
|
flex-shrink: 0;
|
|
116
118
|
position: relative;
|
|
117
119
|
z-index: 2;
|
|
118
120
|
background: #fff;
|
|
119
121
|
}
|
|
120
|
-
|
|
122
|
+
|
|
121
123
|
&-text {
|
|
122
124
|
font-size: unit(54, rpx);
|
|
123
125
|
padding-right: 1em;
|
|
@@ -125,7 +127,7 @@
|
|
|
125
127
|
position: relative;
|
|
126
128
|
z-index: 2;
|
|
127
129
|
color: #666;
|
|
128
|
-
|
|
130
|
+
|
|
129
131
|
& > view {
|
|
130
132
|
width: 100%;
|
|
131
133
|
text-align: center;
|
|
@@ -133,7 +135,7 @@
|
|
|
133
135
|
font-size: unit(32, rpx);
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
|
-
|
|
138
|
+
|
|
137
139
|
&-bg {
|
|
138
140
|
background: #fff;
|
|
139
141
|
position: absolute;
|
|
@@ -41,8 +41,9 @@ export default {
|
|
|
41
41
|
};
|
|
42
42
|
},
|
|
43
43
|
watch: {
|
|
44
|
-
container(value) {
|
|
45
|
-
|
|
44
|
+
container(value,oldValue) {
|
|
45
|
+
if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
|
|
46
|
+
if (this.$configProject['isPreview']) this.init(value)
|
|
46
47
|
},
|
|
47
48
|
},
|
|
48
49
|
destroyed() {
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
:style="{ background: noticeBackgroundColor }"
|
|
76
76
|
>
|
|
77
77
|
<xd-notice-bar
|
|
78
|
+
style="width: 100%"
|
|
78
79
|
:showIcon="true"
|
|
79
80
|
:scrollable="true"
|
|
80
81
|
:speed="20"
|
|
@@ -254,7 +255,7 @@ export default {
|
|
|
254
255
|
if(this.login_text_color) style['color'] = this.login_text_color;
|
|
255
256
|
if(this.login_text_bg_color) style['backgroundColor'] = this.login_text_bg_color;
|
|
256
257
|
if(this.login_text_radius) style['borderRadius'] = this.login_text_radius + 'rpx'
|
|
257
|
-
return
|
|
258
|
+
return this.styleObjectToString(style);
|
|
258
259
|
},
|
|
259
260
|
lookStyle(){
|
|
260
261
|
let style = { backgroundColor: this.cardLayout === '2'? '' : this.mainColor};
|
|
@@ -262,7 +263,7 @@ export default {
|
|
|
262
263
|
if(this.look_text_color) style['color'] = this.look_text_color;
|
|
263
264
|
if(this.look_text_bg_color) style['backgroundColor'] = this.look_text_bg_color;
|
|
264
265
|
if(this.look_text_radius) style['borderRadius'] = this.look_text_radius + 'rpx';
|
|
265
|
-
return style;
|
|
266
|
+
return this.styleObjectToString(style);
|
|
266
267
|
}
|
|
267
268
|
},
|
|
268
269
|
watch: {
|
|
@@ -281,9 +282,10 @@ export default {
|
|
|
281
282
|
})
|
|
282
283
|
|
|
283
284
|
},
|
|
284
|
-
container(value) {
|
|
285
|
-
|
|
286
|
-
|
|
285
|
+
container(value,oldValue) {
|
|
286
|
+
if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
|
|
287
|
+
if (this.$configProject['isPreview']) this.init(value)
|
|
288
|
+
},
|
|
287
289
|
},
|
|
288
290
|
data() {
|
|
289
291
|
return {
|
|
@@ -408,7 +410,9 @@ export default {
|
|
|
408
410
|
})
|
|
409
411
|
.then((res) => {
|
|
410
412
|
if (res.list.length > 0) {
|
|
411
|
-
|
|
413
|
+
if(res.list && res.list.length > 0) {
|
|
414
|
+
this.notice = this.$xdUniHelper.filterHtml(res.list[0].content);
|
|
415
|
+
}
|
|
412
416
|
this.noticeStatus = true;
|
|
413
417
|
}
|
|
414
418
|
})
|