sa2kit 1.6.79 → 1.6.83
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.
|
@@ -1006,7 +1006,7 @@ var ShowMasterpieceMiniappPage = ({
|
|
|
1006
1006
|
onClick: goToCart
|
|
1007
1007
|
},
|
|
1008
1008
|
/* @__PURE__ */ React11__default.default.createElement(components.Text, { className: "text-lg text-white" }, "\u{1F6D2}"),
|
|
1009
|
-
cartCount > 0 && /* @__PURE__ */ React11__default.default.createElement(components.View, { className: "absolute -right-1 -top-1 flex min-h-4 min-w-4 items-center justify-center rounded-full bg-rose-500 px-1" }, /* @__PURE__ */ React11__default.default.createElement(components.Text, { className: "text-
|
|
1009
|
+
cartCount > 0 && /* @__PURE__ */ React11__default.default.createElement(components.View, { className: "absolute -right-1 -top-1 flex min-h-4 min-w-4 items-center justify-center rounded-full bg-rose-500 px-1" }, /* @__PURE__ */ React11__default.default.createElement(components.Text, { className: "text-xs font-semibold text-white" }, cartCount > 99 ? "99+" : cartCount))
|
|
1010
1010
|
), miniappFloatingButtons.showHistory && /* @__PURE__ */ React11__default.default.createElement(
|
|
1011
1011
|
components.View,
|
|
1012
1012
|
{
|
|
@@ -1017,6 +1017,55 @@ var ShowMasterpieceMiniappPage = ({
|
|
|
1017
1017
|
)));
|
|
1018
1018
|
};
|
|
1019
1019
|
var ShowMasterpiecePage_default = ShowMasterpieceMiniappPage;
|
|
1020
|
+
var CONSENT_STORAGE_KEY = "__showmasterpiece_privacy_consent_v1__";
|
|
1021
|
+
var SERVICE_TERMS_TEXT = "\u300A\u7528\u6237\u670D\u52A1\u534F\u8BAE\u300B\u6458\u8981\uFF1A\u672C\u670D\u52A1\u7528\u4E8E\u753B\u96C6\u6D4F\u89C8\u3001\u8D2D\u7269\u8F66\u4E0B\u5355\u4E0E\u5386\u53F2\u67E5\u8BE2\uFF1B\u63D0\u4EA4\u4FE1\u606F\u4EC5\u7528\u4E8E\u8BA2\u5355\u5904\u7406\u3001\u53D1\u8D27\u53CA\u552E\u540E\u6C9F\u901A\u3002";
|
|
1022
|
+
var PRIVACY_POLICY_TEXT = "\u300A\u9690\u79C1\u653F\u7B56\u300B\u6458\u8981\uFF1A\u6211\u4EEC\u4F1A\u6536\u96C6\u60A8\u4E3B\u52A8\u586B\u5199\u7684QQ\u53F7\u3001\u8054\u7CFB\u65B9\u5F0F\u4E0E\u6536\u8D27\u4FE1\u606F\uFF0C\u7528\u4E8E\u9884\u8BA2\u8054\u7CFB\u4E0E\u5C65\u7EA6\uFF1B\u4EC5\u5728\u5FC5\u8981\u671F\u9650\u5185\u4FDD\u5B58\uFF0C\u4E0D\u4F5C\u65E0\u5173\u7528\u9014\u3002";
|
|
1023
|
+
var hasPrivacyConsent = () => {
|
|
1024
|
+
try {
|
|
1025
|
+
return Taro2__default.default.getStorageSync(CONSENT_STORAGE_KEY) === true;
|
|
1026
|
+
} catch {
|
|
1027
|
+
return false;
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
var markPrivacyConsent = () => {
|
|
1031
|
+
try {
|
|
1032
|
+
Taro2__default.default.setStorageSync(CONSENT_STORAGE_KEY, true);
|
|
1033
|
+
} catch (error) {
|
|
1034
|
+
console.error("[privacy-consent] persist failed", error);
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
var showAgreementDoc = async (type) => {
|
|
1038
|
+
const title = type === "service" ? "\u7528\u6237\u670D\u52A1\u534F\u8BAE" : "\u9690\u79C1\u653F\u7B56";
|
|
1039
|
+
const content = type === "service" ? SERVICE_TERMS_TEXT : PRIVACY_POLICY_TEXT;
|
|
1040
|
+
await Taro2__default.default.showModal({
|
|
1041
|
+
title,
|
|
1042
|
+
content,
|
|
1043
|
+
showCancel: false,
|
|
1044
|
+
confirmText: "\u6211\u77E5\u9053\u4E86"
|
|
1045
|
+
});
|
|
1046
|
+
};
|
|
1047
|
+
var ensurePrivacyConsent = async () => {
|
|
1048
|
+
if (hasPrivacyConsent()) return true;
|
|
1049
|
+
try {
|
|
1050
|
+
const { tapIndex } = await Taro2__default.default.showActionSheet({
|
|
1051
|
+
itemList: ["\u67E5\u770B\u300A\u7528\u6237\u670D\u52A1\u534F\u8BAE\u300B", "\u67E5\u770B\u300A\u9690\u79C1\u653F\u7B56\u300B", "\u540C\u610F\u5E76\u7EE7\u7EED"]
|
|
1052
|
+
});
|
|
1053
|
+
if (tapIndex === 0) {
|
|
1054
|
+
await showAgreementDoc("service");
|
|
1055
|
+
return ensurePrivacyConsent();
|
|
1056
|
+
}
|
|
1057
|
+
if (tapIndex === 1) {
|
|
1058
|
+
await showAgreementDoc("privacy");
|
|
1059
|
+
return ensurePrivacyConsent();
|
|
1060
|
+
}
|
|
1061
|
+
markPrivacyConsent();
|
|
1062
|
+
return true;
|
|
1063
|
+
} catch {
|
|
1064
|
+
return false;
|
|
1065
|
+
}
|
|
1066
|
+
};
|
|
1067
|
+
|
|
1068
|
+
// src/showmasterpiece/ui/miniapp/pages/CartPage.tsx
|
|
1020
1069
|
var CartMiniappPage = ({ apiBaseUrl = DEFAULT_BASE_URL }) => {
|
|
1021
1070
|
const [cart, setCart] = React11.useState(() => getCart());
|
|
1022
1071
|
const [qqNumber, setQqNumber] = React11.useState("");
|
|
@@ -1025,6 +1074,7 @@ var CartMiniappPage = ({ apiBaseUrl = DEFAULT_BASE_URL }) => {
|
|
|
1025
1074
|
const [shippingInfo, setShippingInfo] = React11.useState("");
|
|
1026
1075
|
const [submitting, setSubmitting] = React11.useState(false);
|
|
1027
1076
|
const [pendingCheckout, setPendingCheckout] = React11.useState(false);
|
|
1077
|
+
const [privacyConsented, setPrivacyConsented] = React11.useState(() => hasPrivacyConsent());
|
|
1028
1078
|
const [formErrors, setFormErrors] = React11.useState({});
|
|
1029
1079
|
const {
|
|
1030
1080
|
configs: popupConfigs,
|
|
@@ -1044,6 +1094,7 @@ var CartMiniappPage = ({ apiBaseUrl = DEFAULT_BASE_URL }) => {
|
|
|
1044
1094
|
}, []);
|
|
1045
1095
|
Taro2.useDidShow(() => {
|
|
1046
1096
|
refreshCart();
|
|
1097
|
+
setPrivacyConsented(hasPrivacyConsent());
|
|
1047
1098
|
});
|
|
1048
1099
|
const handleUpdateQuantity = (collectionId, quantity) => {
|
|
1049
1100
|
const next = updateCartItem(collectionId, quantity);
|
|
@@ -1120,6 +1171,12 @@ var CartMiniappPage = ({ apiBaseUrl = DEFAULT_BASE_URL }) => {
|
|
|
1120
1171
|
}
|
|
1121
1172
|
};
|
|
1122
1173
|
const handleCheckout = async () => {
|
|
1174
|
+
const consented = await ensurePrivacyConsent();
|
|
1175
|
+
if (!consented) {
|
|
1176
|
+
Taro2__default.default.showToast({ title: "\u8BF7\u5148\u9605\u8BFB\u5E76\u540C\u610F\u534F\u8BAE", icon: "none" });
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
setPrivacyConsented(true);
|
|
1123
1180
|
if (!validateForm()) {
|
|
1124
1181
|
Taro2__default.default.showToast({ title: "\u8BF7\u5148\u4FEE\u6B63\u8868\u5355\u9519\u8BEF", icon: "none" });
|
|
1125
1182
|
return;
|
|
@@ -1207,7 +1264,21 @@ var CartMiniappPage = ({ apiBaseUrl = DEFAULT_BASE_URL }) => {
|
|
|
1207
1264
|
disabled: submitting,
|
|
1208
1265
|
error: formErrors.pickupMethod
|
|
1209
1266
|
}
|
|
1210
|
-
), /* @__PURE__ */ React11__default.default.createElement(components.View, { className: "mt-
|
|
1267
|
+
), /* @__PURE__ */ React11__default.default.createElement(components.View, { className: "mt-4 rounded-xl bg-prussian-blue-50 px-3 py-3" }, /* @__PURE__ */ React11__default.default.createElement(components.Text, { className: "text-xs text-prussian-blue-700" }, "\u63D0\u4EA4\u524D\u8BF7\u9605\u8BFB\u5E76\u540C\u610F"), /* @__PURE__ */ React11__default.default.createElement(
|
|
1268
|
+
components.Text,
|
|
1269
|
+
{
|
|
1270
|
+
className: "ml-1 text-xs text-blue-600",
|
|
1271
|
+
onClick: () => showAgreementDoc("service")
|
|
1272
|
+
},
|
|
1273
|
+
"\u300A\u7528\u6237\u670D\u52A1\u534F\u8BAE\u300B"
|
|
1274
|
+
), /* @__PURE__ */ React11__default.default.createElement(components.Text, { className: "text-xs text-prussian-blue-700" }, "\u4E0E"), /* @__PURE__ */ React11__default.default.createElement(
|
|
1275
|
+
components.Text,
|
|
1276
|
+
{
|
|
1277
|
+
className: "ml-1 text-xs text-blue-600",
|
|
1278
|
+
onClick: () => showAgreementDoc("privacy")
|
|
1279
|
+
},
|
|
1280
|
+
"\u300A\u9690\u79C1\u653F\u7B56\u300B"
|
|
1281
|
+
), /* @__PURE__ */ React11__default.default.createElement(components.Text, { className: "ml-1 text-xs text-prussian-blue-700" }, privacyConsented ? "\uFF08\u5DF2\u540C\u610F\uFF09" : "\uFF08\u672A\u540C\u610F\uFF09")), /* @__PURE__ */ React11__default.default.createElement(components.View, { className: "mt-5 flex items-center justify-between gap-3" }, /* @__PURE__ */ React11__default.default.createElement(
|
|
1211
1282
|
components.View,
|
|
1212
1283
|
{
|
|
1213
1284
|
className: "flex h-11 flex-1 items-center justify-center rounded-xl bg-prussian-blue-100",
|
|
@@ -1239,7 +1310,17 @@ var HistoryMiniappPage = ({ apiBaseUrl = DEFAULT_BASE_URL }) => {
|
|
|
1239
1310
|
const [error, setError] = React11.useState(null);
|
|
1240
1311
|
const [records, setRecords] = React11.useState([]);
|
|
1241
1312
|
const [hasSearched, setHasSearched] = React11.useState(false);
|
|
1313
|
+
const [privacyConsented, setPrivacyConsented] = React11.useState(() => hasPrivacyConsent());
|
|
1314
|
+
Taro2.useDidShow(() => {
|
|
1315
|
+
setPrivacyConsented(hasPrivacyConsent());
|
|
1316
|
+
});
|
|
1242
1317
|
const handleSearch = async () => {
|
|
1318
|
+
const consented = await ensurePrivacyConsent();
|
|
1319
|
+
if (!consented) {
|
|
1320
|
+
Taro2__default.default.showToast({ title: "\u8BF7\u5148\u9605\u8BFB\u5E76\u540C\u610F\u534F\u8BAE", icon: "none" });
|
|
1321
|
+
return;
|
|
1322
|
+
}
|
|
1323
|
+
setPrivacyConsented(true);
|
|
1243
1324
|
if (!qqNumber.trim() && !phoneNumber.trim()) {
|
|
1244
1325
|
Taro2__default.default.showToast({ title: "\u8BF7\u8F93\u5165QQ\u53F7\u6216\u8054\u7CFB\u65B9\u5F0F", icon: "none" });
|
|
1245
1326
|
return;
|
|
@@ -1298,7 +1379,21 @@ var HistoryMiniappPage = ({ apiBaseUrl = DEFAULT_BASE_URL }) => {
|
|
|
1298
1379
|
onChange: setPhoneNumber,
|
|
1299
1380
|
disabled: loading
|
|
1300
1381
|
}
|
|
1301
|
-
), /* @__PURE__ */ React11__default.default.createElement(
|
|
1382
|
+
), /* @__PURE__ */ React11__default.default.createElement(components.View, { className: "mt-4 rounded-xl bg-prussian-blue-50 px-3 py-3" }, /* @__PURE__ */ React11__default.default.createElement(components.Text, { className: "text-xs text-prussian-blue-700" }, "\u67E5\u8BE2\u524D\u8BF7\u9605\u8BFB\u5E76\u540C\u610F"), /* @__PURE__ */ React11__default.default.createElement(
|
|
1383
|
+
components.Text,
|
|
1384
|
+
{
|
|
1385
|
+
className: "ml-1 text-xs text-blue-600",
|
|
1386
|
+
onClick: () => showAgreementDoc("service")
|
|
1387
|
+
},
|
|
1388
|
+
"\u300A\u7528\u6237\u670D\u52A1\u534F\u8BAE\u300B"
|
|
1389
|
+
), /* @__PURE__ */ React11__default.default.createElement(components.Text, { className: "text-xs text-prussian-blue-700" }, "\u4E0E"), /* @__PURE__ */ React11__default.default.createElement(
|
|
1390
|
+
components.Text,
|
|
1391
|
+
{
|
|
1392
|
+
className: "ml-1 text-xs text-blue-600",
|
|
1393
|
+
onClick: () => showAgreementDoc("privacy")
|
|
1394
|
+
},
|
|
1395
|
+
"\u300A\u9690\u79C1\u653F\u7B56\u300B"
|
|
1396
|
+
), /* @__PURE__ */ React11__default.default.createElement(components.Text, { className: "ml-1 text-xs text-prussian-blue-700" }, privacyConsented ? "\uFF08\u5DF2\u540C\u610F\uFF09" : "\uFF08\u672A\u540C\u610F\uFF09")), /* @__PURE__ */ React11__default.default.createElement(
|
|
1302
1397
|
components.View,
|
|
1303
1398
|
{
|
|
1304
1399
|
className: "mt-5 flex h-10 w-full items-center justify-center rounded-full",
|