Commit 3cff158b authored by Reeyou's avatar Reeyou

weapp初始化

parents
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
*~
*.sw[mnpcod]
*.log
*.tmp
*.tmp.*
log.txt
*.sublime-project
*.sublime-workspace
.vscode/
npm-debug.log*
.idea/
node_modules/
## 微信小程序
### 文件目录树
```
├─api api接口管理
├─assets 静态资源
├─components 全局组件
├─config 自定义配置文件
├─filters 过滤器
├─miniprogram_npm npm构建包
├─pages 页面内容
├─res 全局数据
│ └─styles ...全局style
│ └─json ...json数据
├─typings
├─utils 公共类
├─app.js
├─app.json 全局配置
├─app.wxss
├─jsconfig.json
├─project.config.json 开发者工具配置
└─sitemap.json 微信小程序搜索索引文件
```
\ No newline at end of file
import request from "../utils/request"
export default async function getUserInfo() {
return request("api/url")
}
\ No newline at end of file
//app.js
App({
onLaunch: function () {
// 获取设备状态栏高度
wx.getSystemInfo({
success: e => {
this.globalData.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
this.globalData.Custom = custom;
this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
}
})
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
}
}
})
},
globalData: {
userInfo: null
}
})
\ No newline at end of file
{
"pages": [
"pages/home/index",
"pages/user/index",
"pages/login/index",
"pages/login/phoneLogin/index",
"pages/custom-tab/index"
],
"window": {
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "wechat",
"backgroundColor": "#eeeeee",
"backgroundTextStyle": "light"
},
"tabBar": {
"list": [
{
"text": "首页",
"pagePath": "pages/home/index",
"iconPath": "assets/tabBar/home-off.png",
"selectedIconPath": "assets/tabBar/home.png"
},
{
"text": "我的",
"pagePath": "pages/user/index",
"iconPath": "assets/tabBar/user-off.png",
"selectedIconPath": "assets/tabBar/user.png"
}
]
},
"usingComponents": {
"mp-dialog": "/miniprogram_npm/weui-miniprogram/dialog/dialog"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
/**app.wxss**/
@import './miniprogram_npm/weui-miniprogram/weui-wxss/dist/style/weui.wxss';
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
// components/custom-tab/index.js
Component({
/**
* currentIndex 当前tab index
* onTabSelect 点击事件传递给父组件index值
*/
properties: {
currentIndex: String
},
/**
* 组件的初始数据
*/
data: {
business: [
{
title: '首页',
icon: "/assets/tabBar/home-off.png",
selectedIcon: "/assets/tabBar/home.png"
},
{
title: '发布',
selectedIcon: "https://img.58cdn.com.cn/images/car/activitypic/weichebao/publish_normo.png",
icon: "https://img.58cdn.com.cn/images/car/activitypic/weichebao/publish_normo.png",
},
{
title: '我的',
icon: "/assets/tabBar/user-off.png",
selectedIcon: "/assets/tabBar/user.png"
}
]
},
/**
* 组件的方法列表
*/
methods: {
onTabSelect(data) {
this.triggerEvent("tabSelect", {
index: data.currentTarget.dataset.index
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="ha-tab-bar {{telModelData?'ha-tab-iphoneX-bar':'ha-tab-default-bar'}}">
<view wx:for="{{business}}" wx:key="{{index}}" class="ha-tab-item" style="width:33.33%;" >
<view class="ha-tab-content {{currentIndex == index ? 'checked' : ''}} " data-index="{{index}}" data-text="{{item.title}}" bindtap="onTabSelect">
<view class="ha-tab-icon">
<image class='tab-icon' src="{{item.icon}}"></image>
<image class='checked' src="{{item.selectedIcon}}"></image>
</view>
<view class='ha-tab-title'>
<text>{{item.title}}</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
.ha-tab-bar {
flex: 1;
justify-content: space-around;
width: 100%;
display: flex;
flex-direction: row;
background-color: #fff;
border-top: 1px solid #d2d2d2;
/* 定义在底部 */
position: fixed;
left: 0;
height: 100rpx;
z-index: 1000;
}
.ha-tab-default-bar{
bottom: 0;
}
.ha-tab-iphoneX-bar{
padding-bottom: 40rpx;
bottom: 0;
}
.ha-tab-item {
display: inline-block;
flex-direction: column;
align-content: center;
justify-content: center;
position: relative;
padding-top: 16rpx;
padding-bottom: 2rpx;
vertical-align: center;
}
.ha-tab-content {
display: inline-block;
flex-direction: column;
align-content: center;
justify-content: center;
position: relative;
width: 100%;
height: 100%;
}
.ha-tab-icon {
display: flex;
justify-content: center;
align-items: center;
flex: 1;
/* width: 60rpx; *//* height: 60rpx; */
}
.ha-tab-icon .checked {
display: none;
}
.ha-tab-icon.checked .checked {
display: block;
}
.ha-tab-icon.checked .tab-icon {
display: none;
}
.ha-tab-content.checked .checked {
display: block;
}
.ha-tab-content.checked .tab-icon {
display: none;
}
.ha-tab-content.checked .ha-tab-title {
color: #0083d2;
}
image {
width: 48rpx;
height: 40rpx;
/* background-color: lightcyan; */
}
.ha-tab-title {
display: flex;
line-height: 40rpx;
text-align: center;
justify-content: center;
font-family: PingFangSC-Regular;
font-size: 22rpx;
color: #666;
}
.ha-badge-container {
width: 80rpx;
height: 50rpx;
position: absolute;
/* background-color: lightblue; */
}
.ha-tab-bubble {
background-color: #e64340;
text-align: center;
justify-content: flex-start;
align-content: center;
position: absolute;
top: -14rpx;
right: -6rpx;
width: 32rpx;
height: 32rpx;
line-height: 26rpx;
border-radius: 16rpx;
}
.ha-tab-count {
color: white;
font-size: 20rpx;
}
.ha-tab-title-selected {
color: #3782f1;
}
\ No newline at end of file
export const baseUrl = ""
\ No newline at end of file
var filters = {
/**
* 时间格式化
* @param sec
*/
formatTime: function (sec) {
var minutes = Math.floor(sec / 60)
var seconds = sec % 60
minutes = minutes < 10 ? '0' + minutes : minutes
seconds = seconds < 10 ? '0' + seconds : seconds
return minutes + ':' + seconds
}
}
module.exports = {
formatTime: filters.formatTime
}
{/* <wxs src="" module="format"></wxs> */ }
\ No newline at end of file
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs"
}
}
\ No newline at end of file
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = { exports: {} }; __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); if(typeof m.exports === "object") { __MODS__[modId].m.exports.__proto__ = m.exports.__proto__; Object.keys(m.exports).forEach(function(k) { __MODS__[modId].m.exports[k] = m.exports[k]; Object.defineProperty(m.exports, k, { set: function(val) { __MODS__[modId].m.exports[k] = val; }, get: function() { return __MODS__[modId].m.exports[k]; } }); }); if(m.exports.__esModule) Object.defineProperty(__MODS__[modId].m.exports, "__esModule", { value: true }); } else { __MODS__[modId].m.exports = m.exports; } } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1586229640084, function(require, module, exports) {
(function(){
// Copyright (c) 2005 Tom Wu
// All Rights Reserved.
// See "LICENSE" for details.
// Basic JavaScript BN library - subset useful for RSA encryption.
// Bits per digit
var dbits;
// JavaScript engine analysis
var canary = 0xdeadbeefcafe;
var j_lm = ((canary&0xffffff)==0xefcafe);
// (public) Constructor
function BigInteger(a,b,c) {
if(a != null)
if("number" == typeof a) this.fromNumber(a,b,c);
else if(b == null && "string" != typeof a) this.fromString(a,256);
else this.fromString(a,b);
}
// return new, unset BigInteger
function nbi() { return new BigInteger(null); }
// am: Compute w_j += (x*this_i), propagate carries,
// c is initial carry, returns final carry.
// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
// We need to select the fastest one that works in this environment.
// am1: use a single mult and divide to get the high bits,
// max digit bits should be 26 because
// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
function am1(i,x,w,j,c,n) {
while(--n >= 0) {
var v = x*this[i++]+w[j]+c;
c = Math.floor(v/0x4000000);
w[j++] = v&0x3ffffff;
}
return c;
}
// am2 avoids a big mult-and-extract completely.
// Max digit bits should be <= 30 because we do bitwise ops
// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
function am2(i,x,w,j,c,n) {
var xl = x&0x7fff, xh = x>>15;
while(--n >= 0) {
var l = this[i]&0x7fff;
var h = this[i++]>>15;
var m = xh*l+h*xl;
l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
w[j++] = l&0x3fffffff;
}
return c;
}
// Alternately, set max digit bits to 28 since some
// browsers slow down when dealing with 32-bit numbers.
function am3(i,x,w,j,c,n) {
var xl = x&0x3fff, xh = x>>14;
while(--n >= 0) {
var l = this[i]&0x3fff;
var h = this[i++]>>14;
var m = xh*l+h*xl;
l = xl*l+((m&0x3fff)<<14)+w[j]+c;
c = (l>>28)+(m>>14)+xh*h;
w[j++] = l&0xfffffff;
}
return c;
}
var inBrowser = typeof navigator !== "undefined";
if(inBrowser && j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
BigInteger.prototype.am = am2;
dbits = 30;
}
else if(inBrowser && j_lm && (navigator.appName != "Netscape")) {
BigInteger.prototype.am = am1;
dbits = 26;
}
else { // Mozilla/Netscape seems to prefer am3
BigInteger.prototype.am = am3;
dbits = 28;
}
BigInteger.prototype.DB = dbits;
BigInteger.prototype.DM = ((1<<dbits)-1);
BigInteger.prototype.DV = (1<<dbits);
var BI_FP = 52;
BigInteger.prototype.FV = Math.pow(2,BI_FP);
BigInteger.prototype.F1 = BI_FP-dbits;
BigInteger.prototype.F2 = 2*dbits-BI_FP;
// Digit conversions
var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
var BI_RC = new Array();
var rr,vv;
rr = "0".charCodeAt(0);
for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
rr = "a".charCodeAt(0);
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
rr = "A".charCodeAt(0);
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
function int2char(n) { return BI_RM.charAt(n); }
function intAt(s,i) {
var c = BI_RC[s.charCodeAt(i)];
return (c==null)?-1:c;
}
// (protected) copy this to r
function bnpCopyTo(r) {
for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
r.t = this.t;
r.s = this.s;
}
// (protected) set from integer value x, -DV <= x < DV
function bnpFromInt(x) {
this.t = 1;
this.s = (x<0)?-1:0;
if(x > 0) this[0] = x;
else if(x < -1) this[0] = x+this.DV;
else this.t = 0;
}
// return bigint initialized to value
function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
// (protected) set from string and radix
function bnpFromString(s,b) {
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 256) k = 8; // byte array
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else { this.fromRadix(s,b); return; }
this.t = 0;
this.s = 0;
var i = s.length, mi = false, sh = 0;
while(--i >= 0) {
var x = (k==8)?s[i]&0xff:intAt(s,i);
if(x < 0) {
if(s.charAt(i) == "-") mi = true;
continue;
}
mi = false;
if(sh == 0)
this[this.t++] = x;
else if(sh+k > this.DB) {
this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;
this[this.t++] = (x>>(this.DB-sh));
}
else
this[this.t-1] |= x<<sh;
sh += k;
if(sh >= this.DB) sh -= this.DB;
}
if(k == 8 && (s[0]&0x80) != 0) {
this.s = -1;
if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;
}
this.clamp();
if(mi) BigInteger.ZERO.subTo(this,this);
}
// (protected) clamp off excess high words
function bnpClamp() {
var c = this.s&this.DM;
while(this.t > 0 && this[this.t-1] == c) --this.t;
}
// (public) return string representation in given radix
function bnToString(b) {
if(this.s < 0) return "-"+this.negate().toString(b);
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else return this.toRadix(b);
var km = (1<<k)-1, d, m = false, r = "", i = this.t;
var p = this.DB-(i*this.DB)%k;
if(i-- > 0) {
if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
while(i >= 0) {
if(p < k) {
d = (this[i]&((1<<p)-1))<<(k-p);
d |= this[--i]>>(p+=this.DB-k);
}
else {
d = (this[i]>>(p-=k))&km;
if(p <= 0) { p += this.DB; --i; }
}
if(d > 0) m = true;
if(m) r += int2char(d);
}
}
return m?r:"0";
}
// (public) -this
function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
// (public) |this|
function bnAbs() { return (this.s<0)?this.negate():this; }
// (public) return + if this > a, - if this < a, 0 if equal
function bnCompareTo(a) {
var r = this.s-a.s;
if(r != 0) return r;
var i = this.t;
r = i-a.t;
if(r != 0) return (this.s<0)?-r:r;
while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
return 0;
}
// returns bit length of the integer x
function nbits(x) {
var r = 1, t;
if((t=x>>>16) != 0) { x = t; r += 16; }
if((t=x>>8) != 0) { x = t; r += 8; }
if((t=x>>4) != 0) { x = t; r += 4; }
if((t=x>>2) != 0) { x = t; r += 2; }
if((t=x>>1) != 0) { x = t; r += 1; }
return r;
}
// (public) return the number of bits in "this"
function bnBitLength() {
if(this.t <= 0) return 0;
return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
}
// (protected) r = this << n*DB
function bnpDLShiftTo(n,r) {
var i;
for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
for(i = n-1; i >= 0; --i) r[i] = 0;
r.t = this.t+n;
r.s = this.s;
}
// (protected) r = this >> n*DB
function bnpDRShiftTo(n,r) {
for(var i = n; i < this.t; ++i) r[i-n] = this[i];
r.t = Math.max(this.t-n,0);
r.s = this.s;
}
// (protected) r = this << n
function bnpLShiftTo(n,r) {
var bs = n%this.DB;
var cbs = this.DB-bs;
var bm = (1<<cbs)-1;
var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;
for(i = this.t-1; i >= 0; --i) {
r[i+ds+1] = (this[i]>>cbs)|c;
c = (this[i]&bm)<<bs;
}
for(i = ds-1; i >= 0; --i) r[i] = 0;
r[ds] = c;
r.t = this.t+ds+1;
r.s = this.s;
r.clamp();
}
// (protected) r = this >> n
function bnpRShiftTo(n,r) {
r.s = this.s;
var ds = Math.floor(n/this.DB);
if(ds >= this.t) { r.t = 0; return; }
var bs = n%this.DB;
var cbs = this.DB-bs;
var bm = (1<<bs)-1;
r[0] = this[ds]>>bs;
for(var i = ds+1; i < this.t; ++i) {
r[i-ds-1] |= (this[i]&bm)<<cbs;
r[i-ds] = this[i]>>bs;
}
if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;
r.t = this.t-ds;
r.clamp();
}
// (protected) r = this - a
function bnpSubTo(a,r) {
var i = 0, c = 0, m = Math.min(a.t,this.t);
while(i < m) {
c += this[i]-a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
if(a.t < this.t) {
c -= a.s;
while(i < this.t) {
c += this[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c += this.s;
}
else {
c += this.s;
while(i < a.t) {
c -= a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c -= a.s;
}
r.s = (c<0)?-1:0;
if(c < -1) r[i++] = this.DV+c;
else if(c > 0) r[i++] = c;
r.t = i;
r.clamp();
}
// (protected) r = this * a, r != this,a (HAC 14.12)
// "this" should be the larger one if appropriate.
function bnpMultiplyTo(a,r) {
var x = this.abs(), y = a.abs();
var i = x.t;
r.t = i+y.t;
while(--i >= 0) r[i] = 0;
for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
r.s = 0;
r.clamp();
if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
}
// (protected) r = this^2, r != this (HAC 14.16)
function bnpSquareTo(r) {
var x = this.abs();
var i = r.t = 2*x.t;
while(--i >= 0) r[i] = 0;
for(i = 0; i < x.t-1; ++i) {
var c = x.am(i,x[i],r,2*i,0,1);
if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
r[i+x.t] -= x.DV;
r[i+x.t+1] = 1;
}
}
if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
r.s = 0;
r.clamp();
}
// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
// r != q, this != m. q or r may be null.
function bnpDivRemTo(m,q,r) {
var pm = m.abs();
if(pm.t <= 0) return;
var pt = this.abs();
if(pt.t < pm.t) {
if(q != null) q.fromInt(0);
if(r != null) this.copyTo(r);
return;
}
if(r == null) r = nbi();
var y = nbi(), ts = this.s, ms = m.s;
var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus
if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
else { pm.copyTo(y); pt.copyTo(r); }
var ys = y.t;
var y0 = y[ys-1];
if(y0 == 0) return;
var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);
var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;
var i = r.t, j = i-ys, t = (q==null)?nbi():q;
y.dlShiftTo(j,t);
if(r.compareTo(t) >= 0) {
r[r.t++] = 1;
r.subTo(t,r);
}
BigInteger.ONE.dlShiftTo(ys,t);
t.subTo(y,y); // "negative" y so we can replace sub with am later
while(y.t < ys) y[y.t++] = 0;
while(--j >= 0) {
// Estimate quotient digit
var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
y.dlShiftTo(j,t);
r.subTo(t,r);
while(r[i] < --qd) r.subTo(t,r);
}
}
if(q != null) {
r.drShiftTo(ys,q);
if(ts != ms) BigInteger.ZERO.subTo(q,q);
}
r.t = ys;
r.clamp();
if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
if(ts < 0) BigInteger.ZERO.subTo(r,r);
}
// (public) this mod a
function bnMod(a) {
var r = nbi();
this.abs().divRemTo(a,null,r);
if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
return r;
}
// Modular reduction using "classic" algorithm
function Classic(m) { this.m = m; }
function cConvert(x) {
if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
else return x;
}
function cRevert(x) { return x; }
function cReduce(x) { x.divRemTo(this.m,null,x); }
function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
Classic.prototype.convert = cConvert;
Classic.prototype.revert = cRevert;
Classic.prototype.reduce = cReduce;
Classic.prototype.mulTo = cMulTo;
Classic.prototype.sqrTo = cSqrTo;
// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
// justification:
// xy == 1 (mod m)
// xy = 1+km
// xy(2-xy) = (1+km)(1-km)
// x[y(2-xy)] = 1-k^2m^2
// x[y(2-xy)] == 1 (mod m^2)
// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
// JS multiply "overflows" differently from C/C++, so care is needed here.
function bnpInvDigit() {
if(this.t < 1) return 0;
var x = this[0];
if((x&1) == 0) return 0;
var y = x&3; // y == 1/x mod 2^2
y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
// last step - calculate inverse mod DV directly;
// assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
// we really want the negative inverse, and -DV < y < DV
return (y>0)?this.DV-y:-y;
}
// Montgomery reduction
function Montgomery(m) {
this.m = m;
this.mp = m.invDigit();
this.mpl = this.mp&0x7fff;
this.mph = this.mp>>15;
this.um = (1<<(m.DB-15))-1;
this.mt2 = 2*m.t;
}
// xR mod m
function montConvert(x) {
var r = nbi();
x.abs().dlShiftTo(this.m.t,r);
r.divRemTo(this.m,null,r);
if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
return r;
}
// x/R mod m
function montRevert(x) {
var r = nbi();
x.copyTo(r);
this.reduce(r);
return r;
}
// x = x/R mod m (HAC 14.32)
function montReduce(x) {
while(x.t <= this.mt2) // pad x so am has enough room later
x[x.t++] = 0;
for(var i = 0; i < this.m.t; ++i) {
// faster way of calculating u0 = x[i]*mp mod DV
var j = x[i]&0x7fff;
var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
// use am to combine the multiply-shift-add into one call
j = i+this.m.t;
x[j] += this.m.am(0,u0,x,i,0,this.m.t);
// propagate carry
while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
}
x.clamp();
x.drShiftTo(this.m.t,x);
if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
}
// r = "x^2/R mod m"; x != r
function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
// r = "xy/R mod m"; x,y != r
function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
Montgomery.prototype.convert = montConvert;
Montgomery.prototype.revert = montRevert;
Montgomery.prototype.reduce = montReduce;
Montgomery.prototype.mulTo = montMulTo;
Montgomery.prototype.sqrTo = montSqrTo;
// (protected) true iff this is even
function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
function bnpExp(e,z) {
if(e > 0xffffffff || e < 1) return BigInteger.ONE;
var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
g.copyTo(r);
while(--i >= 0) {
z.sqrTo(r,r2);
if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
else { var t = r; r = r2; r2 = t; }
}
return z.revert(r);
}
// (public) this^e % m, 0 <= e < 2^32
function bnModPowInt(e,m) {
var z;
if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
return this.exp(e,z);
}
// protected
BigInteger.prototype.copyTo = bnpCopyTo;
BigInteger.prototype.fromInt = bnpFromInt;
BigInteger.prototype.fromString = bnpFromString;
BigInteger.prototype.clamp = bnpClamp;
BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
BigInteger.prototype.drShiftTo = bnpDRShiftTo;
BigInteger.prototype.lShiftTo = bnpLShiftTo;
BigInteger.prototype.rShiftTo = bnpRShiftTo;
BigInteger.prototype.subTo = bnpSubTo;
BigInteger.prototype.multiplyTo = bnpMultiplyTo;
BigInteger.prototype.squareTo = bnpSquareTo;
BigInteger.prototype.divRemTo = bnpDivRemTo;
BigInteger.prototype.invDigit = bnpInvDigit;
BigInteger.prototype.isEven = bnpIsEven;
BigInteger.prototype.exp = bnpExp;
// public
BigInteger.prototype.toString = bnToString;
BigInteger.prototype.negate = bnNegate;
BigInteger.prototype.abs = bnAbs;
BigInteger.prototype.compareTo = bnCompareTo;
BigInteger.prototype.bitLength = bnBitLength;
BigInteger.prototype.mod = bnMod;
BigInteger.prototype.modPowInt = bnModPowInt;
// "constants"
BigInteger.ZERO = nbv(0);
BigInteger.ONE = nbv(1);
// Copyright (c) 2005-2009 Tom Wu
// All Rights Reserved.
// See "LICENSE" for details.
// Extended JavaScript BN functions, required for RSA private ops.
// Version 1.1: new BigInteger("0", 10) returns "proper" zero
// Version 1.2: square() API, isProbablePrime fix
// (public)
function bnClone() { var r = nbi(); this.copyTo(r); return r; }
// (public) return value as integer
function bnIntValue() {
if(this.s < 0) {
if(this.t == 1) return this[0]-this.DV;
else if(this.t == 0) return -1;
}
else if(this.t == 1) return this[0];
else if(this.t == 0) return 0;
// assumes 16 < DB < 32
return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];
}
// (public) return value as byte
function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }
// (public) return value as short (assumes DB>=16)
function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }
// (protected) return x s.t. r^x < DV
function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
// (public) 0 if this == 0, 1 if this > 0
function bnSigNum() {
if(this.s < 0) return -1;
else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
else return 1;
}
// (protected) convert to radix string
function bnpToRadix(b) {
if(b == null) b = 10;
if(this.signum() == 0 || b < 2 || b > 36) return "0";
var cs = this.chunkSize(b);
var a = Math.pow(b,cs);
var d = nbv(a), y = nbi(), z = nbi(), r = "";
this.divRemTo(d,y,z);
while(y.signum() > 0) {
r = (a+z.intValue()).toString(b).substr(1) + r;
y.divRemTo(d,y,z);
}
return z.intValue().toString(b) + r;
}
// (protected) convert from radix string
function bnpFromRadix(s,b) {
this.fromInt(0);
if(b == null) b = 10;
var cs = this.chunkSize(b);
var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
for(var i = 0; i < s.length; ++i) {
var x = intAt(s,i);
if(x < 0) {
if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
continue;
}
w = b*w+x;
if(++j >= cs) {
this.dMultiply(d);
this.dAddOffset(w,0);
j = 0;
w = 0;
}
}
if(j > 0) {
this.dMultiply(Math.pow(b,j));
this.dAddOffset(w,0);
}
if(mi) BigInteger.ZERO.subTo(this,this);
}
// (protected) alternate constructor
function bnpFromNumber(a,b,c) {
if("number" == typeof b) {
// new BigInteger(int,int,RNG)
if(a < 2) this.fromInt(1);
else {
this.fromNumber(a,c);
if(!this.testBit(a-1)) // force MSB set
this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
if(this.isEven()) this.dAddOffset(1,0); // force odd
while(!this.isProbablePrime(b)) {
this.dAddOffset(2,0);
if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
}
}
}
else {
// new BigInteger(int,RNG)
var x = new Array(), t = a&7;
x.length = (a>>3)+1;
b.nextBytes(x);
if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
this.fromString(x,256);
}
}
// (public) convert to bigendian byte array
function bnToByteArray() {
var i = this.t, r = new Array();
r[0] = this.s;
var p = this.DB-(i*this.DB)%8, d, k = 0;
if(i-- > 0) {
if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)
r[k++] = d|(this.s<<(this.DB-p));
while(i >= 0) {
if(p < 8) {
d = (this[i]&((1<<p)-1))<<(8-p);
d |= this[--i]>>(p+=this.DB-8);
}
else {
d = (this[i]>>(p-=8))&0xff;
if(p <= 0) { p += this.DB; --i; }
}
if((d&0x80) != 0) d |= -256;
if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;
if(k > 0 || d != this.s) r[k++] = d;
}
}
return r;
}
function bnEquals(a) { return(this.compareTo(a)==0); }
function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
// (protected) r = this op a (bitwise)
function bnpBitwiseTo(a,op,r) {
var i, f, m = Math.min(a.t,this.t);
for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);
if(a.t < this.t) {
f = a.s&this.DM;
for(i = m; i < this.t; ++i) r[i] = op(this[i],f);
r.t = this.t;
}
else {
f = this.s&this.DM;
for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);
r.t = a.t;
}
r.s = op(this.s,a.s);
r.clamp();
}
// (public) this & a
function op_and(x,y) { return x&y; }
function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
// (public) this | a
function op_or(x,y) { return x|y; }
function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
// (public) this ^ a
function op_xor(x,y) { return x^y; }
function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
// (public) this & ~a
function op_andnot(x,y) { return x&~y; }
function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
// (public) ~this
function bnNot() {
var r = nbi();
for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];
r.t = this.t;
r.s = ~this.s;
return r;
}
// (public) this << n
function bnShiftLeft(n) {
var r = nbi();
if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
return r;
}
// (public) this >> n
function bnShiftRight(n) {
var r = nbi();
if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
return r;
}
// return index of lowest 1-bit in x, x < 2^31
function lbit(x) {
if(x == 0) return -1;
var r = 0;
if((x&0xffff) == 0) { x >>= 16; r += 16; }
if((x&0xff) == 0) { x >>= 8; r += 8; }
if((x&0xf) == 0) { x >>= 4; r += 4; }
if((x&3) == 0) { x >>= 2; r += 2; }
if((x&1) == 0) ++r;
return r;
}
// (public) returns index of lowest 1-bit (or -1 if none)
function bnGetLowestSetBit() {
for(var i = 0; i < this.t; ++i)
if(this[i] != 0) return i*this.DB+lbit(this[i]);
if(this.s < 0) return this.t*this.DB;
return -1;
}
// return number of 1 bits in x
function cbit(x) {
var r = 0;
while(x != 0) { x &= x-1; ++r; }
return r;
}
// (public) return number of set bits
function bnBitCount() {
var r = 0, x = this.s&this.DM;
for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);
return r;
}
// (public) true iff nth bit is set
function bnTestBit(n) {
var j = Math.floor(n/this.DB);
if(j >= this.t) return(this.s!=0);
return((this[j]&(1<<(n%this.DB)))!=0);
}
// (protected) this op (1<<n)
function bnpChangeBit(n,op) {
var r = BigInteger.ONE.shiftLeft(n);
this.bitwiseTo(r,op,r);
return r;
}
// (public) this | (1<<n)
function bnSetBit(n) { return this.changeBit(n,op_or); }
// (public) this & ~(1<<n)
function bnClearBit(n) { return this.changeBit(n,op_andnot); }
// (public) this ^ (1<<n)
function bnFlipBit(n) { return this.changeBit(n,op_xor); }
// (protected) r = this + a
function bnpAddTo(a,r) {
var i = 0, c = 0, m = Math.min(a.t,this.t);
while(i < m) {
c += this[i]+a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
if(a.t < this.t) {
c += a.s;
while(i < this.t) {
c += this[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c += this.s;
}
else {
c += this.s;
while(i < a.t) {
c += a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c += a.s;
}
r.s = (c<0)?-1:0;
if(c > 0) r[i++] = c;
else if(c < -1) r[i++] = this.DV+c;
r.t = i;
r.clamp();
}
// (public) this + a
function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
// (public) this - a
function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
// (public) this * a
function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
// (public) this^2
function bnSquare() { var r = nbi(); this.squareTo(r); return r; }
// (public) this / a
function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
// (public) this % a
function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
// (public) [this/a,this%a]
function bnDivideAndRemainder(a) {
var q = nbi(), r = nbi();
this.divRemTo(a,q,r);
return new Array(q,r);
}
// (protected) this *= n, this >= 0, 1 < n < DV
function bnpDMultiply(n) {
this[this.t] = this.am(0,n-1,this,0,0,this.t);
++this.t;
this.clamp();
}
// (protected) this += n << w words, this >= 0
function bnpDAddOffset(n,w) {
if(n == 0) return;
while(this.t <= w) this[this.t++] = 0;
this[w] += n;
while(this[w] >= this.DV) {
this[w] -= this.DV;
if(++w >= this.t) this[this.t++] = 0;
++this[w];
}
}
// A "null" reducer
function NullExp() {}
function nNop(x) { return x; }
function nMulTo(x,y,r) { x.multiplyTo(y,r); }
function nSqrTo(x,r) { x.squareTo(r); }
NullExp.prototype.convert = nNop;
NullExp.prototype.revert = nNop;
NullExp.prototype.mulTo = nMulTo;
NullExp.prototype.sqrTo = nSqrTo;
// (public) this^e
function bnPow(e) { return this.exp(e,new NullExp()); }
// (protected) r = lower n words of "this * a", a.t <= n
// "this" should be the larger one if appropriate.
function bnpMultiplyLowerTo(a,n,r) {
var i = Math.min(this.t+a.t,n);
r.s = 0; // assumes a,this >= 0
r.t = i;
while(i > 0) r[--i] = 0;
var j;
for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);
for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);
r.clamp();
}
// (protected) r = "this * a" without lower n words, n > 0
// "this" should be the larger one if appropriate.
function bnpMultiplyUpperTo(a,n,r) {
--n;
var i = r.t = this.t+a.t-n;
r.s = 0; // assumes a,this >= 0
while(--i >= 0) r[i] = 0;
for(i = Math.max(n-this.t,0); i < a.t; ++i)
r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);
r.clamp();
r.drShiftTo(1,r);
}
// Barrett modular reduction
function Barrett(m) {
// setup Barrett
this.r2 = nbi();
this.q3 = nbi();
BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
this.mu = this.r2.divide(m);
this.m = m;
}
function barrettConvert(x) {
if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
else if(x.compareTo(this.m) < 0) return x;
else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
}
function barrettRevert(x) { return x; }
// x = x mod m (HAC 14.42)
function barrettReduce(x) {
x.drShiftTo(this.m.t-1,this.r2);
if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
x.subTo(this.r2,x);
while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
}
// r = x^2 mod m; x != r
function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
// r = x*y mod m; x,y != r
function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
Barrett.prototype.convert = barrettConvert;
Barrett.prototype.revert = barrettRevert;
Barrett.prototype.reduce = barrettReduce;
Barrett.prototype.mulTo = barrettMulTo;
Barrett.prototype.sqrTo = barrettSqrTo;
// (public) this^e % m (HAC 14.85)
function bnModPow(e,m) {
var i = e.bitLength(), k, r = nbv(1), z;
if(i <= 0) return r;
else if(i < 18) k = 1;
else if(i < 48) k = 3;
else if(i < 144) k = 4;
else if(i < 768) k = 5;
else k = 6;
if(i < 8)
z = new Classic(m);
else if(m.isEven())
z = new Barrett(m);
else
z = new Montgomery(m);
// precomputation
var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;
g[1] = z.convert(this);
if(k > 1) {
var g2 = nbi();
z.sqrTo(g[1],g2);
while(n <= km) {
g[n] = nbi();
z.mulTo(g2,g[n-2],g[n]);
n += 2;
}
}
var j = e.t-1, w, is1 = true, r2 = nbi(), t;
i = nbits(e[j])-1;
while(j >= 0) {
if(i >= k1) w = (e[j]>>(i-k1))&km;
else {
w = (e[j]&((1<<(i+1))-1))<<(k1-i);
if(j > 0) w |= e[j-1]>>(this.DB+i-k1);
}
n = k;
while((w&1) == 0) { w >>= 1; --n; }
if((i -= n) < 0) { i += this.DB; --j; }
if(is1) { // ret == 1, don't bother squaring or multiplying it
g[w].copyTo(r);
is1 = false;
}
else {
while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
z.mulTo(r2,g[w],r);
}
while(j >= 0 && (e[j]&(1<<i)) == 0) {
z.sqrTo(r,r2); t = r; r = r2; r2 = t;
if(--i < 0) { i = this.DB-1; --j; }
}
}
return z.revert(r);
}
// (public) gcd(this,a) (HAC 14.54)
function bnGCD(a) {
var x = (this.s<0)?this.negate():this.clone();
var y = (a.s<0)?a.negate():a.clone();
if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }
var i = x.getLowestSetBit(), g = y.getLowestSetBit();
if(g < 0) return x;
if(i < g) g = i;
if(g > 0) {
x.rShiftTo(g,x);
y.rShiftTo(g,y);
}
while(x.signum() > 0) {
if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
if(x.compareTo(y) >= 0) {
x.subTo(y,x);
x.rShiftTo(1,x);
}
else {
y.subTo(x,y);
y.rShiftTo(1,y);
}
}
if(g > 0) y.lShiftTo(g,y);
return y;
}
// (protected) this % n, n < 2^26
function bnpModInt(n) {
if(n <= 0) return 0;
var d = this.DV%n, r = (this.s<0)?n-1:0;
if(this.t > 0)
if(d == 0) r = this[0]%n;
else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;
return r;
}
// (public) 1/this % m (HAC 14.61)
function bnModInverse(m) {
var ac = m.isEven();
if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
var u = m.clone(), v = this.clone();
var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
while(u.signum() != 0) {
while(u.isEven()) {
u.rShiftTo(1,u);
if(ac) {
if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
a.rShiftTo(1,a);
}
else if(!b.isEven()) b.subTo(m,b);
b.rShiftTo(1,b);
}
while(v.isEven()) {
v.rShiftTo(1,v);
if(ac) {
if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
c.rShiftTo(1,c);
}
else if(!d.isEven()) d.subTo(m,d);
d.rShiftTo(1,d);
}
if(u.compareTo(v) >= 0) {
u.subTo(v,u);
if(ac) a.subTo(c,a);
b.subTo(d,b);
}
else {
v.subTo(u,v);
if(ac) c.subTo(a,c);
d.subTo(b,d);
}
}
if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
if(d.compareTo(m) >= 0) return d.subtract(m);
if(d.signum() < 0) d.addTo(m,d); else return d;
if(d.signum() < 0) return d.add(m); else return d;
}
var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
var lplim = (1<<26)/lowprimes[lowprimes.length-1];
// (public) test primality with certainty >= 1-.5^t
function bnIsProbablePrime(t) {
var i, x = this.abs();
if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {
for(i = 0; i < lowprimes.length; ++i)
if(x[0] == lowprimes[i]) return true;
return false;
}
if(x.isEven()) return false;
i = 1;
while(i < lowprimes.length) {
var m = lowprimes[i], j = i+1;
while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];
m = x.modInt(m);
while(i < j) if(m%lowprimes[i++] == 0) return false;
}
return x.millerRabin(t);
}
// (protected) true if probably prime (HAC 4.24, Miller-Rabin)
function bnpMillerRabin(t) {
var n1 = this.subtract(BigInteger.ONE);
var k = n1.getLowestSetBit();
if(k <= 0) return false;
var r = n1.shiftRight(k);
t = (t+1)>>1;
if(t > lowprimes.length) t = lowprimes.length;
var a = nbi();
for(var i = 0; i < t; ++i) {
//Pick bases at random, instead of starting at 2
a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);
var y = a.modPow(r,this);
if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
var j = 1;
while(j++ < k && y.compareTo(n1) != 0) {
y = y.modPowInt(2,this);
if(y.compareTo(BigInteger.ONE) == 0) return false;
}
if(y.compareTo(n1) != 0) return false;
}
}
return true;
}
// protected
BigInteger.prototype.chunkSize = bnpChunkSize;
BigInteger.prototype.toRadix = bnpToRadix;
BigInteger.prototype.fromRadix = bnpFromRadix;
BigInteger.prototype.fromNumber = bnpFromNumber;
BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
BigInteger.prototype.changeBit = bnpChangeBit;
BigInteger.prototype.addTo = bnpAddTo;
BigInteger.prototype.dMultiply = bnpDMultiply;
BigInteger.prototype.dAddOffset = bnpDAddOffset;
BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
BigInteger.prototype.modInt = bnpModInt;
BigInteger.prototype.millerRabin = bnpMillerRabin;
// public
BigInteger.prototype.clone = bnClone;
BigInteger.prototype.intValue = bnIntValue;
BigInteger.prototype.byteValue = bnByteValue;
BigInteger.prototype.shortValue = bnShortValue;
BigInteger.prototype.signum = bnSigNum;
BigInteger.prototype.toByteArray = bnToByteArray;
BigInteger.prototype.equals = bnEquals;
BigInteger.prototype.min = bnMin;
BigInteger.prototype.max = bnMax;
BigInteger.prototype.and = bnAnd;
BigInteger.prototype.or = bnOr;
BigInteger.prototype.xor = bnXor;
BigInteger.prototype.andNot = bnAndNot;
BigInteger.prototype.not = bnNot;
BigInteger.prototype.shiftLeft = bnShiftLeft;
BigInteger.prototype.shiftRight = bnShiftRight;
BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
BigInteger.prototype.bitCount = bnBitCount;
BigInteger.prototype.testBit = bnTestBit;
BigInteger.prototype.setBit = bnSetBit;
BigInteger.prototype.clearBit = bnClearBit;
BigInteger.prototype.flipBit = bnFlipBit;
BigInteger.prototype.add = bnAdd;
BigInteger.prototype.subtract = bnSubtract;
BigInteger.prototype.multiply = bnMultiply;
BigInteger.prototype.divide = bnDivide;
BigInteger.prototype.remainder = bnRemainder;
BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
BigInteger.prototype.modPow = bnModPow;
BigInteger.prototype.modInverse = bnModInverse;
BigInteger.prototype.pow = bnPow;
BigInteger.prototype.gcd = bnGCD;
BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
// JSBN-specific extension
BigInteger.prototype.square = bnSquare;
// Expose the Barrett function
BigInteger.prototype.Barrett = Barrett
// BigInteger interfaces not implemented in jsbn:
// BigInteger(int signum, byte[] magnitude)
// double doubleValue()
// float floatValue()
// int hashCode()
// long longValue()
// static BigInteger valueOf(long val)
// Random number generator - requires a PRNG backend, e.g. prng4.js
// For best results, put code like
// <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
// in your main HTML document.
var rng_state;
var rng_pool;
var rng_pptr;
// Mix in a 32-bit integer into the pool
function rng_seed_int(x) {
rng_pool[rng_pptr++] ^= x & 255;
rng_pool[rng_pptr++] ^= (x >> 8) & 255;
rng_pool[rng_pptr++] ^= (x >> 16) & 255;
rng_pool[rng_pptr++] ^= (x >> 24) & 255;
if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
}
// Mix in the current time (w/milliseconds) into the pool
function rng_seed_time() {
rng_seed_int(new Date().getTime());
}
// Initialize the pool with junk if needed.
if(rng_pool == null) {
rng_pool = new Array();
rng_pptr = 0;
var t;
if(typeof window !== "undefined" && window.crypto) {
if (window.crypto.getRandomValues) {
// Use webcrypto if available
var ua = new Uint8Array(32);
window.crypto.getRandomValues(ua);
for(t = 0; t < 32; ++t)
rng_pool[rng_pptr++] = ua[t];
}
else if(navigator.appName == "Netscape" && navigator.appVersion < "5") {
// Extract entropy (256 bits) from NS4 RNG if available
var z = window.crypto.random(32);
for(t = 0; t < z.length; ++t)
rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
}
}
while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
t = Math.floor(65536 * Math.random());
rng_pool[rng_pptr++] = t >>> 8;
rng_pool[rng_pptr++] = t & 255;
}
rng_pptr = 0;
rng_seed_time();
//rng_seed_int(window.screenX);
//rng_seed_int(window.screenY);
}
function rng_get_byte() {
if(rng_state == null) {
rng_seed_time();
rng_state = prng_newstate();
rng_state.init(rng_pool);
for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
rng_pool[rng_pptr] = 0;
rng_pptr = 0;
//rng_pool = null;
}
// TODO: allow reseeding after first request
return rng_state.next();
}
function rng_get_bytes(ba) {
var i;
for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
}
function SecureRandom() {}
SecureRandom.prototype.nextBytes = rng_get_bytes;
// prng4.js - uses Arcfour as a PRNG
function Arcfour() {
this.i = 0;
this.j = 0;
this.S = new Array();
}
// Initialize arcfour context from key, an array of ints, each from [0..255]
function ARC4init(key) {
var i, j, t;
for(i = 0; i < 256; ++i)
this.S[i] = i;
j = 0;
for(i = 0; i < 256; ++i) {
j = (j + this.S[i] + key[i % key.length]) & 255;
t = this.S[i];
this.S[i] = this.S[j];
this.S[j] = t;
}
this.i = 0;
this.j = 0;
}
function ARC4next() {
var t;
this.i = (this.i + 1) & 255;
this.j = (this.j + this.S[this.i]) & 255;
t = this.S[this.i];
this.S[this.i] = this.S[this.j];
this.S[this.j] = t;
return this.S[(t + this.S[this.i]) & 255];
}
Arcfour.prototype.init = ARC4init;
Arcfour.prototype.next = ARC4next;
// Plug in your RNG constructor here
function prng_newstate() {
return new Arcfour();
}
// Pool size must be a multiple of 4 and greater than 32.
// An array of bytes the size of the pool will be passed to init()
var rng_psize = 256;
if (typeof exports !== 'undefined') {
exports = module.exports = {
default: BigInteger,
BigInteger: BigInteger,
SecureRandom: SecureRandom,
};
} else {
this.jsbn = {
BigInteger: BigInteger,
SecureRandom: SecureRandom
};
}
}).call(this);
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1586229640084);
})()
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["(function(){\n\n // Copyright (c) 2005 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Basic JavaScript BN library - subset useful for RSA encryption.\n\n // Bits per digit\n var dbits;\n\n // JavaScript engine analysis\n var canary = 0xdeadbeefcafe;\n var j_lm = ((canary&0xffffff)==0xefcafe);\n\n // (public) Constructor\n function BigInteger(a,b,c) {\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n }\n\n // return new, unset BigInteger\n function nbi() { return new BigInteger(null); }\n\n // am: Compute w_j += (x*this_i), propagate carries,\n // c is initial carry, returns final carry.\n // c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n // We need to select the fastest one that works in this environment.\n\n // am1: use a single mult and divide to get the high bits,\n // max digit bits should be 26 because\n // max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n }\n // am2 avoids a big mult-and-extract completely.\n // Max digit bits should be <= 30 because we do bitwise ops\n // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }\n // Alternately, set max digit bits to 28 since some\n // browsers slow down when dealing with 32-bit numbers.\n function am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n }\n var inBrowser = typeof navigator !== \"undefined\";\n if(inBrowser && j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n }\n else if(inBrowser && j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n }\n else { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n }\n\n BigInteger.prototype.DB = dbits;\n BigInteger.prototype.DM = ((1<<dbits)-1);\n BigInteger.prototype.DV = (1<<dbits);\n\n var BI_FP = 52;\n BigInteger.prototype.FV = Math.pow(2,BI_FP);\n BigInteger.prototype.F1 = BI_FP-dbits;\n BigInteger.prototype.F2 = 2*dbits-BI_FP;\n\n // Digit conversions\n var BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n var BI_RC = new Array();\n var rr,vv;\n rr = \"0\".charCodeAt(0);\n for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;\n rr = \"a\".charCodeAt(0);\n for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n rr = \"A\".charCodeAt(0);\n for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n\n function int2char(n) { return BI_RM.charAt(n); }\n function intAt(s,i) {\n var c = BI_RC[s.charCodeAt(i)];\n return (c==null)?-1:c;\n }\n\n // (protected) copy this to r\n function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }\n\n // (protected) set from integer value x, -DV <= x < DV\n function bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this[0] = x;\n else if(x < -1) this[0] = x+this.DV;\n else this.t = 0;\n }\n\n // return bigint initialized to value\n function nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n // (protected) set from string and radix\n function bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this[this.t++] = x;\n else if(sh+k > this.DB) {\n this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;\n this[this.t++] = (x>>(this.DB-sh));\n }\n else\n this[this.t-1] |= x<<sh;\n sh += k;\n if(sh >= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;\n }\n this.clamp();\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) clamp off excess high words\n function bnpClamp() {\n var c = this.s&this.DM;\n while(this.t > 0 && this[this.t-1] == c) --this.t;\n }\n\n // (public) return string representation in given radix\n function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }\n\n // (public) -this\n function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n // (public) |this|\n function bnAbs() { return (this.s<0)?this.negate():this; }\n\n // (public) return + if this > a, - if this < a, 0 if equal\n function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }\n\n // returns bit length of the integer x\n function nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n }\n\n // (public) return the number of bits in \"this\"\n function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }\n\n // (protected) r = this << n*DB\n function bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n for(i = n-1; i >= 0; --i) r[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n }\n\n // (protected) r = this >> n*DB\n function bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n }\n\n // (protected) r = this << n\n function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<cbs)-1;\n var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n for(i = this.t-1; i >= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<<bs;\n }\n for(i = ds-1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }\n\n // (protected) r = this >> n\n function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }\n\n // (protected) r = this - a\n function bnpSubTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]-a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c -= a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r[i++] = this.DV+c;\n else if(c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n }\n\n // (protected) r = this * a, r != this,a (HAC 14.12)\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n }\n\n // (protected) r = this^2, r != this (HAC 14.16)\n function bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x[i],r,2*i,0,1);\n if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r[i+x.t] -= x.DV;\n r[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n }\n\n // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n // r != q, this != m. q or r may be null.\n function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }\n\n // (public) this mod a\n function bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n }\n\n // Modular reduction using \"classic\" algorithm\n function Classic(m) { this.m = m; }\n function cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n }\n function cRevert(x) { return x; }\n function cReduce(x) { x.divRemTo(this.m,null,x); }\n function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n Classic.prototype.convert = cConvert;\n Classic.prototype.revert = cRevert;\n Classic.prototype.reduce = cReduce;\n Classic.prototype.mulTo = cMulTo;\n Classic.prototype.sqrTo = cSqrTo;\n\n // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n // justification:\n // xy == 1 (mod m)\n // xy = 1+km\n // xy(2-xy) = (1+km)(1-km)\n // x[y(2-xy)] = 1-k^2m^2\n // x[y(2-xy)] == 1 (mod m^2)\n // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n // JS multiply \"overflows\" differently from C/C++, so care is needed here.\n function bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this[0];\n if((x&1) == 0) return 0;\n var y = x&3; // y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n }\n\n // Montgomery reduction\n function Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n }\n\n // xR mod m\n function montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n }\n\n // x/R mod m\n function montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n }\n\n // x = x/R mod m (HAC 14.32)\n function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = \"x^2/R mod m\"; x != r\n function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = \"xy/R mod m\"; x,y != r\n function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Montgomery.prototype.convert = montConvert;\n Montgomery.prototype.revert = montRevert;\n Montgomery.prototype.reduce = montReduce;\n Montgomery.prototype.mulTo = montMulTo;\n Montgomery.prototype.sqrTo = montSqrTo;\n\n // (protected) true iff this is even\n function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\n // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\n function bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1<<i)) > 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n }\n\n // (public) this^e % m, 0 <= e < 2^32\n function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }\n\n // protected\n BigInteger.prototype.copyTo = bnpCopyTo;\n BigInteger.prototype.fromInt = bnpFromInt;\n BigInteger.prototype.fromString = bnpFromString;\n BigInteger.prototype.clamp = bnpClamp;\n BigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n BigInteger.prototype.drShiftTo = bnpDRShiftTo;\n BigInteger.prototype.lShiftTo = bnpLShiftTo;\n BigInteger.prototype.rShiftTo = bnpRShiftTo;\n BigInteger.prototype.subTo = bnpSubTo;\n BigInteger.prototype.multiplyTo = bnpMultiplyTo;\n BigInteger.prototype.squareTo = bnpSquareTo;\n BigInteger.prototype.divRemTo = bnpDivRemTo;\n BigInteger.prototype.invDigit = bnpInvDigit;\n BigInteger.prototype.isEven = bnpIsEven;\n BigInteger.prototype.exp = bnpExp;\n\n // public\n BigInteger.prototype.toString = bnToString;\n BigInteger.prototype.negate = bnNegate;\n BigInteger.prototype.abs = bnAbs;\n BigInteger.prototype.compareTo = bnCompareTo;\n BigInteger.prototype.bitLength = bnBitLength;\n BigInteger.prototype.mod = bnMod;\n BigInteger.prototype.modPowInt = bnModPowInt;\n\n // \"constants\"\n BigInteger.ZERO = nbv(0);\n BigInteger.ONE = nbv(1);\n\n // Copyright (c) 2005-2009 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Extended JavaScript BN functions, required for RSA private ops.\n\n // Version 1.1: new BigInteger(\"0\", 10) returns \"proper\" zero\n // Version 1.2: square() API, isProbablePrime fix\n\n // (public)\n function bnClone() { var r = nbi(); this.copyTo(r); return r; }\n\n // (public) return value as integer\n function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }\n\n // (public) return value as byte\n function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }\n\n // (public) return value as short (assumes DB>=16)\n function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }\n\n // (protected) return x s.t. r^x < DV\n function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n // (public) 0 if this == 0, 1 if this > 0\n function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n }\n\n // (protected) convert to radix string\n function bnpToRadix(b) {\n if(b == null) b = 10;\n if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b,cs);\n var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n this.divRemTo(d,y,z);\n while(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n }\n return z.intValue().toString(b) + r;\n }\n\n // (protected) convert from radix string\n function bnpFromRadix(s,b) {\n this.fromInt(0);\n if(b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n for(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n }\n if(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n }\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) alternate constructor\n function bnpFromNumber(a,b,c) {\n if(\"number\" == typeof b) {\n // new BigInteger(int,int,RNG)\n if(a < 2) this.fromInt(1);\n else {\n this.fromNumber(a,c);\n if(!this.testBit(a-1)) // force MSB set\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n if(this.isEven()) this.dAddOffset(1,0); // force odd\n while(!this.isProbablePrime(b)) {\n this.dAddOffset(2,0);\n if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);\n }\n }\n }\n else {\n // new BigInteger(int,RNG)\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;\n this.fromString(x,256);\n }\n }\n\n // (public) convert to bigendian byte array\n function bnToByteArray() {\n var i = this.t, r = new Array();\n r[0] = this.s;\n var p = this.DB-(i*this.DB)%8, d, k = 0;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)\n r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n if(p < 8) {\n d = (this[i]&((1<<p)-1))<<(8-p);\n d |= this[--i]>>(p+=this.DB-8);\n }\n else {\n d = (this[i]>>(p-=8))&0xff;\n if(p <= 0) { p += this.DB; --i; }\n }\n if((d&0x80) != 0) d |= -256;\n if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n if(k > 0 || d != this.s) r[k++] = d;\n }\n }\n return r;\n }\n\n function bnEquals(a) { return(this.compareTo(a)==0); }\n function bnMin(a) { return(this.compareTo(a)<0)?this:a; }\n function bnMax(a) { return(this.compareTo(a)>0)?this:a; }\n\n // (protected) r = this op a (bitwise)\n function bnpBitwiseTo(a,op,r) {\n var i, f, m = Math.min(a.t,this.t);\n for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);\n if(a.t < this.t) {\n f = a.s&this.DM;\n for(i = m; i < this.t; ++i) r[i] = op(this[i],f);\n r.t = this.t;\n }\n else {\n f = this.s&this.DM;\n for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);\n r.t = a.t;\n }\n r.s = op(this.s,a.s);\n r.clamp();\n }\n\n // (public) this & a\n function op_and(x,y) { return x&y; }\n function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }\n\n // (public) this | a\n function op_or(x,y) { return x|y; }\n function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }\n\n // (public) this ^ a\n function op_xor(x,y) { return x^y; }\n function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }\n\n // (public) this & ~a\n function op_andnot(x,y) { return x&~y; }\n function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }\n\n // (public) ~this\n function bnNot() {\n var r = nbi();\n for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];\n r.t = this.t;\n r.s = ~this.s;\n return r;\n }\n\n // (public) this << n\n function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }\n\n // (public) this >> n\n function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }\n\n // return index of lowest 1-bit in x, x < 2^31\n function lbit(x) {\n if(x == 0) return -1;\n var r = 0;\n if((x&0xffff) == 0) { x >>= 16; r += 16; }\n if((x&0xff) == 0) { x >>= 8; r += 8; }\n if((x&0xf) == 0) { x >>= 4; r += 4; }\n if((x&3) == 0) { x >>= 2; r += 2; }\n if((x&1) == 0) ++r;\n return r;\n }\n\n // (public) returns index of lowest 1-bit (or -1 if none)\n function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }\n\n // return number of 1 bits in x\n function cbit(x) {\n var r = 0;\n while(x != 0) { x &= x-1; ++r; }\n return r;\n }\n\n // (public) return number of set bits\n function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }\n\n // (public) true iff nth bit is set\n function bnTestBit(n) {\n var j = Math.floor(n/this.DB);\n if(j >= this.t) return(this.s!=0);\n return((this[j]&(1<<(n%this.DB)))!=0);\n }\n\n // (protected) this op (1<<n)\n function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }\n\n // (public) this | (1<<n)\n function bnSetBit(n) { return this.changeBit(n,op_or); }\n\n // (public) this & ~(1<<n)\n function bnClearBit(n) { return this.changeBit(n,op_andnot); }\n\n // (public) this ^ (1<<n)\n function bnFlipBit(n) { return this.changeBit(n,op_xor); }\n\n // (protected) r = this + a\n function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }\n\n // (public) this + a\n function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }\n\n // (public) this - a\n function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }\n\n // (public) this * a\n function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }\n\n // (public) this^2\n function bnSquare() { var r = nbi(); this.squareTo(r); return r; }\n\n // (public) this / a\n function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }\n\n // (public) this % a\n function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }\n\n // (public) [this/a,this%a]\n function bnDivideAndRemainder(a) {\n var q = nbi(), r = nbi();\n this.divRemTo(a,q,r);\n return new Array(q,r);\n }\n\n // (protected) this *= n, this >= 0, 1 < n < DV\n function bnpDMultiply(n) {\n this[this.t] = this.am(0,n-1,this,0,0,this.t);\n ++this.t;\n this.clamp();\n }\n\n // (protected) this += n << w words, this >= 0\n function bnpDAddOffset(n,w) {\n if(n == 0) return;\n while(this.t <= w) this[this.t++] = 0;\n this[w] += n;\n while(this[w] >= this.DV) {\n this[w] -= this.DV;\n if(++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n }\n\n // A \"null\" reducer\n function NullExp() {}\n function nNop(x) { return x; }\n function nMulTo(x,y,r) { x.multiplyTo(y,r); }\n function nSqrTo(x,r) { x.squareTo(r); }\n\n NullExp.prototype.convert = nNop;\n NullExp.prototype.revert = nNop;\n NullExp.prototype.mulTo = nMulTo;\n NullExp.prototype.sqrTo = nSqrTo;\n\n // (public) this^e\n function bnPow(e) { return this.exp(e,new NullExp()); }\n\n // (protected) r = lower n words of \"this * a\", a.t <= n\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyLowerTo(a,n,r) {\n var i = Math.min(this.t+a.t,n);\n r.s = 0; // assumes a,this >= 0\n r.t = i;\n while(i > 0) r[--i] = 0;\n var j;\n for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);\n for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);\n r.clamp();\n }\n\n // (protected) r = \"this * a\" without lower n words, n > 0\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyUpperTo(a,n,r) {\n --n;\n var i = r.t = this.t+a.t-n;\n r.s = 0; // assumes a,this >= 0\n while(--i >= 0) r[i] = 0;\n for(i = Math.max(n-this.t,0); i < a.t; ++i)\n r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);\n r.clamp();\n r.drShiftTo(1,r);\n }\n\n // Barrett modular reduction\n function Barrett(m) {\n // setup Barrett\n this.r2 = nbi();\n this.q3 = nbi();\n BigInteger.ONE.dlShiftTo(2*m.t,this.r2);\n this.mu = this.r2.divide(m);\n this.m = m;\n }\n\n function barrettConvert(x) {\n if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);\n else if(x.compareTo(this.m) < 0) return x;\n else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }\n }\n\n function barrettRevert(x) { return x; }\n\n // x = x mod m (HAC 14.42)\n function barrettReduce(x) {\n x.drShiftTo(this.m.t-1,this.r2);\n if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }\n this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);\n this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);\n while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);\n x.subTo(this.r2,x);\n while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = x^2 mod m; x != r\n function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = x*y mod m; x,y != r\n function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Barrett.prototype.convert = barrettConvert;\n Barrett.prototype.revert = barrettRevert;\n Barrett.prototype.reduce = barrettReduce;\n Barrett.prototype.mulTo = barrettMulTo;\n Barrett.prototype.sqrTo = barrettSqrTo;\n\n // (public) this^e % m (HAC 14.85)\n function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }\n\n // (public) gcd(this,a) (HAC 14.54)\n function bnGCD(a) {\n var x = (this.s<0)?this.negate():this.clone();\n var y = (a.s<0)?a.negate():a.clone();\n if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\n var i = x.getLowestSetBit(), g = y.getLowestSetBit();\n if(g < 0) return x;\n if(i < g) g = i;\n if(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n }\n\n // (protected) this % n, n < 2^26\n function bnpModInt(n) {\n if(n <= 0) return 0;\n var d = this.DV%n, r = (this.s<0)?n-1:0;\n if(this.t > 0)\n if(d == 0) r = this[0]%n;\n else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;\n return r;\n }\n\n // (public) 1/this % m (HAC 14.61)\n function bnModInverse(m) {\n var ac = m.isEven();\n if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\n var u = m.clone(), v = this.clone();\n var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);\n while(u.signum() != 0) {\n while(u.isEven()) {\n u.rShiftTo(1,u);\n if(ac) {\n if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }\n a.rShiftTo(1,a);\n }\n else if(!b.isEven()) b.subTo(m,b);\n b.rShiftTo(1,b);\n }\n while(v.isEven()) {\n v.rShiftTo(1,v);\n if(ac) {\n if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }\n c.rShiftTo(1,c);\n }\n else if(!d.isEven()) d.subTo(m,d);\n d.rShiftTo(1,d);\n }\n if(u.compareTo(v) >= 0) {\n u.subTo(v,u);\n if(ac) a.subTo(c,a);\n b.subTo(d,b);\n }\n else {\n v.subTo(u,v);\n if(ac) c.subTo(a,c);\n d.subTo(b,d);\n }\n }\n if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\n if(d.compareTo(m) >= 0) return d.subtract(m);\n if(d.signum() < 0) d.addTo(m,d); else return d;\n if(d.signum() < 0) return d.add(m); else return d;\n }\n\n var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];\n var lplim = (1<<26)/lowprimes[lowprimes.length-1];\n\n // (public) test primality with certainty >= 1-.5^t\n function bnIsProbablePrime(t) {\n var i, x = this.abs();\n if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {\n for(i = 0; i < lowprimes.length; ++i)\n if(x[0] == lowprimes[i]) return true;\n return false;\n }\n if(x.isEven()) return false;\n i = 1;\n while(i < lowprimes.length) {\n var m = lowprimes[i], j = i+1;\n while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];\n m = x.modInt(m);\n while(i < j) if(m%lowprimes[i++] == 0) return false;\n }\n return x.millerRabin(t);\n }\n\n // (protected) true if probably prime (HAC 4.24, Miller-Rabin)\n function bnpMillerRabin(t) {\n var n1 = this.subtract(BigInteger.ONE);\n var k = n1.getLowestSetBit();\n if(k <= 0) return false;\n var r = n1.shiftRight(k);\n t = (t+1)>>1;\n if(t > lowprimes.length) t = lowprimes.length;\n var a = nbi();\n for(var i = 0; i < t; ++i) {\n //Pick bases at random, instead of starting at 2\n a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);\n var y = a.modPow(r,this);\n if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n var j = 1;\n while(j++ < k && y.compareTo(n1) != 0) {\n y = y.modPowInt(2,this);\n if(y.compareTo(BigInteger.ONE) == 0) return false;\n }\n if(y.compareTo(n1) != 0) return false;\n }\n }\n return true;\n }\n\n // protected\n BigInteger.prototype.chunkSize = bnpChunkSize;\n BigInteger.prototype.toRadix = bnpToRadix;\n BigInteger.prototype.fromRadix = bnpFromRadix;\n BigInteger.prototype.fromNumber = bnpFromNumber;\n BigInteger.prototype.bitwiseTo = bnpBitwiseTo;\n BigInteger.prototype.changeBit = bnpChangeBit;\n BigInteger.prototype.addTo = bnpAddTo;\n BigInteger.prototype.dMultiply = bnpDMultiply;\n BigInteger.prototype.dAddOffset = bnpDAddOffset;\n BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\n BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\n BigInteger.prototype.modInt = bnpModInt;\n BigInteger.prototype.millerRabin = bnpMillerRabin;\n\n // public\n BigInteger.prototype.clone = bnClone;\n BigInteger.prototype.intValue = bnIntValue;\n BigInteger.prototype.byteValue = bnByteValue;\n BigInteger.prototype.shortValue = bnShortValue;\n BigInteger.prototype.signum = bnSigNum;\n BigInteger.prototype.toByteArray = bnToByteArray;\n BigInteger.prototype.equals = bnEquals;\n BigInteger.prototype.min = bnMin;\n BigInteger.prototype.max = bnMax;\n BigInteger.prototype.and = bnAnd;\n BigInteger.prototype.or = bnOr;\n BigInteger.prototype.xor = bnXor;\n BigInteger.prototype.andNot = bnAndNot;\n BigInteger.prototype.not = bnNot;\n BigInteger.prototype.shiftLeft = bnShiftLeft;\n BigInteger.prototype.shiftRight = bnShiftRight;\n BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\n BigInteger.prototype.bitCount = bnBitCount;\n BigInteger.prototype.testBit = bnTestBit;\n BigInteger.prototype.setBit = bnSetBit;\n BigInteger.prototype.clearBit = bnClearBit;\n BigInteger.prototype.flipBit = bnFlipBit;\n BigInteger.prototype.add = bnAdd;\n BigInteger.prototype.subtract = bnSubtract;\n BigInteger.prototype.multiply = bnMultiply;\n BigInteger.prototype.divide = bnDivide;\n BigInteger.prototype.remainder = bnRemainder;\n BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\n BigInteger.prototype.modPow = bnModPow;\n BigInteger.prototype.modInverse = bnModInverse;\n BigInteger.prototype.pow = bnPow;\n BigInteger.prototype.gcd = bnGCD;\n BigInteger.prototype.isProbablePrime = bnIsProbablePrime;\n\n // JSBN-specific extension\n BigInteger.prototype.square = bnSquare;\n\n // Expose the Barrett function\n BigInteger.prototype.Barrett = Barrett\n\n // BigInteger interfaces not implemented in jsbn:\n\n // BigInteger(int signum, byte[] magnitude)\n // double doubleValue()\n // float floatValue()\n // int hashCode()\n // long longValue()\n // static BigInteger valueOf(long val)\n\n // Random number generator - requires a PRNG backend, e.g. prng4.js\n\n // For best results, put code like\n // <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>\n // in your main HTML document.\n\n var rng_state;\n var rng_pool;\n var rng_pptr;\n\n // Mix in a 32-bit integer into the pool\n function rng_seed_int(x) {\n rng_pool[rng_pptr++] ^= x & 255;\n rng_pool[rng_pptr++] ^= (x >> 8) & 255;\n rng_pool[rng_pptr++] ^= (x >> 16) & 255;\n rng_pool[rng_pptr++] ^= (x >> 24) & 255;\n if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;\n }\n\n // Mix in the current time (w/milliseconds) into the pool\n function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n }\n\n // Initialize the pool with junk if needed.\n if(rng_pool == null) {\n rng_pool = new Array();\n rng_pptr = 0;\n var t;\n if(typeof window !== \"undefined\" && window.crypto) {\n if (window.crypto.getRandomValues) {\n // Use webcrypto if available\n var ua = new Uint8Array(32);\n window.crypto.getRandomValues(ua);\n for(t = 0; t < 32; ++t)\n rng_pool[rng_pptr++] = ua[t];\n }\n else if(navigator.appName == \"Netscape\" && navigator.appVersion < \"5\") {\n // Extract entropy (256 bits) from NS4 RNG if available\n var z = window.crypto.random(32);\n for(t = 0; t < z.length; ++t)\n rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;\n }\n }\n while(rng_pptr < rng_psize) { // extract some randomness from Math.random()\n t = Math.floor(65536 * Math.random());\n rng_pool[rng_pptr++] = t >>> 8;\n rng_pool[rng_pptr++] = t & 255;\n }\n rng_pptr = 0;\n rng_seed_time();\n //rng_seed_int(window.screenX);\n //rng_seed_int(window.screenY);\n }\n\n function rng_get_byte() {\n if(rng_state == null) {\n rng_seed_time();\n rng_state = prng_newstate();\n rng_state.init(rng_pool);\n for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)\n rng_pool[rng_pptr] = 0;\n rng_pptr = 0;\n //rng_pool = null;\n }\n // TODO: allow reseeding after first request\n return rng_state.next();\n }\n\n function rng_get_bytes(ba) {\n var i;\n for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();\n }\n\n function SecureRandom() {}\n\n SecureRandom.prototype.nextBytes = rng_get_bytes;\n\n // prng4.js - uses Arcfour as a PRNG\n\n function Arcfour() {\n this.i = 0;\n this.j = 0;\n this.S = new Array();\n }\n\n // Initialize arcfour context from key, an array of ints, each from [0..255]\n function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }\n\n function ARC4next() {\n var t;\n this.i = (this.i + 1) & 255;\n this.j = (this.j + this.S[this.i]) & 255;\n t = this.S[this.i];\n this.S[this.i] = this.S[this.j];\n this.S[this.j] = t;\n return this.S[(t + this.S[this.i]) & 255];\n }\n\n Arcfour.prototype.init = ARC4init;\n Arcfour.prototype.next = ARC4next;\n\n // Plug in your RNG constructor here\n function prng_newstate() {\n return new Arcfour();\n }\n\n // Pool size must be a multiple of 4 and greater than 32.\n // An array of bytes the size of the pool will be passed to init()\n var rng_psize = 256;\n\n if (typeof exports !== 'undefined') {\n exports = module.exports = {\n default: BigInteger,\n BigInteger: BigInteger,\n SecureRandom: SecureRandom,\n };\n } else {\n this.jsbn = {\n BigInteger: BigInteger,\n SecureRandom: SecureRandom\n };\n }\n\n}).call(this);\n"]}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 3);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
module.exports = require("jsbn");
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* eslint-disable no-bitwise, no-mixed-operators, no-use-before-define, max-len */
var _require = __webpack_require__(0),
BigInteger = _require.BigInteger,
SecureRandom = _require.SecureRandom;
var _require2 = __webpack_require__(6),
ECCurveFp = _require2.ECCurveFp;
var rng = new SecureRandom();
var _generateEcparam = generateEcparam(),
curve = _generateEcparam.curve,
G = _generateEcparam.G,
n = _generateEcparam.n;
/**
* 获取公共椭圆曲线
*/
function getGlobalCurve() {
return curve;
}
/**
* 生成ecparam
*/
function generateEcparam() {
// 椭圆曲线
var p = new BigInteger('FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF', 16);
var a = new BigInteger('FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC', 16);
var b = new BigInteger('28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93', 16);
var curve = new ECCurveFp(p, a, b);
// 基点
var gxHex = '32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7';
var gyHex = 'BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0';
var G = curve.decodePointHex('04' + gxHex + gyHex);
var n = new BigInteger('FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123', 16);
return { curve: curve, G: G, n: n };
}
/**
* 生成密钥对
*/
function generateKeyPairHex() {
var d = new BigInteger(n.bitLength(), rng).mod(n.subtract(BigInteger.ONE)).add(BigInteger.ONE); // 随机数
var privateKey = leftPad(d.toString(16), 64);
var P = G.multiply(d); // P = dG,p 为公钥,d 为私钥
var Px = leftPad(P.getX().toBigInteger().toString(16), 64);
var Py = leftPad(P.getY().toBigInteger().toString(16), 64);
var publicKey = '04' + Px + Py;
return { privateKey: privateKey, publicKey: publicKey };
}
/**
* 解析utf8字符串到16进制
*/
function parseUtf8StringToHex(input) {
input = unescape(encodeURIComponent(input));
var length = input.length;
// 转换到字数组
var words = [];
for (var i = 0; i < length; i++) {
words[i >>> 2] |= (input.charCodeAt(i) & 0xff) << 24 - i % 4 * 8;
}
// 转换到16进制
var hexChars = [];
for (var _i = 0; _i < length; _i++) {
var bite = words[_i >>> 2] >>> 24 - _i % 4 * 8 & 0xff;
hexChars.push((bite >>> 4).toString(16));
hexChars.push((bite & 0x0f).toString(16));
}
return hexChars.join('');
}
/**
* 解析arrayBuffer到16进制字符串
*/
function parseArrayBufferToHex(input) {
return Array.prototype.map.call(new Uint8Array(input), function (x) {
return ('00' + x.toString(16)).slice(-2);
}).join('');
}
/**
* 补全16进制字符串
*/
function leftPad(input, num) {
if (input.length >= num) return input;
return new Array(num - input.length + 1).join('0') + input;
}
/**
* 转成16进制串
*/
function arrayToHex(arr) {
var words = [];
var j = 0;
for (var i = 0; i < arr.length * 2; i += 2) {
words[i >>> 3] |= parseInt(arr[j], 10) << 24 - i % 8 * 4;
j++;
}
// 转换到16进制
var hexChars = [];
for (var _i2 = 0; _i2 < arr.length; _i2++) {
var bite = words[_i2 >>> 2] >>> 24 - _i2 % 4 * 8 & 0xff;
hexChars.push((bite >>> 4).toString(16));
hexChars.push((bite & 0x0f).toString(16));
}
return hexChars.join('');
}
/**
* 转成utf8串
*/
function arrayToUtf8(arr) {
var words = [];
var j = 0;
for (var i = 0; i < arr.length * 2; i += 2) {
words[i >>> 3] |= parseInt(arr[j], 10) << 24 - i % 8 * 4;
j++;
}
try {
var latin1Chars = [];
for (var _i3 = 0; _i3 < arr.length; _i3++) {
var bite = words[_i3 >>> 2] >>> 24 - _i3 % 4 * 8 & 0xff;
latin1Chars.push(String.fromCharCode(bite));
}
return decodeURIComponent(escape(latin1Chars.join('')));
} catch (e) {
throw new Error('Malformed UTF-8 data');
}
}
/**
* 转成ascii码数组
*/
function hexToArray(hexStr) {
var words = [];
var hexStrLength = hexStr.length;
if (hexStrLength % 2 !== 0) {
hexStr = leftPad(hexStr, hexStrLength + 1);
}
hexStrLength = hexStr.length;
for (var i = 0; i < hexStrLength; i += 2) {
words.push(parseInt(hexStr.substr(i, 2), 16));
}
return words;
}
module.exports = {
getGlobalCurve: getGlobalCurve,
generateEcparam: generateEcparam,
generateKeyPairHex: generateKeyPairHex,
parseUtf8StringToHex: parseUtf8StringToHex,
parseArrayBufferToHex: parseArrayBufferToHex,
leftPad: leftPad,
arrayToHex: arrayToHex,
arrayToUtf8: arrayToUtf8,
hexToArray: hexToArray
};
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/* eslint-disable no-bitwise, no-mixed-operators, class-methods-use-this, camelcase */
var _require = __webpack_require__(0),
BigInteger = _require.BigInteger;
var _ = __webpack_require__(1);
var copyArray = function copyArray(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {
for (var i = 0; i < length; i++) {
destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];
}
};
var Int32 = {
minValue: -2147483648,
maxValue: 2147483647,
parse: function parse(n) {
if (n < this.minValue) {
var bigInteger = Number(-n);
var bigIntegerRadix = bigInteger.toString(2);
var subBigIntegerRadix = bigIntegerRadix.substr(bigIntegerRadix.length - 31, 31);
var reBigIntegerRadix = '';
for (var i = 0; i < subBigIntegerRadix.length; i++) {
var subBigIntegerRadixItem = subBigIntegerRadix.substr(i, 1);
reBigIntegerRadix += subBigIntegerRadixItem === '0' ? '1' : '0';
}
var result = parseInt(reBigIntegerRadix, 2);
return result + 1;
} else if (n > this.maxValue) {
var _bigInteger = Number(n);
var _bigIntegerRadix = _bigInteger.toString(2);
var _subBigIntegerRadix = _bigIntegerRadix.substr(_bigIntegerRadix.length - 31, 31);
var _reBigIntegerRadix = '';
for (var _i = 0; _i < _subBigIntegerRadix.length; _i++) {
var _subBigIntegerRadixItem = _subBigIntegerRadix.substr(_i, 1);
_reBigIntegerRadix += _subBigIntegerRadixItem === '0' ? '1' : '0';
}
var _result = parseInt(_reBigIntegerRadix, 2);
return -(_result + 1);
} else {
return n;
}
},
parseByte: function parseByte(n) {
if (n < 0) {
var bigInteger = Number(-n);
var bigIntegerRadix = bigInteger.toString(2);
var subBigIntegerRadix = bigIntegerRadix.substr(bigIntegerRadix.length - 8, 8);
var reBigIntegerRadix = '';
for (var i = 0; i < subBigIntegerRadix.length; i++) {
var subBigIntegerRadixItem = subBigIntegerRadix.substr(i, 1);
reBigIntegerRadix += subBigIntegerRadixItem === '0' ? '1' : '0';
}
var result = parseInt(reBigIntegerRadix, 2);
return result + 1;
} else if (n > 255) {
var _bigInteger2 = Number(n);
var _bigIntegerRadix2 = _bigInteger2.toString(2);
return parseInt(_bigIntegerRadix2.substr(_bigIntegerRadix2.length - 8, 8), 2);
} else {
return n;
}
}
};
var SM3Digest = function () {
function SM3Digest() {
_classCallCheck(this, SM3Digest);
this.xBuf = [];
this.xBufOff = 0;
this.byteCount = 0;
this.DIGEST_LENGTH = 32;
this.v0 = [0x7380166f, 0x4914b2b9, 0x172442d7, 0xda8a0600, 0xa96f30bc, 0x163138aa, 0xe38dee4d, 0xb0fb0e4e];
this.v0 = [0x7380166f, 0x4914b2b9, 0x172442d7, -628488704, -1452330820, 0x163138aa, -477237683, -1325724082];
this.v = new Array(8);
this.v_ = new Array(8);
this.X0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
this.X = new Array(68);
this.xOff = 0;
this.T_00_15 = 0x79cc4519;
this.T_16_63 = 0x7a879d8a;
if (arguments.length > 0) {
this.initDigest(arguments.length <= 0 ? undefined : arguments[0]);
} else {
this.init();
}
}
SM3Digest.prototype.init = function init() {
this.xBuf = new Array(4);
this.reset();
};
SM3Digest.prototype.initDigest = function initDigest(t) {
this.xBuf = [].concat(t.xBuf);
this.xBufOff = t.xBufOff;
this.byteCount = t.byteCount;
copyArray(t.X, 0, this.X, 0, t.X.length);
this.xOff = t.xOff;
copyArray(t.v, 0, this.v, 0, t.v.length);
};
SM3Digest.prototype.getDigestSize = function getDigestSize() {
return this.DIGEST_LENGTH;
};
SM3Digest.prototype.reset = function reset() {
this.byteCount = 0;
this.xBufOff = 0;
var keys = Object.keys(this.xBuf);
for (var i = 0, len = keys.length; i < len; i++) {
this.xBuf[keys[i]] = null;
}copyArray(this.v0, 0, this.v, 0, this.v0.length);
this.xOff = 0;
copyArray(this.X0, 0, this.X, 0, this.X0.length);
};
SM3Digest.prototype.processBlock = function processBlock() {
var i = void 0;
var ww = this.X;
var ww_ = new Array(64);
for (i = 16; i < 68; i++) {
ww[i] = this.p1(ww[i - 16] ^ ww[i - 9] ^ this.rotate(ww[i - 3], 15)) ^ this.rotate(ww[i - 13], 7) ^ ww[i - 6];
}
for (i = 0; i < 64; i++) {
ww_[i] = ww[i] ^ ww[i + 4];
}
var vv = this.v;
var vv_ = this.v_;
copyArray(vv, 0, vv_, 0, this.v0.length);
var SS1 = void 0;var SS2 = void 0;var TT1 = void 0;var TT2 = void 0;var aaa = void 0;
for (i = 0; i < 16; i++) {
aaa = this.rotate(vv_[0], 12);
SS1 = Int32.parse(Int32.parse(aaa + vv_[4]) + this.rotate(this.T_00_15, i));
SS1 = this.rotate(SS1, 7);
SS2 = SS1 ^ aaa;
TT1 = Int32.parse(Int32.parse(this.ff_00_15(vv_[0], vv_[1], vv_[2]) + vv_[3]) + SS2) + ww_[i];
TT2 = Int32.parse(Int32.parse(this.gg_00_15(vv_[4], vv_[5], vv_[6]) + vv_[7]) + SS1) + ww[i];
vv_[3] = vv_[2];
vv_[2] = this.rotate(vv_[1], 9);
vv_[1] = vv_[0];
vv_[0] = TT1;
vv_[7] = vv_[6];
vv_[6] = this.rotate(vv_[5], 19);
vv_[5] = vv_[4];
vv_[4] = this.p0(TT2);
}
for (i = 16; i < 64; i++) {
aaa = this.rotate(vv_[0], 12);
SS1 = Int32.parse(Int32.parse(aaa + vv_[4]) + this.rotate(this.T_16_63, i));
SS1 = this.rotate(SS1, 7);
SS2 = SS1 ^ aaa;
TT1 = Int32.parse(Int32.parse(this.ff_16_63(vv_[0], vv_[1], vv_[2]) + vv_[3]) + SS2) + ww_[i];
TT2 = Int32.parse(Int32.parse(this.gg_16_63(vv_[4], vv_[5], vv_[6]) + vv_[7]) + SS1) + ww[i];
vv_[3] = vv_[2];
vv_[2] = this.rotate(vv_[1], 9);
vv_[1] = vv_[0];
vv_[0] = TT1;
vv_[7] = vv_[6];
vv_[6] = this.rotate(vv_[5], 19);
vv_[5] = vv_[4];
vv_[4] = this.p0(TT2);
}
for (i = 0; i < 8; i++) {
vv[i] ^= Int32.parse(vv_[i]);
}
this.xOff = 0;
copyArray(this.X0, 0, this.X, 0, this.X0.length);
};
SM3Digest.prototype.processWord = function processWord(in_Renamed, inOff) {
var n = in_Renamed[inOff] << 24;
n |= (in_Renamed[++inOff] & 0xff) << 16;
n |= (in_Renamed[++inOff] & 0xff) << 8;
n |= in_Renamed[++inOff] & 0xff;
this.X[this.xOff] = n;
if (++this.xOff === 16) {
this.processBlock();
}
};
SM3Digest.prototype.processLength = function processLength(bitLength) {
if (this.xOff > 14) {
this.processBlock();
}
this.X[14] = this.urShiftLong(bitLength, 32);
this.X[15] = bitLength & 0xffffffff;
};
SM3Digest.prototype.intToBigEndian = function intToBigEndian(n, bs, off) {
bs[off] = Int32.parseByte(this.urShift(n, 24)) & 0xff;
bs[++off] = Int32.parseByte(this.urShift(n, 16)) & 0xff;
bs[++off] = Int32.parseByte(this.urShift(n, 8)) & 0xff;
bs[++off] = Int32.parseByte(n) & 0xff;
};
SM3Digest.prototype.doFinal = function doFinal(out_Renamed, outOff) {
this.finish();
for (var i = 0; i < 8; i++) {
this.intToBigEndian(this.v[i], out_Renamed, outOff + i * 4);
}
this.reset();
return this.DIGEST_LENGTH;
};
SM3Digest.prototype.update = function update(input) {
this.xBuf[this.xBufOff++] = input;
if (this.xBufOff === this.xBuf.length) {
this.processWord(this.xBuf, 0);
this.xBufOff = 0;
}
this.byteCount++;
};
SM3Digest.prototype.blockUpdate = function blockUpdate(input, inOff, length) {
while (this.xBufOff !== 0 && length > 0) {
this.update(input[inOff]);
inOff++;
length--;
}
while (length > this.xBuf.length) {
this.processWord(input, inOff);
inOff += this.xBuf.length;
length -= this.xBuf.length;
this.byteCount += this.xBuf.length;
}
while (length > 0) {
this.update(input[inOff]);
inOff++;
length--;
}
};
SM3Digest.prototype.finish = function finish() {
var bitLength = this.byteCount << 3;
this.update(128);
while (this.xBufOff !== 0) {
this.update(0);
}this.processLength(bitLength);
this.processBlock();
};
SM3Digest.prototype.rotate = function rotate(x, n) {
return x << n | this.urShift(x, 32 - n);
};
SM3Digest.prototype.p0 = function p0(X) {
return X ^ this.rotate(X, 9) ^ this.rotate(X, 17);
};
SM3Digest.prototype.p1 = function p1(X) {
return X ^ this.rotate(X, 15) ^ this.rotate(X, 23);
};
SM3Digest.prototype.ff_00_15 = function ff_00_15(X, Y, Z) {
return X ^ Y ^ Z;
};
SM3Digest.prototype.ff_16_63 = function ff_16_63(X, Y, Z) {
return X & Y | X & Z | Y & Z;
};
SM3Digest.prototype.gg_00_15 = function gg_00_15(X, Y, Z) {
return X ^ Y ^ Z;
};
SM3Digest.prototype.gg_16_63 = function gg_16_63(X, Y, Z) {
return X & Y | ~X & Z;
};
SM3Digest.prototype.urShift = function urShift(number, bits) {
if (number > Int32.maxValue || number < Int32.minValue) {
number = Int32.parse(number);
}
if (number >= 0) {
return number >> bits;
} else {
return (number >> bits) + (2 << ~bits);
}
};
SM3Digest.prototype.urShiftLong = function urShiftLong(number, bits) {
var returnV = void 0;
var big = new BigInteger();
big.fromInt(number);
if (big.signum() >= 0) {
returnV = big.shiftRight(bits).intValue();
} else {
var bigAdd = new BigInteger();
bigAdd.fromInt(2);
var shiftLeftBits = ~bits;
var shiftLeftNumber = '';
if (shiftLeftBits < 0) {
var shiftRightBits = 64 + shiftLeftBits;
for (var i = 0; i < shiftRightBits; i++) {
shiftLeftNumber += '0';
}
var shiftLeftNumberBigAdd = new BigInteger();
shiftLeftNumberBigAdd.fromInt(number >> bits);
var shiftLeftNumberBig = new BigInteger('10' + shiftLeftNumber, 2);
shiftLeftNumber = shiftLeftNumberBig.toRadix(10);
var r = shiftLeftNumberBig.add(shiftLeftNumberBigAdd);
returnV = r.toRadix(10);
} else {
shiftLeftNumber = bigAdd.shiftLeft(~bits).intValue();
returnV = (number >> bits) + shiftLeftNumber;
}
}
return returnV;
};
SM3Digest.prototype.getZ = function getZ(g, publicKey) {
var userId = _.parseUtf8StringToHex('1234567812345678');
var len = userId.length * 4;
this.update(len >> 8 & 0x00ff);
this.update(len & 0x00ff);
var userIdWords = _.hexToArray(userId);
this.blockUpdate(userIdWords, 0, userIdWords.length);
var aWords = _.hexToArray(g.curve.a.toBigInteger().toRadix(16));
var bWords = _.hexToArray(g.curve.b.toBigInteger().toRadix(16));
var gxWords = _.hexToArray(g.getX().toBigInteger().toRadix(16));
var gyWords = _.hexToArray(g.getY().toBigInteger().toRadix(16));
var pxWords = _.hexToArray(publicKey.substr(0, 64));
var pyWords = _.hexToArray(publicKey.substr(64, 64));
this.blockUpdate(aWords, 0, aWords.length);
this.blockUpdate(bWords, 0, bWords.length);
this.blockUpdate(gxWords, 0, gxWords.length);
this.blockUpdate(gyWords, 0, gyWords.length);
this.blockUpdate(pxWords, 0, pxWords.length);
this.blockUpdate(pyWords, 0, pyWords.length);
var md = new Array(this.getDigestSize());
this.doFinal(md, 0);
return md;
};
return SM3Digest;
}();
module.exports = SM3Digest;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = {
sm2: __webpack_require__(4),
sm3: __webpack_require__(8),
sm4: __webpack_require__(9)
};
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* eslint-disable no-use-before-define */
var _require = __webpack_require__(0),
BigInteger = _require.BigInteger;
var _require2 = __webpack_require__(5),
encodeDer = _require2.encodeDer,
decodeDer = _require2.decodeDer;
var SM3Digest = __webpack_require__(2);
var SM2Cipher = __webpack_require__(7);
var _ = __webpack_require__(1);
var _$generateEcparam = _.generateEcparam(),
G = _$generateEcparam.G,
curve = _$generateEcparam.curve,
n = _$generateEcparam.n;
var C1C2C3 = 0;
/**
* 加密
*/
function doEncrypt(msg, publicKey) {
var cipherMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
var cipher = new SM2Cipher();
msg = _.hexToArray(_.parseUtf8StringToHex(msg));
if (publicKey.length > 128) {
publicKey = publicKey.substr(publicKey.length - 128);
}
var xHex = publicKey.substr(0, 64);
var yHex = publicKey.substr(64);
publicKey = cipher.createPoint(xHex, yHex);
var c1 = cipher.initEncipher(publicKey);
cipher.encryptBlock(msg);
var c2 = _.arrayToHex(msg);
var c3 = new Array(32);
cipher.doFinal(c3);
c3 = _.arrayToHex(c3);
return cipherMode === C1C2C3 ? c1 + c2 + c3 : c1 + c3 + c2;
}
/**
* 解密
*/
function doDecrypt(encryptData, privateKey) {
var cipherMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
var cipher = new SM2Cipher();
privateKey = new BigInteger(privateKey, 16);
var c1X = encryptData.substr(0, 64);
var c1Y = encryptData.substr(0 + c1X.length, 64);
var c1Length = c1X.length + c1Y.length;
var c3 = encryptData.substr(c1Length, 64);
var c2 = encryptData.substr(c1Length + 64);
if (cipherMode === C1C2C3) {
c3 = encryptData.substr(encryptData.length - 64);
c2 = encryptData.substr(c1Length, encryptData.length - c1Length - 64);
}
var data = _.hexToArray(c2);
var c1 = cipher.createPoint(c1X, c1Y);
cipher.initDecipher(privateKey, c1);
cipher.decryptBlock(data);
var c3_ = new Array(32);
cipher.doFinal(c3_);
var isDecrypt = _.arrayToHex(c3_) === c3;
if (isDecrypt) {
var decryptData = _.arrayToUtf8(data);
return decryptData;
} else {
return '';
}
}
/**
* 签名
*/
function doSignature(msg, privateKey) {
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
pointPool = _ref.pointPool,
der = _ref.der,
hash = _ref.hash,
publicKey = _ref.publicKey;
var hashHex = typeof msg === 'string' ? _.parseUtf8StringToHex(msg) : _.parseArrayBufferToHex(msg);
if (hash) {
// sm3杂凑
publicKey = publicKey || getPublicKeyFromPrivateKey(privateKey);
hashHex = doSm3Hash(hashHex, publicKey);
}
var dA = new BigInteger(privateKey, 16);
var e = new BigInteger(hashHex, 16);
// k
var k = null;
var r = null;
var s = null;
do {
do {
var point = void 0;
if (pointPool && pointPool.length) {
point = pointPool.pop();
} else {
point = getPoint();
}
k = point.k;
// r = (e + x1) mod n
r = e.add(point.x1).mod(n);
} while (r.equals(BigInteger.ZERO) || r.add(k).equals(n));
// s = ((1 + dA)^-1 * (k - r * dA)) mod n
s = dA.add(BigInteger.ONE).modInverse(n).multiply(k.subtract(r.multiply(dA))).mod(n);
} while (s.equals(BigInteger.ZERO));
if (der) {
// asn1 der编码
return encodeDer(r, s);
}
return _.leftPad(r.toString(16), 64) + _.leftPad(s.toString(16), 64);
}
/**
* 验签
*/
function doVerifySignature(msg, signHex, publicKey) {
var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
der = _ref2.der,
hash = _ref2.hash;
var hashHex = typeof msg === 'string' ? _.parseUtf8StringToHex(msg) : _.parseArrayBufferToHex(msg);
if (hash) {
// sm3杂凑
hashHex = doSm3Hash(hashHex, publicKey);
}
var r = void 0;var s = void 0;
if (der) {
var decodeDerObj = decodeDer(signHex);
r = decodeDerObj.r;
s = decodeDerObj.s;
} else {
r = new BigInteger(signHex.substring(0, 64), 16);
s = new BigInteger(signHex.substring(64), 16);
}
var PA = curve.decodePointHex(publicKey);
var e = new BigInteger(hashHex, 16);
// t = (r + s) mod n
var t = r.add(s).mod(n);
if (t.equals(BigInteger.ZERO)) return false;
// x1y1 = s * G + t * PA
var x1y1 = G.multiply(s).add(PA.multiply(t));
// R = (e + x1) mod n
var R = e.add(x1y1.getX().toBigInteger()).mod(n);
return r.equals(R);
}
/**
* sm3杂凑算法
*/
function doSm3Hash(hashHex, publicKey) {
var smDigest = new SM3Digest();
var z = new SM3Digest().getZ(G, publicKey.substr(2, 128));
var zValue = _.hexToArray(_.arrayToHex(z).toString());
var p = hashHex;
var pValue = _.hexToArray(p);
var hashData = new Array(smDigest.getDigestSize());
smDigest.blockUpdate(zValue, 0, zValue.length);
smDigest.blockUpdate(pValue, 0, pValue.length);
smDigest.doFinal(hashData, 0);
return _.arrayToHex(hashData).toString();
}
/**
* 计算公钥
*/
function getPublicKeyFromPrivateKey(privateKey) {
var PA = G.multiply(new BigInteger(privateKey, 16));
var x = _.leftPad(PA.getX().toBigInteger().toString(16), 64);
var y = _.leftPad(PA.getY().toBigInteger().toString(16), 64);
return '04' + x + y;
}
/**
* 获取椭圆曲线点
*/
function getPoint() {
var keypair = _.generateKeyPairHex();
var PA = curve.decodePointHex(keypair.publicKey);
keypair.k = new BigInteger(keypair.privateKey, 16);
keypair.x1 = PA.getX().toBigInteger();
return keypair;
}
module.exports = {
generateKeyPairHex: _.generateKeyPairHex,
doEncrypt: doEncrypt,
doDecrypt: doDecrypt,
doSignature: doSignature,
doVerifySignature: doVerifySignature,
getPoint: getPoint
};
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/* eslint-disable class-methods-use-this */
var _require = __webpack_require__(0),
BigInteger = _require.BigInteger;
function bigIntToMinTwosComplementsHex(bigIntegerValue) {
var h = bigIntegerValue.toString(16);
if (h.substr(0, 1) !== '-') {
if (h.length % 2 === 1) {
h = '0' + h;
} else if (!h.match(/^[0-7]/)) {
h = '00' + h;
}
} else {
var hPos = h.substr(1);
var xorLen = hPos.length;
if (xorLen % 2 === 1) {
xorLen += 1;
} else if (!h.match(/^[0-7]/)) {
xorLen += 2;
}
var hMask = '';
for (var i = 0; i < xorLen; i++) {
hMask += 'f';
}
var biMask = new BigInteger(hMask, 16);
var biNeg = biMask.xor(bigIntegerValue).add(BigInteger.ONE);
h = biNeg.toString(16).replace(/^-/, '');
}
return h;
}
/**
* base class for ASN.1 DER encoder object
*/
var ASN1Object = function () {
function ASN1Object() {
_classCallCheck(this, ASN1Object);
this.isModified = true;
this.hTLV = null;
this.hT = '00';
this.hL = '00';
this.hV = '';
}
/**
* get hexadecimal ASN.1 TLV length(L) bytes from TLV value(V)
*/
ASN1Object.prototype.getLengthHexFromValue = function getLengthHexFromValue() {
var n = this.hV.length / 2;
var hN = n.toString(16);
if (hN.length % 2 === 1) {
hN = '0' + hN;
}
if (n < 128) {
return hN;
} else {
var hNlen = hN.length / 2;
var head = 128 + hNlen;
return head.toString(16) + hN;
}
};
/**
* get hexadecimal string of ASN.1 TLV bytes
*/
ASN1Object.prototype.getEncodedHex = function getEncodedHex() {
if (this.hTLV == null || this.isModified) {
this.hV = this.getFreshValueHex();
this.hL = this.getLengthHexFromValue();
this.hTLV = this.hT + this.hL + this.hV;
this.isModified = false;
}
return this.hTLV;
};
ASN1Object.prototype.getFreshValueHex = function getFreshValueHex() {
return '';
};
return ASN1Object;
}();
/**
* class for ASN.1 DER Integer
*/
var DERInteger = function (_ASN1Object) {
_inherits(DERInteger, _ASN1Object);
function DERInteger(options) {
_classCallCheck(this, DERInteger);
var _this = _possibleConstructorReturn(this, _ASN1Object.call(this));
_this.hT = '02';
if (options && options.bigint) {
_this.hTLV = null;
_this.isModified = true;
_this.hV = bigIntToMinTwosComplementsHex(options.bigint);
}
return _this;
}
DERInteger.prototype.getFreshValueHex = function getFreshValueHex() {
return this.hV;
};
return DERInteger;
}(ASN1Object);
/**
* class for ASN.1 DER Sequence
*/
var DERSequence = function (_ASN1Object2) {
_inherits(DERSequence, _ASN1Object2);
function DERSequence(options) {
_classCallCheck(this, DERSequence);
var _this2 = _possibleConstructorReturn(this, _ASN1Object2.call(this));
_this2.hT = '30';
_this2.asn1Array = [];
if (options && options.array) {
_this2.asn1Array = options.array;
}
return _this2;
}
DERSequence.prototype.getFreshValueHex = function getFreshValueHex() {
var h = '';
for (var i = 0; i < this.asn1Array.length; i++) {
var asn1Obj = this.asn1Array[i];
h += asn1Obj.getEncodedHex();
}
this.hV = h;
return this.hV;
};
return DERSequence;
}(ASN1Object);
/**
* get byte length for ASN.1 L(length) bytes
*/
function getByteLengthOfL(s, pos) {
if (s.substring(pos + 2, pos + 3) !== '8') return 1;
var i = parseInt(s.substring(pos + 3, pos + 4), 10);
if (i === 0) return -1; // length octet '80' indefinite length
if (i > 0 && i < 10) return i + 1; // including '8?' octet;
return -2; // malformed format
}
/**
* get hexadecimal string for ASN.1 L(length) bytes
*/
function getHexOfL(s, pos) {
var len = getByteLengthOfL(s, pos);
if (len < 1) return '';
return s.substring(pos + 2, pos + 2 + len * 2);
}
/**
* get integer value of ASN.1 length for ASN.1 data
*/
function getIntOfL(s, pos) {
var hLength = getHexOfL(s, pos);
if (hLength === '') return -1;
var bi = void 0;
if (parseInt(hLength.substring(0, 1), 10) < 8) {
bi = new BigInteger(hLength, 16);
} else {
bi = new BigInteger(hLength.substring(2), 16);
}
return bi.intValue();
}
/**
* get ASN.1 value starting string position for ASN.1 object refered by index 'idx'.
*/
function getStartPosOfV(s, pos) {
var lLen = getByteLengthOfL(s, pos);
if (lLen < 0) return lLen;
return pos + (lLen + 1) * 2;
}
/**
* get hexadecimal string of ASN.1 V(value)
*/
function getHexOfV(s, pos) {
var pos1 = getStartPosOfV(s, pos);
var len = getIntOfL(s, pos);
return s.substring(pos1, pos1 + len * 2);
}
/**
* get next sibling starting index for ASN.1 object string
*/
function getPosOfNextSibling(s, pos) {
var pos1 = getStartPosOfV(s, pos);
var len = getIntOfL(s, pos);
return pos1 + len * 2;
}
/**
* get array of indexes of child ASN.1 objects
*/
function getPosArrayOfChildren(h, pos) {
var a = [];
var p0 = getStartPosOfV(h, pos);
a.push(p0);
var len = getIntOfL(h, pos);
var p = p0;
var k = 0;
for (;;) {
var pNext = getPosOfNextSibling(h, p);
if (pNext == null || pNext - p0 >= len * 2) break;
if (k >= 200) break;
a.push(pNext);
p = pNext;
k++;
}
return a;
}
module.exports = {
/**
* ASN.1 DER编码
*/
encodeDer: function encodeDer(r, s) {
var derR = new DERInteger({ bigint: r });
var derS = new DERInteger({ bigint: s });
var derSeq = new DERSequence({ array: [derR, derS] });
return derSeq.getEncodedHex();
},
/**
* 解析 ASN.1 DER
*/
decodeDer: function decodeDer(input) {
// 1. Items of ASN.1 Sequence Check
var a = getPosArrayOfChildren(input, 0);
// 2. Integer check
var iTLV1 = a[0];
var iTLV2 = a[1];
// 3. getting value
var hR = getHexOfV(input, iTLV1);
var hS = getHexOfV(input, iTLV2);
var r = new BigInteger(hR, 16);
var s = new BigInteger(hS, 16);
return { r: r, s: s };
}
};
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/* eslint-disable no-case-declarations, max-len */
var _require = __webpack_require__(0),
BigInteger = _require.BigInteger;
/**
* thanks for Tom Wu : http://www-cs-students.stanford.edu/~tjw/jsbn/
*
* Basic Javascript Elliptic Curve implementation
* Ported loosely from BouncyCastle's Java EC code
* Only Fp curves implemented for now
*/
var THREE = new BigInteger('3');
/**
* 椭圆曲线域元素
*/
var ECFieldElementFp = function () {
function ECFieldElementFp(q, x) {
_classCallCheck(this, ECFieldElementFp);
this.x = x;
this.q = q;
// TODO if (x.compareTo(q) >= 0) error
}
/**
* 判断相等
*/
ECFieldElementFp.prototype.equals = function equals(other) {
if (other === this) return true;
return this.q.equals(other.q) && this.x.equals(other.x);
};
/**
* 返回具体数值
*/
ECFieldElementFp.prototype.toBigInteger = function toBigInteger() {
return this.x;
};
/**
* 取反
*/
ECFieldElementFp.prototype.negate = function negate() {
return new ECFieldElementFp(this.q, this.x.negate().mod(this.q));
};
/**
* 相加
*/
ECFieldElementFp.prototype.add = function add(b) {
return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q));
};
/**
* 相减
*/
ECFieldElementFp.prototype.subtract = function subtract(b) {
return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q));
};
/**
* 相乘
*/
ECFieldElementFp.prototype.multiply = function multiply(b) {
return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q));
};
/**
* 相除
*/
ECFieldElementFp.prototype.divide = function divide(b) {
return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q));
};
/**
* 平方
*/
ECFieldElementFp.prototype.square = function square() {
return new ECFieldElementFp(this.q, this.x.square().mod(this.q));
};
return ECFieldElementFp;
}();
var ECPointFp = function () {
function ECPointFp(curve, x, y, z) {
_classCallCheck(this, ECPointFp);
this.curve = curve;
this.x = x;
this.y = y;
// 标准射影坐标系:zinv == null 或 z * zinv == 1
this.z = z == null ? BigInteger.ONE : z;
this.zinv = null;
// TODO: compression flag
}
ECPointFp.prototype.getX = function getX() {
if (this.zinv === null) this.zinv = this.z.modInverse(this.curve.q);
return this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q));
};
ECPointFp.prototype.getY = function getY() {
if (this.zinv === null) this.zinv = this.z.modInverse(this.curve.q);
return this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q));
};
/**
* 判断相等
*/
ECPointFp.prototype.equals = function equals(other) {
if (other === this) return true;
if (this.isInfinity()) return other.isInfinity();
if (other.isInfinity()) return this.isInfinity();
// u = y2 * z1 - y1 * z2
var u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q);
if (!u.equals(BigInteger.ZERO)) return false;
// v = x2 * z1 - x1 * z2
var v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q);
return v.equals(BigInteger.ZERO);
};
/**
* 是否是无穷远点
*/
ECPointFp.prototype.isInfinity = function isInfinity() {
if (this.x === null && this.y === null) return true;
return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO);
};
/**
* 取反,x 轴对称点
*/
ECPointFp.prototype.negate = function negate() {
return new ECPointFp(this.curve, this.x, this.y.negate(), this.z);
};
/**
* 相加
*
* 标准射影坐标系:
*
* λ1 = x1 * z2
* λ2 = x2 * z1
* λ3 = λ1 − λ2
* λ4 = y1 * z2
* λ5 = y2 * z1
* λ6 = λ4 − λ5
* λ7 = λ1 + λ2
* λ8 = z1 * z2
* λ9 = λ3^2
* λ10 = λ3 * λ9
* λ11 = λ8 * λ6^2 − λ7 * λ9
* x3 = λ3 * λ11
* y3 = λ6 * (λ9 * λ1 − λ11) − λ4 * λ10
* z3 = λ10 * λ8
*/
ECPointFp.prototype.add = function add(b) {
if (this.isInfinity()) return b;
if (b.isInfinity()) return this;
var x1 = this.x.toBigInteger();
var y1 = this.y.toBigInteger();
var z1 = this.z;
var x2 = b.x.toBigInteger();
var y2 = b.y.toBigInteger();
var z2 = b.z;
var q = this.curve.q;
var w1 = x1.multiply(z2).mod(q);
var w2 = x2.multiply(z1).mod(q);
var w3 = w1.subtract(w2);
var w4 = y1.multiply(z2).mod(q);
var w5 = y2.multiply(z1).mod(q);
var w6 = w4.subtract(w5);
if (BigInteger.ZERO.equals(w3)) {
if (BigInteger.ZERO.equals(w6)) {
return this.twice(); // this == b,计算自加
}
return this.curve.infinity; // this == -b,则返回无穷远点
}
var w7 = w1.add(w2);
var w8 = z1.multiply(z2).mod(q);
var w9 = w3.square().mod(q);
var w10 = w3.multiply(w9).mod(q);
var w11 = w8.multiply(w6.square()).subtract(w7.multiply(w9)).mod(q);
var x3 = w3.multiply(w11).mod(q);
var y3 = w6.multiply(w9.multiply(w1).subtract(w11)).subtract(w4.multiply(w10)).mod(q);
var z3 = w10.multiply(w8).mod(q);
return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);
};
/**
* 自加
*
* 标准射影坐标系:
*
* λ1 = 3 * x1^2 + a * z1^2
* λ2 = 2 * y1 * z1
* λ3 = y1^2
* λ4 = λ3 * x1 * z1
* λ5 = λ2^2
* λ6 = λ1^2 − 8 * λ4
* x3 = λ2 * λ6
* y3 = λ1 * (4 * λ4 − λ6) − 2 * λ5 * λ3
* z3 = λ2 * λ5
*/
ECPointFp.prototype.twice = function twice() {
if (this.isInfinity()) return this;
if (!this.y.toBigInteger().signum()) return this.curve.infinity;
var x1 = this.x.toBigInteger();
var y1 = this.y.toBigInteger();
var z1 = this.z;
var q = this.curve.q;
var a = this.curve.a.toBigInteger();
var w1 = x1.square().multiply(THREE).add(a.multiply(z1.square())).mod(q);
var w2 = y1.shiftLeft(1).multiply(z1).mod(q);
var w3 = y1.square().mod(q);
var w4 = w3.multiply(x1).multiply(z1).mod(q);
var w5 = w2.square().mod(q);
var w6 = w1.square().subtract(w4.shiftLeft(3)).mod(q);
var x3 = w2.multiply(w6).mod(q);
var y3 = w1.multiply(w4.shiftLeft(2).subtract(w6)).subtract(w5.shiftLeft(1).multiply(w3)).mod(q);
var z3 = w2.multiply(w5).mod(q);
return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);
};
/**
* 倍点计算
*/
ECPointFp.prototype.multiply = function multiply(k) {
if (this.isInfinity()) return this;
if (!k.signum()) return this.curve.infinity;
// 使用加减法
var k3 = k.multiply(THREE);
var neg = this.negate();
var Q = this;
for (var i = k3.bitLength() - 2; i > 0; i--) {
Q = Q.twice();
var k3Bit = k3.testBit(i);
var kBit = k.testBit(i);
if (k3Bit !== kBit) {
Q = Q.add(k3Bit ? this : neg);
}
}
return Q;
};
return ECPointFp;
}();
/**
* 椭圆曲线 y^2 = x^3 + ax + b
*/
var ECCurveFp = function () {
function ECCurveFp(q, a, b) {
_classCallCheck(this, ECCurveFp);
this.q = q;
this.a = this.fromBigInteger(a);
this.b = this.fromBigInteger(b);
this.infinity = new ECPointFp(this, null, null); // 无穷远点
}
/**
* 判断两个椭圆曲线是否相等
*/
ECCurveFp.prototype.equals = function equals(other) {
if (other === this) return true;
return this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b);
};
/**
* 生成椭圆曲线域元素
*/
ECCurveFp.prototype.fromBigInteger = function fromBigInteger(x) {
return new ECFieldElementFp(this.q, x);
};
/**
* 解析 16 进制串为椭圆曲线点
*/
ECCurveFp.prototype.decodePointHex = function decodePointHex(s) {
switch (parseInt(s.substr(0, 2), 16)) {
// 第一个字节
case 0:
return this.infinity;
case 2:
case 3:
// 不支持的压缩方式
return null;
case 4:
case 6:
case 7:
var len = (s.length - 2) / 2;
var xHex = s.substr(2, len);
var yHex = s.substr(len + 2, len);
return new ECPointFp(this, this.fromBigInteger(new BigInteger(xHex, 16)), this.fromBigInteger(new BigInteger(yHex, 16)));
default:
// 不支持
return null;
}
};
return ECCurveFp;
}();
module.exports = {
ECPointFp: ECPointFp,
ECCurveFp: ECCurveFp
};
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/* eslint-disable no-bitwise, no-mixed-operators, class-methods-use-this */
var _require = __webpack_require__(0),
BigInteger = _require.BigInteger;
var SM3Digest = __webpack_require__(2);
var _ = __webpack_require__(1);
var SM2Cipher = function () {
function SM2Cipher() {
_classCallCheck(this, SM2Cipher);
this.ct = 1;
this.p2 = null;
this.sm3keybase = null;
this.sm3c3 = null;
this.key = new Array(32);
this.keyOff = 0;
}
SM2Cipher.prototype.reset = function reset() {
this.sm3keybase = new SM3Digest();
this.sm3c3 = new SM3Digest();
var xWords = _.hexToArray(this.p2.getX().toBigInteger().toRadix(16));
var yWords = _.hexToArray(this.p2.getY().toBigInteger().toRadix(16));
this.sm3keybase.blockUpdate(xWords, 0, xWords.length);
this.sm3c3.blockUpdate(xWords, 0, xWords.length);
this.sm3keybase.blockUpdate(yWords, 0, yWords.length);
this.ct = 1;
this.nextKey();
};
SM2Cipher.prototype.nextKey = function nextKey() {
var sm3keycur = new SM3Digest(this.sm3keybase);
sm3keycur.update(this.ct >> 24 & 0x00ff);
sm3keycur.update(this.ct >> 16 & 0x00ff);
sm3keycur.update(this.ct >> 8 & 0x00ff);
sm3keycur.update(this.ct & 0x00ff);
sm3keycur.doFinal(this.key, 0);
this.keyOff = 0;
this.ct++;
};
SM2Cipher.prototype.initEncipher = function initEncipher(userKey) {
var keypair = _.generateKeyPairHex();
var k = new BigInteger(keypair.privateKey, 16);
var publicKey = keypair.publicKey;
this.p2 = userKey.multiply(k); // [k](Pb)
this.reset();
if (publicKey.length > 128) {
publicKey = publicKey.substr(publicKey.length - 128);
}
return publicKey;
};
SM2Cipher.prototype.encryptBlock = function encryptBlock(data) {
this.sm3c3.blockUpdate(data, 0, data.length);
for (var i = 0; i < data.length; i++) {
if (this.keyOff === this.key.length) {
this.nextKey();
}
data[i] ^= this.key[this.keyOff++] & 0xff;
}
};
SM2Cipher.prototype.initDecipher = function initDecipher(userD, c1) {
this.p2 = c1.multiply(userD);
this.reset();
};
SM2Cipher.prototype.decryptBlock = function decryptBlock(data) {
for (var i = 0; i < data.length; i++) {
if (this.keyOff === this.key.length) {
this.nextKey();
}
data[i] ^= this.key[this.keyOff++] & 0xff;
}
this.sm3c3.blockUpdate(data, 0, data.length);
};
SM2Cipher.prototype.doFinal = function doFinal(c3) {
var yWords = _.hexToArray(this.p2.getY().toBigInteger().toRadix(16));
this.sm3c3.blockUpdate(yWords, 0, yWords.length);
this.sm3c3.doFinal(c3, 0);
this.reset();
};
SM2Cipher.prototype.createPoint = function createPoint(x, y) {
var publicKey = '04' + x + y;
var point = _.getGlobalCurve().decodePointHex(publicKey);
return point;
};
return SM2Cipher;
}();
module.exports = SM2Cipher;
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 左补0到指定长度
*/
function leftPad(input, num) {
if (input.length >= num) return input;
return new Array(num - input.length + 1).join('0') + input;
}
/**
* 二进制转化为十六进制
*/
function binary2hex(binary) {
var binaryLength = 8;
var hex = '';
for (var i = 0; i < binary.length / binaryLength; i++) {
hex += leftPad(parseInt(binary.substr(i * binaryLength, binaryLength), 2).toString(16), 2);
}
return hex;
}
/**
* 十六进制转化为二进制
*/
function hex2binary(hex) {
var hexLength = 2;
var binary = '';
for (var i = 0; i < hex.length / hexLength; i++) {
binary += leftPad(parseInt(hex.substr(i * hexLength, hexLength), 16).toString(2), 8);
}
return binary;
}
/**
* 普通字符串转化为二进制
*/
function str2binary(str) {
var binary = '';
for (var i = 0, len = str.length; i < len; i++) {
var ch = str[i];
binary += leftPad(ch.codePointAt(0).toString(2), 8);
}
return binary;
}
/**
* 循环左移
*/
function rol(str, n) {
return str.substring(n % str.length) + str.substr(0, n % str.length);
}
/**
* 二进制运算
*/
function binaryCal(x, y, method) {
var a = x || '';
var b = y || '';
var result = [];
var prevResult = void 0;
for (var i = a.length - 1; i >= 0; i--) {
// 大端
prevResult = method(a[i], b[i], prevResult);
result[i] = prevResult[0];
}
return result.join('');
}
/**
* 二进制异或运算
*/
function xor(x, y) {
return binaryCal(x, y, function (a, b) {
return [a === b ? '0' : '1'];
});
}
/**
* 二进制与运算
*/
function and(x, y) {
return binaryCal(x, y, function (a, b) {
return [a === '1' && b === '1' ? '1' : '0'];
});
}
/**
* 二进制或运算
*/
function or(x, y) {
return binaryCal(x, y, function (a, b) {
return [a === '1' || b === '1' ? '1' : '0'];
}); // a === '0' && b === '0' ? '0' : '1'
}
/**
* 二进制与运算
*/
function add(x, y) {
var result = binaryCal(x, y, function (a, b, prevResult) {
var carry = prevResult ? prevResult[1] : '0' || '0';
// a,b不等时,carry不变,结果与carry相反
// a,b相等时,结果等于原carry,新carry等于a
if (a !== b) return [carry === '0' ? '1' : '0', carry];
return [carry, a];
});
return result;
}
/**
* 二进制非运算
*/
function not(x) {
return binaryCal(x, undefined, function (a) {
return [a === '1' ? '0' : '1'];
});
}
function calMulti(method) {
return function () {
for (var _len = arguments.length, arr = Array(_len), _key = 0; _key < _len; _key++) {
arr[_key] = arguments[_key];
}
return arr.reduce(function (prev, curr) {
return method(prev, curr);
});
};
}
/**
* 压缩函数中的置换函数 P1(X) = X xor (X <<< 9) xor (X <<< 17)
*/
function P0(X) {
return calMulti(xor)(X, rol(X, 9), rol(X, 17));
}
/**
* 消息扩展中的置换函数 P1(X) = X xor (X <<< 15) xor (X <<< 23)
*/
function P1(X) {
return calMulti(xor)(X, rol(X, 15), rol(X, 23));
}
function FF(X, Y, Z, j) {
return j >= 0 && j <= 15 ? calMulti(xor)(X, Y, Z) : calMulti(or)(and(X, Y), and(X, Z), and(Y, Z));
}
function GG(X, Y, Z, j) {
return j >= 0 && j <= 15 ? calMulti(xor)(X, Y, Z) : or(and(X, Y), and(not(X), Z));
}
function T(j) {
return j >= 0 && j <= 15 ? hex2binary('79cc4519') : hex2binary('7a879d8a');
}
/**
* 压缩函数
*/
function CF(V, Bi) {
// 消息扩展
var wordLength = 32;
var W = [];
var M = []; // W'
// 将消息分组B划分为16个字W0, W1,…… ,W15 (字为长度为32的比特串)
for (var i = 0; i < 16; i++) {
W.push(Bi.substr(i * wordLength, wordLength));
}
// W[j] <- P1(W[j−16] xor W[j−9] xor (W[j−3] <<< 15)) xor (W[j−13] <<< 7) xor W[j−6]
for (var j = 16; j < 68; j++) {
W.push(calMulti(xor)(P1(calMulti(xor)(W[j - 16], W[j - 9], rol(W[j - 3], 15))), rol(W[j - 13], 7), W[j - 6]));
}
// W′[j] = W[j] xor W[j+4]
for (var _j = 0; _j < 64; _j++) {
M.push(xor(W[_j], W[_j + 4]));
}
// 压缩
var wordRegister = []; // 字寄存器
for (var _j2 = 0; _j2 < 8; _j2++) {
wordRegister.push(V.substr(_j2 * wordLength, wordLength));
}
var A = wordRegister[0];
var B = wordRegister[1];
var C = wordRegister[2];
var D = wordRegister[3];
var E = wordRegister[4];
var F = wordRegister[5];
var G = wordRegister[6];
var H = wordRegister[7];
// 中间变量
var SS1 = void 0;
var SS2 = void 0;
var TT1 = void 0;
var TT2 = void 0;
for (var _j3 = 0; _j3 < 64; _j3++) {
SS1 = rol(calMulti(add)(rol(A, 12), E, rol(T(_j3), _j3)), 7);
SS2 = xor(SS1, rol(A, 12));
TT1 = calMulti(add)(FF(A, B, C, _j3), D, SS2, M[_j3]);
TT2 = calMulti(add)(GG(E, F, G, _j3), H, SS1, W[_j3]);
D = C;
C = rol(B, 9);
B = A;
A = TT1;
H = G;
G = rol(F, 19);
F = E;
E = P0(TT2);
}
return xor([A, B, C, D, E, F, G, H].join(''), V);
}
module.exports = function (str) {
var binary = str2binary(str);
// 填充
var len = binary.length;
// k是满足len + 1 + k = 448mod512的最小的非负整数
var k = len % 512;
// 如果 448 <= (512 % len) < 512,需要多补充 (len % 448) 比特'0'以满足总比特长度为512的倍数
k = k >= 448 ? 512 - k % 448 - 1 : 448 - k - 1;
var m = (binary + '1' + leftPad('', k) + leftPad(len.toString(2), 64)).toString(); // k个0
// 迭代压缩
var n = (len + k + 65) / 512;
var V = hex2binary('7380166f4914b2b9172442d7da8a0600a96f30bc163138aae38dee4db0fb0e4e');
for (var i = 0; i <= n - 1; i++) {
var B = m.substr(512 * i, 512);
V = CF(V, B);
}
return binary2hex(V);
};
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* eslint-disable no-bitwise, no-mixed-operators */
var DECRYPT = 0;
var ROUND = 32;
var BLOCK = 16;
var Sbox = [0xd6, 0x90, 0xe9, 0xfe, 0xcc, 0xe1, 0x3d, 0xb7, 0x16, 0xb6, 0x14, 0xc2, 0x28, 0xfb, 0x2c, 0x05, 0x2b, 0x67, 0x9a, 0x76, 0x2a, 0xbe, 0x04, 0xc3, 0xaa, 0x44, 0x13, 0x26, 0x49, 0x86, 0x06, 0x99, 0x9c, 0x42, 0x50, 0xf4, 0x91, 0xef, 0x98, 0x7a, 0x33, 0x54, 0x0b, 0x43, 0xed, 0xcf, 0xac, 0x62, 0xe4, 0xb3, 0x1c, 0xa9, 0xc9, 0x08, 0xe8, 0x95, 0x80, 0xdf, 0x94, 0xfa, 0x75, 0x8f, 0x3f, 0xa6, 0x47, 0x07, 0xa7, 0xfc, 0xf3, 0x73, 0x17, 0xba, 0x83, 0x59, 0x3c, 0x19, 0xe6, 0x85, 0x4f, 0xa8, 0x68, 0x6b, 0x81, 0xb2, 0x71, 0x64, 0xda, 0x8b, 0xf8, 0xeb, 0x0f, 0x4b, 0x70, 0x56, 0x9d, 0x35, 0x1e, 0x24, 0x0e, 0x5e, 0x63, 0x58, 0xd1, 0xa2, 0x25, 0x22, 0x7c, 0x3b, 0x01, 0x21, 0x78, 0x87, 0xd4, 0x00, 0x46, 0x57, 0x9f, 0xd3, 0x27, 0x52, 0x4c, 0x36, 0x02, 0xe7, 0xa0, 0xc4, 0xc8, 0x9e, 0xea, 0xbf, 0x8a, 0xd2, 0x40, 0xc7, 0x38, 0xb5, 0xa3, 0xf7, 0xf2, 0xce, 0xf9, 0x61, 0x15, 0xa1, 0xe0, 0xae, 0x5d, 0xa4, 0x9b, 0x34, 0x1a, 0x55, 0xad, 0x93, 0x32, 0x30, 0xf5, 0x8c, 0xb1, 0xe3, 0x1d, 0xf6, 0xe2, 0x2e, 0x82, 0x66, 0xca, 0x60, 0xc0, 0x29, 0x23, 0xab, 0x0d, 0x53, 0x4e, 0x6f, 0xd5, 0xdb, 0x37, 0x45, 0xde, 0xfd, 0x8e, 0x2f, 0x03, 0xff, 0x6a, 0x72, 0x6d, 0x6c, 0x5b, 0x51, 0x8d, 0x1b, 0xaf, 0x92, 0xbb, 0xdd, 0xbc, 0x7f, 0x11, 0xd9, 0x5c, 0x41, 0x1f, 0x10, 0x5a, 0xd8, 0x0a, 0xc1, 0x31, 0x88, 0xa5, 0xcd, 0x7b, 0xbd, 0x2d, 0x74, 0xd0, 0x12, 0xb8, 0xe5, 0xb4, 0xb0, 0x89, 0x69, 0x97, 0x4a, 0x0c, 0x96, 0x77, 0x7e, 0x65, 0xb9, 0xf1, 0x09, 0xc5, 0x6e, 0xc6, 0x84, 0x18, 0xf0, 0x7d, 0xec, 0x3a, 0xdc, 0x4d, 0x20, 0x79, 0xee, 0x5f, 0x3e, 0xd7, 0xcb, 0x39, 0x48];
var CK = [0x00070e15, 0x1c232a31, 0x383f464d, 0x545b6269, 0x70777e85, 0x8c939aa1, 0xa8afb6bd, 0xc4cbd2d9, 0xe0e7eef5, 0xfc030a11, 0x181f262d, 0x343b4249, 0x50575e65, 0x6c737a81, 0x888f969d, 0xa4abb2b9, 0xc0c7ced5, 0xdce3eaf1, 0xf8ff060d, 0x141b2229, 0x30373e45, 0x4c535a61, 0x686f767d, 0x848b9299, 0xa0a7aeb5, 0xbcc3cad1, 0xd8dfe6ed, 0xf4fb0209, 0x10171e25, 0x2c333a41, 0x484f565d, 0x646b7279];
function rotl(x, y) {
return x << y | x >>> 32 - y;
}
function byteSub(a) {
return (Sbox[a >>> 24 & 0xFF] & 0xFF) << 24 | (Sbox[a >>> 16 & 0xFF] & 0xFF) << 16 | (Sbox[a >>> 8 & 0xFF] & 0xFF) << 8 | Sbox[a & 0xFF] & 0xFF;
}
function l1(b) {
return b ^ rotl(b, 2) ^ rotl(b, 10) ^ rotl(b, 18) ^ rotl(b, 24);
}
function l2(b) {
return b ^ rotl(b, 13) ^ rotl(b, 23);
}
function sms4Crypt(input, output, roundKey) {
var r = void 0;
var mid = void 0;
var x = new Array(4);
var tmp = new Array(4);
for (var i = 0; i < 4; i++) {
tmp[0] = input[0 + 4 * i] & 0xff;
tmp[1] = input[1 + 4 * i] & 0xff;
tmp[2] = input[2 + 4 * i] & 0xff;
tmp[3] = input[3 + 4 * i] & 0xff;
x[i] = tmp[0] << 24 | tmp[1] << 16 | tmp[2] << 8 | tmp[3];
}
for (r = 0; r < 32; r += 4) {
mid = x[1] ^ x[2] ^ x[3] ^ roundKey[r + 0];
mid = byteSub(mid);
x[0] ^= l1(mid); // x4
mid = x[2] ^ x[3] ^ x[0] ^ roundKey[r + 1];
mid = byteSub(mid);
x[1] ^= l1(mid); // x5
mid = x[3] ^ x[0] ^ x[1] ^ roundKey[r + 2];
mid = byteSub(mid);
x[2] ^= l1(mid); // x6
mid = x[0] ^ x[1] ^ x[2] ^ roundKey[r + 3];
mid = byteSub(mid);
x[3] ^= l1(mid); // x7
}
// Reverse
for (var j = 0; j < 16; j += 4) {
output[j] = x[3 - j / 4] >>> 24 & 0xff;
output[j + 1] = x[3 - j / 4] >>> 16 & 0xff;
output[j + 2] = x[3 - j / 4] >>> 8 & 0xff;
output[j + 3] = x[3 - j / 4] & 0xff;
}
}
function sms4KeyExt(key, roundKey, cryptFlag) {
var r = void 0;
var mid = void 0;
var x = new Array(4);
var tmp = new Array(4);
for (var i = 0; i < 4; i++) {
tmp[0] = key[0 + 4 * i] & 0xff;
tmp[1] = key[1 + 4 * i] & 0xff;
tmp[2] = key[2 + 4 * i] & 0xff;
tmp[3] = key[3 + 4 * i] & 0xff;
x[i] = tmp[0] << 24 | tmp[1] << 16 | tmp[2] << 8 | tmp[3];
}
x[0] ^= 0xa3b1bac6;
x[1] ^= 0x56aa3350;
x[2] ^= 0x677d9197;
x[3] ^= 0xb27022dc;
for (r = 0; r < 32; r += 4) {
mid = x[1] ^ x[2] ^ x[3] ^ CK[r + 0];
mid = byteSub(mid);
roundKey[r + 0] = x[0] ^= l2(mid); // roundKey0 = K4
mid = x[2] ^ x[3] ^ x[0] ^ CK[r + 1];
mid = byteSub(mid);
roundKey[r + 1] = x[1] ^= l2(mid); // roundKey1 = K5
mid = x[3] ^ x[0] ^ x[1] ^ CK[r + 2];
mid = byteSub(mid);
roundKey[r + 2] = x[2] ^= l2(mid); // roundKey2 = K6
mid = x[0] ^ x[1] ^ x[2] ^ CK[r + 3];
mid = byteSub(mid);
roundKey[r + 3] = x[3] ^= l2(mid); // roundKey3 = K7
}
// 解密时轮密钥使用顺序:roundKey31, roundKey30, ..., roundKey0
if (cryptFlag === DECRYPT) {
for (r = 0; r < 16; r++) {
mid = roundKey[r];
roundKey[r] = roundKey[31 - r];
roundKey[31 - r] = mid;
}
}
}
function sm4(inArray, key, cryptFlag) {
var outArray = [];
var point = 0;
var roundKey = new Array(ROUND);
sms4KeyExt(key, roundKey, cryptFlag);
var input = new Array(16);
var output = new Array(16);
var inLen = inArray.length;
while (inLen >= BLOCK) {
input = inArray.slice(point, point + 16);
sms4Crypt(input, output, roundKey);
for (var i = 0; i < BLOCK; i++) {
outArray[point + i] = output[i];
}
inLen -= BLOCK;
point += BLOCK;
}
return outArray;
}
module.exports = {
encrypt: function encrypt(inArray, key) {
return sm4(inArray, key, 1);
},
decrypt: function decrypt(inArray, key) {
return sm4(inArray, key, 0);
}
};
/***/ })
/******/ ]);
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */,
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
multipleSlots: true,
addGlobalClass: true
},
properties: {
title: {
type: String,
value: ''
},
showCancel: {
type: Boolean,
value: true
},
cancelText: {
type: String,
value: '取消'
},
maskClass: {
type: String,
value: ''
},
extClass: {
type: String,
value: ''
},
maskClosable: {
type: Boolean,
value: true
},
mask: {
type: Boolean,
value: true
},
show: {
type: Boolean,
value: false
},
actions: {
type: Array,
value: [],
observer: '_groupChange'
}
},
methods: {
_groupChange: function _groupChange(e) {
if (e.length > 0 && typeof e[0] !== 'string' && !(e[0] instanceof Array)) {
this.setData({
actions: [this.data.actions]
});
}
},
buttonTap: function buttonTap(e) {
var _e$currentTarget$data = e.currentTarget.dataset,
value = _e$currentTarget$data.value,
groupindex = _e$currentTarget$data.groupindex,
index = _e$currentTarget$data.index;
this.triggerEvent('actiontap', { value: value, groupindex: groupindex, index: index });
},
closeActionSheet: function closeActionSheet(e) {
var type = e.currentTarget.dataset.type;
if (this.data.maskClosable || type) {
this.setData({
show: false
});
this.triggerEvent('close');
}
}
}
});
/***/ })
/******/ ]);
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<wxs module="utils">
var join = function(a,b) {
return a+b
};
var isNotSlot = function(v) {
return typeof v !== 'string'
}
module.exports = {
join: join,
isNotSlot: isNotSlot
}
</wxs>
<view wx:if="{{mask}}" class="weui-mask {{show ? '' : 'weui-mask_hidden'}} {{maskClass}}" bindtap="closeActionSheet"></view>
<view class="weui-actionsheet {{show ? 'weui-actionsheet_toggle' : ''}} {{extClass}}">
<!-- 标题 -->
<block wx:if="{{title}}">
<view class="weui-actionsheet__title">
<view class="weui-actionsheet__title-text">{{title}}</view>
</view>
</block>
<slot name="title" wx:else></slot>
<view
class="{{ !showCancel && index === actions.length-1 ? 'weui-actionsheet__action' : 'weui-actionsheet__menu' }}"
wx:key="index"
wx:for-item="actionItem"
wx:for-index="index"
wx:for="{{actions}}"
>
<block wx:if="{{utils.isNotSlot(actionItem)}}">
<view
class="weui-actionsheet__cell {{item.type === 'warn' ? 'weui-actionsheet__cell_warn' : '' }}"
wx:key="actionIndex"
wx:for="{{actionItem}}"
wx:for-index="actionIndex"
data-groupindex="{{index}}"
data-index="{{actionIndex}}"
data-value="{{item.value}}"
bindtap="buttonTap"
>
{{item.text}}
</view>
</block>
<slot name="{{actionItem}}" wx:else></slot>
</view>
<!-- 取消按钮 -->
<view class="weui-actionsheet__action" wx:if="{{showCancel}}">
<view class="weui-actionsheet__cell" data-type="close" id="iosActionsheetCancel" bindtap="closeActionSheet">{{cancelText}}</view>
</view>
</view>
.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.6)}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-actionsheet{position:fixed;left:0;bottom:0;transform:translate(0, 100%);backface-visibility:hidden;z-index:5000;width:100%;background-color:#EAE7E8;transition:transform .3s;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden}.weui-actionsheet__title{position:relative;height:56px;padding:0 24px;display:flex;justify-content:center;flex-direction:column;text-align:center;font-size:12px;color:rgba(0,0,0,0.5);line-height:1.4;background:#FFFFFF}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{color:rgba(0,0,0,0.9);background-color:#FFFFFF}.weui-actionsheet__action{margin-top:8px;background-color:#FFFFFF;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-actionsheet__cell{position:relative;padding:16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-actionsheet__cell:active{background-color:#ECECEC}.weui-actionsheet__cell:first-child:before{display:none}.weui-actionsheet__cell_warn{color:#FA5151}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;transform:translate(-50%, -50%);width:274px;box-sizing:border-box;backface-visibility:hidden;background:transparent;transition:transform .3s;border-radius:2px}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,0.1)}.weui-skin_android .weui-actionsheet__cell{padding:16px;font-size:17px;line-height:1.41176471;color:rgba(0,0,0,0.9);text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{transform:translate(0, 0)}.weui-mask.weui-mask_hidden{opacity:0;transform:scale3d(1, 1, 0)}.weui-mask{opacity:1;transform:scale3d(1, 1, 1);transition:all .3s}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 15);
/******/ })
/************************************************************************/
/******/ ({
/***/ 15:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true
},
properties: {
extClass: {
type: String,
value: ''
},
content: {
type: String,
value: ''
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="weui-badge {{extClass}} {{!content ? 'weui-badge_dot' : ''}}">{{content}}</view>
\ No newline at end of file
.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#FA5151;color:#FFFFFF;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 9);
/******/ })
/************************************************************************/
/******/ ({
/***/ 9:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
hover: {
type: Boolean,
value: false
},
link: {
type: Boolean,
value: false
},
extClass: {
type: String,
value: ''
},
iconClass: {
type: String,
value: ''
},
bodyClass: {
type: String,
value: ''
},
icon: {
type: String,
value: ''
},
title: {
type: String,
value: ''
},
value: {
type: String,
value: ''
},
showError: {
type: Boolean,
value: false
},
prop: {
type: String,
value: ''
},
url: {
type: String,
value: ''
},
footerClass: {
type: String,
value: ''
},
footer: {
type: String,
value: ''
},
inline: {
type: Boolean,
value: true
},
hasHeader: {
type: Boolean,
value: true
},
hasFooter: {
type: Boolean,
value: true
},
hasBody: {
type: Boolean,
value: true
}
},
relations: {
'../form/form': {
type: 'ancestor'
},
'../cells/cells': {
type: 'ancestor'
}
},
data: {
inForm: false
},
methods: {
setError: function setError(error) {
this.setData({
error: error || false
});
},
setInForm: function setInForm() {
this.setData({
inForm: true
});
},
setOuterClass: function setOuterClass(className) {
this.setData({
outerClass: className
});
},
navigateTo: function navigateTo() {
var _this = this;
var data = this.data;
if (data.url && data.link) {
wx.navigateTo({
url: data.url,
success: function success(res) {
_this.triggerEvent('navigatesuccess', res, {});
},
fail: function fail(_fail) {
_this.triggerEvent('navigateerror', _fail, {});
}
});
}
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {
"mp-cells": "../cells/cells"
}
}
\ No newline at end of file
<block wx:if="{{link}}">
<view bindtap="navigateTo" class="weui-cell weui-cell_access {{extClass}} {{outerClass}}{{inForm ? ' weui-cell-inform' : ''}}{{inline ? '' : ' .weui-cell_label-block'}}" hover-class="{{hover ? 'weui-cell_active' : ''}}">
<view wx:if="{{hasHeader}}" class="weui-cell__hd {{iconClass}}">
<block wx:if="{{icon}}">
<image src="{{icon}}" class="weui-cell__icon" mode="aspectFit"></image>
</block>
<block wx:else>
<slot name="icon"></slot>
</block>
<block wx:if="{{inForm}}">
<block wx:if="{{title}}"><view class="weui-label">{{title}}</view></block>
<block wx:else>
<slot name="title"></slot>
</block>
</block>
<block wx:else>
<block wx:if="{{title}}">{{title}}</block>
<block wx:else>
<slot name="title"></slot>
</block>
</block>
</view>
<view wx:if="{{hasBody}}" class="weui-cell__bd">
<block wx:if="{{value}}">{{value}}</block>
<block wx:else>
<slot></slot>
</block>
</view>
<view wx:if="{{hasFooter}}" class="weui-cell__ft weui-cell__ft_in-access {{footerClass}}">
<block wx:if="{{footer}}">{{footer}}</block>
<block wx:else>
<slot name="footer"></slot>
</block>
</view>
</view>
</block>
<block wx:else>
<view bindtap="navigateTo" class="weui-cell {{showError && error ? 'weui-cell_warn' : ''}} {{inForm ? 'weui-cell-inform' : ''}} {{extClass}} {{outerClass}}" hover-class="{{hover ? 'weui-cell_active' : ''}}">
<view wx:if="{{hasHeader}}" class="weui-cell__hd {{iconClass}}">
<block wx:if="{{icon}}">
<image src="{{icon}}" class="weui-cell__icon" mode="aspectFit"></image>
</block>
<block wx:else>
<slot name="icon"></slot>
</block>
<block wx:if="{{inForm}}">
<block wx:if="{{title}}"><view class="weui-label">{{title}}</view></block>
<block wx:else>
<slot name="title"></slot>
</block>
</block>
<block wx:else>
<block wx:if="{{title}}">{{title}}</block>
<block wx:else>
<slot name="title"></slot>
</block>
</block>
</view>
<view wx:if="{{hasBody}}" class="weui-cell__bd {{bodyClass}}">
<block wx:if="{{value}}">{{value}}</block>
<block wx:else>
<slot></slot>
</block>
</view>
<view wx:if="{{hasFooter}}" class="weui-cell__ft {{footerClass}}">
<block wx:if="{{footer}}">{{footer}}</block>
<block wx:else>
<slot name="footer"></slot>
</block>
<icon wx:if="{{showError && error}}" type="warn" size="23" color="#E64340"></icon>
</view>
</view>
</block>
\ No newline at end of file
.weui-cells{position:relative;margin-top:8px;background-color:#FFFFFF;line-height:1.41176471;font-size:17px}.weui-cells:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-cells:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-cells__title{margin-top:16px;margin-bottom:3px;padding-left:16px;padding-right:16px;color:rgba(0,0,0,0.5);font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:3px;color:rgba(0,0,0,0.5);padding-left:16px;padding-right:16px;font-size:14px}.weui-cell{padding:16px;position:relative;display:flex;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1);left:16px}.weui-cell:first-child:before{display:none}.weui-cell_active{background-color:#ECECEC}.weui-cell_primary{align-items:flex-start}.weui-cell__bd{flex:1}.weui-cell__ft{text-align:right;color:rgba(0,0,0,0.5)}.weui-cell_wxss.weui-cell_wxss:before{display:block}.weui-cell_label-block{display:block}.weui-cell_label-block .weui-label{width:auto;word-break:initial;-webkit-hyphens:auto;hyphens:auto}.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-img{margin-left:5px;height:3.29411765em;vertical-align:middle}.weui-vcode-btn{display:inline-block;height:3.29411765em;margin-left:5px;padding:0 .6em 0 .7em;border-left:1rpx solid rgba(0,0,0,0.1);line-height:3.29411765em;vertical-align:middle;font-size:17px;color:#576B95;white-space:nowrap}button.weui-vcode-btn{min-height:0;background-color:transparent;border:0;outline:0}.weui-vcode-btn:active{color:#767676}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 8);
/******/ })
/************************************************************************/
/******/ ({
/***/ 8:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
title: {
type: String,
value: ''
},
extClass: {
type: String,
value: ''
},
footer: {
type: String,
value: ''
}
},
data: {
firstItem: null,
checkboxCount: 0,
checkboxIsMulti: false,
outerClass: '',
childClass: ''
},
relations: {
'../cell/cell': {
type: 'descendant',
linked: function linked(target) {
if (!this.data.firstItem) {
this.data.firstItem = target;
}
if (target !== this.data.firstItem) {
target.setOuterClass('weui-cell_wxss');
}
}
},
'../form-page/form-page': {
type: 'ancestor'
},
'../checkbox-group/checkbox-group': {
type: 'descendant',
linked: function linked(target) {
this.setData({
checkboxCount: this.data.checkboxCount + 1,
checkboxIsMulti: target.data.multi
});
},
unlinked: function unlinked(target) {
this.setData({
checkboxCount: this.data.checkboxCount - 1,
checkboxIsMulti: target.data.multi
});
}
}
},
methods: {
setCellMulti: function setCellMulti(multi) {
this.setData({
checkboxIsMulti: multi
});
},
setCellsClass: function setCellsClass(className) {
this.setData({
childClass: className
});
},
setOuterClass: function setOuterClass(className) {
this.setData({
outerClass: className
});
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="{{extClass}} weui-cells__group {{outerClass}} {{childClass}}">
<view wx:if="{{title}}" class="weui-cells__title">{{title}}</view>
<view class="weui-cells weui-cells_after-title weui-cells_form {{checkboxCount > 0 && checkboxIsMulti ? 'weui-cells_checkbox' : ''}}">
<slot></slot>
</view>
<view wx:if="{{footer}}" class="weui-cells__tips">{{footer}}</view>
<slot name="footer" wx:else></slot>
</view>
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 23);
/******/ })
/************************************************************************/
/******/ ({
/***/ 23:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
properties: {
multi: {
type: Boolean,
value: true,
observer: '_multiChange'
},
extClass: {
type: String,
value: ''
},
prop: {
type: String,
value: ''
}
},
data: {
targetList: [],
parentCell: null
},
relations: {
'../checkbox/checkbox': {
type: 'descendant',
linked: function linked(target) {
this.data.targetList.push(target);
target.setMulti(this.data.multi);
if (!this.data.firstItem) {
this.data.firstItem = target;
}
if (target !== this.data.firstItem) {
target.setOuterClass('weui-cell_wxss');
}
},
unlinked: function unlinked(target) {
var index = -1;
this.data.targetList.forEach(function (item, idx) {
if (item === target) {
index = idx;
}
});
this.data.targetList.splice(index, 1);
if (!this.data.targetList) {
this.data.firstItem = null;
}
}
},
'../form/form': {
type: 'ancestor'
},
'../cells/cells': {
type: 'ancestor',
linked: function linked(target) {
if (!this.data.parentCell) {
this.data.parentCell = target;
}
this.setParentCellsClass();
},
unlinked: function unlinked(target) {
this.data.parentCell = null;
}
}
},
methods: {
checkedChange: function checkedChange(checked, target) {
console.log('checked change', checked);
if (this.data.multi) {
var vals = [];
this.data.targetList.forEach(function (item) {
if (item.data.checked) {
vals.push(item.data.value);
}
});
this.triggerEvent('change', { value: vals });
} else {
var val = '';
this.data.targetList.forEach(function (item) {
if (item === target) {
val = item.data.value;
} else {
item.setData({
checked: false
});
}
});
this.triggerEvent('change', { value: val }, {});
}
},
setParentCellsClass: function setParentCellsClass() {
var className = this.data.multi ? 'weui-cells_checkbox' : '';
if (this.data.parentCell) {
this.data.parentCell.setCellsClass(className);
}
},
_multiChange: function _multiChange(multi) {
this.data.targetList.forEach(function (target) {
target.setMulti(multi);
});
if (this.data.parentCell) {
this.data.parentCell.setCellMulti(multi);
}
return multi;
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {
"mp-cells": "../cells/cells"
}
}
\ No newline at end of file
<checkbox-group class="{{extClass}}" wx-if="{{multi}}" bindchange="checkedChange">
<slot></slot>
</checkbox-group>
<radio-group class="{{extClass}}" wx-else bindchange="checkedChange">
<slot></slot>
</radio-group>
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 24);
/******/ })
/************************************************************************/
/******/ ({
/***/ 24:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
multi: {
type: Boolean,
value: true
},
checked: {
type: Boolean,
value: false
},
value: {
type: String,
value: ''
},
label: {
type: String,
value: 'label'
},
extClass: {
type: String,
value: ''
}
},
data: {},
relations: {
'../checkbox-group/checkbox-group': {
type: 'ancestor',
linked: function linked(target) {
this.data.group = target;
},
unlinked: function unlinked() {
this.data.group = null;
}
}
},
methods: {
setMulti: function setMulti(multi) {
this.setData({
multi: multi
});
},
setOuterClass: function setOuterClass(className) {
this.setData({
outerClass: className
});
},
checkedChange: function checkedChange(e) {
if (this.data.multi) {
var checked = !this.data.checked;
this.setData({
checked: checked
});
if (this.data.group) {
this.data.group.checkedChange(checked, this);
}
} else {
var _checked = this.data.checked;
if (_checked) return;
this.setData({
checked: true
});
if (this.data.group) {
this.data.group.checkedChange(_checked, this);
}
}
this.triggerEvent('change', { value: this.data.value, checked: this.data.checked });
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {
"mp-cell": "../cell/cell",
"mp-checkbox-group": "../checkbox-group/checkbox-group"
}
}
<mp-cell has-footer="{{!multi}}" has-header="{{multi}}" bindtap="checkedChange" footer-class="{{!multi ? 'weui-check__ft_in-radio' : ''}}" icon-class="{{multi ? 'weui-check__hd_in-checkbox' : ''}}" ext-class="weui-check__label {{outerClass}} {{extClass}} {{!multi ? 'weui-cell_radio' : 'weui-cell_checkbox'}}">
<view slot="icon" wx:if="{{multi}}">
<checkbox value="{{value}}" checked="{{checked}}" disabled="{{disabled}}" color="{{color}}" class="weui-check"></checkbox>
<!-- 未勾选 -->
<icon wx:if="{{!checked}}" size="23" class="weui-icon-checkbox_circle" type="circle"></icon>
<icon wx:else size="23" class="weui-icon-checkbox_success" type="success"></icon>
</view>
<view>{{label}}</view>
<view slot="footer" wx:if="{{!multi}}">
<radio value="{{value}}" checked="{{checked}}" disabled="{{disabled}}" color="{{color}}" class="weui-check"></radio>
<!-- 已勾选 -->
<icon size="16" wx:if="{{checked}}" class="weui-icon-radio" type="success_no_circle"></icon>
</view>
</mp-cell>
\ No newline at end of file
.weui-cells_checkbox .weui-check__label:before{left:55px}.weui-check__label:active{background-color:#ECECEC}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:16px}.weui-cell__ft_in-radio{padding-left:16px}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 20);
/******/ })
/************************************************************************/
/******/ ({
/***/ 20:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
multipleSlots: true,
addGlobalClass: true
},
properties: {
title: {
type: String,
value: ''
},
extClass: {
type: String,
value: ''
},
maskClosable: {
type: Boolean,
value: true
},
mask: {
type: Boolean,
value: true
},
show: {
type: Boolean,
value: false,
observer: '_showChange'
},
buttons: {
type: Array,
value: []
}
},
data: {
innerShow: false
},
ready: function ready() {
var buttons = this.data.buttons;
var len = buttons.length;
buttons.forEach(function (btn, index) {
if (len === 1) {
btn.className = 'weui-dialog__btn_primary';
} else if (index === 0) {
btn.className = 'weui-dialog__btn_default';
} else {
btn.className = 'weui-dialog__btn_primary';
}
});
this.setData({
buttons: buttons
});
},
methods: {
buttonTap: function buttonTap(e) {
var index = e.currentTarget.dataset.index;
this.triggerEvent('buttontap', { index: index, item: this.data.buttons[index] }, {});
},
close: function close() {
var data = this.data;
if (!data.maskClosable) return;
this.setData({
show: false
});
this.triggerEvent('close', {}, {});
},
stopEvent: function stopEvent() {}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view bindtap="close" class="weui-mask {{!show ? 'weui-mask_hidden' : '' }}" wx:if="{{mask}}"></view>
<view wx:if="{{show}}" bindtap="close" class="weui-dialog__wrp {{extClass}}">
<view class="weui-dialog" catchtap="stopEvent">
<view class="weui-dialog__hd">
<view class="weui-dialog__title">{{title}}
<slot name="title"></slot>
</view>
</view>
<view class="weui-dialog__bd">
<slot></slot>
</view>
<view class="weui-dialog__ft">
<block wx:if="{{buttons && buttons.length}}">
<view wx:for="{{buttons}}" wx:key="index" class="weui-dialog__btn {{item.className}} {{item.extClass}}" data-index="{{index}}" bindtap="buttonTap">{{item.text}}</view>
</block>
<slot name="footer" wx:else></slot>
</view>
</view>
</view>
.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.6)}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-dialog__wrp{position:fixed;z-index:5000;top:16px;bottom:16px;left:16px;right:16px;text-align:center;font-size:0;display:-webkit-box;display:-webkit-flex;display:flex;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__wrp .weui-dialog{max-height:100%}.weui-dialog{background-color:#FFFFFF;text-align:center;border-radius:12px;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;max-height:90%}.weui-dialog__hd{padding:32px 24px 16px}.weui-dialog__title{font-weight:700;font-size:17px;line-height:1.4}.weui-dialog__bd{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 24px;margin-bottom:32px;min-height:40px;font-size:17px;line-height:1.4;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;color:rgba(0,0,0,0.5)}.weui-dialog__bd:first-child{padding:32px 24px 0;font-weight:700;color:rgba(0,0,0,0.9);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__ft{position:relative;line-height:64px;min-height:64px;font-size:17px;display:flex}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-dialog__btn{display:block;flex:1;color:#576B95;font-weight:700;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.weui-dialog__btn:active{background-color:#ECECEC}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:rgba(0,0,0,0.9)}@media screen and (min-width:352px){.weui-dialog{width:320px;margin:0 auto}}.weui-dialog.weui-dialog_hidden{opacity:0;transform:scale3d(1, 1, 0)}.weui-dialog{opacity:1;-webkit-transform:scale3d(1, 1, 1);transform:scale3d(1, 1, 1);transition:all .2s ease-in}.weui-mask.weui-mask_hidden{opacity:0;transform:scale3d(1, 1, 0)}.weui-mask{opacity:1;transform:scale3d(1, 1, 1);transition:all .2s ease-in}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 2);
/******/ })
/************************************************************************/
/******/ ({
/***/ 2:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
title: {
type: String,
value: ''
},
subtitle: {
type: String,
value: ''
}
},
relations: {
'../cells/cells': {
type: 'descendant',
linked: function linked(target) {
if (!this.data.firstItem) {
this.data.firstItem = target;
}
if (target !== this.data.firstItem) {
target.setOuterClass('weui-cells__group_wxss');
}
}
}
},
data: {
firstItem: null
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="weui-form">
<block wx:if="{{title || subtitle}}">
<view class="weui-form__text-area">
<view class="weui-form__title">{{title}}</view>
<view class="weui-form__desc">{{subtitle}}</view>
</view>
</block>
<block wx:else>
<view class="weui-form__text-area">
<slot name="title"></slot>
</view>
</block>
<view class="weui-form__control-area">
<view class="weui-cells__group weui-cells__group_form">
<slot></slot>
</view>
</view>
<view class="weui-form__tips-area">
<slot name="tips"></slot>
</view>
<view class="weui-form__opr-area">
<slot name="button"></slot>
</view>
<view class="weui-form__tips-area">
<slot name="suffixtips"></slot>
</view>
<view class="weui-form__extra-area">
<view class="weui-footer">
<slot name="footer"></slot>
</view>
</view>
</view>
.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cells:before,.weui-cells__group_form .weui-cell:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px;color:rgba(0,0,0,0.9)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:#FA5151}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,0.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:#06AE56;background-color:#F2F2F2}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-form{padding:56px 0 0;padding:calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:flex;flex-direction:column;min-height:100%;box-sizing:border-box;line-height:1.4;background-color:#FFFFFF}.weui-form a:not(.weui-btn){color:#576B95}.weui-form .weui-footer,.weui-form .weui-footer__link{font-size:12px}.weui-form .weui-agree{padding:0}.weui-form__text-area{padding:0 32px;color:rgba(0,0,0,0.9);text-align:center}.weui-form__control-area{flex:1;margin:48px 0}.weui-form__tips-area,.weui-form__extra-area{margin-bottom:24px;text-align:center}.weui-form__opr-area{margin-bottom:64px}.weui-form__opr-area:last-child{margin-bottom:96px}.weui-form__title{font-size:22px;font-weight:700;line-height:1.36}.weui-form__desc{font-size:17px;margin-top:16px}.weui-form__tips{color:rgba(0,0,0,0.5);font-size:12px}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 4);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.diff = function (old, newVal) {
if (!old && newVal || old && !newVal) return true;
for (var k in newVal) {
if (old[k] !== newVal[k]) return true;
}
for (var _k in old) {
if (old[_k] !== newVal[_k]) return true;
}
return false;
};
exports.diffObject = function (old, newVal) {
if (!old && newVal) return newVal;
if (!newVal && old) return old;
var diffObj = {};
var isDiff = false;
for (var k in newVal) {
if (old[k] !== newVal[k]) {
isDiff = true;
diffObj[k] = newVal[k];
}
}
for (var _k2 in old) {
if (old[_k2] !== newVal[_k2]) {
isDiff = true;
diffObj[_k2] = newVal[_k2];
}
}
return isDiff ? diffObj : null;
};
/***/ }),
/* 1 */,
/* 2 */,
/* 3 */,
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var form_validator_1 = __webpack_require__(5);
var object_1 = __webpack_require__(0);
function linked(target) {
if (target.data.prop) {
this.data.formItems[target.data.prop] = target;
}
if (target.setInForm) {
target.setInForm();
}
if (!this.data.firstItem) {
this.data.firstItem = target;
}
if (target !== this.data.firstItem) {}
}
function unlinked(target) {
if (target.data.prop) {
delete this.data.formItems[target.data.prop];
}
}
Component({
properties: {
models: {
type: Object,
value: {},
observer: '_modelChange'
},
rules: {
type: Array,
value: [],
observer: '_rulesChange'
},
extClass: {
type: String,
value: ''
}
},
data: {
errors: {},
formItems: {},
firstItem: null
},
relations: {
'../cell/cell': {
type: 'descendant',
linked: linked,
unlinked: unlinked
},
'../checkbox-group/checkbox-group': {
type: 'descendant',
linked: linked,
unlinked: unlinked
}
},
attached: function attached() {
this.initRules();
this.formValidator = new form_validator_1.default(this.data.models, this.data.newRules);
},
methods: {
initRules: function initRules(rules) {
var newRules = {};
(rules || this.data.rules).forEach(function (rule) {
if (rule.name && rule.rules) {
newRules[rule.name] = rule.rules || [];
}
});
this.setData({ newRules: newRules });
return newRules;
},
_modelChange: function _modelChange(newVal, oldVal, path) {
var _this = this;
if (!this.isInit) {
this.isInit = true;
return newVal;
}
this.formValidator.setModel(newVal);
this.isInit = true;
var diffObj = object_1.diffObject(oldVal, newVal);
if (diffObj) {
(function () {
var isValid = true;
var errors = [];
var errorMap = {};
var _loop = function _loop(k) {
_this.formValidator.validateField(k, diffObj[k], function (isValided, error) {
if (error && error[k]) {
errors.push(error[k]);
errorMap[k] = error[k];
}
isValid = isValided;
});
};
for (var k in diffObj) {
_loop(k);
}
_this._showErrors(diffObj, errorMap);
_this.triggerEvent(isValid ? 'success' : 'fail', isValid ? { trigger: 'change' } : { errors: errors, trigger: 'change' });
})();
}
return newVal;
},
_rulesChange: function _rulesChange(newVal) {
var newRules = this.initRules(newVal);
if (this.formValidator) {
this.formValidator.setRules(newRules);
}
return newVal;
},
_showAllErrors: function _showAllErrors(errors) {
for (var k in this.data.newRules) {
this._showError(k, errors && errors[k]);
}
},
_showErrors: function _showErrors(objs, errors) {
for (var k in objs) {
this._showError(k, errors && errors[k]);
}
},
_showError: function _showError(prop, error) {
var formItem = this.data.formItems[prop];
if (formItem && formItem.data.showError) {
formItem.setError(error);
}
},
validate: function validate(cb) {
var _this2 = this;
return this.formValidator.validate(function (isValid, errors) {
_this2._showAllErrors(errors);
var handleError = _this2.handleErrors(errors);
_this2.triggerEvent(isValid ? 'success' : 'fail', isValid ? { trigger: 'validate' } : { errors: handleError, trigger: 'validate' });
cb && cb(isValid, handleError);
});
},
validateField: function validateField(name, value) {
var _this3 = this;
var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (v) {
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
};
return this.formValidator.validateField(name, value, function (isValid, errors) {
_this3._showError(name, errors);
var handleError = _this3.handleErrors(errors);
_this3.triggerEvent(isValid ? 'success' : 'fail', isValid ? { trigger: 'validate' } : { errors: handleError, trigger: 'validate' });
cb && cb(isValid, handleError);
});
},
handleErrors: function handleErrors(errors) {
if (errors) {
var newErrors = [];
this.data.rules.forEach(function (rule) {
if (errors[rule.name]) {
errors[rule.name].name = rule.name;
newErrors.push(errors[rule.name]);
}
});
return newErrors;
}
return errors;
},
addMethod: function addMethod(ruleName, method) {
return this.formValidator.addMethod(ruleName, method);
}
}
});
exports.default = form_validator_1.default;
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
Object.defineProperty(exports, "__esModule", { value: true });
var validator_1 = __webpack_require__(6);
var object_1 = __webpack_require__(0);
var toString = Object.prototype.toString;
var validateSingleRule = function validateSingleRule(rule, value) {
var param = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
var models = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
var message = '';
for (var ruleKey in rule) {
if (ruleKey === 'name' || ruleKey === 'message') continue;
var validateMethod = typeof rule.validator !== 'undefined' ? rule.validator : validator_1.default[ruleKey];
if (typeof validateMethod === 'function') {
message = validateMethod(rule, value, param, models);
if (message) {
return message;
}
}
}
return message;
};
var FormValidator = function () {
function FormValidator(models, rules) {
_classCallCheck(this, FormValidator);
this.models = models;
this.rules = rules;
this.errors = {};
}
FormValidator.prototype.validate = function validate(cb) {
var _this = this;
return new Promise(function (resolve) {
var fieldCount = 0;
var failCount = 0;
var errors = _this.errors;
var models = _this.models;
var errorChanged = false;
var _loop = function _loop(k) {
(function (fieldName) {
var oldError = errors[fieldName];
_this._innerValidateField(k, models[fieldName], function (valid, newError) {
fieldCount++;
if (!valid) failCount++;
if (object_1.diff(oldError, newError)) {
errors[fieldName] = newError;
errorChanged = true;
}
});
})(k);
};
for (var k in _this.rules) {
_loop(k);
}
if (errorChanged) {}
var keys = Object.keys(errors);
keys.forEach(function (key) {
if (!errors[key]) delete errors[key];
});
resolve({ isValid: !failCount, errors: failCount ? errors : undefined });
cb && cb(!failCount, failCount ? errors : undefined);
});
};
FormValidator.prototype.validateField = function validateField(name, value) {
var _this2 = this;
var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (v) {
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
};
return new Promise(function (resolve) {
_this2._innerValidateField(name, value, function (valid, error) {
var errObj = {};
errObj[name] = error;
resolve({ valid: valid, error: valid ? undefined : error });
cb(valid, valid ? undefined : errObj);
var oldError = _this2.errors[name];
var errorChanged = object_1.diff(oldError, error);
if (errorChanged) {
if (!error) delete _this2.errors[name];
_this2.errors[name] = error;
}
});
});
};
FormValidator.prototype._innerValidateField = function _innerValidateField(name, value) {
var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (v) {
var errors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
};
var rules = this.rules[name];
if (!rules) {
console.warn("[form-validtor] rule name " + name + " not exists.");
cb(true);
return;
}
if (typeof value === 'function') {
cb = value;
value = undefined;
}
var isFail = false;
var models = this.models;
if (toString.call(rules) === '[object Array]') {
rules.forEach(function (rule) {
rule.name = name;
var resMessage = validateSingleRule(rule, value || models[name], rule.param, models);
if (resMessage && !isFail) {
isFail = true;
var error = resMessage ? { message: resMessage, rule: rule } : undefined;
cb(false, error);
}
});
if (!isFail) {
cb(!isFail);
}
} else {
var rule = rules;
rule.name = name;
var resMessage = validateSingleRule(rule, value || models[name], rule.param, models);
var error = resMessage ? { message: resMessage, rule: rule } : undefined;
if (resMessage) {
isFail = true;
}
cb(!isFail, error);
}
};
FormValidator.prototype.addMethod = function addMethod(ruleName, method) {
validator_1.default[ruleName] = method;
};
FormValidator.prototype.setModel = function setModel(newModel) {
this.models = newModel;
};
FormValidator.prototype.setRules = function setRules(newRules) {
this.rules = newRules;
};
return FormValidator;
}();
exports.default = FormValidator;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var string_1 = __webpack_require__(7);
var defaultMessage = {
required: '%s必填',
minlength: '长度最少为%s',
maxlength: '长度最大为%s',
rangelength: '长度在%s和%s之间',
bytelength: '最多只能输入%s个字',
min: '值最小为%s',
max: '值最大为%s',
range: '值的范围为%s和%s之间',
mobile: '请输入正确的手机号',
email: '请输入正确的电子邮件',
url: '请输入正确的URL地址',
equalTo: '值和字段%s不相等'
};
exports.default = {
required: function required(r, val, param, models) {
if (r.required === false) return;
if (!val) return string_1.sprintf(r.message || defaultMessage.required, r.name);
},
minlength: function minlength(r, val) {
var minlen = r.minlength;
val = val || '';
if (val.length < minlen) return string_1.sprintf(r.message || defaultMessage.minlength, minlen);
},
maxlength: function maxlength(r, val) {
var maxlen = r.maxlength;
val = val || '';
if (val.length > maxlen) return string_1.sprintf(r.message || defaultMessage.maxlength, maxlen);
},
rangelength: function rangelength(r, val) {
var range = r.range;
val = val || '';
if (val.length > range[1] || val.length < range[0]) return string_1.sprintf(r.message || defaultMessage.rangelength, range[0], range[1]);
},
min: function min(r, val) {
var min = r.min;
if (val < min) return string_1.sprintf(r.message || defaultMessage.min, min);
},
max: function max(r, val) {
var max = r.max;
if (val > max) return string_1.sprintf(r.message || defaultMessage.max, max);
},
range: function range(r, val) {
var range = r.range;
if (val < range[0] || val > range[1]) return string_1.sprintf(r.message || defaultMessage.range, range[0], range[1]);
},
mobile: function mobile(r, val) {
if (r.mobile === false) return;
val = val || '';
if (val.length !== 11) return string_1.sprintf(r.message || defaultMessage.mobile);
},
email: function email(r, value) {
if (r.email === false) return;
if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(value)) {
return string_1.sprintf(r.message || defaultMessage.email);
}
},
url: function url(r, value) {
if (r.url === false) return;
if (!/^(https?|s?ftp|weixin):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value)) {
return r.message || defaultMessage.url;
}
},
equalTo: function equalTo(r, value, param, models) {
var equalTo = r.equalTo;
if (value !== models[equalTo]) return string_1.sprintf(r.message || defaultMessage.equalTo, r.name);
},
bytelength: function bytelength(r, value, param, models) {
param = r.param;
var len = value.replace(/[^\x00-\xff]/g, '**').length;
if (len > param) return string_1.sprintf(r.message || defaultMessage.bytelength, param);
}
};
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sprintf = function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var i = void 0;
var result = args[0] || '';
var para = void 0;
var reg = void 0;
var length = args.length - 1;
if (length < 1) {
return result;
}
i = 1;
while (i < length + 1) {
result = result.replace(/%s/, '{#' + i + '#}');
i++;
}
result.replace('%s', '');
i = 1;
while (true) {
para = args[i];
if (para === undefined) {
break;
}
reg = new RegExp('{#' + i + '#}', 'g');
result = result.replace(reg, para);
i++;
}
return result;
};
/***/ })
/******/ ]);
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="{{extClass}}">
<slot></slot>
</view>
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 21);
/******/ })
/************************************************************************/
/******/ ({
/***/ 21:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true
},
properties: {
imgUrls: {
type: Array,
value: [],
observer: function observer(newVal, oldVal, changedPath) {
this.setData({ currentImgs: newVal });
}
},
showDelete: {
type: Boolean,
value: true
},
show: {
type: Boolean,
value: true
},
current: {
type: Number,
value: 0
},
hideOnClick: {
type: Boolean,
value: true
},
extClass: {
type: Boolean,
value: ''
}
},
data: {
currentImgs: []
},
ready: function ready() {
var data = this.data;
this.setData({ currentImgs: data.imgUrls });
},
methods: {
change: function change(e) {
this.setData({
current: e.detail.current
});
this.triggerEvent('change', { current: e.detail.current }, {});
},
deleteImg: function deleteImg() {
var data = this.data;
var imgs = data.currentImgs;
var url = imgs.splice(data.current, 1);
this.triggerEvent('delete', { url: url[0], index: data.current }, {});
if (imgs.length === 0) {
this.hideGallery();
return;
}
this.setData({
current: 0,
currentImgs: imgs
});
},
hideGallery: function hideGallery() {
var data = this.data;
if (data.hideOnClick) {
this.setData({
show: false
});
this.triggerEvent('hide', {}, {});
}
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="weui-gallery {{show ? 'weui-gallery_show' : ''}} {{extClass}}">
<view class="weui-gallery__info">{{current+1}}/{{currentImgs.length}}</view>
<swiper class="weui-gallery__img__wrp" bindtap="hideGallery" indicator-dots="{{false}}" bindchange="change" current="{{current}}" autoplay="{{false}}" duration="{{500}}">
<block wx:for="{{currentImgs}}" wx:key="index">
<swiper-item>
<image mode="aspectFit" class="weui-gallery__img" src="{{item}}"></image>
</swiper-item>
</block>
</swiper>
<view class="weui-gallery__opr" wx:if="{{showDelete}}">
<navigator bindtap="deleteImg" class="weui-gallery__del">删除</navigator>
</view>
</view>
.weui-gallery{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000000;z-index:1000;-webkit-flex-direction:column;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;opacity:0;visibility:hidden;transition:opacity .3s}.weui-gallery_show{display:-webkit-box;display:-webkit-flex;display:flex;visibility:visible;opacity:1}.weui-gallery__img__wrp{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;font-size:0}.weui-gallery__img{background:center center no-repeat;background-size:contain;position:absoulte;width:100%;height:100%}.weui-gallery__opr{background-color:#0D0D0D;color:#FFFFFF;line-height:60px;min-height:60px;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);text-align:center}.weui-gallery__opr navigator{color:#FFFFFF}.weui-gallery__del{display:block}.weui-gallery__info{color:#FFFFFF;font-size:17px;line-height:60px;min-height:60px;text-align:center}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 17);
/******/ })
/************************************************************************/
/******/ ({
/***/ 17:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
multipleSlots: true,
addGlobalClass: true
},
properties: {
closabled: {
type: Boolean,
value: true
},
title: {
type: String,
value: ''
},
subTitle: {
type: String,
value: ''
},
extClass: {
type: String,
value: ''
},
desc: {
type: String,
value: ''
},
tips: {
type: String,
value: ''
},
maskClosable: {
type: Boolean,
value: true
},
mask: {
type: Boolean,
value: true
},
show: {
type: Boolean,
value: false,
observer: '_showChange'
},
buttons: {
type: Array,
value: []
}
},
methods: {
close: function close(e) {
var type = e.currentTarget.dataset.type;
if (this.data.maskClosable || type === 'close') {
this.setData({
show: false
});
this.triggerEvent('close');
}
},
buttonTap: function buttonTap(e) {
var index = e.currentTarget.dataset.index;
this.triggerEvent('buttontap', { index: index, item: this.data.buttons[index] }, {});
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="{{show ? 'weui-show' :'weui-hidden'}}">
<view class="weui-mask init" wx:if="{{mask}}" bindtap="close" data-type="tap"></view>
<view class="weui-half-screen-dialog {{extClass}}">
<view class="weui-half-screen-dialog__hd">
<view wx:if="{{closabled}}" class="weui-half-screen-dialog__hd__side" bindtap="close" data-type="close">
<view class="weui-icon-btn weui-icon-btn_close">关闭</view>
</view>
<view class="weui-half-screen-dialog__hd__main">
<block wx:if="{{title}}">
<text class="weui-half-screen-dialog__title">{{title}}</text>
<text class="weui-half-screen-dialog__subtitle">{{subTitle}}</text>
</block>
<block wx:else>
<view class="weui-half-screen-dialog__title"><slot name="title"></slot></view>
</block>
</view>
<view class="weui-half-screen-dialog__hd__side">
<view class="weui-icon-btn weui-icon-btn_more">更多</view>
</view>
</view>
<view class="weui-half-screen-dialog__bd">
<block wx:if="{{title}}">
<view class="weui-half-screen-dialog__desc">{{desc}}</view>
<view class="weui-half-screen-dialog__tips">{{tips}}</view>
</block>
<slot name="desc" wx:else></slot>
</view>
<view class="weui-half-screen-dialog__ft">
<block wx:if="{{buttons && buttons.length}}">
<button
wx:for="{{buttons}}"
wx:key="index"
type="{{item.type}}"
class="weui-btn {{item.className}}"
data-index="{{index}}"
bindtap="buttonTap"
>{{item.text}}</button>
</block>
<slot name="footer" wx:else></slot>
</view>
</view>
</view>
\ No newline at end of file
.weui-half-screen-dialog{position:fixed;left:0;right:0;bottom:0;max-height:75%;z-index:5000;line-height:1.4;background-color:#FFFFFF;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden;padding:0 24px;padding:0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));padding:0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))}.weui-half-screen-dialog__hd{font-size:8px;height:8em;display:flex;align-items:center}.weui-half-screen-dialog__hd .weui-icon-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.weui-half-screen-dialog__hd__side{position:relative;left:-8px}.weui-half-screen-dialog__hd__main{flex:1}.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main{text-align:center;padding:0 40px}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side{right:-8px;left:auto}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn{right:0}.weui-half-screen-dialog__title{display:block;color:rgba(0,0,0,0.9);font-weight:700;font-size:15px}.weui-half-screen-dialog__subtitle{display:block;color:rgba(0,0,0,0.5);font-size:10px}.weui-half-screen-dialog__bd{word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;overflow-y:auto}.weui-half-screen-dialog__desc{padding-top:4px;font-size:17px;font-weight:700;color:rgba(0,0,0,0.9);line-height:1.4}.weui-half-screen-dialog__tips{padding-top:16px;font-size:14px;color:rgba(0,0,0,0.3);line-height:1.4}.weui-half-screen-dialog__ft{padding:40px 24px 32px;text-align:center}.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn{display:inline-block;vertical-align:top;margin:0 8px;width:120px}.weui-icon-btn{background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;background-size:100%;border:0;outline:0;font-size:0}.weui-icon-btn_goback{width:12px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M26 39.438L24.955 40.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42l7.666-7.79L26 24.563 18.682 32 26 39.438z'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_close{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Cpath id='33cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a' d='M8 6.943L1.807.75.75 1.807 6.943 8 .75 14.193l1.057 1.057L8 9.057l6.193 6.193 1.057-1.057L9.057 8l6.193-6.193L14.193.75z'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cuse fill='%23000' fill-opacity='.9' transform='translate(20 24)' xlink:href='%2333cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_more{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-374 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M380.75 32a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zm5.25-1.75a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E %3C/g%3E%3C/svg%3E")}.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.6)}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-mask,.weui-half-screen-dialog{transition:all .3s}.weui-hidden .weui-mask{visibility:hidden;opacity:0}.weui-hidden .weui-half-screen-dialog{transform:translateY(100%)}.weui-show .weui-mask{opacity:1;visibility:visible}.weui-show .weui-half-screen-dialog{transform:translateY(0%)}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<wxs module="utils">
var double = function(a) {
return 2*a
};
var ifSpecialIcon = function(v) {
return v === 'arrow' || v === 'back'
}
module.exports = {
double: double,
ifSpecialIcon: ifSpecialIcon
}
</wxs>
<view class="{{extClass}} weui-icon" style="background:{{color}};width:{{size}}px;height:{{ utils.ifSpecialIcon(icon) ? utils.double(size) : size}}px;mask-image:url({{src}});-webkit-mask-image:url({{src}});-moz-mask-image:url({{src}})"></view>
.weui-icon{vertical-align:middle;display:inline-block;background:black;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;-moz-mask-repeat:no-repeat;mask-size:cover;-webkit-mask-size:cover;-moz-mask-size:cover}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 27);
/******/ })
/************************************************************************/
/******/ ({
/***/ 27:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/***/ })
/******/ });
\ No newline at end of file
{
"usingComponents": {
"actionsheet": "./actionsheet/actionsheet",
"form-page": "./form-page/form-page",
"navigation-bar": "./navigation-bar/navigation-bar",
"form": "./form/form",
"cell": "./cell/cell",
"icon": "./icon/icon",
"toptips": "./toptips/toptips",
"loading": "./loading/loading",
"tabbar": "./tabbar/tabbar",
"cells": "./cells/cells",
"half-screen-dialog": "./half-screen-dialog/half-screen-dialog",
"slideview": "./slideview/slideview",
"msg": "./msg/msg",
"dialog": "./dialog/dialog",
"uploader": "./uploader/uploader",
"gallery": "./gallery/gallery",
"checkbox": "./checkbox/checkbox",
"badge": "./badge/badge",
"searchbar": "./searchbar/searchbar",
"checkbox-group": "./checkbox-group/checkbox-group",
"video-swiper": "./video-swiper/video-swiper"
}
}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 14);
/******/ })
/************************************************************************/
/******/ ({
/***/ 14:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true
},
properties: {
extClass: {
type: String,
value: ''
},
show: {
type: Boolean,
value: true,
observer: function observer(newValue) {
this._computedStyle(newValue, this.data.animated);
}
},
animated: {
type: Boolean,
value: false,
observer: function observer(newValue) {
this._computedStyle(this.data.show, newValue);
}
},
duration: {
type: Number,
value: 350
},
type: {
type: String,
value: 'dot-gray'
},
tips: {
type: String,
value: '加载中'
}
},
data: {
animationData: {},
animationInstance: {},
displayStyle: 'none'
},
methods: {
_computedStyle: function _computedStyle(show, animated) {
if (!show) {
if (!animated) {
this.setData({
displayStyle: 'none'
});
} else {
this._startAnimation();
}
} else {
this.setData({
displayStyle: ''
});
}
},
_startAnimation: function _startAnimation() {
var _this = this;
setTimeout(function () {
var data = _this.data;
var animation = data.animationInstance;
animation.height(0).step();
_this.setData({
animationData: animation.export()
});
}, 0);
}
},
lifetimes: {
attached: function attached() {
var data = this.data;
var animationInstance = wx.createAnimation({
duration: data.duration,
timingFunction: 'ease'
});
this.setData({ animationInstance: animationInstance });
this._computedStyle(this.data.show, this.data.animated);
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view style="display:{{displayStyle}};" class="wx_loading_view {{extClass}}" animation="{{animationData}}" id="wx_loading_view">
<view wx:if="{{type==='dot-white'}}" class="loading wx_dot_loading wx_dot_loading_white">
</view>
<view wx:elif="{{type==='dot-gray'}}" class="loading wx_dot_loading"></view>
<view wx:elif="{{type==='circle'}}" class="weui-loadmore">
<view class="weui-loading"></view>
<view class="weui-loadmore__tips">{{tips}}</view>
</view>
</view>
\ No newline at end of file
.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;animation:weuiLoading 1s steps(12, end) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@keyframes weuiLoading{0%{transform:rotate3d(0, 0, 1, 0deg)}100%{transform:rotate3d(0, 0, 1, 360deg)}}.weui-loadmore{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.weui-loadmore__tips{display:inline-block;vertical-align:middle}.weui-loadmore_line{border-top:1px solid rgba(0,0,0,0.1);margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-0.9em;padding:0 .55em;background-color:#FFFFFF;color:rgba(0,0,0,0.5)}.weui-loadmore__tips_in-dot{position:relative;padding:0 .16em;width:4px;height:1.6em}.weui-loadmore__tips_in-dot:before{content:" ";position:absolute;top:50%;left:50%;margin-top:-1px;margin-left:-2px;width:4px;height:4px;border-radius:50%;background-color:rgba(0,0,0,0.1)}.wx_dot_loading,.wx_dot_loading:before,.wx_dot_loading:after{display:inline-block;vertical-align:middle;width:6px;height:6px;-webkit-border-radius:50%;border-radius:50%;background-color:rgba(0,0,0,0.3);font-size:0;animation:dot2 1.6s step-start infinite}.wx_dot_loading{position:relative}.wx_dot_loading:before{content:"";position:absolute;left:-12px;background-color:rgba(0,0,0,0.1);animation:dot1 1.6s step-start infinite}.wx_dot_loading:after{content:"";position:absolute;right:-12px;background-color:rgba(0,0,0,0.5);animation:dot3 1.6s step-start infinite}@keyframes dot1{0%,100%{background-color:rgba(0,0,0,0.1)}30%{background-color:rgba(0,0,0,0.5)}60%{background-color:rgba(0,0,0,0.3)}}@keyframes dot2{0%,100%{background-color:rgba(0,0,0,0.3)}30%{background-color:rgba(0,0,0,0.1)}60%{background-color:rgba(0,0,0,0.5)}}@keyframes dot3{0%,100%{background-color:rgba(0,0,0,0.5)}30%{background-color:rgba(0,0,0,0.3)}60%{background-color:rgba(0,0,0,0.1)}}.wx_dot_loading_white{background-color:rgba(255,255,255,0.3);animation:dotw2 1.6s step-start infinite}.wx_dot_loading_white:before{background-color:rgba(255,255,255,0.5);animation:dotw1 1.6s step-start infinite}.wx_dot_loading_white:after{background-color:rgba(255,255,255,0.1);animation:dotw3 1.6s step-start infinite}@keyframes dotw1{0%,100%{background-color:rgba(255,255,255,0.5)}30%{background-color:rgba(255,255,255,0.1)}60%{background-color:rgba(255,255,255,0.3)}}@keyframes dotw2{0%,100%{background-color:rgba(255,255,255,0.3)}30%{background-color:rgba(255,255,255,0.5)}60%{background-color:rgba(255,255,255,0.1)}}@keyframes dotw3{0%,100%{background-color:rgba(255,255,255,0.1)}30%{background-color:rgba(255,255,255,0.3)}60%{background-color:rgba(255,255,255,0.5)}}.wx_loading_view{display:flex;justify-content:center;align-items:center;overflow:hidden}.loading{color:rgba(255,255,255,0.9);font-size:17px;text-align:center}.loading_view_translation{transition:height .2s .3s ease}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 19);
/******/ })
/************************************************************************/
/******/ ({
/***/ 19:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
title: {
type: String,
value: ''
},
type: {
type: String,
value: ''
},
icon: {
type: String,
value: ''
},
desc: {
type: String,
value: ''
},
extClass: {
type: String,
value: ''
},
size: {
type: Number,
value: 64
}
},
data: {}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="weui-msg {{extClass}}">
<view class="weui-msg__icon-area">
<icon type="{{type}}" size="{{size}}" wx:if="{{type}}"></icon>
<image class="weui-msg__icon-img" src="{{icon}}" mode="aspectFit" wx:elif="{{icon}}" />
</view>
<view class="weui-msg__text-area">
<view class="weui-msg__title">{{title}}</view>
<view class="weui-msg__desc">
{{desc}}
<slot name="desc" wx:if="{{!desc}}"></slot>
</view>
<slot name="extend"></slot>
</view>
<view class="weui-msg__opr-area">
<view class="weui-btn-area">
<slot name="handle"></slot>
</view>
</view>
<view class="weui-msg__extra-area">
<view class="weui-footer">
<slot name="footer"></slot>
</view>
</view>
</view>
.weui-msg{padding-top:36px;padding:calc(36px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(36px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);text-align:center;line-height:1.4;min-height:100%;box-sizing:border-box;display:flex;flex-direction:column;background-color:#FFFFFF}.weui-msg__link{color:#576B95;display:inline-block;vertical-align:baseline}.weui-msg__icon-area{margin-bottom:32px}.weui-msg__text-area{margin-bottom:32px;padding:0 32px;flex:1;line-height:1.6}.weui-msg__text-area:first-child{padding-top:96px}.weui-msg__title{margin-bottom:5px;font-weight:700;font-size:22px;word-wrap:break-word;word-break:break-all}.weui-msg__desc{font-size:17px;color:rgba(0,0,0,0.9);word-wrap:break-word;word-break:break-all;margin-bottom:16px}.weui-msg__desc-primary{font-size:14px;color:rgba(0,0,0,0.5);word-wrap:break-word;word-break:break-all;margin-bottom:16px}.weui-msg__opr-area{margin-bottom:16px}.weui-msg__opr-area .weui-btn-area{margin:0 16px}.weui-msg__opr-area .weui-btn+.weui-btn{margin-bottom:16px}.weui-msg__opr-area:last-child{margin-bottom:96px}.weui-msg__opr-area+.weui-msg__extra-area{margin-top:48px}.weui-msg__tips-area{margin-bottom:16px;padding:0 40px}.weui-msg__opr-area+.weui-msg__tips-area{margin-bottom:48px}.weui-msg__tips-area:last-child{margin-bottom:64px}.weui-msg__tips{font-size:12px;color:rgba(0,0,0,0.5)}.weui-msg__extra-area{position:static;margin-bottom:24px;font-size:12px;color:rgba(0,0,0,0.5)}.weui-msg__icon-img{width:190rpx;height:190rpx}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 3);
/******/ })
/************************************************************************/
/******/ ({
/***/ 3:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
multipleSlots: true,
addGlobalClass: true
},
properties: {
extClass: {
type: String,
value: ''
},
title: {
type: String,
value: ''
},
background: {
type: String,
value: ''
},
color: {
type: String,
value: ''
},
back: {
type: Boolean,
value: true
},
loading: {
type: Boolean,
value: false
},
animated: {
type: Boolean,
value: true
},
show: {
type: Boolean,
value: true,
observer: '_showChange'
},
delta: {
type: Number,
value: 1
}
},
data: {
displayStyle: ''
},
attached: function attached() {
var _this = this;
var isSupport = !!wx.getMenuButtonBoundingClientRect;
var rect = wx.getMenuButtonBoundingClientRect ? wx.getMenuButtonBoundingClientRect() : null;
wx.getSystemInfo({
success: function success(res) {
var ios = !!(res.system.toLowerCase().search('ios') + 1);
_this.setData({
ios: ios,
statusBarHeight: res.statusBarHeight,
innerWidth: isSupport ? 'width:' + rect.left + 'px' : '',
innerPaddingRight: isSupport ? 'padding-right:' + (res.windowWidth - rect.left) + 'px' : '',
leftWidth: isSupport ? 'width:' + (res.windowWidth - rect.left) + 'px' : ''
});
}
});
},
methods: {
_showChange: function _showChange(show) {
var animated = this.data.animated;
var displayStyle = '';
if (animated) {
displayStyle = 'opacity: ' + (show ? '1' : '0') + ';-webkit-transition:opacity 0.5s;transition:opacity 0.5s;';
} else {
displayStyle = 'display: ' + (show ? '' : 'none');
}
this.setData({
displayStyle: displayStyle
});
},
back: function back() {
var data = this.data;
if (data.delta) {
wx.navigateBack({
delta: data.delta
});
}
this.triggerEvent('back', { delta: data.delta }, {});
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="weui-navigation-bar {{extClass}}">
<view class="weui-navigation-bar__placeholder {{ios ? 'ios' : 'android'}}" style="padding-top: {{statusBarHeight}}px;visibility: hidden;"></view>
<view class="weui-navigation-bar__inner {{ios ? 'ios' : 'android'}}" style="padding-top: {{statusBarHeight}}px; color: {{color}};background: {{background}};{{displayStyle}};{{innerPaddingRight}};{{innerWidth}};">
<view class='weui-navigation-bar__left' style="{{leftWidth}}">
<block wx:if="{{back}}">
<view class="weui-navigation-bar__buttons">
<view bindtap="back" class="weui-navigation-bar__button weui-navigation-bar__btn_goback"></view>
</view>
</block>
<block wx:else>
<slot name="left"></slot>
</block>
</view>
<view class='weui-navigation-bar__center'>
<view wx:if="{{loading}}" class="weui-navigation-bar__loading">
<view class="weui-loading" style="width:{{size.width}}rpx;height:{{size.height}}rpx;"></view>
</view>
<block wx:if="{{title}}">
<text>{{title}}</text>
</block>
<block wx:else>
<slot name="center"></slot>
</block>
</view>
<view class='weui-navigation-bar__right'>
<slot name="right"></slot>
</view>
</view>
</view>
page{--height:44px;--right:190rpx}.weui-navigation-bar{overflow:hidden}.weui-navigation-bar .android{--height:48px;--right:222rpx}.weui-navigation-bar__inner{position:fixed;top:0;left:0;z-index:5001;height:var(--height);display:flex;align-items:center;padding-right:var(--right);width:calc(100% - var(--right))}.weui-navigation-bar__inner .weui-navigation-bar__left{position:relative;width:var(--right);padding-left:16px;display:-webkit-box;display:-webkit-flex;display:flex;align-items:center;-webkit-box-pack:center}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn{display:inline-block;vertical-align:middle;background-repeat:no-repeat}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback{font-size:12px;width:1em;height:2em;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E");background-position:50% 50%;background-size:cover}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active{opacity:.5}.weui-navigation-bar__inner .weui-navigation-bar__center{font-size:17px;text-align:center;position:relative;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-navigation-bar__inner .weui-navigation-bar__loading{font-size:0}.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading{margin-left:0}.weui-navigation-bar__inner .weui-navigation-bar__right{margin-right:16px}.weui-navigation-bar__placeholder{height:var(--height);background:#F8F8F8;position:relative;z-index:50}
\ No newline at end of file
{
"name": "weui-miniprogram",
"version": "0.2.2",
"description": "小程序 WeUI 组件库",
"author": "xushengni,tomylin,cunjinli,rockhou",
"license": "MIT"
}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 25);
/******/ })
/************************************************************************/
/******/ ({
/***/ 25:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true
},
properties: {
extClass: {
type: String,
value: ''
},
focus: {
type: Boolean,
value: false
},
placeholder: {
type: String,
value: '搜索'
},
value: {
type: String,
value: ''
},
search: {
type: Function,
value: null
},
throttle: {
type: Number,
value: 500
},
cancelText: {
type: String,
value: '取消'
},
cancel: {
type: Boolean,
value: true
}
},
data: {
result: []
},
lastSearch: Date.now(),
lifetimes: {
attached: function attached() {
if (this.data.focus) {
this.setData({
searchState: true
});
}
}
},
methods: {
clearInput: function clearInput() {
this.setData({
value: ''
});
this.triggerEvent('clear');
},
inputFocus: function inputFocus(e) {
this.triggerEvent('focus', e.detail);
},
inputBlur: function inputBlur(e) {
this.setData({
focus: false
});
this.triggerEvent('blur', e.detail);
},
showInput: function showInput() {
this.setData({
focus: true,
searchState: true
});
},
hideInput: function hideInput() {
this.setData({
searchState: false
});
},
inputChange: function inputChange(e) {
var _this = this;
this.setData({
value: e.detail.value
});
this.triggerEvent('input', e.detail);
if (Date.now() - this.lastSearch < this.data.throttle) {
return;
}
if (typeof this.data.search !== 'function') {
return;
}
this.lastSearch = Date.now();
this.timerId = setTimeout(function () {
_this.data.search(e.detail.value).then(function (json) {
_this.setData({
result: json
});
}).catch(function (err) {
console.log('search error', err);
});
}, this.data.throttle);
},
selectResult: function selectResult(e) {
var index = e.currentTarget.dataset.index;
var item = this.data.result[index];
this.triggerEvent('selectresult', { index: index, item: item });
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {
"mp-cells": "../cells/cells",
"mp-cell": "../cell/cell"
}
}
\ No newline at end of file
<view class="weui-search-bar {{extClass}}">
<view class="weui-search-bar__form">
<view class="weui-search-bar__box">
<icon class="weui-icon-search_in-box" type="search" size="12"></icon>
<input type="text" class="weui-search-bar__input" placeholder="{{placeholder}}" value="{{value}}" focus="{{focus}}" bindblur="inputBlur" bindfocus="inputFocus" bindinput="inputChange" />
<view class="weui-icon-clear" wx:if="{{value.length > 0}}" bindtap="clearInput">
<icon type="clear" size="12"></icon>
</view>
</view>
<label class="weui-search-bar__label" hidden="{{searchState}}" bindtap="showInput">
<icon class="weui-icon-search" type="search" size="12"></icon>
<view class="weui-search-bar__text">搜索</view>
</label>
</view>
<view wx:if="{{cancel && searchState}}" class="weui-search-bar__cancel-btn" bindtap="hideInput">{{cancelText}}</view>
</view>
<mp-cells class="searchbar-result {{extClass}}" wx:if="{{searchState && result.length > 0}}">
<mp-cell bindtap="selectResult" data-index="{{index}}" wx:for="{{result}}" wx:key="index" hover>
<view>{{item.text}}</view>
</mp-cell>
</mp-cells>
\ No newline at end of file
.weui-search-bar{position:relative;padding:8px;display:flex;box-sizing:border-box;background-color:#EDEDED;-webkit-text-size-adjust:100%;align-items:center}.weui-icon-search{margin-right:8px;font-size:14px;vertical-align:top;margin-top:.64em;height:1em;line-height:1em}.weui-icon-search_in-box{position:absolute;left:12px;top:50%;margin-top:-8px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:top}.weui-search-bar__form{position:relative;flex:auto;border-radius:4px;background:#FFFFFF}.weui-search-bar__box{position:relative;padding-left:32px;padding-right:32px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:32px;line-height:32px;font-size:14px;caret-color:#07C160}.weui-icon-clear{position:absolute;top:0;right:0;bottom:0;padding:0 12px;font-size:0}.weui-icon-clear:after{content:"";height:100%;vertical-align:middle;display:inline-block;width:0;overflow:hidden}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:4px;text-align:center;color:rgba(0,0,0,0.5);background:#FFFFFF;line-height:32px}.weui-search-bar__cancel-btn{margin-left:8px;line-height:32px;color:#576B95;white-space:nowrap}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 18);
/******/ })
/************************************************************************/
/******/ ({
/***/ 18:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
extClass: {
type: String,
value: ''
},
buttons: {
type: Array,
value: [],
observer: function observer(newVal) {
this.addClassNameForButton();
}
},
disable: {
type: Boolean,
value: false
},
icon: {
type: Boolean,
value: false
},
show: {
type: Boolean,
value: false
},
duration: {
type: Number,
value: 350
},
throttle: {
type: Number,
value: 40
},
rebounce: {
type: Number,
value: 0
}
},
data: {
size: null
},
ready: function ready() {
this.updateRight();
this.addClassNameForButton();
},
methods: {
updateRight: function updateRight() {
var _this = this;
var data = this.data;
var query = wx.createSelectorQuery().in(this);
query.select('.left').boundingClientRect(function (res) {
console.log('right res', res);
var btnQuery = wx.createSelectorQuery().in(_this);
btnQuery.selectAll('.btn').boundingClientRect(function (rects) {
console.log('btn rects', rects);
_this.setData({
size: {
buttons: rects,
button: res,
show: data.show,
disable: data.disable,
throttle: data.throttle,
rebounce: data.rebounce
}
});
}).exec();
}).exec();
},
addClassNameForButton: function addClassNameForButton() {
var _data = this.data,
buttons = _data.buttons,
icon = _data.icon;
buttons.forEach(function (btn) {
if (icon) {
btn.className = '';
} else if (btn.type === 'warn') {
btn.className = 'weui-slideview__btn-group_warn';
} else {
btn.className = 'weui-slideview__btn-group_default';
}
});
this.setData({
buttons: buttons
});
},
buttonTapByWxs: function buttonTapByWxs(data) {
this.triggerEvent('buttontap', data, {});
},
hide: function hide() {
this.triggerEvent('hide', {}, {});
},
show: function show() {
this.triggerEvent('show', {}, {});
},
transitionEnd: function transitionEnd() {
console.log('transitiion end');
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!-- slide-view/slide-view.wxml -->
<wxs module="handler" src="./slideview.wxs"></wxs>
<view class="weui-slideview weui-movable-view {{icon ? 'weui-slideview_icon' : ''}} {{extClass}}" style="width: 100%;height: 100%;">
<view bindtransitionend="{{handler.transitionEnd}}"
show="{{show}}" change:show="{{handler.showChange}}"
rebounce="{{rebounce}}" change:rebounce="{{handler.rebounceChange}}"
duration="{{duration}}" change:duration="{{handler.durationChange}}"
change:disable="{{handler.disableChange}}" disable="{{disable}}"
change:prop="{{handler.sizeReady}}" prop="{{size}}"
bindtouchstart="{{handler.touchstart}}" bindtouchmove="{{handler.touchmove}}" bindtouchend="{{handler.touchend}}" class="weui-slideview__left left" style="width:100%;">
<slot></slot>
</view>
<view class="weui-slideview__right right">
<view class="weui-slideview__buttons" style="height:100%;width:100%;" wx:if="{{buttons && buttons.length}}">
<view wx:for="{{buttons}}" wx:key="index" class='btn weui-slideview__btn__wrp {{item.className}} {{item.extClass}}'>
<view bindtap="{{handler.hideButton}}" data-data="{{item.data}}" data-index="{{index}}" class='weui-slideview__btn'>
<text wx:if="{{!icon}}">{{item.text}}</text>
<image class="weui-slideview__btn__icon" wx:else src="{{item.src}}"/>
</view>
</view>
</view>
</view>
</view>
/* eslint-disable */
var touchstart = function(event, ownerInstance) {
var ins = event.instance
var st = ins.getState()
if (st.disable) return // disable的逻辑
// console.log('touchstart st', JSON.stringify(st))
if (!st.size) return
// console.log('touchstart', JSON.stringify(event))
st.isMoving = true
st.startX = event.touches[0].pageX
st.startY = event.touches[0].pageY
st.firstAngle = 0
}
var touchmove = function(event, ownerInstance) {
var ins = event.instance
var st = ins.getState()
if (!st.size || !st.isMoving) return
// console.log('touchmove', JSON.stringify(event))
var pagex = event.touches[0].pageX - st.startX
var pagey = event.touches[0].pageY - st.startY
// 左侧45度角为界限,大于45度则允许水平滑动
if (st.firstAngle === 0) {
st.firstAngle = Math.abs(pagex) - Math.abs(pagey)
}
if (st.firstAngle < 0) {
return
}
var movex = pagex > 0 ? Math.min(st.max, pagex) : Math.max(-st.max, pagex)
// 往回滑动的情况
if (st.out) {
// 已经是划出来了,还要往左滑动,忽略
if (movex < 0) return
ins.setStyle({
'transform': 'translateX(' + (st.transformx + movex) + 'px)',
'transition': ''
})
var btns = ownerInstance.selectAllComponents('.btn')
var transformTotal = 0
var len = btns.length
var i = len - 1;
for (;i >= 0; i--) {
var transform = st.size.buttons[i].width / st.max * movex
var transformx = st.size.buttons[i].max - Math.min(st.size.buttons[i].max, transform + transformTotal)
btns[i].setStyle({
'transform': 'translateX(' + (-transformx) + 'px)',
'transition': ''
})
transformTotal += transform
}
return false
}
if (movex > 0) movex = 0
ins.setStyle({
'transform': 'translateX(' + movex + 'px)',
'transition': ''
})
st.transformx = movex
var btns = ownerInstance.selectAllComponents('.btn')
var transformTotal = 0
var len = btns.length
var i = len - 1;
for (;i >= 0; i--) {
var transform = st.size.buttons[i].width / st.max * movex
var transformx = Math.max(-st.size.buttons[i].max, transform + transformTotal)
btns[i].setStyle({
'transform': 'translateX(' + transformx + 'px)',
'transition': ''
})
st.size.buttons[i].transformx = transformx
transformTotal += transform
}
return false // 禁止垂直方向的滑动
}
var touchend = function(event, ownerInstance) {
var ins = event.instance
var st = ins.getState()
if (!st.size || !st.isMoving) return
// 左侧45度角为界限,大于45度则允许水平滑动
if (st.firstAngle < 0) {
return
}
var duration = st.duration / 1000
st.isMoving = false
// console.log('touchend', JSON.stringify(event))
var btns = ownerInstance.selectAllComponents('.btn')
var len = btns.length
var i = len - 1
// console.log('len size', len)
if (Math.abs(event.changedTouches[0].pageX - st.startX) < st.throttle || event.changedTouches[0].pageX - st.startX > 0) { // 方向也要控制
st.out = false
ins.setStyle({
'transform': 'translate3d(0px, 0, 0)',
'transition': 'transform ' + (duration) + 's'
})
for (;i >= 0; i--) {
btns[i].setStyle({
'transform': 'translate3d(0px, 0, 0)',
'transition': 'transform ' + (duration) + 's'
})
}
ownerInstance.callMethod('hide')
return
}
showButtons(ins, ownerInstance, duration)
ownerInstance.callMethod('show')
}
var REBOUNCE_TIME = 0.2
var showButtons = function(ins, ownerInstance, withDuration) {
var st = ins.getState()
if (!st.size) return
var rebounceTime = st.rebounce ? REBOUNCE_TIME : 0
var movex = st.max
st.out = true
var btns = ownerInstance.selectAllComponents('.btn')
var rebounce = st.rebounce || 0
var len = btns.length
var i = len - 1
ins.setStyle({
'transform': 'translate3d(' + (-movex - rebounce) + 'px, 0, 0)',
'transition': 'transform ' + (withDuration) + 's'
})
st.transformx = -movex
var transformTotal = 0
for (;i >= 0; i--) {
var transform = st.size.buttons[i].width / st.max * movex
var transformx = (-(transform + transformTotal))
btns[i].setStyle({
'transform': 'translate3d(' + transformx + 'px, 0, 0)',
'transition': 'transform ' + (withDuration ? withDuration + rebounceTime : withDuration) + 's'
})
st.size.buttons[i].transformx = transformx
transformTotal += transform
}
}
var innerHideButton = function(ownerInstance) {
var ins = ownerInstance.selectComponent('.left')
var st = ins.getState()
if (!st.size) return
var duration = st.duration ? st.duration / 1000 : 0
var btns = ownerInstance.selectAllComponents('.btn')
var len = btns.length
var i = len - 1
ins.setStyle({
'transform': 'translate3d(0px, 0, 0)',
'transition': 'transform ' + (duration) + 's'
})
st.transformx = 0
for (;i >= 0; i--) {
btns[i].setStyle({
'transform': 'translate3d(0px, 0, 0)',
'transition': 'transform ' + (duration) + 's'
})
st.size.buttons[i].transformx = 0
}
}
var hideButton = function(event, ownerInstance) {
innerHideButton(ownerInstance)
ownerInstance.callMethod('buttonTapByWxs', {index: event.currentTarget.dataset.index, data: event.currentTarget.dataset.data})
return false
}
var sizeReady = function(newVal, oldVal, ownerInstance, ins) {
var st = ins.getState()
// st.disable = newVal && newVal.disable
if (newVal && newVal.button && newVal.buttons) {
st.size = newVal
st.transformx = 0
// var min = newVal.button.width
var max = 0
var len = newVal.buttons.length
var i = newVal.buttons.length - 1;
var total = 0
for (; i >= 0; i--) {
max += newVal.buttons[i].width
// if (min > newVal.buttons[i]) {
// min = newVal.buttons[i].width
// }
total += newVal.buttons[i].width
newVal.buttons[i].max = total
newVal.buttons[i].transformx = 0
}
st.throttle = st.size.throttle || 40 // 固定值
st.rebounce = st.size.rebounce
st.max = max
ownerInstance.selectComponent('.right').setStyle({
'line-height': newVal.button.height + 'px',
left: (newVal.button.width) + 'px',
width: max + 'px'
})
// console.log('st size', JSON.stringify(newVal))
if (!st.size.disable && st.size.show) {
showButtons(ins, ownerInstance)
}
}
}
var disableChange = function(newVal, oldVal, ownerInstance, ins) {
var st = ins.getState()
st.disable = newVal
}
var durationChange = function(newVal, oldVal, ownerInstance, ins) {
var st = ins.getState()
st.duration = newVal || 400
}
var showChange = function(newVal, oldVal, ownerInstance, ins) {
var st = ins.getState()
st.show = newVal
if (st.disable) return
// console.log('show change')
if (st.show) {
showButtons(ins, ownerInstance, st.duration)
} else {
innerHideButton(ownerInstance)
}
}
var rebounceChange = function(newVal, oldVal, ownerInstance, ins) {
var st = ins.getState()
// console.log('rebounce', st.rebounce)
st.rebounce = newVal
}
var transitionEnd = function(event, ownerInstance) {
// console.log('transition')
var ins = event.instance
var st = ins.getState()
// 回弹效果
if (st.out && st.rebounce) {
console.log('transition rebounce', st.rebounce)
ins.setStyle({
'transform': 'translate3d(' + (-st.max) + 'px, 0, 0)',
'transition': 'transform ' + REBOUNCE_TIME +'s'
})
}
}
module.exports = {
touchstart: touchstart,
touchmove: touchmove,
touchend: touchend,
hideButton: hideButton,
sizeReady: sizeReady,
disableChange: disableChange,
durationChange: durationChange,
showChange: showChange,
rebounceChange: rebounceChange,
transitionEnd: transitionEnd
}
\ No newline at end of file
:host{width:100%}.weui-slideview{overflow:hidden;position:relative}.weui-slideview{position:relative}.weui-slideview__left{position:relative;z-index:10}.weui-slideview__right{position:absolute;z-index:1;left:100%;top:0;height:100%}.weui-slideview__btn__wrp{position:absolute;left:0;bottom:0;text-align:center;min-width:69px;height:100%;white-space:nowrap}.weui-slideview__btn{color:#FFFFFF;padding:0 17px}.weui-slideview__btn-group_default .weui-slideview__btn{background:#C7C7CC}.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #FFFFFF;color:#FFFFFF}.weui-slideview__btn-group_default:first-child:before{display:none}.weui-slideview__btn-group_warn .weui-slideview__btn{background:#FE3B30}.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #FFFFFF;color:#FFFFFF}.weui-slideview__btn-group_warn:first-child:before{display:none}.weui-slideview_icon .weui-slideview__btn__wrp{background:transparent;font-size:0}.weui-slideview_icon .weui-slideview__btn__wrp:after{content:"";width:0;height:100%;vertical-align:middle;display:inline-block}.weui-slideview_icon .weui-slideview__btn__wrp:first-child{padding-left:16px}.weui-slideview_icon .weui-slideview__btn__wrp:last-child{padding-right:8px}.weui-slideview_icon .weui-slideview__btn{width:48px;height:48px;line-height:48px;padding:0;display:inline-block;vertical-align:middle;border-radius:50%;background-color:#FFFFFF}.weui-slideview_icon .weui-slideview__btn__icon{display:inline-block;vertical-align:middle;width:22px;height:22px}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="24px" viewBox="0 0 12 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 52.2 (67145) - http://www.bohemiancoding.com/sketch -->
<title>Icons/Filled/arrow Copy 2</title>
<desc>Created with Sketch.</desc>
<g id="05成员管理" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="单个成员编辑" transform="translate(-25.000000, -54.000000)">
<rect id="bg" x="0" y="0" width="375" height="236"></rect>
<g id="Navbar">
<g id="Group-4" transform="translate(8.000000, 50.000000)">
<g id="Icons/Filled/arrow" transform="translate(23.000000, 16.000000) rotate(-180.000000) translate(-23.000000, -16.000000) translate(17.000000, 4.000000)" fill="#000000" fill-opacity="0.9">
<g id="Group" transform="translate(-2.000000, 5.000000)">
<path d="M3,2.5039609 L11,2.5039609 L11,4.5039609 L4,4.5039609 L4,11.5039609 L2,11.5039609 L2,3.5039609 C2,2.95167615 2.44771525,2.5039609 3,2.5039609 Z" id="图标颜色" transform="translate(6.500000, 7.003961) rotate(135.000000) translate(-6.500000, -7.003961) "></path>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 16);
/******/ })
/************************************************************************/
/******/ ({
/***/ 16:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true
},
properties: {
extClass: {
type: String,
value: ''
},
list: {
type: Array,
value: []
},
current: {
type: Number,
value: 0
}
},
methods: {
tabChange: function tabChange(e) {
var index = e.currentTarget.dataset.index;
if (index === this.data.current) {
return;
}
this.setData({
current: index
});
this.triggerEvent('change', { index: index, item: this.data.list[index] });
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {
"mp-badge": "../badge/badge"
}
}
\ No newline at end of file
<view class="weui-tabbar {{extClass}}">
<!-- 选中的时候往 weui-tabbar__item 加 class:weui-bar__item_on -->
<view data-index='{{index}}' bindtap="tabChange" wx:for="{{list}}" wx:key="index" class="weui-tabbar__item {{index === current ? 'weui-bar__item_on' : ''}}">
<view style="position: relative;display:inline-block;">
<image src="{{current === index ? item.selectedIconPath : item.iconPath}}" class="weui-tabbar__icon"></image>
<mp-badge wx:if="{{item.badge}}" content="{{item.badge}}" style="position: absolute;top:-2px;left:calc(100% - 3px)"></mp-badge>
</view>
<view class="weui-tabbar__label">{{item.text}}</view>
</view>
</view>
\ No newline at end of file
.weui-tabbar{display:flex;position:relative;z-index:500;background-color:#F7F7F7}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-tabbar__item{display:block;flex:1;padding:8px 0 4px;padding-bottom:calc(8px + constant(safe-area-inset-bottom));padding-bottom:calc(8px + env(safe-area-inset-bottom));font-size:0;color:rgba(0,0,0,0.5);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-tabbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#07C160}.weui-tabbar__icon{display:inline-block;width:28px;height:28px;margin-bottom:2px}i.weui-tabbar__icon,.weui-tabbar__icon>i{font-size:24px;color:rgba(0,0,0,0.5)}.weui-tabbar__icon image{width:100%;height:100%}.weui-tabbar__label{color:rgba(0,0,0,0.9);font-size:10px;line-height:1.4}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 13);
/******/ })
/************************************************************************/
/******/ ({
/***/ 13:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true
},
properties: {
type: {
type: String,
value: 'error',
observer: '_typeChange'
},
show: {
type: Boolean,
value: false,
observer: '_showChange'
},
msg: {
type: String,
value: ''
},
delay: {
type: Number,
value: 2000
},
extClass: {
type: String,
value: ''
}
},
data: {
typeClassMap: {
'warn': 'weui-toptips_warn',
'info': 'weui-toptips_info',
'success': 'weui-toptips_success',
'error': 'weui-toptips_error'
}
},
attached: function attached() {
var data = this.data;
this.setData({
className: data.typeClassMap[data.type] || ''
});
},
methods: {
_typeChange: function _typeChange(newVal) {
this.setData({
className: this.data.typeClassMap[newVal] || ''
});
return newVal;
},
_showChange: function _showChange(newVal) {
this._showToptips(newVal);
},
_showToptips: function _showToptips(newVal) {
var _this = this;
if (newVal && this.data.delay) {
setTimeout(function () {
_this.setData({
show: false
}, function () {
_this.triggerEvent('hide', {}, {});
});
}, this.data.delay);
}
this.setData({
show: newVal
});
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="weui-toptips {{className}} {{extClass}} {{show ? 'weui-toptips_show' : ''}}">
<block wx:if="{{msg}}">{{msg}}</block>
<block wx:else>
<slot></slot>
</block>
</view>
\ No newline at end of file
.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(calc(-100% - 8px));transform:translateZ(0) translateY(calc(-100% - 8px));text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:rgba(255,255,255,0.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,0.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#FA5151}.weui-toptips_success{background-color:#09BB07}.weui-toptips_error{background-color:#FA5151}.weui-toptips_info{background-color:#10AEFF}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 22);
/******/ })
/************************************************************************/
/******/ ({
/***/ 22:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true
},
properties: {
title: {
type: String,
value: '图片上传'
},
sizeType: {
type: Array,
value: ['original', 'compressed']
},
sourceType: {
type: Array,
value: ['album', 'camera']
},
maxSize: {
type: Number,
value: 5 * 1024 * 1024
},
maxCount: {
type: Number,
value: 1
},
files: {
type: Array,
value: [],
observer: function observer(newVal, oldVal, changedP) {
this.setData({
currentFiles: newVal
});
}
},
select: {
type: Function,
value: function value() {}
},
upload: {
type: Function,
value: null
},
tips: {
type: String,
value: ''
},
extClass: {
type: String,
value: ''
},
showDelete: {
type: Boolean,
value: true
}
},
data: {
currentFiles: [],
showPreview: false,
previewImageUrls: []
},
ready: function ready() {},
methods: {
previewImage: function previewImage(e) {
var index = e.currentTarget.dataset.index;
var previewImageUrls = [];
this.data.files.map(function (item) {
previewImageUrls.push(item.url);
});
this.setData({
previewImageUrls: previewImageUrls,
previewCurrent: index,
showPreview: true
});
},
chooseImage: function chooseImage(e) {
var _this = this;
if (this.uploading) return;
wx.chooseImage({
count: this.data.maxCount - this.data.files.length,
success: function success(res) {
var invalidIndex = -1;
res.tempFiles.forEach(function (item, index) {
if (item.size > _this.data.maxSize) {
invalidIndex = index;
}
});
if (typeof _this.data.select === 'function') {
var ret = _this.data.select(res);
if (ret === false) {
return;
}
}
if (invalidIndex >= 0) {
_this.triggerEvent('fail', { type: 1, errMsg: 'chooseImage:fail size exceed ' + _this.data.maxSize, total: res.tempFilePaths.length, index: invalidIndex }, {});
return;
}
var mgr = wx.getFileSystemManager();
var contents = res.tempFilePaths.map(function (item) {
var fileContent = mgr.readFileSync(item);
return fileContent;
});
var obj = { tempFilePaths: res.tempFilePaths, tempFiles: res.tempFiles, contents: contents };
_this.triggerEvent('select', obj, {});
var files = res.tempFilePaths.map(function (item, i) {
return { loading: true, url: 'data:image/jpg;base64,' + wx.arrayBufferToBase64(contents[i]) };
});
if (!files || !files.length) return;
if (typeof _this.data.upload === 'function') {
var len = _this.data.files.length;
var newFiles = _this.data.files.concat(files);
_this.setData({ files: newFiles, currentFiles: newFiles });
_this.loading = true;
_this.data.upload(obj).then(function (json) {
_this.loading = false;
if (json.urls) {
var oldFiles = _this.data.files;
json.urls.forEach(function (url, index) {
oldFiles[len + index].url = url;
oldFiles[len + index].loading = false;
});
_this.setData({ files: oldFiles, currentFiles: newFiles });
_this.triggerEvent('success', json, {});
} else {
_this.triggerEvent('fail', { type: 3, errMsg: 'upload file fail, urls not found' }, {});
}
}).catch(function (err) {
_this.loading = false;
var oldFiles = _this.data.files;
res.tempFilePaths.map(function (item, index) {
oldFiles[len + index].error = true;
oldFiles[len + index].loading = false;
});
_this.setData({ files: oldFiles, currentFiles: newFiles });
_this.triggerEvent('fail', { type: 3, errMsg: 'upload file fail', error: err }, {});
});
}
},
fail: function fail(_fail) {
if (_fail.errMsg.indexOf('chooseImage:fail cancel') >= 0) {
_this.triggerEvent('cancel', {}, {});
return;
}
_fail.type = 2;
_this.triggerEvent('fail', _fail, {});
}
});
},
deletePic: function deletePic(e) {
var index = e.detail.index;
var files = this.data.files;
var file = files.splice(index, 1);
this.setData({
files: files,
currentFiles: files
});
this.triggerEvent('delete', { index: index, item: file[0] });
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {
"mp-gallery": "../gallery/gallery"
}
}
<view class="weui-uploader {{extClass}}">
<view class="weui-uploader__hd">
<view class="weui-uploader__overview">
<view class="weui-uploader__title">{{title}}</view>
<view class="weui-uploader__info" wx:if="{{maxCount > 1}}">{{currentFiles.length}}/{{maxCount}}</view>
</view>
<view wx:if="{{tips}}" class="weui-uploader__tips">{{tips}}</view>
<view wx:else><slot name="tips"></slot></view>
</view>
<view class="weui-uploader__bd">
<view class="weui-uploader__files">
<block wx:for="{{currentFiles}}" wx:key="*this">
<view wx:if="{{item.error}}" data-index="{{index}}" bindtap="previewImage" class="weui-uploader__file weui-uploader__file_status">
<image class="weui-uploader__img" src="{{item.url}}" mode="aspectFill" />
<view class="weui-uploader__file-content">
<icon type="warn" size="23" color="#F43530"></icon>
</view>
</view>
<view wx:elif="{{item.loading}}" data-index="{{index}}" bindtap="previewImage" class="weui-uploader__file weui-uploader__file_status">
<image class="weui-uploader__img" src="{{item.url}}" mode="aspectFill" />
<view class="weui-uploader__file-content">
<view class="weui-loading"></view>
</view>
</view>
<view wx:else class="weui-uploader__file" data-index="{{index}}" bindtap="previewImage">
<image class="weui-uploader__img" src="{{item.url}}" mode="aspectFill" />
</view>
</block>
</view>
<view wx:if="{{currentFiles.length < maxCount}}" class="weui-uploader__input-box">
<view class="weui-uploader__input" bindtap="chooseImage"></view>
</view>
</view>
</view>
<mp-gallery hide-on-click="{{true}}" show-delete="{{showDelete}}" show="{{showPreview}}" binddelete="deletePic" img-urls="{{previewImageUrls}}" current="{{previewCurrent}}"></mp-gallery>
.weui-uploader{flex:1}.weui-uploader__hd{padding-bottom:16px}.weui-uploader__overview{display:flex;align-items:center}.weui-uploader__title{flex:1}.weui-uploader__tips{color:rgba(0,0,0,0.3);font-size:14px;line-height:1.4;padding-top:4px}.weui-uploader__info{color:rgba(0,0,0,0.3)}.weui-uploader__bd{margin-bottom:-8px;margin-right:-8px;overflow:hidden}.weui-uploader__file{float:left;margin-right:8px;margin-bottom:8px}.weui-uploader__img{display:block;width:96px;height:96px}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,0.5)}.weui-uploader__file-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);color:#FFFFFF}.weui-uploader__input-box{float:left;position:relative;margin-right:8px;margin-bottom:8px;width:96px;height:96px;box-sizing:border-box;background-color:#EDEDED}.weui-uploader__input-box:before,.weui-uploader__input-box:after{content:" ";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);background-color:#A3A3A3}.weui-uploader__input-box:before{width:2px;height:32px}.weui-uploader__input-box:after{width:32px;height:2px}.weui-uploader__input-box:active{border-color:#8b8b8b}.weui-uploader__input-box:active:before,.weui-uploader__input-box:active:after{background-color:#8b8b8b}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;animation:weuiLoading 1s steps(12, end) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@keyframes weuiLoading{0%{transform:rotate3d(0, 0, 1, 0deg)}100%{transform:rotate3d(0, 0, 1, 360deg)}}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 26);
/******/ })
/************************************************************************/
/******/ ({
/***/ 26:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
pureDataPattern: /^_/
},
properties: {
duration: {
type: Number,
value: 500
},
easingFunction: {
type: String,
value: 'default'
},
loop: {
type: Boolean,
value: true
},
videoList: {
type: Array,
value: [],
observer: '_videoListChanged'
}
},
data: {
nextQueue: [],
prevQueue: [],
curQueue: [],
circular: false,
_last: 1,
_change: -1,
_invalidUp: 0,
_invalidDown: 0,
_videoContexts: []
},
lifetimes: {
attached: function attached() {
this.data._videoContexts = [wx.createVideoContext('video_0', this), wx.createVideoContext('video_1', this), wx.createVideoContext('video_2', this)];
}
},
methods: {
_videoListChanged: function _videoListChanged() {
var _this = this;
var newVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var data = this.data;
newVal.forEach(function (item) {
data.nextQueue.push(item);
});
if (data.curQueue.length === 0) {
this.setData({
curQueue: data.nextQueue.splice(0, 3)
}, function () {
_this.playCurrent(1);
});
}
},
animationfinish: function animationfinish(e) {
var _data = this.data,
_last = _data._last,
_change = _data._change,
curQueue = _data.curQueue,
prevQueue = _data.prevQueue,
nextQueue = _data.nextQueue;
var current = e.detail.current;
var diff = current - _last;
if (diff === 0) return;
this.data._last = current;
this.playCurrent(current);
this.triggerEvent('change', { activeId: curQueue[current].id });
var direction = diff === 1 || diff === -2 ? 'up' : 'down';
if (direction === 'up') {
if (this.data._invalidDown === 0) {
var change = (_change + 1) % 3;
var add = nextQueue.shift();
var remove = curQueue[change];
if (add) {
prevQueue.push(remove);
curQueue[change] = add;
this.data._change = change;
} else {
this.data._invalidUp += 1;
}
} else {
this.data._invalidDown -= 1;
}
}
if (direction === 'down') {
if (this.data._invalidUp === 0) {
var _change2 = _change;
var _remove = curQueue[_change2];
var _add = prevQueue.pop();
if (_add) {
curQueue[_change2] = _add;
nextQueue.unshift(_remove);
this.data._change = (_change2 - 1 + 3) % 3;
} else {
this.data._invalidDown += 1;
}
} else {
this.data._invalidUp -= 1;
}
}
var circular = true;
if (nextQueue.length === 0 && current !== 0) {
circular = false;
}
if (prevQueue.length === 0 && current !== 2) {
circular = false;
}
this.setData({
curQueue: curQueue,
circular: circular
});
},
playCurrent: function playCurrent(current) {
this.data._videoContexts.forEach(function (ctx, index) {
index !== current ? ctx.pause() : ctx.play();
});
},
onPlay: function onPlay(e) {
this.trigger(e, 'play');
},
onPause: function onPause(e) {
this.trigger(e, 'pause');
},
onEnded: function onEnded(e) {
this.trigger(e, 'ended');
},
onError: function onError(e) {
this.trigger(e, 'error');
},
onTimeUpdate: function onTimeUpdate(e) {
this.trigger(e, 'timeupdate');
},
onWaiting: function onWaiting(e) {
this.trigger(e, 'wait');
},
onProgress: function onProgress(e) {
this.trigger(e, 'progress');
},
onLoadedMetaData: function onLoadedMetaData(e) {
this.trigger(e, 'loadedmetadata');
},
trigger: function trigger(e, type) {
var ext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var detail = e.detail;
var activeId = e.target.dataset.id;
this.triggerEvent(type, Object.assign(Object.assign(Object.assign({}, detail), { activeId: activeId }), ext));
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="container">
<swiper
class="video-swiper"
circular="{{circular}}"
easing-function="{{easingFunction}}"
vertical
current="1"
duration="{{duration}}"
bindanimationfinish="animationfinish">
<!-- curQueue 循环会导致video重新插入,objectFit 不可变更 -->
<swiper-item wx:for="{{curQueue}}" wx:key="*this">
<video
id="video_{{index}}"
class="video_item"
loop="{{loop}}"
enable-play-gesture
enable-progress-gesture
show-center-play-btn="{{false}}"
controls="{{false}}"
src="{{item.url}}"
data-id="{{item.id}}"
object-fit="{{item.objectFit || 'cover'}}"
data-index="{{index}}"
bindplay="onPlay"
bindpause="onPause"
bindended="onEnded"
binderror="onError"
bindtimeupdate="onTimeUpdate"
bindwaiting="onWaiting"
bindprogress="onProgress"
bindloadedmetadata="onLoadedMetaData"
>
</video>
</swiper-item>
</swiper>
</view>
.container{width:100%;height:100%}.video-swiper{width:100%;height:100%}.video_item{height:100%;width:100%}
\ No newline at end of file
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
page{line-height:1.6;font-family:-apple-system-font,Helvetica Neue,sans-serif}icon{vertical-align:middle}.weui-cells{position:relative;margin-top:8px;background-color:#fff;line-height:1.41176471;font-size:17px}.weui-cells:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-cells:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-cells__title{margin-top:16px;margin-bottom:3px;padding-left:16px;padding-right:16px;color:rgba(0,0,0,.5);font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:3px;color:rgba(0,0,0,.5);padding-left:16px;padding-right:16px;font-size:14px}.weui-cell{padding:16px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-cell:first-child:before{display:none}.weui-cell_active{background-color:#ececec}.weui-cell_primary{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-cell__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-cell__ft{text-align:right;color:rgba(0,0,0,.5)}.weui-cell_label-block,.weui-cell_wxss.weui-cell_wxss:before{display:block}.weui-cell_label-block .weui-label{width:auto;word-break:normal;-webkit-hyphens:auto;hyphens:auto}.weui-cell_access{color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-cell__ft_in-access{padding-right:16px;position:relative}.weui-cell__ft_in-access:after{content:" ";display:inline-block;height:8px;width:8px;border-width:2px 2px 0 0;border-color:#b2b2b2;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;margin-top:-5px;right:0}.weui-cell_link{color:#576b95;font-size:17px}.weui-cell_link:active{background-color:#ececec}.weui-cell_link:first-child:before{display:block}.weui-cells_checkbox .weui-check__label:before{left:55px}.weui-check__label:active{background-color:#ececec}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:16px}.weui-cell__ft_in-radio{padding-left:16px}.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:1.41176471em;min-height:1.41176471em;line-height:1.41176471}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:rgba(0,0,0,.3);text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#fa5151}.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:16px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-form-preview__bd{padding:16px;font-size:.9em;text-align:right;color:rgba(0,0,0,.5);line-height:2}.weui-form-preview__ft{position:relative;line-height:56px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:rgba(0,0,0,.5);text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#576b95;text-align:center;font-weight:700;font-size:17px}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#ececec}.weui-form-preview__btn_default{color:rgba(0,0,0,.9)}.weui-form-preview__btn_primary{color:#576b95}.weui-cell_select{padding:0;overflow:hidden}.weui-cell_select .weui-select{padding-right:30px}.weui-cell_select .weui-cell__bd:after{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-select{-webkit-appearance:none;border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:56px;line-height:56px;position:relative;z-index:1;padding-left:16px}.weui-cell_select-before{padding-right:16px}.weui-cell_select-before .weui-select{width:105px;box-sizing:border-box}.weui-cell_select-before .weui-cell__hd{position:relative}.weui-cell_select-before .weui-cell__hd:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-cell_select-before .weui-cell__hd:before{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-cell_select-before .weui-cell__bd{padding-left:16px}.weui-cell_select-before .weui-cell__bd:after{display:none}.weui-cell_select-before.weui-cell_access .weui-cell__hd{line-height:56px;padding-left:32px}.weui-cell_select-after{padding-left:16px}.weui-cell_select-after .weui-select{padding-left:0}.weui-cell_select-after.weui-cell_access .weui-cell__bd{line-height:56px}.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:3.29411765em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1rpx solid rgba(0,0,0,.1);line-height:3.29411765em;font-size:17px;color:#576b95;white-space:nowrap}button.weui-vcode-btn{min-height:0;background-color:transparent;border:0;outline:0}.weui-vcode-btn:active{color:#767676}.weui-cell_switch{padding-top:12px;padding-bottom:12px}.weui-uploader{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__hd{padding-bottom:16px}.weui-uploader__overview{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-uploader__title{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__tips{color:rgba(0,0,0,.3);font-size:14px;line-height:1.4;padding-top:4px}.weui-uploader__info{color:rgba(0,0,0,.3)}.weui-uploader__bd{margin-bottom:-8px;margin-right:-8px;overflow:hidden}.weui-uploader__file{float:left;margin-right:8px;margin-bottom:8px}.weui-uploader__img{display:block;width:96px;height:96px}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui-uploader__file-content{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff}.weui-uploader__input-box{float:left;position:relative;margin-right:8px;margin-bottom:8px;width:96px;height:96px;box-sizing:border-box;background-color:#ededed}.weui-uploader__input-box:after,.weui-uploader__input-box:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#a3a3a3}.weui-uploader__input-box:before{width:2px;height:32px}.weui-uploader__input-box:after{width:32px;height:2px}.weui-uploader__input-box:active{border-color:#8b8b8b}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{background-color:#8b8b8b}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}.weui-article{padding:24px 16px;padding:24px calc(16px + constant(safe-area-inset-right)) calc(24px + constant(safe-area-inset-bottom)) calc(16px + constant(safe-area-inset-left));padding:24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));font-size:17px;color:rgba(0,0,0,.9)}.weui-article__section{margin-bottom:1.5em}.weui-article__h1{font-size:22px;font-weight:700;margin-bottom:.9em;line-height:1.4}.weui-article__h2{font-size:17px}.weui-article__h2,.weui-article__h3{font-weight:700;margin-bottom:.34em;line-height:1.4}.weui-article__h3{font-size:15px}.weui-article__p{margin:0 0 .8em}.weui-msg{padding-top:36px;padding:calc(36px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(36px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);text-align:center;line-height:1.4;min-height:100%;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;background-color:#fff}.weui-msg__link{color:#576b95;display:inline-block;vertical-align:baseline}.weui-msg__icon-area{margin-bottom:32px}.weui-msg__text-area{margin-bottom:32px;padding:0 32px;-webkit-box-flex:1;-webkit-flex:1;flex:1;line-height:1.6}.weui-msg__text-area:first-child{padding-top:96px}.weui-msg__title{margin-bottom:5px;font-weight:700;font-size:22px;word-wrap:break-word;word-break:break-all}.weui-msg__desc{font-size:17px;color:rgba(0,0,0,.9)}.weui-msg__desc,.weui-msg__desc-primary{word-wrap:break-word;word-break:break-all;margin-bottom:16px}.weui-msg__desc-primary{font-size:14px;color:rgba(0,0,0,.5)}.weui-msg__opr-area{margin-bottom:16px}.weui-msg__opr-area .weui-btn-area{margin:0 16px}.weui-msg__opr-area .weui-btn+.weui-btn{margin-bottom:16px}.weui-msg__opr-area:last-child{margin-bottom:96px}.weui-msg__opr-area+.weui-msg__extra-area{margin-top:48px}.weui-msg__tips-area{margin-bottom:16px;padding:0 40px}.weui-msg__opr-area+.weui-msg__tips-area{margin-bottom:48px}.weui-msg__tips-area:last-child{margin-bottom:64px}.weui-msg__extra-area,.weui-msg__tips{font-size:12px;color:rgba(0,0,0,.5)}.weui-msg__extra-area{position:static;margin-bottom:24px}.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cell:before,.weui-cells__group_form .weui-cells:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px;color:rgba(0,0,0,.9)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:#fa5151}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:#06ae56;background-color:#f2f2f2}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-form{padding:56px 0 0;padding:calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;min-height:100%;box-sizing:border-box;line-height:1.4;background-color:#fff}.weui-form a:not(.weui-btn){color:#576b95}.weui-form .weui-footer,.weui-form .weui-footer__link{font-size:12px}.weui-form .weui-agree{padding:0}.weui-form__text-area{padding:0 32px;color:rgba(0,0,0,.9);text-align:center}.weui-form__control-area{-webkit-box-flex:1;-webkit-flex:1;flex:1;margin:48px 0}.weui-form__extra-area,.weui-form__tips-area{margin-bottom:24px;text-align:center}.weui-form__opr-area{margin-bottom:64px}.weui-form__opr-area:last-child{margin-bottom:96px}.weui-form__title{font-size:22px;font-weight:700;line-height:1.36}.weui-form__desc{font-size:17px;margin-top:16px}.weui-form__tips{color:rgba(0,0,0,.5);font-size:12px}.weui-flex{display:-webkit-box;display:-webkit-flex;display:flex}.weui-flex__item{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn+.weui-btn{margin-top:16px}.weui-btn.weui-btn_inline+.weui-btn.weui-btn_inline{margin-top:auto;margin-left:16px}.weui-btn-area{margin:48px 16px 8px}.weui-btn-area_inline{display:-webkit-box;display:-webkit-flex;display:flex}.weui-btn-area_inline .weui-btn{margin-top:auto;margin-right:16px;width:100%;-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn-area_inline .weui-btn:last-child{margin-right:0}.weui-agree{display:block;padding:.5em 15px;font-size:13px}.weui-agree__text{color:rgba(0,0,0,.5)}.weui-agree__link{display:inline;color:#576b95}.weui-agree__checkbox{position:absolute;left:-9999px}.weui-agree__checkbox-icon{position:relative;top:2px;display:inline-block;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:11px;height:11px}.weui-agree__checkbox-icon-check{position:absolute;top:1px;left:1px}.weui-footer{color:rgba(0,0,0,.3);font-size:14px;line-height:1.4;text-align:center}.weui-footer_fixed-bottom{position:fixed;bottom:16px;bottom:calc(16px + constant(safe-area-inset-bottom));bottom:calc(16px + env(safe-area-inset-bottom));left:0;right:0}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 8px;position:relative;font-size:14px;color:#576b95}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #c7c7c7;color:#c7c7c7;left:-8px;top:.36em;bottom:.36em}.weui-footer__link:first-child:before{display:none}.weui-footer__text{padding:0 .34em;font-size:12px}.weui-grids{border-top:1rpx solid rgba(0,0,0,.1);border-left:1rpx solid rgba(0,0,0,.1);overflow:hidden}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid rgba(0,0,0,.1);border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-grid_active{background-color:#ececec}.weui-grid__icon{display:block;width:28px;height:28px;margin:0 auto}.weui-grid__label{margin-top:5px;display:block;text-align:center;color:rgba(0,0,0,.9);font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:a 1s steps(12) infinite;animation:a 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.wx_dot_loading,.wx_dot_loading:after,.wx_dot_loading:before{display:inline-block;vertical-align:middle;width:6px;height:6px;border-radius:50%;background-color:rgba(0,0,0,.3);font-size:0;-webkit-animation:c 1.6s step-start infinite;animation:c 1.6s step-start infinite}.wx_dot_loading{position:relative}.wx_dot_loading:before{content:"";position:absolute;left:-12px;background-color:rgba(0,0,0,.1);-webkit-animation:b 1.6s step-start infinite;animation:b 1.6s step-start infinite}.wx_dot_loading:after{content:"";position:absolute;right:-12px;background-color:rgba(0,0,0,.5);-webkit-animation:d 1.6s step-start infinite;animation:d 1.6s step-start infinite}@-webkit-keyframes b{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@keyframes b{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@-webkit-keyframes c{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@keyframes c{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@-webkit-keyframes d{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}@keyframes d{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}.wx_dot_loading_white{background-color:hsla(0,0%,100%,.3);-webkit-animation:f 1.6s step-start infinite;animation:f 1.6s step-start infinite}.wx_dot_loading_white:before{background-color:hsla(0,0%,100%,.5);-webkit-animation:e 1.6s step-start infinite;animation:e 1.6s step-start infinite}.wx_dot_loading_white:after{background-color:hsla(0,0%,100%,.1);-webkit-animation:g 1.6s step-start infinite;animation:g 1.6s step-start infinite}@-webkit-keyframes e{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@keyframes e{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@-webkit-keyframes f{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@keyframes f{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@-webkit-keyframes g{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}@keyframes g{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}.weui-loadmore{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.weui-loadmore__tips{display:inline-block;vertical-align:middle}.weui-loadmore_line{border-top:1px solid rgba(0,0,0,.1);margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-.9em;padding:0 .55em;background-color:#fff;color:rgba(0,0,0,.5)}.weui-loadmore__tips_in-dot{position:relative;padding:0 .16em;width:4px;height:1.6em}.weui-loadmore__tips_in-dot:before{content:" ";position:absolute;top:50%;left:50%;margin-top:-1px;margin-left:-2px;width:4px;height:4px;border-radius:50%;background-color:rgba(0,0,0,.1)}.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#fa5151;color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}.weui-panel{background-color:#fff;margin-top:10px;position:relative;overflow:hidden}.weui-panel:first-child{margin-top:0}.weui-panel:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-panel:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-panel__hd{padding:16px 16px 13px;color:rgba(0,0,0,.9);font-size:15px;font-weight:700;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-media-box{padding:16px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:1s6px}.weui-media-box:first-child:before{display:none}.weui-media-box__title{font-weight:400;font-size:17px;color:rgba(0,0,0,.9);width:auto;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc,.weui-media-box__title{line-height:1.4;overflow:hidden;text-overflow:ellipsis}.weui-media-box__desc{color:rgba(0,0,0,.5);font-size:14px;padding-top:4px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:16px;padding-bottom:4px;font-size:13px;color:#cecece;line-height:1em;list-style:none;overflow:hidden}.weui-media-box__info__meta{float:left;padding-right:1em}.weui-media-box__info__meta_extra{padding-left:1em;border-left:1px solid #cecece}.weui-media-box__title_in-text{margin-bottom:8px}.weui-media-box_appmsg{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-media-box__thumb{width:100%;height:100%;vertical-align:top}.weui-media-box__hd_in-appmsg{margin-right:16px;width:60px;height:60px;line-height:60px;text-align:center}.weui-media-box__bd_in-appmsg{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:0}.weui-media-box_small-appmsg{padding:0}.weui-cells_in-small-appmsg{margin-top:0}.weui-cells_in-small-appmsg:before{display:none}.weui-progress{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-progress__bar{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-progress__opr{margin-left:15px;font-size:0}.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#fff;border-bottom:1rpx solid rgba(0,0,0,.1);padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.weui-navbar+.weui-tab__panel{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:16px;padding:calc(16px + constant(safe-area-inset-top)) 16px 16px;padding:calc(16px + env(safe-area-inset-top)) 16px 16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-navbar__item:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-navbar__item.weui-bar__item_on{background-color:#ececec}.weui-navbar__item:first-child{padding-left:calc(16px + constant(safe-area-inset-left));padding-left:calc(16px + env(safe-area-inset-left))}.weui-navbar__item:last-child{padding-right:calc(16px + constant(safe-area-inset-right));padding-right:calc(16px + env(safe-area-inset-right))}.weui-navbar__item:last-child:after{display:none}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:2px;background-color:#07c160;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;display:none}.weui-navbar__title{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.weui-tabbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#f7f7f7}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-tabbar__item{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:8px 0 4px;padding-bottom:calc(8px + constant(safe-area-inset-bottom));padding-bottom:calc(8px + env(safe-area-inset-bottom));font-size:0;color:rgba(0,0,0,.5);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-tabbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#07c160}.weui-tabbar__icon{display:inline-block;width:28px;height:28px;margin-bottom:2px}.weui-tabbar__icon>i,i.weui-tabbar__icon{font-size:24px;color:rgba(0,0,0,.5)}.weui-tabbar__icon image{width:100%;height:100%}.weui-tabbar__label{color:rgba(0,0,0,.9);font-size:10px;line-height:1.4}.weui-tab{display:-webkit-box;display:-webkit-flex;display:flex;height:100%;box-sizing:border-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.weui-tab__panel{box-sizing:border-box;-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}:host{width:100%}.weui-slideview{overflow:hidden;position:relative}.weui-slideview__left{position:relative;z-index:10}.weui-slideview__right{position:absolute;z-index:1;left:100%;top:0;height:100%}.weui-slideview__btn__wrp{position:absolute;left:0;bottom:0;text-align:center;min-width:69px;height:100%;white-space:nowrap}.weui-slideview__btn{color:#fff;padding:0 17px}.weui-slideview__btn-group_default .weui-slideview__btn{background:#c7c7cc}.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_default:first-child:before{display:none}.weui-slideview__btn-group_warn .weui-slideview__btn{background:#fe3b30}.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_warn:first-child:before{display:none}.weui-slideview_icon .weui-slideview__btn__wrp{background:transparent;font-size:0}.weui-slideview_icon .weui-slideview__btn__wrp:after{content:"";width:0;height:100%;vertical-align:middle;display:inline-block}.weui-slideview_icon .weui-slideview__btn__wrp:first-child{padding-left:16px}.weui-slideview_icon .weui-slideview__btn__wrp:last-child{padding-right:8px}.weui-slideview_icon .weui-slideview__btn{width:48px;height:48px;line-height:48px;padding:0;display:inline-block;vertical-align:middle;border-radius:50%;background-color:#fff}.weui-slideview_icon .weui-slideview__btn__icon{display:inline-block;vertical-align:middle;width:22px;height:22px}.weui-gallery{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;z-index:1000;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;opacity:0;visibility:hidden;-webkit-transition:opacity .3s;transition:opacity .3s}.weui-gallery_show{display:-webkit-box;display:-webkit-flex;display:flex;visibility:visible;opacity:1}.weui-gallery__img__wrp{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;font-size:0}.weui-gallery__img{background:50% no-repeat;background-size:contain;position:absoulte;width:100%;height:100%}.weui-gallery__opr{background-color:#0d0d0d;color:#fff;line-height:60px;min-height:60px;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);text-align:center}.weui-gallery__opr navigator{color:#fff}.weui-gallery__del{display:block}.weui-gallery__info{color:#fff;font-size:17px;line-height:60px;min-height:60px;text-align:center}.weui-search-bar{position:relative;padding:8px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:#ededed;-webkit-text-size-adjust:100%;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-icon-search{margin-right:8px;font-size:14px;vertical-align:top;margin-top:.64em;height:1em;line-height:1em}.weui-icon-search_in-box{position:absolute;left:12px;top:50%;margin-top:-8px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:top}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;border-radius:4px;background:#fff}.weui-search-bar__box{position:relative;padding-left:32px;padding-right:32px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:32px;line-height:32px;font-size:14px;caret-color:#07c160}.weui-icon-clear{position:absolute;top:0;right:0;bottom:0;padding:0 12px;font-size:0}.weui-icon-clear:after{content:"";height:100%;vertical-align:middle;display:inline-block;width:0;overflow:hidden}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:4px;text-align:center;color:rgba(0,0,0,.5);background:#fff;line-height:32px}.weui-search-bar__cancel-btn{margin-left:8px;line-height:32px;color:#576b95;white-space:nowrap}icon[type=success]:after,icon[type=success]:before{color:#07c160!important}.weui-mask{background:rgba(0,0,0,.6)}.weui-mask,.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-dialog__wrp{position:fixed;z-index:5000;top:16px;bottom:16px;left:16px;right:16px;text-align:center;font-size:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__wrp .weui-dialog{max-height:100%}.weui-dialog{background-color:#fff;text-align:center;border-radius:12px;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;max-height:90%}.weui-dialog__hd{padding:32px 24px 16px}.weui-dialog__title{font-weight:700;font-size:17px;line-height:1.4}.weui-dialog__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 24px;margin-bottom:32px;min-height:40px;font-size:17px;line-height:1.4;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;color:rgba(0,0,0,.5)}.weui-dialog__bd:first-child{padding:32px 24px 0;font-weight:700;color:rgba(0,0,0,.9);-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__bd:first-child,.weui-dialog__ft{display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft{position:relative;line-height:64px;min-height:64px;font-size:17px}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#576b95;font-weight:700;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.weui-dialog__btn:active{background-color:#ececec}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:rgba(0,0,0,.9)}@media screen and (min-width:352px){.weui-dialog{width:320px;margin:0 auto}}.weui-actionsheet{position:fixed;left:0;bottom:0;-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:5000;width:100%;background-color:#eae7e8;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden}.weui-actionsheet__title{position:relative;height:56px;padding:0 24px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;text-align:center;font-size:12px;color:rgba(0,0,0,.5);line-height:1.4;background:#fff}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{color:rgba(0,0,0,.9);background-color:#fff}.weui-actionsheet__action{margin-top:8px;background-color:#fff;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-actionsheet__cell{position:relative;padding:16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__cell:active{background-color:#ececec}.weui-actionsheet__cell:first-child:before{display:none}.weui-actionsheet__cell_warn{color:#fa5151}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:274px;box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden;background:transparent;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-radius:2px}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,.1)}.weui-skin_android .weui-actionsheet__cell{padding:16px;font-size:17px;line-height:1.41176471;color:rgba(0,0,0,.9);text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{-webkit-transform:translate(0);transform:translate(0)}.weui-half-screen-dialog{position:fixed;left:0;right:0;bottom:0;max-height:75%;z-index:5000;line-height:1.4;background-color:#fff;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden;padding:0 24px;padding:0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));padding:0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))}.weui-half-screen-dialog__hd{font-size:8px;height:8em;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-half-screen-dialog__hd .weui-icon-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.weui-half-screen-dialog__hd__side{position:relative;left:-8px}.weui-half-screen-dialog__hd__main{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main{text-align:center;padding:0 40px}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side{right:-8px;left:auto}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn{right:0}.weui-half-screen-dialog__title{display:block;color:rgba(0,0,0,.9);font-weight:700;font-size:15px}.weui-half-screen-dialog__subtitle{display:block;color:rgba(0,0,0,.5);font-size:10px}.weui-half-screen-dialog__bd{word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;overflow-y:auto}.weui-half-screen-dialog__desc{padding-top:4px;font-size:17px;font-weight:700;color:rgba(0,0,0,.9);line-height:1.4}.weui-half-screen-dialog__tips{padding-top:16px;font-size:14px;color:rgba(0,0,0,.3);line-height:1.4}.weui-half-screen-dialog__ft{padding:40px 24px 32px;text-align:center}.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn{display:inline-block;vertical-align:top;margin:0 8px;width:120px}.weui-icon-btn{background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;background-size:100%;border:0;outline:0;font-size:0}.weui-icon-btn_goback{width:12px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M26 39.438L24.955 40.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42l7.666-7.79L26 24.563 18.682 32 26 39.438z'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_close{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Cpath id='33cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a' d='M8 6.943L1.807.75.75 1.807 6.943 8 .75 14.193l1.057 1.057L8 9.057l6.193 6.193 1.057-1.057L9.057 8l6.193-6.193L14.193.75z'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cuse fill='%23000' fill-opacity='.9' transform='translate(20 24)' xlink:href='%2333cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_more{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-374 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M380.75 32a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zm5.25-1.75a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E %3C/g%3E%3C/svg%3E")}.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(-108%);transform:translateZ(0) translateY(-108%);text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:hsla(0,0%,100%,.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#fa5151}.weui-toptips_success{background-color:#09bb07}.weui-toptips_error{background-color:#fa5151}.weui-toptips_info{background-color:#10aeff}page{--height:44px;--right:190rpx}.weui-navigation-bar{overflow:hidden}.weui-navigation-bar .android{--height:48px;--right:222rpx}.weui-navigation-bar__inner{position:fixed;top:0;left:0;z-index:5001;height:var(--height);padding-right:var(--right);width:calc(100% - var(--right))}.weui-navigation-bar__inner,.weui-navigation-bar__inner .weui-navigation-bar__left{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-navigation-bar__inner .weui-navigation-bar__left{position:relative;width:var(--right);padding-left:16px;-webkit-box-pack:center}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn{display:inline-block;vertical-align:middle;background-repeat:no-repeat}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback{font-size:12px;width:1em;height:2em;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E");background-position:50% 50%;background-size:cover}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active{opacity:.5}.weui-navigation-bar__inner .weui-navigation-bar__center{font-size:17px;text-align:center;position:relative;-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-navigation-bar__inner .weui-navigation-bar__loading{font-size:0}.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading{margin-left:0}.weui-navigation-bar__inner .weui-navigation-bar__right{margin-right:16px}.weui-navigation-bar__placeholder{height:var(--height);background:#f8f8f8;position:relative;z-index:50}
\ No newline at end of file
{
"name": "weapp-base",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"jsbn": {
"version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-1.1.0.tgz",
"integrity": "sha1-sBMHyym2GKHtJux56RH4A8TaAEA="
},
"miniprogram-sm-crypto": {
"version": "0.1.0",
"resolved": "https://registry.npm.taobao.org/miniprogram-sm-crypto/download/miniprogram-sm-crypto-0.1.0.tgz",
"integrity": "sha1-WtB7oz9tY5WjCTU5TQqdUtZUlqc=",
"requires": {
"jsbn": "^1.1.0"
}
},
"weui-miniprogram": {
"version": "0.2.2",
"resolved": "https://registry.npm.taobao.org/weui-miniprogram/download/weui-miniprogram-0.2.2.tgz",
"integrity": "sha1-ThiOYn86WbLtaIW/Vfj0udCA7WU="
}
}
}
{
"name": "weapp-base",
"version": "1.0.0",
"description": "midoo weapp-base project",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"weui-miniprogram": "^0.2.2",
"miniprogram-sm-crypto": "^0.1.0"
}
}
// pages/index/index.js
Page({
data: {
selectIndex: 0
},
NavChange(e) {
this.setData({
PageCur: e.currentTarget.dataset.cur
})
},
tapSelect(data) {
this.setData({
selectIndex: data.detail.index
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {
"custom-tab": "/components/custom-tab/index"
}
}
\ No newline at end of file
<custom-tab bind:tabSelect='tapSelect' currentIndex="{{selectIndex}}"></custom-tab>
\ No newline at end of file
/* pages/index/index.wxss */
\ No newline at end of file
//index.js
//获取应用实例
const app = getApp()
Page({
data: {
error: ""
},
goCustomPage () {
wx.navigateTo({
url: '/pages/custom-tab/index',
})
},
onLoad: function () {
},
onShow: function () {
this.setData({
error: '这是一个错误提示'
})
},
})
{
"usingComponents": {
"mp-toptips": "/miniprogram_npm//weui-miniprogram/toptips/toptips"
}
}
\ No newline at end of file
<!--index.wxml-->
<view class="container">
<button type="primary" bindtap="goCustomPage">custom-tab测试</button>
</view>
/**index.wxss**/
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
}
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
.userinfo-nickname {
color: #aaa;
}
.usermotto {
margin-top: 200px;
}
\ No newline at end of file
// pages/login.js
import { showMsgSuccess, showMsgError, showLoading } from "../../utils/tools"
Page({
options: {
addGlobalClass: true,
multipleSlots: true // 启用slot属性
},
/**
* 页面的初始数据
*/
data: {
show: false,
buttons: [
{
type: 'default',
className: '',
text: '拒绝',
value: 0
},
{
type: 'primary',
className: '',
text: '允许',
value: 1
}
]
},
open: function () {
this.setData({
show: true
})
},
buttontap (e) {
console.log(e.detail)
},
onGotUserInfo: function (e) {
console.log(e.detail.errMsg)
console.log(e.detail.userInfo)
console.log(e.detail.rawData)
},
getPhoneNumber (e) {
console.log(e.detail.errMsg)
console.log(e.detail.iv)
console.log(e.detail.encryptedData)
if(!e.detail.errMsg) {
this.setData({
show: true
})
}
},
wxLogin () {
// showMsgSuccess()
// showLoading()
},
phoneLogin () {
wx.navigateTo({
url: '/pages/login/phoneLogin/index'
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {
"mp-halfScreenDialog": "/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog"
},
"navigationBarTextStyle": "black"
}
\ No newline at end of file
<view class="login-content">
<image class="login-banner" src="https://bpic.588ku.com/back_list_pic/19/07/03/76bef13e0820b1694e3a67fb6334f830.jpg!/fw/320/quality/90/unsharp/true/compress/true" lazy-load="false"></image>
<view class="btn-container">
<!-- <button type="primary" class="btn" bindtap="open" open-type="getUserInfo" bindgetuserinfo="onGotUserInfo">微信直接登录</button> -->
<button type="primary" class="btn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">微信直接登录</button>
<button class="phone-btn btn" bind:tap="phoneLogin">手机号验证码登录</button>
</view>
<mp-halfScreenDialog
bindbuttontap="buttontap"
show="{{show}}"
maskClosable="{{true}}"
closabled="{{false}}"
buttons="{{buttons}}"
>
<view slot="title">
<view>瑞信咖啡申请使用</view>
<text>你的手机号码</text>
</view>
<view slot="desc">
<view>13925053812</view>
<text>使用其他的手机号码</text>
</view>
</mp-halfScreenDialog>
</view>
/* pages/login.wxss */
.login-content {
background-color: #fff;
}
.btn-container {
margin-top: 30rpx;
padding-bottom: 100rpx;
}
.btn {
width: 600rpx;
margin: 0 auto;
border-radius: 100rpx;
font-size: 30rpx;
padding: 10rpx;
}
.btn + .btn {
margin-top: 30rpx;
}
.login-banner {
width: 100%;
height: 500rpx;
}
.phone-btn {
background-color: rgb(34, 81, 151);
color: #fff;
}
.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn {
display: none;
}
\ No newline at end of file
// pages/login/phoneLogin/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTextStyle": "black"
}
\ No newline at end of file
<view class="phoneLogin-content">
phone
</view>
/* pages/login/phoneLogin/index.wxss */
\ No newline at end of file
// pages/user/cmps/userinfo/index.js
const app = getApp()
Component({
options: {
addGlobalClass: true,
multipleSlots: true // 启用slot属性
},
/**
* 组件的属性列表
*/
properties: {
userInfo: {
type: Object
}
},
/**
* 组件的初始数据
*/
data: {
StatusBar: app.globalData.StatusBar,
CustomBar: app.globalData.CustomBar,
Custom: app.globalData.Custom,
src: 'https://res.wx.qq.com/wxdoc/dist/assets/img/0.4cb08bb4.jpg'
},
/**
* 组件的方法列表
*/
methods: {
goLogin() {
this.triggerEvent("goLogin")
},
}
})
{
"component": true,
"usingComponents": {},
"window": {
"navigationStyle": "custom"
}
}
\ No newline at end of file
<view class="userinfo">
<view class='svg-box'>
<!-- <view class="user" wx:if="{{userInfo.isShow}}">
<view class="cu-avatar xl round margin-left" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg);"></view>
<view class="info">
<view>
<text class="username">{{userInfo.username}}</text>
<text class="vip">{{userInfo.vip}}</text>
</view>
<text class="tag">{{userInfo.tag}}</text>
</view>
<view class="setting">
<slot name="handle-label"></slot>
</view>
</view> -->
<view class="login">
<view class="login-content">
<image style="width: 200rpx; height: 200rpx;border-radius: 100%;background-color: #eeeeee;margin: 0 20rpx" mode="withFix" src="{{src}}"></image>
<text class='login-label' bind:tap="goLogin">登录/注册</text>
<text class="cuIcon-right lg text-white login-icon"></text>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* pages/user/cmps/userinfo/index.wxss */
.userinfo {
width: 100%;
height: 456rpx;
position: fixed;
top: 0;
}
.svg-box {
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0' y='0' viewBox='0 0 360 219' xml:space='preserve' class='position-absolute' style='fill: url(&quot;%23linear-gradient&quot;);'%3E %3ClinearGradient id='linear-gradient' gradientUnits='userSpaceOnUse' x1='29.2925' y1='-34.9094' x2='330.7075' y2='128.0078'%3E %3Cstop offset='0' style='stop-color: rgb(236, 75, 52);'%3E%3C/stop%3E %3Cstop offset='1' style='stop-color: rgb(221, 28, 44);'%3E%3C/stop%3E %3C/linearGradient%3E %3Cpath d='M 0 0 h 260 v 130 C 300 153 230 164 160 162 S 40 150 0 130 V 0 Z M 0 0 h 360 v 130 C 300 153 230 164 160 162 S 40 150 0 130 V 0 Z M 0 0 h 360 v 130 C 300 153 230 164 160 162 S 40 150 0 130 V 0 Z' class='st0'%3E%3C/path%3E %3C/svg%3E");
/* background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0' y='0' viewBox='0 0 360 219' xml:space='preserve' class='position-absolute' style='fill: url(&quot;%23linear-gradient&quot;);'%3E %3ClinearGradient id='linear-gradient' gradientUnits='userSpaceOnUse' x1='29.2925' y1='-34.9094' x2='330.7075' y2='128.0078'%3E %3Cstop offset='0' style='stop-color: rgb(236, 75, 52);'%3E%3C/stop%3E %3Cstop offset='1' style='stop-color: rgb(221, 28, 44);'%3E%3C/stop%3E %3C/linearGradient%3E %3Cpath d='M 0 0 h 260 v 90 C 300 113 230 124 160 122 S 40 110 0 90 V 0 Z M 0 0 h 360 v 90 C 300 113 230 124 160 122 S 40 110 0 90 V 0 Z M 0 0 h 360 v 90 C 300 113 230 124 160 122 S 40 110 0 90 V 0 Z' class='st0'%3E%3C/path%3E %3C/svg%3E"); */
/* background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0' y='0' viewBox='0 0 360 219' xml:space='preserve' class='position-absolute' style='fill: url(&quot;%23linear-gradient&quot;);'%3E %3ClinearGradient id='linear-gradient' gradientUnits='userSpaceOnUse' x1='29.2925' y1='-34.9094' x2='330.7075' y2='218.0078'%3E %3Cstop offset='0' style='stop-color: rgb(236, 75, 52);'%3E%3C/stop%3E %3Cstop offset='1' style='stop-color: rgb(221, 28, 44);'%3E%3C/stop%3E %3C/linearGradient%3E %3Cpath d='M 0 0 h 360 v 183.1 C 300 207 240 219 180 219 S 60 207 0 183.1 V 0 Z M 0 0 h 360 v 183.1 C 300 207 240 219 180 219 S 60 207 0 183.1 V 0 Z M 0 0 h 360 v 183.1 C 300 207 240 219 180 219 S 60 207 0 183.1 V 0 Z' class='st0'%3E%3C/path%3E %3C/svg%3E"); */
background-size: cover;
width: 100%;
height: 100%;
overflow: hidden;
}
.content {
position: sticky;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.nav {
width: 100%;
height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 32rpx;
position: static;
}
.user {
display: flex;
flex-direction: row;
align-items: center;
}
.info {
color: #fff;
padding-left: 30rpx;
display: flex;
flex-direction: column;
}
.username {
font-size: 44rpx;
margin-bottom: 6rpx;
}
.vip {
font-size: 24rpx;
color: #000;
display: inline-block;
background-color: rgba(0,0,0,.28);
padding: 4rpx 8rpx;
color: #fff;
border-radius: 8rpx;
vertical-align: top;
}
.tag {
padding: 4rpx;
font-size: 24rpx;
background: #e5e5e5;
border-radius: 10rpx;
color: #999;
}
/* login */
.login {
display: flex;
flex-direction: row;
align-items: flex-start;
}
.login-content {
margin-top: 60rpx;
font-size: 32rpx;
color: #fff;
margin-left: 16rpx;
display: flex;
flex-direction: row;
align-items: center;
}
/* .login-label, .login-icon {
display: inline-block;
vertical-align: middle;
} */
.login-label {
font-size: 32rpx;
}
.login-icon {
font-size: 26rpx;
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>svg</title>
<style>
* {
margin: 0;
}
.svg-box {
width: 100%;
height: 600px;
}
</style>
</head>
<body>
<div class='svg-box'>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0"
viewBox="0 0 360 219" xml:space="preserve" class="position-absolute"
style="fill: url(&quot;#linear-gradient&quot;);">
<linearGradient id="linear-gradient" gradientUnits="userSpaceOnUse" x1="29.2925" y1="-34.9094" x2="330.7075"
y2="128.0078">
<stop offset="0" style="stop-color: rgb(236, 75, 52);"></stop>
<stop offset="1" style="stop-color: rgb(221, 28, 44);"></stop>
</linearGradient>
<path
d="M 0 0 h 260 v 130 C 300 153 230 164 160 162 S 40 150 0 130 V 0 Z
M 0 0 h 360 v 130 C 300 153 230 164 160 162 S 40 150 0 130 V 0 Z
M 0 0 h 360 v 130 C 300 153 230 164 160 162 S 40 150 0 130 V 0 Z"
class="st0"></path>
</svg>
<!-- <path
d="M 0 0 h 260 v 90 C 300 113 230 124 160 122 S 40 110 0 90 V 0 Z
M 0 0 h 360 v 90 C 300 113 230 124 160 122 S 40 110 0 90 V 0 Z
M 0 0 h 360 v 90 C 300 113 230 124 160 122 S 40 110 0 90 V 0 Z"
class="st0"></path> -->
<!-- d="M 0 0 h 260 v 140.1 C 300 207 240 219 180 219 S 60 207 0 123.1 V 0 Z
M 0 0 h 360 v 183.1 C 300 207 240 219 180 219 S 60 207 0 123.1 V 0 Z
M 0 0 h 360 v 183.1 C 300 207 240 219 180 219 S 60 207 0 183.1 V 0 Z" -->
</div>
</body>
</html>
\ No newline at end of file
// pages/user/index.js
Page({
/**
* 页面的初始数据
*/
data: {
userInfo: {
username: "Reeyou",
vip: "vip",
tag: "小白信用分",
isShow: false
}
},
goLogin() {
wx.navigateTo({
url: '/pages/login/index',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {
"c-userinfo": "./cmps/userinfo/index"
}
}
\ No newline at end of file
<c-userinfo userInfo="{{userInfo}}" bindgoLogin="goLogin"></c-userinfo>
/* pages/user/index.wxss */
\ No newline at end of file
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": false,
"es6": true,
"enhance": false,
"postcss": true,
"minified": true,
"newFeature": true,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"libVersion": "2.10.4",
"appid": "wx641a7d3aee01641a",
"projectname": "weapp-base",
"debugOptions": {
"hidedInDevtools": []
},
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": 2,
"list": [
{
"id": -1,
"name": "pages/index/index",
"pathName": "pages/user/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/login/index",
"pathName": "pages/login/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/login/index",
"pathName": "pages/login/index",
"scene": null
}
]
}
}
}
\ No newline at end of file
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}
\ No newline at end of file
// generate time:2017-08-23 21:12:06
// Type definitions for wx app
// Definitions by: hellopao <https://github.com/hellopao/wx.d.ts>
/************************************************
* *
* 微信小程序 API *
* *
************************************************/
interface IAnimation {
/**
* 透明度,参数范围 0~1
*/
opacity(value: number): IAnimation;
/**
* 颜色值
*/
backgroundColor(color: string): IAnimation;
/**
* 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
*/
width(length: number): IAnimation;
/**
* 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
*/
height(length: number): IAnimation;
/**
* 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
*/
top(length: number): IAnimation;
/**
* 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
*/
left(length: number): IAnimation;
/**
* 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
*/
bottom(length: number): IAnimation;
/**
* 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
*/
right(length: number): IAnimation;
/**
* deg的范围-180~180,从原点顺时针旋转一个deg角度
*/
rotate(deg: number): IAnimation;
/**
* deg的范围-180~180,在X轴旋转一个deg角度
*/
rotateX(deg: number): IAnimation;
/**
* deg的范围-180~180,在Y轴旋转一个deg角度
*/
rotateY(deg: number): IAnimation;
/**
* deg的范围-180~180,在Z轴旋转一个deg角度
*/
rotateZ(deg: number): IAnimation;
/**
* 同transform-function rotate3d
*/
rotate3d(x: number, y: number, z: number, deg: number): IAnimation;
/**
* 一个参数时,表示在X轴、Y轴同时缩放sx倍数;两个参数时表示在X轴缩放sx倍数,在Y轴缩放sy倍数
*/
scale(sx: number, sy?: number): IAnimation;
/**
* 在X轴缩放sx倍数
*/
scaleX(sx: number): IAnimation;
/**
* 在Y轴缩放sy倍数
*/
scaleY(sy: number): IAnimation;
/**
* 在Z轴缩放sy倍数
*/
scaleZ(sz: number): IAnimation;
/**
* 在X轴缩放sx倍数,在Y轴缩放sy倍数,在Z轴缩放sz倍数
*/
scale3d(sx: number, sy: number, sz: number): IAnimation;
/**
* 一个参数时,表示在X轴偏移tx,单位px;两个参数时,表示在X轴偏移tx,在Y轴偏移ty,单位px。
*/
translate(tx: number, ty?: number): IAnimation;
/**
* 在X轴偏移tx,单位px
*/
translateX(tx: number): IAnimation;
/**
* 在Y轴偏移tx,单位px
*/
translateY(tx: number): IAnimation;
/**
* 在Z轴偏移tx,单位px
*/
translateZ(tx: number): IAnimation;
/**
* 在X轴偏移tx,在Y轴偏移ty,在Z轴偏移tz,单位px
*/
translate3d(tx: number, ty: number, tz: number): IAnimation;
/**
* 参数范围-180~180;一个参数时,Y轴坐标不变,X轴坐标延顺时针倾斜ax度;两个参数时,分别在X轴倾斜ax度,在Y轴倾斜ay度
*/
skew(ax: number, ay?: number): IAnimation;
/**
* 参数范围-180~180;Y轴坐标不变,X轴坐标延顺时针倾斜ax度
*/
skewX(ax: number): IAnimation;
/**
* 参数范围-180~180;X轴坐标不变,Y轴坐标延顺时针倾斜ay度
*/
skewY(ay: number): IAnimation;
/**
* 同transform-function matrix
*/
matrix(a, b, c, d, tx, ty): IAnimation;
/**
* 同transform-function matrix3d
*/
matrix3d(): IAnimation;
}
interface ICanvasContext {
/**
* 设置填充色, 如果没有设置 fillStyle,默认颜色为 black。
*/
setFillStyle(color: string): void;
/**
* 设置边框颜色, 如果没有设置 fillStyle,默认颜色为 black。
*/
setStrokeStyle(color: string): void;
/**
* 设置阴影
*/
setShadow(offsetX: number, offsetY: number, blur: number, color: string): void;
/**
* 创建一个线性的渐变颜色。需要使用 addColorStop() 来指定渐变点,至少要两个。
*/
createLinearGradient(x0: number, y0: number, x1: number, y1: number): void;
/**
* 创建一个圆形的渐变颜色。 起点在圆心,终点在圆环。 需要使用 addColorStop() 来指定渐变点,至少要两个。
*/
createCircularGradient(x: number, y: number, r: number): void;
/**
* 创建一个颜色的渐变点。小于最小 stop 的部分会按最小 stop 的 color 来渲染,大于最大 stop 的部分会按最大 stop 的 color 来渲染。需要使用 addColorStop() 来指定渐变点,至少要两个。
*/
addColorStop(stop: number, color: string): void;
/**
* 设置线条端点的样式
*/
setLineCap(lineCap: 'butt' | 'round' | 'square'): void;
/**
* 设置两线相交处的样式
*/
setLineJoin(lineJoin: 'bevel' | 'round' | 'miter'): void;
/**
* 设置线条宽度
*/
setLineWidth(lineWidth: number): void;
/**
* 设置最大倾斜
*/
setMiterLimit(miterLimit: number): void;
/**
* 添加一个矩形路径到当前路径。
*/
rect(x: number, y: number, width: number, height: number): void;
/**
* 填充一个矩形。用 setFillStyle() 设置矩形的填充色,如果没设置默认是黑色。
*/
fillRect(x: number, y: number, width: number, height: number): void;
/**
* 一个矩形(非填充)。用 setFillStroke() 设置矩形线条的颜色,如果没设置默认是黑色。
*/
strokeRect(x: number, y: number, width: number, height: number): void;
/**
* 在给定的矩形区域内,清除画布上的像素
*/
clearRect(x: number, y: number, width: number, height: number): void;
/**
* 对当前路径进行填充
*/
fill(): void;
/**
* 对当前路径进行描边
*/
stroke(): void;
/**
* 开始一个路径
*/
beginPath(): void;
/**
* 关闭一个路径
*/
closePath(): void;
/**
* 把路径移动到画布中的指定点,但不创建线条。
*/
moveTo(x: number, y: number): void;
/**
* 添加一个新点,然后在画布中创建从该点到最后指定点的线条。
*/
lineTo(x: number, y: number): void;
/**
* 添加一个弧形路径到当前路径,顺时针绘制。
*/
arc(x: number, y: number, radius: number, startAngle: number, sweepAngle: number): void;
/**
* 创建二次方贝塞尔曲线
*/
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
/**
* 创建三次方贝塞尔曲线
*/
bezierCurveTo(cpx1: number, cpy1: number, cpx2: number, cpy2: number, x: number, y: number): void;
/**
* 对横纵坐标进行缩放
*/
scale(scaleWidth: number/**横坐标缩放的倍数1 = 100%,0.5 = 50%,2 = 200%,依次类 */, scaleHeight: number/** 纵坐标轴缩放的倍数1 = 100%,0.5 = 50%,2 = 200%,依次类 */): void;
/**
* 对坐标轴进行顺时针旋转
*/
rotate(deg: number/**degrees * Math.PI/180;degrees范围为0~360;旋转角度,以弧度计 */): void;
/**
* 对坐标原点进行缩放
*/
translate(x: number/**水平坐标平移量 */, y: number/**竖直坐标平移量 */): void;
/**
* 在画布上绘制被填充的文本
*/
fillText(text: string, x: number, y: number): void;
/**
* 设置字体大小
*/
setFontSize(fontSize: number): void;
/**
* 在画布上绘制图像
*/
drawImage(imageResource: string, x: number, y: number, width: number, height: number): void;
/**
* 设置全局画笔透明度。
*/
setGlobalAlpha(alpha: number): void;
/**
* 保存当前坐标轴的缩放、旋转、平移信息
*/
save(): void;
/**
* 恢复之前保存过的坐标轴的缩放、旋转、平移信息
*/
restore(): void;
/**
* 进行绘图
*/
draw(): void;
}
interface IAudioContext {
/**
* 播放
*/
play: () => void;
/**
* 暂停
*/
pause: () => void;
/**
* 跳转到指定位置,单位 s
*/
seek: (position: number) => void;
}
interface IVideoContext {
/**
* 播放
*/
play: () => void;
/**
* 暂停
*/
pause: () => void;
/**
* 跳转到指定位置,单位 s
*/
seek: (position: number) => void;
/**
* 发送弹幕,danmu 包含两个属性 text, color。
*/
sendDanmu: (danmu: {text: string; color: string;}) => void;
}
interface IMapContext {
/**
* 获取当前地图中心的经纬度,返回的是 gcj02 坐标系,可以用于 wx.openLocation
*/
getCenterLocation: (obj: {
/**
* 接口调用成功的回调函数 ,res = { longitude: "经度", latitude: "纬度"}
*/
success?: (res: {longitude: string; latitude: string}) => void;
/**
* 接口调用失败的回调函数
*/
fail?: () => void;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: () => void;
}) => void;
/**
* 将地图中心移动到当前定位点,需要配合map组件的show-location使用
*/
moveToLocation: () => void;
}
interface Application {
setData: (obj: any) => void;
}
interface AppConstructor {
new (): Application;
(opts: {
/**
* 生命周期函数--监听小程序初始化
*/
onLaunch?: () => void;
/**
* 生命周期函数--监听小程序显示
*/
onShow?: () => void;
/**
* 生命周期函数--监听小程序隐藏
*/
onHide?: () => void;
[key: string]: any;
}): Application;
}
declare var App: AppConstructor;
declare function getApp(): Application;
declare function getCurrentPages(): Page[];
interface Page {
setData: (obj: any) => void;
}
interface PageConstructor {
new (): Page;
(opts: {
/**
* 页面的初始数据
*/
data?: any;
/**
* 页面的初始数据
*/
onLoad?: () => void;
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady?: () => void;
/**
* 生命周期函数--监听页面显示
*/
onShow?: () => void;
/**
* 生命周期函数--监听页面隐藏
*/
onHide?: () => void;
/**
* 生命周期函数--监听页面卸载
*/
onUnload?: () => void;
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefreash?: () => void;
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom?: () => void;
/**
* 用户点击右上角分享
*/
onShareAppMessage?: () => {
/**
* 分享标题, 默认值当前小程序名称
*/
title: string;
/**
* 分享描述, 默认值当前小程序名称
*/
desc: string;
/**
* 分享路径 默认值当前页面 path ,必须是以 / 开头的完整路径
*/
path: string;
};
[key: string]: any;
}): Page;
}
declare var Page: PageConstructor;
declare var wx: {
// # 网络 #
request(obj: {
/**
* 开发者服务器接口地址
*/
url: string;
/**
* 请求的参数
*/
data?: any | string;
/**
* 设置请求的 header , header 中不能设置 Referer
*/
header?: any;
/**
* 默认为 GET,有效值:OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
*/
method?: string;
/**
* 默认为 json。如果设置了 dataType 为 json,则会尝试对响应的数据做一次 JSON.parse
*/
dataType?: string;
/**
* 收到开发者服务成功返回的回调函数,res = {data: '开发者服务器返回的内容'}
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 将本地资源上传到开发者服务器。如页面通过 wx.chooseImage 等接口获取到一个本地资源的临时文件路径后,可通过此接口将本地资源上传到指定服务器。客户端发起一个 HTTPS POST 请求,其中 content-type 为 multipart/form-data 。
*/
uploadFile(obj: {
/**
* 开发者服务器 url
*/
url: string;
/**
* 要上传文件资源的路径
*/
filePath: string;
/**
* 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容
*/
name: string;
/**
* HTTP 请求 Header , header 中不能设置 Referer
*/
header?: any;
/**
* HTTP 请求中其他额外的 form data
*/
formData?: any;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。
*/
downloadFile(obj: {
/**
* 下载资源的 url
*/
url: string;
/**
* HTTP 请求 Header
*/
header?: any;
/**
* 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'}
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 创建一个 WebSocket 连接;一个微信小程序同时只能有一个 WebSocket 连接,如果当前已存在一个 WebSocket 连接,会自动关闭该连接,并重新创建一个 WebSocket 连接。
*/
connectSocket(obj: {
/**
* 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名
*/
url: string;
/**
* 请求的数据
*/
data?: any;
/**
* HTTP Header , header 中不能设置 Referer
*/
header?: any;
/**
* 默认是GET,有效值: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
*/
method?: string;
/**
* 子协议数组
*/
protocols?: string[];
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 监听WebSocket连接打开事件。
*/
onSocketOpen(callback: Function): void;
/**
* 监听WebSocket错误。
*/
onSocketError(callback: Function): void;
/**
* 通过 WebSocket 连接发送数据,需要先 wx.connectSocket,并在 wx.onSocketOpen 回调之后才能发送。
*/
sendSocketMessage(obj: {
/**
* 需要发送的内容
*/
data: undefined;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 监听WebSocket接受到服务器的消息事件。
*/
onSocketMessage(callback: Function): void;
/**
* 关闭WebSocket连接。
*/
closeSocket(obj: {
/**
* 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭)
*/
code?: number;
/**
* 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符)
*/
reason?: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 监听WebSocket关闭。
*/
onSocketClose(callback: Function): void;
// # 媒体 #
/**
* 从本地相册选择图片或使用相机拍照。
*/
chooseImage(obj: {
/**
* 最多可以选择的图片张数,默认9
*/
count?: number;
/**
* original 原图,compressed 压缩图,默认二者都有
*/
sizeType?: string[];
/**
* album 从相册选图,camera 使用相机,默认二者都有
*/
sourceType?: string[];
/**
* 成功则返回图片的本地文件路径列表 tempFilePaths
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 预览图片。
*/
previewImage(obj: {
/**
* 当前显示图片的链接,不填则默认为 urls 的第一张
*/
current?: string;
/**
* 需要预览的图片链接列表
*/
urls: string[];
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 获取图片信息
*/
getImageInfo(obj: {
/**
* 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径
*/
src: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
saveImageToPhotosAlbum(obj: {
/**
* 图片文件路径,可以是临时文件路径也可以是永久文件路径,不支持网络图片路径
*/
filePath: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 开始录音。当主动调用wx.stopRecord,或者录音超过1分钟时自动结束录音,返回录音文件的临时文件路径。当用户离开小程序时,此接口无法调用。
*/
startRecord(obj: {
/**
* 录音成功后调用,返回录音文件的临时文件路径,res = {tempFilePath: '录音文件的临时路径'}
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* ​ 主动调用停止录音。
*/
stopRecord(): void;
/**
* 开始播放语音,同时只允许一个语音文件正在播放,如果前一个语音文件还没播放完,将中断前一个语音播放。
*/
playVoice(obj: {
/**
* 需要播放的语音文件的文件路径
*/
filePath: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 暂停正在播放的语音。再次调用wx.playVoice播放同一个文件时,会从暂停处开始播放。如果想从头开始播放,需要先调用 wx.stopVoice。
*/
pauseVoice(): void;
/**
* 结束播放语音。
*/
stopVoice(): void;
/**
* 获取后台音乐播放状态。
*/
getBackgroundAudioPlayerState(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 使用后台播放器播放音乐,对于微信客户端来说,只能同时有一个后台音乐在播放。当用户离开小程序后,音乐将暂停播放;当用户点击“显示在聊天顶部”时,音乐不会暂停播放;当用户在其他小程序占用了音乐播放器,原有小程序内的音乐将停止播放。
*/
playBackgroundAudio(obj: {
/**
* 音乐链接,目前支持的格式有 m4a, aac, mp3, wav
*/
dataUrl: string;
/**
* 音乐标题
*/
title?: string;
/**
* 封面URL
*/
coverImgUrl?: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 暂停播放音乐。
*/
pauseBackgroundAudio(): void;
/**
* 控制音乐播放进度。
*/
seekBackgroundAudio(obj: {
/**
* 音乐位置,单位:秒
*/
position: number;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 停止播放音乐。
*/
stopBackgroundAudio(): void;
/**
* 监听音乐播放。
*/
onBackgroundAudioPlay(callback: Function): void;
/**
* 监听音乐暂停。
*/
onBackgroundAudioPause(callback: Function): void;
/**
* 监听音乐停止。
*/
onBackgroundAudioStop(callback: Function): void;
getBackgroundAudioManager(): void;
/**
* 创建并返回 audio 上下文 audioContext 对象
*/
createAudioContext(audioId: string): IAudioContext;
/**
* 拍摄视频或从手机相册中选视频,返回视频的临时文件路径。
*/
chooseVideo(obj: {
/**
* album 从相册选视频,camera 使用相机拍摄,默认为:['album', 'camera']
*/
sourceType?: string[];
/**
* 拍摄视频最长拍摄时间,单位秒。最长支持 60 秒
*/
maxDuration?: number;
/**
* 默认调起的为前置还是后置摄像头。front: 前置,back: 后置,默认 back
*/
camera?: string;
/**
* 接口调用成功,返回视频文件的临时文件路径,详见返回参数说明
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
saveVideoToPhotosAlbum(obj: {
/**
* 视频文件路径,可以是临时文件路径也可以是永久文件路径
*/
filePath: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 创建并返回 video 上下文 videoContext 对象
*/
createVideoContext(videoId: string): IVideoContext;
// # 文件 #
/**
* 保存文件到本地。
*/
saveFile(obj: {
/**
* 需要保存的文件的临时路径
*/
tempFilePath: string;
/**
* 返回文件的保存路径,res = {savedFilePath: '文件的保存路径'}
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 获取本地已保存的文件列表
*/
getSavedFileList(obj: {
/**
* 接口调用成功的回调函数,返回结果见success返回参数说明
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 获取本地文件的文件信息。此接口只能用于获取已保存到本地的文件,若需要获取临时文件信息,请使用 wx.getFileInfo 接口。
*/
getSavedFileInfo(obj: {
/**
* 文件路径
*/
filePath: string;
/**
* 接口调用成功的回调函数,返回结果见success返回参数说明
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 删除本地存储的文件
*/
removeSavedFile(obj: {
/**
* 需要删除的文件路径
*/
filePath: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx
*/
openDocument(obj: {
/**
* 文件路径,可通过 downFile 获得
*/
filePath: string;
/**
* 文件类型,指定文件类型打开文件,有效值 doc, xls, ppt, pdf, docx, xlsx, pptx
*/
fileType?: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
getFileInfo(obj: {
/**
* 本地文件路径
*/
filePath: string;
/**
* 计算文件摘要的算法,默认值 md5,有效值:md5,sha1
*/
digestAlgorithm?: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
// # 数据缓存 #
/**
* 将数据存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个异步接口。
*/
setStorage(obj: {
/**
* 本地缓存中的指定的 key
*/
key: string;
/**
* 需要存储的内容
*/
data: any;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。
*/
setStorageSync(key: string, data: any, ): void;
/**
* 从本地缓存中异步获取指定 key 对应的内容。
*/
getStorage(obj: {
/**
* 本地缓存中的指定的 key
*/
key: string;
/**
* 接口调用的回调函数,res = {data: key对应的内容}
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 从本地缓存中同步获取指定 key 对应的内容。
*/
getStorageSync(key: string): void;
/**
* 异步获取当前storage的相关信息
*/
getStorageInfo(obj: {
/**
* 接口调用的回调函数,详见返回参数说明
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 同步获取当前storage的相关信息
*/
getStorageInfoSync(): void;
/**
* 从本地缓存中异步移除指定 key 。
*/
removeStorage(obj: {
/**
* 本地缓存中的指定的 key
*/
key: string;
/**
* 接口调用的回调函数
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 从本地缓存中同步移除指定 key 。
*/
removeStorageSync(key: string): void;
/**
* 清理本地数据缓存。
*/
clearStorage(): void;
/**
* 同步清理本地数据缓存
*/
clearStorageSync(): void;
// # 位置 #
/**
* 获取当前的地理位置、速度。当用户离开小程序后,此接口无法调用;当用户点击“显示在聊天顶部”时,此接口可继续调用。
*/
getLocation(obj: {
/**
* 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于wx.openLocation的坐标
*/
type?: string;
/**
* 接口调用成功的回调函数,返回内容详见返回参数说明。
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 打开地图选择位置
*/
chooseLocation(obj: {
/**
* 接口调用成功的回调函数,返回内容详见返回参数说明。
*/
success: Function;
/**
* 用户取消时调用
*/
cancel?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* ​ 使用微信内置地图查看位置
*/
openLocation(obj: {
/**
* 纬度,范围为-90~90,负数表示南纬
*/
latitude: number;
/**
* 经度,范围为-180~180,负数表示西经
*/
longitude: number;
/**
* 缩放比例,范围5~18,默认为18
*/
scale?: number;
/**
* 位置名
*/
name?: string;
/**
* 地址的详细说明
*/
address?: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 创建并返回 map 上下文 mapContext 对象
*/
createMapContext(mapId: string): IMapContext;
// # 设备 #
/**
* 获取系统信息。
*/
getSystemInfo(obj: {
/**
* 接口调用成功的回调
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 获取系统信息同步接口
*/
getSystemInfoSync(): void;
/**
* 获取网络类型。
*/
getNetworkType(obj: {
/**
* 接口调用成功,返回网络类型 networkType
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
onNetworkStatusChange(callback: Function): void;
setScreenBrightness(obj: {
/**
* 屏幕亮度值,范围 0~1,0 最暗,1 最亮
*/
value: number;
/**
* 接口调用成功
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
getScreenBrightness(obj: {
/**
* 接口调用成功
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
vibrateLong(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
vibrateShort(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 监听加速度数据,频率:5次/秒,接口调用后会自动开始监听,可使用 wx.stopAccelerometer 停止监听。
*/
onAccelerometerChange(callback: Function): void;
startAccelerometer(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
stopAccelerometer(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 监听罗盘数据,频率:5次/秒,接口调用后会自动开始监听,可使用wx.stopCompass停止监听。
*/
onCompassChange(callback: Function): void;
startCompass(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
stopCompass(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
makePhoneCall(obj: {
/**
* 需要拨打的电话号码
*/
phoneNumber: string;
/**
* 接口调用成功的回调
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 调起客户端扫码界面,扫码成功后返回对应的结果
*/
scanCode(obj: {
/**
* 是否只能从相机扫码,不允许从相册选择图片
*/
onlyFromCamera?: boolean;
/**
* 接口调用成功的回调函数,返回内容详见返回参数说明。
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
setClipboardData(obj: {
/**
* 需要设置的内容
*/
data: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
getClipboardData(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
openBluetoothAdapter(obj: {
/**
* 成功则返回成功初始化信息
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
closeBluetoothAdapter(obj: {
/**
* 成功则返回成功关闭模块信息
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
getBluetoothAdapterState(obj: {
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
onBluetoothAdapterStateChange(callback: Function): void;
startBluetoothDevicesDiscovery(obj: {
/**
* 蓝牙设备主 service 的 uuid 列表
*/
services?: Array<any>;
/**
* 是否允许重复上报同一设备, 如果允许重复上报,则onDeviceFound 方法会多次上报同一设备,但是 RSSI 值会有不同
*/
allowDuplicatesKey?: boolean;
/**
* 上报设备的间隔,默认为0,意思是找到新设备立即上报,否则根据传入的间隔上报
*/
interval?: number;
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
stopBluetoothDevicesDiscovery(obj: {
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
getBluetoothDevices(obj: {
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
onBluetoothDeviceFound(callback: Function): void;
getConnectedBluetoothDevices(obj: {
/**
* 蓝牙设备主 service 的 uuid 列表
*/
services: Array<any>;
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
createBLEConnection(obj: {
/**
* 蓝牙设备 id,参考 getDevices 接口
*/
deviceId: string;
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
closeBLEConnection(obj: {
/**
* 蓝牙设备 id,参考 getDevices 接口
*/
deviceId: string;
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
getBLEDeviceServices(obj: {
/**
* 蓝牙设备 id,参考 getDevices 接口
*/
deviceId: string;
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
getBLEDeviceCharacteristics(obj: {
/**
* 蓝牙设备 id,参考 device 对象
*/
deviceId: string;
/**
* 蓝牙服务 uuid
*/
serviceId: string;
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
readBLECharacteristicValue(obj: {
/**
* 蓝牙设备 id,参考 device 对象
*/
deviceId: string;
/**
* 蓝牙特征值对应服务的 uuid
*/
serviceId: string;
/**
* 蓝牙特征值的 uuid
*/
characteristicId: string;
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
writeBLECharacteristicValue(obj: {
/**
* 蓝牙设备 id,参考 device 对象
*/
deviceId: string;
/**
* 蓝牙特征值对应服务的 uuid
*/
serviceId: string;
/**
* 蓝牙特征值的 uuid
*/
characteristicId: string;
/**
* 蓝牙设备特征值对应的二进制值(注意:vConsole 无法打印出 ArrayBuffer 类型数据)
*/
value: undefined;
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
notifyBLECharacteristicValueChange(obj: {
/**
* 蓝牙设备 id,参考 device 对象
*/
deviceId: string;
/**
* 蓝牙特征值对应服务的 uuid
*/
serviceId: string;
/**
* 蓝牙特征值的 uuid
*/
characteristicId: string;
/**
* true: 启用 notify; false: 停用 notify
*/
state: boolean;
/**
* 成功则返回本机蓝牙适配器状态
*/
success: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
onBLEConnectionStateChange(callback: Function): void;
onBLECharacteristicValueChange(callback: Function): void;
startBeaconDiscovery(obj: {
/**
* iBeacon设备广播的 uuids
*/
uuids: string[];
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
stopBeaconDiscovery(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
getBeacons(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
onBeaconUpdate(callback: Function): void;
onBeaconServiceChange(callback: Function): void;
onUserCaptureScreen(callback: Function): void;
addPhoneContact(obj: {
/**
* 头像本地文件路径
*/
photoFilePath?: string;
/**
* 昵称
*/
nickName?: string;
/**
* 姓氏
*/
lastName?: string;
/**
* 中间名
*/
middleName?: string;
/**
* 名字
*/
firstName: string;
/**
* 备注
*/
remark?: string;
/**
* 手机号
*/
mobilePhoneNumber?: string;
/**
* 微信号
*/
weChatNumber?: string;
/**
* 联系地址国家
*/
addressCountry?: string;
/**
* 联系地址省份
*/
addressState?: string;
/**
* 联系地址城市
*/
addressCity?: string;
/**
* 联系地址街道
*/
addressStreet?: string;
/**
* 联系地址邮政编码
*/
addressPostalCode?: string;
/**
* 公司
*/
organization?: string;
/**
* 职位
*/
title?: string;
/**
* 工作传真
*/
workFaxNumber?: string;
/**
* 工作电话
*/
workPhoneNumber?: string;
/**
* 公司电话
*/
hostNumber?: string;
/**
* 电子邮件
*/
email?: string;
/**
* 网站
*/
url?: string;
/**
* 工作地址国家
*/
workAddressCountry?: string;
/**
* 工作地址省份
*/
workAddressState?: string;
/**
* 工作地址城市
*/
workAddressCity?: string;
/**
* 工作地址街道
*/
workAddressStreet?: string;
/**
* 工作地址邮政编码
*/
workAddressPostalCode?: string;
/**
* 住宅传真
*/
homeFaxNumber?: string;
/**
* 住宅电话
*/
homePhoneNumber?: string;
/**
* 住宅地址国家
*/
homeAddressCountry?: string;
/**
* 住宅地址省份
*/
homeAddressState?: string;
/**
* 住宅地址城市
*/
homeAddressCity?: string;
/**
* 住宅地址街道
*/
homeAddressStreet?: string;
/**
* 住宅地址邮政编码
*/
homeAddressPostalCode?: string;
/**
* 接口调用成功
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
// # 界面 #
/**
* 显示消息提示框
*/
showToast(obj: {
/**
* 提示的内容
*/
title: string;
/**
* 图标,有效值 "success", "loading"
*/
icon?: string;
/**
* 自定义图标的本地路径,image 的优先级高于 icon
*/
image?: string;
/**
* 提示的延迟时间,单位毫秒,默认:1500
*/
duration?: number;
/**
* 是否显示透明蒙层,防止触摸穿透,默认:false
*/
mask?: boolean;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
showLoading(obj: {
/**
* 提示的内容
*/
title: string;
/**
* 是否显示透明蒙层,防止触摸穿透,默认:false
*/
mask?: boolean;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 隐藏消息提示框
*/
hideToast(): void;
hideLoading(): void;
/**
* ​显示模态弹窗
*/
showModal(obj: {
/**
* 提示的标题
*/
title: string;
/**
* 提示的内容
*/
content: string;
/**
* 是否显示取消按钮,默认为 true
*/
showCancel?: boolean;
/**
* 取消按钮的文字,默认为"取消",最多 4 个字符
*/
cancelText?: string;
/**
* 取消按钮的文字颜色,默认为"#000000"
*/
cancelColor?: undefined;
/**
* 确定按钮的文字,默认为"确定",最多 4 个字符
*/
confirmText?: string;
/**
* 确定按钮的文字颜色,默认为"#3CC51F"
*/
confirmColor?: undefined;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* ​显示操作菜单
*/
showActionSheet(obj: {
/**
* 按钮的文字数组,数组长度最大为6个
*/
itemList: undefined;
/**
* 按钮的文字颜色,默认为"#000000"
*/
itemColor?: undefined;
/**
* 接口调用成功的回调函数,详见返回参数说明
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
setTopBarText(obj: {
/**
* 置顶栏文字内容
*/
text: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 动态设置当前页面的标题。
*/
setNavigationBarTitle(obj: {
/**
* 页面标题
*/
title: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 在当前页面显示导航条加载动画。
*/
showNavigationBarLoading(): void;
/**
* 隐藏导航条加载动画。
*/
hideNavigationBarLoading(): void;
/**
* 保留当前页面,跳转到应用内的某个页面,使用wx.navigateBack可以返回到原页面。
*/
navigateTo(obj: {
/**
* 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2'
*/
url: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 关闭当前页面,跳转到应用内的某个页面。
*/
redirectTo(obj: {
/**
* 需要跳转的应用内非 tabBar 的页面的路径,路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2'
*/
url: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
reLaunch(obj: {
/**
* 需要跳转的应用内页面路径 , 路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2',如果跳转的页面路径是 tabBar 页面则不能带参数
*/
url: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
*/
switchTab(obj: {
/**
* 需要跳转的 tabBar 页面的路径(需在 app.json 的 tabBar 字段定义的页面),路径后不能带参数
*/
url: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages()) 获取当前的页面栈,决定需要返回几层。
*/
navigateBack(obj: {
/**
* 返回的页面数,如果 delta 大于现有页面数,则返回到首页。
*/
delta?: number;
}): void;
/**
* 创建一个动画实例animation。调用实例的方法来描述动画。最后通过动画实例的export方法导出动画数据传递给组件的animation属性。
*/
createAnimation(obj: {
/**
* 400
*/
duration?: number;
/**
* "linear"
*/
timingFunction?: string;
/**
* 0
*/
delay?: number;
/**
* "50% 50% 0"
*/
transformOrigin?: string;
}): IAnimation;
pageScrollTo(obj: {
/**
* 滚动到页面的目标位置(单位px)
*/
scrollTop: number;
}): void;
/**
* 创建 canvas 绘图上下文(指定 canvasId).Tip: 需要指定 canvasId,该绘图上下文只作用于对应的 <canvas/>
*/
createCanvasContext(canvasId: string): ICanvasContext;
/**
* 把当前画布的内容导出生成图片,并返回文件路径
*/
canvasToTempFilePath(canvasId: string): void;
startPullDownRefresh(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 停止当前页面下拉刷新。
*/
stopPullDownRefresh(): void;
// # WXML节点信息 #
// # 第三方平台 #
getExtConfig(obj: {
/**
* 返回第三方平台自定义的数据
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
getExtConfigSync(): void;
// # 开放接口 #
/**
* 调用接口获取登录凭证(code)进而换取用户登录态信息,包括用户的唯一标识(openid) 及本次登录的 会话密钥(session_key)。用户数据的加解密通讯需要依赖会话密钥完成。
*/
login(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 通过上述接口获得的用户登录态拥有一定的时效性。用户越久未使用小程序,用户登录态越有可能失效。反之如果用户一直在使用小程序,则用户登录态一直保持有效。具体时效逻辑由微信维护,对开发者透明。开发者只需要调用wx.checkSession接口检测当前用户登录态是否有效。登录态过期后开发者可以再调用wx.login获取新的用户登录态。
*/
checkSession(obj: {
/**
* 接口调用成功的回调函数,登录态未过期
*/
success?: Function;
/**
* 接口调用失败的回调函数,登录态已过期
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
authorize(obj: {
/**
* 需要获取权限的scope,详见 scope 列表
*/
scope: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 获取用户信息,withCredentials 为 true 时需要先调用 wx.login 接口。
*/
getUserInfo(obj: {
/**
* 是否带上登录态信息
*/
withCredentials?: boolean;
/**
* 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文
*/
lang?: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
/**
* 发起微信支付。
*/
requestPayment(obj: {
/**
* 时间戳从1970年1月1日00:00:00至今的秒数,即当前的时间
*/
timeStamp: string;
/**
* 随机字符串,长度为32个字符以下。
*/
nonceStr: string;
/**
* 统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=*
*/
package: string;
/**
* 签名算法,暂支持 MD5
*/
signType: string;
/**
* 签名,具体签名方案参见小程序支付接口文档;
*/
paySign: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
chooseAddress(obj: {
/**
* 返回用户选择的收货地址信息
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
addCard(obj: {
/**
* 需要添加的卡券列表,列表内对象说明请参见请求对象说明
*/
cardList: undefined;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
openCard(obj: {
/**
* 需要打开的卡券列表,列表内参数详见openCard 请求对象说明
*/
cardList: undefined;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
openSetting(obj: {
/**
* 接口调用成功的回调函数,返回内容详见返回参数说明。
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
getSetting(obj: {
/**
* 接口调用成功的回调函数,返回内容详见返回参数说明。
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
getWeRunData(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
navigateToMiniProgram(obj: {
/**
* 要打开的小程序 appId
*/
appId: string;
/**
* 打开的页面路径,如果为空则打开首页
*/
path?: string;
/**
* 需要传递给目标小程序的数据,目标小程序可在 App.onLaunch(),App.onShow() 中获取到这份数据。详情
*/
extraData?: any;
/**
* 要打开的小程序版本,有效值 develop(开发版),trial(体验版),release(正式版) ,仅在当前小程序为开发版或体验版时此参数有效;如果当前小程序是体验版或正式版,则打开的小程序必定是正式版。默认值 release
*/
envVersion?: string;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
chooseInvoiceTitle(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
checkIsSupportSoterAuthentication(obj: {
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
// # 数据 #
/**
* 自定义分析数据上报接口。使用前,需要在小程序管理后台自定义分析中新建事件,配置好事件名与字段。
*/
reportAnalytics(eventName: string, data: string, ): void;
// # 拓展接口 #
arrayBufferToBase64(arrayBuffer: string): void;
base64ToArrayBuffer(base64: string): void;
// # 调试接口 #
setEnableDebug(obj: {
/**
* 是否打开调试
*/
enableDebug: boolean;
/**
* 接口调用成功的回调函数
*/
success?: Function;
/**
* 接口调用失败的回调函数
*/
fail?: Function;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: Function;
}): void;
}
\ No newline at end of file
import baseUrl from "../config/project.config.js/index.js.js"
import { showMsgError } from "./tools"
/**
* @param {*} url 请求地址
* @param {*} options 请求参数
* get请求 `url/${params}`
* post || DELETE || ..请求
* (url, {
* method: "POST || DELETE",
* body: params
* })
*/
export default function request (url, options = {}) {
const newOptions = [...options]
return new Promise((resolve, reject) => {
wx.request({
url: baseUrl + url,
method: newOptions.method || 'GET',
data: newOptions.body || '',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success: res => {
if (res.data.code == 200) {
resolve(res.data)
} else {
showMsgError(res.data)
}
},
fail: err => {
reject()
showMsgError(err)
}
})
})
}
\ No newline at end of file
class msgBase {
toast(params) {
const {title, icon, duration = 2000} = params
wx.showToast({
title,
icon,
duration
})
}
}
let msg = new msgBase()
function showMsgSuccess(title="成功") {
const params = {
title,
icon: "success"
}
return msg.toast(params)
}
function showMsgError(title="失败") {
const params = {
title,
icon: "none"
}
return msg.toast(params)
}
function showLoading(title="加载中") {
const params = {
title,
icon: "loading"
}
return msg.toast(params)
}
export {
showMsgSuccess,
showMsgError,
showLoading
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment