ynkszx-applet-study-player 1.0.0
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/README.md +275 -0
- package/package.json +19 -0
- package/src/api/auth.js +102 -0
- package/src/api/player.js +27 -0
- package/src/api/upload.js +28 -0
- package/src/components/jjb-auth/code-comp/code-comp.js +83 -0
- package/src/components/jjb-auth/code-comp/code-comp.json +8 -0
- package/src/components/jjb-auth/code-comp/code-comp.wxml +33 -0
- package/src/components/jjb-auth/code-comp/code-comp.wxss +19 -0
- package/src/components/jjb-auth/face-comp/face-comp.js +125 -0
- package/src/components/jjb-auth/face-comp/face-comp.json +4 -0
- package/src/components/jjb-auth/face-comp/face-comp.wxml +39 -0
- package/src/components/jjb-auth/face-comp/face-comp.wxss +39 -0
- package/src/components/jjb-auth/face-conf/face-conf.js +36 -0
- package/src/components/jjb-auth/face-conf/face-conf.json +4 -0
- package/src/components/jjb-auth/face-conf/face-conf.wxml +17 -0
- package/src/components/jjb-auth/face-conf/face-conf.wxss +26 -0
- package/src/components/jjb-auth/jjb-auth.js +200 -0
- package/src/components/jjb-auth/jjb-auth.json +11 -0
- package/src/components/jjb-auth/jjb-auth.wxml +44 -0
- package/src/components/jjb-auth/living-comp/living-comp.js +221 -0
- package/src/components/jjb-auth/living-comp/living-comp.json +4 -0
- package/src/components/jjb-auth/living-comp/living-comp.wxml +44 -0
- package/src/components/jjb-auth/living-comp/living-comp.wxss +48 -0
- package/src/components/jjb-auth/msg-comp/msg-comp.js +27 -0
- package/src/components/jjb-auth/msg-comp/msg-comp.json +8 -0
- package/src/components/jjb-auth/msg-comp/msg-comp.wxml +16 -0
- package/src/components/jjb-auth/msg-comp/msg-comp.wxss +17 -0
- package/src/components/jjb-auth/qa-auth.wxss +9 -0
- package/src/components/jjb-auth/tip-comp/tip-comp.js +38 -0
- package/src/components/jjb-auth/tip-comp/tip-comp.json +4 -0
- package/src/components/jjb-auth/tip-comp/tip-comp.wxml +20 -0
- package/src/components/jjb-auth/tip-comp/tip-comp.wxss +25 -0
- package/src/components/jjb-player/jjb-player.js +73 -0
- package/src/components/jjb-player/jjb-player.json +7 -0
- package/src/components/jjb-player/jjb-player.wxml +19 -0
- package/src/components/jjb-player/jjb-player.wxss +1 -0
- package/src/components/jjb-player/video-comp/time.wxs +11 -0
- package/src/components/jjb-player/video-comp/video-comp.js +250 -0
- package/src/components/jjb-player/video-comp/video-comp.json +4 -0
- package/src/components/jjb-player/video-comp/video-comp.wxml +52 -0
- package/src/components/jjb-player/video-comp/video-comp.wxss +35 -0
- package/src/components/jjb-verify/verify-idcard/verify-idcard.js +47 -0
- package/src/components/jjb-verify/verify-idcard/verify-idcard.json +4 -0
- package/src/components/jjb-verify/verify-idcard/verify-idcard.wxml +3 -0
- package/src/components/jjb-verify/verify-idcard/verify-idcard.wxss +2 -0
- package/src/components/jjb-verify/verify-move/verify-move.js +44 -0
- package/src/components/jjb-verify/verify-move/verify-move.json +4 -0
- package/src/components/jjb-verify/verify-move/verify-move.wxml +3 -0
- package/src/components/jjb-verify/verify-move/verify-move.wxss +9 -0
- package/src/components/jjb-verify/verify-number/verify-number.js +60 -0
- package/src/components/jjb-verify/verify-number/verify-number.json +4 -0
- package/src/components/jjb-verify/verify-number/verify-number.wxml +9 -0
- package/src/components/jjb-verify/verify-number/verify-number.wxss +2 -0
- package/src/lib/crypto.js +55 -0
- package/src/style/common.wxss +113 -0
- package/src/utils/crypto.js +43 -0
- package/src/utils/http/config/index.js +7 -0
- package/src/utils/http/index.js +173 -0
- package/src/utils/oss/config/index.js +5 -0
- package/src/utils/oss/index.js +6 -0
- package/src/utils/storage.js +22 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
.jjb-text-primary {
|
|
2
|
+
color: #2563EB;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.jjb-text-white {
|
|
6
|
+
color: #fff;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.jjb-text-orange {
|
|
10
|
+
color: #F97316;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.jjb-text-green {
|
|
14
|
+
color: #07C160;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.jjb-text-red {
|
|
18
|
+
color: #FF4136;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.jjb-text-grey {
|
|
22
|
+
color: #909199;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.jjb-text-darken-2 {
|
|
26
|
+
color: #202122;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.jjb-text-size-s {
|
|
30
|
+
font-size: 24rpx;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.jjb-text-size-m {
|
|
34
|
+
font-size: 28rpx;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.jjb-text-size-n {
|
|
38
|
+
font-size: 30rpx;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.jjb-text-size-lg {
|
|
42
|
+
font-size: 36rpx;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.jjb-text-size-2xl {
|
|
46
|
+
font-size: 44rpx;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.jjb-text-weight-b {
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.jjb-text-align-right {
|
|
54
|
+
text-align: right;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.jjb-text-align-center {
|
|
58
|
+
text-align: center;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.jjb-flex {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.jjb-flex-col {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.jjb-flex-center-between {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: space-between;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.jjb-input {
|
|
81
|
+
height: 94rpx;
|
|
82
|
+
padding-left: 32rpx;
|
|
83
|
+
font-size: 28rpx;
|
|
84
|
+
border: 1px solid #E5E7EB;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.jjb-btn {
|
|
88
|
+
height: 100rpx;
|
|
89
|
+
line-height: 100rpx;
|
|
90
|
+
font-size: 32rpx;
|
|
91
|
+
color: #fff;
|
|
92
|
+
background-color: #2563EB;
|
|
93
|
+
border-radius: 8rpx;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.jjb-modal {
|
|
97
|
+
width: 100vw;
|
|
98
|
+
height: 100vh;
|
|
99
|
+
position: fixed;
|
|
100
|
+
left: 0px;
|
|
101
|
+
top: 0px;
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.jjb-modal-content {
|
|
108
|
+
width: 550rpx;
|
|
109
|
+
padding: 40rpx;
|
|
110
|
+
position: relative;
|
|
111
|
+
border-radius: 8rpx;
|
|
112
|
+
background-color: #fff;
|
|
113
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CryptoJS } from '../lib/crypto';
|
|
2
|
+
|
|
3
|
+
function CryptoClient() {
|
|
4
|
+
this.key = 'rw2ZsD5dovIzserdy5LwSw==';
|
|
5
|
+
|
|
6
|
+
/* 加密 */
|
|
7
|
+
this.encrypt = (data) => {
|
|
8
|
+
try {
|
|
9
|
+
const encrypted = CryptoJS.AES.encrypt(JSON.stringify(data || {}), this.key)
|
|
10
|
+
return encrypted.toString();
|
|
11
|
+
} catch (error) {
|
|
12
|
+
return ''
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* 解密 */
|
|
17
|
+
this.decrypt = (data) => {
|
|
18
|
+
try {
|
|
19
|
+
let decryptd = CryptoJS.AES.decrypt(data, this.key);
|
|
20
|
+
decryptd = decryptd.toString(CryptoJS.enc.Utf8);
|
|
21
|
+
decryptd = this.parse(decryptd)
|
|
22
|
+
return decryptd;
|
|
23
|
+
} catch (error) {
|
|
24
|
+
return data
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* json字符串 */
|
|
29
|
+
this.parse = (data) => {
|
|
30
|
+
try {
|
|
31
|
+
const _data = JSON.parse(data)
|
|
32
|
+
return _data
|
|
33
|
+
} catch (error) {
|
|
34
|
+
return data
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const crypto = new CryptoClient()
|
|
40
|
+
|
|
41
|
+
module.exports = {
|
|
42
|
+
crypto
|
|
43
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
const { prefix, TIMEOUT } = require("./config/index");
|
|
2
|
+
const { storage } = require("../storage");
|
|
3
|
+
const { crypto } = require("../crypto");
|
|
4
|
+
|
|
5
|
+
function HttpClient() {
|
|
6
|
+
this.request = (options, othOptions = { loading: true }) => {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
if (othOptions.loading !== false) {
|
|
9
|
+
wx.showLoading({
|
|
10
|
+
title: "加载中",
|
|
11
|
+
mask: true,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const _options = this.formatOpt(
|
|
15
|
+
{
|
|
16
|
+
...options,
|
|
17
|
+
data:
|
|
18
|
+
othOptions.crypto === false
|
|
19
|
+
? options.data
|
|
20
|
+
: {
|
|
21
|
+
encryptStr: crypto.encrypt(options.data),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
othOptions
|
|
25
|
+
);
|
|
26
|
+
// console.log("SDK发起请求=>", _options);
|
|
27
|
+
wx.request({
|
|
28
|
+
..._options,
|
|
29
|
+
success: (data) => this.success(data, { resolve, reject }, othOptions),
|
|
30
|
+
fail: (err) => this.fail(err, { resolve, reject }),
|
|
31
|
+
complete: () =>
|
|
32
|
+
othOptions.loading !== false && wx.hideLoading({ noConflict: true }),
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
this.upload = (options, othOptions = { loading: true }) => {
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
if (othOptions.loading !== false) {
|
|
40
|
+
wx.showLoading({
|
|
41
|
+
title: "加载中",
|
|
42
|
+
mask: true,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const _options = this.formatOpt(options, othOptions);
|
|
46
|
+
// console.log("SDK发起请求=>" + options.url, _options);
|
|
47
|
+
wx.uploadFile({
|
|
48
|
+
..._options,
|
|
49
|
+
success: (data) => {
|
|
50
|
+
this.success(
|
|
51
|
+
{
|
|
52
|
+
...data,
|
|
53
|
+
data: parseData(data),
|
|
54
|
+
},
|
|
55
|
+
{ resolve, reject },
|
|
56
|
+
othOptions
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
fail: (err) => this.fail(err, { resolve, reject }),
|
|
60
|
+
complete: () =>
|
|
61
|
+
othOptions.loading !== false && wx.hideLoading({ noConflict: true }),
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
this.formatHeader = ({ formData }) => {
|
|
67
|
+
const header = {};
|
|
68
|
+
if (formData) header["content-type"] = "application/x-www-form-urlencoded";
|
|
69
|
+
return header;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
this.formatOpt = (options, othOptions) => {
|
|
73
|
+
const { url, params, timeout } = options;
|
|
74
|
+
const header = this.formatHeader(othOptions);
|
|
75
|
+
if (options.header) {
|
|
76
|
+
Object.assign(header, options.header);
|
|
77
|
+
}
|
|
78
|
+
if (!header["Group-App-Id"]) {
|
|
79
|
+
header["Group-App-Id"] = storage.get(3);
|
|
80
|
+
}
|
|
81
|
+
const baseUrl = storage.get(2);
|
|
82
|
+
|
|
83
|
+
let _params = "";
|
|
84
|
+
if (params) {
|
|
85
|
+
const query = [];
|
|
86
|
+
for (const i in params) {
|
|
87
|
+
query.push(`${i}=${params[i]}`);
|
|
88
|
+
}
|
|
89
|
+
_params = `?${query.join("&")}`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
...options,
|
|
94
|
+
header,
|
|
95
|
+
timeout: timeout || TIMEOUT,
|
|
96
|
+
url: `${baseUrl}${othOptions.prefix || prefix}${url}${_params}`,
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
this.success = ({ statusCode, data }, { resolve, reject }, othOptions) => {
|
|
101
|
+
const msg = data.msg || "网络异常,请稍后再试";
|
|
102
|
+
|
|
103
|
+
switch (statusCode) {
|
|
104
|
+
case 200:
|
|
105
|
+
switch (data.code) {
|
|
106
|
+
case "000000":
|
|
107
|
+
// console.log(
|
|
108
|
+
// "SDK请求响应解密后=>",
|
|
109
|
+
// "STATUSCODE=>" + statusCode,
|
|
110
|
+
// othOptions.crypto !== false
|
|
111
|
+
// ? crypto.decrypt(data.data)
|
|
112
|
+
// : data.data
|
|
113
|
+
// );
|
|
114
|
+
resolve(
|
|
115
|
+
othOptions.crypto !== false
|
|
116
|
+
? crypto.decrypt(data.data)
|
|
117
|
+
: data.data
|
|
118
|
+
);
|
|
119
|
+
break;
|
|
120
|
+
case "401":
|
|
121
|
+
case "-401":
|
|
122
|
+
reject(msg);
|
|
123
|
+
break;
|
|
124
|
+
default:
|
|
125
|
+
// console.log("SDK请求响应=>STATUSCODE", data.msg, statusCode);
|
|
126
|
+
// console.log("SDK请求响应=>DATA", data.data);
|
|
127
|
+
errorMsg(msg);
|
|
128
|
+
reject(msg);
|
|
129
|
+
}
|
|
130
|
+
break;
|
|
131
|
+
case 401:
|
|
132
|
+
reject(msg);
|
|
133
|
+
break;
|
|
134
|
+
default:
|
|
135
|
+
// console.log("SDK请求响应=>STATUSCODE", data.msg, statusCode);
|
|
136
|
+
// console.log("SDK请求响应=>DATA", data.data);
|
|
137
|
+
errorMsg(msg);
|
|
138
|
+
reject(msg);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
this.fail = ({ errMsg }, { reject }) => {
|
|
142
|
+
if (errMsg.indexOf("timeout") !== -1) {
|
|
143
|
+
errorMsg("请求超时啦,请稍后重试");
|
|
144
|
+
} else if (errMsg.indexOf("statusCode:-1") !== -1) {
|
|
145
|
+
errorMsg("网络异常,请稍后再试");
|
|
146
|
+
}
|
|
147
|
+
errorMsg(errMsg);
|
|
148
|
+
|
|
149
|
+
reject(errMsg);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function errorMsg(msg) {
|
|
154
|
+
wx.showToast({
|
|
155
|
+
title: msg,
|
|
156
|
+
icon: "none",
|
|
157
|
+
duration: 2000,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function parseData(data) {
|
|
162
|
+
try {
|
|
163
|
+
return typeof data.data === "string" ? JSON.parse(data.data) : data.data;
|
|
164
|
+
} catch (e) {
|
|
165
|
+
return data.data;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const http = new HttpClient();
|
|
170
|
+
|
|
171
|
+
module.exports = {
|
|
172
|
+
http,
|
|
173
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// 默认缓存期限为7天
|
|
2
|
+
const ST_KEYS = {
|
|
3
|
+
0: "QAKJ-PLAYER-ATIPS",
|
|
4
|
+
1: "QAKJ-PLAYER-SCENE",
|
|
5
|
+
2: "QAKJ-PLAYER-BASEURL",
|
|
6
|
+
3: "QAKJ-PLAYER-APPID",
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
function StorageClient() {
|
|
10
|
+
this.set = (type, data) => {
|
|
11
|
+
wx.setStorageSync(ST_KEYS[type], data);
|
|
12
|
+
};
|
|
13
|
+
this.get = (type) => {
|
|
14
|
+
return wx.getStorageSync(ST_KEYS[type]);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const storage = new StorageClient();
|
|
19
|
+
|
|
20
|
+
module.exports = {
|
|
21
|
+
storage,
|
|
22
|
+
};
|