@polyv/product-sdk 1.5.0 → 1.6.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 +87 -0
- package/index.es.js +383 -246
- package/index.umd.js +5 -5
- package/package.json +1 -1
package/index.es.js
CHANGED
|
@@ -195,6 +195,9 @@ var PolyvApiUrl = /* @__PURE__ */ (function(PolyvApiUrl2) {
|
|
|
195
195
|
PolyvApiUrl2["UpdateProductEnabled"] = "/live/v4/channel/product/menu/update-enabled";
|
|
196
196
|
PolyvApiUrl2["UpdateProductSort"] = "/live/v4/channel/product/sort-rank";
|
|
197
197
|
PolyvApiUrl2["MoveProduct"] = "/live/v4/channel/product/sort-rank-by-type";
|
|
198
|
+
PolyvApiUrl2["CreateAiCardTask"] = "/live/v4/channel/product/create-ai-card-task";
|
|
199
|
+
PolyvApiUrl2["GetAiCardContent"] = "/live/v4/channel/product/get-ai-card-task-output";
|
|
200
|
+
PolyvApiUrl2["UpdateAiCardContent"] = "/live/v4/channel/product/update-ai-card-content";
|
|
198
201
|
return PolyvApiUrl2;
|
|
199
202
|
})({});
|
|
200
203
|
var ProductPushRule = /* @__PURE__ */ (function(ProductPushRule2) {
|
|
@@ -302,6 +305,12 @@ var AuthType = /* @__PURE__ */ (function(AuthType2) {
|
|
|
302
305
|
AuthType2["EnterpriseWeChat"] = "enterpriseWeChat";
|
|
303
306
|
return AuthType2;
|
|
304
307
|
})({});
|
|
308
|
+
var AiCardTaskStatus = /* @__PURE__ */ (function(AiCardTaskStatus2) {
|
|
309
|
+
AiCardTaskStatus2["Delta"] = "delta";
|
|
310
|
+
AiCardTaskStatus2["Complete"] = "complete";
|
|
311
|
+
AiCardTaskStatus2["Error"] = "error";
|
|
312
|
+
return AiCardTaskStatus2;
|
|
313
|
+
})({});
|
|
305
314
|
function canMatchKeywords(e, t) {
|
|
306
315
|
e = e.toLowerCase();
|
|
307
316
|
var n = /[/\s;_-]/, s = /[/\s;_-]/;
|
|
@@ -921,7 +930,8 @@ function filterInternalData(internalData) {
|
|
|
921
930
|
}
|
|
922
931
|
var explainData = {
|
|
923
932
|
explainStatus: internalData.explainStatus,
|
|
924
|
-
explainType: internalData.explainType
|
|
933
|
+
explainType: internalData.explainType,
|
|
934
|
+
explainContent: internalData.aiCard
|
|
925
935
|
};
|
|
926
936
|
var productData;
|
|
927
937
|
var productType = internalData.productType;
|
|
@@ -1456,38 +1466,164 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1456
1466
|
return getLaunchProductList;
|
|
1457
1467
|
})()
|
|
1458
1468
|
}, {
|
|
1459
|
-
key: "
|
|
1469
|
+
key: "getProductAiCardEnabled",
|
|
1460
1470
|
value: (function() {
|
|
1461
|
-
var
|
|
1462
|
-
var
|
|
1463
|
-
var
|
|
1471
|
+
var _getProductAiCardEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee4() {
|
|
1472
|
+
var _this$config, _this$config$getProdu, _productConfig$produc;
|
|
1473
|
+
var productConfig;
|
|
1464
1474
|
return _regenerator$3().w(function(_context4) {
|
|
1465
1475
|
while (1) switch (_context4.n) {
|
|
1466
1476
|
case 0:
|
|
1467
1477
|
_context4.n = 1;
|
|
1478
|
+
return (_this$config = this.config) === null || _this$config === void 0 || (_this$config$getProdu = _this$config.getProductConfig) === null || _this$config$getProdu === void 0 ? void 0 : _this$config$getProdu.call(_this$config);
|
|
1479
|
+
case 1:
|
|
1480
|
+
productConfig = _context4.v;
|
|
1481
|
+
return _context4.a(2, (_productConfig$produc = productConfig === null || productConfig === void 0 ? void 0 : productConfig.productAiCardEnabled) !== null && _productConfig$produc !== void 0 ? _productConfig$produc : false);
|
|
1482
|
+
}
|
|
1483
|
+
}, _callee4, this);
|
|
1484
|
+
}));
|
|
1485
|
+
function getProductAiCardEnabled() {
|
|
1486
|
+
return _getProductAiCardEnabled.apply(this, arguments);
|
|
1487
|
+
}
|
|
1488
|
+
return getProductAiCardEnabled;
|
|
1489
|
+
})()
|
|
1490
|
+
}, {
|
|
1491
|
+
key: "createProductAiCardTask",
|
|
1492
|
+
value: (function() {
|
|
1493
|
+
var _createProductAiCardTask = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee5(productId) {
|
|
1494
|
+
var taskId;
|
|
1495
|
+
return _regenerator$3().w(function(_context5) {
|
|
1496
|
+
while (1) switch (_context5.n) {
|
|
1497
|
+
case 0:
|
|
1498
|
+
_context5.n = 1;
|
|
1499
|
+
return this.interactionCore.polyvApi.post(PolyvApiUrl.CreateAiCardTask, {
|
|
1500
|
+
productId
|
|
1501
|
+
});
|
|
1502
|
+
case 1:
|
|
1503
|
+
taskId = _context5.v;
|
|
1504
|
+
return _context5.a(2, taskId);
|
|
1505
|
+
}
|
|
1506
|
+
}, _callee5, this);
|
|
1507
|
+
}));
|
|
1508
|
+
function createProductAiCardTask(_x2) {
|
|
1509
|
+
return _createProductAiCardTask.apply(this, arguments);
|
|
1510
|
+
}
|
|
1511
|
+
return createProductAiCardTask;
|
|
1512
|
+
})()
|
|
1513
|
+
}, {
|
|
1514
|
+
key: "getProductAiCardContent",
|
|
1515
|
+
value: (function() {
|
|
1516
|
+
var _getProductAiCardContent = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee6(taskId) {
|
|
1517
|
+
var res, data, error, completed;
|
|
1518
|
+
return _regenerator$3().w(function(_context6) {
|
|
1519
|
+
while (1) switch (_context6.n) {
|
|
1520
|
+
case 0:
|
|
1521
|
+
_context6.n = 1;
|
|
1522
|
+
return this.interactionCore.polyvApi.get(PolyvApiUrl.GetAiCardContent, {
|
|
1523
|
+
taskId
|
|
1524
|
+
});
|
|
1525
|
+
case 1:
|
|
1526
|
+
res = _context6.v;
|
|
1527
|
+
if (res.length) {
|
|
1528
|
+
_context6.n = 2;
|
|
1529
|
+
break;
|
|
1530
|
+
}
|
|
1531
|
+
return _context6.a(2, {
|
|
1532
|
+
error: false,
|
|
1533
|
+
completed: false,
|
|
1534
|
+
data: ""
|
|
1535
|
+
});
|
|
1536
|
+
case 2:
|
|
1537
|
+
data = res.reduce(function(acc, curr) {
|
|
1538
|
+
if (![AiCardTaskStatus.Complete, AiCardTaskStatus.Error].includes(curr.event)) {
|
|
1539
|
+
acc += curr.data;
|
|
1540
|
+
}
|
|
1541
|
+
return acc;
|
|
1542
|
+
}, "");
|
|
1543
|
+
error = res.some(function(item) {
|
|
1544
|
+
return item.event === AiCardTaskStatus.Error;
|
|
1545
|
+
});
|
|
1546
|
+
completed = res.some(function(item) {
|
|
1547
|
+
return item.event === AiCardTaskStatus.Complete;
|
|
1548
|
+
});
|
|
1549
|
+
return _context6.a(2, {
|
|
1550
|
+
error,
|
|
1551
|
+
completed,
|
|
1552
|
+
data
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
}, _callee6, this);
|
|
1556
|
+
}));
|
|
1557
|
+
function getProductAiCardContent(_x3) {
|
|
1558
|
+
return _getProductAiCardContent.apply(this, arguments);
|
|
1559
|
+
}
|
|
1560
|
+
return getProductAiCardContent;
|
|
1561
|
+
})()
|
|
1562
|
+
}, {
|
|
1563
|
+
key: "UpdateProductAiCardContent",
|
|
1564
|
+
value: (function() {
|
|
1565
|
+
var _UpdateProductAiCardContent = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee7(productId, aiCardContent) {
|
|
1566
|
+
return _regenerator$3().w(function(_context7) {
|
|
1567
|
+
while (1) switch (_context7.n) {
|
|
1568
|
+
case 0:
|
|
1569
|
+
_context7.n = 1;
|
|
1570
|
+
return this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateAiCardContent, {
|
|
1571
|
+
productId,
|
|
1572
|
+
aiCardContent
|
|
1573
|
+
});
|
|
1574
|
+
case 1:
|
|
1575
|
+
return _context7.a(2);
|
|
1576
|
+
}
|
|
1577
|
+
}, _callee7, this);
|
|
1578
|
+
}));
|
|
1579
|
+
function UpdateProductAiCardContent(_x4, _x5) {
|
|
1580
|
+
return _UpdateProductAiCardContent.apply(this, arguments);
|
|
1581
|
+
}
|
|
1582
|
+
return UpdateProductAiCardContent;
|
|
1583
|
+
})()
|
|
1584
|
+
}, {
|
|
1585
|
+
key: "getProductData",
|
|
1586
|
+
value: (function() {
|
|
1587
|
+
var _getProductData = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee8(productId) {
|
|
1588
|
+
var _productData$detail, _productData$explainC;
|
|
1589
|
+
var data, productData, res, _res;
|
|
1590
|
+
return _regenerator$3().w(function(_context8) {
|
|
1591
|
+
while (1) switch (_context8.n) {
|
|
1592
|
+
case 0:
|
|
1593
|
+
_context8.n = 1;
|
|
1468
1594
|
return this.interactionCore.polyvApi.get(PolyvApiUrl.GetProductDataById, {
|
|
1469
1595
|
productId
|
|
1470
1596
|
}, {
|
|
1471
1597
|
useAESDecrypt: true
|
|
1472
1598
|
});
|
|
1473
1599
|
case 1:
|
|
1474
|
-
data =
|
|
1600
|
+
data = _context8.v;
|
|
1475
1601
|
productData = filterInternalData(data);
|
|
1476
1602
|
if (!((_productData$detail = productData.detail) !== null && _productData$detail !== void 0 && _productData$detail.endsWith(".json"))) {
|
|
1477
|
-
|
|
1603
|
+
_context8.n = 3;
|
|
1478
1604
|
break;
|
|
1479
1605
|
}
|
|
1480
|
-
|
|
1606
|
+
_context8.n = 2;
|
|
1481
1607
|
return this.interactionCore.otherApi.get(productData.detail, {});
|
|
1482
1608
|
case 2:
|
|
1483
|
-
res =
|
|
1609
|
+
res = _context8.v;
|
|
1484
1610
|
productData.detail = res.productDetail;
|
|
1485
1611
|
case 3:
|
|
1486
|
-
|
|
1612
|
+
if (!((_productData$explainC = productData.explainContent) !== null && _productData$explainC !== void 0 && _productData$explainC.endsWith(".json"))) {
|
|
1613
|
+
_context8.n = 5;
|
|
1614
|
+
break;
|
|
1615
|
+
}
|
|
1616
|
+
_context8.n = 4;
|
|
1617
|
+
return this.interactionCore.otherApi.get(productData.explainContent, {});
|
|
1618
|
+
case 4:
|
|
1619
|
+
_res = _context8.v;
|
|
1620
|
+
productData.explainContent = _res.aiCardContent;
|
|
1621
|
+
case 5:
|
|
1622
|
+
return _context8.a(2, productData);
|
|
1487
1623
|
}
|
|
1488
|
-
},
|
|
1624
|
+
}, _callee8, this);
|
|
1489
1625
|
}));
|
|
1490
|
-
function getProductData(
|
|
1626
|
+
function getProductData(_x6) {
|
|
1491
1627
|
return _getProductData.apply(this, arguments);
|
|
1492
1628
|
}
|
|
1493
1629
|
return getProductData;
|
|
@@ -1495,29 +1631,29 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1495
1631
|
}, {
|
|
1496
1632
|
key: "sendProductClickEvent",
|
|
1497
1633
|
value: (function() {
|
|
1498
|
-
var _sendProductClickEvent = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1499
|
-
var _this$
|
|
1634
|
+
var _sendProductClickEvent = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee9(params) {
|
|
1635
|
+
var _this$config2, _this$config2$getProd;
|
|
1500
1636
|
var userInfo, channelInfo, productConfig;
|
|
1501
|
-
return _regenerator$3().w(function(
|
|
1502
|
-
while (1) switch (
|
|
1637
|
+
return _regenerator$3().w(function(_context9) {
|
|
1638
|
+
while (1) switch (_context9.n) {
|
|
1503
1639
|
case 0:
|
|
1504
|
-
|
|
1640
|
+
_context9.n = 1;
|
|
1505
1641
|
return this.interactionCore.getUserInfo();
|
|
1506
1642
|
case 1:
|
|
1507
|
-
userInfo =
|
|
1508
|
-
|
|
1643
|
+
userInfo = _context9.v;
|
|
1644
|
+
_context9.n = 2;
|
|
1509
1645
|
return this.interactionCore.getChannelInfo();
|
|
1510
1646
|
case 2:
|
|
1511
|
-
channelInfo =
|
|
1512
|
-
|
|
1513
|
-
return (_this$
|
|
1647
|
+
channelInfo = _context9.v;
|
|
1648
|
+
_context9.n = 3;
|
|
1649
|
+
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);
|
|
1514
1650
|
case 3:
|
|
1515
|
-
productConfig =
|
|
1651
|
+
productConfig = _context9.v;
|
|
1516
1652
|
if (!(!(productConfig !== null && productConfig !== void 0 && productConfig.productHotEffectEnabled) && !(productConfig !== null && productConfig !== void 0 && productConfig.productLinkJumpTipEnabled))) {
|
|
1517
|
-
|
|
1653
|
+
_context9.n = 4;
|
|
1518
1654
|
break;
|
|
1519
1655
|
}
|
|
1520
|
-
return
|
|
1656
|
+
return _context9.a(2);
|
|
1521
1657
|
case 4:
|
|
1522
1658
|
this.interactionCore.emitSocket({
|
|
1523
1659
|
EVENT: "PRODUCT_CLICK",
|
|
@@ -1530,11 +1666,11 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1530
1666
|
roomId: channelInfo.channelId
|
|
1531
1667
|
}, "product");
|
|
1532
1668
|
case 5:
|
|
1533
|
-
return
|
|
1669
|
+
return _context9.a(2);
|
|
1534
1670
|
}
|
|
1535
|
-
},
|
|
1671
|
+
}, _callee9, this);
|
|
1536
1672
|
}));
|
|
1537
|
-
function sendProductClickEvent(
|
|
1673
|
+
function sendProductClickEvent(_x7) {
|
|
1538
1674
|
return _sendProductClickEvent.apply(this, arguments);
|
|
1539
1675
|
}
|
|
1540
1676
|
return sendProductClickEvent;
|
|
@@ -1557,19 +1693,19 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1557
1693
|
}, {
|
|
1558
1694
|
key: "getProductExplainEnabled",
|
|
1559
1695
|
value: (function() {
|
|
1560
|
-
var _getProductExplainEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1561
|
-
var _this$
|
|
1696
|
+
var _getProductExplainEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee0() {
|
|
1697
|
+
var _this$config3, _this$config3$getProd, _productConfig$produc2;
|
|
1562
1698
|
var productConfig;
|
|
1563
|
-
return _regenerator$3().w(function(
|
|
1564
|
-
while (1) switch (
|
|
1699
|
+
return _regenerator$3().w(function(_context0) {
|
|
1700
|
+
while (1) switch (_context0.n) {
|
|
1565
1701
|
case 0:
|
|
1566
|
-
|
|
1567
|
-
return (_this$
|
|
1702
|
+
_context0.n = 1;
|
|
1703
|
+
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);
|
|
1568
1704
|
case 1:
|
|
1569
|
-
productConfig =
|
|
1570
|
-
return
|
|
1705
|
+
productConfig = _context0.v;
|
|
1706
|
+
return _context0.a(2, (_productConfig$produc2 = productConfig === null || productConfig === void 0 ? void 0 : productConfig.productExplainEnabled) !== null && _productConfig$produc2 !== void 0 ? _productConfig$produc2 : false);
|
|
1571
1707
|
}
|
|
1572
|
-
},
|
|
1708
|
+
}, _callee0, this);
|
|
1573
1709
|
}));
|
|
1574
1710
|
function getProductExplainEnabled() {
|
|
1575
1711
|
return _getProductExplainEnabled.apply(this, arguments);
|
|
@@ -1579,24 +1715,24 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1579
1715
|
}, {
|
|
1580
1716
|
key: "generateProductExplainPageUrl",
|
|
1581
1717
|
value: (function() {
|
|
1582
|
-
var _generateProductExplainPageUrl = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1718
|
+
var _generateProductExplainPageUrl = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee1(params) {
|
|
1583
1719
|
var domainInfo, channelInfo, queryParams;
|
|
1584
|
-
return _regenerator$3().w(function(
|
|
1585
|
-
while (1) switch (
|
|
1720
|
+
return _regenerator$3().w(function(_context1) {
|
|
1721
|
+
while (1) switch (_context1.n) {
|
|
1586
1722
|
case 0:
|
|
1587
1723
|
domainInfo = this.interactionCore.getDomainInfo();
|
|
1588
|
-
|
|
1724
|
+
_context1.n = 1;
|
|
1589
1725
|
return this.interactionCore.getChannelInfo();
|
|
1590
1726
|
case 1:
|
|
1591
|
-
channelInfo =
|
|
1727
|
+
channelInfo = _context1.v;
|
|
1592
1728
|
queryParams = _objectSpread$3({
|
|
1593
1729
|
channelId: channelInfo.channelId
|
|
1594
1730
|
}, params || {});
|
|
1595
|
-
return
|
|
1731
|
+
return _context1.a(2, concat("".concat(domainInfo.watchPageDomain, "/landing/product/explain"), queryParams));
|
|
1596
1732
|
}
|
|
1597
|
-
},
|
|
1733
|
+
}, _callee1, this);
|
|
1598
1734
|
}));
|
|
1599
|
-
function generateProductExplainPageUrl(
|
|
1735
|
+
function generateProductExplainPageUrl(_x8) {
|
|
1600
1736
|
return _generateProductExplainPageUrl.apply(this, arguments);
|
|
1601
1737
|
}
|
|
1602
1738
|
return generateProductExplainPageUrl;
|
|
@@ -1604,19 +1740,19 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1604
1740
|
}, {
|
|
1605
1741
|
key: "getOutLinkProductRedirectEnabled",
|
|
1606
1742
|
value: (function() {
|
|
1607
|
-
var _getOutLinkProductRedirectEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1608
|
-
var _this$
|
|
1743
|
+
var _getOutLinkProductRedirectEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee10() {
|
|
1744
|
+
var _this$config4, _this$config4$getProd, _productConfig$outLin;
|
|
1609
1745
|
var productConfig;
|
|
1610
|
-
return _regenerator$3().w(function(
|
|
1611
|
-
while (1) switch (
|
|
1746
|
+
return _regenerator$3().w(function(_context10) {
|
|
1747
|
+
while (1) switch (_context10.n) {
|
|
1612
1748
|
case 0:
|
|
1613
|
-
|
|
1614
|
-
return (_this$
|
|
1749
|
+
_context10.n = 1;
|
|
1750
|
+
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);
|
|
1615
1751
|
case 1:
|
|
1616
|
-
productConfig =
|
|
1617
|
-
return
|
|
1752
|
+
productConfig = _context10.v;
|
|
1753
|
+
return _context10.a(2, (_productConfig$outLin = productConfig === null || productConfig === void 0 ? void 0 : productConfig.outLinkProductRedirectEnabled) !== null && _productConfig$outLin !== void 0 ? _productConfig$outLin : false);
|
|
1618
1754
|
}
|
|
1619
|
-
},
|
|
1755
|
+
}, _callee10, this);
|
|
1620
1756
|
}));
|
|
1621
1757
|
function getOutLinkProductRedirectEnabled() {
|
|
1622
1758
|
return _getOutLinkProductRedirectEnabled.apply(this, arguments);
|
|
@@ -1626,25 +1762,25 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1626
1762
|
}, {
|
|
1627
1763
|
key: "getProductPayOrderEnabled",
|
|
1628
1764
|
value: (function() {
|
|
1629
|
-
var _getProductPayOrderEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1630
|
-
var _this$
|
|
1765
|
+
var _getProductPayOrderEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee11() {
|
|
1766
|
+
var _this$config5, _this$config5$getProd, _productConfig$produc3;
|
|
1631
1767
|
var productConfig;
|
|
1632
|
-
return _regenerator$3().w(function(
|
|
1633
|
-
while (1) switch (
|
|
1768
|
+
return _regenerator$3().w(function(_context11) {
|
|
1769
|
+
while (1) switch (_context11.n) {
|
|
1634
1770
|
case 0:
|
|
1635
|
-
|
|
1636
|
-
return (_this$
|
|
1771
|
+
_context11.n = 1;
|
|
1772
|
+
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);
|
|
1637
1773
|
case 1:
|
|
1638
|
-
productConfig =
|
|
1774
|
+
productConfig = _context11.v;
|
|
1639
1775
|
if (productConfig) {
|
|
1640
|
-
|
|
1776
|
+
_context11.n = 2;
|
|
1641
1777
|
break;
|
|
1642
1778
|
}
|
|
1643
|
-
return
|
|
1779
|
+
return _context11.a(2, false);
|
|
1644
1780
|
case 2:
|
|
1645
|
-
return
|
|
1781
|
+
return _context11.a(2, (_productConfig$produc3 = productConfig.productPayOrderEnabled) !== null && _productConfig$produc3 !== void 0 ? _productConfig$produc3 : false);
|
|
1646
1782
|
}
|
|
1647
|
-
},
|
|
1783
|
+
}, _callee11, this);
|
|
1648
1784
|
}));
|
|
1649
1785
|
function getProductPayOrderEnabled() {
|
|
1650
1786
|
return _getProductPayOrderEnabled.apply(this, arguments);
|
|
@@ -1654,28 +1790,28 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1654
1790
|
}, {
|
|
1655
1791
|
key: "getProductHotSaleConfig",
|
|
1656
1792
|
value: (function() {
|
|
1657
|
-
var _getProductHotSaleConfig = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1658
|
-
var _this$
|
|
1793
|
+
var _getProductHotSaleConfig = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee12() {
|
|
1794
|
+
var _this$config6, _this$config6$getProd, _productConfig$produc4;
|
|
1659
1795
|
var productConfig;
|
|
1660
|
-
return _regenerator$3().w(function(
|
|
1661
|
-
while (1) switch (
|
|
1796
|
+
return _regenerator$3().w(function(_context12) {
|
|
1797
|
+
while (1) switch (_context12.n) {
|
|
1662
1798
|
case 0:
|
|
1663
|
-
|
|
1664
|
-
return (_this$
|
|
1799
|
+
_context12.n = 1;
|
|
1800
|
+
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);
|
|
1665
1801
|
case 1:
|
|
1666
|
-
productConfig =
|
|
1802
|
+
productConfig = _context12.v;
|
|
1667
1803
|
if (productConfig) {
|
|
1668
|
-
|
|
1804
|
+
_context12.n = 2;
|
|
1669
1805
|
break;
|
|
1670
1806
|
}
|
|
1671
|
-
return
|
|
1807
|
+
return _context12.a(2);
|
|
1672
1808
|
case 2:
|
|
1673
|
-
return
|
|
1674
|
-
productHotEffectEnabled: (_productConfig$
|
|
1809
|
+
return _context12.a(2, {
|
|
1810
|
+
productHotEffectEnabled: (_productConfig$produc4 = productConfig.productHotEffectEnabled) !== null && _productConfig$produc4 !== void 0 ? _productConfig$produc4 : false,
|
|
1675
1811
|
productHotEffectTips: productConfig.productHotEffectTips
|
|
1676
1812
|
});
|
|
1677
1813
|
}
|
|
1678
|
-
},
|
|
1814
|
+
}, _callee12, this);
|
|
1679
1815
|
}));
|
|
1680
1816
|
function getProductHotSaleConfig() {
|
|
1681
1817
|
return _getProductHotSaleConfig.apply(this, arguments);
|
|
@@ -1699,16 +1835,16 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1699
1835
|
}, {
|
|
1700
1836
|
key: "getCurrentPushingProduct",
|
|
1701
1837
|
value: (function() {
|
|
1702
|
-
var _getCurrentPushingProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1703
|
-
var _this$
|
|
1838
|
+
var _getCurrentPushingProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee13(productId) {
|
|
1839
|
+
var _this$config7, _this$config7$getProd;
|
|
1704
1840
|
var productConfig, pid, pushRule, _productConfig$channe, _productConfig$channe2, result;
|
|
1705
|
-
return _regenerator$3().w(function(
|
|
1706
|
-
while (1) switch (
|
|
1841
|
+
return _regenerator$3().w(function(_context13) {
|
|
1842
|
+
while (1) switch (_context13.n) {
|
|
1707
1843
|
case 0:
|
|
1708
|
-
|
|
1709
|
-
return (_this$
|
|
1844
|
+
_context13.n = 1;
|
|
1845
|
+
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);
|
|
1710
1846
|
case 1:
|
|
1711
|
-
productConfig =
|
|
1847
|
+
productConfig = _context13.v;
|
|
1712
1848
|
if (this.__isPushingProduct) {
|
|
1713
1849
|
pid = this.__currentPushingProductId;
|
|
1714
1850
|
pushRule = this.__currentPushingProductPushRule;
|
|
@@ -1717,22 +1853,22 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1717
1853
|
pushRule = productConfig === null || productConfig === void 0 || (_productConfig$channe2 = productConfig.channelProductPushingStatusVO) === null || _productConfig$channe2 === void 0 ? void 0 : _productConfig$channe2.pushRule;
|
|
1718
1854
|
}
|
|
1719
1855
|
if (pid) {
|
|
1720
|
-
|
|
1856
|
+
_context13.n = 2;
|
|
1721
1857
|
break;
|
|
1722
1858
|
}
|
|
1723
|
-
return
|
|
1859
|
+
return _context13.a(2);
|
|
1724
1860
|
case 2:
|
|
1725
|
-
|
|
1861
|
+
_context13.n = 3;
|
|
1726
1862
|
return this.getProductData(pid);
|
|
1727
1863
|
case 3:
|
|
1728
|
-
result =
|
|
1729
|
-
return
|
|
1864
|
+
result = _context13.v;
|
|
1865
|
+
return _context13.a(2, _objectSpread$3(_objectSpread$3({}, result), {}, {
|
|
1730
1866
|
pushRule
|
|
1731
1867
|
}));
|
|
1732
1868
|
}
|
|
1733
|
-
},
|
|
1869
|
+
}, _callee13, this);
|
|
1734
1870
|
}));
|
|
1735
|
-
function getCurrentPushingProduct(
|
|
1871
|
+
function getCurrentPushingProduct(_x9) {
|
|
1736
1872
|
return _getCurrentPushingProduct.apply(this, arguments);
|
|
1737
1873
|
}
|
|
1738
1874
|
return getCurrentPushingProduct;
|
|
@@ -1740,40 +1876,40 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1740
1876
|
}, {
|
|
1741
1877
|
key: "_explainProduct",
|
|
1742
1878
|
value: (function() {
|
|
1743
|
-
var _explainProduct2 = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1879
|
+
var _explainProduct2 = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee14(productId, recordType) {
|
|
1744
1880
|
var channelInfo, data, apiPath, _t;
|
|
1745
|
-
return _regenerator$3().w(function(
|
|
1746
|
-
while (1) switch (
|
|
1881
|
+
return _regenerator$3().w(function(_context14) {
|
|
1882
|
+
while (1) switch (_context14.n) {
|
|
1747
1883
|
case 0:
|
|
1748
|
-
|
|
1884
|
+
_context14.n = 1;
|
|
1749
1885
|
return this.interactionCore.getChannelInfo();
|
|
1750
1886
|
case 1:
|
|
1751
|
-
channelInfo =
|
|
1887
|
+
channelInfo = _context14.v;
|
|
1752
1888
|
data = {
|
|
1753
1889
|
sessionId: channelInfo.sessionId || "",
|
|
1754
1890
|
productId
|
|
1755
1891
|
};
|
|
1756
1892
|
_t = recordType;
|
|
1757
|
-
|
|
1893
|
+
_context14.n = _t === ProductExplainOperation.Start ? 2 : _t === ProductExplainOperation.Restart ? 3 : 4;
|
|
1758
1894
|
break;
|
|
1759
1895
|
case 2:
|
|
1760
1896
|
apiPath = PolyvApiUrl.StartProductExplain;
|
|
1761
|
-
return
|
|
1897
|
+
return _context14.a(3, 5);
|
|
1762
1898
|
case 3:
|
|
1763
1899
|
apiPath = PolyvApiUrl.RestartProductExplain;
|
|
1764
|
-
return
|
|
1900
|
+
return _context14.a(3, 5);
|
|
1765
1901
|
case 4:
|
|
1766
1902
|
apiPath = PolyvApiUrl.EndProductExplain;
|
|
1767
1903
|
data.recordType = recordType;
|
|
1768
|
-
return
|
|
1904
|
+
return _context14.a(3, 5);
|
|
1769
1905
|
case 5:
|
|
1770
|
-
return
|
|
1906
|
+
return _context14.a(2, this.interactionCore.polyvApi.post(apiPath, {
|
|
1771
1907
|
data
|
|
1772
1908
|
}));
|
|
1773
1909
|
}
|
|
1774
|
-
},
|
|
1910
|
+
}, _callee14, this);
|
|
1775
1911
|
}));
|
|
1776
|
-
function _explainProduct(
|
|
1912
|
+
function _explainProduct(_x0, _x1) {
|
|
1777
1913
|
return _explainProduct2.apply(this, arguments);
|
|
1778
1914
|
}
|
|
1779
1915
|
return _explainProduct;
|
|
@@ -1828,19 +1964,19 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1828
1964
|
}, {
|
|
1829
1965
|
key: "deleteExplain",
|
|
1830
1966
|
value: (function() {
|
|
1831
|
-
var _deleteExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1832
|
-
return _regenerator$3().w(function(
|
|
1833
|
-
while (1) switch (
|
|
1967
|
+
var _deleteExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee15(productId) {
|
|
1968
|
+
return _regenerator$3().w(function(_context15) {
|
|
1969
|
+
while (1) switch (_context15.n) {
|
|
1834
1970
|
case 0:
|
|
1835
|
-
return
|
|
1971
|
+
return _context15.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.DeleteProductExplain, {
|
|
1836
1972
|
data: {
|
|
1837
1973
|
productId
|
|
1838
1974
|
}
|
|
1839
1975
|
}));
|
|
1840
1976
|
}
|
|
1841
|
-
},
|
|
1977
|
+
}, _callee15, this);
|
|
1842
1978
|
}));
|
|
1843
|
-
function deleteExplain(
|
|
1979
|
+
function deleteExplain(_x10) {
|
|
1844
1980
|
return _deleteExplain.apply(this, arguments);
|
|
1845
1981
|
}
|
|
1846
1982
|
return deleteExplain;
|
|
@@ -1848,18 +1984,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1848
1984
|
}, {
|
|
1849
1985
|
key: "getCurrentProductExplain",
|
|
1850
1986
|
value: (function() {
|
|
1851
|
-
var _getCurrentProductExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1987
|
+
var _getCurrentProductExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee16() {
|
|
1852
1988
|
var explainingId;
|
|
1853
|
-
return _regenerator$3().w(function(
|
|
1854
|
-
while (1) switch (
|
|
1989
|
+
return _regenerator$3().w(function(_context16) {
|
|
1990
|
+
while (1) switch (_context16.n) {
|
|
1855
1991
|
case 0:
|
|
1856
|
-
|
|
1992
|
+
_context16.n = 1;
|
|
1857
1993
|
return this.interactionCore.polyvApi.get(PolyvApiUrl.GetCurrentProductExplain, {});
|
|
1858
1994
|
case 1:
|
|
1859
|
-
explainingId =
|
|
1860
|
-
return
|
|
1995
|
+
explainingId = _context16.v;
|
|
1996
|
+
return _context16.a(2, explainingId);
|
|
1861
1997
|
}
|
|
1862
|
-
},
|
|
1998
|
+
}, _callee16, this);
|
|
1863
1999
|
}));
|
|
1864
2000
|
function getCurrentProductExplain() {
|
|
1865
2001
|
return _getCurrentProductExplain.apply(this, arguments);
|
|
@@ -1869,17 +2005,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1869
2005
|
}, {
|
|
1870
2006
|
key: "openProductPrice",
|
|
1871
2007
|
value: (function() {
|
|
1872
|
-
var _openProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1873
|
-
return _regenerator$3().w(function(
|
|
1874
|
-
while (1) switch (
|
|
2008
|
+
var _openProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee17(productId) {
|
|
2009
|
+
return _regenerator$3().w(function(_context17) {
|
|
2010
|
+
while (1) switch (_context17.n) {
|
|
1875
2011
|
case 0:
|
|
1876
|
-
return
|
|
2012
|
+
return _context17.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.OpenProductPrice, {
|
|
1877
2013
|
productId
|
|
1878
2014
|
}));
|
|
1879
2015
|
}
|
|
1880
|
-
},
|
|
2016
|
+
}, _callee17, this);
|
|
1881
2017
|
}));
|
|
1882
|
-
function openProductPrice(
|
|
2018
|
+
function openProductPrice(_x11) {
|
|
1883
2019
|
return _openProductPrice.apply(this, arguments);
|
|
1884
2020
|
}
|
|
1885
2021
|
return openProductPrice;
|
|
@@ -1887,17 +2023,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1887
2023
|
}, {
|
|
1888
2024
|
key: "hideProductPrice",
|
|
1889
2025
|
value: (function() {
|
|
1890
|
-
var _hideProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1891
|
-
return _regenerator$3().w(function(
|
|
1892
|
-
while (1) switch (
|
|
2026
|
+
var _hideProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee18(productId) {
|
|
2027
|
+
return _regenerator$3().w(function(_context18) {
|
|
2028
|
+
while (1) switch (_context18.n) {
|
|
1893
2029
|
case 0:
|
|
1894
|
-
return
|
|
2030
|
+
return _context18.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.HideProductPrice, {
|
|
1895
2031
|
productId
|
|
1896
2032
|
}));
|
|
1897
2033
|
}
|
|
1898
|
-
},
|
|
2034
|
+
}, _callee18, this);
|
|
1899
2035
|
}));
|
|
1900
|
-
function hideProductPrice(
|
|
2036
|
+
function hideProductPrice(_x12) {
|
|
1901
2037
|
return _hideProductPrice.apply(this, arguments);
|
|
1902
2038
|
}
|
|
1903
2039
|
return hideProductPrice;
|
|
@@ -1905,16 +2041,16 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1905
2041
|
}, {
|
|
1906
2042
|
key: "getProductSetting",
|
|
1907
2043
|
value: (function() {
|
|
1908
|
-
var _getProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2044
|
+
var _getProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee19() {
|
|
1909
2045
|
var data;
|
|
1910
|
-
return _regenerator$3().w(function(
|
|
1911
|
-
while (1) switch (
|
|
2046
|
+
return _regenerator$3().w(function(_context19) {
|
|
2047
|
+
while (1) switch (_context19.n) {
|
|
1912
2048
|
case 0:
|
|
1913
|
-
|
|
2049
|
+
_context19.n = 1;
|
|
1914
2050
|
return this.interactionCore.polyvApi.get(PolyvApiUrl.ProductPushRule, {});
|
|
1915
2051
|
case 1:
|
|
1916
|
-
data =
|
|
1917
|
-
return
|
|
2052
|
+
data = _context19.v;
|
|
2053
|
+
return _context19.a(2, {
|
|
1918
2054
|
pushingProduct: data.channelProductPushingStatusVO,
|
|
1919
2055
|
productPushRule: data.productPushRule,
|
|
1920
2056
|
productExplainEnabled: ynToBool(data.productExplainEnabled, "N"),
|
|
@@ -1923,7 +2059,7 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1923
2059
|
productListSortType: data.productListSortType
|
|
1924
2060
|
});
|
|
1925
2061
|
}
|
|
1926
|
-
},
|
|
2062
|
+
}, _callee19, this);
|
|
1927
2063
|
}));
|
|
1928
2064
|
function getProductSetting() {
|
|
1929
2065
|
return _getProductSetting.apply(this, arguments);
|
|
@@ -1933,10 +2069,10 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1933
2069
|
}, {
|
|
1934
2070
|
key: "updateProductSetting",
|
|
1935
2071
|
value: (function() {
|
|
1936
|
-
var _updateProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2072
|
+
var _updateProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee20(params) {
|
|
1937
2073
|
var booleanFields, payload;
|
|
1938
|
-
return _regenerator$3().w(function(
|
|
1939
|
-
while (1) switch (
|
|
2074
|
+
return _regenerator$3().w(function(_context20) {
|
|
2075
|
+
while (1) switch (_context20.n) {
|
|
1940
2076
|
case 0:
|
|
1941
2077
|
booleanFields = ["productExplainEnabled", "productExplainingAutoPushAndSticky", "hideProductPriceEnabled"];
|
|
1942
2078
|
payload = Object.entries(params).reduce(function(acc, _ref) {
|
|
@@ -1950,11 +2086,11 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1950
2086
|
}
|
|
1951
2087
|
return acc;
|
|
1952
2088
|
}, {});
|
|
1953
|
-
return
|
|
2089
|
+
return _context20.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateProductPushRule, payload));
|
|
1954
2090
|
}
|
|
1955
|
-
},
|
|
2091
|
+
}, _callee20, this);
|
|
1956
2092
|
}));
|
|
1957
|
-
function updateProductSetting(
|
|
2093
|
+
function updateProductSetting(_x13) {
|
|
1958
2094
|
return _updateProductSetting.apply(this, arguments);
|
|
1959
2095
|
}
|
|
1960
2096
|
return updateProductSetting;
|
|
@@ -1962,18 +2098,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1962
2098
|
}, {
|
|
1963
2099
|
key: "pushProduct",
|
|
1964
2100
|
value: (function() {
|
|
1965
|
-
var _pushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1966
|
-
return _regenerator$3().w(function(
|
|
1967
|
-
while (1) switch (
|
|
2101
|
+
var _pushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee21(productId, rule) {
|
|
2102
|
+
return _regenerator$3().w(function(_context21) {
|
|
2103
|
+
while (1) switch (_context21.n) {
|
|
1968
2104
|
case 0:
|
|
1969
|
-
return
|
|
2105
|
+
return _context21.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.PushProduct, {
|
|
1970
2106
|
productId,
|
|
1971
2107
|
productPushRule: rule || ProductPushRule.SmallCard
|
|
1972
2108
|
}));
|
|
1973
2109
|
}
|
|
1974
|
-
},
|
|
2110
|
+
}, _callee21, this);
|
|
1975
2111
|
}));
|
|
1976
|
-
function pushProduct(
|
|
2112
|
+
function pushProduct(_x14, _x15) {
|
|
1977
2113
|
return _pushProduct.apply(this, arguments);
|
|
1978
2114
|
}
|
|
1979
2115
|
return pushProduct;
|
|
@@ -1981,17 +2117,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1981
2117
|
}, {
|
|
1982
2118
|
key: "cancelPushProduct",
|
|
1983
2119
|
value: (function() {
|
|
1984
|
-
var _cancelPushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1985
|
-
return _regenerator$3().w(function(
|
|
1986
|
-
while (1) switch (
|
|
2120
|
+
var _cancelPushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee22(productId) {
|
|
2121
|
+
return _regenerator$3().w(function(_context22) {
|
|
2122
|
+
while (1) switch (_context22.n) {
|
|
1987
2123
|
case 0:
|
|
1988
|
-
return
|
|
2124
|
+
return _context22.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.CancelPushProduct, {
|
|
1989
2125
|
productId
|
|
1990
2126
|
}));
|
|
1991
2127
|
}
|
|
1992
|
-
},
|
|
2128
|
+
}, _callee22, this);
|
|
1993
2129
|
}));
|
|
1994
|
-
function cancelPushProduct(
|
|
2130
|
+
function cancelPushProduct(_x16) {
|
|
1995
2131
|
return _cancelPushProduct.apply(this, arguments);
|
|
1996
2132
|
}
|
|
1997
2133
|
return cancelPushProduct;
|
|
@@ -1999,17 +2135,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1999
2135
|
}, {
|
|
2000
2136
|
key: "batchDeleteProduct",
|
|
2001
2137
|
value: (function() {
|
|
2002
|
-
var _batchDeleteProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2003
|
-
return _regenerator$3().w(function(
|
|
2004
|
-
while (1) switch (
|
|
2138
|
+
var _batchDeleteProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee23(productIds) {
|
|
2139
|
+
return _regenerator$3().w(function(_context23) {
|
|
2140
|
+
while (1) switch (_context23.n) {
|
|
2005
2141
|
case 0:
|
|
2006
|
-
return
|
|
2142
|
+
return _context23.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchDeleteProduct, {
|
|
2007
2143
|
productIds
|
|
2008
2144
|
}));
|
|
2009
2145
|
}
|
|
2010
|
-
},
|
|
2146
|
+
}, _callee23, this);
|
|
2011
2147
|
}));
|
|
2012
|
-
function batchDeleteProduct(
|
|
2148
|
+
function batchDeleteProduct(_x17) {
|
|
2013
2149
|
return _batchDeleteProduct.apply(this, arguments);
|
|
2014
2150
|
}
|
|
2015
2151
|
return batchDeleteProduct;
|
|
@@ -2017,18 +2153,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2017
2153
|
}, {
|
|
2018
2154
|
key: "batchOnShelfProduct",
|
|
2019
2155
|
value: (function() {
|
|
2020
|
-
var _batchOnShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2021
|
-
return _regenerator$3().w(function(
|
|
2022
|
-
while (1) switch (
|
|
2156
|
+
var _batchOnShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee24(productIds) {
|
|
2157
|
+
return _regenerator$3().w(function(_context24) {
|
|
2158
|
+
while (1) switch (_context24.n) {
|
|
2023
2159
|
case 0:
|
|
2024
|
-
return
|
|
2160
|
+
return _context24.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchShelfProduct, {
|
|
2025
2161
|
productIds,
|
|
2026
2162
|
status: ProductStatus.OnSale
|
|
2027
2163
|
}));
|
|
2028
2164
|
}
|
|
2029
|
-
},
|
|
2165
|
+
}, _callee24, this);
|
|
2030
2166
|
}));
|
|
2031
|
-
function batchOnShelfProduct(
|
|
2167
|
+
function batchOnShelfProduct(_x18) {
|
|
2032
2168
|
return _batchOnShelfProduct.apply(this, arguments);
|
|
2033
2169
|
}
|
|
2034
2170
|
return batchOnShelfProduct;
|
|
@@ -2036,18 +2172,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2036
2172
|
}, {
|
|
2037
2173
|
key: "batchOffShelfProduct",
|
|
2038
2174
|
value: (function() {
|
|
2039
|
-
var _batchOffShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2040
|
-
return _regenerator$3().w(function(
|
|
2041
|
-
while (1) switch (
|
|
2175
|
+
var _batchOffShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee25(productIds) {
|
|
2176
|
+
return _regenerator$3().w(function(_context25) {
|
|
2177
|
+
while (1) switch (_context25.n) {
|
|
2042
2178
|
case 0:
|
|
2043
|
-
return
|
|
2179
|
+
return _context25.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchShelfProduct, {
|
|
2044
2180
|
productIds,
|
|
2045
2181
|
status: ProductStatus.OffSale
|
|
2046
2182
|
}));
|
|
2047
2183
|
}
|
|
2048
|
-
},
|
|
2184
|
+
}, _callee25, this);
|
|
2049
2185
|
}));
|
|
2050
|
-
function batchOffShelfProduct(
|
|
2186
|
+
function batchOffShelfProduct(_x19) {
|
|
2051
2187
|
return _batchOffShelfProduct.apply(this, arguments);
|
|
2052
2188
|
}
|
|
2053
2189
|
return batchOffShelfProduct;
|
|
@@ -2055,17 +2191,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2055
2191
|
}, {
|
|
2056
2192
|
key: "topProduct",
|
|
2057
2193
|
value: (function() {
|
|
2058
|
-
var _topProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2059
|
-
return _regenerator$3().w(function(
|
|
2060
|
-
while (1) switch (
|
|
2194
|
+
var _topProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee26(productId) {
|
|
2195
|
+
return _regenerator$3().w(function(_context26) {
|
|
2196
|
+
while (1) switch (_context26.n) {
|
|
2061
2197
|
case 0:
|
|
2062
|
-
return
|
|
2198
|
+
return _context26.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.TopProduct, {
|
|
2063
2199
|
productId
|
|
2064
2200
|
}));
|
|
2065
2201
|
}
|
|
2066
|
-
},
|
|
2202
|
+
}, _callee26, this);
|
|
2067
2203
|
}));
|
|
2068
|
-
function topProduct(
|
|
2204
|
+
function topProduct(_x20) {
|
|
2069
2205
|
return _topProduct.apply(this, arguments);
|
|
2070
2206
|
}
|
|
2071
2207
|
return topProduct;
|
|
@@ -2073,17 +2209,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2073
2209
|
}, {
|
|
2074
2210
|
key: "cancelTopProduct",
|
|
2075
2211
|
value: (function() {
|
|
2076
|
-
var _cancelTopProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2077
|
-
return _regenerator$3().w(function(
|
|
2078
|
-
while (1) switch (
|
|
2212
|
+
var _cancelTopProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee27(productId) {
|
|
2213
|
+
return _regenerator$3().w(function(_context27) {
|
|
2214
|
+
while (1) switch (_context27.n) {
|
|
2079
2215
|
case 0:
|
|
2080
|
-
return
|
|
2216
|
+
return _context27.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.CancelTopProduct, {
|
|
2081
2217
|
productId
|
|
2082
2218
|
}));
|
|
2083
2219
|
}
|
|
2084
|
-
},
|
|
2220
|
+
}, _callee27, this);
|
|
2085
2221
|
}));
|
|
2086
|
-
function cancelTopProduct(
|
|
2222
|
+
function cancelTopProduct(_x21) {
|
|
2087
2223
|
return _cancelTopProduct.apply(this, arguments);
|
|
2088
2224
|
}
|
|
2089
2225
|
return cancelTopProduct;
|
|
@@ -2091,18 +2227,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2091
2227
|
}, {
|
|
2092
2228
|
key: "setProductSoldOut",
|
|
2093
2229
|
value: (function() {
|
|
2094
|
-
var _setProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2095
|
-
return _regenerator$3().w(function(
|
|
2096
|
-
while (1) switch (
|
|
2230
|
+
var _setProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee28(productId) {
|
|
2231
|
+
return _regenerator$3().w(function(_context28) {
|
|
2232
|
+
while (1) switch (_context28.n) {
|
|
2097
2233
|
case 0:
|
|
2098
|
-
return
|
|
2234
|
+
return _context28.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.ToggleProductSoldOut, {
|
|
2099
2235
|
productId,
|
|
2100
2236
|
markAsSoldout: "Y"
|
|
2101
2237
|
}));
|
|
2102
2238
|
}
|
|
2103
|
-
},
|
|
2239
|
+
}, _callee28, this);
|
|
2104
2240
|
}));
|
|
2105
|
-
function setProductSoldOut(
|
|
2241
|
+
function setProductSoldOut(_x22) {
|
|
2106
2242
|
return _setProductSoldOut.apply(this, arguments);
|
|
2107
2243
|
}
|
|
2108
2244
|
return setProductSoldOut;
|
|
@@ -2110,18 +2246,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2110
2246
|
}, {
|
|
2111
2247
|
key: "cancelProductSoldOut",
|
|
2112
2248
|
value: (function() {
|
|
2113
|
-
var _cancelProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2114
|
-
return _regenerator$3().w(function(
|
|
2115
|
-
while (1) switch (
|
|
2249
|
+
var _cancelProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee29(productId) {
|
|
2250
|
+
return _regenerator$3().w(function(_context29) {
|
|
2251
|
+
while (1) switch (_context29.n) {
|
|
2116
2252
|
case 0:
|
|
2117
|
-
return
|
|
2253
|
+
return _context29.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.ToggleProductSoldOut, {
|
|
2118
2254
|
productId,
|
|
2119
2255
|
markAsSoldout: "N"
|
|
2120
2256
|
}));
|
|
2121
2257
|
}
|
|
2122
|
-
},
|
|
2258
|
+
}, _callee29, this);
|
|
2123
2259
|
}));
|
|
2124
|
-
function cancelProductSoldOut(
|
|
2260
|
+
function cancelProductSoldOut(_x23) {
|
|
2125
2261
|
return _cancelProductSoldOut.apply(this, arguments);
|
|
2126
2262
|
}
|
|
2127
2263
|
return cancelProductSoldOut;
|
|
@@ -2129,18 +2265,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2129
2265
|
}, {
|
|
2130
2266
|
key: "getProductEnabled",
|
|
2131
2267
|
value: (function() {
|
|
2132
|
-
var _getProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2268
|
+
var _getProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee30() {
|
|
2133
2269
|
var enabled;
|
|
2134
|
-
return _regenerator$3().w(function(
|
|
2135
|
-
while (1) switch (
|
|
2270
|
+
return _regenerator$3().w(function(_context30) {
|
|
2271
|
+
while (1) switch (_context30.n) {
|
|
2136
2272
|
case 0:
|
|
2137
|
-
|
|
2273
|
+
_context30.n = 1;
|
|
2138
2274
|
return this.interactionCore.polyvApi.get(PolyvApiUrl.GetProductEnabled, {});
|
|
2139
2275
|
case 1:
|
|
2140
|
-
enabled =
|
|
2141
|
-
return
|
|
2276
|
+
enabled = _context30.v;
|
|
2277
|
+
return _context30.a(2, ynToBool(enabled, "N"));
|
|
2142
2278
|
}
|
|
2143
|
-
},
|
|
2279
|
+
}, _callee30, this);
|
|
2144
2280
|
}));
|
|
2145
2281
|
function getProductEnabled() {
|
|
2146
2282
|
return _getProductEnabled.apply(this, arguments);
|
|
@@ -2150,20 +2286,20 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2150
2286
|
}, {
|
|
2151
2287
|
key: "updateProductEnabled",
|
|
2152
2288
|
value: (function() {
|
|
2153
|
-
var _updateProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2154
|
-
return _regenerator$3().w(function(
|
|
2155
|
-
while (1) switch (
|
|
2289
|
+
var _updateProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee31(enabled) {
|
|
2290
|
+
return _regenerator$3().w(function(_context31) {
|
|
2291
|
+
while (1) switch (_context31.n) {
|
|
2156
2292
|
case 0:
|
|
2157
|
-
|
|
2293
|
+
_context31.n = 1;
|
|
2158
2294
|
return this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateProductEnabled, {
|
|
2159
2295
|
enabled: boolToYN(enabled)
|
|
2160
2296
|
});
|
|
2161
2297
|
case 1:
|
|
2162
|
-
return
|
|
2298
|
+
return _context31.a(2);
|
|
2163
2299
|
}
|
|
2164
|
-
},
|
|
2300
|
+
}, _callee31, this);
|
|
2165
2301
|
}));
|
|
2166
|
-
function updateProductEnabled(
|
|
2302
|
+
function updateProductEnabled(_x24) {
|
|
2167
2303
|
return _updateProductEnabled.apply(this, arguments);
|
|
2168
2304
|
}
|
|
2169
2305
|
return updateProductEnabled;
|
|
@@ -2171,15 +2307,15 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2171
2307
|
}, {
|
|
2172
2308
|
key: "updateProductSort",
|
|
2173
2309
|
value: (function() {
|
|
2174
|
-
var _updateProductSort = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2175
|
-
return _regenerator$3().w(function(
|
|
2176
|
-
while (1) switch (
|
|
2310
|
+
var _updateProductSort = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee32(params) {
|
|
2311
|
+
return _regenerator$3().w(function(_context32) {
|
|
2312
|
+
while (1) switch (_context32.n) {
|
|
2177
2313
|
case 0:
|
|
2178
|
-
return
|
|
2314
|
+
return _context32.a(2, this.interactionCore.polyvApi.post(concat(PolyvApiUrl.UpdateProductSort, params), {}));
|
|
2179
2315
|
}
|
|
2180
|
-
},
|
|
2316
|
+
}, _callee32, this);
|
|
2181
2317
|
}));
|
|
2182
|
-
function updateProductSort(
|
|
2318
|
+
function updateProductSort(_x25) {
|
|
2183
2319
|
return _updateProductSort.apply(this, arguments);
|
|
2184
2320
|
}
|
|
2185
2321
|
return updateProductSort;
|
|
@@ -2187,20 +2323,20 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2187
2323
|
}, {
|
|
2188
2324
|
key: "moveProduct",
|
|
2189
2325
|
value: (function() {
|
|
2190
|
-
var _moveProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2326
|
+
var _moveProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee33(productId, operation) {
|
|
2191
2327
|
var type;
|
|
2192
|
-
return _regenerator$3().w(function(
|
|
2193
|
-
while (1) switch (
|
|
2328
|
+
return _regenerator$3().w(function(_context33) {
|
|
2329
|
+
while (1) switch (_context33.n) {
|
|
2194
2330
|
case 0:
|
|
2195
2331
|
type = operation === ProductMoveOperation.MoveUp ? 10 : 20;
|
|
2196
|
-
return
|
|
2332
|
+
return _context33.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.MoveProduct, {
|
|
2197
2333
|
productId,
|
|
2198
2334
|
type
|
|
2199
2335
|
}));
|
|
2200
2336
|
}
|
|
2201
|
-
},
|
|
2337
|
+
}, _callee33, this);
|
|
2202
2338
|
}));
|
|
2203
|
-
function moveProduct(
|
|
2339
|
+
function moveProduct(_x26, _x27) {
|
|
2204
2340
|
return _moveProduct.apply(this, arguments);
|
|
2205
2341
|
}
|
|
2206
2342
|
return moveProduct;
|
|
@@ -2208,58 +2344,58 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
2208
2344
|
}, {
|
|
2209
2345
|
key: "getSupportToDirectBuy",
|
|
2210
2346
|
value: (function() {
|
|
2211
|
-
var _getSupportToDirectBuy = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2212
|
-
var _this$
|
|
2347
|
+
var _getSupportToDirectBuy = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee34() {
|
|
2348
|
+
var _this$config8, _this$config8$getProd;
|
|
2213
2349
|
var userInfo, productConfig, authType, notSupportAuthTypes;
|
|
2214
|
-
return _regenerator$3().w(function(
|
|
2215
|
-
while (1) switch (
|
|
2350
|
+
return _regenerator$3().w(function(_context34) {
|
|
2351
|
+
while (1) switch (_context34.n) {
|
|
2216
2352
|
case 0:
|
|
2217
|
-
|
|
2353
|
+
_context34.n = 1;
|
|
2218
2354
|
return this.getProductPayOrderEnabled();
|
|
2219
2355
|
case 1:
|
|
2220
|
-
if (
|
|
2221
|
-
|
|
2356
|
+
if (_context34.v) {
|
|
2357
|
+
_context34.n = 2;
|
|
2222
2358
|
break;
|
|
2223
2359
|
}
|
|
2224
|
-
return
|
|
2360
|
+
return _context34.a(2, false);
|
|
2225
2361
|
case 2:
|
|
2226
|
-
|
|
2362
|
+
_context34.n = 3;
|
|
2227
2363
|
return this.interactionCore.getUserInfo();
|
|
2228
2364
|
case 3:
|
|
2229
|
-
userInfo =
|
|
2365
|
+
userInfo = _context34.v;
|
|
2230
2366
|
if (userInfo.unionId) {
|
|
2231
|
-
|
|
2367
|
+
_context34.n = 4;
|
|
2232
2368
|
break;
|
|
2233
2369
|
}
|
|
2234
|
-
return
|
|
2370
|
+
return _context34.a(2, false);
|
|
2235
2371
|
case 4:
|
|
2236
|
-
|
|
2237
|
-
return (_this$
|
|
2372
|
+
_context34.n = 5;
|
|
2373
|
+
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);
|
|
2238
2374
|
case 5:
|
|
2239
|
-
productConfig =
|
|
2375
|
+
productConfig = _context34.v;
|
|
2240
2376
|
if (productConfig !== null && productConfig !== void 0 && productConfig.directBuyEnabled) {
|
|
2241
|
-
|
|
2377
|
+
_context34.n = 6;
|
|
2242
2378
|
break;
|
|
2243
2379
|
}
|
|
2244
|
-
return
|
|
2380
|
+
return _context34.a(2, false);
|
|
2245
2381
|
case 6:
|
|
2246
2382
|
authType = userInfo.authType;
|
|
2247
2383
|
if (!(!authType || authType === AuthType.None)) {
|
|
2248
|
-
|
|
2384
|
+
_context34.n = 7;
|
|
2249
2385
|
break;
|
|
2250
2386
|
}
|
|
2251
|
-
return
|
|
2387
|
+
return _context34.a(2, true);
|
|
2252
2388
|
case 7:
|
|
2253
2389
|
notSupportAuthTypes = [AuthType.Custom, AuthType.External, AuthType.Direct, AuthType.EnterpriseWeChat];
|
|
2254
2390
|
if (!notSupportAuthTypes.includes(authType)) {
|
|
2255
|
-
|
|
2391
|
+
_context34.n = 8;
|
|
2256
2392
|
break;
|
|
2257
2393
|
}
|
|
2258
|
-
return
|
|
2394
|
+
return _context34.a(2, false);
|
|
2259
2395
|
case 8:
|
|
2260
|
-
return
|
|
2396
|
+
return _context34.a(2, true);
|
|
2261
2397
|
}
|
|
2262
|
-
},
|
|
2398
|
+
}, _callee34, this);
|
|
2263
2399
|
}));
|
|
2264
2400
|
function getSupportToDirectBuy() {
|
|
2265
2401
|
return _getSupportToDirectBuy.apply(this, arguments);
|
|
@@ -3312,11 +3448,12 @@ var Payment = /* @__PURE__ */ (function() {
|
|
|
3312
3448
|
console.log(
|
|
3313
3449
|
"%c@polyv/product-sdk",
|
|
3314
3450
|
"background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff",
|
|
3315
|
-
"[version: 1.
|
|
3316
|
-
"[buildTime: 2025-
|
|
3451
|
+
"[version: 1.6.0]",
|
|
3452
|
+
"[buildTime: 2025-10-23 03:46:33]"
|
|
3317
3453
|
);
|
|
3318
3454
|
export {
|
|
3319
3455
|
Address,
|
|
3456
|
+
AiCardTaskStatus,
|
|
3320
3457
|
AuthType,
|
|
3321
3458
|
CreateOrderFailReason,
|
|
3322
3459
|
Order,
|