@polyv/product-sdk 1.6.0 → 1.7.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/index.cjs.js +5 -5
- package/index.es.d.ts +117 -1
- package/index.es.js +355 -240
- package/index.umd.js +5 -5
- package/package.json +1 -1
package/index.es.js
CHANGED
|
@@ -161,7 +161,6 @@ var PolyvApiUrl = /* @__PURE__ */ (function(PolyvApiUrl2) {
|
|
|
161
161
|
PolyvApiUrl2["GetProductTagList"] = "/live/v4/watch/channel/product/tag/list";
|
|
162
162
|
PolyvApiUrl2["GetProductListByShowId"] = "/live/v3/sdk/watch/interactive/product/list-by-showId";
|
|
163
163
|
PolyvApiUrl2["GetProductListByTag"] = "/live/v4/watch/channel/product/list";
|
|
164
|
-
PolyvApiUrl2["GetProductListByLaunch"] = "/live/v4/channel/product/list";
|
|
165
164
|
PolyvApiUrl2["GetProductDataById"] = "/live/v3/sdk/watch/interactive/product/get-by-product-id";
|
|
166
165
|
PolyvApiUrl2["GetOrderList"] = "/live/v4/watch/channel/viewer/product/order/list";
|
|
167
166
|
PolyvApiUrl2["GetOrderDetail"] = "/live/v4/watch/channel/viewer/product/order/get-detail";
|
|
@@ -175,6 +174,8 @@ var PolyvApiUrl = /* @__PURE__ */ (function(PolyvApiUrl2) {
|
|
|
175
174
|
PolyvApiUrl2["AddAddress"] = "/live/v4/watch/channel/viewer/address/save";
|
|
176
175
|
PolyvApiUrl2["UpdateAddress"] = "/live/v4/watch/channel/viewer/address/update";
|
|
177
176
|
PolyvApiUrl2["DeleteAddress"] = "/live/v4/watch/channel/viewer/address/delete";
|
|
177
|
+
PolyvApiUrl2["GetProductListByLaunch"] = "/live/v4/channel/product/list";
|
|
178
|
+
PolyvApiUrl2["GetProductDataByLaunch"] = "/live/v4/channel/product/get";
|
|
178
179
|
PolyvApiUrl2["StartProductExplain"] = "/live/v4/channel/product/product-explain/start-now";
|
|
179
180
|
PolyvApiUrl2["EndProductExplain"] = "/live/v4/channel/product/product-explain/end-now";
|
|
180
181
|
PolyvApiUrl2["RestartProductExplain"] = "/live/v4/channel/product/product-explain/restart-now";
|
|
@@ -201,6 +202,7 @@ var PolyvApiUrl = /* @__PURE__ */ (function(PolyvApiUrl2) {
|
|
|
201
202
|
return PolyvApiUrl2;
|
|
202
203
|
})({});
|
|
203
204
|
var ProductPushRule = /* @__PURE__ */ (function(ProductPushRule2) {
|
|
205
|
+
ProductPushRule2["ChooseCard"] = "chooseCard";
|
|
204
206
|
ProductPushRule2["BigCard"] = "bigCard";
|
|
205
207
|
ProductPushRule2["SmallCard"] = "smallCard";
|
|
206
208
|
return ProductPushRule2;
|
|
@@ -287,6 +289,16 @@ var ProductServiceType = /* @__PURE__ */ (function(ProductServiceType2) {
|
|
|
287
289
|
ProductServiceType2["Custom"] = "custom";
|
|
288
290
|
return ProductServiceType2;
|
|
289
291
|
})({});
|
|
292
|
+
var ProductMoreOperation = /* @__PURE__ */ (function(ProductMoreOperation2) {
|
|
293
|
+
ProductMoreOperation2["Edit"] = "edit";
|
|
294
|
+
ProductMoreOperation2["Top"] = "top";
|
|
295
|
+
ProductMoreOperation2["MoveUp"] = "moveUp";
|
|
296
|
+
ProductMoreOperation2["MoveDown"] = "moveDown";
|
|
297
|
+
ProductMoreOperation2["Delete"] = "delete";
|
|
298
|
+
ProductMoreOperation2["OnShelf"] = "onShelf";
|
|
299
|
+
ProductMoreOperation2["OffShelf"] = "offShelf";
|
|
300
|
+
return ProductMoreOperation2;
|
|
301
|
+
})({});
|
|
290
302
|
var ProductMoveOperation = /* @__PURE__ */ (function(ProductMoveOperation2) {
|
|
291
303
|
ProductMoveOperation2["MoveUp"] = "moveUp";
|
|
292
304
|
ProductMoveOperation2["MoveDown"] = "moveDown";
|
|
@@ -311,6 +323,19 @@ var AiCardTaskStatus = /* @__PURE__ */ (function(AiCardTaskStatus2) {
|
|
|
311
323
|
AiCardTaskStatus2["Error"] = "error";
|
|
312
324
|
return AiCardTaskStatus2;
|
|
313
325
|
})({});
|
|
326
|
+
var ProductOrigin = /* @__PURE__ */ (function(ProductOrigin2) {
|
|
327
|
+
ProductOrigin2["PlatformRef"] = "platform-ref";
|
|
328
|
+
ProductOrigin2["Platform"] = "platform";
|
|
329
|
+
ProductOrigin2["Create"] = "create";
|
|
330
|
+
return ProductOrigin2;
|
|
331
|
+
})({});
|
|
332
|
+
var ProductVersion = /* @__PURE__ */ (function(ProductVersion2) {
|
|
333
|
+
ProductVersion2["V1"] = "v1";
|
|
334
|
+
ProductVersion2["V2"] = "v2";
|
|
335
|
+
ProductVersion2["V3"] = "v3";
|
|
336
|
+
ProductVersion2["Vn"] = "vn";
|
|
337
|
+
return ProductVersion2;
|
|
338
|
+
})({});
|
|
314
339
|
function canMatchKeywords(e, t) {
|
|
315
340
|
e = e.toLowerCase();
|
|
316
341
|
var n = /[/\s;_-]/, s = /[/\s;_-]/;
|
|
@@ -886,7 +911,9 @@ function filterInternalData(internalData) {
|
|
|
886
911
|
pushLogId: internalData.logId,
|
|
887
912
|
rank: internalData.rank,
|
|
888
913
|
originalData: internalData,
|
|
889
|
-
topping: ynToBool(internalData.toppingEnable, "N")
|
|
914
|
+
topping: ynToBool(internalData.toppingEnable, "N"),
|
|
915
|
+
origin: internalData.productOrigin,
|
|
916
|
+
version: internalData.version
|
|
890
917
|
};
|
|
891
918
|
var linkData = {
|
|
892
919
|
linkType: internalData.linkType,
|
|
@@ -931,7 +958,8 @@ function filterInternalData(internalData) {
|
|
|
931
958
|
var explainData = {
|
|
932
959
|
explainStatus: internalData.explainStatus,
|
|
933
960
|
explainType: internalData.explainType,
|
|
934
|
-
explainContent: internalData.aiCard
|
|
961
|
+
explainContent: internalData.aiCard,
|
|
962
|
+
explainedCount: internalData.productExplainNum
|
|
935
963
|
};
|
|
936
964
|
var productData;
|
|
937
965
|
var productType = internalData.productType;
|
|
@@ -1203,6 +1231,9 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1203
1231
|
_defineProperty$4(this, "ProductPushRule", ProductPushRule);
|
|
1204
1232
|
_defineProperty$4(this, "ProductMoveOperation", ProductMoveOperation);
|
|
1205
1233
|
_defineProperty$4(this, "ProductSortType", ProductSortType);
|
|
1234
|
+
_defineProperty$4(this, "ProductMoreOperation", ProductMoreOperation);
|
|
1235
|
+
_defineProperty$4(this, "ProductOrigin", ProductOrigin);
|
|
1236
|
+
_defineProperty$4(this, "ProductVersion", ProductVersion);
|
|
1206
1237
|
_defineProperty$4(this, "eventEmitter", new EventEmitter());
|
|
1207
1238
|
_defineProperty$4(this, "__isPushingProduct", false);
|
|
1208
1239
|
_defineProperty$4(this, "__handleProductMessage", function(socketData) {
|
|
@@ -1598,27 +1629,33 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1598
1629
|
});
|
|
1599
1630
|
case 1:
|
|
1600
1631
|
data = _context8.v;
|
|
1632
|
+
if (data) {
|
|
1633
|
+
_context8.n = 2;
|
|
1634
|
+
break;
|
|
1635
|
+
}
|
|
1636
|
+
return _context8.a(2, void 0);
|
|
1637
|
+
case 2:
|
|
1601
1638
|
productData = filterInternalData(data);
|
|
1602
1639
|
if (!((_productData$detail = productData.detail) !== null && _productData$detail !== void 0 && _productData$detail.endsWith(".json"))) {
|
|
1603
|
-
_context8.n =
|
|
1640
|
+
_context8.n = 4;
|
|
1604
1641
|
break;
|
|
1605
1642
|
}
|
|
1606
|
-
_context8.n =
|
|
1643
|
+
_context8.n = 3;
|
|
1607
1644
|
return this.interactionCore.otherApi.get(productData.detail, {});
|
|
1608
|
-
case
|
|
1645
|
+
case 3:
|
|
1609
1646
|
res = _context8.v;
|
|
1610
1647
|
productData.detail = res.productDetail;
|
|
1611
|
-
case
|
|
1648
|
+
case 4:
|
|
1612
1649
|
if (!((_productData$explainC = productData.explainContent) !== null && _productData$explainC !== void 0 && _productData$explainC.endsWith(".json"))) {
|
|
1613
|
-
_context8.n =
|
|
1650
|
+
_context8.n = 6;
|
|
1614
1651
|
break;
|
|
1615
1652
|
}
|
|
1616
|
-
_context8.n =
|
|
1653
|
+
_context8.n = 5;
|
|
1617
1654
|
return this.interactionCore.otherApi.get(productData.explainContent, {});
|
|
1618
|
-
case
|
|
1655
|
+
case 5:
|
|
1619
1656
|
_res = _context8.v;
|
|
1620
1657
|
productData.explainContent = _res.aiCardContent;
|
|
1621
|
-
case
|
|
1658
|
+
case 6:
|
|
1622
1659
|
return _context8.a(2, productData);
|
|
1623
1660
|
}
|
|
1624
1661
|
}, _callee8, this);
|
|
@@ -1629,31 +1666,78 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1629
1666
|
return getProductData;
|
|
1630
1667
|
})()
|
|
1631
1668
|
}, {
|
|
1632
|
-
key: "
|
|
1669
|
+
key: "getLaunchProductData",
|
|
1633
1670
|
value: (function() {
|
|
1634
|
-
var
|
|
1635
|
-
var
|
|
1636
|
-
var
|
|
1671
|
+
var _getLaunchProductData = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee9(productId) {
|
|
1672
|
+
var _productData$detail2, _productData$explainC2;
|
|
1673
|
+
var data, productData, res, _res2;
|
|
1637
1674
|
return _regenerator$3().w(function(_context9) {
|
|
1638
1675
|
while (1) switch (_context9.n) {
|
|
1639
1676
|
case 0:
|
|
1640
1677
|
_context9.n = 1;
|
|
1641
|
-
return this.interactionCore.
|
|
1678
|
+
return this.interactionCore.polyvApi.get(PolyvApiUrl.GetProductDataByLaunch, {
|
|
1679
|
+
productId
|
|
1680
|
+
}, {
|
|
1681
|
+
useAESDecrypt: true
|
|
1682
|
+
});
|
|
1642
1683
|
case 1:
|
|
1643
|
-
|
|
1684
|
+
data = _context9.v;
|
|
1685
|
+
productData = filterInternalData(data);
|
|
1686
|
+
if (!((_productData$detail2 = productData.detail) !== null && _productData$detail2 !== void 0 && _productData$detail2.endsWith(".json"))) {
|
|
1687
|
+
_context9.n = 3;
|
|
1688
|
+
break;
|
|
1689
|
+
}
|
|
1644
1690
|
_context9.n = 2;
|
|
1691
|
+
return this.interactionCore.otherApi.get(productData.detail, {});
|
|
1692
|
+
case 2:
|
|
1693
|
+
res = _context9.v;
|
|
1694
|
+
productData.detail = res.productDetail;
|
|
1695
|
+
case 3:
|
|
1696
|
+
if (!((_productData$explainC2 = productData.explainContent) !== null && _productData$explainC2 !== void 0 && _productData$explainC2.endsWith(".json"))) {
|
|
1697
|
+
_context9.n = 5;
|
|
1698
|
+
break;
|
|
1699
|
+
}
|
|
1700
|
+
_context9.n = 4;
|
|
1701
|
+
return this.interactionCore.otherApi.get(productData.explainContent, {});
|
|
1702
|
+
case 4:
|
|
1703
|
+
_res2 = _context9.v;
|
|
1704
|
+
productData.explainContent = _res2.aiCardContent;
|
|
1705
|
+
case 5:
|
|
1706
|
+
return _context9.a(2, productData);
|
|
1707
|
+
}
|
|
1708
|
+
}, _callee9, this);
|
|
1709
|
+
}));
|
|
1710
|
+
function getLaunchProductData(_x7) {
|
|
1711
|
+
return _getLaunchProductData.apply(this, arguments);
|
|
1712
|
+
}
|
|
1713
|
+
return getLaunchProductData;
|
|
1714
|
+
})()
|
|
1715
|
+
}, {
|
|
1716
|
+
key: "sendProductClickEvent",
|
|
1717
|
+
value: (function() {
|
|
1718
|
+
var _sendProductClickEvent = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee0(params) {
|
|
1719
|
+
var _this$config2, _this$config2$getProd;
|
|
1720
|
+
var userInfo, channelInfo, productConfig;
|
|
1721
|
+
return _regenerator$3().w(function(_context0) {
|
|
1722
|
+
while (1) switch (_context0.n) {
|
|
1723
|
+
case 0:
|
|
1724
|
+
_context0.n = 1;
|
|
1725
|
+
return this.interactionCore.getUserInfo();
|
|
1726
|
+
case 1:
|
|
1727
|
+
userInfo = _context0.v;
|
|
1728
|
+
_context0.n = 2;
|
|
1645
1729
|
return this.interactionCore.getChannelInfo();
|
|
1646
1730
|
case 2:
|
|
1647
|
-
channelInfo =
|
|
1648
|
-
|
|
1731
|
+
channelInfo = _context0.v;
|
|
1732
|
+
_context0.n = 3;
|
|
1649
1733
|
return (_this$config2 = this.config) === null || _this$config2 === void 0 || (_this$config2$getProd = _this$config2.getProductConfig) === null || _this$config2$getProd === void 0 ? void 0 : _this$config2$getProd.call(_this$config2);
|
|
1650
1734
|
case 3:
|
|
1651
|
-
productConfig =
|
|
1735
|
+
productConfig = _context0.v;
|
|
1652
1736
|
if (!(!(productConfig !== null && productConfig !== void 0 && productConfig.productHotEffectEnabled) && !(productConfig !== null && productConfig !== void 0 && productConfig.productLinkJumpTipEnabled))) {
|
|
1653
|
-
|
|
1737
|
+
_context0.n = 4;
|
|
1654
1738
|
break;
|
|
1655
1739
|
}
|
|
1656
|
-
return
|
|
1740
|
+
return _context0.a(2);
|
|
1657
1741
|
case 4:
|
|
1658
1742
|
this.interactionCore.emitSocket({
|
|
1659
1743
|
EVENT: "PRODUCT_CLICK",
|
|
@@ -1666,11 +1750,11 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1666
1750
|
roomId: channelInfo.channelId
|
|
1667
1751
|
}, "product");
|
|
1668
1752
|
case 5:
|
|
1669
|
-
return
|
|
1753
|
+
return _context0.a(2);
|
|
1670
1754
|
}
|
|
1671
|
-
},
|
|
1755
|
+
}, _callee0, this);
|
|
1672
1756
|
}));
|
|
1673
|
-
function sendProductClickEvent(
|
|
1757
|
+
function sendProductClickEvent(_x8) {
|
|
1674
1758
|
return _sendProductClickEvent.apply(this, arguments);
|
|
1675
1759
|
}
|
|
1676
1760
|
return sendProductClickEvent;
|
|
@@ -1693,46 +1777,68 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1693
1777
|
}, {
|
|
1694
1778
|
key: "getProductExplainEnabled",
|
|
1695
1779
|
value: (function() {
|
|
1696
|
-
var _getProductExplainEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1780
|
+
var _getProductExplainEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee1() {
|
|
1697
1781
|
var _this$config3, _this$config3$getProd, _productConfig$produc2;
|
|
1698
1782
|
var productConfig;
|
|
1699
|
-
return _regenerator$3().w(function(
|
|
1700
|
-
while (1) switch (
|
|
1783
|
+
return _regenerator$3().w(function(_context1) {
|
|
1784
|
+
while (1) switch (_context1.n) {
|
|
1701
1785
|
case 0:
|
|
1702
|
-
|
|
1786
|
+
_context1.n = 1;
|
|
1703
1787
|
return (_this$config3 = this.config) === null || _this$config3 === void 0 || (_this$config3$getProd = _this$config3.getProductConfig) === null || _this$config3$getProd === void 0 ? void 0 : _this$config3$getProd.call(_this$config3);
|
|
1704
1788
|
case 1:
|
|
1705
|
-
productConfig =
|
|
1706
|
-
return
|
|
1789
|
+
productConfig = _context1.v;
|
|
1790
|
+
return _context1.a(2, (_productConfig$produc2 = productConfig === null || productConfig === void 0 ? void 0 : productConfig.productExplainEnabled) !== null && _productConfig$produc2 !== void 0 ? _productConfig$produc2 : false);
|
|
1707
1791
|
}
|
|
1708
|
-
},
|
|
1792
|
+
}, _callee1, this);
|
|
1709
1793
|
}));
|
|
1710
1794
|
function getProductExplainEnabled() {
|
|
1711
1795
|
return _getProductExplainEnabled.apply(this, arguments);
|
|
1712
1796
|
}
|
|
1713
1797
|
return getProductExplainEnabled;
|
|
1714
1798
|
})()
|
|
1799
|
+
}, {
|
|
1800
|
+
key: "getAssistantProductOperationEnabled",
|
|
1801
|
+
value: (function() {
|
|
1802
|
+
var _getAssistantProductOperationEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee10() {
|
|
1803
|
+
var _this$config4, _this$config4$getProd, _productConfig$assist;
|
|
1804
|
+
var productConfig;
|
|
1805
|
+
return _regenerator$3().w(function(_context10) {
|
|
1806
|
+
while (1) switch (_context10.n) {
|
|
1807
|
+
case 0:
|
|
1808
|
+
_context10.n = 1;
|
|
1809
|
+
return (_this$config4 = this.config) === null || _this$config4 === void 0 || (_this$config4$getProd = _this$config4.getProductConfig) === null || _this$config4$getProd === void 0 ? void 0 : _this$config4$getProd.call(_this$config4);
|
|
1810
|
+
case 1:
|
|
1811
|
+
productConfig = _context10.v;
|
|
1812
|
+
return _context10.a(2, (_productConfig$assist = productConfig === null || productConfig === void 0 ? void 0 : productConfig.assistantProductOperationEnabled) !== null && _productConfig$assist !== void 0 ? _productConfig$assist : false);
|
|
1813
|
+
}
|
|
1814
|
+
}, _callee10, this);
|
|
1815
|
+
}));
|
|
1816
|
+
function getAssistantProductOperationEnabled() {
|
|
1817
|
+
return _getAssistantProductOperationEnabled.apply(this, arguments);
|
|
1818
|
+
}
|
|
1819
|
+
return getAssistantProductOperationEnabled;
|
|
1820
|
+
})()
|
|
1715
1821
|
}, {
|
|
1716
1822
|
key: "generateProductExplainPageUrl",
|
|
1717
1823
|
value: (function() {
|
|
1718
|
-
var _generateProductExplainPageUrl = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1824
|
+
var _generateProductExplainPageUrl = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee11(params) {
|
|
1719
1825
|
var domainInfo, channelInfo, queryParams;
|
|
1720
|
-
return _regenerator$3().w(function(
|
|
1721
|
-
while (1) switch (
|
|
1826
|
+
return _regenerator$3().w(function(_context11) {
|
|
1827
|
+
while (1) switch (_context11.n) {
|
|
1722
1828
|
case 0:
|
|
1723
1829
|
domainInfo = this.interactionCore.getDomainInfo();
|
|
1724
|
-
|
|
1830
|
+
_context11.n = 1;
|
|
1725
1831
|
return this.interactionCore.getChannelInfo();
|
|
1726
1832
|
case 1:
|
|
1727
|
-
channelInfo =
|
|
1833
|
+
channelInfo = _context11.v;
|
|
1728
1834
|
queryParams = _objectSpread$3({
|
|
1729
1835
|
channelId: channelInfo.channelId
|
|
1730
1836
|
}, params || {});
|
|
1731
|
-
return
|
|
1837
|
+
return _context11.a(2, concat("".concat(domainInfo.watchPageDomain, "/landing/product/explain"), queryParams));
|
|
1732
1838
|
}
|
|
1733
|
-
},
|
|
1839
|
+
}, _callee11, this);
|
|
1734
1840
|
}));
|
|
1735
|
-
function generateProductExplainPageUrl(
|
|
1841
|
+
function generateProductExplainPageUrl(_x9) {
|
|
1736
1842
|
return _generateProductExplainPageUrl.apply(this, arguments);
|
|
1737
1843
|
}
|
|
1738
1844
|
return generateProductExplainPageUrl;
|
|
@@ -1740,19 +1846,19 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1740
1846
|
}, {
|
|
1741
1847
|
key: "getOutLinkProductRedirectEnabled",
|
|
1742
1848
|
value: (function() {
|
|
1743
|
-
var _getOutLinkProductRedirectEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1744
|
-
var _this$
|
|
1849
|
+
var _getOutLinkProductRedirectEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee12() {
|
|
1850
|
+
var _this$config5, _this$config5$getProd, _productConfig$outLin;
|
|
1745
1851
|
var productConfig;
|
|
1746
|
-
return _regenerator$3().w(function(
|
|
1747
|
-
while (1) switch (
|
|
1852
|
+
return _regenerator$3().w(function(_context12) {
|
|
1853
|
+
while (1) switch (_context12.n) {
|
|
1748
1854
|
case 0:
|
|
1749
|
-
|
|
1750
|
-
return (_this$
|
|
1855
|
+
_context12.n = 1;
|
|
1856
|
+
return (_this$config5 = this.config) === null || _this$config5 === void 0 || (_this$config5$getProd = _this$config5.getProductConfig) === null || _this$config5$getProd === void 0 ? void 0 : _this$config5$getProd.call(_this$config5);
|
|
1751
1857
|
case 1:
|
|
1752
|
-
productConfig =
|
|
1753
|
-
return
|
|
1858
|
+
productConfig = _context12.v;
|
|
1859
|
+
return _context12.a(2, (_productConfig$outLin = productConfig === null || productConfig === void 0 ? void 0 : productConfig.outLinkProductRedirectEnabled) !== null && _productConfig$outLin !== void 0 ? _productConfig$outLin : false);
|
|
1754
1860
|
}
|
|
1755
|
-
},
|
|
1861
|
+
}, _callee12, this);
|
|
1756
1862
|
}));
|
|
1757
1863
|
function getOutLinkProductRedirectEnabled() {
|
|
1758
1864
|
return _getOutLinkProductRedirectEnabled.apply(this, arguments);
|
|
@@ -1762,25 +1868,25 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1762
1868
|
}, {
|
|
1763
1869
|
key: "getProductPayOrderEnabled",
|
|
1764
1870
|
value: (function() {
|
|
1765
|
-
var _getProductPayOrderEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1766
|
-
var _this$
|
|
1871
|
+
var _getProductPayOrderEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee13() {
|
|
1872
|
+
var _this$config6, _this$config6$getProd, _productConfig$produc3;
|
|
1767
1873
|
var productConfig;
|
|
1768
|
-
return _regenerator$3().w(function(
|
|
1769
|
-
while (1) switch (
|
|
1874
|
+
return _regenerator$3().w(function(_context13) {
|
|
1875
|
+
while (1) switch (_context13.n) {
|
|
1770
1876
|
case 0:
|
|
1771
|
-
|
|
1772
|
-
return (_this$
|
|
1877
|
+
_context13.n = 1;
|
|
1878
|
+
return (_this$config6 = this.config) === null || _this$config6 === void 0 || (_this$config6$getProd = _this$config6.getProductConfig) === null || _this$config6$getProd === void 0 ? void 0 : _this$config6$getProd.call(_this$config6);
|
|
1773
1879
|
case 1:
|
|
1774
|
-
productConfig =
|
|
1880
|
+
productConfig = _context13.v;
|
|
1775
1881
|
if (productConfig) {
|
|
1776
|
-
|
|
1882
|
+
_context13.n = 2;
|
|
1777
1883
|
break;
|
|
1778
1884
|
}
|
|
1779
|
-
return
|
|
1885
|
+
return _context13.a(2, false);
|
|
1780
1886
|
case 2:
|
|
1781
|
-
return
|
|
1887
|
+
return _context13.a(2, (_productConfig$produc3 = productConfig.productPayOrderEnabled) !== null && _productConfig$produc3 !== void 0 ? _productConfig$produc3 : false);
|
|
1782
1888
|
}
|
|
1783
|
-
},
|
|
1889
|
+
}, _callee13, this);
|
|
1784
1890
|
}));
|
|
1785
1891
|
function getProductPayOrderEnabled() {
|
|
1786
1892
|
return _getProductPayOrderEnabled.apply(this, arguments);
|
|
@@ -1790,28 +1896,28 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1790
1896
|
}, {
|
|
1791
1897
|
key: "getProductHotSaleConfig",
|
|
1792
1898
|
value: (function() {
|
|
1793
|
-
var _getProductHotSaleConfig = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1794
|
-
var _this$
|
|
1899
|
+
var _getProductHotSaleConfig = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee14() {
|
|
1900
|
+
var _this$config7, _this$config7$getProd, _productConfig$produc4;
|
|
1795
1901
|
var productConfig;
|
|
1796
|
-
return _regenerator$3().w(function(
|
|
1797
|
-
while (1) switch (
|
|
1902
|
+
return _regenerator$3().w(function(_context14) {
|
|
1903
|
+
while (1) switch (_context14.n) {
|
|
1798
1904
|
case 0:
|
|
1799
|
-
|
|
1800
|
-
return (_this$
|
|
1905
|
+
_context14.n = 1;
|
|
1906
|
+
return (_this$config7 = this.config) === null || _this$config7 === void 0 || (_this$config7$getProd = _this$config7.getProductConfig) === null || _this$config7$getProd === void 0 ? void 0 : _this$config7$getProd.call(_this$config7);
|
|
1801
1907
|
case 1:
|
|
1802
|
-
productConfig =
|
|
1908
|
+
productConfig = _context14.v;
|
|
1803
1909
|
if (productConfig) {
|
|
1804
|
-
|
|
1910
|
+
_context14.n = 2;
|
|
1805
1911
|
break;
|
|
1806
1912
|
}
|
|
1807
|
-
return
|
|
1913
|
+
return _context14.a(2);
|
|
1808
1914
|
case 2:
|
|
1809
|
-
return
|
|
1915
|
+
return _context14.a(2, {
|
|
1810
1916
|
productHotEffectEnabled: (_productConfig$produc4 = productConfig.productHotEffectEnabled) !== null && _productConfig$produc4 !== void 0 ? _productConfig$produc4 : false,
|
|
1811
1917
|
productHotEffectTips: productConfig.productHotEffectTips
|
|
1812
1918
|
});
|
|
1813
1919
|
}
|
|
1814
|
-
},
|
|
1920
|
+
}, _callee14, this);
|
|
1815
1921
|
}));
|
|
1816
1922
|
function getProductHotSaleConfig() {
|
|
1817
1923
|
return _getProductHotSaleConfig.apply(this, arguments);
|
|
@@ -1835,16 +1941,16 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1835
1941
|
}, {
|
|
1836
1942
|
key: "getCurrentPushingProduct",
|
|
1837
1943
|
value: (function() {
|
|
1838
|
-
var _getCurrentPushingProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1839
|
-
var _this$
|
|
1944
|
+
var _getCurrentPushingProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee15(productId) {
|
|
1945
|
+
var _this$config8, _this$config8$getProd;
|
|
1840
1946
|
var productConfig, pid, pushRule, _productConfig$channe, _productConfig$channe2, result;
|
|
1841
|
-
return _regenerator$3().w(function(
|
|
1842
|
-
while (1) switch (
|
|
1947
|
+
return _regenerator$3().w(function(_context15) {
|
|
1948
|
+
while (1) switch (_context15.n) {
|
|
1843
1949
|
case 0:
|
|
1844
|
-
|
|
1845
|
-
return (_this$
|
|
1950
|
+
_context15.n = 1;
|
|
1951
|
+
return (_this$config8 = this.config) === null || _this$config8 === void 0 || (_this$config8$getProd = _this$config8.getProductConfig) === null || _this$config8$getProd === void 0 ? void 0 : _this$config8$getProd.call(_this$config8);
|
|
1846
1952
|
case 1:
|
|
1847
|
-
productConfig =
|
|
1953
|
+
productConfig = _context15.v;
|
|
1848
1954
|
if (this.__isPushingProduct) {
|
|
1849
1955
|
pid = this.__currentPushingProductId;
|
|
1850
1956
|
pushRule = this.__currentPushingProductPushRule;
|
|
@@ -1853,22 +1959,28 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1853
1959
|
pushRule = productConfig === null || productConfig === void 0 || (_productConfig$channe2 = productConfig.channelProductPushingStatusVO) === null || _productConfig$channe2 === void 0 ? void 0 : _productConfig$channe2.pushRule;
|
|
1854
1960
|
}
|
|
1855
1961
|
if (pid) {
|
|
1856
|
-
|
|
1962
|
+
_context15.n = 2;
|
|
1857
1963
|
break;
|
|
1858
1964
|
}
|
|
1859
|
-
return
|
|
1965
|
+
return _context15.a(2);
|
|
1860
1966
|
case 2:
|
|
1861
|
-
|
|
1967
|
+
_context15.n = 3;
|
|
1862
1968
|
return this.getProductData(pid);
|
|
1863
1969
|
case 3:
|
|
1864
|
-
result =
|
|
1865
|
-
|
|
1970
|
+
result = _context15.v;
|
|
1971
|
+
if (result) {
|
|
1972
|
+
_context15.n = 4;
|
|
1973
|
+
break;
|
|
1974
|
+
}
|
|
1975
|
+
return _context15.a(2);
|
|
1976
|
+
case 4:
|
|
1977
|
+
return _context15.a(2, _objectSpread$3(_objectSpread$3({}, result), {}, {
|
|
1866
1978
|
pushRule
|
|
1867
1979
|
}));
|
|
1868
1980
|
}
|
|
1869
|
-
},
|
|
1981
|
+
}, _callee15, this);
|
|
1870
1982
|
}));
|
|
1871
|
-
function getCurrentPushingProduct(
|
|
1983
|
+
function getCurrentPushingProduct(_x0) {
|
|
1872
1984
|
return _getCurrentPushingProduct.apply(this, arguments);
|
|
1873
1985
|
}
|
|
1874
1986
|
return getCurrentPushingProduct;
|
|
@@ -1876,40 +1988,40 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1876
1988
|
}, {
|
|
1877
1989
|
key: "_explainProduct",
|
|
1878
1990
|
value: (function() {
|
|
1879
|
-
var _explainProduct2 = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1991
|
+
var _explainProduct2 = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee16(productId, recordType) {
|
|
1880
1992
|
var channelInfo, data, apiPath, _t;
|
|
1881
|
-
return _regenerator$3().w(function(
|
|
1882
|
-
while (1) switch (
|
|
1993
|
+
return _regenerator$3().w(function(_context16) {
|
|
1994
|
+
while (1) switch (_context16.n) {
|
|
1883
1995
|
case 0:
|
|
1884
|
-
|
|
1996
|
+
_context16.n = 1;
|
|
1885
1997
|
return this.interactionCore.getChannelInfo();
|
|
1886
1998
|
case 1:
|
|
1887
|
-
channelInfo =
|
|
1999
|
+
channelInfo = _context16.v;
|
|
1888
2000
|
data = {
|
|
1889
2001
|
sessionId: channelInfo.sessionId || "",
|
|
1890
2002
|
productId
|
|
1891
2003
|
};
|
|
1892
2004
|
_t = recordType;
|
|
1893
|
-
|
|
2005
|
+
_context16.n = _t === ProductExplainOperation.Start ? 2 : _t === ProductExplainOperation.Restart ? 3 : 4;
|
|
1894
2006
|
break;
|
|
1895
2007
|
case 2:
|
|
1896
2008
|
apiPath = PolyvApiUrl.StartProductExplain;
|
|
1897
|
-
return
|
|
2009
|
+
return _context16.a(3, 5);
|
|
1898
2010
|
case 3:
|
|
1899
2011
|
apiPath = PolyvApiUrl.RestartProductExplain;
|
|
1900
|
-
return
|
|
2012
|
+
return _context16.a(3, 5);
|
|
1901
2013
|
case 4:
|
|
1902
2014
|
apiPath = PolyvApiUrl.EndProductExplain;
|
|
1903
2015
|
data.recordType = recordType;
|
|
1904
|
-
return
|
|
2016
|
+
return _context16.a(3, 5);
|
|
1905
2017
|
case 5:
|
|
1906
|
-
return
|
|
2018
|
+
return _context16.a(2, this.interactionCore.polyvApi.post(apiPath, {
|
|
1907
2019
|
data
|
|
1908
2020
|
}));
|
|
1909
2021
|
}
|
|
1910
|
-
},
|
|
2022
|
+
}, _callee16, this);
|
|
1911
2023
|
}));
|
|
1912
|
-
function _explainProduct(
|
|
2024
|
+
function _explainProduct(_x1, _x10) {
|
|
1913
2025
|
return _explainProduct2.apply(this, arguments);
|
|
1914
2026
|
}
|
|
1915
2027
|
return _explainProduct;
|
|
@@ -1964,19 +2076,19 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1964
2076
|
}, {
|
|
1965
2077
|
key: "deleteExplain",
|
|
1966
2078
|
value: (function() {
|
|
1967
|
-
var _deleteExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1968
|
-
return _regenerator$3().w(function(
|
|
1969
|
-
while (1) switch (
|
|
2079
|
+
var _deleteExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee17(productId) {
|
|
2080
|
+
return _regenerator$3().w(function(_context17) {
|
|
2081
|
+
while (1) switch (_context17.n) {
|
|
1970
2082
|
case 0:
|
|
1971
|
-
return
|
|
2083
|
+
return _context17.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.DeleteProductExplain, {
|
|
1972
2084
|
data: {
|
|
1973
2085
|
productId
|
|
1974
2086
|
}
|
|
1975
2087
|
}));
|
|
1976
2088
|
}
|
|
1977
|
-
},
|
|
2089
|
+
}, _callee17, this);
|
|
1978
2090
|
}));
|
|
1979
|
-
function deleteExplain(
|
|
2091
|
+
function deleteExplain(_x11) {
|
|
1980
2092
|
return _deleteExplain.apply(this, arguments);
|
|
1981
2093
|
}
|
|
1982
2094
|
return deleteExplain;
|
|
@@ -1984,18 +2096,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1984
2096
|
}, {
|
|
1985
2097
|
key: "getCurrentProductExplain",
|
|
1986
2098
|
value: (function() {
|
|
1987
|
-
var _getCurrentProductExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2099
|
+
var _getCurrentProductExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee18() {
|
|
1988
2100
|
var explainingId;
|
|
1989
|
-
return _regenerator$3().w(function(
|
|
1990
|
-
while (1) switch (
|
|
2101
|
+
return _regenerator$3().w(function(_context18) {
|
|
2102
|
+
while (1) switch (_context18.n) {
|
|
1991
2103
|
case 0:
|
|
1992
|
-
|
|
2104
|
+
_context18.n = 1;
|
|
1993
2105
|
return this.interactionCore.polyvApi.get(PolyvApiUrl.GetCurrentProductExplain, {});
|
|
1994
2106
|
case 1:
|
|
1995
|
-
explainingId =
|
|
1996
|
-
return
|
|
2107
|
+
explainingId = _context18.v;
|
|
2108
|
+
return _context18.a(2, explainingId);
|
|
1997
2109
|
}
|
|
1998
|
-
},
|
|
2110
|
+
}, _callee18, this);
|
|
1999
2111
|
}));
|
|
2000
2112
|
function getCurrentProductExplain() {
|
|
2001
2113
|
return _getCurrentProductExplain.apply(this, arguments);
|
|
@@ -2005,17 +2117,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2005
2117
|
}, {
|
|
2006
2118
|
key: "openProductPrice",
|
|
2007
2119
|
value: (function() {
|
|
2008
|
-
var _openProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2009
|
-
return _regenerator$3().w(function(
|
|
2010
|
-
while (1) switch (
|
|
2120
|
+
var _openProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee19(productId) {
|
|
2121
|
+
return _regenerator$3().w(function(_context19) {
|
|
2122
|
+
while (1) switch (_context19.n) {
|
|
2011
2123
|
case 0:
|
|
2012
|
-
return
|
|
2124
|
+
return _context19.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.OpenProductPrice, {
|
|
2013
2125
|
productId
|
|
2014
2126
|
}));
|
|
2015
2127
|
}
|
|
2016
|
-
},
|
|
2128
|
+
}, _callee19, this);
|
|
2017
2129
|
}));
|
|
2018
|
-
function openProductPrice(
|
|
2130
|
+
function openProductPrice(_x12) {
|
|
2019
2131
|
return _openProductPrice.apply(this, arguments);
|
|
2020
2132
|
}
|
|
2021
2133
|
return openProductPrice;
|
|
@@ -2023,17 +2135,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2023
2135
|
}, {
|
|
2024
2136
|
key: "hideProductPrice",
|
|
2025
2137
|
value: (function() {
|
|
2026
|
-
var _hideProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2027
|
-
return _regenerator$3().w(function(
|
|
2028
|
-
while (1) switch (
|
|
2138
|
+
var _hideProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee20(productId) {
|
|
2139
|
+
return _regenerator$3().w(function(_context20) {
|
|
2140
|
+
while (1) switch (_context20.n) {
|
|
2029
2141
|
case 0:
|
|
2030
|
-
return
|
|
2142
|
+
return _context20.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.HideProductPrice, {
|
|
2031
2143
|
productId
|
|
2032
2144
|
}));
|
|
2033
2145
|
}
|
|
2034
|
-
},
|
|
2146
|
+
}, _callee20, this);
|
|
2035
2147
|
}));
|
|
2036
|
-
function hideProductPrice(
|
|
2148
|
+
function hideProductPrice(_x13) {
|
|
2037
2149
|
return _hideProductPrice.apply(this, arguments);
|
|
2038
2150
|
}
|
|
2039
2151
|
return hideProductPrice;
|
|
@@ -2041,16 +2153,16 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2041
2153
|
}, {
|
|
2042
2154
|
key: "getProductSetting",
|
|
2043
2155
|
value: (function() {
|
|
2044
|
-
var _getProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2156
|
+
var _getProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee21() {
|
|
2045
2157
|
var data;
|
|
2046
|
-
return _regenerator$3().w(function(
|
|
2047
|
-
while (1) switch (
|
|
2158
|
+
return _regenerator$3().w(function(_context21) {
|
|
2159
|
+
while (1) switch (_context21.n) {
|
|
2048
2160
|
case 0:
|
|
2049
|
-
|
|
2161
|
+
_context21.n = 1;
|
|
2050
2162
|
return this.interactionCore.polyvApi.get(PolyvApiUrl.ProductPushRule, {});
|
|
2051
2163
|
case 1:
|
|
2052
|
-
data =
|
|
2053
|
-
return
|
|
2164
|
+
data = _context21.v;
|
|
2165
|
+
return _context21.a(2, {
|
|
2054
2166
|
pushingProduct: data.channelProductPushingStatusVO,
|
|
2055
2167
|
productPushRule: data.productPushRule,
|
|
2056
2168
|
productExplainEnabled: ynToBool(data.productExplainEnabled, "N"),
|
|
@@ -2059,7 +2171,7 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2059
2171
|
productListSortType: data.productListSortType
|
|
2060
2172
|
});
|
|
2061
2173
|
}
|
|
2062
|
-
},
|
|
2174
|
+
}, _callee21, this);
|
|
2063
2175
|
}));
|
|
2064
2176
|
function getProductSetting() {
|
|
2065
2177
|
return _getProductSetting.apply(this, arguments);
|
|
@@ -2069,10 +2181,10 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2069
2181
|
}, {
|
|
2070
2182
|
key: "updateProductSetting",
|
|
2071
2183
|
value: (function() {
|
|
2072
|
-
var _updateProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2184
|
+
var _updateProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee22(params) {
|
|
2073
2185
|
var booleanFields, payload;
|
|
2074
|
-
return _regenerator$3().w(function(
|
|
2075
|
-
while (1) switch (
|
|
2186
|
+
return _regenerator$3().w(function(_context22) {
|
|
2187
|
+
while (1) switch (_context22.n) {
|
|
2076
2188
|
case 0:
|
|
2077
2189
|
booleanFields = ["productExplainEnabled", "productExplainingAutoPushAndSticky", "hideProductPriceEnabled"];
|
|
2078
2190
|
payload = Object.entries(params).reduce(function(acc, _ref) {
|
|
@@ -2086,11 +2198,11 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2086
2198
|
}
|
|
2087
2199
|
return acc;
|
|
2088
2200
|
}, {});
|
|
2089
|
-
return
|
|
2201
|
+
return _context22.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateProductPushRule, payload));
|
|
2090
2202
|
}
|
|
2091
|
-
},
|
|
2203
|
+
}, _callee22, this);
|
|
2092
2204
|
}));
|
|
2093
|
-
function updateProductSetting(
|
|
2205
|
+
function updateProductSetting(_x14) {
|
|
2094
2206
|
return _updateProductSetting.apply(this, arguments);
|
|
2095
2207
|
}
|
|
2096
2208
|
return updateProductSetting;
|
|
@@ -2098,18 +2210,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2098
2210
|
}, {
|
|
2099
2211
|
key: "pushProduct",
|
|
2100
2212
|
value: (function() {
|
|
2101
|
-
var _pushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2102
|
-
return _regenerator$3().w(function(
|
|
2103
|
-
while (1) switch (
|
|
2213
|
+
var _pushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee23(productId, rule) {
|
|
2214
|
+
return _regenerator$3().w(function(_context23) {
|
|
2215
|
+
while (1) switch (_context23.n) {
|
|
2104
2216
|
case 0:
|
|
2105
|
-
return
|
|
2217
|
+
return _context23.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.PushProduct, {
|
|
2106
2218
|
productId,
|
|
2107
2219
|
productPushRule: rule || ProductPushRule.SmallCard
|
|
2108
2220
|
}));
|
|
2109
2221
|
}
|
|
2110
|
-
},
|
|
2222
|
+
}, _callee23, this);
|
|
2111
2223
|
}));
|
|
2112
|
-
function pushProduct(
|
|
2224
|
+
function pushProduct(_x15, _x16) {
|
|
2113
2225
|
return _pushProduct.apply(this, arguments);
|
|
2114
2226
|
}
|
|
2115
2227
|
return pushProduct;
|
|
@@ -2117,17 +2229,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2117
2229
|
}, {
|
|
2118
2230
|
key: "cancelPushProduct",
|
|
2119
2231
|
value: (function() {
|
|
2120
|
-
var _cancelPushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2121
|
-
return _regenerator$3().w(function(
|
|
2122
|
-
while (1) switch (
|
|
2232
|
+
var _cancelPushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee24(productId) {
|
|
2233
|
+
return _regenerator$3().w(function(_context24) {
|
|
2234
|
+
while (1) switch (_context24.n) {
|
|
2123
2235
|
case 0:
|
|
2124
|
-
return
|
|
2236
|
+
return _context24.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.CancelPushProduct, {
|
|
2125
2237
|
productId
|
|
2126
2238
|
}));
|
|
2127
2239
|
}
|
|
2128
|
-
},
|
|
2240
|
+
}, _callee24, this);
|
|
2129
2241
|
}));
|
|
2130
|
-
function cancelPushProduct(
|
|
2242
|
+
function cancelPushProduct(_x17) {
|
|
2131
2243
|
return _cancelPushProduct.apply(this, arguments);
|
|
2132
2244
|
}
|
|
2133
2245
|
return cancelPushProduct;
|
|
@@ -2135,17 +2247,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2135
2247
|
}, {
|
|
2136
2248
|
key: "batchDeleteProduct",
|
|
2137
2249
|
value: (function() {
|
|
2138
|
-
var _batchDeleteProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2139
|
-
return _regenerator$3().w(function(
|
|
2140
|
-
while (1) switch (
|
|
2250
|
+
var _batchDeleteProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee25(productIds) {
|
|
2251
|
+
return _regenerator$3().w(function(_context25) {
|
|
2252
|
+
while (1) switch (_context25.n) {
|
|
2141
2253
|
case 0:
|
|
2142
|
-
return
|
|
2254
|
+
return _context25.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchDeleteProduct, {
|
|
2143
2255
|
productIds
|
|
2144
2256
|
}));
|
|
2145
2257
|
}
|
|
2146
|
-
},
|
|
2258
|
+
}, _callee25, this);
|
|
2147
2259
|
}));
|
|
2148
|
-
function batchDeleteProduct(
|
|
2260
|
+
function batchDeleteProduct(_x18) {
|
|
2149
2261
|
return _batchDeleteProduct.apply(this, arguments);
|
|
2150
2262
|
}
|
|
2151
2263
|
return batchDeleteProduct;
|
|
@@ -2153,18 +2265,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2153
2265
|
}, {
|
|
2154
2266
|
key: "batchOnShelfProduct",
|
|
2155
2267
|
value: (function() {
|
|
2156
|
-
var _batchOnShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2157
|
-
return _regenerator$3().w(function(
|
|
2158
|
-
while (1) switch (
|
|
2268
|
+
var _batchOnShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee26(productIds) {
|
|
2269
|
+
return _regenerator$3().w(function(_context26) {
|
|
2270
|
+
while (1) switch (_context26.n) {
|
|
2159
2271
|
case 0:
|
|
2160
|
-
return
|
|
2272
|
+
return _context26.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchShelfProduct, {
|
|
2161
2273
|
productIds,
|
|
2162
2274
|
status: ProductStatus.OnSale
|
|
2163
2275
|
}));
|
|
2164
2276
|
}
|
|
2165
|
-
},
|
|
2277
|
+
}, _callee26, this);
|
|
2166
2278
|
}));
|
|
2167
|
-
function batchOnShelfProduct(
|
|
2279
|
+
function batchOnShelfProduct(_x19) {
|
|
2168
2280
|
return _batchOnShelfProduct.apply(this, arguments);
|
|
2169
2281
|
}
|
|
2170
2282
|
return batchOnShelfProduct;
|
|
@@ -2172,18 +2284,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2172
2284
|
}, {
|
|
2173
2285
|
key: "batchOffShelfProduct",
|
|
2174
2286
|
value: (function() {
|
|
2175
|
-
var _batchOffShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2176
|
-
return _regenerator$3().w(function(
|
|
2177
|
-
while (1) switch (
|
|
2287
|
+
var _batchOffShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee27(productIds) {
|
|
2288
|
+
return _regenerator$3().w(function(_context27) {
|
|
2289
|
+
while (1) switch (_context27.n) {
|
|
2178
2290
|
case 0:
|
|
2179
|
-
return
|
|
2291
|
+
return _context27.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchShelfProduct, {
|
|
2180
2292
|
productIds,
|
|
2181
2293
|
status: ProductStatus.OffSale
|
|
2182
2294
|
}));
|
|
2183
2295
|
}
|
|
2184
|
-
},
|
|
2296
|
+
}, _callee27, this);
|
|
2185
2297
|
}));
|
|
2186
|
-
function batchOffShelfProduct(
|
|
2298
|
+
function batchOffShelfProduct(_x20) {
|
|
2187
2299
|
return _batchOffShelfProduct.apply(this, arguments);
|
|
2188
2300
|
}
|
|
2189
2301
|
return batchOffShelfProduct;
|
|
@@ -2191,17 +2303,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2191
2303
|
}, {
|
|
2192
2304
|
key: "topProduct",
|
|
2193
2305
|
value: (function() {
|
|
2194
|
-
var _topProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2195
|
-
return _regenerator$3().w(function(
|
|
2196
|
-
while (1) switch (
|
|
2306
|
+
var _topProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee28(productId) {
|
|
2307
|
+
return _regenerator$3().w(function(_context28) {
|
|
2308
|
+
while (1) switch (_context28.n) {
|
|
2197
2309
|
case 0:
|
|
2198
|
-
return
|
|
2310
|
+
return _context28.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.TopProduct, {
|
|
2199
2311
|
productId
|
|
2200
2312
|
}));
|
|
2201
2313
|
}
|
|
2202
|
-
},
|
|
2314
|
+
}, _callee28, this);
|
|
2203
2315
|
}));
|
|
2204
|
-
function topProduct(
|
|
2316
|
+
function topProduct(_x21) {
|
|
2205
2317
|
return _topProduct.apply(this, arguments);
|
|
2206
2318
|
}
|
|
2207
2319
|
return topProduct;
|
|
@@ -2209,17 +2321,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2209
2321
|
}, {
|
|
2210
2322
|
key: "cancelTopProduct",
|
|
2211
2323
|
value: (function() {
|
|
2212
|
-
var _cancelTopProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2213
|
-
return _regenerator$3().w(function(
|
|
2214
|
-
while (1) switch (
|
|
2324
|
+
var _cancelTopProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee29(productId) {
|
|
2325
|
+
return _regenerator$3().w(function(_context29) {
|
|
2326
|
+
while (1) switch (_context29.n) {
|
|
2215
2327
|
case 0:
|
|
2216
|
-
return
|
|
2328
|
+
return _context29.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.CancelTopProduct, {
|
|
2217
2329
|
productId
|
|
2218
2330
|
}));
|
|
2219
2331
|
}
|
|
2220
|
-
},
|
|
2332
|
+
}, _callee29, this);
|
|
2221
2333
|
}));
|
|
2222
|
-
function cancelTopProduct(
|
|
2334
|
+
function cancelTopProduct(_x22) {
|
|
2223
2335
|
return _cancelTopProduct.apply(this, arguments);
|
|
2224
2336
|
}
|
|
2225
2337
|
return cancelTopProduct;
|
|
@@ -2227,18 +2339,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2227
2339
|
}, {
|
|
2228
2340
|
key: "setProductSoldOut",
|
|
2229
2341
|
value: (function() {
|
|
2230
|
-
var _setProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2231
|
-
return _regenerator$3().w(function(
|
|
2232
|
-
while (1) switch (
|
|
2342
|
+
var _setProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee30(productId) {
|
|
2343
|
+
return _regenerator$3().w(function(_context30) {
|
|
2344
|
+
while (1) switch (_context30.n) {
|
|
2233
2345
|
case 0:
|
|
2234
|
-
return
|
|
2346
|
+
return _context30.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.ToggleProductSoldOut, {
|
|
2235
2347
|
productId,
|
|
2236
2348
|
markAsSoldout: "Y"
|
|
2237
2349
|
}));
|
|
2238
2350
|
}
|
|
2239
|
-
},
|
|
2351
|
+
}, _callee30, this);
|
|
2240
2352
|
}));
|
|
2241
|
-
function setProductSoldOut(
|
|
2353
|
+
function setProductSoldOut(_x23) {
|
|
2242
2354
|
return _setProductSoldOut.apply(this, arguments);
|
|
2243
2355
|
}
|
|
2244
2356
|
return setProductSoldOut;
|
|
@@ -2246,18 +2358,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2246
2358
|
}, {
|
|
2247
2359
|
key: "cancelProductSoldOut",
|
|
2248
2360
|
value: (function() {
|
|
2249
|
-
var _cancelProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2250
|
-
return _regenerator$3().w(function(
|
|
2251
|
-
while (1) switch (
|
|
2361
|
+
var _cancelProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee31(productId) {
|
|
2362
|
+
return _regenerator$3().w(function(_context31) {
|
|
2363
|
+
while (1) switch (_context31.n) {
|
|
2252
2364
|
case 0:
|
|
2253
|
-
return
|
|
2365
|
+
return _context31.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.ToggleProductSoldOut, {
|
|
2254
2366
|
productId,
|
|
2255
2367
|
markAsSoldout: "N"
|
|
2256
2368
|
}));
|
|
2257
2369
|
}
|
|
2258
|
-
},
|
|
2370
|
+
}, _callee31, this);
|
|
2259
2371
|
}));
|
|
2260
|
-
function cancelProductSoldOut(
|
|
2372
|
+
function cancelProductSoldOut(_x24) {
|
|
2261
2373
|
return _cancelProductSoldOut.apply(this, arguments);
|
|
2262
2374
|
}
|
|
2263
2375
|
return cancelProductSoldOut;
|
|
@@ -2265,18 +2377,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2265
2377
|
}, {
|
|
2266
2378
|
key: "getProductEnabled",
|
|
2267
2379
|
value: (function() {
|
|
2268
|
-
var _getProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2380
|
+
var _getProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee32() {
|
|
2269
2381
|
var enabled;
|
|
2270
|
-
return _regenerator$3().w(function(
|
|
2271
|
-
while (1) switch (
|
|
2382
|
+
return _regenerator$3().w(function(_context32) {
|
|
2383
|
+
while (1) switch (_context32.n) {
|
|
2272
2384
|
case 0:
|
|
2273
|
-
|
|
2385
|
+
_context32.n = 1;
|
|
2274
2386
|
return this.interactionCore.polyvApi.get(PolyvApiUrl.GetProductEnabled, {});
|
|
2275
2387
|
case 1:
|
|
2276
|
-
enabled =
|
|
2277
|
-
return
|
|
2388
|
+
enabled = _context32.v;
|
|
2389
|
+
return _context32.a(2, ynToBool(enabled, "N"));
|
|
2278
2390
|
}
|
|
2279
|
-
},
|
|
2391
|
+
}, _callee32, this);
|
|
2280
2392
|
}));
|
|
2281
2393
|
function getProductEnabled() {
|
|
2282
2394
|
return _getProductEnabled.apply(this, arguments);
|
|
@@ -2286,20 +2398,20 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2286
2398
|
}, {
|
|
2287
2399
|
key: "updateProductEnabled",
|
|
2288
2400
|
value: (function() {
|
|
2289
|
-
var _updateProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2290
|
-
return _regenerator$3().w(function(
|
|
2291
|
-
while (1) switch (
|
|
2401
|
+
var _updateProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee33(enabled) {
|
|
2402
|
+
return _regenerator$3().w(function(_context33) {
|
|
2403
|
+
while (1) switch (_context33.n) {
|
|
2292
2404
|
case 0:
|
|
2293
|
-
|
|
2405
|
+
_context33.n = 1;
|
|
2294
2406
|
return this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateProductEnabled, {
|
|
2295
2407
|
enabled: boolToYN(enabled)
|
|
2296
2408
|
});
|
|
2297
2409
|
case 1:
|
|
2298
|
-
return
|
|
2410
|
+
return _context33.a(2);
|
|
2299
2411
|
}
|
|
2300
|
-
},
|
|
2412
|
+
}, _callee33, this);
|
|
2301
2413
|
}));
|
|
2302
|
-
function updateProductEnabled(
|
|
2414
|
+
function updateProductEnabled(_x25) {
|
|
2303
2415
|
return _updateProductEnabled.apply(this, arguments);
|
|
2304
2416
|
}
|
|
2305
2417
|
return updateProductEnabled;
|
|
@@ -2307,15 +2419,15 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2307
2419
|
}, {
|
|
2308
2420
|
key: "updateProductSort",
|
|
2309
2421
|
value: (function() {
|
|
2310
|
-
var _updateProductSort = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2311
|
-
return _regenerator$3().w(function(
|
|
2312
|
-
while (1) switch (
|
|
2422
|
+
var _updateProductSort = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee34(params) {
|
|
2423
|
+
return _regenerator$3().w(function(_context34) {
|
|
2424
|
+
while (1) switch (_context34.n) {
|
|
2313
2425
|
case 0:
|
|
2314
|
-
return
|
|
2426
|
+
return _context34.a(2, this.interactionCore.polyvApi.post(concat(PolyvApiUrl.UpdateProductSort, params), {}));
|
|
2315
2427
|
}
|
|
2316
|
-
},
|
|
2428
|
+
}, _callee34, this);
|
|
2317
2429
|
}));
|
|
2318
|
-
function updateProductSort(
|
|
2430
|
+
function updateProductSort(_x26) {
|
|
2319
2431
|
return _updateProductSort.apply(this, arguments);
|
|
2320
2432
|
}
|
|
2321
2433
|
return updateProductSort;
|
|
@@ -2323,20 +2435,20 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2323
2435
|
}, {
|
|
2324
2436
|
key: "moveProduct",
|
|
2325
2437
|
value: (function() {
|
|
2326
|
-
var _moveProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2438
|
+
var _moveProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee35(productId, operation) {
|
|
2327
2439
|
var type;
|
|
2328
|
-
return _regenerator$3().w(function(
|
|
2329
|
-
while (1) switch (
|
|
2440
|
+
return _regenerator$3().w(function(_context35) {
|
|
2441
|
+
while (1) switch (_context35.n) {
|
|
2330
2442
|
case 0:
|
|
2331
2443
|
type = operation === ProductMoveOperation.MoveUp ? 10 : 20;
|
|
2332
|
-
return
|
|
2444
|
+
return _context35.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.MoveProduct, {
|
|
2333
2445
|
productId,
|
|
2334
2446
|
type
|
|
2335
2447
|
}));
|
|
2336
2448
|
}
|
|
2337
|
-
},
|
|
2449
|
+
}, _callee35, this);
|
|
2338
2450
|
}));
|
|
2339
|
-
function moveProduct(
|
|
2451
|
+
function moveProduct(_x27, _x28) {
|
|
2340
2452
|
return _moveProduct.apply(this, arguments);
|
|
2341
2453
|
}
|
|
2342
2454
|
return moveProduct;
|
|
@@ -2344,58 +2456,58 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2344
2456
|
}, {
|
|
2345
2457
|
key: "getSupportToDirectBuy",
|
|
2346
2458
|
value: (function() {
|
|
2347
|
-
var _getSupportToDirectBuy = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2348
|
-
var _this$
|
|
2459
|
+
var _getSupportToDirectBuy = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee36() {
|
|
2460
|
+
var _this$config9, _this$config9$getProd;
|
|
2349
2461
|
var userInfo, productConfig, authType, notSupportAuthTypes;
|
|
2350
|
-
return _regenerator$3().w(function(
|
|
2351
|
-
while (1) switch (
|
|
2462
|
+
return _regenerator$3().w(function(_context36) {
|
|
2463
|
+
while (1) switch (_context36.n) {
|
|
2352
2464
|
case 0:
|
|
2353
|
-
|
|
2465
|
+
_context36.n = 1;
|
|
2354
2466
|
return this.getProductPayOrderEnabled();
|
|
2355
2467
|
case 1:
|
|
2356
|
-
if (
|
|
2357
|
-
|
|
2468
|
+
if (_context36.v) {
|
|
2469
|
+
_context36.n = 2;
|
|
2358
2470
|
break;
|
|
2359
2471
|
}
|
|
2360
|
-
return
|
|
2472
|
+
return _context36.a(2, false);
|
|
2361
2473
|
case 2:
|
|
2362
|
-
|
|
2474
|
+
_context36.n = 3;
|
|
2363
2475
|
return this.interactionCore.getUserInfo();
|
|
2364
2476
|
case 3:
|
|
2365
|
-
userInfo =
|
|
2477
|
+
userInfo = _context36.v;
|
|
2366
2478
|
if (userInfo.unionId) {
|
|
2367
|
-
|
|
2479
|
+
_context36.n = 4;
|
|
2368
2480
|
break;
|
|
2369
2481
|
}
|
|
2370
|
-
return
|
|
2482
|
+
return _context36.a(2, false);
|
|
2371
2483
|
case 4:
|
|
2372
|
-
|
|
2373
|
-
return (_this$
|
|
2484
|
+
_context36.n = 5;
|
|
2485
|
+
return (_this$config9 = this.config) === null || _this$config9 === void 0 || (_this$config9$getProd = _this$config9.getProductConfig) === null || _this$config9$getProd === void 0 ? void 0 : _this$config9$getProd.call(_this$config9);
|
|
2374
2486
|
case 5:
|
|
2375
|
-
productConfig =
|
|
2487
|
+
productConfig = _context36.v;
|
|
2376
2488
|
if (productConfig !== null && productConfig !== void 0 && productConfig.directBuyEnabled) {
|
|
2377
|
-
|
|
2489
|
+
_context36.n = 6;
|
|
2378
2490
|
break;
|
|
2379
2491
|
}
|
|
2380
|
-
return
|
|
2492
|
+
return _context36.a(2, false);
|
|
2381
2493
|
case 6:
|
|
2382
2494
|
authType = userInfo.authType;
|
|
2383
2495
|
if (!(!authType || authType === AuthType.None)) {
|
|
2384
|
-
|
|
2496
|
+
_context36.n = 7;
|
|
2385
2497
|
break;
|
|
2386
2498
|
}
|
|
2387
|
-
return
|
|
2499
|
+
return _context36.a(2, true);
|
|
2388
2500
|
case 7:
|
|
2389
2501
|
notSupportAuthTypes = [AuthType.Custom, AuthType.External, AuthType.Direct, AuthType.EnterpriseWeChat];
|
|
2390
2502
|
if (!notSupportAuthTypes.includes(authType)) {
|
|
2391
|
-
|
|
2503
|
+
_context36.n = 8;
|
|
2392
2504
|
break;
|
|
2393
2505
|
}
|
|
2394
|
-
return
|
|
2506
|
+
return _context36.a(2, false);
|
|
2395
2507
|
case 8:
|
|
2396
|
-
return
|
|
2508
|
+
return _context36.a(2, true);
|
|
2397
2509
|
}
|
|
2398
|
-
},
|
|
2510
|
+
}, _callee36, this);
|
|
2399
2511
|
}));
|
|
2400
2512
|
function getSupportToDirectBuy() {
|
|
2401
2513
|
return _getSupportToDirectBuy.apply(this, arguments);
|
|
@@ -3448,8 +3560,8 @@ var Payment = /* @__PURE__ */ (function() {
|
|
|
3448
3560
|
console.log(
|
|
3449
3561
|
"%c@polyv/product-sdk",
|
|
3450
3562
|
"background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff",
|
|
3451
|
-
"[version: 1.
|
|
3452
|
-
"[buildTime: 2025-
|
|
3563
|
+
"[version: 1.7.0]",
|
|
3564
|
+
"[buildTime: 2025-11-14 03:36:24]"
|
|
3453
3565
|
);
|
|
3454
3566
|
export {
|
|
3455
3567
|
Address,
|
|
@@ -3472,12 +3584,15 @@ export {
|
|
|
3472
3584
|
ProductLinkJumpWay,
|
|
3473
3585
|
ProductLinkType,
|
|
3474
3586
|
ProductMediaType,
|
|
3587
|
+
ProductMoreOperation,
|
|
3475
3588
|
ProductMoveOperation,
|
|
3589
|
+
ProductOrigin,
|
|
3476
3590
|
ProductPriceType,
|
|
3477
3591
|
ProductPushRule,
|
|
3478
3592
|
ProductServiceType,
|
|
3479
3593
|
ProductSortType,
|
|
3480
3594
|
ProductStatus,
|
|
3481
3595
|
ProductType,
|
|
3596
|
+
ProductVersion,
|
|
3482
3597
|
RefundStatus
|
|
3483
3598
|
};
|