lazy-bee 1.0.7 → 1.0.8
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/index.d.ts +1 -1
- package/index.js +1 -13
- package/package.json +1 -1
- package/src/_virtual/_plugin-vue_export-helper.js +9 -0
- package/src/components/Login/Login.vue.js +134 -0
- package/src/components/Login/LoginModal.js +48 -0
- package/src/components/Login/LoginModal.vue.js +155 -0
- package/src/components/Login/LoginPage.js +9 -0
- package/src/components/Login/LoginPage.vue.js +79 -0
- package/src/components/PayModal/PayModal.vue.js +200 -0
- package/src/components/PayModal/index.js +71 -0
- package/src/components/addScript.js +32 -0
- package/src/components/converToken.js +163 -0
- package/src/components/debug.js +9 -0
- package/src/components/share.js +30 -0
- package/src/components/trackEvent.js +63 -0
- package/src/index.js +16 -0
- package/src/style.css +1 -0
- package/src/gdp-full-H5-3.8.3.js +0 -2606
- package/src/lazy-bee.js +0 -3350
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { ref as u, onMounted as M, openBlock as i, createBlock as b, unref as w, withCtx as C, createElementVNode as o, toDisplayString as m, createElementBlock as d, createCommentVNode as S, Fragment as x, renderList as L, withDirectives as B, vModelText as N } from "vue";
|
|
2
|
+
import { Popup as T } from "vant";
|
|
3
|
+
import { Get as h } from "lazy-koala";
|
|
4
|
+
import { UUID as j, showToast as l, izSMS as $, CountDown as D } from "lazy-koala/leaf";
|
|
5
|
+
/* empty css */
|
|
6
|
+
const U = { class: "pay-modal__title" }, q = { class: "pay-modal__field" }, O = ["value"], V = { class: "pay-modal__field" }, z = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "pay-modal__field-countdown"
|
|
9
|
+
}, G = {
|
|
10
|
+
__name: "PayModal",
|
|
11
|
+
props: [
|
|
12
|
+
"maskMobile",
|
|
13
|
+
"info",
|
|
14
|
+
"title",
|
|
15
|
+
"showConfirmButton",
|
|
16
|
+
"showCancelButton",
|
|
17
|
+
"confirmButtonText",
|
|
18
|
+
"cancelButtonText",
|
|
19
|
+
"closeable",
|
|
20
|
+
"auto",
|
|
21
|
+
"host",
|
|
22
|
+
"token",
|
|
23
|
+
"pid",
|
|
24
|
+
"goodsList",
|
|
25
|
+
"sendSMS",
|
|
26
|
+
"pay",
|
|
27
|
+
"resolve",
|
|
28
|
+
"reject",
|
|
29
|
+
"clear"
|
|
30
|
+
],
|
|
31
|
+
setup(r) {
|
|
32
|
+
const e = r, f = u(!0), n = u(""), v = u(""), c = u(!1), y = u(59), p = () => {
|
|
33
|
+
f.value = !1, setTimeout(() => {
|
|
34
|
+
e.clear();
|
|
35
|
+
}, 500);
|
|
36
|
+
};
|
|
37
|
+
M(() => {
|
|
38
|
+
if (!e.auto) {
|
|
39
|
+
if (e.host) {
|
|
40
|
+
e.reject("缺少host");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (e.token) {
|
|
44
|
+
e.reject("缺少token");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (e.pid) {
|
|
48
|
+
e.reject("缺少pid");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (e.goodsList) {
|
|
52
|
+
e.reject("缺少goodsList");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const _ = () => {
|
|
58
|
+
c.value || (c.value = !0, D({
|
|
59
|
+
timer: 59,
|
|
60
|
+
onTick(t) {
|
|
61
|
+
y.value = t;
|
|
62
|
+
}
|
|
63
|
+
}).then(() => {
|
|
64
|
+
y.value = 59;
|
|
65
|
+
}));
|
|
66
|
+
};
|
|
67
|
+
function g() {
|
|
68
|
+
if (console.log("0000"), !e.auto) {
|
|
69
|
+
e.sendSMS(_);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
c.value || (v.value = j(), h(
|
|
73
|
+
`${e.host}/api/order/sendSmsCode?token=${e.token}`,
|
|
74
|
+
{
|
|
75
|
+
body: JSON.stringify({
|
|
76
|
+
pid: e.pid,
|
|
77
|
+
goodsList: e.goodsList,
|
|
78
|
+
requestNumber: v.value
|
|
79
|
+
})
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
loading: !0,
|
|
83
|
+
failMsg: !1,
|
|
84
|
+
errMsg: !0
|
|
85
|
+
}
|
|
86
|
+
).then(
|
|
87
|
+
() => {
|
|
88
|
+
l("发送成功,请注意查收"), _();
|
|
89
|
+
},
|
|
90
|
+
(t) => {
|
|
91
|
+
t.respMsg.includes("用户身份受限") ? l("当前号码不符合活动参与资格,请使用符合资格的号码参与活动") : l(t.respMsg);
|
|
92
|
+
}
|
|
93
|
+
));
|
|
94
|
+
}
|
|
95
|
+
function k() {
|
|
96
|
+
if (!e.auto) {
|
|
97
|
+
e.pay({ sms: n.value }, p);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!n.value) {
|
|
101
|
+
l("请输入验证码");
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (!$(n.value)) {
|
|
105
|
+
l("请输入正确的验证码");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
h(
|
|
109
|
+
`${e.host}/api/order/placeOrder?token=${e.token}`,
|
|
110
|
+
{
|
|
111
|
+
body: JSON.stringify({
|
|
112
|
+
pid: e.pid,
|
|
113
|
+
goodsList: e.goodsList,
|
|
114
|
+
smsCode: n.value,
|
|
115
|
+
requestNumber: v.value
|
|
116
|
+
})
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
loading: !0,
|
|
120
|
+
failMsg: !1,
|
|
121
|
+
errMsg: !0
|
|
122
|
+
}
|
|
123
|
+
).then(
|
|
124
|
+
(t) => {
|
|
125
|
+
const a = t.data[0];
|
|
126
|
+
e.resolve({ orderId: a }), p();
|
|
127
|
+
},
|
|
128
|
+
(t) => {
|
|
129
|
+
t.respMsg.includes("验证码不存在") ? l("验证码错误") : l(t.respMsg);
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
return (t, a) => (i(), b(w(T), {
|
|
134
|
+
show: f.value,
|
|
135
|
+
"onUpdate:show": a[1] || (a[1] = (s) => f.value = s),
|
|
136
|
+
round: "",
|
|
137
|
+
class: "pay-modal",
|
|
138
|
+
closeable: !1,
|
|
139
|
+
"close-on-click-overlay": !1,
|
|
140
|
+
position: "bottom"
|
|
141
|
+
}, {
|
|
142
|
+
default: C(() => [
|
|
143
|
+
o("div", U, [
|
|
144
|
+
o("p", null, m(r.title), 1),
|
|
145
|
+
r.closeable ? (i(), d("span", {
|
|
146
|
+
key: 0,
|
|
147
|
+
onClick: p
|
|
148
|
+
}, "×")) : S("", !0)
|
|
149
|
+
]),
|
|
150
|
+
(i(!0), d(x, null, L(r.info, (s) => (i(), d("div", {
|
|
151
|
+
class: "pay-modal__info",
|
|
152
|
+
key: s.name + Math.round()
|
|
153
|
+
}, [
|
|
154
|
+
o("span", null, m(s.name), 1),
|
|
155
|
+
o("span", null, m(s.value), 1)
|
|
156
|
+
]))), 128)),
|
|
157
|
+
o("div", q, [
|
|
158
|
+
o("input", {
|
|
159
|
+
class: "pay-modal__field-input",
|
|
160
|
+
type: "text",
|
|
161
|
+
maxlength: "11",
|
|
162
|
+
value: r.maskMobile,
|
|
163
|
+
readonly: "",
|
|
164
|
+
placeholder: "请输入手机号"
|
|
165
|
+
}, null, 8, O)
|
|
166
|
+
]),
|
|
167
|
+
o("div", V, [
|
|
168
|
+
B(o("input", {
|
|
169
|
+
"onUpdate:modelValue": a[0] || (a[0] = (s) => n.value = s),
|
|
170
|
+
class: "pay-modal__field-input",
|
|
171
|
+
maxlength: "6",
|
|
172
|
+
type: "text",
|
|
173
|
+
placeholder: "请输入验证码"
|
|
174
|
+
}, null, 512), [
|
|
175
|
+
[N, n.value]
|
|
176
|
+
]),
|
|
177
|
+
c.value ? (i(), d("span", z, "还有" + m(y.value) + "s", 1)) : (i(), d("span", {
|
|
178
|
+
key: 1,
|
|
179
|
+
class: "pay-modal__field-send",
|
|
180
|
+
onClick: g
|
|
181
|
+
}, "获取验证码"))
|
|
182
|
+
]),
|
|
183
|
+
o("div", { class: "pay-modal__btns" }, [
|
|
184
|
+
o("div", {
|
|
185
|
+
class: "pay-modal__btn--confirm",
|
|
186
|
+
onClick: k
|
|
187
|
+
}, "确认下单"),
|
|
188
|
+
o("div", {
|
|
189
|
+
class: "pay-modal__btn--cancel",
|
|
190
|
+
onClick: p
|
|
191
|
+
}, "我在想想")
|
|
192
|
+
])
|
|
193
|
+
]),
|
|
194
|
+
_: 1
|
|
195
|
+
}, 8, ["show"]));
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
export {
|
|
199
|
+
G as default
|
|
200
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { h as u, render as e } from "vue";
|
|
2
|
+
import v from "./PayModal.vue.js";
|
|
3
|
+
const D = ({
|
|
4
|
+
// 必填
|
|
5
|
+
maskMobile: m = "",
|
|
6
|
+
info: n = [],
|
|
7
|
+
// 可选
|
|
8
|
+
title: o = "订购确认",
|
|
9
|
+
showConfirmButton: s = !0,
|
|
10
|
+
showCancelButton: c = !0,
|
|
11
|
+
confirmButtonText: y = "确认下单",
|
|
12
|
+
cancelButtonText: f = "我再想想",
|
|
13
|
+
closeable: l = !1,
|
|
14
|
+
auto: r = !1,
|
|
15
|
+
// 手动
|
|
16
|
+
sendSMS: P = () => {
|
|
17
|
+
},
|
|
18
|
+
pay: _ = () => {
|
|
19
|
+
},
|
|
20
|
+
// 自动
|
|
21
|
+
host: b = "",
|
|
22
|
+
token: a = "",
|
|
23
|
+
pid: g = "",
|
|
24
|
+
goodsList: i = null
|
|
25
|
+
}) => {
|
|
26
|
+
const p = () => {
|
|
27
|
+
e(null, document.body);
|
|
28
|
+
};
|
|
29
|
+
if (r)
|
|
30
|
+
return new Promise((d, j) => {
|
|
31
|
+
const q = u(v, {
|
|
32
|
+
maskMobile: m,
|
|
33
|
+
info: n,
|
|
34
|
+
title: o,
|
|
35
|
+
showConfirmButton: s,
|
|
36
|
+
showCancelButton: c,
|
|
37
|
+
confirmButtonText: y,
|
|
38
|
+
cancelButtonText: f,
|
|
39
|
+
closeable: l,
|
|
40
|
+
auto: r,
|
|
41
|
+
host: b,
|
|
42
|
+
token: a,
|
|
43
|
+
pid: g,
|
|
44
|
+
goodsList: i,
|
|
45
|
+
resolve: d,
|
|
46
|
+
reject: j,
|
|
47
|
+
clear: p
|
|
48
|
+
});
|
|
49
|
+
e(q, document.body);
|
|
50
|
+
});
|
|
51
|
+
{
|
|
52
|
+
const d = u(v, {
|
|
53
|
+
maskMobile: m,
|
|
54
|
+
info: n,
|
|
55
|
+
title: o,
|
|
56
|
+
showConfirmButton: s,
|
|
57
|
+
showCancelButton: c,
|
|
58
|
+
confirmButtonText: y,
|
|
59
|
+
cancelButtonText: f,
|
|
60
|
+
closeable: l,
|
|
61
|
+
auto: r,
|
|
62
|
+
sendSMS: P,
|
|
63
|
+
pay: _,
|
|
64
|
+
clear: p
|
|
65
|
+
});
|
|
66
|
+
e(d, document.body);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
D as PayModal
|
|
71
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function o() {
|
|
2
|
+
return new Promise((n, t) => {
|
|
3
|
+
if (window.leadeon)
|
|
4
|
+
n("leadeon.js加载成功");
|
|
5
|
+
else {
|
|
6
|
+
const e = document.createElement("script");
|
|
7
|
+
e.src = "https://res.app.coc.10086.cn/appother/js/public/leadeon.js", e.type = "text/javascript", e.crossOrigin = "anonymous", e.onload = function() {
|
|
8
|
+
n("leadeon.js加载成功");
|
|
9
|
+
}, e.onerror = function() {
|
|
10
|
+
t("leadeon.js加载失败");
|
|
11
|
+
}, document.getElementsByTagName("head")[0].appendChild(e);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function s() {
|
|
16
|
+
return new Promise((n, t) => {
|
|
17
|
+
if (window.showCommonShareBox)
|
|
18
|
+
n("share.js加载成功");
|
|
19
|
+
else {
|
|
20
|
+
const e = document.createElement("script");
|
|
21
|
+
e.src = "https://wap.cq.10086.cn/mapp/activities/act2023/share/js/share.js", e.type = "text/javascript", e.crossOrigin = "anonymous", e.onload = function() {
|
|
22
|
+
n("share.js加载成功");
|
|
23
|
+
}, e.onerror = function() {
|
|
24
|
+
t("share.js加载失败");
|
|
25
|
+
}, document.getElementsByTagName("head")[0].appendChild(e);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
o as addLeadeonScript,
|
|
31
|
+
s as addShareScript
|
|
32
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { Get as i } from "lazy-koala";
|
|
2
|
+
import { inCMCC as T, SearchParams as k, HashParams as l, UrlParams as h } from "lazy-koala/leaf";
|
|
3
|
+
import { addLeadeonScript as d } from "./addScript.js";
|
|
4
|
+
const s = {
|
|
5
|
+
urlToken: {
|
|
6
|
+
// 来自url中的token, 需要转化为mcToken, 重庆本地和集团名称一样, 默认按重庆本地
|
|
7
|
+
name: "token",
|
|
8
|
+
// 名称
|
|
9
|
+
position: "all",
|
|
10
|
+
// 位置 search | hash | all
|
|
11
|
+
type: "cq"
|
|
12
|
+
// cq | jt
|
|
13
|
+
},
|
|
14
|
+
myToken: {
|
|
15
|
+
// mytoken原商城token, 商城2.0以后需要转化为mctoken
|
|
16
|
+
name: "mytoken",
|
|
17
|
+
position: "all"
|
|
18
|
+
// 位置 search | hash | all
|
|
19
|
+
},
|
|
20
|
+
appToken: {
|
|
21
|
+
sourceId: ""
|
|
22
|
+
},
|
|
23
|
+
sessToken: {
|
|
24
|
+
// 本地存储token, 也是登录判断标识, 各项目可能不一致
|
|
25
|
+
name: "token",
|
|
26
|
+
// 名称
|
|
27
|
+
position: "session"
|
|
28
|
+
// 位置 session | local
|
|
29
|
+
},
|
|
30
|
+
mcToken: {
|
|
31
|
+
// 商城2.0以后的token, 等同sessToken, 可放url中
|
|
32
|
+
name: "mctoken",
|
|
33
|
+
position: "all"
|
|
34
|
+
// 位置 search | hash | all
|
|
35
|
+
},
|
|
36
|
+
host: ""
|
|
37
|
+
// 接口, 仅支持商城2.0及以上, 集团app内会自动转化
|
|
38
|
+
};
|
|
39
|
+
function g(n) {
|
|
40
|
+
return new Promise((e, o) => {
|
|
41
|
+
leadeon.checkSessionIsvalid({
|
|
42
|
+
debug: !1,
|
|
43
|
+
success: function(t) {
|
|
44
|
+
String(t.status) === "1" && leadeon.getYDRZToken({
|
|
45
|
+
debug: !1,
|
|
46
|
+
sourceId: n,
|
|
47
|
+
success: function(a) {
|
|
48
|
+
e(a.token);
|
|
49
|
+
},
|
|
50
|
+
error: function(a) {
|
|
51
|
+
o(a);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
error: function(t) {
|
|
56
|
+
o(t);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function m(n, e) {
|
|
62
|
+
if (e === "search")
|
|
63
|
+
return k(n);
|
|
64
|
+
if (e === "hash")
|
|
65
|
+
return l(n);
|
|
66
|
+
if (e === "all")
|
|
67
|
+
return h(n);
|
|
68
|
+
}
|
|
69
|
+
function S(n = {}) {
|
|
70
|
+
return Object.keys(s).forEach((e) => {
|
|
71
|
+
s[e] instanceof Object ? n[e] = Object.assign(s[e], n[e]) : n[e] = n[e] || s[e];
|
|
72
|
+
}), new Promise((e, o) => {
|
|
73
|
+
if (!n.host) {
|
|
74
|
+
o("缺少host");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const t = ((r) => {
|
|
78
|
+
if (r.position === "local")
|
|
79
|
+
return localStorage.getItem(r.name);
|
|
80
|
+
if (r.position === "session")
|
|
81
|
+
return sessionStorage.getItem(r.name);
|
|
82
|
+
})(n.sessToken);
|
|
83
|
+
if (t) {
|
|
84
|
+
e({
|
|
85
|
+
token: t,
|
|
86
|
+
from: "sessToken"
|
|
87
|
+
});
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const a = m(n.mcToken.name, n.mcToken.position);
|
|
91
|
+
if (a) {
|
|
92
|
+
e({
|
|
93
|
+
token: a,
|
|
94
|
+
from: "mcToken"
|
|
95
|
+
});
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const u = m(n.urlToken.name, n.urlToken.position);
|
|
99
|
+
if (u) {
|
|
100
|
+
i(
|
|
101
|
+
`${n.host}/api/user/loginReturnJsonToken`,
|
|
102
|
+
{
|
|
103
|
+
from: n.urlToken.type === "jt" ? "JT" : "CQAPP",
|
|
104
|
+
data: n.urlToken.type === "jt" ? u : JSON.stringify({ ticket: u })
|
|
105
|
+
}
|
|
106
|
+
).then((r) => {
|
|
107
|
+
e({
|
|
108
|
+
token: r.data,
|
|
109
|
+
from: "urlToken"
|
|
110
|
+
});
|
|
111
|
+
}).catch((r) => {
|
|
112
|
+
o(r);
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const f = m(n.myToken.name, n.myToken.position);
|
|
117
|
+
if (f) {
|
|
118
|
+
i(
|
|
119
|
+
`${n.host}/api/user/entryFromThirdPartyJson`,
|
|
120
|
+
{
|
|
121
|
+
data: f
|
|
122
|
+
}
|
|
123
|
+
).then((r) => {
|
|
124
|
+
e({
|
|
125
|
+
token: r.data,
|
|
126
|
+
from: "urlToken"
|
|
127
|
+
});
|
|
128
|
+
}).catch((r) => {
|
|
129
|
+
o(r);
|
|
130
|
+
});
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (T()) {
|
|
134
|
+
if (!n.appToken.sourceId) {
|
|
135
|
+
o("缺少sourceId");
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
d().then(() => {
|
|
139
|
+
g(n.appToken.sourceId).then((r) => {
|
|
140
|
+
i(
|
|
141
|
+
`${n.host}/api/user/loginReturnJsonToken`,
|
|
142
|
+
{
|
|
143
|
+
from: "JT",
|
|
144
|
+
data: r
|
|
145
|
+
}
|
|
146
|
+
).then((c) => {
|
|
147
|
+
e({
|
|
148
|
+
token: c.data,
|
|
149
|
+
from: "appToken"
|
|
150
|
+
});
|
|
151
|
+
}).catch((c) => {
|
|
152
|
+
o(c);
|
|
153
|
+
});
|
|
154
|
+
}).catch((r) => o(r));
|
|
155
|
+
}).catch((r) => o(r));
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
o("未登录");
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
export {
|
|
162
|
+
S as converToken
|
|
163
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { inCMCC as n } from "lazy-koala/leaf";
|
|
2
|
+
import { addLeadeonScript as s, addShareScript as d } from "./addScript.js";
|
|
3
|
+
function t({ title: e, content: r, link: o, imgUrl: a }) {
|
|
4
|
+
n() ? s().then(() => {
|
|
5
|
+
window.leadeon.shareMessage({
|
|
6
|
+
debug: !1,
|
|
7
|
+
shareChannelArray: ["0", "1", "2", "3", "4", "5", "6", "7"],
|
|
8
|
+
title: e,
|
|
9
|
+
content: r,
|
|
10
|
+
link: o,
|
|
11
|
+
imgUrl: a,
|
|
12
|
+
success: function() {
|
|
13
|
+
},
|
|
14
|
+
error: function(h) {
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}) : d().then(() => {
|
|
18
|
+
window.showCommonShareBox(
|
|
19
|
+
[0, 1, 2, 3, 4, 5],
|
|
20
|
+
e,
|
|
21
|
+
r,
|
|
22
|
+
o,
|
|
23
|
+
a,
|
|
24
|
+
!0
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
t as share
|
|
30
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
let n = null;
|
|
2
|
+
class o {
|
|
3
|
+
constructor(e = {}) {
|
|
4
|
+
if (n)
|
|
5
|
+
return n;
|
|
6
|
+
window.gdp = window.gdp || function() {
|
|
7
|
+
(window.gdp.q = window.gdp.q || []).push(arguments);
|
|
8
|
+
}, this.options = Object.assign({
|
|
9
|
+
scriptName: "https://res.coc.10086.cn/res/res1/chama-h5sdk/gdp-full-3.8.6.js",
|
|
10
|
+
generalProps: {}
|
|
11
|
+
}, e), this.init(), n = this;
|
|
12
|
+
}
|
|
13
|
+
init() {
|
|
14
|
+
if (!this.options.generalProps.WT_cid) throw new Error("缺少WT_cid");
|
|
15
|
+
if (!this.options.generalProps.WT_clientID) throw new Error("缺少WT_clientID");
|
|
16
|
+
if (!this.options.generalProps.WT_channelid) throw new Error("WT_channelid");
|
|
17
|
+
const e = document.createElement("script");
|
|
18
|
+
e.src = this.options.scriptName, e.type = "text/javascript", e.async = !0, e.onload = function() {
|
|
19
|
+
}, document.getElementsByTagName("head")[0].appendChild(e);
|
|
20
|
+
const t = sessionStorage.getItem("debug") === "true";
|
|
21
|
+
window._gr_ignore_local_rule = !!t, window.gdp("init", "9e4e5fa7244c6b6e", "b23efeab1461679b", {
|
|
22
|
+
host: "jiguang.coc.10086.cn",
|
|
23
|
+
autotrack: !!t,
|
|
24
|
+
// 关闭无埋点事件发送,生产环境设置为关闭。
|
|
25
|
+
compress: !t,
|
|
26
|
+
// 开启数据压缩模式,整体报文加密,生产环境设置为开启。
|
|
27
|
+
hashtag: !t,
|
|
28
|
+
// 开启页面URL混淆采集,生产环境设置为开启。
|
|
29
|
+
scheme: "https"
|
|
30
|
+
});
|
|
31
|
+
const s = Object.assign({
|
|
32
|
+
WT_cid: this.options.channelid,
|
|
33
|
+
WT_clientID: this.options.channelid,
|
|
34
|
+
WT_loginProvince: "230",
|
|
35
|
+
// 登录号码归属地省编码
|
|
36
|
+
WT_loginCity: "023",
|
|
37
|
+
// 登录号码归属地市编码
|
|
38
|
+
WT_prov: "230",
|
|
39
|
+
// 用户登陆省份和定位省份取最新值
|
|
40
|
+
WT_city: "023",
|
|
41
|
+
// 用户登陆地市和定位地市取最新值
|
|
42
|
+
XY_member: "游客",
|
|
43
|
+
// 超市会员等级
|
|
44
|
+
XY_login_status: "0",
|
|
45
|
+
// 登录状态
|
|
46
|
+
WT_mc_ev: "210315_QYCS_230",
|
|
47
|
+
// 营销活动码
|
|
48
|
+
XY_environment: "production",
|
|
49
|
+
// 环境
|
|
50
|
+
WT_channelid: this.options.channelid
|
|
51
|
+
// 事件编码
|
|
52
|
+
}, this.options.generalProps);
|
|
53
|
+
window.gdp("setGeneralProps", s);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const r = {
|
|
57
|
+
init(i) {
|
|
58
|
+
new o(i);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
r as trackEvent
|
|
63
|
+
};
|
package/src/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { converToken as e } from "./components/converToken.js";
|
|
2
|
+
import { share as f } from "./components/share.js";
|
|
3
|
+
import { showLoginModal as p } from "./components/Login/LoginModal.js";
|
|
4
|
+
import { LoginPage as a } from "./components/Login/LoginPage.js";
|
|
5
|
+
import { PayModal as g } from "./components/PayModal/index.js";
|
|
6
|
+
import { trackEvent as d } from "./components/trackEvent.js";
|
|
7
|
+
import { Debug as i } from "./components/debug.js";
|
|
8
|
+
export {
|
|
9
|
+
i as Debug,
|
|
10
|
+
a as LoginPage,
|
|
11
|
+
g as PayModal,
|
|
12
|
+
e as converToken,
|
|
13
|
+
f as share,
|
|
14
|
+
p as showLoginModal,
|
|
15
|
+
d as trackEvent
|
|
16
|
+
};
|
package/src/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.login-modal[data-v-45012623]{width:85vw;box-sizing:border-box;padding:8vw 4vw 4vw;border-radius:4vw;background:#fff}.login-modal__logo[data-v-45012623]{display:block;width:40%;margin:0 auto 2.666667vw;display:flex;align-items:center}.login-modal__colse[data-v-45012623]{color:#999;background:#f2f2f2;width:5.4vw;height:5.4vw;border-radius:50%;position:absolute;top:2vw;right:3vw;display:flex;justify-content:center;align-items:center;line-height:1em;font-size:3.733333vw}.login-modal[data-v-45012623] .login__mobile,.login-modal[data-v-45012623] .login__sms{position:relative;display:flex;padding:3.2vw 4.266667vw}.login-modal[data-v-45012623] .login__mobile:after,.login-modal[data-v-45012623] .login__sms:after{content:"";position:absolute;box-sizing:border-box;pointer-events:none;right:4.266667vw;bottom:0;left:4.266667vw;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.login-modal[data-v-45012623] .login__mobile-value,.login-modal[data-v-45012623] .login__sms-value{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;color:#323233;background-color:transparent;border:0;resize:none;-webkit-user-select:auto;user-select:auto;flex:1;font-size:3.733333vw}.login-modal[data-v-45012623] .login__mobile-value::-webkit-input-placeholder,.login-modal[data-v-45012623] .login__sms-value::-webkit-input-placeholder{color:#c8c9cc}.login-modal[data-v-45012623] .login__sms-btn,.login-modal[data-v-45012623] .login__sms-countdown{color:#0089fe;font-size:3.466667vw}.login-modal[data-v-45012623] .login__btn{height:10.666667vw;line-height:10.666667vw;text-align:center;border-radius:5.333334vw;background-image:-webkit-linear-gradient(left,#ffdb69 0%,#ffa641 100%);background-image:linear-gradient(90deg,#ffdb69,#ffa641);font-size:4.266667vw;color:#7f4300;border:0;width:90%;margin:6.666667vw auto 2.666667vw}.login-page[data-v-c860df47]{background:#f5f7fa;width:100vw;height:100vh;box-sizing:border-box;padding-top:9%}.login-page__logo[data-v-c860df47]{display:block;margin:0 auto;width:36%;display:flex;flex-wrap:wrap;justify-content:center}.login-page__tips[data-v-c860df47]{text-align:center;line-height:12vw;font-size:4.266667vw;color:#006eff;margin:0 0 2.666667vw}.login-page[data-v-c860df47] .login__mobile,.login-page[data-v-c860df47] .login__sms{display:flex;margin:0 12% 4.666667vw;height:12vw;border:1px solid #dbdbdb;border-radius:6vw;align-items:center;position:relative;overflow:hidden}.login-page[data-v-c860df47] .login__mobile:before,.login-page[data-v-c860df47] .login__sms:before{content:"";width:9.066667vw;height:9.066667vw;position:absolute;top:1.466667vw;left:2vw}.login-page[data-v-c860df47] .login__mobile:before{background:url(data:image/webp;base64,UklGRpgBAABXRUJQVlA4WAoAAAAQAAAAGwAAIwAAQUxQSHsAAAABcFpr29o8KlFZoqqaGUbqAPVdI5sUPWkmyTLM+f7Kqogw2rZNTEe7I6A2sX0Be1IDGpZvnU+5zpZvNWDpmwYChukvwXnoiOgPB/w1Qmv/79RuILSLUwD+fSh0/+VJYbUtyhv5/jiznI2WXt925kbztq1p2dtW/AlKvwQAVlA4IKAAAAAwBgCdASocACQAPrlQnUunJSKhurZoAOAXCWwAvvmuuA/in5KuYBdgG8igQb+A0cSBhAEB78frPcggAP6cX/90X//Brgg35IokBnwOJ8hJxXH8h/7fRadNiCcEyPRZyvn8AAl/55GUKgkYb/k8if+iBKz7vGS+hlLOO1n2t/erH3W+HgSXN8z0hI93XqV03jiXDuvObRTWiz9BsHMlyAAAUFNBSU4AAAA4QklNA+0AAAAAABAASAAAAAEAAgBIAAAAAQACOEJJTQQoAAAAAAAMAAAAAj/wAAAAAAAAOEJJTQRDAAAAAAAOUGJlVwEQAAYAMgAAAAA=) no-repeat center center / auto 90%}.login-page[data-v-c860df47] .login__sms:before{background:url(data:image/webp;base64,UklGRogCAABXRUJQVlA4WAoAAAAQAAAAGwAAIQAAQUxQSFEBAAABkKtt2yFJb41tZrbNNfM5g7Vt27btzLb3LGx7qwbPohRtHBETINeFD+8XyOeoBSaY86P8iJrwivY169t5OTbKS9nKj3CtXKq8AR9WlNrldm+dcvwJcKm7bHtfBh4fm9LaLbuDfx8vL5HL0hVP+LedX6fXDciR54JB6878gkfy/dH/QODOC+G+BR6GfL+MbbBefq2GnYanqFsHQiQtgMOB8lQEJwI1FU4Fy5uWwoERcCVErh7bGVsBbkfI5ZPO12aIjYwD8DBWLkOtV+fpYafAjaeT5bYn50Zw0MHzPoYlfrMy/cm0viVoOef8OckSKeYlw/0YwLNoSf2wunhr+kVf/TuPz9VeSt8yR7bGPj63uGv+wC7DToF7sYa5GWqyO1DOxlw4nWGXdY7OWYZc93/Bz801AYGNOy2e95PXuHU/wTTh5+pY+Zg+48HXrw9mpMklAFZQOCC6AAAA8AQAnQEqHAAiAD7RVKRMKCSjojVUCAEAGglsALsvNHgCnAPYA58j2IQYiDiOKwh4AP7paR/84l6BbA+xn/5BihpjWUOoH/3/6UrRltJf1Eme859cvnzVi5i/l+f/yV+Z/4/52EVP6bykZ4W4pBIzvjhSVD7BXiER6MEeJ9SnZTrK8+93XxykptRkQgM0Hqewuw+X43t6zhHvrWEgDxtlBBX9RBqH/8GUmRa//wZSZwPK9u+LegKlWAAAUFNBSU4AAAA4QklNA+0AAAAAABAASAAAAAEAAgBIAAAAAQACOEJJTQQoAAAAAAAMAAAAAj/wAAAAAAAAOEJJTQRDAAAAAAAOUGJlVwEQAAYAMgAAAAA=) no-repeat center center / auto 90%}.login-page[data-v-c860df47] .login__mobile-value,.login-page[data-v-c860df47] .login__sms-value{width:100%;height:100%;background:transparent;border:0;box-sizing:border-box;padding:0 4vw 0 12vw;resize:none;-webkit-user-select:auto;user-select:auto;flex:1}.login-page[data-v-c860df47] .login__sms-btn,.login-page[data-v-c860df47] .login__sms-countdown{width:40%;height:100%;text-align:center;line-height:12vw;color:#006eff;font-size:4vw}.login-page[data-v-c860df47] .login__btn{display:block;margin:5.333333vw 12%;background:linear-gradient(180deg,#0973ff,#3d90ff);height:11.733333vw;line-height:11.733333vw;border-radius:5.866667vw;text-align:center;color:#fff;font-size:4vw}.pay-modal__title{position:relative}.pay-modal__title p{font-size:4.8vw;color:#333;line-height:6.666667vw;text-align:center;padding:5.333333vw 0 2.666667vw;font-weight:700;margin:0}.pay-modal__title span{position:absolute;top:1vw;right:2vw;color:#c8c9cc;width:7vw;height:7vw;display:flex;justify-content:center;align-items:center;font-size:6vw;font-weight:100}.pay-modal__info{display:flex;justify-content:space-between;align-items:center;margin:0 5.333333vw}.pay-modal__info span:first-child{font-size:3.733333vw;color:#666}.pay-modal__info span:last-child{font-size:3.733333vw;color:#333}.pay-modal__field{margin:3.2vw 5.333333vw;align-items:center;justify-content:space-between;height:12.8vw;padding:0 1em;border-radius:6.4vw;border:1px solid #ccc;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center}.pay-modal__field-input{display:block;box-sizing:border-box;height:100%;border:0;flex:1;font-size:4.266667vw;color:#333}.input-solt__input::-webkit-input-placeholder{color:#c8c9cc}.pay-modal__field-send,.pay-modal__field-countdown{width:6em;text-align:center;color:#ff5a18}.pay-modal__btns{margin:0 5.333333vw}.pay-modal__btn--confirm{height:13.066667vw;line-height:13.066667vw;text-align:center;background:-webkit-linear-gradient(right,#f40 0%,#ff7200 100%);background:linear-gradient(270deg,#f40,#ff7200);border-radius:6.533333vw;font-weight:700;font-size:4.8vw;color:#fff;margin:5.333333vw 0}.pay-modal__btn--cancel{margin:6.666667vw auto;width:5em;font-size:4.266667vw;color:#666;line-height:5.866667vw;text-align:center}
|