component-shipinlv 0.0.17 → 0.0.19

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.
@@ -2,5 +2,5 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLit
2
2
  var _templateObject;
3
3
  import styled from 'styled-components';
4
4
  export default {
5
- Buy: styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :global{\n .ktv-ai-vip-compare{\n .vip-compare-price{\n small{\n color: #888;\n vertical-align: middle;\n }\n }\n .listMore{\n position: absolute;\n right: 10px;\n top: 9px;\n }\n\n .vipCompareListMoreContent{\n width: 500px;\n .ratioAlt{\n padding: 6px 0;\n font-size: 13px;\n color: #777;\n .vip-compare-alt{\n\n }\n }\n }\n\n }\n }\n "])))
5
+ Buy: styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :global{\n //.ktv-ai-vip-compare{\n // .vip-compare-price{\n // small{\n // color: #888;\n // vertical-align: middle;\n // }\n // }\n // .listMore{\n // position: absolute;\n // right: 10px;\n // top: 9px;\n // }\n //\n // .vipCompareListMoreContent{\n // width: 500px;\n // .ratioAlt{\n // padding: 6px 0;\n // font-size: 13px;\n // color: #777;\n // .vip-compare-alt{\n //\n // }\n // }\n // }\n //\n //}\n }\n "])))
6
6
  };
@@ -1,13 +1,11 @@
1
1
  import React from 'react';
2
- import type { SizeType } from "antd/es/config-provider/SizeContext";
3
2
  interface Props {
4
3
  env?: Global.Env;
5
4
  vipId: number;
6
5
  productCount: number;
7
6
  productKind: Global.ProductKind;
8
- buttonSmall?: SizeType;
9
- title?: React.ReactNode;
10
7
  disabled?: boolean;
8
+ children: React.ReactNode;
11
9
  }
12
10
  declare const Buy: React.FC<Props>;
13
11
  export default Buy;
package/dist/Buy/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import React from 'react';
4
- import { Button } from 'antd';
5
4
  import Tool from "../lib/Tool";
6
5
  import styles from "./index.css";
7
6
  import VipQr from "./qr";
@@ -10,35 +9,38 @@ import { jsx as _jsx } from "react/jsx-runtime";
10
9
  var Buy = function Buy(_ref) {
11
10
  var _ref$env = _ref.env,
12
11
  env = _ref$env === void 0 ? 'prod' : _ref$env,
13
- _ref$buttonSmall = _ref.buttonSmall,
14
- buttonSmall = _ref$buttonSmall === void 0 ? 'small' : _ref$buttonSmall,
15
12
  _ref$productKind = _ref.productKind,
16
13
  productKind = _ref$productKind === void 0 ? 'vip' : _ref$productKind,
17
14
  _ref$vipId = _ref.vipId,
18
15
  vipId = _ref$vipId === void 0 ? 0 : _ref$vipId,
19
16
  _ref$productCount = _ref.productCount,
20
17
  productCount = _ref$productCount === void 0 ? 1 : _ref$productCount,
21
- _ref$title = _ref.title,
22
- title = _ref$title === void 0 ? '购买' : _ref$title,
23
18
  _ref$disabled = _ref.disabled,
24
- disabled = _ref$disabled === void 0 ? false : _ref$disabled;
19
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
20
+ children = _ref.children;
25
21
  var onBuy = /*#__PURE__*/function () {
26
22
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
27
23
  var userInfo;
28
24
  return _regeneratorRuntime().wrap(function _callee$(_context) {
29
25
  while (1) switch (_context.prev = _context.next) {
30
26
  case 0:
27
+ if (!disabled) {
28
+ _context.next = 2;
29
+ break;
30
+ }
31
+ return _context.abrupt("return");
32
+ case 2:
31
33
  // 先要登录;
32
34
  userInfo = Tool.getLocalUserInfo();
33
35
  if (userInfo.isLogin) {
34
- _context.next = 4;
36
+ _context.next = 6;
35
37
  break;
36
38
  }
37
39
  console.log("not login");
38
40
  return _context.abrupt("return", Tool.onLogin());
39
- case 4:
41
+ case 6:
40
42
  onOpenVipQr();
41
- case 5:
43
+ case 7:
42
44
  case "end":
43
45
  return _context.stop();
44
46
  }
@@ -80,15 +82,10 @@ var Buy = function Buy(_ref) {
80
82
  Tool.event.run('vip-buy-click');
81
83
  };
82
84
  return /*#__PURE__*/_jsx(styles.Buy, {
83
- children: /*#__PURE__*/_jsx(Button, {
84
- type: "primary",
85
- size: buttonSmall,
86
- disabled: disabled,
87
- onClick: function onClick() {
88
- return onBuy();
89
- },
90
- children: title
91
- })
85
+ onClick: function onClick(e) {
86
+ return onBuy();
87
+ },
88
+ children: children
92
89
  });
93
90
  };
94
91
  export default Buy;
@@ -256,8 +256,8 @@ var VipCompare = function VipCompare(_ref) {
256
256
  // onlyBuyOne={ productDetail.onlyBuyOne }
257
257
  // isVip={ buyListData[record?.productType|| '']?.isVip }
258
258
  ,
259
- title: "\u8D2D\u4E70",
260
- productKind: "vip"
259
+ productKind: "vip",
260
+ children: "\u8D2D\u4E70"
261
261
  });
262
262
  }
263
263
  });
@@ -163,7 +163,7 @@ declare const Tool: {
163
163
  setTimeOffset(serverTime: number): void;
164
164
  getTime(): number;
165
165
  h5Pay(query: Pay.H5PayQuery): void;
166
- notification(type: "error" | "success" | "info" | "warning", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
166
+ notification(type: "success" | "info" | "warning" | "error", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
167
167
  notificationSuccess(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
168
168
  notificationError(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
169
169
  notificationWarning(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
package/dist/lib/Tool.js CHANGED
@@ -21,15 +21,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
21
21
  var packageJson = require("../../package.json");
22
22
  var store = {
23
23
  key: function key() {
24
- var _window;
25
- var WebBaseConfig = ((_window = window) === null || _window === void 0 ? void 0 : _window.WebBaseConfig) || {};
26
- return "__".concat(WebBaseConfig.webKind, "-").concat(WebBaseConfig.productName, "__");
24
+ return "_shipinlv_";
27
25
  },
28
26
  get: function get(name) {
29
27
  var getData;
30
28
  try {
31
- var _window2;
32
- getData = (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.localStorage.getItem(this.key() + name);
29
+ var _window;
30
+ getData = (_window = window) === null || _window === void 0 ? void 0 : _window.localStorage.getItem(this.key() + name);
33
31
  if (getData) {
34
32
  getData = JSON.parse(getData);
35
33
  }
@@ -50,8 +48,8 @@ var store = {
50
48
  value: value
51
49
  };
52
50
  try {
53
- var _window3;
54
- (_window3 = window) === null || _window3 === void 0 || _window3.localStorage.setItem(this.key() + name, JSON.stringify(saveData));
51
+ var _window2;
52
+ (_window2 = window) === null || _window2 === void 0 || _window2.localStorage.setItem(this.key() + name, JSON.stringify(saveData));
55
53
  } catch (e) {
56
54
  console.error('LocalStorage set Error:', e);
57
55
  }
@@ -323,18 +321,18 @@ var Tool = _objectSpread(_objectSpread({
323
321
  },
324
322
  //参数:变量名,url为空则表从当前页面的url中取
325
323
  getQuery: function getQuery(name) {
326
- var _window4, _document;
324
+ var _window3, _document;
327
325
  var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
328
- var u = arguments[1] || ((_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.location) === null || _window4 === void 0 ? void 0 : _window4.search.replace('?', '')) || ((_document = document) === null || _document === void 0 || (_document = _document.location) === null || _document === void 0 ? void 0 : _document.hash.replace('#', '')),
326
+ var u = arguments[1] || ((_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.location) === null || _window3 === void 0 ? void 0 : _window3.search.replace('?', '')) || ((_document = document) === null || _document === void 0 || (_document = _document.location) === null || _document === void 0 ? void 0 : _document.hash.replace('#', '')),
329
327
  reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'),
330
328
  r = u.substr(u.indexOf('?') + 1).match(reg);
331
329
  return r != null ? decodeURIComponent(r[2]) : '';
332
330
  },
333
331
  getQueryAll: function getQueryAll() {
334
- var _window5, _document2;
332
+ var _window4, _document2;
335
333
  var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
336
334
  var theRequest = {};
337
- var str = url || ((_window5 = window) === null || _window5 === void 0 || (_window5 = _window5.location) === null || _window5 === void 0 ? void 0 : _window5.search.replace('?', '')) || ((_document2 = document) === null || _document2 === void 0 || (_document2 = _document2.location) === null || _document2 === void 0 ? void 0 : _document2.hash.replace('#', ''));
335
+ var str = url || ((_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.location) === null || _window4 === void 0 ? void 0 : _window4.search.replace('?', '')) || ((_document2 = document) === null || _document2 === void 0 || (_document2 = _document2.location) === null || _document2 === void 0 ? void 0 : _document2.hash.replace('#', ''));
338
336
  if (url.indexOf('?') !== -1) {
339
337
  str = url.substr(url.indexOf('?') + 1);
340
338
  }
@@ -1051,8 +1049,8 @@ var Tool = _objectSpread(_objectSpread({
1051
1049
  return PostMessage('login');
1052
1050
  },
1053
1051
  getObjectURL: function getObjectURL(file) {
1054
- var _window6, _window7;
1055
- var url = ((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.URL) || ((_window7 = window) === null || _window7 === void 0 ? void 0 : _window7.webkitURL);
1052
+ var _window5, _window6;
1053
+ var url = ((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.URL) || ((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.webkitURL);
1056
1054
  return url.createObjectURL(file);
1057
1055
  },
1058
1056
  // file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",