jufubao-base 1.0.15 → 1.0.17
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/commands.js +26 -2
- package/get.package.path.js +22 -0
- package/get.package.path.js.tpl +22 -0
- package/package.json +12 -13
- package/src/business/business_store.png +0 -0
- package/src/common/authorize.js +155 -0
- package/src/{getBusinessImageUrl.js → common/getBusinessImageUrl.js} +0 -0
- package/src/components/JfbBaseBlock/Attr.js +11 -1
- package/src/components/JfbBaseBlock/JfbBaseBlockMixin.js +2 -1
- package/src/components/JfbBaseCard/JfbBaseCard.vue +35 -84
- package/src/components/JfbBaseCard/JfbBaseCardMixin.js +2 -1
- package/src/components/JfbBaseCardBind/JfbBaseCardBindMixin.js +2 -1
- package/src/components/JfbBaseCardDetail/JfbBaseCardDetailMixin.js +2 -1
- package/src/components/JfbBaseCardInfo/JfbBaseCardInfoMixin.js +2 -1
- package/src/components/JfbBaseCardMy/JfbBaseCardMyMixin.js +2 -1
- package/src/components/JfbBaseCardShift/JfbBaseCardShiftMixin.js +2 -1
- package/src/components/JfbBaseLine/Attr.js +2 -2
- package/src/components/JfbBaseLine/JfbBaseLineMixin.js +2 -1
- package/src/components/JfbBaseLogin/Api.js +11 -0
- package/src/components/JfbBaseLogin/JfbBaseLoginMixin.js +2 -1
- package/src/components/JfbBaseSetPwd/JfbBaseSetPwdMixin.js +2 -1
- package/src/components/JfbBaseTestApi/JfbBaseTestApi.vue +2 -1
- package/src/components/JfbBaseTestApi/JfbBaseTestApiMixin.js +2 -1
- package/src/components/JfbBaseTestBody/JfbBaseTestBodyMixin.js +2 -1
- package/src/components/JfbBaseTestBottom/JfbBaseTestBottomMixin.js +2 -1
- package/src/components/JfbBaseTestTop/JfbBaseTestTopMixin.js +2 -1
- package/src/components/JfbBaseVerificationBefore/Api.js +16 -0
- package/src/components/JfbBaseVerificationBefore/Attr.js +154 -0
- package/src/components/JfbBaseVerificationBefore/JfbBaseVerificationBefore.vue +225 -0
- package/src/components/JfbBaseVerificationBefore/JfbBaseVerificationBeforeLess.less +57 -0
- package/src/components/JfbBaseVerificationBefore/JfbBaseVerificationBeforeMixin.js +175 -0
- package/src/components/JfbBaseVerificationPay/Api.js +88 -0
- package/src/components/JfbBaseVerificationPay/Attr.js +154 -0
- package/src/components/JfbBaseVerificationPay/JfbBaseVerificationPay.vue +493 -0
- package/src/components/JfbBaseVerificationPay/JfbBaseVerificationPayLess.less +57 -0
- package/src/components/JfbBaseVerificationPay/JfbBaseVerificationPayMixin.js +175 -0
package/commands.js
CHANGED
|
@@ -1,21 +1,45 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const path = require('path');
|
|
4
|
+
const basePath = require('./build/path');
|
|
4
5
|
const clog = require('./build/clog');
|
|
5
6
|
const fileHelper = require('./build/fileHepler');
|
|
6
|
-
|
|
7
|
+
let fromBuildPath = path.resolve('./node_modules/gxd-commands-bussiness/build');
|
|
7
8
|
const toBuildPath = path.resolve('./build');
|
|
8
|
-
|
|
9
|
+
let fromCommandsPath = path.resolve('./node_modules/gxd-commands-bussiness/commands');
|
|
9
10
|
const toCommandsPath = path.resolve('./commands');
|
|
10
11
|
const utils = require('./build/lib/utils');
|
|
12
|
+
const execSync = require('child_process').execSync;
|
|
13
|
+
const getPackage = `${basePath.buildRoot}/get.package.path.js`;
|
|
14
|
+
|
|
11
15
|
|
|
12
16
|
const init = ()=>{
|
|
17
|
+
|
|
18
|
+
//判断是否从本地获取数据
|
|
19
|
+
let isLocal = process.env.isLocal === 'true';
|
|
20
|
+
if(isLocal && fileHelper.existFileSync(getPackage)) {
|
|
21
|
+
const {getPackagePath} = require(getPackage);
|
|
22
|
+
fromBuildPath = fileHelper.getPlatformSurePath(getPackagePath('/build', 'gxd-commands-bussiness'));
|
|
23
|
+
fromCommandsPath = fileHelper.getPlatformSurePath(getPackagePath('/commands', 'gxd-commands-bussiness'));
|
|
24
|
+
}
|
|
25
|
+
|
|
13
26
|
utils.logsLine(clog, 'start');
|
|
27
|
+
|
|
28
|
+
//更新包
|
|
29
|
+
execSync(`npm i --registry=https://registry.npm.taobao.org`, {stdio: 'inherit'});
|
|
30
|
+
|
|
31
|
+
//复制命令行
|
|
14
32
|
fileHelper.copySync(fromBuildPath, toBuildPath);
|
|
15
33
|
fileHelper.copySync(fromCommandsPath, toCommandsPath);
|
|
16
34
|
clog(`拷贝命令行操作成功,目录:${toBuildPath}`, 'green');
|
|
17
35
|
clog(`拷贝命令行操作成功,目录:${toCommandsPath}`, 'green');
|
|
18
36
|
utils.logsLine(clog);
|
|
37
|
+
|
|
38
|
+
//复制插件库文件
|
|
39
|
+
clog(`拷贝框架资源`, 'cyanBG');
|
|
40
|
+
utils.logsLine(clog);
|
|
41
|
+
execSync(`node ./build/commands/copy.init.js`, {stdio: 'inherit'});
|
|
42
|
+
utils.logsLine(clog);
|
|
19
43
|
};
|
|
20
44
|
|
|
21
45
|
init();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description 第三方库
|
|
5
|
+
* @param threePackagePath {String} 第三方库所在项目路径存放路径路
|
|
6
|
+
* @param packname {String} 包名字
|
|
7
|
+
* @returns {string|*}
|
|
8
|
+
*/
|
|
9
|
+
const getPackagePath = (threePackagePath, packname = 'gxd-commands-bussiness')=>{
|
|
10
|
+
if(packname === 'gxd-commands-bussiness') {
|
|
11
|
+
return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-commands-bussiness/${threePackagePath}`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (packname === 'gxd-uni-library') {
|
|
15
|
+
return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-uni-library/${threePackagePath}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
module.exports = {
|
|
21
|
+
getPackagePath
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description 第三方库
|
|
5
|
+
* @param threePackagePath {String} 第三方库所在项目路径存放路径路
|
|
6
|
+
* @param packname {String} 包名字
|
|
7
|
+
* @returns {string|*}
|
|
8
|
+
*/
|
|
9
|
+
const getPackagePath = (threePackagePath, packname = 'gxd-commands-bussiness')=>{
|
|
10
|
+
if(packname === 'gxd-commands-bussiness') {
|
|
11
|
+
return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-commands-bussiness/${threePackagePath}`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (packname === 'gxd-uni-library') {
|
|
15
|
+
return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-uni-library/${threePackagePath}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
module.exports = {
|
|
21
|
+
getPackagePath
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jufubao-base",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "聚福宝业务组件基础插件包",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"serve": "cross-env type=test cross-env NODE_ENV=development UNI_PLATFORM=h5 npm run init.entry
|
|
9
|
-
"test": "cross-env type=test cross-env NODE_ENV=development UNI_PLATFORM=h5 npm run init.entry
|
|
10
|
-
"dev": "cross-env type=test cross-env NODE_ENV=development UNI_PLATFORM=h5 npm run init.entry
|
|
11
|
-
"build": "cross-env type=build cross-env NODE_ENV=production UNI_PLATFORM=h5 npm run init.entry
|
|
8
|
+
"serve": "cross-env type=test cross-env NODE_ENV=development UNI_PLATFORM=h5 npm run init.entry",
|
|
9
|
+
"test": "cross-env type=test cross-env NODE_ENV=development UNI_PLATFORM=h5 npm run init.entry",
|
|
10
|
+
"dev": "cross-env type=test cross-env NODE_ENV=development UNI_PLATFORM=h5 npm run init.entry",
|
|
11
|
+
"build": "cross-env type=build cross-env NODE_ENV=production UNI_PLATFORM=h5 npm run init.entry",
|
|
12
|
+
"init.entry": "node ./build/commands/entry.init.js",
|
|
12
13
|
"update": "node ./commands/update.pack.js",
|
|
13
14
|
"create": "node ./commands/create.pack.js",
|
|
14
|
-
"commands": "npm i && node ./commands.js",
|
|
15
15
|
"release": "node ./commands/npmignore && npm publish",
|
|
16
|
-
"
|
|
17
|
-
"init.
|
|
18
|
-
"
|
|
16
|
+
"init": "cross-env isLocal=false node ./commands.js",
|
|
17
|
+
"init.local": "cross-env isLocal=true node ./commands.js",
|
|
18
|
+
"coder": "node ./build/commands/coder.js",
|
|
19
19
|
"dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",
|
|
20
20
|
"dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch --minimize",
|
|
21
21
|
"dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve",
|
|
22
22
|
"build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
|
|
23
23
|
"build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build --minimize",
|
|
24
24
|
"build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build",
|
|
25
|
-
"init.commands": "cp -rf ./node_modules/gxd-uni-commands/build ./",
|
|
26
|
-
"init.editx": "node ./build/commands/editx.init.js",
|
|
27
25
|
"copy": "cross-env isOpenDir=true node build/commands/copy.js",
|
|
28
26
|
"oss": "cross-env bucket=xxx region=oss-cn-beijing name=基础项目 node ./build/commands/oss.js",
|
|
29
27
|
"oss.dev": "cross-env bucket=dev-xxx region=oss-cn-qingdao name=基础项目 node ./build/commands/oss.js",
|
|
@@ -48,10 +46,11 @@
|
|
|
48
46
|
"color": "^3.1.3",
|
|
49
47
|
"core-js": "^2.6.5",
|
|
50
48
|
"flyio": "^0.6.2",
|
|
51
|
-
"gxd-
|
|
52
|
-
"gxd-uni-library": "1.0.
|
|
49
|
+
"gxd-commands-bussiness": "^1.0.6",
|
|
50
|
+
"gxd-uni-library": "1.0.40",
|
|
53
51
|
"jweixin-module": "^1.6.0",
|
|
54
52
|
"md5": "^2.3.0",
|
|
53
|
+
"path-to-regexp": "^6.2.1",
|
|
55
54
|
"qs": "^6.9.6",
|
|
56
55
|
"regenerator-runtime": "^0.12.1",
|
|
57
56
|
"vue": "^2.6.10",
|
|
Binary file
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
//#ifdef H5
|
|
4
|
+
import cookie from "@/common/cookie";
|
|
5
|
+
//#endif
|
|
6
|
+
import storage from "@/common/storage";
|
|
7
|
+
const settings = require('./../../settings');
|
|
8
|
+
import Vue from 'vue';
|
|
9
|
+
let __jfbAuthorize = null;
|
|
10
|
+
|
|
11
|
+
class JfbAuthorize {
|
|
12
|
+
/**
|
|
13
|
+
* @description 构造函数
|
|
14
|
+
* @param options {Object}
|
|
15
|
+
* @param options.siteId {String} 网站ID 【必填】
|
|
16
|
+
* @param options.xSite {String} 网站XID 【必填】
|
|
17
|
+
* @param options.cardPath {String} 购物登录地址 【选填】
|
|
18
|
+
* @param options.LoginPath {String} 用户登录地址 【选填】
|
|
19
|
+
*/
|
|
20
|
+
constructor(options){
|
|
21
|
+
this.siteId = options.siteId;
|
|
22
|
+
this.xSite = options.xSite;
|
|
23
|
+
this.cardPath = options.cardPath || '/pages/card/card';
|
|
24
|
+
this.LoginPath = options.LoginPath || '/pages/login/login';
|
|
25
|
+
|
|
26
|
+
this.config = Object.assign({},{
|
|
27
|
+
'user': 'JFB-CSRF-TOKEN-{siteID}',
|
|
28
|
+
'card': 'JFB-CARD-TOKEN-{siteID}',
|
|
29
|
+
'refresh': 'JFB-REFRESH-TOKEN-{siteID}',
|
|
30
|
+
'access': 'JFB-ACCESS-TOKEN',
|
|
31
|
+
}, settings.token? settings.token: {});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @description 获取token键值
|
|
38
|
+
* @param key {String} {String} 设置cookie/storage键值,其值:card|user|refresh|access, 默认:user,【选填】
|
|
39
|
+
* @returns {string|*}
|
|
40
|
+
*/
|
|
41
|
+
getTokenKeyword(key){
|
|
42
|
+
if (!this.config[key]) key = 'user';
|
|
43
|
+
if(key === 'access') return this.config.access;
|
|
44
|
+
else{
|
|
45
|
+
return `${this.config[key].replace("{siteID}", this.siteId)}`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @description 获取request中token键值
|
|
51
|
+
* @param key {String} {String} 设置cookie/storage键值,其值:card|user|refresh|access, 默认:user,【选填】
|
|
52
|
+
* @returns {string|*}
|
|
53
|
+
*/
|
|
54
|
+
getRequestTokenKey(key) {
|
|
55
|
+
if (!this.config[key]) key = 'user';
|
|
56
|
+
if (key === 'access') return this.config.access;
|
|
57
|
+
else {
|
|
58
|
+
return `${this.config[key].replace("-{siteID}", '')}`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @description 设置token
|
|
64
|
+
* @param key {String} 设置cookie/storage键值,其值:card|user|refresh|access, 默认:user,【选填】
|
|
65
|
+
* @param value {*} 设置cookie/storage的值 【必填】
|
|
66
|
+
* @param options {Object} 可选项,{expires: 1, domain: ''}, 【选填】
|
|
67
|
+
* @param options.expires {Number} 过期时间单位:小时
|
|
68
|
+
* @param options.domain {String} 生效域名
|
|
69
|
+
*/
|
|
70
|
+
setToken(key, value, options = {}) {
|
|
71
|
+
key = this.getTokenKeyword(key);
|
|
72
|
+
|
|
73
|
+
//#ifdef H5
|
|
74
|
+
cookie.set(key, value, options);
|
|
75
|
+
//#endif
|
|
76
|
+
storage.set(key, value, options.expires ? options.expires : 0)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @description 删除操作token
|
|
81
|
+
* @param key {String} 设置cookie/storage键值,其值:card|user|refresh|access, 默认:user
|
|
82
|
+
* @param options {Object} 可选项,{expires: 1, domain: ''}, 过期时间单位:小时
|
|
83
|
+
*/
|
|
84
|
+
removeToken(key, options = {}) {
|
|
85
|
+
//#ifdef H5
|
|
86
|
+
cookie.remove(key, options);
|
|
87
|
+
//#endif
|
|
88
|
+
storage.remove(key);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @description 获取token信息
|
|
93
|
+
* @param key {String} 设置cookie/storage键值,其值:card|user|refresh|access, 默认:user
|
|
94
|
+
* @param options {Object} 可选项,{expires: 1, domain: ''}, 【选填】
|
|
95
|
+
* @param options.expires {Number} 过期时间单位:小时
|
|
96
|
+
* @param options.domain {String} 生效域名
|
|
97
|
+
* @return {null|String}
|
|
98
|
+
*/
|
|
99
|
+
getToken(key, options = {}) {
|
|
100
|
+
let tokenKey = this.getTokenKeyword(key);
|
|
101
|
+
console.log(tokenKey)
|
|
102
|
+
let token = null;
|
|
103
|
+
if (storage.get(tokenKey)) token = storage.get(tokenKey);
|
|
104
|
+
//#ifdef H5
|
|
105
|
+
if (cookie.get(tokenKey, options)) token = cookie.get(tokenKey, options)
|
|
106
|
+
//#endif
|
|
107
|
+
return token
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @description 用户是否已登录卡信息
|
|
112
|
+
* @param canCard {Boolean} 检查是否用登录购物车信息 默认:false
|
|
113
|
+
* @param $vm {Vue}
|
|
114
|
+
*/
|
|
115
|
+
checkCardLogin(canCard = false, $vm){
|
|
116
|
+
if(!canCard) return true;
|
|
117
|
+
if (!this.getToken('card')) {
|
|
118
|
+
$vm['$xdUniHelper'].redirectTo({
|
|
119
|
+
url: this.cardPath,
|
|
120
|
+
});
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @description 用户已登录信息
|
|
128
|
+
* @param canSign {Boolean} 检查是否用登录信息 默认:false
|
|
129
|
+
* @param $vm {Vue}
|
|
130
|
+
*/
|
|
131
|
+
checkUserLogin(canSign, $vm) {
|
|
132
|
+
if (!canSign) return true;
|
|
133
|
+
if (!this.getToken('user')) {
|
|
134
|
+
$vm['$xdUniHelper'].redirectTo({
|
|
135
|
+
url: '/pages/login/login',
|
|
136
|
+
});
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @description 单利初始化用户授权函数
|
|
145
|
+
* @param options {Object}
|
|
146
|
+
* @param options.siteId {String} 网站ID 【必填】
|
|
147
|
+
* @param options.cardPath {String} 购物登录地址 【选填】
|
|
148
|
+
* @param options.LoginPath {String} 用户登录地址 【选填】
|
|
149
|
+
*/
|
|
150
|
+
export default function (options) {
|
|
151
|
+
if(__jfbAuthorize !== null) return __jfbAuthorize;
|
|
152
|
+
return __jfbAuthorize = new JfbAuthorize(options);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
|
|
File without changes
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
content: [
|
|
7
7
|
{
|
|
8
8
|
label: '背景颜色:', //label
|
|
9
|
-
ele: 'xd-
|
|
9
|
+
ele: 'xd-color', //package 名称
|
|
10
10
|
valueKey: 'bgcolor', //form[valueKey]
|
|
11
11
|
value: '', //v-model
|
|
12
12
|
placeholder: '请输入占位框背景颜色',
|
|
@@ -19,6 +19,16 @@ export default {
|
|
|
19
19
|
},
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
|
+
{
|
|
23
|
+
label: '选中路径:', //label
|
|
24
|
+
ele: 'xd-select-pages-path', //package 名称
|
|
25
|
+
valueKey: 'select-pages-path', //form[valueKey]
|
|
26
|
+
value: null,
|
|
27
|
+
setting: {
|
|
28
|
+
router: XdBus.getParentData('getPagesTree')
|
|
29
|
+
},
|
|
30
|
+
inline: false,
|
|
31
|
+
},
|
|
22
32
|
{
|
|
23
33
|
label: '高度:', //label
|
|
24
34
|
ele: 'el-input', //package 名称
|
|
@@ -151,7 +151,8 @@ export default {
|
|
|
151
151
|
//设置已绑定数据
|
|
152
152
|
Object.keys(AttrObj).map(type=>{
|
|
153
153
|
AttrObj[type].map(item=>{
|
|
154
|
-
item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
154
|
+
if(item.value !== undefined) item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
|
+
if(item.defaultValue !== undefined) item.defaultValue = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
156
|
})
|
|
156
157
|
});
|
|
157
158
|
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
*目前仅支持电影票兑换券进行转换
|
|
42
42
|
</view>
|
|
43
43
|
<view class="jfb-base-card__body-card">
|
|
44
|
-
<view v-for="(item,index) in cardList" :key="index" @click="handleBindLogin(item)"
|
|
44
|
+
<view v-for="(item,index) in cardList" :key="index" @click="handleBindLogin(item)"
|
|
45
|
+
class="jfb-base-card__body-card-item">
|
|
45
46
|
<view class="jfb-base-card__body-card-item-left">
|
|
46
47
|
<xd-font-icon size="55" icon="iconyouhuiquan"></xd-font-icon>
|
|
47
48
|
<view>{{tabIndex===1?'登录':'转换'}}</view>
|
|
@@ -63,45 +64,23 @@
|
|
|
63
64
|
</view>
|
|
64
65
|
<view class="jfb-base-card__body-card-item-right-bottom">
|
|
65
66
|
<view class="jfb-base-card__body-card-item-right-bottom-info">
|
|
66
|
-
<view v-if="1" class="jfb-base-card__body-card-item-right-bottom-info-residue"
|
|
67
|
-
|
|
67
|
+
<view v-if="1" class="jfb-base-card__body-card-item-right-bottom-info-residue">
|
|
68
|
+
剩余点数:{{item.card_point}}
|
|
69
|
+
</view>
|
|
70
|
+
<view class="jfb-base-card__body-card-item-right-bottom-info-deduction">
|
|
71
|
+
购买其他物品可抵:{{item.other_card_point}}
|
|
72
|
+
</view>
|
|
68
73
|
</view>
|
|
69
74
|
<view @click.stop="toDetail(item)" :style="{background:$mainColor}">查看</view>
|
|
70
75
|
</view>
|
|
71
76
|
</view>
|
|
72
77
|
</view>
|
|
73
78
|
</view>
|
|
74
|
-
<!-- <view class="jfb-base--card__body-card" v-else>-->
|
|
75
|
-
<!-- <view v-for="(item,index) in 3" :key="index" class="jfb-base--card__body-card-item">-->
|
|
76
|
-
<!-- <view class="jfb-base--card__body-card-item-left">-->
|
|
77
|
-
<!-- <xd-font-icon size="55" icon="iconyouhuiquan"></xd-font-icon>-->
|
|
78
|
-
<!-- <view>转换</view>-->
|
|
79
|
-
<!-- </view>-->
|
|
80
|
-
<!-- <view class="jfb-base--card__body-card-item-right">-->
|
|
81
|
-
<!-- <view class="jfb-base--card__body-card-item-right-top">-->
|
|
82
|
-
<!-- <view v-if="1">-->
|
|
83
|
-
<!-- <xd-font-icon icon="iconkaquan" size="30" style="margin-right: 10rpx"></xd-font-icon>-->
|
|
84
|
-
<!-- <view>电影票兑换券</view>-->
|
|
85
|
-
<!-- </view>-->
|
|
86
|
-
<!-- <view>-->
|
|
87
|
-
<!-- <view>ID:123454566</view>-->
|
|
88
|
-
<!-- <view>有效期至:2024.05.10</view>-->
|
|
89
|
-
<!-- </view>-->
|
|
90
|
-
<!-- </view>-->
|
|
91
|
-
<!-- <view class="jfb-base--card__body-card-item-right-bottom">-->
|
|
92
|
-
<!-- <view class="jfb-base--card__body-card-item-right-bottom-info">-->
|
|
93
|
-
<!-- <view class="jfb-base--card__body-card-item-right-bottom-info-residue">剩余次数:2</view>-->
|
|
94
|
-
<!-- </view>-->
|
|
95
|
-
<!-- <view :style="{background:$mainColor}">查看</view>-->
|
|
96
|
-
<!-- </view>-->
|
|
97
|
-
<!-- </view>-->
|
|
98
|
-
<!-- </view>-->
|
|
99
|
-
<!-- </view>-->
|
|
100
79
|
<view class="jfb-base-card__body-disabled">
|
|
101
80
|
失效票券
|
|
102
81
|
</view>
|
|
103
82
|
<view class="jfb-base-card__body-card">
|
|
104
|
-
<view v-for="(item,index) in disableList" :key="index"
|
|
83
|
+
<view v-for="(item,index) in disableList" :key="index" class="jfb-base-card__body-card-item">
|
|
105
84
|
<view class="jfb-base-card__body-card-item-left">
|
|
106
85
|
<xd-font-icon color="#F0F0F0" size="55" icon="iconyouhuiquan"></xd-font-icon>
|
|
107
86
|
<view>{{tabIndex===1?'登录':'转换'}}</view>
|
|
@@ -123,40 +102,18 @@
|
|
|
123
102
|
</view>
|
|
124
103
|
<view class="jfb-base-card__body-card-item-right-bottom">
|
|
125
104
|
<view class="jfb-base-card__body-card-item-right-bottom-info">
|
|
126
|
-
<view v-if="item.unit==='点'" class="jfb-base-card__body-card-item-right-bottom-info-residue"
|
|
127
|
-
|
|
105
|
+
<view v-if="item.unit==='点'" class="jfb-base-card__body-card-item-right-bottom-info-residue">
|
|
106
|
+
剩余点数:{{item.card_point}}
|
|
107
|
+
</view>
|
|
108
|
+
<view class="jfb-base-card__body-card-item-right-bottom-info-deduction">
|
|
109
|
+
购买其他物品可抵:{{item.other_card_point}}
|
|
110
|
+
</view>
|
|
128
111
|
</view>
|
|
129
112
|
<view :style="{background:'#E5E5E5'}">查看</view>
|
|
130
113
|
</view>
|
|
131
114
|
</view>
|
|
132
115
|
</view>
|
|
133
116
|
</view>
|
|
134
|
-
<!-- <view class="jfb-base--card__body-card" v-else>-->
|
|
135
|
-
<!-- <view v-for="(item,index) in 3" :key="index" class="jfb-base--card__body-card-item">-->
|
|
136
|
-
<!-- <view class="jfb-base--card__body-card-item-left">-->
|
|
137
|
-
<!-- <xd-font-icon color="#B8B7BE" size="55" icon="iconyouhuiquan"></xd-font-icon>-->
|
|
138
|
-
<!-- <view>转换</view>-->
|
|
139
|
-
<!-- </view>-->
|
|
140
|
-
<!-- <view class="jfb-base--card__body-card-item-right">-->
|
|
141
|
-
<!-- <view class="jfb-base--card__body-card-item-right-top">-->
|
|
142
|
-
<!-- <view>-->
|
|
143
|
-
<!-- <xd-font-icon color="#B8B7BE" icon="iconkaquan" size="30" style="margin-right: 10rpx"></xd-font-icon>-->
|
|
144
|
-
<!-- <view>电影票兑换券</view>-->
|
|
145
|
-
<!-- </view>-->
|
|
146
|
-
<!-- <view>-->
|
|
147
|
-
<!-- <view>ID:123454566</view>-->
|
|
148
|
-
<!-- <view>有效期至:2024.05.10</view>-->
|
|
149
|
-
<!-- </view>-->
|
|
150
|
-
<!-- </view>-->
|
|
151
|
-
<!-- <view class="jfb-base--card__body-card-item-right-bottom">-->
|
|
152
|
-
<!-- <view class="jfb-base--card__body-card-item-right-bottom-info">-->
|
|
153
|
-
<!-- <view class="jfb-base--card__body-card-item-right-bottom-info-residue">剩余次数:2</view>-->
|
|
154
|
-
<!-- </view>-->
|
|
155
|
-
<!-- <view :style="{background:'#B8B7BE'}">查看</view>-->
|
|
156
|
-
<!-- </view>-->
|
|
157
|
-
<!-- </view>-->
|
|
158
|
-
<!-- </view>-->
|
|
159
|
-
<!-- </view>-->
|
|
160
117
|
</view>
|
|
161
118
|
</view>
|
|
162
119
|
</template>
|
|
@@ -166,7 +123,7 @@
|
|
|
166
123
|
import XdButton from "@/components/XdButton/XdButton";
|
|
167
124
|
import {jfbRootExec} from "@/utils/xd.event";
|
|
168
125
|
import JfbBaseCardMixin from "./JfbBaseCardMixin";
|
|
169
|
-
import {mapState,mapActions} from 'vuex'
|
|
126
|
+
import {mapState, mapActions} from 'vuex'
|
|
170
127
|
|
|
171
128
|
export default {
|
|
172
129
|
name: "JfbBaseCard",
|
|
@@ -179,7 +136,7 @@
|
|
|
179
136
|
],
|
|
180
137
|
computed: {
|
|
181
138
|
...mapState({
|
|
182
|
-
jwxSDK: state=>state.jwxSDK
|
|
139
|
+
jwxSDK: state => state.jwxSDK
|
|
183
140
|
})
|
|
184
141
|
},
|
|
185
142
|
data() {
|
|
@@ -209,17 +166,16 @@
|
|
|
209
166
|
* @description 扫码绑定
|
|
210
167
|
*/
|
|
211
168
|
handleScan() {
|
|
169
|
+
console.log(getApp().globalData, 'pageAtrr')
|
|
212
170
|
jfbRootExec('getH5WxAuthorize', {
|
|
213
171
|
vm: this,
|
|
214
|
-
data: {}
|
|
172
|
+
data: {url: window.location.href, partner_id: 161, site_id: 'wx_pub'}
|
|
215
173
|
}).then(res => {
|
|
216
|
-
|
|
174
|
+
if (this.jwxSDK !== null) {
|
|
175
|
+
console.log(this.jwxSDK, 'this.jwxSDK')
|
|
176
|
+
//todo
|
|
177
|
+
}
|
|
217
178
|
})
|
|
218
|
-
console.log(this.jwxSDK,'this.jwxSDK')
|
|
219
|
-
if (this.jwxSDK !== null) {
|
|
220
|
-
console.log(this.jwxSDK,'this.jwxSDK')
|
|
221
|
-
//todo
|
|
222
|
-
}
|
|
223
179
|
},
|
|
224
180
|
/**
|
|
225
181
|
* @description 已绑定卡登录
|
|
@@ -243,7 +199,7 @@
|
|
|
243
199
|
|
|
244
200
|
//无效卡
|
|
245
201
|
if (item['is_valid'] !== 'Y') {
|
|
246
|
-
console.log(item,item['is_valid'],item['is_valide'] !== 'Y', 'itemitem')
|
|
202
|
+
console.log(item, item['is_valid'], item['is_valide'] !== 'Y', 'itemitem')
|
|
247
203
|
return
|
|
248
204
|
}
|
|
249
205
|
this.$xdShowLoading({});
|
|
@@ -277,7 +233,7 @@
|
|
|
277
233
|
}, false);
|
|
278
234
|
},
|
|
279
235
|
onJfbLoad(options) {
|
|
280
|
-
console.log(this.jwxSDK,'000000')
|
|
236
|
+
console.log(this.jwxSDK, '000000')
|
|
281
237
|
this.$nextTick(() => {
|
|
282
238
|
let {inCallback, isBack} = this.$xdUniHelper.parseURL()['params'];
|
|
283
239
|
if (inCallback) this.inCallback = decodeURIComponent(inCallback);
|
|
@@ -287,22 +243,17 @@
|
|
|
287
243
|
jfbRootExec('getListCardBind', {
|
|
288
244
|
|
|
289
245
|
vm: this,
|
|
290
|
-
|
|
291
|
-
}
|
|
246
|
+
data: {}
|
|
292
247
|
|
|
293
|
-
}).then((res)=>{
|
|
294
|
-
// res=res.map(item=>{
|
|
295
|
-
// item.is_valide =0
|
|
296
|
-
// return item
|
|
297
|
-
// })
|
|
248
|
+
}).then((res) => {
|
|
298
249
|
this.cardList = res.filter((item) => {
|
|
299
|
-
if (item['is_valide'] !==
|
|
250
|
+
if (item['is_valide'] !== 'N' && item['card_point'] !== 0) {
|
|
300
251
|
return true
|
|
301
252
|
}
|
|
302
253
|
return false
|
|
303
254
|
});
|
|
304
255
|
this.disableList = res.filter((item) => {
|
|
305
|
-
if (item['is_valide'] ===
|
|
256
|
+
if (item['is_valide'] === 'N' || item['card_point'] === 0) {
|
|
306
257
|
return true
|
|
307
258
|
}
|
|
308
259
|
return false
|
|
@@ -369,7 +320,7 @@
|
|
|
369
320
|
display: flex;
|
|
370
321
|
align-items: center;
|
|
371
322
|
font-size: unit(28, rpx);
|
|
372
|
-
margin-bottom: unit(46,rpx);
|
|
323
|
+
margin-bottom: unit(46, rpx);
|
|
373
324
|
|
|
374
325
|
& > view {
|
|
375
326
|
width: unit(214, rpx);
|
|
@@ -382,8 +333,8 @@
|
|
|
382
333
|
}
|
|
383
334
|
|
|
384
335
|
&-tips {
|
|
385
|
-
font-size: unit(20,rpx);
|
|
386
|
-
margin-bottom: unit(46,rpx);
|
|
336
|
+
font-size: unit(20, rpx);
|
|
337
|
+
margin-bottom: unit(46, rpx);
|
|
387
338
|
}
|
|
388
339
|
|
|
389
340
|
&-card {
|
|
@@ -393,7 +344,7 @@
|
|
|
393
344
|
justify-content: flex-start;
|
|
394
345
|
border: unit(2, rpx) solid #EEEEEEFF;
|
|
395
346
|
border-radius: unit(20, rpx);
|
|
396
|
-
margin-bottom: unit(30,rpx);
|
|
347
|
+
margin-bottom: unit(30, rpx);
|
|
397
348
|
|
|
398
349
|
&-left {
|
|
399
350
|
width: unit(200, rpx);
|
|
@@ -464,9 +415,9 @@
|
|
|
464
415
|
}
|
|
465
416
|
|
|
466
417
|
&-disabled {
|
|
467
|
-
font-size: unit(28,rpx);
|
|
418
|
+
font-size: unit(28, rpx);
|
|
468
419
|
color: #B8B7BE;
|
|
469
|
-
margin-bottom: unit(30,rpx);
|
|
420
|
+
margin-bottom: unit(30, rpx);
|
|
470
421
|
}
|
|
471
422
|
}
|
|
472
423
|
}
|
|
@@ -151,7 +151,8 @@ export default {
|
|
|
151
151
|
//设置已绑定数据
|
|
152
152
|
Object.keys(AttrObj).map(type=>{
|
|
153
153
|
AttrObj[type].map(item=>{
|
|
154
|
-
item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
154
|
+
if(item.value !== undefined) item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
|
+
if(item.defaultValue !== undefined) item.defaultValue = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
156
|
})
|
|
156
157
|
});
|
|
157
158
|
|
|
@@ -151,7 +151,8 @@ export default {
|
|
|
151
151
|
//设置已绑定数据
|
|
152
152
|
Object.keys(AttrObj).map(type=>{
|
|
153
153
|
AttrObj[type].map(item=>{
|
|
154
|
-
item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
154
|
+
if(item.value !== undefined) item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
|
+
if(item.defaultValue !== undefined) item.defaultValue = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
156
|
})
|
|
156
157
|
});
|
|
157
158
|
|
|
@@ -151,7 +151,8 @@ export default {
|
|
|
151
151
|
//设置已绑定数据
|
|
152
152
|
Object.keys(AttrObj).map(type=>{
|
|
153
153
|
AttrObj[type].map(item=>{
|
|
154
|
-
item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
154
|
+
if(item.value !== undefined) item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
|
+
if(item.defaultValue !== undefined) item.defaultValue = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
156
|
})
|
|
156
157
|
});
|
|
157
158
|
|
|
@@ -151,7 +151,8 @@ export default {
|
|
|
151
151
|
//设置已绑定数据
|
|
152
152
|
Object.keys(AttrObj).map(type=>{
|
|
153
153
|
AttrObj[type].map(item=>{
|
|
154
|
-
item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
154
|
+
if(item.value !== undefined) item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
|
+
if(item.defaultValue !== undefined) item.defaultValue = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
156
|
})
|
|
156
157
|
});
|
|
157
158
|
|
|
@@ -151,7 +151,8 @@ export default {
|
|
|
151
151
|
//设置已绑定数据
|
|
152
152
|
Object.keys(AttrObj).map(type=>{
|
|
153
153
|
AttrObj[type].map(item=>{
|
|
154
|
-
item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
154
|
+
if(item.value !== undefined) item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
|
+
if(item.defaultValue !== undefined) item.defaultValue = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
156
|
})
|
|
156
157
|
});
|
|
157
158
|
|
|
@@ -151,7 +151,8 @@ export default {
|
|
|
151
151
|
//设置已绑定数据
|
|
152
152
|
Object.keys(AttrObj).map(type=>{
|
|
153
153
|
AttrObj[type].map(item=>{
|
|
154
|
-
item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
154
|
+
if(item.value !== undefined) item.value = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
|
+
if(item.defaultValue !== undefined) item.defaultValue = getContainerPropsValue(this.container, `${type}.${item.valueKey}`, item.value);
|
|
155
156
|
})
|
|
156
157
|
});
|
|
157
158
|
|