3560 lines
159 KiB
JavaScript
3560 lines
159 KiB
JavaScript
(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["pages/home/index"],{
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/card/index.js":
|
|
/*!******************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/card/index.js ***!
|
|
\******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export Card */
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _common_jumpLink__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/jumpLink */ "./node_modules/@antmjs/vantui/es/common/jumpLink.js");
|
|
/* harmony import */ var _tag__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../tag */ "./node_modules/@antmjs/vantui/es/tag/index.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
|
|
|
|
|
var _excluded = ["tag", "num", "desc", "thumb", "title", "price", "centered", "lazyLoad", "thumbLink", "originPrice", "thumbMode", "currency", "renderFooter", "renderBottom", "renderNum", "renderOriginPrice", "renderPriceTop", "renderThumb", "renderPrice", "renderDesc", "renderTag", "renderTitle", "renderTags", "style", "className"];
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Card(props) {
|
|
var tag = props.tag,
|
|
num = props.num,
|
|
desc = props.desc,
|
|
thumb = props.thumb,
|
|
title = props.title,
|
|
price = props.price,
|
|
centered = props.centered,
|
|
lazyLoad = props.lazyLoad,
|
|
thumbLink = props.thumbLink,
|
|
originPrice = props.originPrice,
|
|
_props$thumbMode = props.thumbMode,
|
|
thumbMode = _props$thumbMode === void 0 ? 'aspectFit' : _props$thumbMode,
|
|
_props$currency = props.currency,
|
|
currency = _props$currency === void 0 ? '¥' : _props$currency,
|
|
renderFooter = props.renderFooter,
|
|
renderBottom = props.renderBottom,
|
|
renderNum = props.renderNum,
|
|
renderOriginPrice = props.renderOriginPrice,
|
|
renderPriceTop = props.renderPriceTop,
|
|
renderThumb = props.renderThumb,
|
|
renderPrice = props.renderPrice,
|
|
renderDesc = props.renderDesc,
|
|
renderTag = props.renderTag,
|
|
renderTitle = props.renderTitle,
|
|
renderTags = props.renderTags,
|
|
style = props.style,
|
|
className = props.className,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_6__["default"])(props, _excluded);
|
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({
|
|
integerStr: '',
|
|
decimalStr: ''
|
|
}),
|
|
_useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7__["default"])(_useState, 2),
|
|
state = _useState2[0],
|
|
setState = _useState2[1];
|
|
|
|
var integerStr = state.integerStr,
|
|
decimalStr = state.decimalStr;
|
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
var priceArr = price.toString().split('.');
|
|
setState(function (pre) {
|
|
return _objectSpread(_objectSpread({}, pre), {}, {
|
|
integerStr: priceArr[0],
|
|
decimalStr: priceArr[1] ? ".".concat(priceArr[1]) : ''
|
|
});
|
|
});
|
|
}, [price]);
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, _objectSpread(_objectSpread({
|
|
className: "van-card ".concat(className || ''),
|
|
style: style
|
|
}, others), {}, {
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.bem('card__header', {
|
|
center: centered
|
|
}),
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-card__thumb",
|
|
onClick: function onClick() {
|
|
thumbLink && (0,_common_jumpLink__WEBPACK_IMPORTED_MODULE_3__.jumpLink)(thumbLink);
|
|
},
|
|
children: [thumb ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.Image, {
|
|
src: thumb,
|
|
mode: thumbMode,
|
|
lazyLoad: lazyLoad,
|
|
className: "van-card__img thumb-class"
|
|
}) : renderThumb, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
children: tag ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tag__WEBPACK_IMPORTED_MODULE_4__.Tag, {
|
|
mark: true,
|
|
type: "danger",
|
|
className: "van-card__tag",
|
|
children: tag
|
|
}) : renderTag
|
|
})]
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: 'van-card__content ' + _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.bem('card__content', {
|
|
center: centered
|
|
}),
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
children: title ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-card__title title-class",
|
|
children: title
|
|
}) : renderTitle
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
children: desc ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-card__desc desc-class",
|
|
children: desc
|
|
}) : renderDesc
|
|
}), renderTags]
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-card__bottom",
|
|
children: [renderPriceTop, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
children: price ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-card__price price-class",
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.Text, {
|
|
children: currency
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.Text, {
|
|
className: "van-card__price-integer",
|
|
children: integerStr
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.Text, {
|
|
className: "van-card__price-decimal",
|
|
children: decimalStr
|
|
})]
|
|
}) : renderPrice
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
children: originPrice ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-card__origin-price origin-price-class",
|
|
children: currency + ' ' + originPrice
|
|
}) : renderOriginPrice
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
children: num ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-card__num num-class",
|
|
children: 'x ' + num
|
|
}) : renderNum
|
|
}), renderBottom]
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-card__footer",
|
|
children: renderFooter
|
|
})]
|
|
}));
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (Card);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/common/jumpLink.js":
|
|
/*!***********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/common/jumpLink.js ***!
|
|
\***********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "jumpLink": function() { return /* binding */ jumpLink; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
|
function jumpLink(url, linkType) {
|
|
var _linkType;
|
|
|
|
linkType = (_linkType = linkType) !== null && _linkType !== void 0 ? _linkType : 'navigateTo';
|
|
|
|
if (url) {
|
|
if (linkType === 'navigateTo' && (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.getCurrentPages)().length > 9) {
|
|
(0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.redirectTo)({
|
|
url: url
|
|
});
|
|
} else {
|
|
switch (linkType) {
|
|
case 'navigateTo':
|
|
(0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.navigateTo)({
|
|
url: url
|
|
});
|
|
break;
|
|
|
|
case 'reLaunch':
|
|
(0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.reLaunch)({
|
|
url: url
|
|
});
|
|
break;
|
|
|
|
case 'redirectTo':
|
|
(0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.redirectTo)({
|
|
url: url
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/common/utils.js":
|
|
/*!********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/common/utils.js ***!
|
|
\********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "requestAnimationFrame": function() { return /* binding */ requestAnimationFrame; },
|
|
/* harmony export */ "getRect": function() { return /* binding */ getRect; }
|
|
/* harmony export */ });
|
|
/* unused harmony exports range, nextTick, getSystemInfoSync, getMenuButtonBoundingClientRect, addUnit, pickExclude, getAllRect, toPromise, getCurrentPage */
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var raf__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! raf */ "./node_modules/raf/index.js");
|
|
/* harmony import */ var raf__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(raf__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _validator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./validator */ "./node_modules/@antmjs/vantui/es/common/validator.js");
|
|
/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./version */ "./node_modules/@antmjs/vantui/es/common/version.js");
|
|
/* provided dependency */ var window = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime")["window"];
|
|
|
|
|
|
|
|
|
|
|
|
function range(num, min, max) {
|
|
return Math.min(Math.max(num, min), max);
|
|
}
|
|
function nextTick(cb) {
|
|
if ((0,_version__WEBPACK_IMPORTED_MODULE_2__.canIUseNextTick)()) {
|
|
_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().nextTick(cb);
|
|
} else {
|
|
setTimeout(function () {
|
|
cb();
|
|
}, 33.333333333333336);
|
|
}
|
|
}
|
|
var systemInfo;
|
|
function getSystemInfoSync() {
|
|
if (systemInfo == null) {
|
|
systemInfo = (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.getSystemInfoSync)();
|
|
}
|
|
|
|
return systemInfo;
|
|
}
|
|
var menuInfo;
|
|
function getMenuButtonBoundingClientRect() {
|
|
if (menuInfo == null) {
|
|
menuInfo = _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getMenuButtonBoundingClientRect();
|
|
}
|
|
|
|
return menuInfo;
|
|
}
|
|
function addUnit(value) {
|
|
if (!(0,_validator__WEBPACK_IMPORTED_MODULE_3__.isDef)(value)) {
|
|
return undefined;
|
|
}
|
|
|
|
return /^-?\d+(\.\d+)?$/.test('' + value) ? _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().pxTransform(value) : value;
|
|
}
|
|
function requestAnimationFrame(cb) {
|
|
if (window.requestAnimationFrame) {
|
|
return window.requestAnimationFrame(cb);
|
|
}
|
|
|
|
return raf__WEBPACK_IMPORTED_MODULE_1___default()(cb);
|
|
}
|
|
function pickExclude(obj, keys) {
|
|
if (!(0,_validator__WEBPACK_IMPORTED_MODULE_3__.isPlainObject)(obj)) {
|
|
return {};
|
|
}
|
|
|
|
return Object.keys(obj).reduce(function (prev, key) {
|
|
if (!keys.includes(key)) {
|
|
prev[key] = obj[key];
|
|
}
|
|
|
|
return prev;
|
|
}, {});
|
|
}
|
|
function getRect(context, selector) {
|
|
return new Promise(function (resolve) {
|
|
var query = (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.createSelectorQuery)();
|
|
|
|
if (context) {
|
|
query = query.in(context);
|
|
}
|
|
|
|
query.select(selector).boundingClientRect().exec(function () {
|
|
var rect = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
return resolve(rect[0]);
|
|
});
|
|
});
|
|
}
|
|
function getAllRect(context, selector) {
|
|
return new Promise(function (resolve) {
|
|
var query = (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.createSelectorQuery)();
|
|
|
|
if (context) {
|
|
query = query.in(context);
|
|
}
|
|
|
|
query.selectAll(selector).boundingClientRect().exec(function () {
|
|
var rect = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
return resolve(rect[0]);
|
|
});
|
|
});
|
|
}
|
|
function toPromise(promiseLike) {
|
|
if ((0,_validator__WEBPACK_IMPORTED_MODULE_3__.isPromise)(promiseLike)) {
|
|
return promiseLike;
|
|
}
|
|
|
|
return Promise.resolve(promiseLike);
|
|
}
|
|
function getCurrentPage() {
|
|
var pages = _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getCurrentPages();
|
|
return pages[pages.length - 1];
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/common/validator.js":
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/common/validator.js ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "isPlainObject": function() { return /* binding */ isPlainObject; },
|
|
/* harmony export */ "isPromise": function() { return /* binding */ isPromise; },
|
|
/* harmony export */ "isDef": function() { return /* binding */ isDef; }
|
|
/* harmony export */ });
|
|
/* unused harmony exports isFunction, isObj, isNumber, isBoolean, isImageUrl, isVideoUrl */
|
|
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
function isFunction(val) {
|
|
return typeof val === 'function';
|
|
}
|
|
function isPlainObject(val) {
|
|
return val !== null && (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(val) === 'object' && !Array.isArray(val);
|
|
}
|
|
function isPromise(val) {
|
|
return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
}
|
|
function isDef(value) {
|
|
return value !== undefined && value !== null;
|
|
}
|
|
function isObj(x) {
|
|
var type = (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(x);
|
|
|
|
return x !== null && (type === 'object' || type === 'function');
|
|
}
|
|
function isNumber(value) {
|
|
return /^\d+(\.\d+)?$/.test(value);
|
|
}
|
|
function isBoolean(value) {
|
|
return typeof value === 'boolean';
|
|
}
|
|
var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
|
|
var VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i;
|
|
function isImageUrl(url) {
|
|
return IMAGE_REGEXP.test(url);
|
|
}
|
|
function isVideoUrl(url) {
|
|
return VIDEO_REGEXP.test(url);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/common/version.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/common/version.js ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "canIUseNextTick": function() { return /* binding */ canIUseNextTick; }
|
|
/* harmony export */ });
|
|
/* unused harmony exports canIUseModel, canIUseFormFieldButton, canIUseAnimate, canIUseGroupSetData, canIUseCanvas2d, canIUseGetUserProfile */
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
|
|
|
function compareVersion(v1, v2) {
|
|
v1 = v1.split('.');
|
|
v2 = v2.split('.');
|
|
var len = Math.max(v1.length, v2.length);
|
|
|
|
while (v1.length < len) {
|
|
v1.push('0');
|
|
}
|
|
|
|
while (v2.length < len) {
|
|
v2.push('0');
|
|
}
|
|
|
|
for (var i = 0; i < len; i++) {
|
|
var num1 = parseInt(v1[i], 10);
|
|
var num2 = parseInt(v2[i], 10);
|
|
|
|
if (num1 > num2) {
|
|
return 1;
|
|
}
|
|
|
|
if (num1 < num2) {
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
var systemInfo;
|
|
|
|
function getSystemInfoSync() {
|
|
if (systemInfo == null) {
|
|
systemInfo = (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.getSystemInfoSync)();
|
|
}
|
|
|
|
return systemInfo;
|
|
}
|
|
|
|
function gte(version) {
|
|
var system = getSystemInfoSync();
|
|
return compareVersion(system.SDKVersion || system.version, version) >= 0;
|
|
}
|
|
|
|
function canIUseModel() {
|
|
return gte('2.9.3');
|
|
}
|
|
function canIUseFormFieldButton() {
|
|
return gte('2.10.3');
|
|
}
|
|
function canIUseAnimate() {
|
|
return gte('2.9.0');
|
|
}
|
|
function canIUseGroupSetData() {
|
|
return gte('2.4.0');
|
|
}
|
|
function canIUseNextTick() {
|
|
return (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.canIUse)('nextTick');
|
|
}
|
|
function canIUseCanvas2d() {
|
|
return gte('2.9.0');
|
|
}
|
|
function canIUseGetUserProfile() {
|
|
return !!(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getUserProfile);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/divider/index.js":
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/divider/index.js ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export Divider */
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _wxs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./wxs */ "./node_modules/@antmjs/vantui/es/divider/wxs.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
|
|
|
var _excluded = ["dashed", "hairline", "contentPosition", "borderColor", "textColor", "fontSize", "style", "className", "children"];
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
function Divider(props) {
|
|
var _props$dashed = props.dashed,
|
|
dashed = _props$dashed === void 0 ? false : _props$dashed,
|
|
_props$hairline = props.hairline,
|
|
hairline = _props$hairline === void 0 ? false : _props$hairline,
|
|
contentPosition = props.contentPosition,
|
|
borderColor = props.borderColor,
|
|
textColor = props.textColor,
|
|
fontSize = props.fontSize,
|
|
style = props.style,
|
|
className = props.className,
|
|
children = props.children,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__["default"])(props, _excluded);
|
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, _objectSpread(_objectSpread({
|
|
className: ' ' + _wxs_utils__WEBPACK_IMPORTED_MODULE_1__.bem('divider', [{
|
|
dashed: dashed,
|
|
hairline: hairline
|
|
}, contentPosition]) + " ".concat(className || ''),
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_1__.style([_wxs__WEBPACK_IMPORTED_MODULE_2__.rootStyle({
|
|
borderColor: borderColor,
|
|
textColor: textColor,
|
|
fontSize: fontSize
|
|
}), style])
|
|
}, others), {}, {
|
|
children: children
|
|
}));
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (Divider);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/divider/wxs.js":
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/divider/wxs.js ***!
|
|
\*******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "rootStyle": function() { return /* binding */ rootStyle; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wxs_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/style */ "./node_modules/@antmjs/vantui/es/wxs/style.js");
|
|
/* harmony import */ var _wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wxs/add-unit */ "./node_modules/@antmjs/vantui/es/wxs/add-unit.js");
|
|
|
|
|
|
|
|
function rootStyle(data) {
|
|
return (0,_wxs_style__WEBPACK_IMPORTED_MODULE_1__.style)([{
|
|
'border-color': data.borderColor,
|
|
color: data.textColor,
|
|
'font-size': (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__.addUnit)(data.fontSize)
|
|
}]);
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/grid-item/index.js":
|
|
/*!***********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/grid-item/index.js ***!
|
|
\***********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export GridItem */
|
|
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _common_jumpLink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/jumpLink */ "./node_modules/@antmjs/vantui/es/common/jumpLink.js");
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _icon_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icon/index */ "./node_modules/@antmjs/vantui/es/icon/index.js");
|
|
/* harmony import */ var _wxs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./wxs */ "./node_modules/@antmjs/vantui/es/grid-item/wxs.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
|
|
|
var _excluded = ["icon", "iconColor", "iconPrefix", "dot", "info", "badge", "text", "setChildrenInstance", "parentInstance", "index", "url", "linkType", "style", "className"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function GridItem(props) {
|
|
var icon = props.icon,
|
|
iconColor = props.iconColor,
|
|
_props$iconPrefix = props.iconPrefix,
|
|
iconPrefix = _props$iconPrefix === void 0 ? 'van-icon' : _props$iconPrefix,
|
|
dot = props.dot,
|
|
info = props.info,
|
|
badge = props.badge,
|
|
text = props.text,
|
|
setChildrenInstance = props.setChildrenInstance,
|
|
parentInstance = props.parentInstance,
|
|
index = props.index,
|
|
url = props.url,
|
|
linkType = props.linkType,
|
|
style = props.style,
|
|
className = props.className,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_6__["default"])(props, _excluded);
|
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),
|
|
_useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7__["default"])(_useState, 2),
|
|
parentState = _useState2[0],
|
|
setParentState = _useState2[1];
|
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
setChildrenInstance(index, {
|
|
updateStyle: updateStyle
|
|
});
|
|
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
[index, setChildrenInstance]);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
updateStyle(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
[parentInstance.columnNum]);
|
|
var updateStyle = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
|
var columnNum = parentInstance.columnNum,
|
|
border = parentInstance.border,
|
|
square = parentInstance.square,
|
|
gutter = parentInstance.gutter,
|
|
clickable = parentInstance.clickable,
|
|
center = parentInstance.center,
|
|
direction = parentInstance.direction,
|
|
reverse = parentInstance.reverse,
|
|
iconSize = parentInstance.iconSize;
|
|
setParentState({
|
|
center: center,
|
|
border: border,
|
|
square: square,
|
|
gutter: gutter,
|
|
clickable: clickable,
|
|
direction: direction,
|
|
reverse: reverse,
|
|
iconSize: iconSize,
|
|
index: index,
|
|
columnNum: columnNum
|
|
});
|
|
}, [parentInstance, index]);
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: ' ' + _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.bem('grid-item', {
|
|
square: parentState === null || parentState === void 0 ? void 0 : parentState.square
|
|
}) + ' ' + className,
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.style([_wxs__WEBPACK_IMPORTED_MODULE_4__.wrapperStyle({
|
|
square: parentState === null || parentState === void 0 ? void 0 : parentState.square,
|
|
gutter: parentState === null || parentState === void 0 ? void 0 : parentState.gutter,
|
|
columnNum: parentState === null || parentState === void 0 ? void 0 : parentState.columnNum,
|
|
index: parentState === null || parentState === void 0 ? void 0 : parentState.index
|
|
}), style]),
|
|
onClick: function onClick(e) {
|
|
var _others$onClick;
|
|
|
|
url && (0,_common_jumpLink__WEBPACK_IMPORTED_MODULE_1__.jumpLink)(url, linkType);
|
|
others === null || others === void 0 ? void 0 : (_others$onClick = others.onClick) === null || _others$onClick === void 0 ? void 0 : _others$onClick.call(others, e);
|
|
},
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: 'content-class ' + _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.bem('grid-item__content', [parentState === null || parentState === void 0 ? void 0 : parentState.direction, {
|
|
center: parentState === null || parentState === void 0 ? void 0 : parentState.center,
|
|
square: parentState === null || parentState === void 0 ? void 0 : parentState.square,
|
|
reverse: parentState === null || parentState === void 0 ? void 0 : parentState.reverse,
|
|
clickable: parentState === null || parentState === void 0 ? void 0 : parentState.clickable,
|
|
surround: (parentState === null || parentState === void 0 ? void 0 : parentState.border) && (parentState === null || parentState === void 0 ? void 0 : parentState.gutter)
|
|
}]) + ' ' + (parentState !== null && parentState !== void 0 && parentState.border ? 'van-hairline--surround' : ''),
|
|
style: _wxs__WEBPACK_IMPORTED_MODULE_4__.contentStyle({
|
|
square: parentState === null || parentState === void 0 ? void 0 : parentState.square,
|
|
gutter: parentState === null || parentState === void 0 ? void 0 : parentState.gutter
|
|
}),
|
|
children: others.children || /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-grid-item__icon icon-class",
|
|
children: icon ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icon_index__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
name: icon,
|
|
color: iconColor,
|
|
classPrefix: iconPrefix,
|
|
dot: dot,
|
|
info: badge || info,
|
|
size: parentState === null || parentState === void 0 ? void 0 : parentState.iconSize
|
|
}) : parentState.renderIcon
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-grid-item__text text-class",
|
|
children: text ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.Text, {
|
|
children: text
|
|
}) : parentState.renderText
|
|
})]
|
|
})
|
|
})
|
|
});
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (GridItem);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/grid-item/wxs.js":
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/grid-item/wxs.js ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "wrapperStyle": function() { return /* binding */ wrapperStyle; },
|
|
/* harmony export */ "contentStyle": function() { return /* binding */ contentStyle; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wxs_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/style */ "./node_modules/@antmjs/vantui/es/wxs/style.js");
|
|
/* harmony import */ var _wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wxs/add-unit */ "./node_modules/@antmjs/vantui/es/wxs/add-unit.js");
|
|
|
|
|
|
|
|
function wrapperStyle(data) {
|
|
var width = 100 / data.columnNum + '%';
|
|
return (0,_wxs_style__WEBPACK_IMPORTED_MODULE_1__.style)({
|
|
width: width,
|
|
'padding-top': data.square ? width : null,
|
|
'padding-right': (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__.addUnit)(data.gutter),
|
|
'margin-top': data.index >= data.columnNum && !data.square ? (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__.addUnit)(data.gutter) : null
|
|
});
|
|
}
|
|
|
|
function contentStyle(data) {
|
|
return data.square ? (0,_wxs_style__WEBPACK_IMPORTED_MODULE_1__.style)({
|
|
right: (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__.addUnit)(data.gutter),
|
|
bottom: (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__.addUnit)(data.gutter),
|
|
height: 'auto'
|
|
}) : '';
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/grid/index.js":
|
|
/*!******************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/grid/index.js ***!
|
|
\******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export Grid */
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _wxs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./wxs */ "./node_modules/@antmjs/vantui/es/grid/wxs.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
|
var _excluded = ["gutter", "clickable", "columnNum", "center", "border", "direction", "iconSize", "square", "reverse", "className", "style"];
|
|
|
|
|
|
|
|
|
|
|
|
function Grid(props) {
|
|
var _props$gutter = props.gutter,
|
|
gutter = _props$gutter === void 0 ? null : _props$gutter,
|
|
clickable = props.clickable,
|
|
_props$columnNum = props.columnNum,
|
|
columnNum = _props$columnNum === void 0 ? 4 : _props$columnNum,
|
|
_props$center = props.center,
|
|
center = _props$center === void 0 ? true : _props$center,
|
|
_props$border = props.border,
|
|
border = _props$border === void 0 ? true : _props$border,
|
|
direction = props.direction,
|
|
_props$iconSize = props.iconSize,
|
|
iconSize = _props$iconSize === void 0 ? '48' : _props$iconSize,
|
|
square = props.square,
|
|
_props$reverse = props.reverse,
|
|
reverse = _props$reverse === void 0 ? false : _props$reverse,
|
|
_props$className = props.className,
|
|
className = _props$className === void 0 ? '' : _props$className,
|
|
_props$style = props.style,
|
|
style = _props$style === void 0 ? {} : _props$style,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__["default"])(props, _excluded);
|
|
|
|
var childrenInstance = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
|
|
var updateChildren = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
|
childrenInstance.current.forEach(function (child) {
|
|
child.updateStyle();
|
|
});
|
|
}, []);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
updateChildren();
|
|
}, [updateChildren]);
|
|
var setChildrenInstance = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (index, instance) {
|
|
childrenInstance.current[index] = instance;
|
|
}, []);
|
|
var ResetChildren = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
|
var res = [];
|
|
|
|
if (others.children && Array.isArray(others.children)) {
|
|
others.children.forEach(function (child, index) {
|
|
res.push( /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(child, {
|
|
setChildrenInstance: setChildrenInstance,
|
|
key: index,
|
|
index: index,
|
|
parentInstance: {
|
|
columnNum: columnNum,
|
|
border: border,
|
|
square: square,
|
|
gutter: gutter,
|
|
clickable: clickable,
|
|
center: center,
|
|
direction: direction,
|
|
reverse: reverse,
|
|
iconSize: iconSize
|
|
}
|
|
}));
|
|
});
|
|
}
|
|
|
|
return res;
|
|
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
[others.children, columnNum]);
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
|
|
className: 'van-grid ' + (border && !gutter ? 'van-hairline--top' : '') + ' ' + className,
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_1__.style([_wxs__WEBPACK_IMPORTED_MODULE_2__.rootStyle({
|
|
gutter: gutter
|
|
}), style]),
|
|
children: ResetChildren
|
|
});
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (Grid);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/grid/wxs.js":
|
|
/*!****************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/grid/wxs.js ***!
|
|
\****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "rootStyle": function() { return /* binding */ rootStyle; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wxs_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/style */ "./node_modules/@antmjs/vantui/es/wxs/style.js");
|
|
/* harmony import */ var _wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wxs/add-unit */ "./node_modules/@antmjs/vantui/es/wxs/add-unit.js");
|
|
|
|
|
|
|
|
function rootStyle(data) {
|
|
return (0,_wxs_style__WEBPACK_IMPORTED_MODULE_1__.style)({
|
|
'padding-left': (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__.addUnit)(data.gutter)
|
|
});
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/icon/index.js":
|
|
/*!******************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/icon/index.js ***!
|
|
\******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "Icon": function() { return /* binding */ Icon; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _info_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../info/index */ "./node_modules/@antmjs/vantui/es/info/index.js");
|
|
/* harmony import */ var _wxs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wxs */ "./node_modules/@antmjs/vantui/es/icon/wxs.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
|
|
|
var _excluded = ["classPrefix", "name", "color", "size", "dot", "info", "style", "className"];
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Icon(props) {
|
|
var _props$classPrefix = props.classPrefix,
|
|
classPrefix = _props$classPrefix === void 0 ? 'van-icon' : _props$classPrefix,
|
|
name = props.name,
|
|
color = props.color,
|
|
size = props.size,
|
|
dot = props.dot,
|
|
info = props.info,
|
|
style = props.style,
|
|
className = props.className,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_5__["default"])(props, _excluded);
|
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.View, _objectSpread(_objectSpread({
|
|
className: _wxs__WEBPACK_IMPORTED_MODULE_3__.rootClass({
|
|
classPrefix: classPrefix,
|
|
name: name
|
|
}) + " ".concat(className || ''),
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_1__.style([_wxs__WEBPACK_IMPORTED_MODULE_3__.rootStyle({
|
|
color: color,
|
|
size: size
|
|
}), style])
|
|
}, others), {}, {
|
|
children: [(info || info === 0 || dot) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_info_index__WEBPACK_IMPORTED_MODULE_2__.Info, {
|
|
dot: dot,
|
|
info: info,
|
|
className: "van-icon__info"
|
|
}), _wxs__WEBPACK_IMPORTED_MODULE_3__.isImage(name) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.Image, {
|
|
src: name,
|
|
mode: "aspectFit",
|
|
className: "van-icon__image"
|
|
})]
|
|
}));
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (Icon);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/icon/wxs.js":
|
|
/*!****************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/icon/wxs.js ***!
|
|
\****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "isImage": function() { return /* binding */ isImage; },
|
|
/* harmony export */ "rootClass": function() { return /* binding */ rootClass; },
|
|
/* harmony export */ "rootStyle": function() { return /* binding */ rootStyle; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wxs_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/style */ "./node_modules/@antmjs/vantui/es/wxs/style.js");
|
|
/* harmony import */ var _wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wxs/add-unit */ "./node_modules/@antmjs/vantui/es/wxs/add-unit.js");
|
|
|
|
|
|
|
|
function isImage(name) {
|
|
return name.indexOf('/') !== -1;
|
|
}
|
|
|
|
function rootClass(data) {
|
|
var classes = [];
|
|
|
|
if (data.classPrefix != null) {
|
|
classes.push(data.classPrefix);
|
|
}
|
|
|
|
if (isImage(data.name)) {
|
|
classes.push('van-icon--image');
|
|
} else if (data.classPrefix != null) {
|
|
classes.push(data.classPrefix + '-' + data.name);
|
|
}
|
|
|
|
return classes.join(' ');
|
|
}
|
|
|
|
function rootStyle(data) {
|
|
return (0,_wxs_style__WEBPACK_IMPORTED_MODULE_1__.style)([{
|
|
color: data.color,
|
|
'font-size': (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__.addUnit)(data.size)
|
|
}]);
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/image/index.js":
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/image/index.js ***!
|
|
\*******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export Image */
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _icon_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icon/index */ "./node_modules/@antmjs/vantui/es/icon/index.js");
|
|
/* harmony import */ var _wxs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./wxs */ "./node_modules/@antmjs/vantui/es/image/wxs.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
|
|
|
|
|
var _excluded = ["src", "round", "width", "height", "radius", "lazyLoad", "showMenuByLongpress", "fit", "showError", "showLoading", "className", "style", "renderError", "renderLoading"];
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Image(props) {
|
|
var src = props.src,
|
|
round = props.round,
|
|
width = props.width,
|
|
height = props.height,
|
|
radius = props.radius,
|
|
lazyLoad = props.lazyLoad,
|
|
showMenuByLongpress = props.showMenuByLongpress,
|
|
fit = props.fit,
|
|
_props$showError = props.showError,
|
|
showError = _props$showError === void 0 ? true : _props$showError,
|
|
_props$showLoading = props.showLoading,
|
|
showLoading = _props$showLoading === void 0 ? true : _props$showLoading,
|
|
className = props.className,
|
|
style = props.style,
|
|
renderError = props.renderError,
|
|
renderLoading = props.renderLoading,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_6__["default"])(props, _excluded);
|
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(),
|
|
_useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7__["default"])(_useState, 2),
|
|
loading = _useState2[0],
|
|
setLoading = _useState2[1];
|
|
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
|
|
_useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7__["default"])(_useState3, 2),
|
|
error = _useState4[0],
|
|
setError = _useState4[1];
|
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
if (loading === undefined) setLoading(true);
|
|
setError(false);
|
|
}, [loading]);
|
|
var onLoad = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
|
|
setLoading(false);
|
|
}, []);
|
|
var onError = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
|
|
setError(true);
|
|
}, []); //样式挂在给img外层的webCompoent
|
|
|
|
var styleH5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
|
|
var style = {};
|
|
|
|
if (false) {}
|
|
|
|
return style;
|
|
}, [fit]);
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, _objectSpread(_objectSpread({
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.style([_wxs__WEBPACK_IMPORTED_MODULE_4__.rootStyle({
|
|
width: width,
|
|
height: height,
|
|
radius: radius
|
|
}), style]),
|
|
className: ' ' + _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.bem('image', {
|
|
round: round
|
|
}) + ' ' + className,
|
|
onClick: others.onClick
|
|
}, others), {}, {
|
|
children: [!error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.Image, {
|
|
src: src,
|
|
mode: _wxs__WEBPACK_IMPORTED_MODULE_4__.mode(fit || 'none'),
|
|
lazyLoad: lazyLoad,
|
|
className: "image-class van-image__img",
|
|
showMenuByLongpress: showMenuByLongpress,
|
|
onLoad: onLoad,
|
|
onError: onError,
|
|
style: styleH5
|
|
}), loading && showLoading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "loading-class van-image__loading",
|
|
children: renderLoading || /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icon_index__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
name: "photo",
|
|
className: "van-image__loading-icon"
|
|
})
|
|
}), error && showError && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "error-class van-image__error",
|
|
children: renderError || /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icon_index__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
name: "photo-fail",
|
|
className: "van-image__error-icon"
|
|
})
|
|
})]
|
|
}));
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (Image);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/image/wxs.js":
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/image/wxs.js ***!
|
|
\*****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "rootStyle": function() { return /* binding */ rootStyle; },
|
|
/* harmony export */ "mode": function() { return /* binding */ mode; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _wxs_add_unit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/add-unit */ "./node_modules/@antmjs/vantui/es/wxs/add-unit.js");
|
|
|
|
|
|
|
|
function rootStyle(data) {
|
|
return (0,_wxs_utils__WEBPACK_IMPORTED_MODULE_0__.style)([{
|
|
width: (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_1__.addUnit)(data.width),
|
|
height: (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_1__.addUnit)(data.height),
|
|
'border-radius': (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_1__.addUnit)(data.radius)
|
|
}, data.radius ? 'overflow: hidden' : null]);
|
|
}
|
|
|
|
var FIT_MODE_MAP = {
|
|
none: 'scaleToFill',
|
|
fill: 'scaleToFill',
|
|
cover: 'aspectFill',
|
|
contain: 'aspectFit',
|
|
widthFix: 'widthFix',
|
|
heightFix: 'heightFix',
|
|
scaleDown: 'aspectFit'
|
|
};
|
|
|
|
function mode(fit) {
|
|
return FIT_MODE_MAP[fit];
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/info/index.js":
|
|
/*!******************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/info/index.js ***!
|
|
\******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "Info": function() { return /* binding */ Info; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
|
|
|
var _excluded = ["dot", "info", "style", "className"];
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
function Info(props) {
|
|
var dot = props.dot,
|
|
_props$info = props.info,
|
|
info = _props$info === void 0 ? null : _props$info,
|
|
style = props.style,
|
|
className = props.className,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__["default"])(props, _excluded);
|
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
|
|
children: (info || info === 0 || dot) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, _objectSpread(_objectSpread({
|
|
className: 'van-info ' + _wxs_utils__WEBPACK_IMPORTED_MODULE_1__.bem('info', {
|
|
dot: dot
|
|
}) + ' ' + className,
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_1__.style([style])
|
|
}, others), {}, {
|
|
children: dot ? '' : info
|
|
}))
|
|
});
|
|
}
|
|
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (Info);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/notice-bar/index.js":
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/notice-bar/index.js ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export NoticeBar */
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/utils */ "./node_modules/@antmjs/vantui/es/common/utils.js");
|
|
/* harmony import */ var _icon_index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../icon/index */ "./node_modules/@antmjs/vantui/es/icon/index.js");
|
|
/* harmony import */ var _wxs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./wxs */ "./node_modules/@antmjs/vantui/es/notice-bar/wxs.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
|
|
|
|
|
|
|
|
var _excluded = ["text", "mode", "url", "openType", "delay", "speed", "scrollable", "leftIcon", "color", "backgroundColor", "background", "wrapable", "renderLeftIcon", "renderRightIcon", "onClick", "onClose", "style", "className", "children"];
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var NOTICE_BAR_INDEX = 0;
|
|
function NoticeBar(props) {
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)({
|
|
ready: false,
|
|
show: true,
|
|
animationData: {
|
|
actions: []
|
|
},
|
|
unitag: 0
|
|
}),
|
|
_useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_7__["default"])(_useState, 2),
|
|
state = _useState2[0],
|
|
setState = _useState2[1];
|
|
|
|
var params = {
|
|
animation: null,
|
|
resetAnimation: null,
|
|
timer: null,
|
|
wrapWidth: undefined,
|
|
contentWidth: undefined,
|
|
duration: undefined
|
|
};
|
|
var ref = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(params);
|
|
|
|
var _props$text = props.text,
|
|
text = _props$text === void 0 ? '' : _props$text,
|
|
_props$mode = props.mode,
|
|
mode = _props$mode === void 0 ? '' : _props$mode,
|
|
_props$url = props.url,
|
|
url = _props$url === void 0 ? '' : _props$url,
|
|
_props$openType = props.openType,
|
|
openType = _props$openType === void 0 ? 'navigate' : _props$openType,
|
|
_props$delay = props.delay,
|
|
delay = _props$delay === void 0 ? 1 : _props$delay,
|
|
_props$speed = props.speed,
|
|
speed = _props$speed === void 0 ? 60 : _props$speed,
|
|
_props$scrollable = props.scrollable,
|
|
scrollable = _props$scrollable === void 0 ? null : _props$scrollable,
|
|
_props$leftIcon = props.leftIcon,
|
|
leftIcon = _props$leftIcon === void 0 ? '' : _props$leftIcon,
|
|
_props$color = props.color,
|
|
color = _props$color === void 0 ? '#ed6a0c' : _props$color,
|
|
_props$backgroundColo = props.backgroundColor,
|
|
backgroundColor = _props$backgroundColo === void 0 ? '#fffbe8' : _props$backgroundColo,
|
|
background = props.background,
|
|
wrapable = props.wrapable,
|
|
renderLeftIcon = props.renderLeftIcon,
|
|
renderRightIcon = props.renderRightIcon,
|
|
onClick = props.onClick,
|
|
onClose = props.onClose,
|
|
style = props.style,
|
|
className = props.className,
|
|
children = props.children,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_8__["default"])(props, _excluded);
|
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
setState(function (state) {
|
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
unitag: NOTICE_BAR_INDEX++
|
|
});
|
|
});
|
|
}, []);
|
|
(0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__.useReady)(function () {
|
|
if (true) {
|
|
ref.current.resetAnimation = (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__.createAnimation)({
|
|
duration: 0,
|
|
timingFunction: 'linear'
|
|
});
|
|
setState(function (state) {
|
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
ready: true
|
|
});
|
|
});
|
|
}
|
|
});
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
ref.current.resetAnimation = (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__.createAnimation)({
|
|
duration: 0,
|
|
timingFunction: 'linear'
|
|
});
|
|
setState(function (state) {
|
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
ready: true
|
|
});
|
|
});
|
|
}, []);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
if (text && state.ready) {
|
|
init();
|
|
}
|
|
|
|
return function () {
|
|
/* eslint-disable-next-line */
|
|
ref.current.timer && clearTimeout(ref.current.timer);
|
|
};
|
|
/* eslint-disable-next-line */
|
|
}, [text, speed, state.ready]);
|
|
var scroll = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function () {
|
|
var isInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
ref.current.timer && clearTimeout(ref.current.timer);
|
|
ref.current.timer = null;
|
|
setState(function (state) {
|
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
animationData: ref.current.resetAnimation.translateX(isInit ? 0 : ref.current.wrapWidth).step().export()
|
|
});
|
|
});
|
|
setTimeout(function () {
|
|
(0,_common_utils__WEBPACK_IMPORTED_MODULE_4__.requestAnimationFrame)(function () {
|
|
setState(function (state) {
|
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
animationData: ref.current.animation.translateX(-ref.current.contentWidth).step().export()
|
|
});
|
|
});
|
|
});
|
|
}, 10);
|
|
ref.current.timer = setTimeout(function () {
|
|
scroll();
|
|
}, ref.current.duration);
|
|
}, []);
|
|
var init = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function () {
|
|
(0,_common_utils__WEBPACK_IMPORTED_MODULE_4__.requestAnimationFrame)(function () {
|
|
Promise.all([(0,_common_utils__WEBPACK_IMPORTED_MODULE_4__.getRect)(null, ".van-notice-bar__content_".concat(state.unitag)), (0,_common_utils__WEBPACK_IMPORTED_MODULE_4__.getRect)(null, ".van-notice-bar__wrap_".concat(state.unitag))]).then(function (rects) {
|
|
var contentRect = rects[0];
|
|
var wrapRect = rects[1];
|
|
|
|
if (contentRect == null || wrapRect == null || !contentRect.width || !wrapRect.width || scrollable === false) {
|
|
return;
|
|
}
|
|
|
|
(0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__.nextTick)(function () {
|
|
if (scrollable || wrapRect.width <= contentRect.width) {
|
|
ref.current.wrapWidth = wrapRect.width;
|
|
ref.current.contentWidth = contentRect.width;
|
|
ref.current.duration = (wrapRect.width + contentRect.width) / speed * 1000;
|
|
ref.current.animation = (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__.createAnimation)({
|
|
duration: ref.current.duration,
|
|
timingFunction: 'linear',
|
|
delay: delay
|
|
});
|
|
scroll(true);
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}, [state.unitag, scrollable, speed, delay, scroll]);
|
|
var onClickIcon = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (event) {
|
|
if (mode === 'closeable') {
|
|
ref.current.timer && clearTimeout(ref.current.timer);
|
|
ref.current.timer = null;
|
|
setState(function (state) {
|
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
show: false
|
|
});
|
|
});
|
|
onClose === null || onClose === void 0 ? void 0 : onClose(event);
|
|
}
|
|
}, [mode, onClose]);
|
|
return state.show && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, _objectSpread(_objectSpread({
|
|
className: _wxs_utils__WEBPACK_IMPORTED_MODULE_3__.bem('notice-bar', {
|
|
withicon: mode,
|
|
wrapable: wrapable
|
|
}) + " ".concat(className || ''),
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_3__.style([_wxs__WEBPACK_IMPORTED_MODULE_10__.rootStyle({
|
|
color: color,
|
|
backgroundColor: backgroundColor,
|
|
background: background
|
|
}), style])
|
|
}, others), {}, {
|
|
onClick: onClick,
|
|
children: [leftIcon ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icon_index__WEBPACK_IMPORTED_MODULE_5__["default"], {
|
|
name: leftIcon,
|
|
className: "van-notice-bar__left-icon"
|
|
}) : renderLeftIcon, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, {
|
|
className: "van-notice-bar__wrap van-notice-bar__wrap_".concat(state.unitag),
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, {
|
|
className: "van-notice-bar__content van-notice-bar__content_".concat(state.unitag, " ") + (scrollable === false && !wrapable ? 'van-ellipsis' : ''),
|
|
animation: state.animationData,
|
|
children: [text, !text && children]
|
|
})
|
|
}), mode === 'closeable' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icon_index__WEBPACK_IMPORTED_MODULE_5__["default"], {
|
|
className: "van-notice-bar__right-icon",
|
|
name: "cross",
|
|
onClick: onClickIcon
|
|
}) : mode === 'link' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.Navigator, {
|
|
url: url,
|
|
openType: openType,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icon_index__WEBPACK_IMPORTED_MODULE_5__["default"], {
|
|
className: "van-notice-bar__right-icon",
|
|
name: "arrow"
|
|
})
|
|
}) : renderRightIcon]
|
|
}));
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (NoticeBar);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/notice-bar/wxs.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/notice-bar/wxs.js ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "rootStyle": function() { return /* binding */ rootStyle; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wxs_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wxs/style */ "./node_modules/@antmjs/vantui/es/wxs/style.js");
|
|
|
|
|
|
function rootStyle(data) {
|
|
return (0,_wxs_style__WEBPACK_IMPORTED_MODULE_0__.style)({
|
|
color: data.color,
|
|
'background-color': data.backgroundColor,
|
|
background: data.background
|
|
});
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/swiper-item/index.js":
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/swiper-item/index.js ***!
|
|
\*************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export SwiperItem */
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var _swiper_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../swiper/context */ "./node_modules/@antmjs/vantui/es/swiper/context.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
var defaultProps = {
|
|
direction: 'horizontal',
|
|
className: ''
|
|
};
|
|
var SwiperItem = function SwiperItem(props) {
|
|
var _props = _objectSpread(_objectSpread({}, defaultProps), props);
|
|
|
|
var children = _props.children,
|
|
direction = _props.direction,
|
|
size = _props.size,
|
|
className = _props.className;
|
|
var parent = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_swiper_context__WEBPACK_IMPORTED_MODULE_2__.DataContext);
|
|
|
|
var style = function style() {
|
|
var style = {};
|
|
|
|
var _direction = (parent === null || parent === void 0 ? void 0 : parent.propSwiper.direction) || direction;
|
|
|
|
var _size = (parent === null || parent === void 0 ? void 0 : parent.size) || size;
|
|
|
|
if (_size) {
|
|
style[_direction === 'horizontal' ? 'width' : 'height'] = "".concat(_size, "px");
|
|
}
|
|
|
|
return style;
|
|
};
|
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, {
|
|
className: "van-swiper-item ".concat(className),
|
|
style: style(),
|
|
children: children
|
|
});
|
|
};
|
|
/* harmony default export */ __webpack_exports__["default"] = (SwiperItem);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/swiper/context.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/swiper/context.js ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "DataContext": function() { return /* binding */ DataContext; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
|
var DataContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({});
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/swiper/index.js":
|
|
/*!********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/swiper/index.js ***!
|
|
\********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var _swiper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./swiper */ "./node_modules/@antmjs/vantui/es/swiper/swiper.js");
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (_swiper__WEBPACK_IMPORTED_MODULE_0__["default"]);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/swiper/swiper.js":
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/swiper/swiper.js ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export Swiper_ */
|
|
/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
|
|
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
|
|
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
|
|
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_4__);
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./context */ "./node_modules/@antmjs/vantui/es/swiper/context.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
|
|
/* provided dependency */ var window = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime")["window"];
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["children", "direction", "className", "pageContent", "onChange", "initPage", "paginationColor", "paginationVisible", "touchable", "isPreventDefault", "isStopPropagation", "autoPlay", "isCenter", "style"];
|
|
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var defaultProps = {
|
|
width: (typeof window === "undefined" ? "undefined" : (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_7__["default"])(window)) === 'object' ? window.innerWidth : 375,
|
|
height: 0,
|
|
duration: 500,
|
|
initPage: 0,
|
|
autoPlay: 0,
|
|
direction: 'horizontal',
|
|
paginationColor: '#fff',
|
|
paginationVisible: false,
|
|
loop: true,
|
|
touchable: true,
|
|
isPreventDefault: true,
|
|
isStopPropagation: true,
|
|
isCenter: false,
|
|
className: ''
|
|
};
|
|
var DISTANCE = 5;
|
|
|
|
var Swiper = function Swiper(props, ref) {
|
|
var _classNames, _classNames2;
|
|
|
|
var propSwiper = _objectSpread(_objectSpread({}, defaultProps), props);
|
|
|
|
var children = propSwiper.children,
|
|
direction = propSwiper.direction,
|
|
className = propSwiper.className,
|
|
pageContent = propSwiper.pageContent,
|
|
onChange = propSwiper.onChange,
|
|
initPage = propSwiper.initPage,
|
|
paginationColor = propSwiper.paginationColor,
|
|
paginationVisible = propSwiper.paginationVisible,
|
|
touchable = propSwiper.touchable,
|
|
isPreventDefault = propSwiper.isPreventDefault,
|
|
isStopPropagation = propSwiper.isStopPropagation,
|
|
autoPlay = propSwiper.autoPlay,
|
|
isCenter = propSwiper.isCenter,
|
|
style = propSwiper.style,
|
|
rest = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_8__["default"])(propSwiper, _excluded);
|
|
|
|
var container = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
|
|
var innerRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
|
|
|
|
var _swiper = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)({
|
|
moving: false,
|
|
autoplayTimer: null,
|
|
width: 0,
|
|
height: 0,
|
|
offset: 0,
|
|
size: 0
|
|
});
|
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(Math.random().toString(36).slice(-8)),
|
|
_useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_9__["default"])(_useState, 1),
|
|
refRandomId = _useState2[0];
|
|
|
|
var isVertical = direction === 'vertical';
|
|
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null),
|
|
_useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_9__["default"])(_useState3, 2),
|
|
rect = _useState4[0],
|
|
setRect = _useState4[1]; // eslint-disable-next-line prefer-const
|
|
|
|
|
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0),
|
|
_useState6 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_9__["default"])(_useState5, 2),
|
|
active = _useState6[0],
|
|
setActive = _useState6[1];
|
|
|
|
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0),
|
|
_useState8 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_9__["default"])(_useState7, 2),
|
|
width = _useState8[0],
|
|
setWidth = _useState8[1];
|
|
|
|
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0),
|
|
_useState10 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_9__["default"])(_useState9, 2),
|
|
height = _useState10[0],
|
|
setHeight = _useState10[1];
|
|
|
|
var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0),
|
|
_useState12 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_9__["default"])(_useState11, 2),
|
|
offset = _useState12[0],
|
|
setOffset = _useState12[1];
|
|
|
|
var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([]),
|
|
_useState14 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_9__["default"])(_useState13, 2),
|
|
childOffset = _useState14[0],
|
|
setChildOffset = _useState14[1];
|
|
|
|
var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false),
|
|
_useState16 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_9__["default"])(_useState15, 2),
|
|
ready = _useState16[0],
|
|
setReady = _useState16[1];
|
|
|
|
var size = isVertical ? height : width;
|
|
|
|
var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)({
|
|
startX: 0,
|
|
startY: 0,
|
|
deltaX: 0,
|
|
deltaY: 0,
|
|
offsetX: 0,
|
|
offsetY: 0,
|
|
stateDirection: '',
|
|
delta: 0,
|
|
touchTime: 0
|
|
}),
|
|
_useState18 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_9__["default"])(_useState17, 1),
|
|
touch = _useState18[0];
|
|
|
|
var _useMemo = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {
|
|
var childCount = 0;
|
|
var childs = react__WEBPACK_IMPORTED_MODULE_2__.Children.map(propSwiper.children, function (child) {
|
|
if (! /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_2__.isValidElement)(child)) return null;
|
|
childCount++;
|
|
return child;
|
|
});
|
|
return {
|
|
childs: childs,
|
|
childCount: childCount
|
|
};
|
|
}, [propSwiper.children]),
|
|
childs = _useMemo.childs,
|
|
childCount = _useMemo.childCount;
|
|
|
|
var trackSize = childCount * Number(size); // 父组件参数传入子组件item
|
|
|
|
var parent = {
|
|
propSwiper: propSwiper,
|
|
size: size
|
|
};
|
|
|
|
var minOffset = function () {
|
|
if (rect) {
|
|
var base = isVertical ? rect === null || rect === void 0 ? void 0 : rect.height : rect === null || rect === void 0 ? void 0 : rect.width;
|
|
return base - Number(size) * childCount;
|
|
}
|
|
|
|
return 0;
|
|
}(); // 清除定时器
|
|
|
|
|
|
var stopAutoPlay = function stopAutoPlay() {
|
|
clearTimeout(_swiper.current.autoplayTimer);
|
|
_swiper.current.autoplayTimer = null;
|
|
}; // 定时轮播
|
|
|
|
|
|
var autoplay = function autoplay() {
|
|
if (propSwiper.autoPlay <= 0 || childCount <= 1) return;
|
|
stopAutoPlay();
|
|
_swiper.current.autoplayTimer = setTimeout(function () {
|
|
next();
|
|
autoplay();
|
|
}, Number(propSwiper.autoPlay));
|
|
}; // 重置首尾位置信息
|
|
|
|
|
|
var resettPosition = function resettPosition() {
|
|
_swiper.current.moving = true;
|
|
|
|
if (active <= -1) {
|
|
move({
|
|
pace: childCount
|
|
});
|
|
}
|
|
|
|
if (active >= childCount) {
|
|
move({
|
|
pace: -childCount
|
|
});
|
|
}
|
|
}; // 上一页
|
|
|
|
|
|
var prev = function prev() {
|
|
resettPosition();
|
|
touchReset();
|
|
requestFrame(function () {
|
|
requestFrame(function () {
|
|
_swiper.current.moving = false;
|
|
move({
|
|
pace: -1,
|
|
isEmit: true
|
|
});
|
|
});
|
|
});
|
|
}; // 下一页
|
|
|
|
|
|
var next = function next() {
|
|
resettPosition();
|
|
touchReset();
|
|
requestFrame(function () {
|
|
requestFrame(function () {
|
|
_swiper.current.moving = false;
|
|
move({
|
|
pace: 1,
|
|
isEmit: true
|
|
});
|
|
});
|
|
});
|
|
}; // 前往指定页
|
|
|
|
|
|
var to = function to(index) {
|
|
resettPosition();
|
|
touchReset();
|
|
requestFrame(function () {
|
|
requestFrame(function () {
|
|
_swiper.current.moving = false;
|
|
var targetIndex;
|
|
|
|
if (propSwiper.loop && childCount === index) {
|
|
targetIndex = active === 0 ? 0 : index;
|
|
} else {
|
|
targetIndex = index % childCount;
|
|
}
|
|
|
|
move({
|
|
pace: targetIndex - active,
|
|
isEmit: true
|
|
});
|
|
});
|
|
});
|
|
}; // 切换方法
|
|
|
|
|
|
var move = function move(_ref) {
|
|
var _ref$pace = _ref.pace,
|
|
pace = _ref$pace === void 0 ? 0 : _ref$pace,
|
|
_ref$offset = _ref.offset,
|
|
offset = _ref$offset === void 0 ? 0 : _ref$offset,
|
|
_ref$isEmit = _ref.isEmit,
|
|
isEmit = _ref$isEmit === void 0 ? false : _ref$isEmit;
|
|
if (childCount <= 1) return;
|
|
var targetActive = getActive(pace); // 父级容器偏移量
|
|
|
|
var targetOffset = getOffset(targetActive, offset); // 如果循环,调整开头结尾图片位置
|
|
|
|
if (propSwiper.loop) {
|
|
if (Array.isArray(children) && children[0] && targetOffset !== minOffset) {
|
|
var rightBound = targetOffset < minOffset;
|
|
childOffset[0] = rightBound ? trackSize : 0;
|
|
}
|
|
|
|
if (Array.isArray(children) && children[childCount - 1] && targetOffset !== 0) {
|
|
var leftBound = targetOffset > 0;
|
|
childOffset[childCount - 1] = leftBound ? -trackSize : 0;
|
|
}
|
|
|
|
setChildOffset(childOffset);
|
|
}
|
|
|
|
if (isEmit && active !== targetActive) {
|
|
propSwiper.onChange && propSwiper.onChange((targetActive + childCount) % childCount);
|
|
}
|
|
|
|
active = targetActive;
|
|
setActive(targetActive);
|
|
setOffset(targetOffset);
|
|
getStyle(targetOffset);
|
|
}; // 确定当前active 元素
|
|
|
|
|
|
var getActive = function getActive(pace) {
|
|
if (pace) {
|
|
var _active = active + pace;
|
|
|
|
if (propSwiper.loop) {
|
|
return range(_active, -1, childCount);
|
|
}
|
|
|
|
return range(_active, 0, childCount - 1);
|
|
}
|
|
|
|
return active;
|
|
}; // 计算位移
|
|
|
|
|
|
var getOffset = function getOffset(active) {
|
|
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
var currentPosition = active * Number(size);
|
|
|
|
if (!propSwiper.loop) {
|
|
currentPosition = Math.min(currentPosition, -minOffset);
|
|
}
|
|
|
|
var targetOffset = offset - currentPosition;
|
|
|
|
if (!propSwiper.loop) {
|
|
targetOffset = range(targetOffset, minOffset, 0);
|
|
}
|
|
|
|
return targetOffset;
|
|
}; // 浏览器 帧 事件
|
|
|
|
|
|
var requestFrame = function requestFrame(fn) {
|
|
window.requestAnimationFrame.call(window, fn);
|
|
}; // 取值 方法
|
|
|
|
|
|
var range = function range(num, min, max) {
|
|
return Math.min(Math.max(num, min), max);
|
|
};
|
|
|
|
var getDirection = function getDirection(x, y) {
|
|
if (x > y && x > DISTANCE) return 'horizontal';
|
|
if (y > x && y > DISTANCE) return 'vertical';
|
|
return '';
|
|
}; // 重置 全部位移信息
|
|
|
|
|
|
var touchReset = function touchReset() {
|
|
touch.startX = 0;
|
|
touch.startY = 0;
|
|
touch.deltaX = 0;
|
|
touch.deltaY = 0;
|
|
touch.offsetX = 0;
|
|
touch.offsetY = 0;
|
|
touch.delta = 0;
|
|
touch.stateDirection = '';
|
|
touch.touchTime = 0;
|
|
}; // 触摸事件开始
|
|
|
|
|
|
var touchStart = function touchStart(e) {
|
|
var _e$touches$, _e$touches$2;
|
|
|
|
touchReset();
|
|
touch.startX = (e === null || e === void 0 ? void 0 : (_e$touches$ = e.touches[0]) === null || _e$touches$ === void 0 ? void 0 : _e$touches$.clientX) || 0;
|
|
touch.startY = (e === null || e === void 0 ? void 0 : (_e$touches$2 = e.touches[0]) === null || _e$touches$2 === void 0 ? void 0 : _e$touches$2.clientY) || 0;
|
|
}; // 触摸事件移动
|
|
|
|
|
|
var touchMove = function touchMove(e) {
|
|
var _e$touches$3, _e$touches$4;
|
|
|
|
touch.deltaX = ((e === null || e === void 0 ? void 0 : (_e$touches$3 = e.touches[0]) === null || _e$touches$3 === void 0 ? void 0 : _e$touches$3.clientX) || 0) - touch.startX;
|
|
touch.deltaY = ((e === null || e === void 0 ? void 0 : (_e$touches$4 = e.touches[0]) === null || _e$touches$4 === void 0 ? void 0 : _e$touches$4.clientY) || 0) - touch.startY;
|
|
touch.offsetX = Math.abs(touch.deltaX);
|
|
touch.offsetY = Math.abs(touch.deltaY);
|
|
touch.delta = isVertical ? touch.deltaY : touch.deltaX;
|
|
|
|
if (!touch.stateDirection) {
|
|
touch.stateDirection = getDirection(touch.offsetX, touch.offsetY);
|
|
}
|
|
};
|
|
|
|
var contentClass = classnames__WEBPACK_IMPORTED_MODULE_3___default()((_classNames = {}, (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames, 'van-swiper__inner', true), (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames, 'van-swiper__vertical', isVertical), _classNames));
|
|
|
|
var getStyle = function getStyle() {
|
|
var moveOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : offset;
|
|
var target = innerRef.current;
|
|
var _offset = 0;
|
|
|
|
if (!isCenter) {
|
|
_offset = moveOffset;
|
|
} else {
|
|
var _size = isVertical ? height : width;
|
|
|
|
var val = isVertical ? (rect === null || rect === void 0 ? void 0 : rect.height) - _size : (rect === null || rect === void 0 ? void 0 : rect.width) - _size;
|
|
_offset = moveOffset + (active === childCount - 1 && !propSwiper.loop ? -val / 2 : val / 2);
|
|
}
|
|
|
|
target.style.transitionDuration = "".concat(_swiper.current.moving ? 0 : propSwiper.duration, "ms");
|
|
target.style[isVertical ? 'height' : 'width'] = "".concat(Number(size) * childCount, "px");
|
|
target.style[isVertical ? 'width' : 'height'] = "".concat(isVertical ? width : height, "px");
|
|
target.style.transform = "translate3D".concat(!isVertical ? "(".concat(_offset, "px,0,0)") : "(0,".concat(_offset, "px,0)"));
|
|
};
|
|
|
|
var onTouchStart = function onTouchStart(e) {
|
|
if (propSwiper.isPreventDefault) e.preventDefault();
|
|
if (propSwiper.isStopPropagation) e.stopPropagation();
|
|
if (!propSwiper.touchable) return;
|
|
touchStart(e);
|
|
touch.touchTime = Date.now();
|
|
stopAutoPlay();
|
|
resettPosition();
|
|
};
|
|
|
|
var onTouchMove = function onTouchMove(e) {
|
|
if (propSwiper.touchable && _swiper.current.moving) {
|
|
touchMove(e);
|
|
|
|
if (touch.stateDirection === propSwiper.direction) {
|
|
move({
|
|
offset: touch.delta
|
|
});
|
|
}
|
|
}
|
|
};
|
|
|
|
var onTouchEnd = function onTouchEnd() {
|
|
if (!propSwiper.touchable || !_swiper.current.moving) return;
|
|
var speed = touch.delta / (Date.now() - touch.touchTime);
|
|
var isShouldMove = Math.abs(speed) > 0.3 || Math.abs(touch.delta) > +(size / 2).toFixed(2);
|
|
var pace = 0;
|
|
_swiper.current.moving = false;
|
|
|
|
if (isShouldMove && touch.stateDirection === propSwiper.direction) {
|
|
var _offset2 = isVertical ? touch.offsetY : touch.offsetX;
|
|
|
|
if (propSwiper.loop) {
|
|
if (_offset2 > 0) {
|
|
pace = touch.delta > 0 ? -1 : 1;
|
|
} else {
|
|
pace = 0;
|
|
}
|
|
} else {
|
|
pace = -Math[touch.delta > 0 ? 'ceil' : 'floor'](touch.delta / size);
|
|
}
|
|
|
|
move({
|
|
pace: pace,
|
|
isEmit: true
|
|
});
|
|
} else if (touch.delta) {
|
|
move({
|
|
pace: 0
|
|
});
|
|
} else {
|
|
getStyle();
|
|
}
|
|
|
|
autoplay();
|
|
};
|
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
_swiper.current.activePagination = (active + childCount) % childCount; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, [active]);
|
|
|
|
var queryRect = function queryRect(element) {
|
|
return new Promise(function (resolve) {
|
|
var query = (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_4__.createSelectorQuery)();
|
|
query.select("#".concat(element.id)) && query.select("#".concat(element.id)).boundingClientRect();
|
|
query.exec(function (res) {
|
|
resolve(res[0]);
|
|
});
|
|
});
|
|
};
|
|
|
|
var init = /*#__PURE__*/function () {
|
|
var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_10__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
|
|
var active,
|
|
rect,
|
|
_active,
|
|
_width,
|
|
_height,
|
|
targetOffset,
|
|
_args = arguments;
|
|
|
|
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
|
|
while (1) {
|
|
switch (_context.prev = _context.next) {
|
|
case 0:
|
|
active = _args.length > 0 && _args[0] !== undefined ? _args[0] : +propSwiper.initPage;
|
|
_context.next = 3;
|
|
return queryRect(container.current);
|
|
|
|
case 3:
|
|
rect = _context.sent;
|
|
_active = Math.max(Math.min(childCount - 1, active), 0);
|
|
_width = propSwiper.width ? +propSwiper.width : rect === null || rect === void 0 ? void 0 : rect.width;
|
|
_height = propSwiper.height ? +propSwiper.height : rect === null || rect === void 0 ? void 0 : rect.height;
|
|
size = isVertical ? _height : _width;
|
|
trackSize = childCount * Number(size);
|
|
targetOffset = getOffset(_active);
|
|
_swiper.current.moving = true;
|
|
|
|
if (ready) {
|
|
_swiper.current.moving = false;
|
|
}
|
|
|
|
setRect(rect);
|
|
setActive(_active);
|
|
setWidth(_width);
|
|
setHeight(_height);
|
|
setOffset(targetOffset);
|
|
setReady(true);
|
|
|
|
case 18:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}
|
|
}, _callee);
|
|
}));
|
|
|
|
return function init() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
if (ready) {
|
|
getStyle();
|
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
}, [isVertical, width, height, offset, ready]);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
return function () {
|
|
setReady(false);
|
|
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, []);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
stopAutoPlay();
|
|
autoplay(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, [children]);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
init(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, [propSwiper.initPage]);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
return function () {
|
|
stopAutoPlay();
|
|
};
|
|
}, []);
|
|
(0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_4__.useReady)(function () {
|
|
init();
|
|
_tarojs_taro__WEBPACK_IMPORTED_MODULE_4___default().nextTick(function () {
|
|
setTimeout(function () {
|
|
stopAutoPlay();
|
|
autoplay();
|
|
}, 16);
|
|
});
|
|
});
|
|
|
|
var itemStyle = function itemStyle(index) {
|
|
var style = {};
|
|
|
|
var _direction = propSwiper.direction || direction;
|
|
|
|
var _size = size;
|
|
|
|
if (_size) {
|
|
style[_direction === 'horizontal' ? 'width' : 'height'] = "".concat(_size, "px");
|
|
}
|
|
|
|
var offset = childOffset[index];
|
|
|
|
if (offset) {
|
|
style.transform = "translate3D".concat(_direction === 'horizontal' ? "(".concat(offset, "px,0,0)") : "(0,".concat(offset, "px,0)"));
|
|
}
|
|
|
|
return style;
|
|
};
|
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useImperativeHandle)(ref, function () {
|
|
return {
|
|
to: to,
|
|
next: next,
|
|
prev: prev
|
|
};
|
|
});
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_context__WEBPACK_IMPORTED_MODULE_5__.DataContext.Provider, {
|
|
value: parent,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, _objectSpread(_objectSpread({
|
|
className: "van-swiper ".concat(className),
|
|
ref: container
|
|
}, rest), {}, {
|
|
id: 'container-' + refRandomId,
|
|
onTouchStart: onTouchStart,
|
|
onTouchMove: onTouchMove,
|
|
onTouchEnd: onTouchEnd // @ts-ignore
|
|
,
|
|
catchMove: isVertical,
|
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
height: height
|
|
}),
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
|
|
className: contentClass,
|
|
ref: innerRef,
|
|
children: [react__WEBPACK_IMPORTED_MODULE_2__.Children.map(childs, function (child, index) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
|
|
className: 'van-swiper-item-wrapper',
|
|
style: itemStyle(index),
|
|
children: child
|
|
}, index);
|
|
}), true && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
|
|
className: 'van-swiper-item-wrapper',
|
|
style: itemStyle(0),
|
|
children: childs && childs.length ? childs[0] : ''
|
|
})]
|
|
}), propSwiper.paginationVisible && !('pageContent' in propSwiper) ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
|
|
className: classnames__WEBPACK_IMPORTED_MODULE_3___default()((_classNames2 = {}, (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames2, 'van-swiper__pagination', true), (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames2, 'van-swiper__pagination-vertical', isVertical), _classNames2)),
|
|
children: react__WEBPACK_IMPORTED_MODULE_2__.Children.map(childs, function (_, index) {
|
|
var _classNames3;
|
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.Text, {
|
|
style: (active + childCount) % childCount === index ? {
|
|
backgroundColor: propSwiper.paginationColor
|
|
} : undefined,
|
|
className: classnames__WEBPACK_IMPORTED_MODULE_3___default()((_classNames3 = {}, (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames3, 'van-swiper__pagination-item', true), (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames3, "active", (active + childCount) % childCount === index), _classNames3))
|
|
}, index);
|
|
})
|
|
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_11__.View, {
|
|
children: pageContent
|
|
})]
|
|
}))
|
|
});
|
|
};
|
|
|
|
var Swiper_ = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(Swiper);
|
|
/* harmony default export */ __webpack_exports__["default"] = (Swiper_);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/tag/index.js":
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/tag/index.js ***!
|
|
\*****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "Tag": function() { return /* binding */ Tag; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../icon */ "./node_modules/@antmjs/vantui/es/icon/index.js");
|
|
/* harmony import */ var _wxs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./wxs */ "./node_modules/@antmjs/vantui/es/tag/wxs.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
|
|
|
var _excluded = ["type", "size", "mark", "plain", "round", "color", "textColor", "closeable", "children", "onClose", "style", "className"];
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tag(props) {
|
|
var _props$type = props.type,
|
|
type = _props$type === void 0 ? 'default' : _props$type,
|
|
size = props.size,
|
|
mark = props.mark,
|
|
plain = props.plain,
|
|
round = props.round,
|
|
color = props.color,
|
|
textColor = props.textColor,
|
|
closeable = props.closeable,
|
|
children = props.children,
|
|
onClose = props.onClose,
|
|
style = props.style,
|
|
className = props.className,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__["default"])(props, _excluded);
|
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, _objectSpread(_objectSpread({
|
|
className: ' ' + _wxs_utils__WEBPACK_IMPORTED_MODULE_1__.bem('tag', [type, size, {
|
|
mark: mark,
|
|
plain: plain,
|
|
round: round
|
|
}]) + " ".concat(className || ''),
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_1__.style([_wxs__WEBPACK_IMPORTED_MODULE_6__.rootStyle({
|
|
plain: plain,
|
|
color: color,
|
|
textColor: textColor
|
|
}), style])
|
|
}, others), {}, {
|
|
children: [children, closeable && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icon__WEBPACK_IMPORTED_MODULE_2__.Icon, {
|
|
name: "cross",
|
|
className: "van-tag__close",
|
|
onClick: onClose
|
|
})]
|
|
}));
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (Tag);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/tag/wxs.js":
|
|
/*!***************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/tag/wxs.js ***!
|
|
\***************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "rootStyle": function() { return /* binding */ rootStyle; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wxs_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wxs/style */ "./node_modules/@antmjs/vantui/es/wxs/style.js");
|
|
|
|
|
|
function rootStyle(data) {
|
|
return (0,_wxs_style__WEBPACK_IMPORTED_MODULE_0__.style)({
|
|
'background-color': data.plain ? '' : data.color,
|
|
color: data.textColor || data.plain ? data.textColor || data.color : ''
|
|
});
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/wxs/add-unit.js":
|
|
/*!********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/wxs/add-unit.js ***!
|
|
\********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "addUnit": function() { return /* binding */ addUnit; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
|
|
|
function addUnit(value) {
|
|
if (value == null) {
|
|
return undefined;
|
|
}
|
|
|
|
return /^-?\d+(\.\d+)?$/.test('' + value) ? (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.pxTransform)(value) : value;
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/wxs/array.js":
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/wxs/array.js ***!
|
|
\*****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "isArray": function() { return /* binding */ isArray; }
|
|
/* harmony export */ });
|
|
function isArray(array) {
|
|
return array && toString.call(array) === '[object Array]';
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/wxs/bem.js":
|
|
/*!***************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/wxs/bem.js ***!
|
|
\***************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "_bem": function() { return /* binding */ _bem; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
|
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array */ "./node_modules/@antmjs/vantui/es/wxs/array.js");
|
|
/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./object */ "./node_modules/@antmjs/vantui/es/wxs/object.js");
|
|
|
|
|
|
|
|
var PREFIX = 'van-';
|
|
|
|
function join(name, mods) {
|
|
name = PREFIX + name;
|
|
mods = mods.map(function (mod) {
|
|
return name + '--' + mod;
|
|
});
|
|
mods.unshift(name);
|
|
return mods.join(' ');
|
|
}
|
|
|
|
function traversing(mods, conf) {
|
|
if (!conf) {
|
|
return;
|
|
} // 加前缀
|
|
|
|
|
|
if (typeof conf === 'string' || typeof conf === 'number') {
|
|
mods.push(conf);
|
|
} else if (_array__WEBPACK_IMPORTED_MODULE_0__.isArray(conf)) {
|
|
// 加前缀
|
|
conf.forEach(function (item) {
|
|
traversing(mods, item);
|
|
});
|
|
} else if ((0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__["default"])(conf) === 'object') {
|
|
// 加属性
|
|
_object__WEBPACK_IMPORTED_MODULE_2__.keys(conf).forEach(function (key) {
|
|
conf[key] && mods.push(key);
|
|
});
|
|
}
|
|
}
|
|
|
|
function _bem(name, conf) {
|
|
var mods = [];
|
|
traversing(mods, conf);
|
|
return join(name, mods);
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/wxs/memoize.js":
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/wxs/memoize.js ***!
|
|
\*******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "memoize": function() { return /* binding */ memoize; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
|
|
|
|
|
|
/**
|
|
* Simple memoize
|
|
* wxs doesn't support fn.apply, so this memoize only support up to 2 args
|
|
*/
|
|
|
|
/* eslint-disable */
|
|
function isPrimitive(value) {
|
|
var type = (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
|
|
|
|
return type === 'boolean' || type === 'number' || type === 'string' || type === 'undefined' || value === null;
|
|
} // mock simple fn.call in wxs
|
|
|
|
|
|
function call(fn, args) {
|
|
if (args.length === 2) {
|
|
return fn(args[0], args[1]);
|
|
}
|
|
|
|
if (args.length === 1) {
|
|
return fn(args[0]);
|
|
}
|
|
|
|
return fn();
|
|
}
|
|
|
|
function serializer(args) {
|
|
if (args.length === 1 && isPrimitive(args[0])) {
|
|
return args[0];
|
|
}
|
|
|
|
var obj = {};
|
|
|
|
for (var i = 0; i < args.length; i++) {
|
|
obj['key' + i] = args[i];
|
|
}
|
|
|
|
return JSON.stringify(obj);
|
|
}
|
|
|
|
function memoize(fn) {
|
|
var cache = {};
|
|
return function () {
|
|
var key = serializer(arguments);
|
|
|
|
if (cache[key] === undefined) {
|
|
cache[key] = call(fn, arguments);
|
|
}
|
|
|
|
return cache[key];
|
|
};
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/wxs/object.js":
|
|
/*!******************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/wxs/object.js ***!
|
|
\******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "keys": function() { return /* binding */ keys; }
|
|
/* harmony export */ });
|
|
var REGEXP = new RegExp('{|}|"', 'g');
|
|
|
|
function keys(obj) {
|
|
return JSON.stringify(obj).replace(REGEXP, '').split(',').map(function (item) {
|
|
return item.split(':')[0];
|
|
});
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/wxs/style.js":
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/wxs/style.js ***!
|
|
\*****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "style": function() { return /* binding */ style; }
|
|
/* harmony export */ });
|
|
/* unused harmony export cssStyle */
|
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array */ "./node_modules/@antmjs/vantui/es/wxs/array.js");
|
|
/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./object */ "./node_modules/@antmjs/vantui/es/wxs/object.js");
|
|
|
|
|
|
|
|
function kebabCase(word) {
|
|
var _word$replace;
|
|
|
|
var newWord = (_word$replace = word.replace(new RegExp('[A-Z]', 'g'), function (i) {
|
|
return '-' + i;
|
|
})) === null || _word$replace === void 0 ? void 0 : _word$replace.toLowerCase();
|
|
return newWord;
|
|
}
|
|
|
|
function cssStyle(styles) {
|
|
if (_array__WEBPACK_IMPORTED_MODULE_0__.isArray(styles)) {
|
|
var obj = {};
|
|
styles.filter(function (item) {
|
|
return item != null && item !== '';
|
|
}).map(function (item) {
|
|
Object.assign(obj, cssStyle(item));
|
|
});
|
|
return obj;
|
|
}
|
|
|
|
if (toString.call(styles) === '[object String]') {
|
|
var _obj = {};
|
|
styles.split(';').map(function (item) {
|
|
var _property$, _property$2;
|
|
|
|
var property = item.split(':');
|
|
_obj[((_property$ = property[0]) === null || _property$ === void 0 ? void 0 : _property$.trim()) || ''] = (_property$2 = property[1]) === null || _property$2 === void 0 ? void 0 : _property$2.trim();
|
|
});
|
|
return _obj;
|
|
}
|
|
|
|
return styles;
|
|
}
|
|
|
|
function style(styles) {
|
|
if (_array__WEBPACK_IMPORTED_MODULE_0__.isArray(styles)) {
|
|
return styles.filter(function (item) {
|
|
return item != null && item !== '';
|
|
}).map(function (item) {
|
|
return style(item);
|
|
}).join(';') || '';
|
|
}
|
|
|
|
if (toString.call(styles) === '[object Object]') {
|
|
return _object__WEBPACK_IMPORTED_MODULE_1__.keys(styles).filter(function (key) {
|
|
return styles[key] != null && styles[key] !== '';
|
|
}).map(function (key) {
|
|
return [kebabCase(key), [styles[key]]].join(':');
|
|
}).join(';') || '';
|
|
}
|
|
|
|
return styles || '';
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/wxs/utils.js":
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/wxs/utils.js ***!
|
|
\*****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "bem": function() { return /* binding */ bem; },
|
|
/* harmony export */ "style": function() { return /* reexport safe */ _style__WEBPACK_IMPORTED_MODULE_3__.style; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _bem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bem */ "./node_modules/@antmjs/vantui/es/wxs/bem.js");
|
|
/* harmony import */ var _memoize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./memoize */ "./node_modules/@antmjs/vantui/es/wxs/memoize.js");
|
|
/* harmony import */ var _add_unit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add-unit */ "./node_modules/@antmjs/vantui/es/wxs/add-unit.js");
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style */ "./node_modules/@antmjs/vantui/es/wxs/style.js");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var bem = (0,_memoize__WEBPACK_IMPORTED_MODULE_1__.memoize)(_bem__WEBPACK_IMPORTED_MODULE_2__._bem);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/home/index.tsx":
|
|
/*!*******************************************************************************************************!*\
|
|
!*** ./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/home/index.tsx ***!
|
|
\*******************************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var _antmjs_vantui_es_card__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antmjs/vantui/es/card */ "./node_modules/@antmjs/vantui/es/card/index.js");
|
|
/* harmony import */ var _antmjs_vantui_es_divider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antmjs/vantui/es/divider */ "./node_modules/@antmjs/vantui/es/divider/index.js");
|
|
/* harmony import */ var _antmjs_vantui_es_grid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antmjs/vantui/es/grid */ "./node_modules/@antmjs/vantui/es/grid/index.js");
|
|
/* harmony import */ var _antmjs_vantui_es_grid_item__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antmjs/vantui/es/grid-item */ "./node_modules/@antmjs/vantui/es/grid-item/index.js");
|
|
/* harmony import */ var _antmjs_vantui_es_swiper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antmjs/vantui/es/swiper */ "./node_modules/@antmjs/vantui/es/swiper/index.js");
|
|
/* harmony import */ var _antmjs_vantui_es_swiper_item__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antmjs/vantui/es/swiper-item */ "./node_modules/@antmjs/vantui/es/swiper-item/index.js");
|
|
/* harmony import */ var _antmjs_vantui_es_image__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @antmjs/vantui/es/image */ "./node_modules/@antmjs/vantui/es/image/index.js");
|
|
/* harmony import */ var _antmjs_vantui_es_tag__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @antmjs/vantui/es/tag */ "./node_modules/@antmjs/vantui/es/tag/index.js");
|
|
/* harmony import */ var _antmjs_vantui_es_notice_bar__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @antmjs/vantui/es/notice-bar */ "./node_modules/@antmjs/vantui/es/notice-bar/index.js");
|
|
/* harmony import */ var _Users_eric_Desktop_citynew_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__);
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Home = function Home() {
|
|
// const { images } = COMMON
|
|
var _react$useState = react__WEBPACK_IMPORTED_MODULE_9___default().useState(0),
|
|
_react$useState2 = (0,_Users_eric_Desktop_citynew_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_11__["default"])(_react$useState, 2),
|
|
initPage1 = _react$useState2[0],
|
|
setInitPage1 = _react$useState2[1];
|
|
var onChange = function onChange(e) {};
|
|
var images = ["cloud://cloud1-5g5xrgza12a0dd6d.636c-cloud1-5g5xrgza12a0dd6d-1253665791/download.jpg", "cloud://cloud1-5g5xrgza12a0dd6d.636c-cloud1-5g5xrgza12a0dd6d-1253665791/images.jpg"];
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_antmjs_vantui_es_notice_bar__WEBPACK_IMPORTED_MODULE_8__["default"], {
|
|
leftIcon: "volume-o",
|
|
text: "\u5728\u4EE3\u7801\u9605\u8BFB\u8FC7\u7A0B\u4E2D\u4EBA\u4EEC\u8BF4\u810F\u8BDD\u7684\u9891\u7387\u662F\u8861\u91CF\u4EE3\u7801\u8D28\u91CF\u7684\u552F\u4E00\u6807\u51C6\u3002"
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_antmjs_vantui_es_tag__WEBPACK_IMPORTED_MODULE_7__["default"], {
|
|
plain: true,
|
|
type: "primary",
|
|
children: "\u6DF1\u5733"
|
|
})
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
|
|
className: "demo-box",
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_antmjs_vantui_es_swiper__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
|
height: 200,
|
|
paginationColor: "#426543",
|
|
autoPlay: "3000",
|
|
initPage: initPage1,
|
|
paginationVisible: true,
|
|
onChange: onChange,
|
|
children: images.map(function (item, index) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_antmjs_vantui_es_swiper_item__WEBPACK_IMPORTED_MODULE_5__["default"], {
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_antmjs_vantui_es_image__WEBPACK_IMPORTED_MODULE_6__["default"], {
|
|
src: item,
|
|
fit: "cover",
|
|
width: "100%",
|
|
height: "200px"
|
|
})
|
|
}, "swiper#demo1".concat(index));
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_antmjs_vantui_es_grid__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_antmjs_vantui_es_grid_item__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
icon: "photo-o",
|
|
text: "\u6D3B\u52A8"
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_antmjs_vantui_es_grid_item__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
icon: "photo-o",
|
|
text: "\u6D3B\u52A8"
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_antmjs_vantui_es_grid_item__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
icon: "photo-o",
|
|
text: "\u6D3B\u52A8"
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_antmjs_vantui_es_grid_item__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
icon: "photo-o",
|
|
text: "\u6D3B\u52A8"
|
|
})]
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_12__.View, {
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_antmjs_vantui_es_divider__WEBPACK_IMPORTED_MODULE_1__["default"], {})
|
|
}), [1, 2].map(function (item) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_antmjs_vantui_es_card__WEBPACK_IMPORTED_MODULE_0__["default"], {
|
|
num: "",
|
|
price: "",
|
|
desc: "\u62A5\u540D\u4E2D",
|
|
title: "\u5468\u672B\u722C\u5C71",
|
|
thumb: "cloud://cloud1-5g5xrgza12a0dd6d.636c-cloud1-5g5xrgza12a0dd6d-1253665791/images.jpg"
|
|
// renderFooter={
|
|
// <View>
|
|
// <Button size="mini">按钮1</Button>
|
|
// <Button size="mini">按钮2</Button>
|
|
// </View>
|
|
// }
|
|
});
|
|
})]
|
|
});
|
|
};
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Home);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./src/pages/home/index.tsx":
|
|
/*!**********************************!*\
|
|
!*** ./src/pages/home/index.tsx ***!
|
|
\**********************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime");
|
|
/* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_index_tsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./index.tsx */ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/home/index.tsx");
|
|
|
|
|
|
var config = {};
|
|
|
|
|
|
var inst = Page((0,_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__.createPageConfig)(_node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_index_tsx__WEBPACK_IMPORTED_MODULE_1__["default"], 'pages/home/index', {root:{cn:[]}}, config || {}))
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/classnames/index.js":
|
|
/*!******************************************!*\
|
|
!*** ./node_modules/classnames/index.js ***!
|
|
\******************************************/
|
|
/***/ (function(module, exports) {
|
|
|
|
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|
Copyright (c) 2018 Jed Watson.
|
|
Licensed under the MIT License (MIT), see
|
|
http://jedwatson.github.io/classnames
|
|
*/
|
|
/* global define */
|
|
|
|
(function () {
|
|
'use strict';
|
|
|
|
var hasOwn = {}.hasOwnProperty;
|
|
var nativeCodeString = '[native code]';
|
|
|
|
function classNames() {
|
|
var classes = [];
|
|
|
|
for (var i = 0; i < arguments.length; i++) {
|
|
var arg = arguments[i];
|
|
if (!arg) continue;
|
|
|
|
var argType = typeof arg;
|
|
|
|
if (argType === 'string' || argType === 'number') {
|
|
classes.push(arg);
|
|
} else if (Array.isArray(arg)) {
|
|
if (arg.length) {
|
|
var inner = classNames.apply(null, arg);
|
|
if (inner) {
|
|
classes.push(inner);
|
|
}
|
|
}
|
|
} else if (argType === 'object') {
|
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
classes.push(arg.toString());
|
|
continue;
|
|
}
|
|
|
|
for (var key in arg) {
|
|
if (hasOwn.call(arg, key) && arg[key]) {
|
|
classes.push(key);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return classes.join(' ');
|
|
}
|
|
|
|
if ( true && module.exports) {
|
|
classNames.default = classNames;
|
|
module.exports = classNames;
|
|
} else if (true) {
|
|
// register as 'classnames', consistent with npm package name
|
|
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
|
|
return classNames;
|
|
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
|
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
} else {}
|
|
}());
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/performance-now/lib/performance-now.js":
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/performance-now/lib/performance-now.js ***!
|
|
\*************************************************************/
|
|
/***/ (function(module) {
|
|
|
|
// Generated by CoffeeScript 1.12.2
|
|
(function() {
|
|
var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
|
|
|
|
if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
|
|
module.exports = function() {
|
|
return performance.now();
|
|
};
|
|
} else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
|
|
module.exports = function() {
|
|
return (getNanoSeconds() - nodeLoadTime) / 1e6;
|
|
};
|
|
hrtime = process.hrtime;
|
|
getNanoSeconds = function() {
|
|
var hr;
|
|
hr = hrtime();
|
|
return hr[0] * 1e9 + hr[1];
|
|
};
|
|
moduleLoadTime = getNanoSeconds();
|
|
upTime = process.uptime() * 1e9;
|
|
nodeLoadTime = moduleLoadTime - upTime;
|
|
} else if (Date.now) {
|
|
module.exports = function() {
|
|
return Date.now() - loadTime;
|
|
};
|
|
loadTime = Date.now();
|
|
} else {
|
|
module.exports = function() {
|
|
return new Date().getTime() - loadTime;
|
|
};
|
|
loadTime = new Date().getTime();
|
|
}
|
|
|
|
}).call(this);
|
|
|
|
//# sourceMappingURL=performance-now.js.map
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/raf/index.js":
|
|
/*!***********************************!*\
|
|
!*** ./node_modules/raf/index.js ***!
|
|
\***********************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
/* provided dependency */ var window = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime")["window"];
|
|
var now = __webpack_require__(/*! performance-now */ "./node_modules/performance-now/lib/performance-now.js")
|
|
, root = typeof window === 'undefined' ? __webpack_require__.g : window
|
|
, vendors = ['moz', 'webkit']
|
|
, suffix = 'AnimationFrame'
|
|
, raf = root['request' + suffix]
|
|
, caf = root['cancel' + suffix] || root['cancelRequest' + suffix]
|
|
|
|
for(var i = 0; !raf && i < vendors.length; i++) {
|
|
raf = root[vendors[i] + 'Request' + suffix]
|
|
caf = root[vendors[i] + 'Cancel' + suffix]
|
|
|| root[vendors[i] + 'CancelRequest' + suffix]
|
|
}
|
|
|
|
// Some versions of FF have rAF but not cAF
|
|
if(!raf || !caf) {
|
|
var last = 0
|
|
, id = 0
|
|
, queue = []
|
|
, frameDuration = 1000 / 60
|
|
|
|
raf = function(callback) {
|
|
if(queue.length === 0) {
|
|
var _now = now()
|
|
, next = Math.max(0, frameDuration - (_now - last))
|
|
last = next + _now
|
|
setTimeout(function() {
|
|
var cp = queue.slice(0)
|
|
// Clear queue here to prevent
|
|
// callbacks from appending listeners
|
|
// to the current frame's queue
|
|
queue.length = 0
|
|
for(var i = 0; i < cp.length; i++) {
|
|
if(!cp[i].cancelled) {
|
|
try{
|
|
cp[i].callback(last)
|
|
} catch(e) {
|
|
setTimeout(function() { throw e }, 0)
|
|
}
|
|
}
|
|
}
|
|
}, Math.round(next))
|
|
}
|
|
queue.push({
|
|
handle: ++id,
|
|
callback: callback,
|
|
cancelled: false
|
|
})
|
|
return id
|
|
}
|
|
|
|
caf = function(handle) {
|
|
for(var i = 0; i < queue.length; i++) {
|
|
if(queue[i].handle === handle) {
|
|
queue[i].cancelled = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = function(fn) {
|
|
// Wrap in a new function to prevent
|
|
// `cancel` potentially being assigned
|
|
// to the native rAF function
|
|
return raf.call(root, fn)
|
|
}
|
|
module.exports.cancel = function() {
|
|
caf.apply(root, arguments)
|
|
}
|
|
module.exports.polyfill = function(object) {
|
|
if (!object) {
|
|
object = root;
|
|
}
|
|
object.requestAnimationFrame = raf
|
|
object.cancelAnimationFrame = caf
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
|
|
/*!*******************************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
|
|
\*******************************************************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
var _typeof = (__webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/typeof.js")["default"]);
|
|
function _regeneratorRuntime() {
|
|
"use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
return exports;
|
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
var exports = {},
|
|
Op = Object.prototype,
|
|
hasOwn = Op.hasOwnProperty,
|
|
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
|
obj[key] = desc.value;
|
|
},
|
|
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
function define(obj, key, value) {
|
|
return Object.defineProperty(obj, key, {
|
|
value: value,
|
|
enumerable: !0,
|
|
configurable: !0,
|
|
writable: !0
|
|
}), obj[key];
|
|
}
|
|
try {
|
|
define({}, "");
|
|
} catch (err) {
|
|
define = function define(obj, key, value) {
|
|
return obj[key] = value;
|
|
};
|
|
}
|
|
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
generator = Object.create(protoGenerator.prototype),
|
|
context = new Context(tryLocsList || []);
|
|
return defineProperty(generator, "_invoke", {
|
|
value: makeInvokeMethod(innerFn, self, context)
|
|
}), generator;
|
|
}
|
|
function tryCatch(fn, obj, arg) {
|
|
try {
|
|
return {
|
|
type: "normal",
|
|
arg: fn.call(obj, arg)
|
|
};
|
|
} catch (err) {
|
|
return {
|
|
type: "throw",
|
|
arg: err
|
|
};
|
|
}
|
|
}
|
|
exports.wrap = wrap;
|
|
var ContinueSentinel = {};
|
|
function Generator() {}
|
|
function GeneratorFunction() {}
|
|
function GeneratorFunctionPrototype() {}
|
|
var IteratorPrototype = {};
|
|
define(IteratorPrototype, iteratorSymbol, function () {
|
|
return this;
|
|
});
|
|
var getProto = Object.getPrototypeOf,
|
|
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
function defineIteratorMethods(prototype) {
|
|
["next", "throw", "return"].forEach(function (method) {
|
|
define(prototype, method, function (arg) {
|
|
return this._invoke(method, arg);
|
|
});
|
|
});
|
|
}
|
|
function AsyncIterator(generator, PromiseImpl) {
|
|
function invoke(method, arg, resolve, reject) {
|
|
var record = tryCatch(generator[method], generator, arg);
|
|
if ("throw" !== record.type) {
|
|
var result = record.arg,
|
|
value = result.value;
|
|
return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
invoke("next", value, resolve, reject);
|
|
}, function (err) {
|
|
invoke("throw", err, resolve, reject);
|
|
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
result.value = unwrapped, resolve(result);
|
|
}, function (error) {
|
|
return invoke("throw", error, resolve, reject);
|
|
});
|
|
}
|
|
reject(record.arg);
|
|
}
|
|
var previousPromise;
|
|
defineProperty(this, "_invoke", {
|
|
value: function value(method, arg) {
|
|
function callInvokeWithMethodAndArg() {
|
|
return new PromiseImpl(function (resolve, reject) {
|
|
invoke(method, arg, resolve, reject);
|
|
});
|
|
}
|
|
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
}
|
|
});
|
|
}
|
|
function makeInvokeMethod(innerFn, self, context) {
|
|
var state = "suspendedStart";
|
|
return function (method, arg) {
|
|
if ("executing" === state) throw new Error("Generator is already running");
|
|
if ("completed" === state) {
|
|
if ("throw" === method) throw arg;
|
|
return doneResult();
|
|
}
|
|
for (context.method = method, context.arg = arg;;) {
|
|
var delegate = context.delegate;
|
|
if (delegate) {
|
|
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
if (delegateResult) {
|
|
if (delegateResult === ContinueSentinel) continue;
|
|
return delegateResult;
|
|
}
|
|
}
|
|
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
context.dispatchException(context.arg);
|
|
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
state = "executing";
|
|
var record = tryCatch(innerFn, self, context);
|
|
if ("normal" === record.type) {
|
|
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
return {
|
|
value: record.arg,
|
|
done: context.done
|
|
};
|
|
}
|
|
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
}
|
|
};
|
|
}
|
|
function maybeInvokeDelegate(delegate, context) {
|
|
var method = delegate.iterator[context.method];
|
|
if (undefined === method) {
|
|
if (context.delegate = null, "throw" === context.method) {
|
|
if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
}
|
|
return ContinueSentinel;
|
|
}
|
|
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
var info = record.arg;
|
|
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
}
|
|
function pushTryEntry(locs) {
|
|
var entry = {
|
|
tryLoc: locs[0]
|
|
};
|
|
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
}
|
|
function resetTryEntry(entry) {
|
|
var record = entry.completion || {};
|
|
record.type = "normal", delete record.arg, entry.completion = record;
|
|
}
|
|
function Context(tryLocsList) {
|
|
this.tryEntries = [{
|
|
tryLoc: "root"
|
|
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
}
|
|
function values(iterable) {
|
|
if (iterable) {
|
|
var iteratorMethod = iterable[iteratorSymbol];
|
|
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
if ("function" == typeof iterable.next) return iterable;
|
|
if (!isNaN(iterable.length)) {
|
|
var i = -1,
|
|
next = function next() {
|
|
for (; ++i < iterable.length;) {
|
|
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
}
|
|
return next.value = undefined, next.done = !0, next;
|
|
};
|
|
return next.next = next;
|
|
}
|
|
}
|
|
return {
|
|
next: doneResult
|
|
};
|
|
}
|
|
function doneResult() {
|
|
return {
|
|
value: undefined,
|
|
done: !0
|
|
};
|
|
}
|
|
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
value: GeneratorFunctionPrototype,
|
|
configurable: !0
|
|
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
value: GeneratorFunction,
|
|
configurable: !0
|
|
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
}, exports.mark = function (genFun) {
|
|
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
}, exports.awrap = function (arg) {
|
|
return {
|
|
__await: arg
|
|
};
|
|
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
return this;
|
|
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
return result.done ? result.value : iter.next();
|
|
});
|
|
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
return this;
|
|
}), define(Gp, "toString", function () {
|
|
return "[object Generator]";
|
|
}), exports.keys = function (val) {
|
|
var object = Object(val),
|
|
keys = [];
|
|
for (var key in object) {
|
|
keys.push(key);
|
|
}
|
|
return keys.reverse(), function next() {
|
|
for (; keys.length;) {
|
|
var key = keys.pop();
|
|
if (key in object) return next.value = key, next.done = !1, next;
|
|
}
|
|
return next.done = !0, next;
|
|
};
|
|
}, exports.values = values, Context.prototype = {
|
|
constructor: Context,
|
|
reset: function reset(skipTempReset) {
|
|
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
|
|
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
}
|
|
},
|
|
stop: function stop() {
|
|
this.done = !0;
|
|
var rootRecord = this.tryEntries[0].completion;
|
|
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
return this.rval;
|
|
},
|
|
dispatchException: function dispatchException(exception) {
|
|
if (this.done) throw exception;
|
|
var context = this;
|
|
function handle(loc, caught) {
|
|
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
}
|
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
var entry = this.tryEntries[i],
|
|
record = entry.completion;
|
|
if ("root" === entry.tryLoc) return handle("end");
|
|
if (entry.tryLoc <= this.prev) {
|
|
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
if (hasCatch && hasFinally) {
|
|
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
} else if (hasCatch) {
|
|
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
} else {
|
|
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
}
|
|
}
|
|
}
|
|
},
|
|
abrupt: function abrupt(type, arg) {
|
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
var entry = this.tryEntries[i];
|
|
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
var finallyEntry = entry;
|
|
break;
|
|
}
|
|
}
|
|
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
var record = finallyEntry ? finallyEntry.completion : {};
|
|
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
},
|
|
complete: function complete(record, afterLoc) {
|
|
if ("throw" === record.type) throw record.arg;
|
|
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
},
|
|
finish: function finish(finallyLoc) {
|
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
var entry = this.tryEntries[i];
|
|
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
}
|
|
},
|
|
"catch": function _catch(tryLoc) {
|
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
var entry = this.tryEntries[i];
|
|
if (entry.tryLoc === tryLoc) {
|
|
var record = entry.completion;
|
|
if ("throw" === record.type) {
|
|
var thrown = record.arg;
|
|
resetTryEntry(entry);
|
|
}
|
|
return thrown;
|
|
}
|
|
}
|
|
throw new Error("illegal catch attempt");
|
|
},
|
|
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
return this.delegate = {
|
|
iterator: values(iterable),
|
|
resultName: resultName,
|
|
nextLoc: nextLoc
|
|
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
}
|
|
}, exports;
|
|
}
|
|
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/typeof.js":
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
|
|
\*******************************************************/
|
|
/***/ (function(module) {
|
|
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
|
|
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
return typeof obj;
|
|
} : function (obj) {
|
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
|
}
|
|
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/regenerator/index.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/regenerator/index.js ***!
|
|
\**********************************************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// TODO(Babel 8): Remove this file.
|
|
|
|
var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
|
|
module.exports = runtime;
|
|
|
|
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
try {
|
|
regeneratorRuntime = runtime;
|
|
} catch (accidentalStrictMode) {
|
|
if (typeof globalThis === "object") {
|
|
globalThis.regeneratorRuntime = runtime;
|
|
} else {
|
|
Function("r", "regeneratorRuntime = r")(runtime);
|
|
}
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":
|
|
/*!*********************************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js ***!
|
|
\*********************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "default": function() { return /* binding */ _arrayLikeToArray; }
|
|
/* harmony export */ });
|
|
function _arrayLikeToArray(arr, len) {
|
|
if (len == null || len > arr.length) len = arr.length;
|
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
arr2[i] = arr[i];
|
|
}
|
|
return arr2;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":
|
|
/*!*******************************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***!
|
|
\*******************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "default": function() { return /* binding */ _arrayWithHoles; }
|
|
/* harmony export */ });
|
|
function _arrayWithHoles(arr) {
|
|
if (Array.isArray(arr)) return arr;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js":
|
|
/*!*********************************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js ***!
|
|
\*********************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "default": function() { return /* binding */ _asyncToGenerator; }
|
|
/* harmony export */ });
|
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
try {
|
|
var info = gen[key](arg);
|
|
var value = info.value;
|
|
} catch (error) {
|
|
reject(error);
|
|
return;
|
|
}
|
|
if (info.done) {
|
|
resolve(value);
|
|
} else {
|
|
Promise.resolve(value).then(_next, _throw);
|
|
}
|
|
}
|
|
function _asyncToGenerator(fn) {
|
|
return function () {
|
|
var self = this,
|
|
args = arguments;
|
|
return new Promise(function (resolve, reject) {
|
|
var gen = fn.apply(self, args);
|
|
function _next(value) {
|
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
}
|
|
function _throw(err) {
|
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
}
|
|
_next(undefined);
|
|
});
|
|
};
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js":
|
|
/*!*******************************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
|
|
\*******************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "default": function() { return /* binding */ _defineProperty; }
|
|
/* harmony export */ });
|
|
function _defineProperty(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, {
|
|
value: value,
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true
|
|
});
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js":
|
|
/*!*************************************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js ***!
|
|
\*************************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "default": function() { return /* binding */ _iterableToArrayLimit; }
|
|
/* harmony export */ });
|
|
function _iterableToArrayLimit(arr, i) {
|
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
if (_i == null) return;
|
|
var _arr = [];
|
|
var _n = true;
|
|
var _d = false;
|
|
var _s, _e;
|
|
try {
|
|
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
_arr.push(_s.value);
|
|
if (i && _arr.length === i) break;
|
|
}
|
|
} catch (err) {
|
|
_d = true;
|
|
_e = err;
|
|
} finally {
|
|
try {
|
|
if (!_n && _i["return"] != null) _i["return"]();
|
|
} finally {
|
|
if (_d) throw _e;
|
|
}
|
|
}
|
|
return _arr;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":
|
|
/*!********************************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***!
|
|
\********************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "default": function() { return /* binding */ _nonIterableRest; }
|
|
/* harmony export */ });
|
|
function _nonIterableRest() {
|
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js":
|
|
/*!****************************************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js ***!
|
|
\****************************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "default": function() { return /* binding */ _objectWithoutProperties; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objectWithoutPropertiesLoose.js */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
|
|
|
|
function _objectWithoutProperties(source, excluded) {
|
|
if (source == null) return {};
|
|
var target = (0,_objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, excluded);
|
|
var key, i;
|
|
if (Object.getOwnPropertySymbols) {
|
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
key = sourceSymbolKeys[i];
|
|
if (excluded.indexOf(key) >= 0) continue;
|
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
target[key] = source[key];
|
|
}
|
|
}
|
|
return target;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js":
|
|
/*!*********************************************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***!
|
|
\*********************************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "default": function() { return /* binding */ _objectWithoutPropertiesLoose; }
|
|
/* harmony export */ });
|
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
if (source == null) return {};
|
|
var target = {};
|
|
var sourceKeys = Object.keys(source);
|
|
var key, i;
|
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
key = sourceKeys[i];
|
|
if (excluded.indexOf(key) >= 0) continue;
|
|
target[key] = source[key];
|
|
}
|
|
return target;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js":
|
|
/*!******************************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js ***!
|
|
\******************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "default": function() { return /* binding */ _slicedToArray; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles.js */ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");
|
|
/* harmony import */ var _iterableToArrayLimit_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit.js */ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js");
|
|
/* harmony import */ var _unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");
|
|
/* harmony import */ var _nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./nonIterableRest.js */ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");
|
|
|
|
|
|
|
|
|
|
function _slicedToArray(arr, i) {
|
|
return (0,_arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || (0,_iterableToArrayLimit_js__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, i) || (0,_unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(arr, i) || (0,_nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])();
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":
|
|
/*!*******************************************************************************!*\
|
|
!*** ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js ***!
|
|
\*******************************************************************************/
|
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "default": function() { return /* binding */ _unsupportedIterableToArray; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayLikeToArray.js */ "./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");
|
|
|
|
function _unsupportedIterableToArray(o, minLen) {
|
|
if (!o) return;
|
|
if (typeof o === "string") return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(o, minLen);
|
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(o, minLen);
|
|
}
|
|
|
|
/***/ })
|
|
|
|
},
|
|
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
|
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
|
/******/ __webpack_require__.O(0, ["taro","vendors","common"], function() { return __webpack_exec__("./src/pages/home/index.tsx"); });
|
|
/******/ var __webpack_exports__ = __webpack_require__.O();
|
|
/******/ }
|
|
]);
|
|
//# sourceMappingURL=index.js.map
|