zs-mini-ali-ui
Version:
中视编译后版本 ali-ui
495 lines (461 loc) • 14.6 kB
JavaScript
;/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ fmtEvent)
/* harmony export */ });
function fmtEvent(props, e) {
var dataset = {};
for (var key in props) {
if (/data-/gi.test(key)) {
dataset[key.replace(/data-/gi, '')] = props[key];
}
}
return Object.assign({}, e, {
currentTarget: {
dataset: dataset
},
target: {
dataset: dataset,
targetDataset: dataset
}
});
}
/***/ }),
/* 2 */,
/* 3 */,
/* 4 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ fmtUnit)
/* harmony export */ });
var jsUnitRpx = 'false';
/* eslint-disable no-continue, prefer-spread */
function fmtUnit(oldUnit) {
var getUnit = oldUnit;
if (jsUnitRpx === 'true') {
if (typeof getUnit === 'string' && getUnit === 'px') {
getUnit = 'rpx';
} else if (typeof getUnit === 'number') {
getUnit *= 2;
} else if (typeof getUnit === 'string') {
getUnit = oldUnit.match(/(\d+|\d+\.\d+)(px)/)[1] * 2 + 'rpx';
}
}
return getUnit;
}
/***/ }),
/* 5 */,
/* 6 */,
/* 7 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ getI18n)
/* harmony export */ });
/* harmony import */ var _lang_zh_CN__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
/* harmony import */ var _lang_en_US__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
function getI18n() {
try {
/* global getApp */
/* eslint no-undef: "error" */
var appMiniAliUI = getApp() || null;
if (appMiniAliUI) {
var _appMiniAliUI$globalD;
if (((_appMiniAliUI$globalD = appMiniAliUI.globalData) == null ? void 0 : _appMiniAliUI$globalD.miniAliUiLang) === 'en-US') {
return _lang_en_US__WEBPACK_IMPORTED_MODULE_1__["default"];
} else {
return _lang_zh_CN__WEBPACK_IMPORTED_MODULE_0__["default"];
}
} else {
return _lang_zh_CN__WEBPACK_IMPORTED_MODULE_0__["default"];
}
} catch (error) {
return _lang_zh_CN__WEBPACK_IMPORTED_MODULE_0__["default"];
}
}
/***/ }),
/* 8 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
var I18n_zhCN = {
amountInput: {
thousand: '千',
tenThousand: '万',
hundredThousand: '十万',
million: '百万',
tenMillion: '千万',
hundredMillion: '亿',
billion: '十亿'
},
avatar: {
error: 'Avatar: 不允许设置 desc 但不定义 name'
},
calendar: {
year: '年',
month: '月',
sunday: '日',
monday: '一',
tuesday: '二',
wednesday: '三',
thursday: '四',
friday: '五',
saturday: '六'
},
coupon: {
ruleBtn: '规则详情'
},
filter: {
reset: '重置',
confirm: '确定'
},
footer: {
endLine: '我是有底线的'
},
guide: {
nextBtn: '下一步',
jumpBtn: '跳过',
overBtn: '知道了'
},
list: {
loadMore: '加载更多...',
loadOver: '-- 数据加载完了 --'
},
notice: {
detail: '查看详情'
},
pageResult: {
refresh: '重新刷新',
networkTitle: '网络不给力',
errorTitle: '页面遇到一些小问题',
busyTitle: '请稍等哦,马上出来',
emptyTitle: '什么都没有',
logoffTitle: '此用户已注销',
paymentTitle: '付款没成功',
redpacketTitle: '什么都没有',
networkBrief: '世界上最遥远的距离莫过于此',
errorBrief: '请稍后刷新',
busyBrief: '前面还有很多朋友在排队',
emptyBrief: '前不见古人,后不见来者',
logoffBrief: '',
paymentBrief: '请重新付款',
redpacketBrief: '红包已领空',
timeOut: '秒后'
},
searchBar: {
cancel: '取消'
},
verifyCode: {
label: '验证码',
placeholder: '请输入验证码',
sendBtn: '发送验证码',
sendAgainBtn: '重发验证码',
countDown: '秒后重试'
}
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (I18n_zhCN);
/***/ }),
/* 9 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _zh_CN__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
var I18n_enUS = {
amountInput: {
thousand: 'in thousand (K)' || 0,
tenThousand: 'in ten thousand' || 0,
hundredThousand: 'in a hundred thousand' || 0,
million: 'in million (M)' || 0,
tenMillion: 'in ten million' || 0,
hundredMillion: 'in a hundred million' || 0,
billion: 'in billion (B)' || 0
},
avatar: {
error: 'Avatar: Define both the name and the desc.' || 0
},
calendar: {
year: ' ' || 0,
month: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] || 0,
sunday: 'SUN' || 0,
monday: 'MON' || 0,
tuesday: 'TUE' || 0,
wednesday: 'WED' || 0,
thursday: 'THUR' || 0,
friday: 'FRI' || 0,
saturday: 'SAT' || 0
},
coupon: {
ruleBtn: 'More' || 0
},
filter: {
reset: 'Clear' || 0,
confirm: 'Apply' || 0
},
footer: {
endLine: 'End' || 0
},
guide: {
nextBtn: 'Next' || 0,
jumpBtn: 'Skip' || 0,
overBtn: 'OK' || 0
},
list: {
loadMore: 'See more...' || 0,
loadOver: '-- This is the end. --' || 0
},
notice: {
detail: 'More' || 0
},
pageResult: {
refresh: 'Refresh' || 0,
networkTitle: 'We\'ve lost the Internet connection.' || 0,
errorTitle: 'We\'re met some errors.' || 0,
busyTitle: 'Hang on, we\'ll be back soon.' || 0,
emptyTitle: 'No coupons anymore.' || 0,
logoffTitle: 'The user has logged off.' || 0,
paymentTitle: 'Your payment failed.' || 0,
redpacketTitle: 'No coupons anymore.' || 0,
networkBrief: 'We\'re working out best to get you back up and running. Just be patient.' || 0,
errorBrief: 'Please refresh and try again later.' || 0,
busyBrief: 'You\'re in a high traffic. Just be patient.' || 0,
emptyBrief: 'Sorry. We tried out best.' || 0,
logoffBrief: false || _zh_CN__WEBPACK_IMPORTED_MODULE_0__["default"].pageResult.logoffBrief,
paymentBrief: 'Please try again.' || 0,
redpacketBrief: 'Come to pick up the coupon earlier next time.' || 0,
timeOut: 's to ' || 0
},
searchBar: {
cancel: 'Cancel' || 0
},
verifyCode: {
label: 'Ver. Code' || 0,
placeholder: 'Verification Code' || 0,
sendBtn: 'Send' || 0,
sendAgainBtn: 'Resend Now' || 0,
countDown: 's to Resend' || 0
}
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (I18n_enUS);
/***/ })
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_fmtEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
/* harmony import */ var _util_fmtUnit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
/* harmony import */ var _util_getI18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
var i18n = (0,_util_getI18n__WEBPACK_IMPORTED_MODULE_2__["default"])().verifyCode;
Component({
props: {
className: '',
labelCls: '',
label: i18n.label,
inputCls: '',
last: false,
value: '',
name: '',
type: 'text',
password: false,
placeholder: i18n.placeholder,
placeholderClass: '',
placeholderStyle: '',
disabled: false,
maxlength: 140,
focus: false,
clear: true,
// 默认有清除功能
syncInput: false,
controlled: true,
enableNative: false,
// 兼容安卓input的输入bug
countDown: 60,
isInitialActive: true,
initActive: false,
// 是否自动触发点击发送事件
onInput: function onInput() {},
onConfirm: function onConfirm() {},
onFocus: function onFocus() {},
onBlur: function onBlur() {},
onClear: function onClear() {},
onSend: function onSend() {},
txtSend: i18n.sendBtn,
txtSendAgain: i18n.sendAgainBtn,
txtCountDown: i18n.countDown
},
data: {
_focus: false,
_actionActive: true,
_countDown: 60,
resent: false,
iconSize: (0,_util_fmtUnit__WEBPACK_IMPORTED_MODULE_1__["default"])(18)
},
didMount: function didMount() {
this.setData({
_focus: this.props.focus,
_actionActive: this.props.isInitialActive,
_countDown: this.props.countDown,
actedBefore: false
}); // 在组件加载的时候是否主动触发点击发送验证码事件
if (this.props.initActive) {
this.noSendCountDown();
} else {
this.setData({
_actionActive: !this.props.initActive
});
}
},
didUnmount: function didUnmount() {
clearInterval(this._timeout);
},
methods: {
onBlur: function onBlur(e) {
this.setData({
_focus: false
});
var event = (0,_util_fmtEvent__WEBPACK_IMPORTED_MODULE_0__["default"])(this.props, e);
this.props.onBlur(event);
},
onConfirm: function onConfirm(e) {
var event = (0,_util_fmtEvent__WEBPACK_IMPORTED_MODULE_0__["default"])(this.props, e);
this.props.onConfirm(event);
},
onFocus: function onFocus(e) {
this.setData({
_focus: true
});
var event = (0,_util_fmtEvent__WEBPACK_IMPORTED_MODULE_0__["default"])(this.props, e);
this.props.onFocus(event);
},
onInput: function onInput(e) {
var event = (0,_util_fmtEvent__WEBPACK_IMPORTED_MODULE_0__["default"])(this.props, e);
this.props.onInput(event);
},
onClear: function onClear(e) {
var event = (0,_util_fmtEvent__WEBPACK_IMPORTED_MODULE_0__["default"])(this.props, e);
this.props.onClear(event);
},
onTapSend: function onTapSend(e) {
var _this = this;
var _this$props = this.props,
countDown = _this$props.countDown,
onSend = _this$props.onSend;
if (this.data._actionActive) {
this.setData({
_actionActive: false
});
this._timeout = setInterval(function () {
var subOne = _this.data._countDown - 1;
if (subOne <= 0) {
clearInterval(_this._timeout);
_this.setData({
_actionActive: true,
resend: true,
_countDown: countDown,
actedBefore: true
});
} else {
_this.setData({
_countDown: subOne
});
}
}, 1000);
var event = (0,_util_fmtEvent__WEBPACK_IMPORTED_MODULE_0__["default"])(this.props, e);
onSend(event);
}
},
noSendCountDown: function noSendCountDown() {
var _this2 = this;
var countDown = this.props.countDown;
if (this.data._actionActive) {
this.setData({
_actionActive: false
});
this._timeout = setInterval(function () {
var subOne = _this2.data._countDown - 1;
if (subOne <= 0) {
clearInterval(_this2._timeout);
_this2.setData({
_actionActive: true,
resend: true,
_countDown: countDown,
actedBefore: true
});
} else {
_this2.setData({
_countDown: subOne
});
}
}, 1000);
}
}
}
});
})();
/******/ })()
;