commit e8938f973d22e42f4ca3a494be72c813e76365e7 Author: chenshengle <954534408@qq.com> Date: Wed Mar 23 15:08:18 2022 +0800 【抖音B端代码提交】 diff --git a/app.js b/app.js new file mode 100644 index 0000000..bedd248 --- /dev/null +++ b/app.js @@ -0,0 +1,22 @@ +App({ + data:{}, + globalData:{ + token: "", + // "token": "0b272d7d-d669-401a-8d4b-a9eef9340dc1:1027:tt-cuser", + imgHttps: 'https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/', + platform:null,//手机型号 + }, + onLaunch: function () { + let that = this + // this.logn(); + try { + var res = tt.getSystemInfoSync(); + that.statusBarHeight = res.statusBarHeight + console.log(`手机型号为 ${res.platform}`); + this.globalData.platform = res.platform + } catch (error) { + console.log(`获取系统信息失败`); + } + }, + statusBarHeight: 0, +}) diff --git a/app.json b/app.json new file mode 100644 index 0000000..5e3a9d2 --- /dev/null +++ b/app.json @@ -0,0 +1,47 @@ +{ + "pages": [ + "pages/login/login", + "pages/index/index", + "pages/user/user", + "pages/scan/scan", + "pages/writeoffPage/writeoffPage", + "pages/errorPage/errorPage", + "pages/write0ff/write0ff", + "pages/marktingsettlement/marktingsettlement", + "pages/forgetpwd/forgetpwd", + "pages/setpwd/setpwd", + "pages/success/success", + "pages/transaction/transaction", + "pages/creditSelect/index", + "pages/memberPhone/index", + "pages/Add/index", + "pages/operation/index", + "pages/getMerchant/index", + "pages/editSuccess/index", + "pages/exchange/index", + "pages/creditOperate/index" + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#52A0FD" + }, + "tabBar": { + "color": "#9F9F9F", + "selectedColor": "#52a0fd", + "backgroundColor": "#fff", + "list": [ + { + "pagePath": "pages/index/index", + "text": "首页", + "iconPath": "assets/images/home-n.png", + "selectedIconPath": "assets/images/home-y.png" + }, + { + "pagePath": "pages/user/user", + "text": "我的", + "iconPath": "assets/images/user-n.png", + "selectedIconPath": "assets/images/user-y.png" + } + ] + } +} \ No newline at end of file diff --git a/app.ttss b/app.ttss new file mode 100644 index 0000000..fa51942 --- /dev/null +++ b/app.ttss @@ -0,0 +1,29 @@ + +.container { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + box-sizing: border-box; + } + text{ + font-size: 34rpx; + } + .fl{ + float: left; + } + .fr{ + float: right; + } + .clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } + view, + text { + font-family: PingFangSC-Regular; + } \ No newline at end of file diff --git a/assets/images/admin.png b/assets/images/admin.png new file mode 100644 index 0000000..3447603 Binary files /dev/null and b/assets/images/admin.png differ diff --git a/assets/images/arrow.png b/assets/images/arrow.png new file mode 100644 index 0000000..de0feea Binary files /dev/null and b/assets/images/arrow.png differ diff --git a/assets/images/bannerbg.png b/assets/images/bannerbg.png new file mode 100644 index 0000000..2261718 Binary files /dev/null and b/assets/images/bannerbg.png differ diff --git a/assets/images/beOverdue.png b/assets/images/beOverdue.png new file mode 100644 index 0000000..c4f0fa9 Binary files /dev/null and b/assets/images/beOverdue.png differ diff --git a/assets/images/bg.png b/assets/images/bg.png new file mode 100644 index 0000000..f110435 Binary files /dev/null and b/assets/images/bg.png differ diff --git a/assets/images/bill.png b/assets/images/bill.png new file mode 100644 index 0000000..11a8405 Binary files /dev/null and b/assets/images/bill.png differ diff --git a/assets/images/bill1.png b/assets/images/bill1.png new file mode 100644 index 0000000..7211144 Binary files /dev/null and b/assets/images/bill1.png differ diff --git a/assets/images/camera.png b/assets/images/camera.png new file mode 100644 index 0000000..79c9241 Binary files /dev/null and b/assets/images/camera.png differ diff --git a/assets/images/cuoo.jpg b/assets/images/cuoo.jpg new file mode 100644 index 0000000..47ef7dd Binary files /dev/null and b/assets/images/cuoo.jpg differ diff --git a/assets/images/daijiao.png b/assets/images/daijiao.png new file mode 100644 index 0000000..c9e2bc0 Binary files /dev/null and b/assets/images/daijiao.png differ diff --git a/assets/images/data1.png b/assets/images/data1.png new file mode 100644 index 0000000..1ed67ba Binary files /dev/null and b/assets/images/data1.png differ diff --git a/assets/images/data2.png b/assets/images/data2.png new file mode 100644 index 0000000..e60eeb8 Binary files /dev/null and b/assets/images/data2.png differ diff --git a/assets/images/eye.png b/assets/images/eye.png new file mode 100644 index 0000000..e58bfe1 Binary files /dev/null and b/assets/images/eye.png differ diff --git a/assets/images/fail.png b/assets/images/fail.png new file mode 100644 index 0000000..8919125 Binary files /dev/null and b/assets/images/fail.png differ diff --git a/assets/images/hide.png b/assets/images/hide.png new file mode 100644 index 0000000..ed77b22 Binary files /dev/null and b/assets/images/hide.png differ diff --git a/assets/images/home-n.png b/assets/images/home-n.png new file mode 100644 index 0000000..dc6434e Binary files /dev/null and b/assets/images/home-n.png differ diff --git a/assets/images/home-y.png b/assets/images/home-y.png new file mode 100644 index 0000000..68365e6 Binary files /dev/null and b/assets/images/home-y.png differ diff --git a/assets/images/jian.png b/assets/images/jian.png new file mode 100644 index 0000000..c33a54c Binary files /dev/null and b/assets/images/jian.png differ diff --git a/assets/images/jiaoyi.png b/assets/images/jiaoyi.png new file mode 100644 index 0000000..a5f20b2 Binary files /dev/null and b/assets/images/jiaoyi.png differ diff --git a/assets/images/logo.png b/assets/images/logo.png new file mode 100644 index 0000000..f4d3142 Binary files /dev/null and b/assets/images/logo.png differ diff --git a/assets/images/logo1.png b/assets/images/logo1.png new file mode 100644 index 0000000..26de594 Binary files /dev/null and b/assets/images/logo1.png differ diff --git a/assets/images/logo1111.png b/assets/images/logo1111.png new file mode 100644 index 0000000..4bcbff5 Binary files /dev/null and b/assets/images/logo1111.png differ diff --git a/assets/images/mess.png b/assets/images/mess.png new file mode 100644 index 0000000..49890d1 Binary files /dev/null and b/assets/images/mess.png differ diff --git a/assets/images/nohave03.png b/assets/images/nohave03.png new file mode 100644 index 0000000..1db75b9 Binary files /dev/null and b/assets/images/nohave03.png differ diff --git a/assets/images/nothave01.png b/assets/images/nothave01.png new file mode 100644 index 0000000..d683c2d Binary files /dev/null and b/assets/images/nothave01.png differ diff --git a/assets/images/nothave02.png b/assets/images/nothave02.png new file mode 100644 index 0000000..108703a Binary files /dev/null and b/assets/images/nothave02.png differ diff --git a/assets/images/password.png b/assets/images/password.png new file mode 100644 index 0000000..4417051 Binary files /dev/null and b/assets/images/password.png differ diff --git a/assets/images/refund.png b/assets/images/refund.png new file mode 100644 index 0000000..acab85c Binary files /dev/null and b/assets/images/refund.png differ diff --git a/assets/images/reviveimg.png b/assets/images/reviveimg.png new file mode 100644 index 0000000..9b51d6e Binary files /dev/null and b/assets/images/reviveimg.png differ diff --git a/assets/images/scan.png b/assets/images/scan.png new file mode 100644 index 0000000..5612c22 Binary files /dev/null and b/assets/images/scan.png differ diff --git a/assets/images/selected2.png b/assets/images/selected2.png new file mode 100644 index 0000000..cccac1e Binary files /dev/null and b/assets/images/selected2.png differ diff --git a/assets/images/success.png b/assets/images/success.png new file mode 100644 index 0000000..d5946be Binary files /dev/null and b/assets/images/success.png differ diff --git a/assets/images/tick.png b/assets/images/tick.png new file mode 100644 index 0000000..82f323d Binary files /dev/null and b/assets/images/tick.png differ diff --git a/assets/images/use.png b/assets/images/use.png new file mode 100644 index 0000000..7679f2d Binary files /dev/null and b/assets/images/use.png differ diff --git a/assets/images/user-n.png b/assets/images/user-n.png new file mode 100644 index 0000000..5df5f66 Binary files /dev/null and b/assets/images/user-n.png differ diff --git a/assets/images/user-y.png b/assets/images/user-y.png new file mode 100644 index 0000000..c2426be Binary files /dev/null and b/assets/images/user-y.png differ diff --git a/assets/images/weidaozhang.png b/assets/images/weidaozhang.png new file mode 100644 index 0000000..92f2e4e Binary files /dev/null and b/assets/images/weidaozhang.png differ diff --git a/assets/images/xia.png b/assets/images/xia.png new file mode 100644 index 0000000..6fd5402 Binary files /dev/null and b/assets/images/xia.png differ diff --git a/common/common.js b/common/common.js new file mode 100644 index 0000000..f2ddfed --- /dev/null +++ b/common/common.js @@ -0,0 +1,359 @@ +let config = require("../config/config.js"); +var app = getApp(); +let host = "https://btest.malls.iformall.com/B" +const func = { + getMallIcon: function () { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.getMallIcon, + data: { + appId: config.weapp.appId, + }, + success: function (res) { + resolve(res.data) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + //console.log("getMallIcon complete:" + res) + } + }) + }) + }, + userLogin: function (phone, password, latitude, longitude) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.login, + data: { + appId: config.weapp.appId, + phone: phone, + password: password, + latitude: latitude, + longitude: longitude + }, + method: "POST", + success: function (res) { + resolve(res.data) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + //console.log("userLogin complete:" + res) + } + }) + }) + }, + + getUserInfo: function (phone, password, latitude, longitude) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.userDetail, + header: { + "content-type": "application/json;charset=UTF-8", + "token": app.globalData.token + }, + data: { + appId: config.weapp.appId, + phone: phone, + password: password, + latitude: latitude, + longitude: longitude + }, + method: "POST", + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + //console.log("userLogin complete:" + res) + } + }) + }) + }, + + /** + * 优惠券查询 + */ + getCouponList: function (pageNum, pageSize) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.couponList, + header: { + "content-type": "application/json;charset=UTF-8", + "token": app.globalData.token + }, + method: "GET", + data: { + pageNum: pageNum, + pageSize: pageSize + }, + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + console.log(res) + } + }) + }) + }, + /** + * 优惠券详情 + */ + getCouponOrderDetail: function (couponOrderId) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.couponOrderDetail, + header: { + "content-type": "application/json;charset=UTF-8", + "token": app.globalData.token + }, + method: "GET", + data: { + couponOrderId: couponOrderId + }, + success: function (res) { + resolve(res.data) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + console.log(res) + } + }) + }) + }, + /** + * 获取图文详情html + */ + getHtml: function (couponOrderId) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.couponHtmlDetail, + header: { + "content-type": "application/json;charset=UTF-8", + "token": app.globalData.token + }, + method: "GET", + data: { + couponOrderId: couponOrderId + }, + success: function (res) { + resolve(res.data) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + console.log(res) + } + }) + }) + }, + /** + * 更新密码 + */ + updateUserPassword: function (phone, yzm, newPwd) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.userUpdatePwd, + header: { + "content-type": "application/json;charset=UTF-8", + }, + method: "POST", + data: { + phone: phone, + code: yzm, + pwd: newPwd, + appId: config.weapp.appId + }, + success: function (res) { + resolve(res.data) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + console.log(res) + } + }) + }) + }, + /** + * 验证码验证 + */ + hasValidationCode: function (phone, yzm) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.hasValidationCode, + header: { + "content-type": "application/json;charset=UTF-8", + }, + method: "GET", + data: { + phone: phone, + code: yzm, + type: 1, + appid: config.weapp.appId + }, + success: function (res) { + resolve(res.data) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + console.log(res) + } + }) + }) + }, + /** + * 发送验证码 + */ + sendValidationCode: function (phone) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.sendValidationCode, + header: { + "content-type": "application/json;charset=UTF-8", + }, + method: "GET", + data: { + phone: phone, + type: 1, + appid: config.weapp.appId + }, + success: function (res) { + resolve(res.data) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + console.log(res) + } + }) + }) + }, + /** + * 券核销 + */ + couponOrderVerify: function (couponOrderId, verifyRemark) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.couponOrderVerify, + header: { + "content-type": "application/json;charset=UTF-8", + "token": app.globalData.token, + }, + data: { + couponOrderId: couponOrderId, + verifyRemark: verifyRemark, + }, + method: "POST", + success: function (res) { + resolve(res.data) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + //console.log("userLogin complete:" + res) + } + }) + }) + }, + /** + * + * @param {*换取openId} code + */ + getOpenId: function (code,bUserId) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.getOpenId, + header: { + "content-type": "application/json;charset=UTF-8", + "token": app.globalData.token, + }, + data: { + appId: config.weapp.appId, + code: code, + bUserId:bUserId + }, + method: "POST", + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + //console.log("userLogin complete:" + res) + } + }) + }) + }, + /** + * 获得超级管理员openId + */ + getSuperOpenId: function (code) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.getSuperOpenId, + header: { + "content-type": "application/json;charset=UTF-8", + }, + data: { + appId: config.weapp.appId, + code: code, + }, + method: "POST", + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + } + }) + }) + }, + /** + * 获得手机号 + */ + getUserPhone: function (encryptedData, iv, superopenId, session_key) { + return new Promise((resolve, reject) => { + tt.request({ + url: host+config.api.getUserPhone, + header: { + "content-type": "application/json;charset=UTF-8", + }, + data: { + appId: config.weapp.appId, + encryptedData: encryptedData, + iv: iv, + openId: superopenId, + session_key: session_key, + }, + method: "POST", + success: function (res) { + resolve(res) + }, + fail: function (err) { + reject(err) + }, + complete: function (res) { + //console.log("userLogin complete:" + res) + } + }) + }) + }, +} +module.exports = func; \ No newline at end of file diff --git a/components/navbar/img/back.png b/components/navbar/img/back.png new file mode 100644 index 0000000..fd1ad06 Binary files /dev/null and b/components/navbar/img/back.png differ diff --git a/components/navbar/img/home.png b/components/navbar/img/home.png new file mode 100644 index 0000000..ae0eb91 Binary files /dev/null and b/components/navbar/img/home.png differ diff --git a/components/navbar/img/home.svg b/components/navbar/img/home.svg new file mode 100644 index 0000000..b8fe7ed --- /dev/null +++ b/components/navbar/img/home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/components/navbar/navbar.js b/components/navbar/navbar.js new file mode 100644 index 0000000..4ecd6e0 --- /dev/null +++ b/components/navbar/navbar.js @@ -0,0 +1,71 @@ +const app = getApp() + +Component({ + + properties: { + background: { + type: String, + value: '#F4F5F9' + }, + color: { + type: String, + value: '#000' + }, + text: { + type: String, + value: 'Wechat' + }, + showLocationIf: { + type: Boolean, + value: false + }, + back: { + type: Boolean, + value: false + }, + home: { + type: Boolean, + value: false + } + }, + + data: { + array: ['A广场', 'B广场-北京西单'], + index: 1, + statusBarHeight: app.statusBarHeight + 'px', + navigationBarHeight: (app.statusBarHeight + 44) + 'px', + imgHttps: app.globalData.imgHttps, + }, + methods: { + backHome: function () { + tt.switchTab({ + url: `/pages/index/index`, + success(res) { + console.log(`${res}`); + }, + fail(res) { + console.log(`switchTab调用失败`); + }, + }); + }, + bindPickerChange: function (e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + index: e.detail.value + }) + }, + back: function () { + tt.navigateBack({ + delta: 1 + }) + } + }, + attached: function(){ + let pages = getCurrentPages(); + if (pages.length <= 1) { + this.setData({ + back: false + }) + } + } +}) diff --git a/components/navbar/navbar.json b/components/navbar/navbar.json new file mode 100644 index 0000000..32640e0 --- /dev/null +++ b/components/navbar/navbar.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/components/navbar/navbar.ttml b/components/navbar/navbar.ttml new file mode 100644 index 0000000..1988acc --- /dev/null +++ b/components/navbar/navbar.ttml @@ -0,0 +1,21 @@ + + + + + + + + + + + + {{text}} + + + + {{array[index]}} + + + + + \ No newline at end of file diff --git a/components/navbar/navbar.ttss b/components/navbar/navbar.ttss new file mode 100644 index 0000000..9dc93f2 --- /dev/null +++ b/components/navbar/navbar.ttss @@ -0,0 +1,91 @@ +.navbar { + width: 100vw; + background-color: #F4F5F9; + position: fixed; + left: 0; + top: 0; + overflow: hidden; + z-index: 400000000; +} + +.title-container { + height: 44px; + display: flex; + align-items: center; + position: relative; +} + +.capsule { + margin-left: 10px; + height: 32px; + /* border: 1px solid #e1e1e3; */ + border-radius: 60px; + display: flex; + align-items: center; + padding: 0 20rpx; + /* background: #fff!important; */ +} + +.capsule > view { + width: 35px; + height: 60%; + position: relative; +} + +.capsule > view:nth-child(2) { + border-left: 1px solid #777; +} + +.capsule image { + width: 70%; + height: 100%; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%,-50%); +} + +.title { + color: #000; + position: absolute; + left: 104px; + right: 104px; + font-weight: 600; + font-size: 32rpx; + text-align: center; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +@font-face { + font-family: 'iconfont'; /* project id 1353695 */ + src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot'); + src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot?#iefix') format('embedded-opentype'), + url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff2') format('woff2'), + url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff') format('woff'), + url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.ttf') format('truetype'), + url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.svg#iconfont') format('svg'); +} +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-daohangdizhiweizhi:before { + content: "\e787"; +} +.locations{ + font-size: 28rpx; + display: inline-block; + width: 200rpx; + overflow: hidden; + text-overflow:ellipsis; + white-space: nowrap; +} +.pick-box{ + width: 260rpx; + padding-left: 20rpx; +} \ No newline at end of file diff --git a/config/config.js b/config/config.js new file mode 100644 index 0000000..80a1a5b --- /dev/null +++ b/config/config.js @@ -0,0 +1,329 @@ +let config = { + api:{ + /** + * 接口用途:login + */ + login: '/api/user/login', + /** + * B端用户详情 + */ + userDetail: '/api/user/detail', + getMallIcon: '/api/mall/getAppIcon', + //提现列表 + withdrawLsit:"/api/cashout/list", + //账户余额 + balance:"/api/cashout/getCurrentCashOutData", + // 商户提现 + userWithdraw:"/api/cashout/cashout", + /** + * 修改密码 + */ + userUpdatePwd: '/api/user/updatepwd', + /** + * 券包详情 + */ + couponOrderDetail: '/api/couponOrder/detail', + /** + * 购买须知图文详情 + */ + couponHtmlDetail: '/api/couponOrder/html', + /** + * 退款 + */ + refundOrderCreate: '/api/refund/create', + /** + * 券核销 + */ + couponOrderVerify: '/api/couponOrder/verify', + /** + * 发送验证码 + */ + sendValidationCode: '/wxMsgValidationcode/sendvalidationcode', + /** + * 验证验证码 + */ + hasValidationCode: '/wxMsgValidationcode/hasvalidationcode', + /** + * 已被核销的券包 + */ + couponOrderListVerified: '/api/couponOrder/listVerified', + /** + * 未核销的券包 + */ + couponOrderListUnVerified: '/api/couponOrder/listUnverified', + /** + * 上报解单 + */ + reportDailyVolume: '/api/wxMerchantTradeDaily/reportDailyVolume', + /** + * 获取当日解单 + */ + getVolume: '/api/wxMerchantTradeDaily/getVolume', + /** + * 获取周解单 + */ + getVolumeOfWeek: '/api/wxMerchantTradeDaily/getVolumeOfWeek', + /** + * 交易记录list + */ + dateAmountRecordListOrder: '/api/wxDateAmountRecord/listOrder', + /** + * 交易记录list + */ + dateAmountRecordListVerified: '/api/wxDateAmountRecord/listVerified', + /** + * 某日期交易总流水 + */ + getUnverifiedAmountOnDate: '/api/couponOrder/getUnverifiedAmountOnDate', + /** + * 某日期核销总流水 + */ + getVerifiedAmountOnDate: '/api/couponOrder/getVerifiedAmountOnDate', + /** + *刷卡支付订单 + */ + orderCreate: '/api/micropay/order_create', + /** + *查询刷卡支付订单 + */ + orderQuery: '/api/micropay/order_query', + /** + *撤销刷卡支付订单 + */ + orderReverse: '/api/micropay/order_reverse', + /** + *首页查询刷卡金额记录接口 + */ + listMicropay: '/api/wxDateAmountRecord/listMicropay', + /** + *刷卡支付交易流水分页列表接口 + */ + micropayListMicroPay: '/api/micropay/listMicroPay', + /** + *刷卡支付退款 + */ + // microPayRefund: '/api/micropay/microPayRefund', + /** + *刷卡支付某日期交易总流水 + */ + getMicroPayAmountOnDate:'/api/micropay/getMicroPayAmountOnDate', + /** + * 首页账单列表 + */ + listBillOweAndWaitPay:"/api/bill/listBillOweAndWaitPay", + /** + * 账单 + */ + listBill:"/api/bill/listBill", + /** + * 获得openId + */ + getOpenId:"/api/wx/getOpenId", + /** + * 获得超级管理员openid + */ + getSuperOpenId:"/api/wx/getSuperOpenId", + /** + * 获得手机号 + */ + getUserPhone: "/api/wx/getUserPhone", + /** + * + */ + getUserPhoneForBuser:"/api/wx/getUserPhoneForBuser", + /** + * 发起微信小程序支付订单 + */ + createorder:"/api/pay/create", + /** + * 更新支付订单状态 + */ + updatePayBill:'/api/pay/updatePayBill', + /** + * 获取用户等级及在此商户的折扣率及折扣后的金额 + */ + getUserInfo:"/api/user/getUserInfo", + /** + * 扫C端会员码返回会员信息 + */ + memScan:"/api/mem/mem_scan", + /** + * 补充会员信息 + */ + cMemberAdd:"/api/cuser/updateUserInfo", + /** + * + */ + findUserInfo:'/api/cuser/findUserInfo', + /** + *b端来源会员信息分页列表接口 + */ + listCUser: '/api/cuser/listCUser', + /** + *C端扫B端储值卡交易流水(消费记录 + 补贴)列表接口 + */ + cardPayList:"/api/cardPay/list", + /** + *C端扫B端储值卡交易流水SUM + */ + payMum:"/api/cardPay/sum", + /** + 补贴记录 + */ + subsidyList:"/api/subsidy/list", + /** + * 补贴记录汇总 + */ + subsidySum:"/api/subsidy/sum", + /** + * 图片上传 + */ + imgUpload:'/api/upload/awsFileUpload', + /** + * 获取商户列表 + */ + getMerchentList:"/api/merchant/name_list", + /** + * 获取消费金额对应积分 + */ + getCreditNum:"/api/credit/findByMerchantIdAndSpend", + /** + * 积分新增 + */ + addCredit:"/api/credit/add", + /** + * 根据手机号查询C端会员信息 + */ + findByPhone:"/api/credit/findByPhone", + /** + * 获取积分操作记录 + */ + getCreditList:"/api/credit/list", + /** + * 查询账户信息 + */ + findAccountById:"/api/merchant/findAccountById", + /** + * 更新收款账户信息 + */ + updateAccount: "/api/merchant/updateAccount", + /** + * 删除分账账户 + */ + deleteByReceiverId: "/api/merchant/deleteByReceiverId", + /** + * 获得解单的list + */ + tradeDailyList:"/api/wxMerchantTradeDaily/list", + /** + *保存或编辑 + */ + saveOrUpdate:"/api/wxMerchantTradeDaily/saveOrUpdate", + /** + * 解单详情详情 + */ + wxMerchantTradeDailyfindById:"/api/wxMerchantTradeDaily/findById", + /** + * 获取会员可赠送的券列表 + */ + wxMerchantcouponSend:"/api/couponSend/list", + /** + * 商户注券操作 + */ + wxMerchantcouponhandSel: "/api/couponSend/handSel", + /** + * 商户注券记录 + */ + wxMerchantcouponStory: "/api/couponSend/actionLog", + /** + * 获取结算单详情接口 + */ + findSettleById:"/api/bill/findSettleById", + /** + * 检查用户手机授权状态 + */ + checkPhoneStatus:"/api/wx/checkPhoneStatus", + /** + * 检查用户是否有权限修改收款账户 + */ + permitModifiy: "/api/merchant/permitModifiy", + /** + * 查询服装tag + */ + getTag: "/api/tag/getData", + /** + * 收银满减券 + */ + getManjian: "/api/micropay/order_create_v2", + /** + * 获取营销结算列表 + */ + getSubsidyList:"/api/subsidy/list", + /** + * 获取营销结算汇总 + */ + getSubsidySummary:"/api/subsidy/summary", + /** + *刷卡支付订单 + */ + orderCreate2: '/api/micropay/pay_order_create_v2', + /** + * 查询商户授权状态 + */ + getOpenIdByPhone:"/api/merchant/getOpenIdByPhone", + /** + * B端发卷-查询 + */ + getCouponlist:"/api/coupon/list", + /** + * B端发卷-已上架 + */ + getShelf: "/api/wxCouponChannel/list", + /** + * B端发卷-添加通用卷 + */ + addCoupon: "/api/coupon/add", + /** + * B端发卷-修改通用券 + */ + updataCoupon:"/api/coupon/update", + /** + *B端发卷- 提交审批 + */ + submitExamine:"/api/coupon/apply", + /** + * B端发卷-投放 + */ + addbatch:"/api/wxCouponChannel/addbatch", + /** + * B端发卷-下架 + */ + soldOut: "/api/wxCouponChannel/update", + /** + * B端发卷-作废 + */ + cancellation:"/api/coupon/update", + /** + * B端发卷-查询审批历史记录 + */ + lookHistory :"/api/coupon/flowHistory", + /** + * 配送列表 + */ + goodsList:'/api/couponOrder/goodsList', + /** + * 查询配送详情 + */ + ouponOrderId:"/api/couponOrder/detail", + /** + * 发货 + */ + sendGoods:"/api/couponOrder/sendGoods", + + }, + weapp: { + appId: "tt7af40c49e5cd8d5001", + dataTowerUrl: "https://mobiletest.malls.iformall.com", + } +} +module.exports = config; \ No newline at end of file diff --git a/ec-canvas/ec-canvas.js b/ec-canvas/ec-canvas.js new file mode 100644 index 0000000..f58e59f --- /dev/null +++ b/ec-canvas/ec-canvas.js @@ -0,0 +1,118 @@ +import WxCanvas from './tt-canvas'; +import * as echarts from './echarts'; +let ctx; +Component({ + properties: { + canvasId: { + type: String, + value: 'ec-canvas' + }, + + ec: { + type: Object + } + }, + + data: { + + }, + + ready: function () { + if (!this.data.ec) { + console.warn('组件需绑定 ec 变量,例:'); + return; + } + + if (!this.data.ec.lazyLoad) { + this.init(); + } + }, + + methods: { + init: function (callback) { + const version = tt.version.version.split('.').map(n => parseInt(n, 10)); + const isValid = version[0] > 1 || (version[0] === 1 && version[1] > 9) + || (version[0] === 1 && version[1] === 9 && version[2] >= 91); + if (!isValid) { + console.error('微信基础库版本过低,需大于等于 1.9.91。' + + '参见:https://github.com/ecomfe/echarts-for-weixin' + + '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82'); + return; + } + + ctx = tt.createCanvasContext(this.data.canvasId, this); + + const canvas = new WxCanvas(ctx, this.data.canvasId); + + echarts.setCanvasCreator(() => { + return canvas; + }); + + var query = tt.createSelectorQuery().in(this); + query.select('.ec-canvas').boundingClientRect(res => { + if (typeof callback === 'function') { + this.chart = callback(canvas, res.width, res.height); + } + else if (this.data.ec && typeof this.data.ec.onInit === 'function') { + this.chart = this.data.ec.onInit(canvas, res.width, res.height); + } + else { + this.triggerEvent('init', { + canvas: canvas, + width: res.width, + height: res.height + }); + } + }).exec(); + }, + + canvasToTempFilePath(opt) { + if (!opt.canvasId) { + opt.canvasId = this.data.canvasId; + } + + ctx.draw(true, () => { + tt.canvasToTempFilePath(opt, this); + }); + }, + + touchStart(e) { + if (this.chart && e.touches.length > 0) { + var touch = e.touches[0]; + this.chart._zr.handler.dispatch('mousedown', { + zrX: touch.x, + zrY: touch.y + }); + this.chart._zr.handler.dispatch('mousemove', { + zrX: touch.x, + zrY: touch.y + }); + } + }, + + touchMove(e) { + if (this.chart && e.touches.length > 0) { + var touch = e.touches[0]; + this.chart._zr.handler.dispatch('mousemove', { + zrX: touch.x, + zrY: touch.y + }); + } + }, + + touchEnd(e) { + if (this.chart) { + const touch = e.changedTouches ? e.changedTouches[0] : {}; + this.chart._zr.handler.dispatch('mouseup', { + zrX: touch.x, + zrY: touch.y + }); + this.chart._zr.handler.dispatch('click', { + zrX: touch.x, + zrY: touch.y + }); + } + } + } +}); diff --git a/ec-canvas/ec-canvas.json b/ec-canvas/ec-canvas.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/ec-canvas/ec-canvas.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/ec-canvas/ec-canvas.wxml b/ec-canvas/ec-canvas.wxml new file mode 100644 index 0000000..33cfaf7 --- /dev/null +++ b/ec-canvas/ec-canvas.wxml @@ -0,0 +1,4 @@ + + diff --git a/ec-canvas/ec-canvas.wxss b/ec-canvas/ec-canvas.wxss new file mode 100644 index 0000000..0d64b10 --- /dev/null +++ b/ec-canvas/ec-canvas.wxss @@ -0,0 +1,4 @@ +.ec-canvas { + width: 100%; + height: 100%; +} diff --git a/ec-canvas/echarts.js b/ec-canvas/echarts.js new file mode 100644 index 0000000..1c472bf --- /dev/null +++ b/ec-canvas/echarts.js @@ -0,0 +1,10 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.echarts={})}(this,function(t){"use strict";function e(t){var e={},n={},i=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),a=t.match(/Edge\/([\d.]+)/),o=/micromessenger/i.test(t);return i&&(n.firefox=!0,n.version=i[1]),r&&(n.ie=!0,n.version=r[1]),a&&(n.edge=!0,n.version=a[1]),o&&(n.weChat=!0),{browser:n,os:e,node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!n.ie&&!n.edge,pointerEventsSupported:"onpointerdown"in window&&(n.edge||n.ie&&n.version>=11),domSupported:"undefined"!=typeof document}}function n(t,e){"createCanvas"===t&&(Kc=null),$c[t]=e}function i(t){if(null==t||"object"!=typeof t)return t;var e=t,n=Gc.call(t);if("[object Array]"===n){if(!B(t)){e=[];for(var r=0,a=t.length;a>r;r++)e[r]=i(t[r])}}else if(Hc[n]){if(!B(t)){var o=t.constructor;if(t.constructor.from)e=o.from(t);else{e=new o(t.length);for(var r=0,a=t.length;a>r;r++)e[r]=i(t[r])}}}else if(!Wc[n]&&!B(t)&&!C(t)){e={};for(var s in t)t.hasOwnProperty(s)&&(e[s]=i(t[s]))}return e}function r(t,e,n){if(!S(e)||!S(t))return n?i(e):t;for(var a in e)if(e.hasOwnProperty(a)){var o=t[a],s=e[a];!S(s)||!S(o)||x(s)||x(o)||C(s)||C(o)||M(s)||M(o)||B(s)||B(o)?!n&&a in t||(t[a]=i(e[a],!0)):r(o,s,n)}return t}function a(t,e){for(var n=t[0],i=1,a=t.length;a>i;i++)n=r(n,t[i],e);return n}function o(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function s(t,e,n){for(var i in e)e.hasOwnProperty(i)&&(n?null!=e[i]:null==t[i])&&(t[i]=e[i]);return t}function l(){return Kc||(Kc=Qc().getContext("2d")),Kc}function u(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return n}return-1}function h(t,e){function n(){}var i=t.prototype;n.prototype=e.prototype,t.prototype=new n;for(var r in i)t.prototype[r]=i[r];t.prototype.constructor=t,t.superClass=e}function c(t,e,n){t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,s(t,e,n)}function f(t){return t?"string"==typeof t?!1:"number"==typeof t.length:void 0}function d(t,e,n){if(t&&e)if(t.forEach&&t.forEach===Xc)t.forEach(e,n);else if(t.length===+t.length)for(var i=0,r=t.length;r>i;i++)e.call(n,t[i],i,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(n,t[a],a,t)}function p(t,e,n){if(t&&e){if(t.map&&t.map===Yc)return t.map(e,n);for(var i=[],r=0,a=t.length;a>r;r++)i.push(e.call(n,t[r],r,t));return i}}function g(t,e,n,i){if(t&&e){if(t.reduce&&t.reduce===Zc)return t.reduce(e,n,i);for(var r=0,a=t.length;a>r;r++)n=e.call(i,n,t[r],r,t);return n}}function v(t,e,n){if(t&&e){if(t.filter&&t.filter===jc)return t.filter(e,n);for(var i=[],r=0,a=t.length;a>r;r++)e.call(n,t[r],r,t)&&i.push(t[r]);return i}}function m(t,e,n){if(t&&e)for(var i=0,r=t.length;r>i;i++)if(e.call(n,t[i],i,t))return t[i]}function y(t,e){var n=Uc.call(arguments,2);return function(){return t.apply(e,n.concat(Uc.call(arguments)))}}function _(t){var e=Uc.call(arguments,1);return function(){return t.apply(this,e.concat(Uc.call(arguments)))}}function x(t){return"[object Array]"===Gc.call(t)}function w(t){return"function"==typeof t}function b(t){return"[object String]"===Gc.call(t)}function S(t){var e=typeof t;return"function"===e||!!t&&"object"==e}function M(t){return!!Wc[Gc.call(t)]}function T(t){return!!Hc[Gc.call(t)]}function C(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function k(t){return t!==t}function I(){for(var t=0,e=arguments.length;e>t;t++)if(null!=arguments[t])return arguments[t]}function D(t,e){return null!=t?t:e}function A(t,e,n){return null!=t?t:null!=e?e:n}function P(){return Function.call.apply(Uc,arguments)}function O(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function L(t,e){if(!t)throw new Error(e)}function E(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function R(t){t[Jc]=!0}function B(t){return t[Jc]}function z(t){function e(t,e){n?i.set(t,e):i.set(e,t)}var n=x(t);this.data={};var i=this;t instanceof z?t.each(e):t&&d(t,e)}function F(t){return new z(t)}function N(t,e){for(var n=new t.constructor(t.length+e.length),i=0;i=0;if(r){var a="touchend"!=i?e.targetTouches[0]:e.changedTouches[0];a&&fe(t,a,e,n)}else fe(t,e,e,n),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var o=e.button;return null==e.which&&void 0!==o&&cf.test(e.type)&&(e.which=1&o?1:2&o?3:4&o?2:0),e}function ge(t,e,n){hf?t.addEventListener(e,n):t.attachEvent("on"+e,n)}function ve(t,e,n){hf?t.removeEventListener(e,n):t.detachEvent("on"+e,n)}function me(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:ye}}function ye(){ff(this.event)}function _e(){}function xe(t,e,n){if(t[t.rectHover?"rectContain":"contain"](e,n)){for(var i,r=t;r;){if(r.clipPath&&!r.clipPath.contain(e,n))return!1;r.silent&&(i=!0),r=r.parent}return i?df:!0}return!1}function we(){var t=new vf(6);return be(t),t}function be(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Se(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Me(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],a=e[0]*n[2]+e[2]*n[3],o=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t}function Te(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function Ce(t,e,n){var i=e[0],r=e[2],a=e[4],o=e[1],s=e[3],l=e[5],u=Math.sin(n),h=Math.cos(n);return t[0]=i*h+o*u,t[1]=-i*u+o*h,t[2]=r*h+s*u,t[3]=-r*u+h*s,t[4]=h*a+u*l,t[5]=h*l-u*a,t}function ke(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t}function Ie(t,e){var n=e[0],i=e[2],r=e[4],a=e[1],o=e[3],s=e[5],l=n*o-a*i;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-o*r)*l,t[5]=(a*r-n*s)*l,t):null}function De(t){var e=we();return Se(e,t),e}function Ae(t){return t>_f||-_f>t}function Pe(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null==t.loop?!1:t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}function Oe(t){return t=Math.round(t),0>t?0:t>255?255:t}function Le(t){return t=Math.round(t),0>t?0:t>360?360:t}function Ee(t){return 0>t?0:t>1?1:t}function Re(t){return Oe(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100*255:parseInt(t,10))}function Be(t){return Ee(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100:parseFloat(t))}function ze(t,e,n){return 0>n?n+=1:n>1&&(n-=1),1>6*n?t+(e-t)*n*6:1>2*n?e:2>3*n?t+(e-t)*(2/3-n)*6:t}function Fe(t,e,n){return t+(e-t)*n}function Ne(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function Ve(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function We(t,e){Lf&&Ve(Lf,e),Lf=Of.put(t,Lf||e.slice())}function He(t,e){if(t){e=e||[];var n=Of.get(t);if(n)return Ve(e,n);t+="";var i=t.replace(/ /g,"").toLowerCase();if(i in Pf)return Ve(e,Pf[i]),We(t,e),e;if("#"!==i.charAt(0)){var r=i.indexOf("("),a=i.indexOf(")");if(-1!==r&&a+1===i.length){var o=i.substr(0,r),s=i.substr(r+1,a-(r+1)).split(","),l=1;switch(o){case"rgba":if(4!==s.length)return void Ne(e,0,0,0,1);l=Be(s.pop());case"rgb":return 3!==s.length?void Ne(e,0,0,0,1):(Ne(e,Re(s[0]),Re(s[1]),Re(s[2]),l),We(t,e),e);case"hsla":return 4!==s.length?void Ne(e,0,0,0,1):(s[3]=Be(s[3]),Ge(s,e),We(t,e),e);case"hsl":return 3!==s.length?void Ne(e,0,0,0,1):(Ge(s,e),We(t,e),e);default:return}}Ne(e,0,0,0,1)}else{if(4===i.length){var u=parseInt(i.substr(1),16);return u>=0&&4095>=u?(Ne(e,(3840&u)>>4|(3840&u)>>8,240&u|(240&u)>>4,15&u|(15&u)<<4,1),We(t,e),e):void Ne(e,0,0,0,1)}if(7===i.length){var u=parseInt(i.substr(1),16);return u>=0&&16777215>=u?(Ne(e,(16711680&u)>>16,(65280&u)>>8,255&u,1),We(t,e),e):void Ne(e,0,0,0,1)}}}}function Ge(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Be(t[1]),r=Be(t[2]),a=.5>=r?r*(i+1):r+i-r*i,o=2*r-a;return e=e||[],Ne(e,Oe(255*ze(o,a,n+1/3)),Oe(255*ze(o,a,n)),Oe(255*ze(o,a,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function qe(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,a=t[2]/255,o=Math.min(i,r,a),s=Math.max(i,r,a),l=s-o,u=(s+o)/2;if(0===l)e=0,n=0;else{n=.5>u?l/(s+o):l/(2-s-o);var h=((s-i)/6+l/2)/l,c=((s-r)/6+l/2)/l,f=((s-a)/6+l/2)/l;i===s?e=f-c:r===s?e=1/3+h-f:a===s&&(e=2/3+c-h),0>e&&(e+=1),e>1&&(e-=1)}var d=[360*e,n,u];return null!=t[3]&&d.push(t[3]),d}}function Xe(t,e){var n=He(t);if(n){for(var i=0;3>i;i++)n[i]=0>e?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:t[i]<0&&(n[i]=0);return Qe(n,4===n.length?"rgba":"rgb")}}function je(t){var e=He(t);return e?((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1):void 0}function Ue(t,e,n){if(e&&e.length&&t>=0&&1>=t){n=n||[];var i=t*(e.length-1),r=Math.floor(i),a=Math.ceil(i),o=e[r],s=e[a],l=i-r;return n[0]=Oe(Fe(o[0],s[0],l)),n[1]=Oe(Fe(o[1],s[1],l)),n[2]=Oe(Fe(o[2],s[2],l)),n[3]=Ee(Fe(o[3],s[3],l)),n}}function Ye(t,e,n){if(e&&e.length&&t>=0&&1>=t){var i=t*(e.length-1),r=Math.floor(i),a=Math.ceil(i),o=He(e[r]),s=He(e[a]),l=i-r,u=Qe([Oe(Fe(o[0],s[0],l)),Oe(Fe(o[1],s[1],l)),Oe(Fe(o[2],s[2],l)),Ee(Fe(o[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:a,value:i}:u}}function Ze(t,e,n,i){return t=He(t),t?(t=qe(t),null!=e&&(t[0]=Le(e)),null!=n&&(t[1]=Be(n)),null!=i&&(t[2]=Be(i)),Qe(Ge(t),"rgba")):void 0}function $e(t,e){return t=He(t),t&&null!=e?(t[3]=Ee(e),Qe(t,"rgba")):void 0}function Qe(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return("rgba"===e||"hsva"===e||"hsla"===e)&&(n+=","+t[3]),e+"("+n+")"}}function Ke(t,e){return t[e]}function Je(t,e,n){t[e]=n}function tn(t,e,n){return(e-t)*n+t}function en(t,e,n){return n>.5?e:t}function nn(t,e,n,i,r){var a=t.length;if(1==r)for(var o=0;a>o;o++)i[o]=tn(t[o],e[o],n);else for(var s=a&&t[0].length,o=0;a>o;o++)for(var l=0;s>l;l++)i[o][l]=tn(t[o][l],e[o][l],n)}function rn(t,e,n){var i=t.length,r=e.length;if(i!==r){var a=i>r;if(a)t.length=r;else for(var o=i;r>o;o++)t.push(1===n?e[o]:zf.call(e[o]))}for(var s=t[0]&&t[0].length,o=0;ol;l++)isNaN(t[o][l])&&(t[o][l]=e[o][l])}function an(t,e,n){if(t===e)return!0;var i=t.length;if(i!==e.length)return!1;if(1===n){for(var r=0;i>r;r++)if(t[r]!==e[r])return!1}else for(var a=t[0].length,r=0;i>r;r++)for(var o=0;a>o;o++)if(t[r][o]!==e[r][o])return!1;return!0}function on(t,e,n,i,r,a,o,s,l){var u=t.length;if(1==l)for(var h=0;u>h;h++)s[h]=sn(t[h],e[h],n[h],i[h],r,a,o);else for(var c=t[0].length,h=0;u>h;h++)for(var f=0;c>f;f++)s[h][f]=sn(t[h][f],e[h][f],n[h][f],i[h][f],r,a,o)}function sn(t,e,n,i,r,a,o){var s=.5*(n-t),l=.5*(i-e);return(2*(e-n)+s+l)*o+(-3*(e-n)-2*s-l)*a+s*r+e}function ln(t){if(f(t)){var e=t.length;if(f(t[0])){for(var n=[],i=0;e>i;i++)n.push(zf.call(t[i]));return n}return zf.call(t)}return t}function un(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}function hn(t){var e=t[t.length-1].value;return f(e&&e[0])?2:1}function cn(t,e,n,i,r,a){var o=t._getter,s=t._setter,l="spline"===e,u=i.length;if(u){var h,c=i[0].value,d=f(c),p=!1,g=!1,v=d?hn(i):0;i.sort(function(t,e){return t.time-e.time}),h=i[u-1].time;for(var m=[],y=[],_=i[0].value,x=!0,w=0;u>w;w++){m.push(i[w].time/h);var b=i[w].value;if(d&&an(b,_,v)||!d&&b===_||(x=!1),_=b,"string"==typeof b){var S=He(b);S?(b=S,p=!0):g=!0}y.push(b)}if(a||!x){for(var M=y[u-1],w=0;u-1>w;w++)d?rn(y[w],M,v):!isNaN(y[w])||isNaN(M)||g||p||(y[w]=M);d&&rn(o(t._target,r),M,v);var T,C,k,I,D,A,P=0,O=0;if(p)var L=[0,0,0,0];var E=function(t,e){var n;if(0>e)n=0;else if(O>e){for(T=Math.min(P+1,u-1),n=T;n>=0&&!(m[n]<=e);n--);n=Math.min(n,u-2)}else{for(n=P;u>n&&!(m[n]>e);n++);n=Math.min(n-1,u-2)}P=n,O=e;var i=m[n+1]-m[n];if(0!==i)if(C=(e-m[n])/i,l)if(I=y[n],k=y[0===n?n:n-1],D=y[n>u-2?u-1:n+1],A=y[n>u-3?u-1:n+2],d)on(k,I,D,A,C,C*C,C*C*C,o(t,r),v);else{var a;if(p)a=on(k,I,D,A,C,C*C,C*C*C,L,1),a=un(L);else{if(g)return en(I,D,C);a=sn(k,I,D,A,C,C*C,C*C*C)}s(t,r,a)}else if(d)nn(y[n],y[n+1],C,o(t,r),v);else{var a;if(p)nn(y[n],y[n+1],C,L,1),a=un(L);else{if(g)return en(y[n],y[n+1],C);a=tn(y[n],y[n+1],C)}s(t,r,a)}},R=new Pe({target:t._target,life:h,loop:t._loop,delay:t._delay,onframe:E,ondestroy:n});return e&&"spline"!==e&&(R.easing=e),R}}}function fn(t,e,n,i,r,a,o,s){function l(){h--,h||a&&a()}b(i)?(a=r,r=i,i=0):w(r)?(a=r,r="linear",i=0):w(i)?(a=i,i=0):w(n)?(a=n,n=500):n||(n=500),t.stopAnimation(),dn(t,"",t,e,n,i,s);var u=t.animators.slice(),h=u.length;h||a&&a();for(var c=0;c0&&t.animate(e,!1).when(null==r?500:r,s).delay(a||0)}function pn(t,e,n,i){if(e){var r={};r[e]={},r[e][n]=i,t.attr(r)}else t.attr(n,i)}function gn(t,e,n,i){0>n&&(t+=n,n=-n),0>i&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}function vn(t){for(var e=0;t>=$f;)e|=1&t,t>>=1;return t+e}function mn(t,e,n,i){var r=e+1;if(r===n)return 1;if(i(t[r++],t[e])<0){for(;n>r&&i(t[r],t[r-1])<0;)r++;yn(t,e,r)}else for(;n>r&&i(t[r],t[r-1])>=0;)r++;return r-e}function yn(t,e,n){for(n--;n>e;){var i=t[e];t[e++]=t[n],t[n--]=i}}function _n(t,e,n,i,r){for(i===e&&i++;n>i;i++){for(var a,o=t[i],s=e,l=i;l>s;)a=s+l>>>1,r(o,t[a])<0?l=a:s=a+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=o}}function xn(t,e,n,i,r,a){var o=0,s=0,l=1;if(a(t,e[n+r])>0){for(s=i-r;s>l&&a(t,e[n+r+l])>0;)o=l,l=(l<<1)+1,0>=l&&(l=s);l>s&&(l=s),o+=r,l+=r}else{for(s=r+1;s>l&&a(t,e[n+r-l])<=0;)o=l,l=(l<<1)+1,0>=l&&(l=s);l>s&&(l=s);var u=o;o=r-l,l=r-u}for(o++;l>o;){var h=o+(l-o>>>1);a(t,e[n+h])>0?o=h+1:l=h}return l}function wn(t,e,n,i,r,a){var o=0,s=0,l=1;if(a(t,e[n+r])<0){for(s=r+1;s>l&&a(t,e[n+r-l])<0;)o=l,l=(l<<1)+1,0>=l&&(l=s);l>s&&(l=s);var u=o;o=r-l,l=r-u}else{for(s=i-r;s>l&&a(t,e[n+r+l])>=0;)o=l,l=(l<<1)+1,0>=l&&(l=s);l>s&&(l=s),o+=r,l+=r}for(o++;l>o;){var h=o+(l-o>>>1);a(t,e[n+h])<0?l=h:o=h+1}return l}function bn(t,e){function n(t,e){l[c]=t,u[c]=e,c+=1}function i(){for(;c>1;){var t=c-2;if(t>=1&&u[t-1]<=u[t]+u[t+1]||t>=2&&u[t-2]<=u[t]+u[t-1])u[t-1]u[t+1])break;a(t)}}function r(){for(;c>1;){var t=c-2;t>0&&u[t-1]=r?o(i,r,a,h):s(i,r,a,h)))}function o(n,i,r,a){var o=0;for(o=0;i>o;o++)f[o]=t[n+o];var s=0,l=r,u=n;if(t[u++]=t[l++],0!==--a){if(1===i){for(o=0;a>o;o++)t[u+o]=t[l+o];return void(t[u+a]=f[s])}for(var c,d,p,g=h;;){c=0,d=0,p=!1;do if(e(t[l],f[s])<0){if(t[u++]=t[l++],d++,c=0,0===--a){p=!0;break}}else if(t[u++]=f[s++],c++,d=0,1===--i){p=!0;break}while(g>(c|d));if(p)break;do{if(c=wn(t[l],f,s,i,0,e),0!==c){for(o=0;c>o;o++)t[u+o]=f[s+o];if(u+=c,s+=c,i-=c,1>=i){p=!0;break}}if(t[u++]=t[l++],0===--a){p=!0;break}if(d=xn(f[s],t,l,a,0,e),0!==d){for(o=0;d>o;o++)t[u+o]=t[l+o];if(u+=d,l+=d,a-=d,0===a){p=!0;break}}if(t[u++]=f[s++],1===--i){p=!0;break}g--}while(c>=Qf||d>=Qf);if(p)break;0>g&&(g=0),g+=2}if(h=g,1>h&&(h=1),1===i){for(o=0;a>o;o++)t[u+o]=t[l+o];t[u+a]=f[s]}else{if(0===i)throw new Error;for(o=0;i>o;o++)t[u+o]=f[s+o]}}else for(o=0;i>o;o++)t[u+o]=f[s+o]}function s(n,i,r,a){var o=0;for(o=0;a>o;o++)f[o]=t[r+o];var s=n+i-1,l=a-1,u=r+a-1,c=0,d=0;if(t[u--]=t[s--],0!==--i){if(1===a){for(u-=i,s-=i,d=u+1,c=s+1,o=i-1;o>=0;o--)t[d+o]=t[c+o];return void(t[u]=f[l])}for(var p=h;;){var g=0,v=0,m=!1;do if(e(f[l],t[s])<0){if(t[u--]=t[s--],g++,v=0,0===--i){m=!0;break}}else if(t[u--]=f[l--],v++,g=0,1===--a){m=!0;break}while(p>(g|v));if(m)break;do{if(g=i-wn(f[l],t,n,i,i-1,e),0!==g){for(u-=g,s-=g,i-=g,d=u+1,c=s+1,o=g-1;o>=0;o--)t[d+o]=t[c+o];if(0===i){m=!0;break}}if(t[u--]=f[l--],1===--a){m=!0;break}if(v=a-xn(t[s],f,0,a,a-1,e),0!==v){for(u-=v,l-=v,a-=v,d=u+1,c=l+1,o=0;v>o;o++)t[d+o]=f[c+o];if(1>=a){m=!0;break}}if(t[u--]=t[s--],0===--i){m=!0;break}p--}while(g>=Qf||v>=Qf);if(m)break;0>p&&(p=0),p+=2}if(h=p,1>h&&(h=1),1===a){for(u-=i,s-=i,d=u+1,c=s+1,o=i-1;o>=0;o--)t[d+o]=t[c+o];t[u]=f[l]}else{if(0===a)throw new Error;for(c=u-(a-1),o=0;a>o;o++)t[c+o]=f[o]}}else for(c=u-(a-1),o=0;a>o;o++)t[c+o]=f[o]}var l,u,h=Qf,c=0,f=[];l=[],u=[],this.mergeRuns=i,this.forceMergeRuns=r,this.pushRun=n}function Sn(t,e,n,i){n||(n=0),i||(i=t.length);var r=i-n;if(!(2>r)){var a=0;if($f>r)return a=mn(t,n,i,e),void _n(t,n,i,n+a,e);var o=new bn(t,e),s=vn(r);do{if(a=mn(t,n,i,e),s>a){var l=r;l>s&&(l=s),_n(t,n,n+l,n+a,e),a=l}o.pushRun(n,a),o.mergeRuns(),r-=a,n+=a}while(0!==r);o.forceMergeRuns()}}function Mn(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function Tn(t,e,n){var i=null==e.x?0:e.x,r=null==e.x2?1:e.x2,a=null==e.y?0:e.y,o=null==e.y2?0:e.y2;e.global||(i=i*n.width+n.x,r=r*n.width+n.x,a=a*n.height+n.y,o=o*n.height+n.y),i=isNaN(i)?0:i,r=isNaN(r)?1:r,a=isNaN(a)?0:a,o=isNaN(o)?0:o;var s=t.createLinearGradient(i,a,r,o);return s}function Cn(t,e,n){var i=n.width,r=n.height,a=Math.min(i,r),o=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;e.global||(o=o*i+n.x,s=s*r+n.y,l*=a);var u=t.createRadialGradient(o,s,0,o,s,l);return u}function kn(){return!1}function In(t,e,n){var i=Qc(),r=e.getWidth(),a=e.getHeight(),o=i.style;return o&&(o.position="absolute",o.left=0,o.top=0,o.width=r+"px",o.height=a+"px",i.setAttribute("data-zr-dom-id",t)),i.width=r*n,i.height=a*n,i}function Dn(t){if("string"==typeof t){var e=ud.get(t);return e&&e.image}return t}function An(t,e,n,i,r){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var a=ud.get(t),o={hostEl:n,cb:i,cbPayload:r};return a?(e=a.image,!On(e)&&a.pending.push(o)):(!e&&(e=new Image),e.onload=e.onerror=Pn,ud.put(t,e.__cachedImgObj={image:e,pending:[o]}),e.src=e.__zrImageSrc=t),e}return t}return e}function Pn(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;ea;a++)r=Math.max(Xn(i[a],e).width,r);return cd>fd&&(cd=0,hd={}),cd++,hd[n]=r,r}function En(t,e,n,i,r,a,o){return a?Bn(t,e,n,i,r,a,o):Rn(t,e,n,i,r,o)}function Rn(t,e,n,i,r,a){var o=jn(t,e,r,a),s=Ln(t,e);r&&(s+=r[1]+r[3]);var l=o.outerHeight,u=zn(0,s,n),h=Fn(0,l,i),c=new gn(u,h,s,l);return c.lineHeight=o.lineHeight,c}function Bn(t,e,n,i,r,a,o){var s=Un(t,{rich:a,truncate:o,font:e,textAlign:n,textPadding:r}),l=s.outerWidth,u=s.outerHeight,h=zn(0,l,n),c=Fn(0,u,i);return new gn(h,c,l,u)}function zn(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function Fn(t,e,n){return"middle"===n?t-=e/2:"bottom"===n&&(t-=e),t}function Nn(t,e,n){var i=e.x,r=e.y,a=e.height,o=e.width,s=a/2,l="left",u="top";switch(t){case"left":i-=n,r+=s,l="right",u="middle";break;case"right":i+=n+o,r+=s,u="middle";break;case"top":i+=o/2,r-=n,l="center",u="bottom";break;case"bottom":i+=o/2,r+=a+n,l="center";break;case"inside":i+=o/2,r+=s,l="center",u="middle";break;case"insideLeft":i+=n,r+=s,u="middle";break;case"insideRight":i+=o-n,r+=s,l="right",u="middle";break;case"insideTop":i+=o/2,r+=n,l="center";break;case"insideBottom":i+=o/2,r+=a-n,l="center",u="bottom";break;case"insideTopLeft":i+=n,r+=n;break;case"insideTopRight":i+=o-n,r+=n,l="right";break;case"insideBottomLeft":i+=n,r+=a-n,u="bottom";break;case"insideBottomRight":i+=o-n,r+=a-n,l="right",u="bottom"}return{x:i,y:r,textAlign:l,textVerticalAlign:u}}function Vn(t,e,n,i,r){if(!e)return"";var a=(t+"").split("\n");r=Wn(e,n,i,r);for(var o=0,s=a.length;s>o;o++)a[o]=Hn(a[o],r);return a.join("\n")}function Wn(t,e,n,i){i=o({},i),i.font=e;var n=D(n,"...");i.maxIterations=D(i.maxIterations,2);var r=i.minChar=D(i.minChar,0);i.cnCharWidth=Ln("国",e);var a=i.ascCharWidth=Ln("a",e);i.placeholder=D(i.placeholder,"");for(var s=t=Math.max(0,t-1),l=0;r>l&&s>=a;l++)s-=a;var u=Ln(n);return u>s&&(n="",u=0),s=t-u,i.ellipsis=n,i.ellipsisWidth=u,i.contentWidth=s,i.containerWidth=t,i}function Hn(t,e){var n=e.containerWidth,i=e.font,r=e.contentWidth;if(!n)return"";var a=Ln(t,i);if(n>=a)return t;for(var o=0;;o++){if(r>=a||o>=e.maxIterations){t+=e.ellipsis;break}var s=0===o?Gn(t,r,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*r/a):0;t=t.substr(0,s),a=Ln(t,i)}return""===t&&(t=e.placeholder),t}function Gn(t,e,n,i){for(var r=0,a=0,o=t.length;o>a&&e>r;a++){var s=t.charCodeAt(a);r+=s>=0&&127>=s?n:i}return a}function qn(t){return Ln("国",t)}function Xn(t,e){return gd.measureText(t,e)}function jn(t,e,n,i){null!=t&&(t+="");var r=qn(e),a=t?t.split("\n"):[],o=a.length*r,s=o;if(n&&(s+=n[0]+n[2]),t&&i){var l=i.outerHeight,u=i.outerWidth;if(null!=l&&s>l)t="",a=[];else if(null!=u)for(var h=Wn(u-(n?n[1]+n[3]:0),e,i.ellipsis,{minChar:i.minChar,placeholder:i.placeholder}),c=0,f=a.length;f>c;c++)a[c]=Hn(a[c],h)}return{lines:a,height:o,outerHeight:s,lineHeight:r}}function Un(t,e){var n={lines:[],width:0,height:0};if(null!=t&&(t+=""),!t)return n;for(var i,r=dd.lastIndex=0;null!=(i=dd.exec(t));){var a=i.index;a>r&&Yn(n,t.substring(r,a)),Yn(n,i[2],i[1]),r=dd.lastIndex}rd)return{lines:[],width:0,height:0};_.textWidth=Ln(_.text,b);var M=x.textWidth,T=null==M||"auto"===M;if("string"==typeof M&&"%"===M.charAt(M.length-1))_.percentWidth=M,u.push(_),M=0;else{if(T){M=_.textWidth;var C=x.textBackgroundColor,k=C&&C.image;k&&(k=Dn(k),On(k)&&(M=Math.max(M,k.width*S/k.height)))}var I=w?w[1]+w[3]:0;M+=I;var P=null!=f?f-m:null;null!=P&&M>P&&(!T||I>P?(_.text="",_.textWidth=M=0):(_.text=Vn(_.text,P-I,b,c.ellipsis,{minChar:c.minChar}),_.textWidth=Ln(_.text,b),M=_.textWidth+I))}m+=_.width=M,x&&(v=Math.max(v,_.lineHeight))}g.width=m,g.lineHeight=v,s+=v,l=Math.max(l,m)}n.outerWidth=n.width=D(e.textWidth,l),n.outerHeight=n.height=D(e.textHeight,s),h&&(n.outerWidth+=h[1]+h[3],n.outerHeight+=h[0]+h[2]);for(var p=0;pl&&(o+=l,l=-l),0>u&&(s+=u,u=-u),"number"==typeof h?n=i=r=a=h:h instanceof Array?1===h.length?n=i=r=a=h[0]:2===h.length?(n=r=h[0],i=a=h[1]):3===h.length?(n=h[0],i=a=h[1],r=h[2]):(n=h[0],i=h[1],r=h[2],a=h[3]):n=i=r=a=0;var c;n+i>l&&(c=n+i,n*=l/c,i*=l/c),r+a>l&&(c=r+a,r*=l/c,a*=l/c),i+r>u&&(c=i+r,i*=u/c,r*=u/c),n+a>u&&(c=n+a,n*=u/c,a*=u/c),t.moveTo(o+n,s),t.lineTo(o+l-i,s),0!==i&&t.arc(o+l-i,s+i,i,-Math.PI/2,0),t.lineTo(o+l,s+u-r),0!==r&&t.arc(o+l-r,s+u-r,r,0,Math.PI/2),t.lineTo(o+a,s+u),0!==a&&t.arc(o+a,s+u-a,a,Math.PI/2,Math.PI),t.lineTo(o,s+n),0!==n&&t.arc(o+n,s+n,n,Math.PI,1.5*Math.PI)}function Qn(t){return Kn(t),d(t.rich,Kn),t}function Kn(t){if(t){t.font=Zn(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||vd[e]?e:"left";var n=t.textVerticalAlign||t.textBaseline;"center"===n&&(n="middle"),t.textVerticalAlign=null==n||md[n]?n:"top";var i=t.textPadding;i&&(t.textPadding=O(t.textPadding))}}function Jn(t,e,n,i,r,a){i.rich?ei(t,e,n,i,r):ti(t,e,n,i,r,a)}function ti(t,e,n,i,r,a){var o=a&&a.style,s=o&&"text"===a.type,l=i.font||pd;s&&l===(o.font||pd)||(e.font=l);var u=t.__computedFont;t.__styleFont!==l&&(t.__styleFont=l,u=t.__computedFont=e.font);var h=i.textPadding,c=t.__textCotentBlock;(!c||t.__dirtyText)&&(c=t.__textCotentBlock=jn(n,u,h,i.truncate));var f=c.outerHeight,d=c.lines,p=c.lineHeight,g=li(f,i,r),v=g.baseX,m=g.baseY,y=g.textAlign||"left",_=g.textVerticalAlign;ii(e,i,r,v,m);var x=Fn(m,f,_),w=v,b=x,S=ai(i);if(S||h){var M=Ln(n,u),T=M;h&&(T+=h[1]+h[3]);var C=zn(v,T,y);S&&oi(t,e,i,C,x,T,f),h&&(w=di(v,y,h),b+=h[0])}e.textAlign=y,e.textBaseline="middle";for(var k=0;kC&&(x=b[C],!x.textAlign||"left"===x.textAlign);)ri(t,e,x,i,M,m,k,"left"),T-=x.width,k+=x.width,C++;for(;D>=0&&(x=b[D],"right"===x.textAlign);)ri(t,e,x,i,M,m,I,"right"),T-=x.width,I-=x.width,D--;for(k+=(a-(k-v)-(y-I)-T)/2;D>=C;)x=b[C],ri(t,e,x,i,M,m,k+x.width/2,"center"),k+=x.width,C++;m+=M}}function ii(t,e,n,i,r){if(n&&e.textRotation){var a=e.textOrigin;"center"===a?(i=n.width/2+n.x,r=n.height/2+n.y):a&&(i=a[0]+n.x,r=a[1]+n.y),t.translate(i,r),t.rotate(-e.textRotation),t.translate(-i,-r)}}function ri(t,e,n,i,r,a,o,s){var l=i.rich[n.styleName]||{};l.text=n.text;var u=n.textVerticalAlign,h=a+r/2;"top"===u?h=a+n.height/2:"bottom"===u&&(h=a+r-n.height/2),!n.isLineHolder&&ai(l)&&oi(t,e,l,"right"===s?o-n.width:"center"===s?o-n.width/2:o,h-n.height/2,n.width,n.height);var c=n.textPadding;c&&(o=di(o,s,c),h-=n.height/2-c[2]-n.textHeight/2),ui(e,"shadowBlur",A(l.textShadowBlur,i.textShadowBlur,0)),ui(e,"shadowColor",l.textShadowColor||i.textShadowColor||"transparent"),ui(e,"shadowOffsetX",A(l.textShadowOffsetX,i.textShadowOffsetX,0)),ui(e,"shadowOffsetY",A(l.textShadowOffsetY,i.textShadowOffsetY,0)),ui(e,"textAlign",s),ui(e,"textBaseline","middle"),ui(e,"font",n.font||pd);var f=hi(l.textStroke||i.textStroke,p),d=ci(l.textFill||i.textFill),p=D(l.textStrokeWidth,i.textStrokeWidth);f&&(ui(e,"lineWidth",p),ui(e,"strokeStyle",f),e.strokeText(n.text,o,h)),d&&(ui(e,"fillStyle",d),e.fillText(n.text,o,h))}function ai(t){return t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor}function oi(t,e,n,i,r,a,o){var s=n.textBackgroundColor,l=n.textBorderWidth,u=n.textBorderColor,h=b(s);if(ui(e,"shadowBlur",n.textBoxShadowBlur||0),ui(e,"shadowColor",n.textBoxShadowColor||"transparent"),ui(e,"shadowOffsetX",n.textBoxShadowOffsetX||0),ui(e,"shadowOffsetY",n.textBoxShadowOffsetY||0),h||l&&u){e.beginPath();var c=n.textBorderRadius;c?$n(e,{x:i,y:r,width:a,height:o,r:c}):e.rect(i,r,a,o),e.closePath()}if(h)if(ui(e,"fillStyle",s),null!=n.fillOpacity){var f=e.globalAlpha;e.globalAlpha=n.fillOpacity*n.opacity,e.fill(),e.globalAlpha=f}else e.fill();else if(w(s))ui(e,"fillStyle",s(n)),e.fill();else if(S(s)){var d=s.image;d=An(d,null,t,si,s),d&&On(d)&&e.drawImage(d,i,r,a,o)}if(l&&u)if(ui(e,"lineWidth",l),ui(e,"strokeStyle",u),null!=n.strokeOpacity){var f=e.globalAlpha;e.globalAlpha=n.strokeOpacity*n.opacity,e.stroke(),e.globalAlpha=f}else e.stroke()}function si(t,e){e.image=t}function li(t,e,n){var i=e.x||0,r=e.y||0,a=e.textAlign,o=e.textVerticalAlign;if(n){var s=e.textPosition;if(s instanceof Array)i=n.x+fi(s[0],n.width),r=n.y+fi(s[1],n.height);else{var l=Nn(s,n,e.textDistance);i=l.x,r=l.y,a=a||l.textAlign,o=o||l.textVerticalAlign}var u=e.textOffset;u&&(i+=u[0],r+=u[1])}return{baseX:i,baseY:r,textAlign:a,textVerticalAlign:o}}function ui(t,e,n){return t[e]=td(t,e,n),t[e]}function hi(t,e){return null==t||0>=e||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function ci(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function fi(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function di(t,e,n){return"right"===e?t-n[1]:"center"===e?t+n[3]/2-n[1]/2:t+n[3]}function pi(t,e){return null!=t&&(t||e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor||e.textPadding)}function gi(t){t=t||{},Xf.call(this,t);for(var e in t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new nd(t.style,this),this._rect=null,this.__clipPaths=[]}function vi(t){gi.call(this,t)}function mi(t){return parseInt(t,10) +}function yi(t){return t?t.__builtin__?!0:"function"!=typeof t.resize||"function"!=typeof t.refresh?!1:!0:!1}function _i(t,e,n){return Td.copy(t.getBoundingRect()),t.transform&&Td.applyTransform(t.transform),Cd.width=e,Cd.height=n,!Td.intersect(Cd)}function xi(t,e){if(t==e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var n=0;ni;i++){var a=n[i];!t.emphasis[e].hasOwnProperty(a)&&t[e].hasOwnProperty(a)&&(t.emphasis[e][a]=t[e][a])}}}function Fi(t){return!Xd(t)||jd(t)||t instanceof Date?t:t.value}function Ni(t){return Xd(t)&&!(t instanceof Array)}function Vi(t,e){e=(e||[]).slice();var n=p(t||[],function(t){return{exist:t}});return qd(e,function(t,i){if(Xd(t)){for(var r=0;r=n.length&&n.push({option:t})}}),n}function Wi(t){var e=F();qd(t,function(t){var n=t.exist;n&&e.set(n.id,t)}),qd(t,function(t){var n=t.option;L(!n||null==n.id||!e.get(n.id)||e.get(n.id)===t,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&e.set(n.id,t),!t.keyInfo&&(t.keyInfo={})}),qd(t,function(t,n){var i=t.exist,r=t.option,a=t.keyInfo;if(Xd(r)){if(a.name=null!=r.name?r.name+"":i?i.name:Ud+n,i)a.id=i.id;else if(null!=r.id)a.id=r.id+"";else{var o=0;do a.id="\x00"+a.name+"\x00"+o++;while(e.get(a.id))}e.set(a.id,t)}})}function Hi(t){var e=t.name;return!(!e||!e.indexOf(Ud))}function Gi(t){return Xd(t)&&t.id&&0===(t.id+"").indexOf("\x00_ec_\x00")}function qi(t,e){return null!=e.dataIndexInside?e.dataIndexInside:null!=e.dataIndex?x(e.dataIndex)?p(e.dataIndex,function(e){return t.indexOfRawIndex(e)}):t.indexOfRawIndex(e.dataIndex):null!=e.name?x(e.name)?p(e.name,function(e){return t.indexOfName(e)}):t.indexOfName(e.name):void 0}function Xi(){var t="__\x00ec_inner_"+Zd++ +"_"+Math.random().toFixed(5);return function(e){return e[t]||(e[t]={})}}function ji(t,e,n){if(b(e)){var i={};i[e+"Index"]=0,e=i}var r=n&&n.defaultMainType;!r||Ui(e,r+"Index")||Ui(e,r+"Id")||Ui(e,r+"Name")||(e[r+"Index"]=0);var a={};return qd(e,function(i,r){var i=e[r];if("dataIndex"===r||"dataIndexInside"===r)return void(a[r]=i);var o=r.match(/^(\w+)(Index|Id|Name)$/)||[],s=o[1],l=(o[2]||"").toLowerCase();if(!(!s||!l||null==i||"index"===l&&"none"===i||n&&n.includeMainTypes&&u(n.includeMainTypes,s)<0)){var h={mainType:s};("index"!==l||"all"!==i)&&(h[l]=i);var c=t.queryComponents(h);a[s+"Models"]=c,a[s+"Model"]=c[0]}}),a}function Ui(t,e){return t&&t.hasOwnProperty(e)}function Yi(t,e,n){t.setAttribute?t.setAttribute(e,n):t[e]=n}function Zi(t,e){return t.getAttribute?t.getAttribute(e):t[e]}function $i(t){return"auto"===t?Vc.domSupported?"html":"richText":t||"html"}function Qi(t){var e={main:"",sub:""};return t&&(t=t.split($d),e.main=t[0]||"",e.sub=t[1]||""),e}function Ki(t){L(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function Ji(t){t.$constructor=t,t.extend=function(t){var e=this,n=function(){t.$constructor?t.$constructor.apply(this,arguments):e.apply(this,arguments)};return o(n.prototype,t),n.extend=this.extend,n.superCall=er,n.superApply=nr,h(n,this),n.superClass=e,n}}function tr(t){var e=["__\x00is_clz",Kd++,Math.random().toFixed(3)].join("_");t.prototype[e]=!0,t.isInstance=function(t){return!(!t||!t[e])}}function er(t,e){var n=P(arguments,2);return this.superClass.prototype[e].apply(t,n)}function nr(t,e,n){return this.superClass.prototype[e].apply(t,n)}function ir(t,e){function n(t){var e=i[t.main];return e&&e[Qd]||(e=i[t.main]={},e[Qd]=!0),e}e=e||{};var i={};if(t.registerClass=function(t,e){if(e)if(Ki(e),e=Qi(e),e.sub){if(e.sub!==Qd){var r=n(e);r[e.sub]=t}}else i[e.main]=t;return t},t.getClass=function(t,e,n){var r=i[t];if(r&&r[Qd]&&(r=e?r[e]:null),n&&!r)throw new Error(e?"Component "+t+"."+(e||"")+" not exists. Load it first.":t+".type should be specified.");return r},t.getClassesByMainType=function(t){t=Qi(t);var e=[],n=i[t.main];return n&&n[Qd]?d(n,function(t,n){n!==Qd&&e.push(t)}):e.push(n),e},t.hasClass=function(t){return t=Qi(t),!!i[t.main]},t.getAllClassMainTypes=function(){var t=[];return d(i,function(e,n){t.push(n)}),t},t.hasSubTypes=function(t){t=Qi(t);var e=i[t.main];return e&&e[Qd]},t.parseClassType=Qi,e.registerWhenExtend){var r=t.extend;r&&(t.extend=function(e){var n=r.call(this,e);return t.registerClass(n,e.type)})}return t}function rr(t){return t>-op&&op>t}function ar(t){return t>op||-op>t}function or(t,e,n,i,r){var a=1-r;return a*a*(a*t+3*r*e)+r*r*(r*i+3*a*n)}function sr(t,e,n,i,r){var a=1-r;return 3*(((e-t)*a+2*(n-e)*r)*a+(i-n)*r*r)}function lr(t,e,n,i,r,a){var o=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-r,h=s*s-3*o*l,c=s*l-9*o*u,f=l*l-3*s*u,d=0;if(rr(h)&&rr(c))if(rr(s))a[0]=0;else{var p=-l/s;p>=0&&1>=p&&(a[d++]=p)}else{var g=c*c-4*h*f;if(rr(g)){var v=c/h,p=-s/o+v,m=-v/2;p>=0&&1>=p&&(a[d++]=p),m>=0&&1>=m&&(a[d++]=m)}else if(g>0){var y=ap(g),_=h*s+1.5*o*(-c+y),x=h*s+1.5*o*(-c-y);_=0>_?-rp(-_,up):rp(_,up),x=0>x?-rp(-x,up):rp(x,up);var p=(-s-(_+x))/(3*o);p>=0&&1>=p&&(a[d++]=p)}else{var w=(2*h*s-3*o*c)/(2*ap(h*h*h)),b=Math.acos(w)/3,S=ap(h),M=Math.cos(b),p=(-s-2*S*M)/(3*o),m=(-s+S*(M+lp*Math.sin(b)))/(3*o),T=(-s+S*(M-lp*Math.sin(b)))/(3*o);p>=0&&1>=p&&(a[d++]=p),m>=0&&1>=m&&(a[d++]=m),T>=0&&1>=T&&(a[d++]=T)}}return d}function ur(t,e,n,i,r){var a=6*n-12*e+6*t,o=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(rr(o)){if(ar(a)){var u=-s/a;u>=0&&1>=u&&(r[l++]=u)}}else{var h=a*a-4*o*s;if(rr(h))r[0]=-a/(2*o);else if(h>0){var c=ap(h),u=(-a+c)/(2*o),f=(-a-c)/(2*o);u>=0&&1>=u&&(r[l++]=u),f>=0&&1>=f&&(r[l++]=f)}}return l}function hr(t,e,n,i,r,a){var o=(e-t)*r+t,s=(n-e)*r+e,l=(i-n)*r+n,u=(s-o)*r+o,h=(l-s)*r+s,c=(h-u)*r+u;a[0]=t,a[1]=o,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=i}function cr(t,e,n,i,r,a,o,s,l,u,h){var c,f,d,p,g,v=.005,m=1/0;hp[0]=l,hp[1]=u;for(var y=0;1>y;y+=.05)cp[0]=or(t,n,r,o,y),cp[1]=or(e,i,a,s,y),p=of(hp,cp),m>p&&(c=y,m=p);m=1/0;for(var _=0;32>_&&!(sp>v);_++)f=c-v,d=c+v,cp[0]=or(t,n,r,o,f),cp[1]=or(e,i,a,s,f),p=of(cp,hp),f>=0&&m>p?(c=f,m=p):(fp[0]=or(t,n,r,o,d),fp[1]=or(e,i,a,s,d),g=of(fp,hp),1>=d&&m>g?(c=d,m=g):v*=.5);return h&&(h[0]=or(t,n,r,o,c),h[1]=or(e,i,a,s,c)),ap(m)}function fr(t,e,n,i){var r=1-i;return r*(r*t+2*i*e)+i*i*n}function dr(t,e,n,i){return 2*((1-i)*(e-t)+i*(n-e))}function pr(t,e,n,i,r){var a=t-2*e+n,o=2*(e-t),s=t-i,l=0;if(rr(a)){if(ar(o)){var u=-s/o;u>=0&&1>=u&&(r[l++]=u)}}else{var h=o*o-4*a*s;if(rr(h)){var u=-o/(2*a);u>=0&&1>=u&&(r[l++]=u)}else if(h>0){var c=ap(h),u=(-o+c)/(2*a),f=(-o-c)/(2*a);u>=0&&1>=u&&(r[l++]=u),f>=0&&1>=f&&(r[l++]=f)}}return l}function gr(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function vr(t,e,n,i,r){var a=(e-t)*i+t,o=(n-e)*i+e,s=(o-a)*i+a;r[0]=t,r[1]=a,r[2]=s,r[3]=s,r[4]=o,r[5]=n}function mr(t,e,n,i,r,a,o,s,l){var u,h=.005,c=1/0;hp[0]=o,hp[1]=s;for(var f=0;1>f;f+=.05){cp[0]=fr(t,n,r,f),cp[1]=fr(e,i,a,f);var d=of(hp,cp);c>d&&(u=f,c=d)}c=1/0;for(var p=0;32>p&&!(sp>h);p++){var g=u-h,v=u+h;cp[0]=fr(t,n,r,g),cp[1]=fr(e,i,a,g);var d=of(cp,hp);if(g>=0&&c>d)u=g,c=d;else{fp[0]=fr(t,n,r,v),fp[1]=fr(e,i,a,v);var m=of(fp,hp);1>=v&&c>m?(u=v,c=m):h*=.5}}return l&&(l[0]=fr(t,n,r,u),l[1]=fr(e,i,a,u)),ap(c)}function yr(t,e,n){if(0!==t.length){var i,r=t[0],a=r[0],o=r[0],s=r[1],l=r[1];for(i=1;ih;h++){var p=f(t,n,r,o,wp[h]);l[0]=dp(p,l[0]),u[0]=pp(p,u[0])}for(d=c(e,i,a,s,bp),h=0;d>h;h++){var g=f(e,i,a,s,bp[h]);l[1]=dp(g,l[1]),u[1]=pp(g,u[1])}l[0]=dp(t,l[0]),u[0]=pp(t,u[0]),l[0]=dp(o,l[0]),u[0]=pp(o,u[0]),l[1]=dp(e,l[1]),u[1]=pp(e,u[1]),l[1]=dp(s,l[1]),u[1]=pp(s,u[1])}function wr(t,e,n,i,r,a,o,s){var l=gr,u=fr,h=pp(dp(l(t,n,r),1),0),c=pp(dp(l(e,i,a),1),0),f=u(t,n,r,h),d=u(e,i,a,c);o[0]=dp(t,r,f),o[1]=dp(e,a,d),s[0]=pp(t,r,f),s[1]=pp(e,a,d)}function br(t,e,n,i,r,a,o,s,l){var u=oe,h=se,c=Math.abs(r-a);if(1e-4>c%mp&&c>1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(yp[0]=vp(r)*n+t,yp[1]=gp(r)*i+e,_p[0]=vp(a)*n+t,_p[1]=gp(a)*i+e,u(s,yp,_p),h(l,yp,_p),r%=mp,0>r&&(r+=mp),a%=mp,0>a&&(a+=mp),r>a&&!o?a+=mp:a>r&&o&&(r+=mp),o){var f=a;a=r,r=f}for(var d=0;a>d;d+=Math.PI/2)d>r&&(xp[0]=vp(d)*n+t,xp[1]=gp(d)*i+e,u(s,xp,s),h(l,xp,l))}function Sr(t,e,n,i,r,a,o){if(0===r)return!1;var s=r,l=0,u=t;if(o>e+s&&o>i+s||e-s>o&&i-s>o||a>t+s&&a>n+s||t-s>a&&n-s>a)return!1;if(t===n)return Math.abs(a-t)<=s/2;l=(e-i)/(t-n),u=(t*i-n*e)/(t-n);var h=l*a-o+u,c=h*h/(l*l+1);return s/2*s/2>=c}function Mr(t,e,n,i,r,a,o,s,l,u,h){if(0===l)return!1;var c=l;if(h>e+c&&h>i+c&&h>a+c&&h>s+c||e-c>h&&i-c>h&&a-c>h&&s-c>h||u>t+c&&u>n+c&&u>r+c&&u>o+c||t-c>u&&n-c>u&&r-c>u&&o-c>u)return!1;var f=cr(t,e,n,i,r,a,o,s,u,h,null);return c/2>=f}function Tr(t,e,n,i,r,a,o,s,l){if(0===o)return!1;var u=o;if(l>e+u&&l>i+u&&l>a+u||e-u>l&&i-u>l&&a-u>l||s>t+u&&s>n+u&&s>r+u||t-u>s&&n-u>s&&r-u>s)return!1;var h=mr(t,e,n,i,r,a,s,l,null);return u/2>=h}function Cr(t){return t%=Bp,0>t&&(t+=Bp),t}function kr(t,e,n,i,r,a,o,s,l){if(0===o)return!1;var u=o;s-=t,l-=e;var h=Math.sqrt(s*s+l*l);if(h-u>n||n>h+u)return!1;if(Math.abs(i-r)%zp<1e-4)return!0;if(a){var c=i;i=Cr(r),r=Cr(c)}else i=Cr(i),r=Cr(r);i>r&&(r+=zp);var f=Math.atan2(l,s);return 0>f&&(f+=zp),f>=i&&r>=f||f+zp>=i&&r>=f+zp}function Ir(t,e,n,i,r,a){if(a>e&&a>i||e>a&&i>a)return 0;if(i===e)return 0;var o=e>i?1:-1,s=(a-e)/(i-e);(1===s||0===s)&&(o=e>i?.5:-.5);var l=s*(n-t)+t;return l===r?1/0:l>r?o:0}function Dr(t,e){return Math.abs(t-e)e&&u>i&&u>a&&u>s||e>u&&i>u&&a>u&&s>u)return 0;var h=lr(e,i,a,s,u,Wp);if(0===h)return 0;for(var c,f,d=0,p=-1,g=0;h>g;g++){var v=Wp[g],m=0===v||1===v?.5:1,y=or(t,n,r,o,v);l>y||(0>p&&(p=ur(e,i,a,s,Hp),Hp[1]1&&Ar(),c=or(e,i,a,s,Hp[0]),p>1&&(f=or(e,i,a,s,Hp[1]))),d+=2==p?vc?m:-m:vf?m:-m:f>s?m:-m:vc?m:-m:c>s?m:-m)}return d}function Or(t,e,n,i,r,a,o,s){if(s>e&&s>i&&s>a||e>s&&i>s&&a>s)return 0;var l=pr(e,i,a,s,Wp);if(0===l)return 0;var u=gr(e,i,a);if(u>=0&&1>=u){for(var h=0,c=fr(e,i,a,u),f=0;l>f;f++){var d=0===Wp[f]||1===Wp[f]?.5:1,p=fr(t,n,r,Wp[f]);o>p||(h+=Wp[f]c?d:-d:c>a?d:-d)}return h}var d=0===Wp[0]||1===Wp[0]?.5:1,p=fr(t,n,r,Wp[0]);return o>p?0:e>a?d:-d}function Lr(t,e,n,i,r,a,o,s){if(s-=e,s>n||-n>s)return 0;var l=Math.sqrt(n*n-s*s);Wp[0]=-l,Wp[1]=l;var u=Math.abs(i-r);if(1e-4>u)return 0;if(1e-4>u%Np){i=0,r=Np;var h=a?1:-1;return o>=Wp[0]+t&&o<=Wp[1]+t?h:0}if(a){var l=i;i=Cr(r),r=Cr(l)}else i=Cr(i),r=Cr(r);i>r&&(r+=Np);for(var c=0,f=0;2>f;f++){var d=Wp[f];if(d+t>o){var p=Math.atan2(s,d),h=a?1:-1;0>p&&(p=Np+p),(p>=i&&r>=p||p+Np>=i&&r>=p+Np)&&(p>Math.PI/2&&p<1.5*Math.PI&&(h=-h),c+=h)}}return c}function Er(t,e,n,i,r){for(var a=0,o=0,s=0,l=0,u=0,h=0;h1&&(n||(a+=Ir(o,s,l,u,i,r))),1==h&&(o=t[h],s=t[h+1],l=o,u=s),c){case Fp.M:l=t[h++],u=t[h++],o=l,s=u;break;case Fp.L:if(n){if(Sr(o,s,t[h],t[h+1],e,i,r))return!0}else a+=Ir(o,s,t[h],t[h+1],i,r)||0;o=t[h++],s=t[h++];break;case Fp.C:if(n){if(Mr(o,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],e,i,r))return!0}else a+=Pr(o,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],i,r)||0;o=t[h++],s=t[h++];break;case Fp.Q:if(n){if(Tr(o,s,t[h++],t[h++],t[h],t[h+1],e,i,r))return!0}else a+=Or(o,s,t[h++],t[h++],t[h],t[h+1],i,r)||0;o=t[h++],s=t[h++];break;case Fp.A:var f=t[h++],d=t[h++],p=t[h++],g=t[h++],v=t[h++],m=t[h++],y=(t[h++],1-t[h++]),_=Math.cos(v)*p+f,x=Math.sin(v)*g+d;h>1?a+=Ir(o,s,_,x,i,r):(l=_,u=x);var w=(i-f)*g/p+f;if(n){if(kr(f,d,g,v,v+m,y,e,w,r))return!0}else a+=Lr(f,d,g,v,v+m,y,w,r);o=Math.cos(v+m)*p+f,s=Math.sin(v+m)*g+d;break;case Fp.R:l=o=t[h++],u=s=t[h++];var b=t[h++],S=t[h++],_=l+b,x=u+S;if(n){if(Sr(l,u,_,u,e,i,r)||Sr(_,u,_,x,e,i,r)||Sr(_,x,l,x,e,i,r)||Sr(l,x,l,u,e,i,r))return!0}else a+=Ir(_,u,_,x,i,r),a+=Ir(l,x,l,u,i,r);break;case Fp.Z:if(n){if(Sr(o,s,l,u,e,i,r))return!0}else a+=Ir(o,s,l,u,i,r);o=l,s=u}}return n||Dr(s,u)||(a+=Ir(o,s,l,u,i,r)||0),0!==a}function Rr(t,e,n){return Er(t,0,!1,e,n)}function Br(t,e,n,i){return Er(t,e,!0,n,i)}function zr(t){gi.call(this,t),this.path=null}function Fr(t,e,n,i,r,a,o,s,l,u,h){var c=l*(tg/180),f=Jp(c)*(t-n)/2+Kp(c)*(e-i)/2,d=-1*Kp(c)*(t-n)/2+Jp(c)*(e-i)/2,p=f*f/(o*o)+d*d/(s*s);p>1&&(o*=Qp(p),s*=Qp(p));var g=(r===a?-1:1)*Qp((o*o*s*s-o*o*d*d-s*s*f*f)/(o*o*d*d+s*s*f*f))||0,v=g*o*d/s,m=g*-s*f/o,y=(t+n)/2+Jp(c)*v-Kp(c)*m,_=(e+i)/2+Kp(c)*v+Jp(c)*m,x=ig([1,0],[(f-v)/o,(d-m)/s]),w=[(f-v)/o,(d-m)/s],b=[(-1*f-v)/o,(-1*d-m)/s],S=ig(w,b);ng(w,b)<=-1&&(S=tg),ng(w,b)>=1&&(S=0),0===a&&S>0&&(S-=2*tg),1===a&&0>S&&(S+=2*tg),h.addData(u,y,_,o,s,x,S,c,a)}function Nr(t){if(!t)return new Rp;for(var e,n=0,i=0,r=n,a=i,o=new Rp,s=Rp.CMD,l=t.match(rg),u=0;ug;g++)d[g]=parseFloat(d[g]);for(var v=0;p>v;){var m,y,_,x,w,b,S,M=n,T=i;switch(f){case"l":n+=d[v++],i+=d[v++],h=s.L,o.addData(h,n,i);break;case"L":n=d[v++],i=d[v++],h=s.L,o.addData(h,n,i);break;case"m":n+=d[v++],i+=d[v++],h=s.M,o.addData(h,n,i),r=n,a=i,f="l";break;case"M":n=d[v++],i=d[v++],h=s.M,o.addData(h,n,i),r=n,a=i,f="L";break;case"h":n+=d[v++],h=s.L,o.addData(h,n,i);break;case"H":n=d[v++],h=s.L,o.addData(h,n,i);break;case"v":i+=d[v++],h=s.L,o.addData(h,n,i);break;case"V":i=d[v++],h=s.L,o.addData(h,n,i);break;case"C":h=s.C,o.addData(h,d[v++],d[v++],d[v++],d[v++],d[v++],d[v++]),n=d[v-2],i=d[v-1];break;case"c":h=s.C,o.addData(h,d[v++]+n,d[v++]+i,d[v++]+n,d[v++]+i,d[v++]+n,d[v++]+i),n+=d[v-2],i+=d[v-1];break;case"S":m=n,y=i;var C=o.len(),k=o.data;e===s.C&&(m+=n-k[C-4],y+=i-k[C-3]),h=s.C,M=d[v++],T=d[v++],n=d[v++],i=d[v++],o.addData(h,m,y,M,T,n,i);break;case"s":m=n,y=i;var C=o.len(),k=o.data;e===s.C&&(m+=n-k[C-4],y+=i-k[C-3]),h=s.C,M=n+d[v++],T=i+d[v++],n+=d[v++],i+=d[v++],o.addData(h,m,y,M,T,n,i);break;case"Q":M=d[v++],T=d[v++],n=d[v++],i=d[v++],h=s.Q,o.addData(h,M,T,n,i);break;case"q":M=d[v++]+n,T=d[v++]+i,n+=d[v++],i+=d[v++],h=s.Q,o.addData(h,M,T,n,i);break;case"T":m=n,y=i;var C=o.len(),k=o.data;e===s.Q&&(m+=n-k[C-4],y+=i-k[C-3]),n=d[v++],i=d[v++],h=s.Q,o.addData(h,m,y,n,i);break;case"t":m=n,y=i;var C=o.len(),k=o.data;e===s.Q&&(m+=n-k[C-4],y+=i-k[C-3]),n+=d[v++],i+=d[v++],h=s.Q,o.addData(h,m,y,n,i);break;case"A":_=d[v++],x=d[v++],w=d[v++],b=d[v++],S=d[v++],M=n,T=i,n=d[v++],i=d[v++],h=s.A,Fr(M,T,n,i,b,S,_,x,w,h,o);break;case"a":_=d[v++],x=d[v++],w=d[v++],b=d[v++],S=d[v++],M=n,T=i,n+=d[v++],i+=d[v++],h=s.A,Fr(M,T,n,i,b,S,_,x,w,h,o)}}("z"===f||"Z"===f)&&(h=s.Z,o.addData(h),n=r,i=a),e=h}return o.toStatic(),o}function Vr(t,e){var n=Nr(t);return e=e||{},e.buildPath=function(t){if(t.setData){t.setData(n.data);var e=t.getContext();e&&t.rebuildPath(e)}else{var e=t;n.rebuildPath(e)}},e.applyTransform=function(t){$p(n,t),this.dirty(!0)},e}function Wr(t,e){return new zr(Vr(t,e))}function Hr(t,e){return zr.extend(Vr(t,e))}function Gr(t,e){for(var n=[],i=t.length,r=0;i>r;r++){var a=t[r];a.path||a.createPathProxy(),a.__dirtyPath&&a.buildPath(a.path,a.shape,!0),n.push(a.path)}var o=new zr(e);return o.createPathProxy(),o.buildPath=function(t){t.appendPath(n);var e=t.getContext();e&&t.rebuildPath(e)},o}function qr(t,e,n,i,r,a,o){var s=.5*(n-t),l=.5*(i-e);return(2*(e-n)+s+l)*o+(-3*(e-n)-2*s-l)*a+s*r+e}function Xr(t,e,n){var i=e.points,r=e.smooth;if(i&&i.length>=2){if(r&&"spline"!==r){var a=dg(i,r,n,e.smoothConstraint);t.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;(n?o:o-1)>s;s++){var l=a[2*s],u=a[2*s+1],h=i[(s+1)%o];t.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{"spline"===r&&(i=fg(i,n)),t.moveTo(i[0][0],i[0][1]);for(var s=1,c=i.length;c>s;s++)t.lineTo(i[s][0],i[s][1])}n&&t.closePath()}}function jr(t,e,n){var i=t.cpx2,r=t.cpy2;return null===i||null===r?[(n?sr:or)(t.x1,t.cpx1,t.cpx2,t.x2,e),(n?sr:or)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(n?dr:fr)(t.x1,t.cpx1,t.x2,e),(n?dr:fr)(t.y1,t.cpy1,t.y2,e)]}function Ur(t){gi.call(this,t),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}function Yr(t){return zr.extend(t)}function Zr(t,e){return Hr(t,e)}function $r(t,e,n,i){var r=Wr(t,e);return n&&("center"===i&&(n=Kr(n,r.getBoundingRect())),Jr(r,n)),r}function Qr(t,e,n){var i=new vi({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(t){if("center"===n){var r={width:t.width,height:t.height};i.setStyle(Kr(e,r))}}});return i}function Kr(t,e){var n,i=e.width/e.height,r=t.height*i;r<=t.width?n=t.height:(r=t.width,n=r/i);var a=t.x+t.width/2,o=t.y+t.height/2;return{x:a-r/2,y:o-n/2,width:r,height:n}}function Jr(t,e){if(t.applyTransform){var n=t.getBoundingRect(),i=n.calculateTransform(e);t.applyTransform(i)}}function ta(t){var e=t.shape,n=t.style.lineWidth;return Cg(2*e.x1)===Cg(2*e.x2)&&(e.x1=e.x2=na(e.x1,n,!0)),Cg(2*e.y1)===Cg(2*e.y2)&&(e.y1=e.y2=na(e.y1,n,!0)),t}function ea(t){var e=t.shape,n=t.style.lineWidth,i=e.x,r=e.y,a=e.width,o=e.height;return e.x=na(e.x,n,!0),e.y=na(e.y,n,!0),e.width=Math.max(na(i+a,n,!1)-e.x,0===a?0:1),e.height=Math.max(na(r+o,n,!1)-e.y,0===o?0:1),t}function na(t,e,n){var i=Cg(2*t);return(i+Cg(e))%2===0?i/2:(i+(n?1:-1))/2}function ia(t){return null!=t&&"none"!==t}function ra(t){if("string"!=typeof t)return t;var e=Pg.get(t);return e||(e=Xe(t,-.1),1e4>Og&&(Pg.set(t,e),Og++)),e}function aa(t){if(t.__hoverStlDirty){t.__hoverStlDirty=!1;var e=t.__hoverStl;if(!e)return void(t.__normalStl=null);var n=t.__normalStl={},i=t.style;for(var r in e)null!=e[r]&&(n[r]=i[r]);n.fill=i.fill,n.stroke=i.stroke}}function oa(t){var e=t.__hoverStl;if(e&&!t.__highlighted){var n=t.useHoverLayer;t.__highlighted=n?"layer":"plain";var i=t.__zr;if(i||!n){var r=t,a=t.style;n&&(r=i.addHover(t),a=r.style),ka(a),n||aa(r),a.extendFrom(e),sa(a,e,"fill"),sa(a,e,"stroke"),Ca(a),n||(t.dirty(!1),t.z2+=1)}}}function sa(t,e,n){!ia(e[n])&&ia(t[n])&&(t[n]=ra(t[n]))}function la(t){t.__highlighted&&(ua(t),t.__highlighted=!1)}function ua(t){var e=t.__highlighted;if("layer"===e)t.__zr&&t.__zr.removeHover(t);else if(e){var n=t.style,i=t.__normalStl;i&&(ka(n),t.setStyle(i),Ca(n),t.z2-=1)}}function ha(t,e){t.isGroup?t.traverse(function(t){!t.isGroup&&e(t)}):e(t)}function ca(t,e){e=t.__hoverStl=e!==!1&&(e||{}),t.__hoverStlDirty=!0,t.__highlighted&&(la(t),oa(t))}function fa(t){return t&&t.__isEmphasisEntered}function da(t){this.__hoverSilentOnTouch&&t.zrByTouch||!this.__isEmphasisEntered&&ha(this,oa)}function pa(t){this.__hoverSilentOnTouch&&t.zrByTouch||!this.__isEmphasisEntered&&ha(this,la)}function ga(){this.__isEmphasisEntered=!0,ha(this,oa)}function va(){this.__isEmphasisEntered=!1,ha(this,la)}function ma(t,e,n){t.isGroup?t.traverse(function(t){!t.isGroup&&ca(t,t.hoverStyle||e)}):ca(t,t.hoverStyle||e),ya(t,n)}function ya(t,e){var n=e===!1;if(t.__hoverSilentOnTouch=null!=e&&e.hoverSilentOnTouch,!n||t.__hoverStyleTrigger){var i=n?"off":"on";t[i]("mouseover",da)[i]("mouseout",pa),t[i]("emphasis",ga)[i]("normal",va),t.__hoverStyleTrigger=!n}}function _a(t,e,n,i,r,a,o){r=r||Dg;var s,l=r.labelFetcher,u=r.labelDataIndex,h=r.labelDimIndex,c=n.getShallow("show"),f=i.getShallow("show");(c||f)&&(l&&(s=l.getFormattedLabel(u,"normal",null,h)),null==s&&(s=w(r.defaultText)?r.defaultText(u,r):r.defaultText));var d=c?s:null,p=f?D(l?l.getFormattedLabel(u,"emphasis",null,h):null,s):null;(null!=d||null!=p)&&(xa(t,n,a,r),xa(e,i,o,r,!0)),t.text=d,e.text=p}function xa(t,e,n,i,r){return ba(t,e,i,r),n&&o(t,n),t}function wa(t,e,n){var i,r={isRectText:!0};n===!1?i=!0:r.autoColor=n,ba(t,e,r,i)}function ba(t,e,n,i){if(n=n||Dg,n.isRectText){var r=e.getShallow("position")||(i?null:"inside");"outside"===r&&(r="top"),t.textPosition=r,t.textOffset=e.getShallow("offset");var a=e.getShallow("rotate");null!=a&&(a*=Math.PI/180),t.textRotation=a,t.textDistance=D(e.getShallow("distance"),i?null:5)}var o,s=e.ecModel,l=s&&s.option.textStyle,u=Sa(e);if(u){o={};for(var h in u)if(u.hasOwnProperty(h)){var c=e.getModel(["rich",h]);Ma(o[h]={},c,l,n,i)}}return t.rich=o,Ma(t,e,l,n,i,!0),n.forceRich&&!n.textStyle&&(n.textStyle={}),t}function Sa(t){for(var e;t&&t!==t.ecModel;){var n=(t.option||Dg).rich;if(n){e=e||{};for(var i in n)n.hasOwnProperty(i)&&(e[i]=1)}t=t.parentModel}return e}function Ma(t,e,n,i,r,a){n=!r&&n||Dg,t.textFill=Ta(e.getShallow("color"),i)||n.color,t.textStroke=Ta(e.getShallow("textBorderColor"),i)||n.textBorderColor,t.textStrokeWidth=D(e.getShallow("textBorderWidth"),n.textBorderWidth),t.insideRawTextPosition=t.textPosition,r||(a&&(t.insideRollbackOpt=i,Ca(t)),null==t.textFill&&(t.textFill=i.autoColor)),t.fontStyle=e.getShallow("fontStyle")||n.fontStyle,t.fontWeight=e.getShallow("fontWeight")||n.fontWeight,t.fontSize=e.getShallow("fontSize")||n.fontSize,t.fontFamily=e.getShallow("fontFamily")||n.fontFamily,t.textAlign=e.getShallow("align"),t.textVerticalAlign=e.getShallow("verticalAlign")||e.getShallow("baseline"),t.textLineHeight=e.getShallow("lineHeight"),t.textWidth=e.getShallow("width"),t.textHeight=e.getShallow("height"),t.textTag=e.getShallow("tag"),a&&i.disableBox||(t.textBackgroundColor=Ta(e.getShallow("backgroundColor"),i),t.textPadding=e.getShallow("padding"),t.textBorderColor=Ta(e.getShallow("borderColor"),i),t.textBorderWidth=e.getShallow("borderWidth"),t.textBorderRadius=e.getShallow("borderRadius"),t.textBoxShadowColor=e.getShallow("shadowColor"),t.textBoxShadowBlur=e.getShallow("shadowBlur"),t.textBoxShadowOffsetX=e.getShallow("shadowOffsetX"),t.textBoxShadowOffsetY=e.getShallow("shadowOffsetY")),t.textShadowColor=e.getShallow("textShadowColor")||n.textShadowColor,t.textShadowBlur=e.getShallow("textShadowBlur")||n.textShadowBlur,t.textShadowOffsetX=e.getShallow("textShadowOffsetX")||n.textShadowOffsetX,t.textShadowOffsetY=e.getShallow("textShadowOffsetY")||n.textShadowOffsetY}function Ta(t,e){return"auto"!==t?t:e&&e.autoColor?e.autoColor:null}function Ca(t){var e=t.insideRollbackOpt;if(e&&null==t.textFill){var n,i=e.useInsideStyle,r=t.insideRawTextPosition,a=e.autoColor;i!==!1&&(i===!0||e.isRectText&&r&&"string"==typeof r&&r.indexOf("inside")>=0)?(n={textFill:null,textStroke:t.textStroke,textStrokeWidth:t.textStrokeWidth},t.textFill="#fff",null==t.textStroke&&(t.textStroke=a,null==t.textStrokeWidth&&(t.textStrokeWidth=2))):null!=a&&(n={textFill:null},t.textFill=a),n&&(t.insideRollback=n)}}function ka(t){var e=t.insideRollback;e&&(t.textFill=e.textFill,t.textStroke=e.textStroke,t.textStrokeWidth=e.textStrokeWidth,t.insideRollback=null)}function Ia(t,e){var n=e||e.getModel("textStyle");return E([t.fontStyle||n&&n.getShallow("fontStyle")||"",t.fontWeight||n&&n.getShallow("fontWeight")||"",(t.fontSize||n&&n.getShallow("fontSize")||12)+"px",t.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}function Da(t,e,n,i,r,a){"function"==typeof r&&(a=r,r=null);var o=i&&i.isAnimationEnabled();if(o){var s=t?"Update":"",l=i.getShallow("animationDuration"+s),u=i.getShallow("animationEasing"+s),h=i.getShallow("animationDelay"+s);"function"==typeof h&&(h=h(r,i.getAnimationDelayParams?i.getAnimationDelayParams(e,r):null)),"function"==typeof l&&(l=l(r)),l>0?e.animateTo(n,l,h||0,u,a,!!a):(e.stopAnimation(),e.attr(n),a&&a())}else e.stopAnimation(),e.attr(n),a&&a()}function Aa(t,e,n,i,r){Da(!0,t,e,n,i,r)}function Pa(t,e,n,i,r){Da(!1,t,e,n,i,r)}function Oa(t,e){for(var n=be([]);t&&t!==e;)Me(n,t.getLocalTransform(),n),t=t.parent;return n}function La(t,e,n){return e&&!f(e)&&(e=xf.getLocalTransform(e)),n&&(e=Ie([],e)),ae([],t,e)}function Ea(t,e,n){var i=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),r=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),a=["left"===t?-i:"right"===t?i:0,"top"===t?-r:"bottom"===t?r:0];return a=La(a,e,n),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Ra(t,e,n){function i(t){var e={};return t.traverse(function(t){!t.isGroup&&t.anid&&(e[t.anid]=t)}),e}function r(t){var e={position:G(t.position),rotation:t.rotation};return t.shape&&(e.shape=o({},t.shape)),e}if(t&&e){var a=i(t);e.traverse(function(t){if(!t.isGroup&&t.anid){var e=a[t.anid];if(e){var i=r(t);t.attr(r(e)),Aa(t,i,n,t.dataIndex)}}})}}function Ba(t,e){return p(t,function(t){var n=t[0];n=kg(n,e.x),n=Ig(n,e.x+e.width);var i=t[1];return i=kg(i,e.y),i=Ig(i,e.y+e.height),[n,i]})}function za(t,e){var n=kg(t.x,e.x),i=Ig(t.x+t.width,e.x+e.width),r=kg(t.y,e.y),a=Ig(t.y+t.height,e.y+e.height);return i>=n&&a>=r?{x:n,y:r,width:i-n,height:a-r}:void 0}function Fa(t,e,n){e=o({rectHover:!0},e);var i=e.style={strokeNoScale:!0};return n=n||{x:-1,y:-1,width:2,height:2},t?0===t.indexOf("image://")?(i.image=t.slice(8),s(i,n),new vi(e)):$r(t.replace("path://",""),e,n,"center"):void 0}function Na(t,e,n){this.parentModel=e,this.ecModel=n,this.option=t}function Va(t,e,n){for(var i=0;i=0&&n.push(t)}),n}t.topologicalTravel=function(t,e,i,r){function a(t){l[t].entryCount--,0===l[t].entryCount&&u.push(t)}function o(t){h[t]=!0,a(t)}if(t.length){var s=n(e),l=s.graph,u=s.noEntryList,h={};for(d(t,function(t){h[t]=!0});u.length;){var c=u.pop(),f=l[c],p=!!h[c];p&&(i.call(r,c,f.originalDeps.slice()),delete h[c]),d(f.successor,p?o:a)}d(h,function(){throw new Error("Circle dependency may exists")})}}}function Xa(t){return t.replace(/^\s+/,"").replace(/\s+$/,"")}function ja(t,e,n,i){var r=e[1]-e[0],a=n[1]-n[0];if(0===r)return 0===a?n[0]:(n[0]+n[1])/2;if(i)if(r>0){if(t<=e[0])return n[0];if(t>=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/r*a+n[0]}function Ua(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?Xa(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?0/0:+t}function Ya(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function Za(t){return t.sort(function(t,e){return t-e}),t}function $a(t){if(t=+t,isNaN(t))return 0;for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Qa(t){var e=t.toString(),n=e.indexOf("e");if(n>0){var i=+e.slice(n+1);return 0>i?-i:0}var r=e.indexOf(".");return 0>r?0:e.length-1-r}function Ka(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),a=Math.round(n(Math.abs(e[1]-e[0]))/i),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20}function Ja(t,e,n){if(!t[e])return 0;var i=g(t,function(t,e){return t+(isNaN(e)?0:e)},0);if(0===i)return 0;for(var r=Math.pow(10,n),a=p(t,function(t){return(isNaN(t)?0:t)/i*r*100}),o=100*r,s=p(a,function(t){return Math.floor(t)}),l=g(s,function(t,e){return t+e},0),u=p(a,function(t,e){return t-s[e]});o>l;){for(var h=Number.NEGATIVE_INFINITY,c=null,f=0,d=u.length;d>f;++f)u[f]>h&&(h=u[f],c=f);++s[c],u[c]=0,++l}return s[e]/r}function to(t){var e=2*Math.PI;return(t%e+e)%e}function eo(t){return t>-Wg&&Wg>t}function no(t){if(t instanceof Date)return t;if("string"==typeof t){var e=Gg.exec(t);if(!e)return new Date(0/0);if(e[8]){var n=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(n-=e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,n,+(e[5]||0),+e[6]||0,+e[7]||0))}return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,+e[7]||0)}return new Date(null==t?0/0:Math.round(t))}function io(t){return Math.pow(10,ro(t))}function ro(t){return Math.floor(Math.log(t)/Math.LN10)}function ao(t,e){var n,i=ro(t),r=Math.pow(10,i),a=t/r;return n=e?1.5>a?1:2.5>a?2:4>a?3:7>a?5:10:1>a?1:2>a?2:3>a?3:5>a?5:10,t=n*r,i>=-20?+t.toFixed(0>i?-i:0):t}function oo(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],a=n-i;return a?r+a*(t[i]-r):r}function so(t){function e(t,n,i){return t.interval[i]s;s++)a[s]<=n&&(a[s]=n,o[s]=s?1:1-i),n=a[s],i=o[s];a[0]===a[1]&&o[0]*o[1]!==1?t.splice(r,1):r++}return t}function lo(t){return t-parseFloat(t)>=0}function uo(t){return isNaN(t)?"-":(t=(t+"").split("."),t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:""))}function ho(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}function co(t){return null==t?"":(t+"").replace(jg,function(t,e){return Ug[e]})}function fo(t,e,n){x(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],a=0;as;s++)for(var l=0;l':'':{renderMode:r,content:"{marker"+a+"|} ",style:{color:n}}:"" +}function vo(t,e){return t+="","0000".substr(0,e-t.length)+t}function mo(t,e,n){("week"===t||"month"===t||"quarter"===t||"half-year"===t||"year"===t)&&(t="MM-dd\nyyyy");var i=no(e),r=n?"UTC":"",a=i["get"+r+"FullYear"](),o=i["get"+r+"Month"]()+1,s=i["get"+r+"Date"](),l=i["get"+r+"Hours"](),u=i["get"+r+"Minutes"](),h=i["get"+r+"Seconds"](),c=i["get"+r+"Milliseconds"]();return t=t.replace("MM",vo(o,2)).replace("M",o).replace("yyyy",a).replace("yy",a%100).replace("dd",vo(s,2)).replace("d",s).replace("hh",vo(l,2)).replace("h",l).replace("mm",vo(u,2)).replace("m",u).replace("ss",vo(h,2)).replace("s",h).replace("SSS",vo(c,3))}function yo(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}function _o(t,e,n,i,r){var a=0,o=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;e.eachChild(function(l,u){var h,c,f=l.position,d=l.getBoundingRect(),p=e.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===t){var v=d.width+(g?-g.x+d.x:0);h=a+v,h>i||l.newline?(a=0,h=v,o+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(g?-g.y+d.y:0);c=o+m,c>r||l.newline?(a+=s+n,o=0,c=m,s=d.width):s=Math.max(s,d.width)}l.newline||(f[0]=a,f[1]=o,"horizontal"===t?a=h+n:o=c+n)})}function xo(t,e,n){n=Xg(n||0);var i=e.width,r=e.height,a=Ua(t.left,i),o=Ua(t.top,r),s=Ua(t.right,i),l=Ua(t.bottom,r),u=Ua(t.width,i),h=Ua(t.height,r),c=n[2]+n[0],f=n[1]+n[3],d=t.aspect;switch(isNaN(u)&&(u=i-s-f-a),isNaN(h)&&(h=r-l-c-o),null!=d&&(isNaN(u)&&isNaN(h)&&(d>i/r?u=.8*i:h=.8*r),isNaN(u)&&(u=d*h),isNaN(h)&&(h=u/d)),isNaN(a)&&(a=i-s-u-f),isNaN(o)&&(o=r-l-h-c),t.left||t.right){case"center":a=i/2-u/2-n[3];break;case"right":a=i-u-f}switch(t.top||t.bottom){case"middle":case"center":o=r/2-h/2-n[0];break;case"bottom":o=r-h-c}a=a||0,o=o||0,isNaN(u)&&(u=i-f-a-(s||0)),isNaN(h)&&(h=r-c-o-(l||0));var p=new gn(a+n[3],o+n[0],u,h);return p.margin=n,p}function wo(t,e,n){function i(n,i){var o={},l=0,u={},h=0,c=2;if(Jg(n,function(e){u[e]=t[e]}),Jg(n,function(t){r(e,t)&&(o[t]=u[t]=e[t]),a(o,t)&&l++,a(u,t)&&h++}),s[i])return a(e,n[1])?u[n[2]]=null:a(e,n[2])&&(u[n[1]]=null),u;if(h!==c&&l){if(l>=c)return o;for(var f=0;fi;i++)if(t[i].length>e)return t[i];return t[n-1]}function Co(t){var e=t.get("coordinateSystem"),n={coordSysName:e,coordSysDims:[],axisMap:F(),categoryAxisMap:F()},i=uv[e];return i?(i(t,n,n.axisMap,n.categoryAxisMap),n):void 0}function ko(t){return"category"===t.get("type")}function Io(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===dv?{}:[]),this.sourceFormat=t.sourceFormat||pv,this.seriesLayoutBy=t.seriesLayoutBy||vv,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&F(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}function Do(t){var e=t.option.source,n=pv;if(T(e))n=gv;else if(x(e)){0===e.length&&(n=cv);for(var i=0,r=e.length;r>i;i++){var a=e[i];if(null!=a){if(x(a)){n=cv;break}if(S(a)){n=fv;break}}}}else if(S(e)){for(var o in e)if(e.hasOwnProperty(o)&&f(e[o])){n=dv;break}}else if(null!=e)throw new Error("Invalid data");yv(t).sourceFormat=n}function Ao(t){return yv(t).source}function Po(t){yv(t).datasetMap=F()}function Oo(t){var e=t.option,n=e.data,i=T(n)?gv:hv,r=!1,a=e.seriesLayoutBy,o=e.sourceHeader,s=e.dimensions,l=Fo(t);if(l){var u=l.option;n=u.source,i=yv(l).sourceFormat,r=!0,a=a||u.seriesLayoutBy,null==o&&(o=u.sourceHeader),s=s||u.dimensions}var h=Lo(n,i,a,o,s),c=e.encode;!c&&l&&(c=zo(t,l,n,i,a,h)),yv(t).source=new Io({data:n,fromDataset:r,seriesLayoutBy:a,sourceFormat:i,dimensionsDefine:h.dimensionsDefine,startIndex:h.startIndex,dimensionsDetectCount:h.dimensionsDetectCount,encodeDefine:c})}function Lo(t,e,n,i,r){if(!t)return{dimensionsDefine:Eo(r)};var a,o,s;if(e===cv)"auto"===i||null==i?Ro(function(t){null!=t&&"-"!==t&&(b(t)?null==o&&(o=1):o=0)},n,t,10):o=i?1:0,r||1!==o||(r=[],Ro(function(t,e){r[e]=null!=t?t:""},n,t)),a=r?r.length:n===mv?t.length:t[0]?t[0].length:null;else if(e===fv)r||(r=Bo(t),s=!0);else if(e===dv)r||(r=[],s=!0,d(t,function(t,e){r.push(e)}));else if(e===hv){var l=Fi(t[0]);a=x(l)&&l.length||1}var u;return s&&d(r,function(t,e){"name"===(S(t)?t.name:t)&&(u=e)}),{startIndex:o,dimensionsDefine:Eo(r),dimensionsDetectCount:a,potentialNameDimIndex:u}}function Eo(t){if(t){var e=F();return p(t,function(t){if(t=o({},S(t)?t:{name:t}),null==t.name)return t;t.name+="",null==t.displayName&&(t.displayName=t.name);var n=e.get(t.name);return n?t.name+="-"+n.count++:e.set(t.name,{count:1}),t})}}function Ro(t,e,n,i){if(null==i&&(i=1/0),e===mv)for(var r=0;rr;r++)t(n[r]?n[r][0]:null,r);else for(var a=n[0]||[],r=0;rr;r++)t(a[r],r)}function Bo(t){for(var e,n=0;n_&&null==y;_++)Vo(n,i,r,a.dimensionsDefine,a.startIndex,_)||(y=_);if(null!=y){s.value=y;var x=a.potentialNameDimIndex||Math.max(y-1,0);u.push(x),l.push(x)}}return l.length&&(s.itemName=l),u.length&&(s.seriesName=u),s}function Fo(t){var e=t.option,n=e.data;return n?void 0:t.ecModel.getComponent("dataset",e.datasetIndex||0)}function No(t,e){return Vo(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function Vo(t,e,n,i,r,a){function o(t){return null!=t&&isFinite(t)&&""!==t?!1:b(t)&&"-"!==t?!0:void 0}var s,l=5;if(T(t))return!1;var u;if(i&&(u=i[a],u=S(u)?u.name:u),e===cv)if(n===mv){for(var h=t[a],c=0;c<(h||[]).length&&l>c;c++)if(null!=(s=o(h[r+c])))return s}else for(var c=0;cc;c++){var f=t[r+c];if(f&&null!=(s=o(f[a])))return s}else if(e===fv){if(!u)return;for(var c=0;cc;c++){var d=t[c];if(d&&null!=(s=o(d[u])))return s}}else if(e===dv){if(!u)return;var h=t[u];if(!h||T(h))return!1;for(var c=0;cc;c++)if(null!=(s=o(h[c])))return s}else if(e===hv)for(var c=0;cc;c++){var d=t[c],p=Fi(d);if(!x(p))return!1;if(null!=(s=o(p[a])))return s}return!1}function Wo(t,e){if(e){var n=e.seiresIndex,i=e.seriesId,r=e.seriesName;return null!=n&&t.componentIndex!==n||null!=i&&t.id!==i||null!=r&&t.name!==r}}function Ho(t,e){var n=t.color&&!t.colorLayer;d(e,function(e,a){"colorLayer"===a&&n||rv.hasClass(a)||("object"==typeof e?t[a]=t[a]?r(t[a],e,!1):i(e):null==t[a]&&(t[a]=e))})}function Go(t){t=t,this.option={},this.option[_v]=1,this._componentsMap=F({series:[]}),this._seriesIndices,this._seriesIndicesMap,Ho(t,this._theme.option),r(t,ov,!1),this.mergeOption(t)}function qo(t,e){x(e)||(e=e?[e]:[]);var n={};return d(e,function(e){n[e]=(t.get(e)||[]).slice()}),n}function Xo(t,e,n){var i=e.type?e.type:n?n.subType:rv.determineSubType(t,e);return i}function jo(t,e){t._seriesIndicesMap=F(t._seriesIndices=p(e,function(t){return t.componentIndex})||[])}function Uo(t,e){return e.hasOwnProperty("subType")?v(t,function(t){return t.subType===e.subType}):t}function Yo(t){d(wv,function(e){this[e]=y(t[e],t)},this)}function Zo(){this._coordinateSystems=[]}function $o(t){this._api=t,this._timelineOptions=[],this._mediaList=[],this._mediaDefault,this._currentMediaIndices=[],this._optionBackup,this._newBaseOption}function Qo(t,e,n){var i,r,a=[],o=[],s=t.timeline;if(t.baseOption&&(r=t.baseOption),(s||t.options)&&(r=r||{},a=(t.options||[]).slice()),t.media){r=r||{};var l=t.media;Sv(l,function(t){t&&t.option&&(t.query?o.push(t):i||(i=t))})}return r||(r=t),r.timeline||(r.timeline=s),Sv([r].concat(a).concat(p(o,function(t){return t.option})),function(t){Sv(e,function(e){e(t,n)})}),{baseOption:r,timelineOptions:a,mediaDefault:i,mediaList:o}}function Ko(t,e,n){var i={width:e,height:n,aspectratio:e/n},r=!0;return d(t,function(t,e){var n=e.match(kv);if(n&&n[1]&&n[2]){var a=n[1],o=n[2].toLowerCase();Jo(i[o],t,a)||(r=!1)}}),r}function Jo(t,e,n){return"min"===n?t>=e:"max"===n?e>=t:t===e}function ts(t,e){return t.join(",")===e.join(",")}function es(t,e){e=e||{},Sv(e,function(e,n){if(null!=e){var i=t[n];if(rv.hasClass(n)){e=Bi(e),i=Bi(i);var r=Vi(i,e);t[n]=Tv(r,function(t){return t.option&&t.exist?Cv(t.exist,t.option,!0):t.exist||t.option})}else t[n]=Cv(i,e,!0)}})}function ns(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=Av.length;i>n;n++){var a=Av[n],o=e.normal,s=e.emphasis;o&&o[a]&&(t[a]=t[a]||{},t[a].normal?r(t[a].normal,o[a]):t[a].normal=o[a],o[a]=null),s&&s[a]&&(t[a]=t[a]||{},t[a].emphasis?r(t[a].emphasis,s[a]):t[a].emphasis=s[a],s[a]=null)}}function is(t,e,n){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var i=t[e].normal,r=t[e].emphasis;i&&(n?(t[e].normal=t[e].emphasis=null,s(t[e],i)):t[e]=i),r&&(t.emphasis=t.emphasis||{},t.emphasis[e]=r)}}function rs(t){is(t,"itemStyle"),is(t,"lineStyle"),is(t,"areaStyle"),is(t,"label"),is(t,"labelLine"),is(t,"upperLabel"),is(t,"edgeLabel")}function as(t,e){var n=Dv(t)&&t[e],i=Dv(n)&&n.textStyle;if(i)for(var r=0,a=Yd.length;a>r;r++){var e=Yd[r];i.hasOwnProperty(e)&&(n[e]=i[e])}}function os(t){t&&(rs(t),as(t,"label"),t.emphasis&&as(t.emphasis,"label"))}function ss(t){if(Dv(t)){ns(t),rs(t),as(t,"label"),as(t,"upperLabel"),as(t,"edgeLabel"),t.emphasis&&(as(t.emphasis,"label"),as(t.emphasis,"upperLabel"),as(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(ns(e),os(e));var n=t.markLine;n&&(ns(n),os(n));var i=t.markArea;i&&os(i);var r=t.data;if("graph"===t.type){r=r||t.nodes;var a=t.links||t.edges;if(a&&!T(a))for(var o=0;o=0;p--){var g=t[p];if(s||(f=g.data.rawIndexOf(g.stackedByDimension,c)),f>=0){var v=g.data.getByRawIndex(g.stackResultDimension,f);if(h>=0&&v>0||0>=h&&0>v){h+=v,d=v;break}}}return i[0]=h,i[1]=d,i});o.hostModel.setData(l),e.data=l})}function ps(t,e){Io.isInstance(t)||(t=Io.seriesDataToSource(t)),this._source=t;var n=this._data=t.data,i=t.sourceFormat;i===gv&&(this._offset=0,this._dimSize=e,this._data=n);var r=zv[i===cv?i+"_"+t.seriesLayoutBy:i];o(this,r)}function gs(){return this._data.length}function vs(t){return this._data[t]}function ms(t){for(var e=0;ee.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Ps(t,e){d(t.CHANGABLE_METHODS,function(n){t.wrapMethod(n,_(Os,e))})}function Os(t){var e=Ls(t);e&&e.setOutputEnd(this.count())}function Ls(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(t.uid))}return i}}function Es(){this.group=new Zf,this.uid=Ha("viewChart"),this.renderTask=bs({plan:zs,reset:Fs}),this.renderTask.context={view:this}}function Rs(t,e){if(t&&(t.trigger(e),"group"===t.type))for(var n=0;n=0?i():c=setTimeout(i,-a),u=r};return f.clear=function(){c&&(clearTimeout(c),c=null)},f.debounceNextCall=function(t){l=t},f}function Vs(t,e,n,i){this.ecInstance=t,this.api=e,this.unfinished;var n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice();this._allHandlers=n.concat(i),this._stageTaskMap=F()}function Ws(t,e,n,i,r){function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}r=r||{};var o;d(e,function(e){if(!r.visualType||r.visualType===e.visualType){var s=t._stageTaskMap.get(e.uid),l=s.seriesTaskMap,u=s.overallTask;if(u){var h,c=u.agentStubMap;c.each(function(t){a(r,t)&&(t.dirty(),h=!0)}),h&&u.dirty(),am(u,i);var f=t.getPerformArgs(u,r.block);c.each(function(t){t.perform(f)}),o|=u.perform(f)}else l&&l.each(function(s){a(r,s)&&s.dirty();var l=t.getPerformArgs(s,r.block);l.skip=!e.performRawSeries&&n.isSeriesFiltered(s.context.model),am(s,i),o|=s.perform(l)})}}),t.unfinished|=o}function Hs(t,e,n,i,r){function a(n){var a=n.uid,s=o.get(a)||o.set(a,bs({plan:Ys,reset:Zs,count:Qs}));s.context={model:n,ecModel:i,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:t},Ks(t,n,s)}var o=n.seriesTaskMap||(n.seriesTaskMap=F()),s=e.seriesType,l=e.getTargetSeries;e.createOnAllSeries?i.eachRawSeries(a):s?i.eachRawSeriesByType(s,a):l&&l(i,r).each(a);var u=t._pipelineMap;o.each(function(t,e){u.get(e)||(t.dispose(),o.removeKey(e))})}function Gs(t,e,n,i,r){function a(e){var n=e.uid,i=s.get(n);i||(i=s.set(n,bs({reset:Xs,onDirty:Us})),o.dirty()),i.context={model:e,overallProgress:h,modifyOutputEnd:c},i.agent=o,i.__block=h,Ks(t,e,i)}var o=n.overallTask=n.overallTask||bs({reset:qs});o.context={ecModel:i,api:r,overallReset:e.overallReset,scheduler:t};var s=o.agentStubMap=o.agentStubMap||F(),l=e.seriesType,u=e.getTargetSeries,h=!0,c=e.modifyOutputEnd;l?i.eachRawSeriesByType(l,a):u?u(i,r).each(a):(h=!1,d(i.getSeries(),a));var f=t._pipelineMap;s.each(function(t,e){f.get(e)||(t.dispose(),o.dirty(),s.removeKey(e))})}function qs(t){t.overallReset(t.ecModel,t.api,t.payload)}function Xs(t){return t.overallProgress&&js}function js(){this.agent.dirty(),this.getDownstream().dirty()}function Us(){this.agent&&this.agent.dirty()}function Ys(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function Zs(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Bi(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?p(e,function(t,e){return $s(e)}):om}function $s(t){return function(e,n){var i=n.data,r=n.resetDefines[t];if(r&&r.dataEach)for(var a=e.start;a0?parseInt(i,10)/100:i?parseFloat(i):0;var r=n.getAttribute("stop-color")||"#000000";e.addColorStop(i,r)}n=n.nextSibling}}function rl(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),s(e.__inheritedStyle,t.__inheritedStyle))}function al(t){for(var e=E(t).split(mm),n=[],i=0;i0;a-=2){var o=r[a],s=r[a-1];switch(i=i||we(),s){case"translate":o=E(o).split(mm),Te(i,i,[parseFloat(o[0]),parseFloat(o[1]||0)]);break;case"scale":o=E(o).split(mm),ke(i,i,[parseFloat(o[0]),parseFloat(o[1]||o[0])]);break;case"rotate":o=E(o).split(mm),Ce(i,i,parseFloat(o[0]));break;case"skew":o=E(o).split(mm),console.warn("Skew transform is not supported yet");break;case"matrix":var o=E(o).split(mm);i[0]=parseFloat(o[0]),i[1]=parseFloat(o[1]),i[2]=parseFloat(o[2]),i[3]=parseFloat(o[3]),i[4]=parseFloat(o[4]),i[5]=parseFloat(o[5])}}}e.setLocalTransform(i)}function ul(t){var e=t.getAttribute("style"),n={};if(!e)return n;var i={};Sm.lastIndex=0;for(var r;null!=(r=Sm.exec(e));)i[r[1]]=r[2];for(var a in xm)xm.hasOwnProperty(a)&&null!=i[a]&&(n[xm[a]]=i[a]);return n}function hl(t,e,n){var i=e/t.width,r=n/t.height,a=Math.min(i,r),o=[a,a],s=[-(t.x+t.width/2)*a+e/2,-(t.y+t.height/2)*a+n/2];return{scale:o,position:s}}function cl(t){return function(e,n,i){e=e&&e.toLowerCase(),uf.prototype[t].call(this,e,n,i)}}function fl(){uf.call(this)}function dl(t,e,n){function r(t,e){return t.__prio-e.__prio}n=n||{},"string"==typeof e&&(e=ey[e]),this.id,this.group,this._dom=t;var a="canvas",o=this._zr=Pi(t,{renderer:n.renderer||a,devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height});this._throttledZrFlush=Ns(y(o.flush,o),17);var e=i(e);e&&Ev(e,!0),this._theme=e,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new Zo;var s=this._api=Pl(this);Sn(ty,r),Sn(Qm,r),this._scheduler=new Vs(this,s,Qm,ty),uf.call(this,this._ecEventProcessor=new Ol),this._messageCenter=new fl,this._initEvents(),this.resize=y(this.resize,this),this._pendingActions=[],o.animation.on("frame",this._onframe,this),wl(o,this),R(this)}function pl(t,e,n){var i,r=this._model,a=this._coordSysMgr.getCoordinateSystems();e=ji(r,e);for(var o=0;oe.get("hoverLayerThreshold")&&!Vc.node&&n.traverse(function(t){t.isGroup||(t.useHoverLayer=!0)})}function Dl(t,e){var n=t.get("blendMode")||null;e.group.traverse(function(t){t.isGroup||t.style.blend!==n&&t.setStyle("blend",n),t.eachPendingDisplayable&&t.eachPendingDisplayable(function(t){t.setStyle("blend",n)})})}function Al(t,e){var n=t.get("z"),i=t.get("zlevel");e.group.traverse(function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=i&&(t.zlevel=i))})}function Pl(t){var e=t._coordSysMgr;return o(new Yo(t),{getCoordinateSystems:y(e.getCoordinateSystems,e),getComponentByElement:function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}}})}function Ol(){this.eventInfo}function Ll(t){function e(t,e){for(var n=0;n65535?gy:vy}function cu(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function fu(t,e){d(my.concat(e.__wrappedMethods||[]),function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t.__wrappedMethods=e.__wrappedMethods,d(yy,function(n){t[n]=i(e[n])}),t._calculationInfo=o(e._calculationInfo)}function du(t){var e=t._invertedIndicesMap;d(e,function(n,i){var r=t._dimensionInfos[i],a=r.ordinalMeta;if(a){n=e[i]=new gy(a.categories.length);for(var o=0;o=0?this._indices[t]:-1}function mu(t,e){var n=t._idList[e];return null==n&&(n=pu(t,t._idDimIdx,e)),null==n&&(n=dy+e),n}function yu(t){return x(t)||(t=[t]),t}function _u(t,e){var n=t.dimensions,i=new _y(p(n,t.getDimensionInfo,t),t.hostModel);fu(i,t);for(var r=i._storage={},a=t._storage,o=0;o=0?(r[s]=xu(a[s]),i._rawExtent[s]=wu(),i._extent[s]=null):r[s]=a[s])}return i}function xu(t){for(var e=new Array(t.length),n=0;np;p++){var g=a[p]=o({},S(a[p])?a[p]:{name:a[p]}),v=g.name,m=c[p]={otherDims:{}};null!=v&&null==u.get(v)&&(m.name=m.displayName=v,u.set(v,p)),null!=g.type&&(m.type=g.type),null!=g.displayName&&(m.displayName=g.displayName)}l.each(function(t,e){if(t=Bi(t).slice(),1===t.length&&t[0]<0)return void l.set(e,!1);var n=l.set(e,[]);d(t,function(t,i){b(t)&&(t=u.get(t)),null!=t&&f>t&&(n[i]=t,r(c[t],e,i))})});var y=0;d(t,function(t){var e,t,n,a;if(b(t))e=t,t={};else{e=t.name;var o=t.ordinalMeta;t.ordinalMeta=null,t=i(t),t.ordinalMeta=o,n=t.dimsDef,a=t.otherDims,t.name=t.coordDim=t.coordDimIndex=t.dimsDef=t.otherDims=null}var u=l.get(e);if(u!==!1){var u=Bi(u);if(!u.length)for(var h=0;h<(n&&n.length||1);h++){for(;yT;T++){var m=c[T]=c[T]||{},C=m.coordDim;null==C&&(m.coordDim=Mu(M,h,w),m.coordDimIndex=0,(!_||0>=x)&&(m.isExtraCoord=!0),x--),null==m.name&&(m.name=Mu(m.coordDim,u)),null==m.type&&No(e,T,m.name)&&(m.type="ordinal")}return c}function Su(t,e,n,i){var r=Math.max(t.dimensionsDetectCount||1,e.length,n.length,i||0);return d(e,function(t){var e=t.dimsDef;e&&(r=Math.max(r,e.length))}),r}function Mu(t,e,n){if(n||null!=e.get(t)){for(var i=0;null!=e.get(t+i);)i++;t+=i}return e.set(t,!0),t}function Tu(t,e,n){n=n||{};var i,r,a,o,s=n.byIndex,l=n.stackedCoordDimension,u=!(!t||!t.get("stack"));if(d(e,function(t,n){b(t)&&(e[n]=t={name:t}),u&&!t.isExtraCoord&&(s||i||!t.ordinalMeta||(i=t),r||"ordinal"===t.type||"time"===t.type||l&&l!==t.coordDim||(r=t))}),!r||s||i||(s=!0),r){a="__\x00ecstackresult",o="__\x00ecstackedover",i&&(i.createInvertedIndices=!0); +var h=r.coordDim,c=r.type,f=0;d(e,function(t){t.coordDim===h&&f++}),e.push({name:a,coordDim:h,coordDimIndex:f,type:c,isExtraCoord:!0,isCalculationCoord:!0}),f++,e.push({name:o,coordDim:o,coordDimIndex:f,type:c,isExtraCoord:!0,isCalculationCoord:!0})}return{stackedDimension:r&&r.name,stackedByDimension:i&&i.name,isStackedByIndex:s,stackedOverDimension:o,stackResultDimension:a}}function Cu(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function ku(t,e){return Cu(t,e)?t.getCalculationInfo("stackResultDimension"):e}function Iu(t,e,n){n=n||{},Io.isInstance(t)||(t=Io.seriesDataToSource(t));var i,r=e.get("coordinateSystem"),a=Zo.get(r),o=Co(e);o&&(i=p(o.coordSysDims,function(t){var e={name:t},n=o.axisMap.get(t);if(n){var i=n.get("type");e.type=lu(i)}return e})),i||(i=a&&(a.getDimensionsInfo?a.getDimensionsInfo():a.dimensions.slice())||["x","y"]);var s,l,u=by(t,{coordDimensions:i,generateCoord:n.generateCoord});o&&d(u,function(t,e){var n=t.coordDim,i=o.categoryAxisMap.get(n);i&&(null==s&&(s=e),t.ordinalMeta=i.getOrdinalMeta()),null!=t.otherDims.itemName&&(l=!0)}),l||null==s||(u[s].otherDims.itemName=0);var h=Tu(e,u),c=new _y(u,e);c.setCalculationInfo(h);var f=null!=s&&Du(t)?function(t,e,n,i){return i===s?n:this.defaultDimValueGetter(t,e,n,i)}:null;return c.hasItemOption=!1,c.initData(t,null,f),c}function Du(t){if(t.sourceFormat===hv){var e=Au(t.data||[]);return null!=e&&!x(Fi(e))}}function Au(t){for(var e=0;eo&&(o=r.interval=n),null!=i&&o>i&&(o=r.interval=i);var s=r.intervalPrecision=Bu(o),l=r.niceTickExtent=[Cy(Math.ceil(t[0]/o)*o,s),Cy(Math.floor(t[1]/o)*o,s)];return Fu(l,t),r}function Bu(t){return Qa(t)+2}function zu(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function Fu(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),zu(t,0,e),zu(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function Nu(t,e,n,i){var r=[];if(!t)return r;var a=1e4;e[0]a)return[];return e[1]>(r.length?r[r.length-1]:n[1])&&r.push(e[1]),r}function Vu(t){return t.get("stack")||Dy+t.seriesIndex}function Wu(t){return t.dim+t.index}function Hu(t,e){var n=[];return e.eachSeriesByType(t,function(t){ju(t)&&!Uu(t)&&n.push(t)}),n}function Gu(t){var e=[];return d(t,function(t){var n=t.getData(),i=t.coordinateSystem,r=i.getBaseAxis(),a=r.getExtent(),o="category"===r.type?r.getBandWidth():Math.abs(a[1]-a[0])/n.count(),s=Ua(t.get("barWidth"),o),l=Ua(t.get("barMaxWidth"),o),u=t.get("barGap"),h=t.get("barCategoryGap");e.push({bandWidth:o,barWidth:s,barMaxWidth:l,barGap:u,barCategoryGap:h,axisKey:Wu(r),stackId:Vu(t)})}),qu(e)}function qu(t){var e={};d(t,function(t){var n=t.axisKey,i=t.bandWidth,r=e[n]||{bandWidth:i,remainedWidth:i,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},a=r.stacks;e[n]=r;var o=t.stackId;a[o]||r.autoWidthCount++,a[o]=a[o]||{width:0,maxWidth:0};var s=t.barWidth;s&&!a[o].width&&(a[o].width=s,s=Math.min(r.remainedWidth,s),r.remainedWidth-=s);var l=t.barMaxWidth;l&&(a[o].maxWidth=l);var u=t.barGap;null!=u&&(r.gap=u);var h=t.barCategoryGap;null!=h&&(r.categoryGap=h)});var n={};return d(e,function(t,e){n[e]={};var i=t.stacks,r=t.bandWidth,a=Ua(t.categoryGap,r),o=Ua(t.gap,1),s=t.remainedWidth,l=t.autoWidthCount,u=(s-a)/(l+(l-1)*o);u=Math.max(u,0),d(i,function(t){var e=t.maxWidth;e&&u>e&&(e=Math.min(e,s),t.width&&(e=Math.min(e,t.width)),s-=e,t.width=e,l--)}),u=(s-a)/(l+(l-1)*o),u=Math.max(u,0);var h,c=0;d(i,function(t){t.width||(t.width=u),h=t,c+=t.width*(1+o)}),h&&(c-=h.width*o);var f=-c/2;d(i,function(t,i){n[e][i]=n[e][i]||{offset:f,width:t.width},f+=t.width*(1+o)})}),n}function Xu(t,e,n){if(t&&e){var i=t[Wu(e)];return null!=i&&null!=n&&(i=i[Vu(n)]),i}}function ju(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function Uu(t){return t.pipelineContext&&t.pipelineContext.large}function Yu(t,e){var n,i,r=e.getGlobalExtent();r[0]>r[1]?(n=r[1],i=r[0]):(n=r[0],i=r[1]);var a=e.toGlobalCoord(e.dataToCoord(0));return n>a&&(a=n),a>i&&(a=i),a}function Zu(t,e){return Xy(t,qy(e))}function $u(t,e){var n,i,r,a=t.type,o=e.getMin(),s=e.getMax(),l=null!=o,u=null!=s,h=t.getExtent();"ordinal"===a?n=e.getCategories().length:(i=e.get("boundaryGap"),x(i)||(i=[i||0,i||0]),"boolean"==typeof i[0]&&(i=[0,0]),i[0]=Ua(i[0],1),i[1]=Ua(i[1],1),r=h[1]-h[0]||Math.abs(h[0])),null==o&&(o="ordinal"===a?n?0:0/0:h[0]-i[0]*r),null==s&&(s="ordinal"===a?n?n-1:0/0:h[1]+i[1]*r),"dataMin"===o?o=h[0]:"function"==typeof o&&(o=o({min:h[0],max:h[1]})),"dataMax"===s?s=h[1]:"function"==typeof s&&(s=s({min:h[0],max:h[1]})),(null==o||!isFinite(o))&&(o=0/0),(null==s||!isFinite(s))&&(s=0/0),t.setBlank(k(o)||k(s)||"ordinal"===a&&!t.getOrdinalMeta().categories.length),e.getNeedCrossZero()&&(o>0&&s>0&&!l&&(o=0),0>o&&0>s&&!u&&(s=0));var c=e.ecModel;if(c&&"time"===a){var f,p=Hu("bar",c);if(d(p,function(t){f|=t.getBaseAxis()===e.axis}),f){var g=Gu(p),v=Qu(o,s,e,g);o=v.min,s=v.max}}return[o,s]}function Qu(t,e,n,i){var r=n.axis.getExtent(),a=r[1]-r[0],o=Xu(i,n.axis);if(void 0===o)return{min:t,max:e};var s=1/0;d(o,function(t){s=Math.min(t.offset,s)});var l=-1/0;d(o,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=1-(s+l)/a,f=h/c-h;return e+=f*(l/u),t-=f*(s/u),{min:t,max:e}}function Ku(t,e){var n=$u(t,e),i=null!=e.getMin(),r=null!=e.getMax(),a=e.get("splitNumber");"log"===t.type&&(t.base=e.get("logBase"));var o=t.type;t.setExtent(n[0],n[1]),t.niceExtent({splitNumber:a,fixMin:i,fixMax:r,minInterval:"interval"===o||"time"===o?e.get("minInterval"):null,maxInterval:"interval"===o||"time"===o?e.get("maxInterval"):null});var s=e.get("interval");null!=s&&t.setInterval&&t.setInterval(s)}function Ju(t,e){if(e=e||t.get("type"))switch(e){case"category":return new Ty(t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),[1/0,-1/0]);case"value":return new Iy;default:return(Pu.getClass(e)||Iy).create(t)}}function th(t){var e=t.scale.getExtent(),n=e[0],i=e[1];return!(n>0&&i>0||0>n&&0>i)}function eh(t){var e=t.getLabelModel().get("formatter"),n="category"===t.type?t.scale.getExtent()[0]:null;return"string"==typeof e?e=function(e){return function(n){return n=t.scale.getLabel(n),e.replace("{value}",null!=n?n:"")}}(e):"function"==typeof e?function(i,r){return null!=n&&(r=i-n),e(nh(t,i),r)}:function(e){return t.scale.getLabel(e)}}function nh(t,e){return"category"===t.type?t.scale.getLabel(e):e}function ih(t){var e=t.model,n=t.scale;if(e.get("axisLabel.show")&&!n.isBlank()){var i,r,a="category"===t.type,o=n.getExtent();a?r=n.count():(i=n.getTicks(),r=i.length);var s,l=t.getLabelModel(),u=eh(t),h=1;r>40&&(h=Math.ceil(r/40));for(var c=0;r>c;c+=h){var f=i?i[c]:o[0]+c,d=u(f),p=l.getTextRect(d),g=rh(p,l.get("rotate")||0);s?s.union(g):s=g}return s}}function rh(t,e){var n=e*Math.PI/180,i=t.plain(),r=i.width,a=i.height,o=r*Math.cos(n)+a*Math.sin(n),s=r*Math.sin(n)+a*Math.cos(n),l=new gn(i.x,i.y,o,s);return l}function ah(t,e){if("image"!==this.type){var n=this.style,i=this.shape;i&&"line"===i.symbolType?n.stroke=t:this.__isEmptyBrush?(n.stroke=t,n.fill=e||"#fff"):(n.fill&&(n.fill=t),n.stroke&&(n.stroke=t)),this.dirty(!1)}}function oh(t,e,n,i,r,a,o){var s=0===t.indexOf("empty");s&&(t=t.substr(5,1).toLowerCase()+t.substr(6));var l;return l=0===t.indexOf("image://")?Qr(t.slice(8),new gn(e,n,i,r),o?"center":"cover"):0===t.indexOf("path://")?$r(t.slice(7),{},new gn(e,n,i,r),o?"center":"cover"):new a_({shape:{symbolType:t,x:e,y:n,width:i,height:r}}),l.__isEmptyBrush=s,l.setColor=ah,l.setColor(a),l}function sh(t){return Iu(t.getSource(),t)}function lh(t,e){var n=e;Na.isInstance(e)||(n=new Na(e),c(n,Qy));var i=Ju(n);return i.setExtent(t[0],t[1]),Ku(i,n),i}function uh(t){c(t,Qy)}function hh(t,e){return Math.abs(t-e)>1^-(1&s),l=l>>1^-(1&l),s+=r,l+=a,r=s,a=l,i.push([s/n,l/n])}return i}function gh(t){return"category"===t.type?mh(t):xh(t)}function vh(t,e){return"category"===t.type?_h(t,e):{ticks:t.scale.getTicks()}}function mh(t){var e=t.getLabelModel(),n=yh(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}function yh(t,e){var n=wh(t,"labels"),i=Dh(e),r=bh(n,i);if(r)return r;var a,o;return w(i)?a=Ih(t,i):(o="auto"===i?Mh(t):i,a=kh(t,o)),Sh(n,i,{labels:a,labelCategoryInterval:o})}function _h(t,e){var n=wh(t,"ticks"),i=Dh(e),r=bh(n,i);if(r)return r;var a,o;if((!e.get("show")||t.scale.isBlank())&&(a=[]),w(i))a=Ih(t,i,!0);else if("auto"===i){var s=yh(t,t.getLabelModel());o=s.labelCategoryInterval,a=p(s.labels,function(t){return t.tickValue})}else o=i,a=kh(t,o,!0);return Sh(n,i,{ticks:a,tickCategoryInterval:o})}function xh(t){var e=t.scale.getTicks(),n=eh(t);return{labels:p(e,function(e,i){return{formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e}})}}function wh(t,e){return h_(t)[e]||(h_(t)[e]=[])}function bh(t,e){for(var n=0;n40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),h=Math.abs(u*Math.cos(i)),c=Math.abs(u*Math.sin(i)),f=0,d=0;l<=a[1];l+=s){var p=0,g=0,v=En(n(l),e.font,"center","top");p=1.3*v.width,g=1.3*v.height,f=Math.max(f,p,7),d=Math.max(d,g,7)}var m=f/h,y=d/c;isNaN(m)&&(m=1/0),isNaN(y)&&(y=1/0);var _=Math.max(0,Math.floor(Math.min(m,y))),x=h_(t.model),w=x.lastAutoInterval,b=x.lastTickCount;return null!=w&&null!=b&&Math.abs(w-_)<=1&&Math.abs(b-o)<=1&&w>_?_=w:(x.lastTickCount=o,x.lastAutoInterval=_),_}function Ch(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function kh(t,e,n){function i(t){l.push(n?t:{formattedLabel:r(t),rawLabel:a.getLabel(t),tickValue:t})}var r=eh(t),a=t.scale,o=a.getExtent(),s=t.getLabelModel(),l=[],u=Math.max((e||0)+1,1),h=o[0],c=a.count();0!==h&&u>1&&c/u>2&&(h=Math.round(Math.ceil(h/u)*u));var f={min:s.get("showMinLabel"),max:s.get("showMaxLabel")};f.min&&h!==o[0]&&i(o[0]);for(var d=h;d<=o[1];d+=u)i(d);return f.max&&d!==o[1]&&i(o[1]),l}function Ih(t,e,n){var i=t.scale,r=eh(t),a=[];return d(i.getTicks(),function(t){var o=i.getLabel(t);e(t,o)&&a.push(n?t:{formattedLabel:r(t),rawLabel:o,tickValue:t})}),a}function Dh(t){var e=t.get("interval");return null==e?"auto":e}function Ah(t,e){var n=t[1]-t[0],i=e,r=n/i/2;t[0]+=r,t[1]-=r}function Ph(t,e,n,i,r){function a(t,e){return h?t>e:e>t}var o=e.length;if(t.onBand&&!i&&o){var s,l=t.getExtent();if(1===o)e[0].coord=l[0],s=e[1]={coord:l[0]};else{var u=e[1].coord-e[0].coord;d(e,function(t){t.coord-=u/2;var e=e||0;e%2>0&&(t.coord-=u/(2*(e+1)))}),s={coord:e[o-1].coord+u},e.push(s)}var h=l[0]>l[1];a(e[0].coord,l[0])&&(r?e[0].coord=l[0]:e.shift()),r&&a(l[0],e[0].coord)&&e.unshift({coord:l[0]}),a(l[1],s.coord)&&(r?s.coord=l[1]:e.pop()),r&&a(s.coord,l[1])&&e.push({coord:l[1]})}}function Oh(t,e){var n=t.mapDimension("defaultedLabel",!0),i=n.length;if(1===i)return ws(t,e,n[0]);if(i){for(var r=[],a=0;a0?n=i[0]:i[1]<0&&(n=i[1]),n}function jh(t,e,n,i){var r=0/0;t.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=t.valueStart);var a=t.baseDataOffset,o=[];return o[a]=n.get(t.baseDim,i),o[1-a]=r,e.dataToPoint(o)}function Uh(t,e){var n=[];return e.diff(t).add(function(t){n.push({cmd:"+",idx:t})}).update(function(t,e){n.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){n.push({cmd:"-",idx:t})}).execute(),n}function Yh(t){return isNaN(t[0])||isNaN(t[1])}function Zh(t,e,n,i,r,a,o,s,l,u){return"none"!==u&&u?$h.apply(this,arguments):Qh.apply(this,arguments)}function $h(t,e,n,i,r,a,o,s,l,u,h){for(var c=0,f=n,d=0;i>d;d++){var p=e[f];if(f>=r||0>f)break;if(Yh(p)){if(h){f+=a;continue}break}if(f===n)t[a>0?"moveTo":"lineTo"](p[0],p[1]);else if(l>0){var g=e[c],v="y"===u?1:0,m=(p[v]-g[v])*l;k_(D_,g),D_[v]=g[v]+m,k_(A_,p),A_[v]=p[v]-m,t.bezierCurveTo(D_[0],D_[1],A_[0],A_[1],p[0],p[1])}else t.lineTo(p[0],p[1]);c=f,f+=a}return d}function Qh(t,e,n,i,r,a,o,s,l,u,h){for(var c=0,f=n,d=0;i>d;d++){var p=e[f];if(f>=r||0>f)break;if(Yh(p)){if(h){f+=a;continue}break}if(f===n)t[a>0?"moveTo":"lineTo"](p[0],p[1]),k_(D_,p);else if(l>0){var g=f+a,v=e[g];if(h)for(;v&&Yh(e[g]);)g+=a,v=e[g];var m=.5,y=e[c],v=e[g];if(!v||Yh(v))k_(A_,p);else{Yh(v)&&!h&&(v=p),U(I_,v,y);var _,x;if("x"===u||"y"===u){var w="x"===u?0:1;_=Math.abs(p[w]-y[w]),x=Math.abs(p[w]-v[w])}else _=af(p,y),x=af(p,v);m=x/(x+_),C_(A_,p,I_,-l*(1-m))}M_(D_,D_,s),T_(D_,D_,o),M_(A_,A_,s),T_(A_,A_,o),t.bezierCurveTo(D_[0],D_[1],A_[0],A_[1],p[0],p[1]),C_(D_,p,I_,l*m)}else t.lineTo(p[0],p[1]);c=f,f+=a}return d}function Kh(t,e){var n=[1/0,1/0],i=[-1/0,-1/0];if(e)for(var r=0;ri[0]&&(i[0]=a[0]),a[1]>i[1]&&(i[1]=a[1])}return{min:e?n:i,max:e?i:n}}function Jh(t,e){if(t.length===e.length){for(var n=0;ne[0]?1:-1;e[0]+=i*n,e[1]-=i*n}return e}function nc(t,e,n){if(!n.valueDim)return[];for(var i=[],r=0,a=e.count();a>r;r++)i.push(jh(n,t,e,r));return i}function ic(t,e,n,i){var r=ec(t.getAxis("x")),a=ec(t.getAxis("y")),o=t.getBaseAxis().isHorizontal(),s=Math.min(r[0],r[1]),l=Math.min(a[0],a[1]),u=Math.max(r[0],r[1])-s,h=Math.max(a[0],a[1])-l;if(n)s-=.5,u+=.5,l-=.5,h+=.5;else{var c=i.get("lineStyle.width")||2,f=i.get("clipOverflow")?c/2:Math.max(u,h);o?(l-=f,h+=2*f):(s-=f,u+=2*f)}var d=new vg({shape:{x:s,y:l,width:u,height:h}});return e&&(d.shape[o?"width":"height"]=0,Pa(d,{shape:{width:u,height:h}},i)),d}function rc(t,e,n,i){var r=t.getAngleAxis(),a=t.getRadiusAxis(),o=a.getExtent().slice();o[0]>o[1]&&o.reverse();var s=r.getExtent(),l=Math.PI/180;n&&(o[0]-=.5,o[1]+=.5);var u=new hg({shape:{cx:Ya(t.cx,1),cy:Ya(t.cy,1),r0:Ya(o[0],1),r:Ya(o[1],1),startAngle:-s[0]*l,endAngle:-s[1]*l,clockwise:r.inverse}});return e&&(u.shape.endAngle=-s[0]*l,Pa(u,{shape:{endAngle:-s[1]*l}},i)),u}function ac(t,e,n,i){return"polar"===t.type?rc(t,e,n,i):ic(t,e,n,i)}function oc(t,e,n){for(var i=e.getBaseAxis(),r="x"===i.dim||"radius"===i.dim?0:1,a=[],o=0;o=0;a--){var o=n[a].dimension,s=t.dimensions[o],l=t.getDimensionInfo(s);if(i=l&&l.coordDim,"x"===i||"y"===i){r=n[a];break}}if(r){var u=e.getAxis(i),h=p(r.stops,function(t){return{coord:u.toGlobalCoord(u.dataToCoord(t.value)),color:t.color}}),c=h.length,f=r.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),f.reverse());var g=10,v=h[0].coord-g,m=h[c-1].coord+g,y=m-v;if(.001>y)return"transparent";d(h,function(t){t.offset=(t.coord-v)/y}),h.push({offset:c?h[c-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:f[0]||"transparent"});var _=new Sg(0,0,0,0,h,!0);return _[i]=v,_[i+"2"]=m,_}}}function lc(t,e,n){var i=t.get("showAllSymbol"),r="auto"===i;if(!i||r){var a=n.getAxesByScale("ordinal")[0];if(a&&(!r||!uc(a,e))){var o=e.mapDimension(a.dim),s={};return d(a.getViewLabels(),function(t){s[t.tickValue]=1}),function(t){return!s.hasOwnProperty(e.get(o,t))}}}}function uc(t,e){var n=t.getExtent(),i=Math.abs(n[1]-n[0])/t.scale.count();isNaN(i)&&(i=0);for(var r=e.count(),a=Math.max(1,Math.round(r/5)),o=0;r>o;o+=a)if(1.5*Lh.getSymbolSize(e,o)[t.isHorizontal()?1:0]>i)return!1;return!0}function hc(t){return this._axes[t]}function cc(t){F_.call(this,t)}function fc(t,e){return e.type||(e.data?"category":"value")}function dc(t,e){return t.getCoordSysModel()===e}function pc(t,e,n){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(t,e,n),this.model=t}function gc(t,e,n,i){function r(t){return t.dim+"_"+t.index}n.getAxesOnZeroOf=function(){return a?[a]:[]};var a,o=t[e],s=n.model,l=s.get("axisLine.onZero"),u=s.get("axisLine.onZeroAxisIndex");if(l){if(null!=u)vc(o[u])&&(a=o[u]);else for(var h in o)if(o.hasOwnProperty(h)&&vc(o[h])&&!i[r(o[h])]){a=o[h];break}a&&(i[r(a)]=!0)}}function vc(t){return t&&"category"!==t.type&&"time"!==t.type&&th(t)}function mc(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}function yc(t){return p(U_,function(e){var n=t.getReferringComponents(e)[0];return n})}function _c(t){return"cartesian2d"===t.get("coordinateSystem")}function xc(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e}function wc(t,e,n,i){var r,a,o=to(n-t.rotation),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;return eo(o-Y_/2)?(a=l?"bottom":"top",r="center"):eo(o-1.5*Y_)?(a=l?"top":"bottom",r="center"):(a="middle",r=1.5*Y_>o&&o>Y_/2?l?"left":"right":l?"right":"left"),{rotation:o,textAlign:r,textVerticalAlign:a}}function bc(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)}function Sc(t,e,n){var i=t.get("axisLabel.showMinLabel"),r=t.get("axisLabel.showMaxLabel");e=e||[],n=n||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],u=n[0],h=n[1],c=n[n.length-1],f=n[n.length-2];i===!1?(Mc(a),Mc(u)):Tc(a,o)&&(i?(Mc(o),Mc(h)):(Mc(a),Mc(u))),r===!1?(Mc(s),Mc(c)):Tc(l,s)&&(r?(Mc(l),Mc(f)):(Mc(s),Mc(c)))}function Mc(t){t&&(t.ignore=!0)}function Tc(t,e){var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){var r=be([]);return Ce(r,r,-t.rotation),n.applyTransform(Me([],r,t.getLocalTransform())),i.applyTransform(Me([],r,e.getLocalTransform())),n.intersect(i)}}function Cc(t){return"middle"===t||"center"===t}function kc(t,e,n){var i=e.axis;if(e.get("axisTick.show")&&!i.scale.isBlank()){for(var r=e.getModel("axisTick"),a=r.getModel("lineStyle"),o=r.get("length"),l=i.getTicksCoords(),u=[],h=[],c=t._transform,f=[],d=0;dl[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),or;r++)n[t][r].h!==e&&i.push(n[t][r]);n[t]=i}n[t]&&0===n[t].length&&delete n[t]}else delete n[t];return this},trigger:function(t){var e=this._$handlers[t],n=this._$eventProcessor;if(e){var i=arguments,r=i.length;r>3&&(i=lf.call(i,1));for(var a=e.length,o=0;a>o;){var s=e[o];if(n&&n.filter&&null!=s.query&&!n.filter(t,s.query))o++;else{switch(r){case 1:s.h.call(s.ctx);break;case 2:s.h.call(s.ctx,i[1]);break;case 3:s.h.call(s.ctx,i[1],i[2]);break;default:s.h.apply(s.ctx,i)}s.one?(e.splice(o,1),a--):o++}}}return n&&n.afterTrigger&&n.afterTrigger(t),this},triggerWithContext:function(t){var e=this._$handlers[t],n=this._$eventProcessor;if(e){var i=arguments,r=i.length;r>4&&(i=lf.call(i,1,i.length-1));for(var a=i[i.length-1],o=e.length,s=0;o>s;){var l=e[s];if(n&&n.filter&&null!=l.query&&!n.filter(t,l.query))s++;else{switch(r){case 1:l.h.call(a);break;case 2:l.h.call(a,i[1]);break;case 3:l.h.call(a,i[1],i[2]);break;default:l.h.apply(a,i)}l.one?(e.splice(s,1),o--):s++}}}return n&&n.afterTrigger&&n.afterTrigger(t),this}};var hf="undefined"!=typeof window&&!!window.addEventListener,cf=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ff=hf?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0},df="silent";_e.prototype.dispose=function(){};var pf=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],gf=function(t,e,n,i){uf.call(this),this.storage=t,this.painter=e,this.painterRoot=i,n=n||new _e,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,le.call(this),this.setHandlerProxy(n)};gf.prototype={constructor:gf,setHandlerProxy:function(t){this.proxy&&this.proxy.dispose(),t&&(d(pf,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},mousemove:function(t){var e=t.zrX,n=t.zrY,i=this._hovered,r=i.target;r&&!r.__zr&&(i=this.findHover(i.x,i.y),r=i.target);var a=this._hovered=this.findHover(e,n),o=a.target,s=this.proxy;s.setCursor&&s.setCursor(o?o.cursor:"default"),r&&o!==r&&this.dispatchToElement(i,"mouseout",t),this.dispatchToElement(a,"mousemove",t),o&&o!==r&&this.dispatchToElement(a,"mouseover",t)},mouseout:function(t){this.dispatchToElement(this._hovered,"mouseout",t);var e,n=t.toElement||t.relatedTarget;do n=n&&n.parentNode;while(n&&9!=n.nodeType&&!(e=n===this.painterRoot));!e&&this.trigger("globalout",{event:t})},resize:function(){this._hovered={}},dispatch:function(t,e){var n=this[t];n&&n.call(this,e)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},dispatchToElement:function(t,e,n){t=t||{};var i=t.target;if(!i||!i.silent){for(var r="on"+e,a=me(e,t,n);i&&(i[r]&&(a.cancelBubble=i[r].call(i,a)),i.trigger(e,a),i=i.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(e,a),this.painter&&this.painter.eachOtherLayer(function(t){"function"==typeof t[r]&&t[r].call(t,a),t.trigger&&t.trigger(e,a)}))}},findHover:function(t,e,n){for(var i=this.storage.getDisplayList(),r={x:t,y:e},a=i.length-1;a>=0;a--){var o;if(i[a]!==n&&!i[a].ignore&&(o=xe(i[a],t,e))&&(!r.topTarget&&(r.topTarget=i[a]),o!==df)){r.target=i[a];break}}return r}},d(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){gf.prototype[t]=function(e){var n=this.findHover(e.zrX,e.zrY),i=n.target;if("mousedown"===t)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===t)this._upEl=i;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||af(this._downPoint,[e.zrX,e.zrY])>4)return; +this._downPoint=null}this.dispatchToElement(n,t,e)}}),c(gf,uf),c(gf,le);var vf="undefined"==typeof Float32Array?Array:Float32Array,mf=(Object.freeze||Object)({create:we,identity:be,copy:Se,mul:Me,translate:Te,rotate:Ce,scale:ke,invert:Ie,clone:De}),yf=be,_f=5e-5,xf=function(t){t=t||{},t.position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},wf=xf.prototype;wf.transform=null,wf.needLocalTransform=function(){return Ae(this.rotation)||Ae(this.position[0])||Ae(this.position[1])||Ae(this.scale[0]-1)||Ae(this.scale[1]-1)};var bf=[];wf.updateTransform=function(){var t=this.parent,e=t&&t.transform,n=this.needLocalTransform(),i=this.transform;if(!n&&!e)return void(i&&yf(i));i=i||we(),n?this.getLocalTransform(i):yf(i),e&&(n?Me(i,t.transform,i):Se(i,t.transform)),this.transform=i;var r=this.globalScaleRatio;if(null!=r&&1!==r){this.getGlobalScale(bf);var a=bf[0]<0?-1:1,o=bf[1]<0?-1:1,s=((bf[0]-a)*r+a)/bf[0]||0,l=((bf[1]-o)*r+o)/bf[1]||0;i[0]*=s,i[1]*=s,i[2]*=l,i[3]*=l}this.invTransform=this.invTransform||we(),Ie(this.invTransform,i)},wf.getLocalTransform=function(t){return xf.getLocalTransform(this,t)},wf.setTransform=function(t){var e=this.transform,n=t.dpr||1;e?t.setTransform(n*e[0],n*e[1],n*e[2],n*e[3],n*e[4],n*e[5]):t.setTransform(n,0,0,n,0,0)},wf.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var Sf=[],Mf=we();wf.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=this.position,r=this.scale;Ae(e-1)&&(e=Math.sqrt(e)),Ae(n-1)&&(n=Math.sqrt(n)),t[0]<0&&(e=-e),t[3]<0&&(n=-n),i[0]=t[4],i[1]=t[5],r[0]=e,r[1]=n,this.rotation=Math.atan2(-t[1]/n,t[0]/e)}},wf.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(Me(Sf,t.invTransform,e),e=Sf);var n=this.origin;n&&(n[0]||n[1])&&(Mf[4]=n[0],Mf[5]=n[1],Me(Sf,e,Mf),Sf[4]-=n[0],Sf[5]-=n[1],e=Sf),this.setLocalTransform(e)}},wf.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},wf.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&ae(n,n,i),n},wf.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&ae(n,n,i),n},xf.getLocalTransform=function(t,e){e=e||[],yf(e);var n=t.origin,i=t.scale||[1,1],r=t.rotation||0,a=t.position||[0,0];return n&&(e[4]-=n[0],e[5]-=n[1]),ke(e,e,i),r&&Ce(e,e,r),n&&(e[4]+=n[0],e[5]+=n[1]),e[4]+=a[0],e[5]+=a[1],e};var Tf={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||1>n?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(t-=1))*Math.sin(2*(t-e)*Math.PI/i)))},elasticOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||1>n?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin(2*(t-e)*Math.PI/i)+1)},elasticInOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||1>n?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?-.5*n*Math.pow(2,10*(t-=1))*Math.sin(2*(t-e)*Math.PI/i):n*Math.pow(2,-10*(t-=1))*Math.sin(2*(t-e)*Math.PI/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*t*t*((e+1)*t-e):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-Tf.bounceOut(1-t)},bounceOut:function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return.5>t?.5*Tf.bounceIn(2*t):.5*Tf.bounceOut(2*t-1)+.5}};Pe.prototype={constructor:Pe,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)return void(this._pausedTime+=e);var n=(t-this._startTime-this._pausedTime)/this._life;if(!(0>n)){n=Math.min(n,1);var i=this.easing,r="string"==typeof i?Tf[i]:i,a="function"==typeof r?r(n):n;return this.fire("frame",a),1==n?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){t="on"+t,this[t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var Cf=function(){this.head=null,this.tail=null,this._len=0},kf=Cf.prototype;kf.insert=function(t){var e=new If(t);return this.insertEntry(e),e},kf.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},kf.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},kf.len=function(){return this._len},kf.clear=function(){this.head=this.tail=null,this._len=0};var If=function(t){this.value=t,this.next,this.prev},Df=function(t){this._list=new Cf,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},Af=Df.prototype;Af.put=function(t,e){var n=this._list,i=this._map,r=null;if(null==i[t]){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}o?o.value=e:o=new If(e),o.key=t,n.insertEntry(o),i[t]=o}return r},Af.get=function(t){var e=this._map[t],n=this._list;return null!=e?(e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value):void 0},Af.clear=function(){this._list.clear(),this._map={}};var Pf={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]},Of=new Df(20),Lf=null,Ef=Ue,Rf=Ye,Bf=(Object.freeze||Object)({parse:He,lift:Xe,toHex:je,fastLerp:Ue,fastMapToColor:Ef,lerp:Ye,mapToColor:Rf,modifyHSL:Ze,modifyAlpha:$e,stringify:Qe}),zf=Array.prototype.slice,Ff=function(t,e,n,i){this._tracks={},this._target=t,this._loop=e||!1,this._getter=n||Ke,this._setter=i||Je,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};Ff.prototype={when:function(t,e){var n=this._tracks;for(var i in e)if(e.hasOwnProperty(i)){if(!n[i]){n[i]=[];var r=this._getter(this._target,i);if(null==r)continue;0!==t&&n[i].push({time:0,value:ln(r)})}n[i].push({time:t,value:e[i]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;tn;n++)t[n].call(this)},start:function(t,e){var n,i=this,r=0,a=function(){r--,r||i._doneCallback()};for(var o in this._tracks)if(this._tracks.hasOwnProperty(o)){var s=cn(this,t,a,this._tracks[o],o,e);s&&(this._clipList.push(s),r++,this.animation&&this.animation.addClip(s),n=s)}if(n){var l=n.onframe;n.onframe=function(t,e){l(t,e);for(var n=0;n1&&(Hf=function(){for(var t in arguments)console.log(arguments[t])});var Gf=Hf,qf=function(){this.animators=[]};qf.prototype={constructor:qf,animate:function(t,e){var n,i=!1,r=this,a=this.__zr;if(t){var o=t.split("."),s=r;i="shape"===o[0];for(var l=0,h=o.length;h>l;l++)s&&(s=s[o[l]]);s&&(n=s)}else n=r;if(!n)return void Gf('Property "'+t+'" is not existed in element '+r.id);var c=r.animators,f=new Ff(n,e);return f.during(function(){r.dirty(i)}).done(function(){c.splice(u(c,f),1)}),c.push(f),a&&a.animation.addAnimator(f),f},stopAnimation:function(t){for(var e=this.animators,n=e.length,i=0;n>i;i++)e[i].stop(t);return e.length=0,this},animateTo:function(t,e,n,i,r,a){fn(this,t,e,n,i,r,a)},animateFrom:function(t,e,n,i,r,a){fn(this,t,e,n,i,r,a,!0)}};var Xf=function(t){xf.call(this,t),uf.call(this,t),qf.call(this,t),this.id=t.id||Fc()};Xf.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=t,n[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var n=this[t];n||(n=this[t]=[]),n[0]=e[0],n[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(S(t))for(var n in t)t.hasOwnProperty(n)&&this.attrKV(n,t[n]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),this.clipPath=t,t.__zr=e,t.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var n=0;ni||n>s||l>a||r>u)},contain:function(t,e){var n=this;return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},clone:function(){return new gn(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},gn.create=function(t){return new gn(t.x,t.y,t.width,t.height)};var Zf=function(t){t=t||{},Xf.call(this,t);for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};Zf.prototype={constructor:Zf,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,n=0;n=0&&(n.splice(i,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,n=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof Zf&&t.addChildrenToStorage(e)),n&&n.refresh()},remove:function(t){var e=this.__zr,n=this.__storage,i=this._children,r=u(i,t);return 0>r?this:(i.splice(r,1),t.parent=null,n&&(n.delFromStorage(t),t instanceof Zf&&t.delChildrenFromStorage(n)),e&&e.refresh(),this)},removeAll:function(){var t,e,n=this._children,i=this.__storage;for(e=0;ei;i++)this._updateAndAddDisplayable(e[i],null,t);n.length=this._displayListLen,Vc.canvasSupported&&Sn(n,Mn)},_updateAndAddDisplayable:function(t,e,n){if(!t.ignore||n){t.beforeUpdate(),t.__dirty&&t.update(),t.afterUpdate();var i=t.clipPath;if(i){e=e?e.slice():[];for(var r=i,a=t;r;)r.parent=a,r.updateTransform(),e.push(r),a=r,r=r.clipPath}if(t.isGroup){for(var o=t._children,s=0;se;e++)this.delRoot(t[e]);else{var r=u(this._roots,t);r>=0&&(this.delFromStorage(t),this._roots.splice(r,1),t instanceof Zf&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:Mn};var Jf={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},td=function(t,e,n){return Jf.hasOwnProperty(e)?n*=t.dpr:n},ed=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],nd=function(t){this.extendFrom(t,!1)};nd.prototype={constructor:nd,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(t,e,n){for(var i=this,r=n&&n.style,a=!r,o=0;o0},extendFrom:function(t,e){if(t)for(var n in t)!t.hasOwnProperty(n)||e!==!0&&(e===!1?this.hasOwnProperty(n):null==t[n])||(this[n]=t[n])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,n){for(var i="radial"===e.type?Cn:Tn,r=i(t,e,n),a=e.colorStops,o=0;o=0&&n.splice(i,1),t.__hoverMir=null},clearHover:function(){for(var t=this._hoverElements,e=0;er;){var a=t[r],o=a.__from;o&&o.__zr?(r++,o.invisible||(a.transform=o.transform,a.invTransform=o.invTransform,a.__clipPaths=o.__clipPaths,this._doPaintEl(a,n,!0,i))):(t.splice(r,1),o.__hoverMir=null,e--)}n.ctx.restore()}},getHoverLayer:function(){return this.getLayer(wd)},_paintList:function(t,e,n){if(this._redrawId===n){e=e||!1,this._updateLayerStatus(t);var i=this._doPaintList(t,e);if(this._needsManuallyCompositing&&this._compositeManually(),!i){var r=this;ld(function(){r._paintList(t,e,n)})}}},_compositeManually:function(){var t=this.getLayer(bd).ctx,e=this._domRoot.width,n=this._domRoot.height;t.clearRect(0,0,e,n),this.eachBuiltinLayer(function(i){i.virtual&&t.drawImage(i.dom,0,0,e,n)})},_doPaintList:function(t,e){for(var n=[],i=0;i15)break}}a.__drawIndex=v,a.__drawIndex0&&t>i[0]){for(o=0;r-1>o&&!(i[o]t);o++);a=n[i[o]]}if(i.splice(o+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?s.insertBefore(e.dom,l.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)},eachLayer:function(t,e){var n,i,r=this._zlevelList;for(i=0;i0?Sd:0),this._needsManuallyCompositing),o.__builtin__||Gf("ZLevel "+s+" has been used by unkown layer "+o.id),o!==r&&(o.__used=!0,o.__startIndex!==n&&(o.__dirty=!0),o.__startIndex=n,o.__drawIndex=o.incremental?-1:n,e(n),r=o),i.__dirty&&(o.__dirty=!0,o.incremental&&o.__drawIndex<0&&(o.__drawIndex=n))}e(n),this.eachBuiltinLayer(function(t){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var n=this._layerConfig;n[t]?r(n[t],e,!0):n[t]=e;for(var i=0;i=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),n=0;no;o++){var s=n[o],l=s.step(t,e);l&&(r.push(l),a.push(s))}for(var o=0;i>o;)n[o]._needsRemove?(n[o]=n[i-1],n.pop(),i--):o++;i=r.length;for(var o=0;i>o;o++)a[o].fire(r[o]);this._time=t,this.onframe(e),this.trigger("frame",e),this.stage.update&&this.stage.update()},_startLoop:function(){function t(){e._running&&(ld(t),!e._paused&&e._update())}var e=this;this._running=!0,ld(t)},start:function(){this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop()},stop:function(){this._running=!1},pause:function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},resume:function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},clear:function(){this._clips=[]},isFinished:function(){return!this._clips.length},animate:function(t,e){e=e||{};var n=new Ff(t,e.loop,e.getter,e.setter);return this.addAnimator(n),n}},c(Id,uf);var Dd=function(){this._track=[]};Dd.prototype={constructor:Dd,recognize:function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},clear:function(){return this._track.length=0,this},_doTrack:function(t,e,n){var i=t.touches;if(i){for(var r={points:[],touches:[],target:e,event:t},a=0,o=i.length;o>a;a++){var s=i[a],l=fe(n,s,{});r.points.push([l.zrX,l.zrY]),r.touches.push(s)}this._track.push(r)}},_recognize:function(t){for(var e in Ad)if(Ad.hasOwnProperty(e)){var n=Ad[e](this._track,t);if(n)return n}}};var Ad={pinch:function(t,e){var n=t.length;if(n){var i=(t[n-1]||{}).points,r=(t[n-2]||{}).points||i;if(r&&r.length>1&&i&&i.length>1){var a=Si(i)/Si(r);!isFinite(a)&&(a=1),e.pinchScale=a;var o=Mi(i);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}},Pd=300,Od=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Ld=["touchstart","touchend","touchmove"],Ed={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},Rd=p(Od,function(t){var e=t.replace("mouse","pointer");return Ed[e]?e:t}),Bd={mousemove:function(t){t=pe(this.dom,t),this.trigger("mousemove",t)},mouseout:function(t){t=pe(this.dom,t);var e=t.toElement||t.relatedTarget;if(e!=this.dom)for(;e&&9!=e.nodeType;){if(e===this.dom)return;e=e.parentNode}this.trigger("mouseout",t)},touchstart:function(t){t=pe(this.dom,t),t.zrByTouch=!0,this._lastTouchMoment=new Date,Ci(this,t,"start"),Bd.mousemove.call(this,t),Bd.mousedown.call(this,t),ki(this)},touchmove:function(t){t=pe(this.dom,t),t.zrByTouch=!0,Ci(this,t,"change"),Bd.mousemove.call(this,t),ki(this)},touchend:function(t){t=pe(this.dom,t),t.zrByTouch=!0,Ci(this,t,"end"),Bd.mouseup.call(this,t),+new Date-this._lastTouchMoment=0||i&&u(i,o)<0)){var s=e.getShallow(o);null!=s&&(r[t[a][0]]=s)}}return r}},tp=Jd([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),ep={getLineStyle:function(t){var e=tp(this,t),n=this.getLineDash(e.lineWidth);return n&&(e.lineDash=n),e},getLineDash:function(t){null==t&&(t=1);var e=this.get("type"),n=Math.max(t,2),i=4*t;return"solid"===e||null==e?null:"dashed"===e?[i,i]:[n,n]}},np=Jd([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),ip={getAreaStyle:function(t,e){return np(this,t,e)}},rp=Math.pow,ap=Math.sqrt,op=1e-8,sp=1e-4,lp=ap(3),up=1/3,hp=W(),cp=W(),fp=W(),dp=Math.min,pp=Math.max,gp=Math.sin,vp=Math.cos,mp=2*Math.PI,yp=W(),_p=W(),xp=W(),wp=[],bp=[],Sp={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Mp=[],Tp=[],Cp=[],kp=[],Ip=Math.min,Dp=Math.max,Ap=Math.cos,Pp=Math.sin,Op=Math.sqrt,Lp=Math.abs,Ep="undefined"!=typeof Float32Array,Rp=function(t){this._saveData=!t,this._saveData&&(this.data=[]),this._ctx=null};Rp.prototype={constructor:Rp,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(t,e){this._ux=Lp(1/Wf/t)||0,this._uy=Lp(1/Wf/e)||0},getContext:function(){return this._ctx},beginPath:function(t){return this._ctx=t,t&&t.beginPath(),t&&(this.dpr=t.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(t,e){return this.addData(Sp.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},lineTo:function(t,e){var n=Lp(t-this._xi)>this._ux||Lp(e-this._yi)>this._uy||this._len<5;return this.addData(Sp.L,t,e),this._ctx&&n&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),n&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,n,i,r,a){return this.addData(Sp.C,t,e,n,i,r,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,n,i,r,a):this._ctx.bezierCurveTo(t,e,n,i,r,a)),this._xi=r,this._yi=a,this},quadraticCurveTo:function(t,e,n,i){return this.addData(Sp.Q,t,e,n,i),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,n,i):this._ctx.quadraticCurveTo(t,e,n,i)),this._xi=n,this._yi=i,this},arc:function(t,e,n,i,r,a){return this.addData(Sp.A,t,e,n,n,i,r-i,0,a?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,a),this._xi=Ap(r)*n+t,this._yi=Pp(r)*n+e,this},arcTo:function(t,e,n,i,r){return this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},rect:function(t,e,n,i){return this._ctx&&this._ctx.rect(t,e,n,i),this.addData(Sp.R,t,e,n,i),this},closePath:function(){this.addData(Sp.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,n),t.closePath()),this._xi=e,this._yi=n,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,n=0;nn;n++)this.data[n]=t[n];this._len=e},appendPath:function(t){t instanceof Array||(t=[t]);for(var e=t.length,n=0,i=this._len,r=0;e>r;r++)n+=t[r].len();Ep&&this.data instanceof Float32Array&&(this.data=new Float32Array(i+n));for(var r=0;e>r;r++)for(var a=t[r].data,o=0;oe.length&&(this._expandData(),e=this.data);for(var n=0;na&&(a=r+a),a%=r,d-=a*h,p-=a*c;h>0&&t>=d||0>h&&d>=t||0==h&&(c>0&&e>=p||0>c&&p>=e);)i=this._dashIdx,n=o[i],d+=h*n,p+=c*n,this._dashIdx=(i+1)%g,h>0&&l>d||0>h&&d>l||c>0&&u>p||0>c&&p>u||s[i%2?"moveTo":"lineTo"](h>=0?Ip(d,t):Dp(d,t),c>=0?Ip(p,e):Dp(p,e));h=d-t,c=p-e,this._dashOffset=-Op(h*h+c*c)},_dashedBezierTo:function(t,e,n,i,r,a){var o,s,l,u,h,c=this._dashSum,f=this._dashOffset,d=this._lineDash,p=this._ctx,g=this._xi,v=this._yi,m=or,y=0,_=this._dashIdx,x=d.length,w=0;for(0>f&&(f=c+f),f%=c,o=0;1>o;o+=.1)s=m(g,t,n,r,o+.1)-m(g,t,n,r,o),l=m(v,e,i,a,o+.1)-m(v,e,i,a,o),y+=Op(s*s+l*l);for(;x>_&&(w+=d[_],!(w>f));_++);for(o=(w-f)/y;1>=o;)u=m(g,t,n,r,o),h=m(v,e,i,a,o),_%2?p.moveTo(u,h):p.lineTo(u,h),o+=d[_]/y,_=(_+1)%x;_%2!==0&&p.lineTo(r,a),s=r-u,l=a-h,this._dashOffset=-Op(s*s+l*l)},_dashedQuadraticTo:function(t,e,n,i){var r=n,a=i;n=(n+2*t)/3,i=(i+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,n,i,r,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,Ep&&(this.data=new Float32Array(t)))},getBoundingRect:function(){Mp[0]=Mp[1]=Cp[0]=Cp[1]=Number.MAX_VALUE,Tp[0]=Tp[1]=kp[0]=kp[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,n=0,i=0,r=0,a=0;ac;){var f=s[c++];switch(1==c&&(i=s[c],r=s[c+1],e=i,n=r),f){case Sp.M:e=i=s[c++],n=r=s[c++],t.moveTo(i,r);break;case Sp.L:a=s[c++],o=s[c++],(Lp(a-i)>l||Lp(o-r)>u||c===h-1)&&(t.lineTo(a,o),i=a,r=o);break;case Sp.C:t.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),i=s[c-2],r=s[c-1];break;case Sp.Q:t.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),i=s[c-2],r=s[c-1];break;case Sp.A:var d=s[c++],p=s[c++],g=s[c++],v=s[c++],m=s[c++],y=s[c++],_=s[c++],x=s[c++],w=g>v?g:v,b=g>v?1:g/v,S=g>v?v/g:1,M=Math.abs(g-v)>.001,T=m+y;M?(t.translate(d,p),t.rotate(_),t.scale(b,S),t.arc(0,0,w,m,T,1-x),t.scale(1/b,1/S),t.rotate(-_),t.translate(-d,-p)):t.arc(d,p,w,m,T,1-x),1==c&&(e=Ap(m)*g+d,n=Pp(m)*v+p),i=Ap(T)*g+d,r=Pp(T)*v+p;break;case Sp.R:e=i=s[c],n=r=s[c+1],t.rect(s[c++],s[c++],s[c++],s[c++]);break;case Sp.Z:t.closePath(),i=e,r=n}}}},Rp.CMD=Sp;var Bp=2*Math.PI,zp=2*Math.PI,Fp=Rp.CMD,Np=2*Math.PI,Vp=1e-4,Wp=[-1,-1,-1],Hp=[-1,-1],Gp=od.prototype.getCanvasPattern,qp=Math.abs,Xp=new Rp(!0);zr.prototype={constructor:zr,type:"path",__dirtyPath:!0,strokeContainThreshold:5,brush:function(t,e){var n=this.style,i=this.path||Xp,r=n.hasStroke(),a=n.hasFill(),o=n.fill,s=n.stroke,l=a&&!!o.colorStops,u=r&&!!s.colorStops,h=a&&!!o.image,c=r&&!!s.image;if(n.bind(t,this,e),this.setTransform(t),this.__dirty){var f;l&&(f=f||this.getBoundingRect(),this._fillGradient=n.getGradient(t,o,f)),u&&(f=f||this.getBoundingRect(),this._strokeGradient=n.getGradient(t,s,f))}l?t.fillStyle=this._fillGradient:h&&(t.fillStyle=Gp.call(o,t)),u?t.strokeStyle=this._strokeGradient:c&&(t.strokeStyle=Gp.call(s,t));var d=n.lineDash,p=n.lineDashOffset,g=!!t.setLineDash,v=this.getGlobalScale();if(i.setScale(v[0],v[1]),this.__dirtyPath||d&&!g&&r?(i.beginPath(t),d&&!g&&(i.setLineDash(d),i.setLineDashOffset(p)),this.buildPath(i,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),a)if(null!=n.fillOpacity){var m=t.globalAlpha;t.globalAlpha=n.fillOpacity*n.opacity,i.fill(t),t.globalAlpha=m}else i.fill(t);if(d&&g&&(t.setLineDash(d),t.lineDashOffset=p),r)if(null!=n.strokeOpacity){var m=t.globalAlpha;t.globalAlpha=n.strokeOpacity*n.opacity,i.stroke(t),t.globalAlpha=m}else i.stroke(t);d&&g&&t.setLineDash([]),null!=n.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(){},createPathProxy:function(){this.path=new Rp},getBoundingRect:function(){var t=this._rect,e=this.style,n=!t;if(n){var i=this.path;i||(i=this.path=new Rp),this.__dirtyPath&&(i.beginPath(),this.buildPath(i,this.shape,!1)),t=i.getBoundingRect()}if(this._rect=t,e.hasStroke()){var r=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||n){r.copy(t);var a=e.lineWidth,o=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),o>1e-10&&(r.width+=a/o,r.height+=a/o,r.x-=a/o/2,r.y-=a/o/2)}return r}return t},contain:function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),r=this.style;if(t=n[0],e=n[1],i.contain(t,e)){var a=this.path.data;if(r.hasStroke()){var o=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(r.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),Br(a,o/s,t,e)))return!0}if(r.hasFill())return Rr(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):gi.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var n=this.shape;if(n){if(S(t))for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);else n[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&qp(t[0]-1)>1e-10&&qp(t[3]-1)>1e-10?Math.sqrt(qp(t[0]*t[3]-t[2]*t[1])):1}},zr.extend=function(t){var e=function(e){zr.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var n=t.shape;if(n){this.shape=this.shape||{};var i=this.shape;for(var r in n)!i.hasOwnProperty(r)&&n.hasOwnProperty(r)&&(i[r]=n[r])}t.init&&t.init.call(this,e)};h(e,zr);for(var n in t)"style"!==n&&"shape"!==n&&(e.prototype[n]=t[n]);return e},h(zr,gi);var jp=Rp.CMD,Up=[[],[],[]],Yp=Math.sqrt,Zp=Math.atan2,$p=function(t,e){var n,i,r,a,o,s,l=t.data,u=jp.M,h=jp.C,c=jp.L,f=jp.R,d=jp.A,p=jp.Q;for(r=0,a=0;ro;o++){var s=Up[o];s[0]=l[r++],s[1]=l[r++],ae(s,s,e),l[a++]=s[0],l[a++]=s[1]}}},Qp=Math.sqrt,Kp=Math.sin,Jp=Math.cos,tg=Math.PI,eg=function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},ng=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(eg(t)*eg(e))},ig=function(t,e){return(t[0]*e[1]=11?function(){var e,n=this.__clipPaths,i=this.style;if(n)for(var r=0;ra;a++)r+=ee(t[a-1],t[a]);var o=r/2;o=n>o?n:o;for(var a=0;o>a;a++){var s,l,u,h=a/(o-1)*(e?n:n-1),c=Math.floor(h),f=h-c,d=t[c%n];e?(s=t[(c-1+n)%n],l=t[(c+1)%n],u=t[(c+2)%n]):(s=t[0===c?c:c-1],l=t[c>n-2?n-1:c+1],u=t[c>n-3?n-1:c+2]);var p=f*f,g=f*p;i.push([qr(s[0],d[0],l[0],u[0],f,p,g),qr(s[1],d[1],l[1],u[1],f,p,g)])}return i},dg=function(t,e,n,i){var r,a,o,s,l=[],u=[],h=[],c=[];if(i){o=[1/0,1/0],s=[-1/0,-1/0];for(var f=0,d=t.length;d>f;f++)oe(o,o,t[f]),se(s,s,t[f]);oe(o,o,i[0]),se(s,s,i[1])}for(var f=0,d=t.length;d>f;f++){var p=t[f];if(n)r=t[f?f-1:d-1],a=t[(f+1)%d];else{if(0===f||f===d-1){l.push(G(t[f]));continue}r=t[f-1],a=t[f+1]}U(u,a,r),J(u,u,e);var g=ee(p,r),v=ee(p,a),m=g+v;0!==m&&(g/=m,v/=m),J(h,u,-g),J(c,u,v);var y=X([],p,h),_=X([],p,c);i&&(se(y,y,o),oe(y,y,s),se(_,_,o),oe(_,_,s)),l.push(y),l.push(_)}return n&&l.push(l.shift()),l},pg=zr.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(t,e){Xr(t,e,!0)}}),gg=zr.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(t,e){Xr(t,e,!1)}}),vg=zr.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.x,i=e.y,r=e.width,a=e.height;e.r?$n(t,e):t.rect(n,i,r,a),t.closePath()}}),mg=zr.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var n=e.x1,i=e.y1,r=e.x2,a=e.y2,o=e.percent;0!==o&&(t.moveTo(n,i),1>o&&(r=n*(1-o)+r*o,a=i*(1-o)+a*o),t.lineTo(r,a))},pointAt:function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]}}),yg=[],_g=zr.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var n=e.x1,i=e.y1,r=e.x2,a=e.y2,o=e.cpx1,s=e.cpy1,l=e.cpx2,u=e.cpy2,h=e.percent;0!==h&&(t.moveTo(n,i),null==l||null==u?(1>h&&(vr(n,o,r,h,yg),o=yg[1],r=yg[2],vr(i,s,a,h,yg),s=yg[1],a=yg[2]),t.quadraticCurveTo(o,s,r,a)):(1>h&&(hr(n,o,l,r,h,yg),o=yg[1],l=yg[2],r=yg[3],hr(i,s,u,a,h,yg),s=yg[1],u=yg[2],a=yg[3]),t.bezierCurveTo(o,s,l,u,r,a)))},pointAt:function(t){return jr(this.shape,t,!1)},tangentAt:function(t){var e=jr(this.shape,t,!0);return te(e,e)}}),xg=zr.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r,0),a=e.startAngle,o=e.endAngle,s=e.clockwise,l=Math.cos(a),u=Math.sin(a);t.moveTo(l*r+n,u*r+i),t.arc(n,i,r,a,o,!s)}}),wg=zr.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var t=this.__dirtyPath,e=this.shape.paths,n=0;n"'])/g,Ug={"&":"&","<":"<",">":">",'"':""","'":"'"},Yg=["a","b","c","d","e","f","g"],Zg=function(t,e){return"{"+t+(null==e?"":e)+"}"},$g=Vn,Qg=En,Kg=(Object.freeze||Object)({addCommas:uo,toCamelCase:ho,normalizeCssArray:Xg,encodeHTML:co,formatTpl:fo,formatTplSimple:po,getTooltipMarker:go,formatTime:mo,capitalFirst:yo,truncateText:$g,getTextRect:Qg}),Jg=d,tv=["left","right","top","bottom","width","height"],ev=[["width","left","right"],["height","top","bottom"]],nv=(_(_o,"vertical"),_(_o,"horizontal"),{getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}}),iv=Xi(),rv=Na.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(t,e,n,i){Na.call(this,t,e,n,i),this.uid=Ha("ec_cpt_model")},init:function(t,e,n){this.mergeDefaultAndTheme(t,n)},mergeDefaultAndTheme:function(t,e){var n=this.layoutMode,i=n?bo(t):{},a=e.getTheme();r(t,a.get(this.mainType)),r(t,this.getDefaultOption()),n&&wo(t,i,n)},mergeOption:function(t){r(this.option,t,!0);var e=this.layoutMode;e&&wo(this.option,t,e)},optionUpdated:function(){},getDefaultOption:function(){var t=iv(this);if(!t.defaultOption){for(var e=[],n=this.constructor;n;){var i=n.prototype.defaultOption;i&&e.push(i),n=n.superClass}for(var a={},o=e.length-1;o>=0;o--)a=r(a,e[o],!0);t.defaultOption=a}return t.defaultOption},getReferringComponents:function(t){return this.ecModel.queryComponents({mainType:t,index:this.get(t+"Index",!0),id:this.get(t+"Id",!0)})}});ir(rv,{registerWhenExtend:!0}),Ga(rv),qa(rv,Mo),c(rv,nv);var av="";"undefined"!=typeof navigator&&(av=navigator.platform||"");var ov={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:av.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},sv=Xi(),lv={clearColorPalette:function(){sv(this).colorIdx=0,sv(this).colorNameMap={}},getColorFromPalette:function(t,e,n){e=e||this;var i=sv(e),r=i.colorIdx||0,a=i.colorNameMap=i.colorNameMap||{};if(a.hasOwnProperty(t))return a[t];var o=Bi(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=n&&s?To(s,n):o;if(l=l||o,l&&l.length){var u=l[r];return t&&(a[t]=u),i.colorIdx=(r+1)%l.length,u}}},uv={cartesian2d:function(t,e,n,i){var r=t.getReferringComponents("xAxis")[0],a=t.getReferringComponents("yAxis")[0];e.coordSysDims=["x","y"],n.set("x",r),n.set("y",a),ko(r)&&(i.set("x",r),e.firstCategoryDimIndex=0),ko(a)&&(i.set("y",a),e.firstCategoryDimIndex=1)},singleAxis:function(t,e,n,i){var r=t.getReferringComponents("singleAxis")[0];e.coordSysDims=["single"],n.set("single",r),ko(r)&&(i.set("single",r),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var r=t.getReferringComponents("polar")[0],a=r.findAxisModel("radiusAxis"),o=r.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",a),n.set("angle",o),ko(a)&&(i.set("radius",a),e.firstCategoryDimIndex=0),ko(o)&&(i.set("angle",o),e.firstCategoryDimIndex=1)},geo:function(t,e){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var r=t.ecModel,a=r.getComponent("parallel",t.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();d(a.parallelAxisIndex,function(t,a){var s=r.getComponent("parallelAxis",t),l=o[a];n.set(l,s),ko(s)&&null==e.firstCategoryDimIndex&&(i.set(l,s),e.firstCategoryDimIndex=a)})}},hv="original",cv="arrayRows",fv="objectRows",dv="keyedColumns",pv="unknown",gv="typedArray",vv="column",mv="row";Io.seriesDataToSource=function(t){return new Io({data:t,sourceFormat:T(t)?gv:hv,fromDataset:!1})},tr(Io);var yv=Xi(),_v="\x00_ec_inner",xv=Na.extend({init:function(t,e,n,i){n=n||{},this.option=null,this._theme=new Na(n),this._optionManager=i},setOption:function(t,e){L(!(_v in t),"please use chart.getOption()"),this._optionManager.setOption(t,e),this.resetOption(null)},resetOption:function(t){var e=!1,n=this._optionManager;if(!t||"recreate"===t){var i=n.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this.mergeOption(i)):Go.call(this,i),e=!0}if(("timeline"===t||"media"===t)&&this.restoreData(),!t||"recreate"===t||"timeline"===t){var r=n.getTimelineOption(this);r&&(this.mergeOption(r),e=!0)}if(!t||"recreate"===t||"media"===t){var a=n.getMediaOption(this,this._api);a.length&&d(a,function(t){this.mergeOption(t,e=!0)},this)}return e},mergeOption:function(t){function e(e,i){var r=Bi(t[e]),s=Vi(a.get(e),r);Wi(s),d(s,function(t){var n=t.option;S(n)&&(t.keyInfo.mainType=e,t.keyInfo.subType=Xo(e,n,t.exist))});var l=qo(a,i);n[e]=[],a.set(e,[]),d(s,function(t,i){var r=t.exist,s=t.option;if(L(S(s)||r,"Empty component definition"),s){var u=rv.getClass(e,t.keyInfo.subType,!0);if(r&&r instanceof u)r.name=t.keyInfo.name,r.mergeOption(s,this),r.optionUpdated(s,!1);else{var h=o({dependentModels:l,componentIndex:i},t.keyInfo);r=new u(s,this,this,h),o(r,h),r.init(s,this,this,h),r.optionUpdated(null,!0)}}else r.mergeOption({},this),r.optionUpdated({},!1);a.get(e)[i]=r,n[e][i]=r.option},this),"series"===e&&jo(this,a.get("series"))}var n=this.option,a=this._componentsMap,s=[];Po(this),d(t,function(t,e){null!=t&&(rv.hasClass(e)?e&&s.push(e):n[e]=null==n[e]?i(t):r(n[e],t,!0))}),rv.topologicalTravel(s,rv.getAllClassMainTypes(),e,this),this._seriesIndicesMap=F(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var t=i(this.option);return d(t,function(e,n){if(rv.hasClass(n)){for(var e=Bi(e),i=e.length-1;i>=0;i--)Gi(e[i])&&e.splice(i,1);t[n]=e}}),delete t[_v],t},getTheme:function(){return this._theme},getComponent:function(t,e){var n=this._componentsMap.get(t);return n?n[e||0]:void 0},queryComponents:function(t){var e=t.mainType;if(!e)return[];var n=t.index,i=t.id,r=t.name,a=this._componentsMap.get(e);if(!a||!a.length)return[];var o;if(null!=n)x(n)||(n=[n]),o=v(p(n,function(t){return a[t]}),function(t){return!!t});else if(null!=i){var s=x(i);o=v(a,function(t){return s&&u(i,t.id)>=0||!s&&t.id===i})}else if(null!=r){var l=x(r);o=v(a,function(t){return l&&u(r,t.name)>=0||!l&&t.name===r})}else o=a.slice();return Uo(o,t)},findComponents:function(t){function e(t){var e=r+"Index",n=r+"Id",i=r+"Name";return!t||null==t[e]&&null==t[n]&&null==t[i]?null:{mainType:r,index:t[e],id:t[n],name:t[i]}}function n(e){return t.filter?v(e,t.filter):e}var i=t.query,r=t.mainType,a=e(i),o=a?this.queryComponents(a):this._componentsMap.get(r);return n(Uo(o,t))},eachComponent:function(t,e,n){var i=this._componentsMap;if("function"==typeof t)n=e,e=t,i.each(function(t,i){d(t,function(t,r){e.call(n,i,t,r)})});else if(b(t))d(i.get(t),e,n);else if(S(t)){var r=this.findComponents(t);d(r,e,n)}},getSeriesByName:function(t){var e=this._componentsMap.get("series");return v(e,function(e){return e.name===t})},getSeriesByIndex:function(t){return this._componentsMap.get("series")[t]},getSeriesByType:function(t){var e=this._componentsMap.get("series");return v(e,function(e){return e.subType===t})},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(t,e){d(this._seriesIndices,function(n){var i=this._componentsMap.get("series")[n];t.call(e,i,n)},this)},eachRawSeries:function(t,e){d(this._componentsMap.get("series"),t,e)},eachSeriesByType:function(t,e,n){d(this._seriesIndices,function(i){var r=this._componentsMap.get("series")[i];r.subType===t&&e.call(n,r,i)},this)},eachRawSeriesByType:function(t,e,n){return d(this.getSeriesByType(t),e,n)},isSeriesFiltered:function(t){return null==this._seriesIndicesMap.get(t.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(t,e){var n=v(this._componentsMap.get("series"),t,e);jo(this,n)},restoreData:function(t){var e=this._componentsMap;jo(this,e.get("series"));var n=[];e.each(function(t,e){n.push(e)}),rv.topologicalTravel(n,rv.getAllClassMainTypes(),function(n){d(e.get(n),function(e){("series"!==n||!Wo(e,t))&&e.restoreData()})})}});c(xv,lv);var wv=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"],bv={};Zo.prototype={constructor:Zo,create:function(t,e){var n=[];d(bv,function(i){var r=i.create(t,e);n=n.concat(r||[])}),this._coordinateSystems=n},update:function(t,e){d(this._coordinateSystems,function(n){n.update&&n.update(t,e)})},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},Zo.register=function(t,e){bv[t]=e},Zo.get=function(t){return bv[t]};var Sv=d,Mv=i,Tv=p,Cv=r,kv=/^(min|max)?(.+)$/;$o.prototype={constructor:$o,setOption:function(t,e){t&&d(Bi(t.series),function(t){t&&t.data&&T(t.data)&&R(t.data)}),t=Mv(t,!0);var n=this._optionBackup,i=Qo.call(this,t,e,!n);this._newBaseOption=i.baseOption,n?(es(n.baseOption,i.baseOption),i.timelineOptions.length&&(n.timelineOptions=i.timelineOptions),i.mediaList.length&&(n.mediaList=i.mediaList),i.mediaDefault&&(n.mediaDefault=i.mediaDefault)):this._optionBackup=i},mountOption:function(t){var e=this._optionBackup;return this._timelineOptions=Tv(e.timelineOptions,Mv),this._mediaList=Tv(e.mediaList,Mv),this._mediaDefault=Mv(e.mediaDefault),this._currentMediaIndices=[],Mv(t?e.baseOption:this._newBaseOption)},getTimelineOption:function(t){var e,n=this._timelineOptions;if(n.length){var i=t.getComponent("timeline");i&&(e=Mv(n[i.getCurrentIndex()],!0))}return e},getMediaOption:function(){var t=this._api.getWidth(),e=this._api.getHeight(),n=this._mediaList,i=this._mediaDefault,r=[],a=[];if(!n.length&&!i)return a;for(var o=0,s=n.length;s>o;o++)Ko(n[o].query,t,e)&&r.push(o);return!r.length&&i&&(r=[-1]),r.length&&!ts(r,this._currentMediaIndices)&&(a=Tv(r,function(t){return Mv(-1===t?i.option:n[t].option)})),this._currentMediaIndices=r,a}};var Iv=d,Dv=S,Av=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"],Pv=function(t,e){Iv(ls(t.series),function(t){Dv(t)&&ss(t)});var n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),Iv(n,function(e){Iv(ls(t[e]),function(t){t&&(as(t,"axisLabel"),as(t.axisPointer,"label"))})}),Iv(ls(t.parallel),function(t){var e=t&&t.parallelAxisDefault;as(e,"axisLabel"),as(e&&e.axisPointer,"label")}),Iv(ls(t.calendar),function(t){is(t,"itemStyle"),as(t,"dayLabel"),as(t,"monthLabel"),as(t,"yearLabel")}),Iv(ls(t.radar),function(t){as(t,"name")}),Iv(ls(t.geo),function(t){Dv(t)&&(os(t),Iv(ls(t.regions),function(t){os(t)}))}),Iv(ls(t.timeline),function(t){os(t),is(t,"label"),is(t,"itemStyle"),is(t,"controlStyle",!0);var e=t.data;x(e)&&d(e,function(t){S(t)&&(is(t,"label"),is(t,"itemStyle"))})}),Iv(ls(t.toolbox),function(t){is(t,"iconStyle"),Iv(t.feature,function(t){is(t,"iconStyle")})}),as(us(t.axisPointer),"label"),as(us(t.tooltip).axisPointer,"label")},Ov=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],Lv=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],Ev=function(t,e){Pv(t,e),t.series=Bi(t.series),d(t.series,function(t){if(S(t)){var e=t.type;if(("pie"===e||"gauge"===e)&&null!=t.clockWise&&(t.clockwise=t.clockWise),"gauge"===e){var n=hs(t,"pointer.color");null!=n&&cs(t,"itemStyle.normal.color",n)}fs(t)}}),t.dataRange&&(t.visualMap=t.dataRange),d(Lv,function(e){var n=t[e];n&&(x(n)||(n=[n]),d(n,function(t){fs(t)}))})},Rv=function(t){var e=F();t.eachSeries(function(t){var n=t.get("stack");if(n){var i=e.get(n)||e.set(n,[]),r=t.getData(),a={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:t};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;i.length&&r.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(a)}}),e.each(ds)},Bv=ps.prototype;Bv.pure=!1,Bv.persistent=!0,Bv.getSource=function(){return this._source};var zv={arrayRows_column:{pure:!0,count:function(){return Math.max(0,this._data.length-this._source.startIndex)},getItem:function(t){return this._data[t+this._source.startIndex]},appendData:ms},arrayRows_row:{pure:!0,count:function(){var t=this._data[0];return t?Math.max(0,t.length-this._source.startIndex):0},getItem:function(t){t+=this._source.startIndex;for(var e=[],n=this._data,i=0;i=1)&&(t=1),t}var n=this._upstream,i=t&&t.skip;if(this._dirty&&n){var r=this.context;r.data=r.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!i&&(a=this._plan(this.context));var o=e(this._modBy),s=this._modDataCount||0,l=e(t&&t.modBy),u=t&&t.modDataCount||0;(o!==l||s!==u)&&(a="reset");var h;(this._dirty||"reset"===a)&&(this._dirty=!1,h=Ts(this,i)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var f=this._dueIndex,d=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!i&&(h||d>f)){var p=this._progress;if(x(p))for(var g=0;gi?i++:null}function e(){var t=i%o*r+Math.ceil(i/o),e=i>=n?null:a>t?t:i;return i++,e}var n,i,r,a,o,s={reset:function(l,u,h,c){i=l,n=u,r=h,a=c,o=Math.ceil(a/r),s.next=r>1&&a>0?e:t}};return s}();Hv.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},Hv.unfinished=function(){return this._progress&&this._dueIndex":"",v=p+s.join(p||", ");return{renderMode:i,content:v,style:u}}function a(t){return{renderMode:i,content:co(uo(t)),style:u}}var o=this;i=i||"html";var s="html"===i?"
":"\n",l="richText"===i,u={},h=0,c=this.getData(),f=c.mapDimension("defaultedTooltip",!0),p=f.length,v=this.getRawValue(t),m=x(v),y=c.getItemVisual(t,"color");S(y)&&y.colorStops&&(y=(y.colorStops[0]||{}).color),y=y||"transparent";var _=p>1||m&&!p?r(v):a(p?ws(c,t,f[0]):m?v[0]:v),w=_.content,b=o.seriesIndex+"at"+h,M=go({color:y,type:"item",renderMode:i,markerId:b});u[b]=y,++h;var T=c.getName(t),C=this.name;Hi(this)||(C=""),C=C?co(C)+(e?": ":s):"";var k="string"==typeof M?M:M.content,I=e?k+C+w:C+k+(T?co(T)+": "+w:w);return{html:I,markers:u}},isAnimationEnabled:function(){if(Vc.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,n){var i=this.ecModel,r=lv.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});c(Xv,Wv),c(Xv,lv);var jv=function(){this.group=new Zf,this.uid=Ha("viewComponent")};jv.prototype={constructor:jv,init:function(){},render:function(){},dispose:function(){},filterForExposedEvent:null};var Uv=jv.prototype;Uv.updateView=Uv.updateLayout=Uv.updateVisual=function(){},Ji(jv),ir(jv,{registerWhenExtend:!0});var Yv=function(){var t=Xi();return function(e){var n=t(e),i=e.pipelineContext,r=n.large,a=n.progressiveRender,o=n.large=i.large,s=n.progressiveRender=i.progressiveRender;return!!(r^o||a^s)&&"reset"}},Zv=Xi(),$v=Yv();Es.prototype={type:"chart",init:function(){},render:function(){},highlight:function(t,e,n,i){Bs(t.getData(),i,"emphasis")},downplay:function(t,e,n,i){Bs(t.getData(),i,"normal")},remove:function(){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var Qv=Es.prototype;Qv.updateView=Qv.updateLayout=Qv.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},Ji(Es,["dispose"]),ir(Es,{registerWhenExtend:!0}),Es.markUpdateMethod=function(t,e){Zv(t).updateMethod=e};var Kv={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},Jv={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),i=(t.visualColorAccessPath||"itemStyle.color").split("."),r=t.get(i)||t.getColorFromPalette(t.name,null,e.getSeriesCount());if(n.setVisual("color",r),!e.isSeriesFiltered(t)){"function"!=typeof r||r instanceof bg||n.each(function(e){n.setItemVisual(e,"color",r(t.getDataParams(e)))});var a=function(t,e){var n=t.getItemModel(e),r=n.get(i,!0);null!=r&&t.setItemVisual(e,"color",r)};return{dataEach:n.hasItemOption?a:null}}}},tm={toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}},em=function(t,e){function n(t,e){if("string"!=typeof t)return t;var n=t;return d(e,function(t,e){n=n.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),n}function i(t){var e=o.get(t);if(null==e){for(var n=t.split("."),i=tm.aria,r=0;rs)){var f=r();l=f?n(i("general.withTitle"),{title:f}):i("general.withoutTitle");var p=[],g=s>1?"series.multiple.prefix":"series.single.prefix";l+=n(i(g),{seriesCount:s}),e.eachSeries(function(t,e){if(c>e){var r,o=t.get("name"),l="series."+(s>1?"multiple":"single")+".";r=i(o?l+"withName":l+"withoutName"),r=n(r,{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:a(t.subType)});var h=t.getData();window.data=h,r+=h.count()>u?n(i("data.partialData"),{displayCnt:u}):i("data.allData");for(var f=[],d=0;dd){var g=h.getName(d),v=ws(h,d);f.push(n(i(g?"data.withName":"data.withoutName"),{name:g,value:v}))}r+=f.join(i("data.separator.middle"))+i("data.separator.end"),p.push(r)}}),l+=p.join(i("series.multiple.separator.middle"))+i("series.multiple.separator.end"),t.setAttribute("aria-label",l)}}},nm=Math.PI,im=function(t,e){e=e||{},s(e,{text:"loading",color:"#c23531",textColor:"#000",maskColor:"rgba(255, 255, 255, 0.8)",zlevel:0});var n=new vg({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4}),i=new xg({shape:{startAngle:-nm/2,endAngle:-nm/2+.1,r:10},style:{stroke:e.color,lineCap:"round",lineWidth:5},zlevel:e.zlevel,z:10001}),r=new vg({style:{fill:"none",text:e.text,textPosition:"right",textDistance:10,textFill:e.textColor},zlevel:e.zlevel,z:10001});i.animateShape(!0).when(1e3,{endAngle:3*nm/2}).start("circularInOut"),i.animateShape(!0).when(1e3,{startAngle:3*nm/2}).delay(300).start("circularInOut");var a=new Zf;return a.add(i),a.add(r),a.add(n),a.resize=function(){var e=t.getWidth()/2,a=t.getHeight()/2;i.setShape({cx:e,cy:a});var o=i.shape.r;r.setShape({x:e-o,y:a-o,width:2*o,height:2*o}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},a.resize(),a},rm=Vs.prototype;rm.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each(function(t){var e=t.overallTask;e&&e.dirty()})},rm.getPerformArgs=function(t,e){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,r=!e&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex,a=r?n.step:null,o=i&&i.modDataCount,s=null!=o?Math.ceil(o/a):null;return{step:a,modBy:s,modDataCount:o}}},rm.getPipeline=function(t){return this._pipelineMap.get(t)},rm.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData(),r=i.count(),a=n.progressiveEnabled&&e.incrementalPrepareRender&&r>=n.threshold,o=t.get("large")&&r>=t.get("largeThreshold"),s="mod"===t.get("progressiveChunkMode")?r:null;t.pipelineContext=n.context={progressiveRender:a,modDataCount:s,large:o}},rm.restorePipelines=function(t){var e=this,n=e._pipelineMap=F();t.eachSeries(function(t){var i=t.getProgressive(),r=t.uid;n.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),Ks(e,t,t.dataTask)})},rm.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.ecInstance.getModel(),n=this.api;d(this._allHandlers,function(i){var r=t.get(i.uid)||t.set(i.uid,[]);i.reset&&Hs(this,i,r,e,n),i.overallReset&&Gs(this,i,r,e,n)},this)},rm.prepareView=function(t,e,n,i){var r=t.renderTask,a=r.context;a.model=e,a.ecModel=n,a.api=i,r.__block=!t.incrementalPrepareRender,Ks(this,e,r)},rm.performDataProcessorTasks=function(t,e){Ws(this,this._dataProcessorHandlers,t,e,{block:!0})},rm.performVisualTasks=function(t,e,n){Ws(this,this._visualHandlers,t,e,n)},rm.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e|=t.dataTask.perform()}),this.unfinished|=e},rm.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})};var am=rm.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},om=$s(0);Vs.wrapStageHandler=function(t,e){return w(t)&&(t={overallReset:t,seriesType:Js(t)}),t.uid=Ha("stageHandler"),e&&(t.visualType=e),t};var sm,lm={},um={};tl(lm,xv),tl(um,Yo),lm.eachSeriesByType=lm.eachRawSeriesByType=function(t){sm=t},lm.eachComponent=function(t){"series"===t.mainType&&t.subType&&(sm=t.subType)};var hm=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],cm={color:hm,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],hm]},fm="#eee",dm=function(){return{axisLine:{lineStyle:{color:fm}},axisTick:{lineStyle:{color:fm}},axisLabel:{textStyle:{color:fm}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:fm}}}},pm=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],gm={color:pm,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:fm},crossStyle:{color:fm}}},legend:{textStyle:{color:fm}},textStyle:{color:fm},title:{textStyle:{color:fm}},toolbox:{iconStyle:{normal:{borderColor:fm}}},dataZoom:{textStyle:{color:fm}},visualMap:{textStyle:{color:fm}},timeline:{lineStyle:{color:fm},itemStyle:{normal:{color:pm[1]}},label:{normal:{textStyle:{color:fm}}},controlStyle:{normal:{color:fm,borderColor:fm}}},timeAxis:dm(),logAxis:dm(),valueAxis:dm(),categoryAxis:dm(),line:{symbol:"circle"},graph:{color:pm},gauge:{title:{textStyle:{color:fm}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}}; +gm.categoryAxis.splitLine.show=!1,rv.extend({type:"dataset",defaultOption:{seriesLayoutBy:vv,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){Do(this)}}),jv.extend({type:"dataset"});var vm=zr.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(t,e){var n=.5522848,i=e.cx,r=e.cy,a=e.rx,o=e.ry,s=a*n,l=o*n;t.moveTo(i-a,r),t.bezierCurveTo(i-a,r-l,i-s,r-o,i,r-o),t.bezierCurveTo(i+s,r-o,i+a,r-l,i+a,r),t.bezierCurveTo(i+a,r+l,i+s,r+o,i,r+o),t.bezierCurveTo(i-s,r+o,i-a,r+l,i-a,r),t.closePath()}}),mm=/[\s,]+/;nl.prototype.parse=function(t,e){e=e||{};var n=el(t);if(!n)throw new Error("Illegal svg");var i=new Zf;this._root=i;var r=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||e.width),o=parseFloat(n.getAttribute("height")||e.height);isNaN(a)&&(a=null),isNaN(o)&&(o=null),ol(n,i,null,!0);for(var s=n.firstChild;s;)this._parseNode(s,i),s=s.nextSibling;var l,u;if(r){var h=E(r).split(mm);h.length>=4&&(l={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(l&&null!=a&&null!=o&&(u=hl(l,a,o),!e.ignoreViewBox)){var c=i;i=new Zf,i.add(c),c.scale=u.scale.slice(),c.position=u.position.slice()}return e.ignoreRootClip||null==a||null==o||i.setClipPath(new vg({shape:{x:0,y:0,width:a,height:o}})),{root:i,width:a,height:o,viewBoxRect:l,viewBoxTransform:u}},nl.prototype._parseNode=function(t,e){var n=t.nodeName.toLowerCase();"defs"===n?this._isDefine=!0:"text"===n&&(this._isText=!0);var i;if(this._isDefine){var r=_m[n];if(r){var a=r.call(this,t),o=t.getAttribute("id");o&&(this._defs[o]=a)}}else{var r=ym[n];r&&(i=r.call(this,t,e),e.add(i))}for(var s=t.firstChild;s;)1===s.nodeType&&this._parseNode(s,i),3===s.nodeType&&this._isText&&this._parseText(s,i),s=s.nextSibling;"defs"===n?this._isDefine=!1:"text"===n&&(this._isText=!1)},nl.prototype._parseText=function(t,e){if(1===t.nodeType){var n=t.getAttribute("dx")||0,i=t.getAttribute("dy")||0;this._textX+=parseFloat(n),this._textY+=parseFloat(i)}var r=new og({style:{text:t.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});rl(e,r),ol(t,r,this._defs);var a=r.style.fontSize;a&&9>a&&(r.style.fontSize=9,r.scale=r.scale||[1,1],r.scale[0]*=a/9,r.scale[1]*=a/9);var o=r.getBoundingRect();return this._textX+=o.width,e.add(r),r};var ym={g:function(t,e){var n=new Zf;return rl(e,n),ol(t,n,this._defs),n},rect:function(t,e){var n=new vg;return rl(e,n),ol(t,n,this._defs),n.setShape({x:parseFloat(t.getAttribute("x")||0),y:parseFloat(t.getAttribute("y")||0),width:parseFloat(t.getAttribute("width")||0),height:parseFloat(t.getAttribute("height")||0)}),n},circle:function(t,e){var n=new sg;return rl(e,n),ol(t,n,this._defs),n.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),r:parseFloat(t.getAttribute("r")||0)}),n},line:function(t,e){var n=new mg;return rl(e,n),ol(t,n,this._defs),n.setShape({x1:parseFloat(t.getAttribute("x1")||0),y1:parseFloat(t.getAttribute("y1")||0),x2:parseFloat(t.getAttribute("x2")||0),y2:parseFloat(t.getAttribute("y2")||0)}),n},ellipse:function(t,e){var n=new vm;return rl(e,n),ol(t,n,this._defs),n.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),rx:parseFloat(t.getAttribute("rx")||0),ry:parseFloat(t.getAttribute("ry")||0)}),n},polygon:function(t,e){var n=t.getAttribute("points");n&&(n=al(n));var i=new pg({shape:{points:n||[]}});return rl(e,i),ol(t,i,this._defs),i},polyline:function(t,e){var n=new zr;rl(e,n),ol(t,n,this._defs);var i=t.getAttribute("points");i&&(i=al(i));var r=new gg({shape:{points:i||[]}});return r},image:function(t,e){var n=new vi;return rl(e,n),ol(t,n,this._defs),n.setStyle({image:t.getAttribute("xlink:href"),x:t.getAttribute("x"),y:t.getAttribute("y"),width:t.getAttribute("width"),height:t.getAttribute("height")}),n},text:function(t,e){var n=t.getAttribute("x")||0,i=t.getAttribute("y")||0,r=t.getAttribute("dx")||0,a=t.getAttribute("dy")||0;this._textX=parseFloat(n)+parseFloat(r),this._textY=parseFloat(i)+parseFloat(a);var o=new Zf;return rl(e,o),ol(t,o,this._defs),o},tspan:function(t,e){var n=t.getAttribute("x"),i=t.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=i&&(this._textY=parseFloat(i));var r=t.getAttribute("dx")||0,a=t.getAttribute("dy")||0,o=new Zf;return rl(e,o),ol(t,o,this._defs),this._textX+=r,this._textY+=a,o},path:function(t,e){var n=t.getAttribute("d")||"",i=Wr(n);return rl(e,i),ol(t,i,this._defs),i}},_m={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||0,10),n=parseInt(t.getAttribute("y1")||0,10),i=parseInt(t.getAttribute("x2")||10,10),r=parseInt(t.getAttribute("y2")||0,10),a=new Sg(e,n,i,r);return il(t,a),a},radialgradient:function(){}},xm={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-align":"textAlign","alignment-baseline":"textBaseline"},wm=/url\(\s*#(.*?)\)/,bm=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g,Sm=/([^\s:;]+)\s*:\s*([^:;]+)/g,Mm=F(),Tm={registerMap:function(t,e,n){var i;return x(e)?i=e:e.svg?i=[{type:"svg",source:e.svg,specialAreas:e.specialAreas}]:(e.geoJson&&!e.features&&(n=e.specialAreas,e=e.geoJson),i=[{type:"geoJSON",source:e,specialAreas:n}]),d(i,function(t){var e=t.type;"geoJson"===e&&(e=t.type="geoJSON");var n=Cm[e];n(t)}),Mm.set(t,i)},retrieveMap:function(t){return Mm.get(t)}},Cm={geoJSON:function(t){var e=t.source;t.geoJSON=b(e)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(e):new Function("return ("+e+");")():e},svg:function(t){t.svgXML=el(t.source)}},km=L,Im=d,Dm=w,Am=S,Pm=rv.parseClassType,Om="4.2.0",Lm={zrender:"4.0.5"},Em=1,Rm=1e3,Bm=5e3,zm=1e3,Fm=2e3,Nm=3e3,Vm=4e3,Wm=5e3,Hm={PROCESSOR:{FILTER:Rm,STATISTIC:Bm},VISUAL:{LAYOUT:zm,GLOBAL:Fm,CHART:Nm,COMPONENT:Vm,BRUSH:Wm}},Gm="__flagInMainProcess",qm="__optionUpdated",Xm=/^[a-zA-Z0-9_]+$/;fl.prototype.on=cl("on"),fl.prototype.off=cl("off"),fl.prototype.one=cl("one"),c(fl,uf);var jm=dl.prototype;jm._onframe=function(){if(!this._disposed){var t=this._scheduler;if(this[qm]){var e=this[qm].silent;this[Gm]=!0,gl(this),Um.update.call(this),this[Gm]=!1,this[qm]=!1,_l.call(this,e),xl.call(this,e)}else if(t.unfinished){var n=Em,i=this._model,r=this._api;t.unfinished=!1;do{var a=+new Date;t.performSeriesTasks(i),t.performDataProcessorTasks(i),ml(this,i),t.performVisualTasks(i),Cl(this,this._model,r,"remain"),n-=+new Date-a}while(n>0&&t.unfinished);t.unfinished||this._zr.flush()}}},jm.getDom=function(){return this._dom},jm.getZr=function(){return this._zr},jm.setOption=function(t,e,n){var i;if(Am(e)&&(n=e.lazyUpdate,i=e.silent,e=e.notMerge),this[Gm]=!0,!this._model||e){var r=new $o(this._api),a=this._theme,o=this._model=new xv(null,null,a,r);o.scheduler=this._scheduler,o.init(null,null,a,r)}this._model.setOption(t,Km),n?(this[qm]={silent:i},this[Gm]=!1):(gl(this),Um.update.call(this),this._zr.flush(),this[qm]=!1,this[Gm]=!1,_l.call(this,i),xl.call(this,i))},jm.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},jm.getModel=function(){return this._model},jm.getOption=function(){return this._model&&this._model.getOption()},jm.getWidth=function(){return this._zr.getWidth()},jm.getHeight=function(){return this._zr.getHeight()},jm.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},jm.getRenderedCanvas=function(t){if(Vc.canvasSupported){t=t||{},t.pixelRatio=t.pixelRatio||1,t.backgroundColor=t.backgroundColor||this._model.get("backgroundColor");var e=this._zr;return e.painter.getRenderedCanvas(t)}},jm.getSvgDataUrl=function(){if(Vc.svgSupported){var t=this._zr,e=t.storage.getDisplayList();return d(e,function(t){t.stopAnimation(!0)}),t.painter.pathToDataUrl()}},jm.getDataURL=function(t){t=t||{};var e=t.excludeComponents,n=this._model,i=[],r=this;Im(e,function(t){n.eachComponent({mainType:t},function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)})});var a="svg"===this._zr.painter.getType()?this.getSvgDataUrl():this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return Im(i,function(t){t.group.ignore=!1}),a},jm.getConnectedDataURL=function(t){if(Vc.canvasSupported){var e=this.group,n=Math.min,r=Math.max,a=1/0;if(ry[e]){var o=a,s=a,l=-a,u=-a,h=[],c=t&&t.pixelRatio||1;d(iy,function(a){if(a.group===e){var c=a.getRenderedCanvas(i(t)),f=a.getDom().getBoundingClientRect();o=n(f.left,o),s=n(f.top,s),l=r(f.right,l),u=r(f.bottom,u),h.push({dom:c,left:f.left,top:f.top})}}),o*=c,s*=c,l*=c,u*=c;var f=l-o,p=u-s,g=Qc();g.width=f,g.height=p;var v=Pi(g);return Im(h,function(t){var e=new vi({style:{x:t.left*c-o,y:t.top*c-s,image:t.dom}});v.add(e)}),v.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},jm.convertToPixel=_(pl,"convertToPixel"),jm.convertFromPixel=_(pl,"convertFromPixel"),jm.containPixel=function(t,e){var n,i=this._model;return t=ji(i,t),d(t,function(t,i){i.indexOf("Models")>=0&&d(t,function(t){var r=t.coordinateSystem;if(r&&r.containPoint)n|=!!r.containPoint(e);else if("seriesModels"===i){var a=this._chartsMap[t.__viewId];a&&a.containPoint&&(n|=a.containPoint(e,t))}},this)},this),!!n},jm.getVisual=function(t,e){var n=this._model;t=ji(n,t,{defaultMainType:"series"});var i=t.seriesModel,r=i.getData(),a=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?r.indexOfRawIndex(t.dataIndex):null;return null!=a?r.getItemVisual(a,e):r.getVisual(e)},jm.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},jm.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var Um={prepareAndUpdate:function(t){gl(this),Um.update.call(this,t)},update:function(t){var e=this._model,n=this._api,i=this._zr,r=this._coordSysMgr,a=this._scheduler;if(e){a.restoreData(e,t),a.performSeriesTasks(e),r.create(e,n),a.performDataProcessorTasks(e,t),ml(this,e),r.update(e,n),Sl(e),a.performVisualTasks(e,t),Ml(this,e,n,t);var o=e.get("backgroundColor")||"transparent";if(Vc.canvasSupported)i.setBackgroundColor(o);else{var s=He(o);o=Qe(s,"rgb"),0===s[3]&&(o="transparent")}kl(e,n)}},updateTransform:function(t){var e=this._model,n=this,i=this._api;if(e){var r=[];e.eachComponent(function(a,o){var s=n.getViewOfComponentModel(o);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(o,e,i,t);l&&l.update&&r.push(s)}else r.push(s)});var a=F();e.eachSeries(function(r){var o=n._chartsMap[r.__viewId];if(o.updateTransform){var s=o.updateTransform(r,e,i,t);s&&s.update&&a.set(r.uid,1)}else a.set(r.uid,1)}),Sl(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0,dirtyMap:a}),Cl(n,e,i,t,a),kl(e,this._api)}},updateView:function(t){var e=this._model;e&&(Es.markUpdateMethod(t,"updateView"),Sl(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0}),Ml(this,this._model,this._api,t),kl(e,this._api))},updateVisual:function(t){Um.update.call(this,t)},updateLayout:function(t){Um.update.call(this,t)}};jm.resize=function(t){this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[Gm]=!0,n&&gl(this),Um.update.call(this),this[Gm]=!1,_l.call(this,i),xl.call(this,i)}},jm.showLoading=function(t,e){if(Am(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),ny[t]){var n=ny[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},jm.hideLoading=function(){this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},jm.makeActionFromEvent=function(t){var e=o({},t);return e.type=$m[t.type],e},jm.dispatchAction=function(t,e){if(Am(e)||(e={silent:!!e}),Zm[t.type]&&this._model){if(this[Gm])return void this._pendingActions.push(t);yl.call(this,t,e.silent),e.flush?this._zr.flush(!0):e.flush!==!1&&Vc.browser.weChat&&this._throttledZrFlush(),_l.call(this,e.silent),xl.call(this,e.silent)}},jm.appendData=function(t){var e=t.seriesIndex,n=this.getModel(),i=n.getSeriesByIndex(e);i.appendData(t),this._scheduler.unfinished=!0},jm.on=cl("on"),jm.off=cl("off"),jm.one=cl("one");var Ym=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];jm._initEvents=function(){Im(Ym,function(t){this._zr.on(t,function(e){var n,i=this.getModel(),r=e.target,a="globalout"===t;if(a)n={};else if(r&&null!=r.dataIndex){var s=r.dataModel||i.getSeriesByIndex(r.seriesIndex);n=s&&s.getDataParams(r.dataIndex,r.dataType,r)||{}}else r&&r.eventData&&(n=o({},r.eventData));if(n){var l=n.componentType,u=n.componentIndex;("markLine"===l||"markPoint"===l||"markArea"===l)&&(l="series",u=n.seriesIndex);var h=l&&null!=u&&i.getComponent(l,u),c=h&&this["series"===h.mainType?"_chartsMap":"_componentsMap"][h.__viewId];n.event=e,n.type=t,this._ecEventProcessor.eventInfo={targetEl:r,packedEvent:n,model:h,view:c},this.trigger(t,n)}},this)},this),Im($m,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},jm.isDisposed=function(){return this._disposed},jm.clear=function(){this.setOption({series:[]},!0)},jm.dispose=function(){if(!this._disposed){this._disposed=!0,Yi(this.getDom(),sy,"");var t=this._api,e=this._model;Im(this._componentsViews,function(n){n.dispose(e,t)}),Im(this._chartsViews,function(n){n.dispose(e,t)}),this._zr.dispose(),delete iy[this.id]}},c(dl,uf),Ol.prototype={constructor:Ol,normalizeQuery:function(t){var e={},n={},i={};if(b(t)){var r=Pm(t);e.mainType=r.main||null,e.subType=r.sub||null}else{var a=["Index","Name","Id"],o={name:1,dataIndex:1,dataType:1};d(t,function(t,r){for(var s=!1,l=0;l0&&h===r.length-u.length){var c=r.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}o.hasOwnProperty(r)&&(n[r]=t,s=!0),s||(i[r]=t)})}return{cptQuery:e,dataQuery:n,otherQuery:i}},filter:function(t,e){function n(t,e,n,i){return null==t[n]||e[i||n]===t[n]}var i=this.eventInfo;if(!i)return!0;var r=i.targetEl,a=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return n(l,o,"mainType")&&n(l,o,"subType")&&n(l,o,"index","componentIndex")&&n(l,o,"name")&&n(l,o,"id")&&n(u,a,"name")&&n(u,a,"dataIndex")&&n(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,r,a))},afterTrigger:function(){this.eventInfo=null}};var Zm={},$m={},Qm=[],Km=[],Jm=[],ty=[],ey={},ny={},iy={},ry={},ay=new Date-0,oy=new Date-0,sy="_echarts_instance_",ly=Bl;Yl(Fm,Jv),Wl(Ev),Hl(Bm,Rv),$l("default",im),ql({type:"highlight",event:"highlight",update:"highlight"},V),ql({type:"downplay",event:"downplay",update:"downplay"},V),Vl("light",cm),Vl("dark",gm);var uy={};au.prototype={constructor:au,add:function(t){return this._add=t,this},update:function(t){return this._update=t,this},remove:function(t){return this._remove=t,this},execute:function(){var t,e=this._old,n=this._new,i={},r={},a=[],o=[];for(ou(e,i,a,"_oldKeyGetter",this),ou(n,r,o,"_newKeyGetter",this),t=0;th;h++)this._add&&this._add(l[h]);else this._add&&this._add(l)}}}};var hy=F(["tooltip","label","itemName","itemId","seriesName"]),cy=S,fy="undefined",dy="e\x00\x00",py={"float":typeof Float64Array===fy?Array:Float64Array,"int":typeof Int32Array===fy?Array:Int32Array,ordinal:Array,number:Array,time:Array},gy=typeof Uint32Array===fy?Array:Uint32Array,vy=typeof Uint16Array===fy?Array:Uint16Array,my=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],yy=["_extent","_approximateExtent","_rawExtent"],_y=function(t,e){t=t||["x","y"];for(var n={},i=[],r={},a=0;a=e)){for(var n,i=this._chunkSize,r=this._rawData,a=this._storage,o=this.dimensions,s=o.length,l=this._dimensionInfos,u=this._nameList,h=this._idList,c=this._rawExtent,f=this._nameRepeatCount={},d=this._chunkCount,p=d-1,g=0;s>g;g++){var v=o[g];c[v]||(c[v]=wu());var m=l[v];0===m.otherDims.itemName&&(n=this._nameDimIdx=g),0===m.otherDims.itemId&&(this._idDimIdx=g);var y=py[m.type];a[v]||(a[v]=[]);var _=a[v][p];if(_&&_.lengthb;b+=i)a[v].push(new y(Math.min(e-b,i)));this._chunkCount=a[v].length}for(var S=new Array(s),M=t;e>M;M++){S=r.getItem(M,S);for(var T=Math.floor(M/i),C=M%i,b=0;s>b;b++){var v=o[b],k=a[v][T],I=this._dimValueGetter(S,v,M,b);k[C]=I;var D=c[v];ID[1]&&(D[1]=I)}if(!r.pure){var A=u[M];if(S&&null==A)if(null!=S.name)u[M]=A=S.name;else if(null!=n){var P=o[n],O=a[P][T];if(O){A=O[C];var L=l[P].ordinalMeta;L&&L.categories.length&&(A=L.categories[A])}}var E=null==S?null:S.id;null==E&&null!=A&&(f[A]=f[A]||0,E=A,f[A]>0&&(E+="__ec__"+f[A]),f[A]++),null!=E&&(h[M]=E)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=e,this._extent={},du(this)}},xy.count=function(){return this._count},xy.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,i=this._count;if(n===Array){t=new n(i);for(var r=0;i>r;r++)t[r]=e[r]}else t=new n(e.buffer,0,i)}else for(var n=hu(this),t=new n(this.count()),r=0;r=0&&e=0&&ei;i++)n.push(this.get(t[i],e));return n},xy.hasValue=function(t){for(var e=this._dimensionsSummary.dataDimsOnCoord,n=this._dimensionInfos,i=0,r=e.length;r>i;i++)if("ordinal"!==n[e[i]].type&&isNaN(this.get(e[i],t)))return!1;return!0},xy.getDataExtent=function(t){t=this.getDimension(t);var e=this._storage[t],n=wu();if(!e)return n;var i,r=this.count(),a=!this._indices;if(a)return this._rawExtent[t].slice();if(i=this._extent[t])return i.slice();i=n;for(var o=i[0],s=i[1],l=0;r>l;l++){var u=this._getFast(t,this.getRawIndex(l));o>u&&(o=u),u>s&&(s=u)}return i=[o,s],this._extent[t]=i,i},xy.getApproximateExtent=function(t){return t=this.getDimension(t),this._approximateExtent[t]||this.getDataExtent(t)},xy.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},xy.getCalculationInfo=function(t){return this._calculationInfo[t]},xy.setCalculationInfo=function(t,e){cy(t)?o(this._calculationInfo,t):this._calculationInfo[t]=e},xy.getSum=function(t){var e=this._storage[t],n=0;if(e)for(var i=0,r=this.count();r>i;i++){var a=this.get(t,i);isNaN(a)||(n+=a)}return n},xy.getMedian=function(t){var e=[];this.each(t,function(t){isNaN(t)||e.push(t)});var n=[].concat(e).sort(function(t,e){return t-e}),i=this.count();return 0===i?0:i%2===1?n[(i-1)/2]:(n[i/2]+n[i/2-1])/2},xy.rawIndexOf=function(t,e){var n=t&&this._invertedIndicesMap[t],i=n[e];return null==i||isNaN(i)?-1:i},xy.indexOfName=function(t){for(var e=0,n=this.count();n>e;e++)if(this.getName(e)===t)return e;return-1},xy.indexOfRawIndex=function(t){if(!this._indices)return t;if(t>=this._rawCount||0>t)return-1;var e=this._indices,n=e[t];if(null!=n&&n=i;){var a=(i+r)/2|0;if(e[a]t))return a;r=a-1}}return-1},xy.indicesOfNearest=function(t,e,n){var i=this._storage,r=i[t],a=[];if(!r)return a;null==n&&(n=1/0);for(var o=Number.MAX_VALUE,s=-1,l=0,u=this.count();u>l;l++){var h=e-this.get(t,l),c=Math.abs(h);n>=h&&o>=c&&((o>c||h>=0&&0>s)&&(o=c,s=h,a.length=0),a.push(l))}return a},xy.getRawIndex=gu,xy.getRawDataItem=function(t){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(t));for(var e=[],n=0;no;o++)s[o]=this.get(t[o],a);s[o]=a,e.apply(n,s)}}},xy.filterSelf=function(t,e,n,i){if(this._count){"function"==typeof t&&(i=n,n=e,e=t,t=[]),n=n||i||this,t=p(yu(t),this.getDimension,this);for(var r=this.count(),a=hu(this),o=new a(r),s=[],l=t.length,u=0,h=t[0],c=0;r>c;c++){var f,d=this.getRawIndex(c);if(0===l)f=e.call(n,c);else if(1===l){var g=this._getFast(h,d);f=e.call(n,g,c)}else{for(var v=0;l>v;v++)s[v]=this._getFast(h,d);s[v]=c,f=e.apply(n,s)}f&&(o[u++]=d)}return r>u&&(this._indices=o),this._count=u,this._extent={},this.getRawIndex=this._indices?vu:gu,this}},xy.selectRange=function(t){if(this._count){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);var i=e.length;if(i){var r=this.count(),a=hu(this),o=new a(r),s=0,l=e[0],u=t[l][0],h=t[l][1],c=!1;if(!this._indices){var f=0;if(1===i){for(var d=this._storage[e[0]],p=0;pm;m++){var y=g[m];(y>=u&&h>=y||isNaN(y))&&(o[s++]=f),f++}c=!0}else if(2===i){for(var d=this._storage[l],_=this._storage[e[1]],x=t[e[1]][0],w=t[e[1]][1],p=0;pm;m++){var y=g[m],S=b[m];(y>=u&&h>=y||isNaN(y))&&(S>=x&&w>=S||isNaN(S))&&(o[s++]=f),f++}c=!0}}if(!c)if(1===i)for(var m=0;r>m;m++){var M=this.getRawIndex(m),y=this._getFast(l,M);(y>=u&&h>=y||isNaN(y))&&(o[s++]=M)}else for(var m=0;r>m;m++){for(var T=!0,M=this.getRawIndex(m),p=0;i>p;p++){var C=e[p],y=this._getFast(n,M);(yt[C][1])&&(T=!1)}T&&(o[s++]=this.getRawIndex(m))}return r>s&&(this._indices=o),this._count=s,this._extent={},this.getRawIndex=this._indices?vu:gu,this}}},xy.mapArray=function(t,e,n,i){"function"==typeof t&&(i=n,n=e,e=t,t=[]),n=n||i||this;var r=[];return this.each(t,function(){r.push(e&&e.apply(this,arguments))},n),r},xy.map=function(t,e,n,i){n=n||i||this,t=p(yu(t),this.getDimension,this);var r=_u(this,t);r._indices=this._indices,r.getRawIndex=r._indices?vu:gu;for(var a=r._storage,o=[],s=this._chunkSize,l=t.length,u=this.count(),h=[],c=r._rawExtent,f=0;u>f;f++){for(var d=0;l>d;d++)h[d]=this.get(t[d],f);h[l]=f;var g=e&&e.apply(n,h);if(null!=g){"object"!=typeof g&&(o[0]=g,g=o);for(var v=this.getRawIndex(f),m=Math.floor(v/s),y=v%s,_=0;_b[1]&&(b[1]=w)}}}return r},xy.downSample=function(t,e,n,i){for(var r=_u(this,[t]),a=r._storage,o=[],s=Math.floor(1/e),l=a[t],u=this.count(),h=this._chunkSize,c=r._rawExtent[t],f=new(hu(this))(u),d=0,p=0;u>p;p+=s){s>u-p&&(s=u-p,o.length=s);for(var g=0;s>g;g++){var v=this.getRawIndex(p+g),m=Math.floor(v/h),y=v%h;o[g]=l[m][y]}var _=n(o),x=this.getRawIndex(Math.min(p+i(o,_)||0,u-1)),w=Math.floor(x/h),b=x%h;l[w][b]=_,_c[1]&&(c[1]=_),f[d++]=x}return r._count=d,r._indices=f,r.getRawIndex=vu,r},xy.getItemModel=function(t){var e=this.hostModel;return new Na(this.getRawDataItem(t),e,e&&e.ecModel)},xy.diff=function(t){var e=this;return new au(t?t.getIndices():[],this.getIndices(),function(e){return mu(t,e)},function(t){return mu(e,t)})},xy.getVisual=function(t){var e=this._visual;return e&&e[t]},xy.setVisual=function(t,e){if(cy(t))for(var n in t)t.hasOwnProperty(n)&&this.setVisual(n,t[n]);else this._visual=this._visual||{},this._visual[t]=e},xy.setLayout=function(t,e){if(cy(t))for(var n in t)t.hasOwnProperty(n)&&this.setLayout(n,t[n]);else this._layout[t]=e},xy.getLayout=function(t){return this._layout[t]},xy.getItemLayout=function(t){return this._itemLayouts[t]},xy.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?o(this._itemLayouts[t]||{},e):e},xy.clearItemLayouts=function(){this._itemLayouts.length=0},xy.getItemVisual=function(t,e,n){var i=this._itemVisuals[t],r=i&&i[e];return null!=r||n?r:this.getVisual(e)},xy.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{},r=this.hasItemVisual;if(this._itemVisuals[t]=i,cy(e))for(var a in e)e.hasOwnProperty(a)&&(i[a]=e[a],r[a]=!0);else i[e]=n,r[e]=!0},xy.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var wy=function(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType};xy.setItemGraphicEl=function(t,e){var n=this.hostModel;e&&(e.dataIndex=t,e.dataType=this.dataType,e.seriesIndex=n&&n.seriesIndex,"group"===e.type&&e.traverse(wy,e)),this._graphicEls[t]=e},xy.getItemGraphicEl=function(t){return this._graphicEls[t]},xy.eachItemGraphicEl=function(t,e){d(this._graphicEls,function(n,i){n&&t&&t.call(e,n,i)})},xy.cloneShallow=function(t){if(!t){var e=p(this.dimensions,this.getDimensionInfo,this);t=new _y(e,this.hostModel)}if(t._storage=this._storage,fu(t,this),this._indices){var n=this._indices.constructor;t._indices=new n(this._indices)}else t._indices=null;return t.getRawIndex=t._indices?vu:gu,t},xy.wrapMethod=function(t,e){var n=this[t];"function"==typeof n&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(P(arguments)))})},xy.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],xy.CHANGABLE_METHODS=["filterSelf","selectRange"];var by=function(t,e){return e=e||{},bu(e.coordDimensions||[],t,{dimsDef:e.dimensionsDefine||t.dimensionsDefine,encodeDef:e.encodeDefine||t.encodeDefine,dimCount:e.dimensionsCount,generateCoord:e.generateCoord,generateCoordCount:e.generateCoordCount})};Pu.prototype.parse=function(t){return t},Pu.prototype.getSetting=function(t){return this._setting[t]},Pu.prototype.contain=function(t){var e=this._extent;return t>=e[0]&&t<=e[1]},Pu.prototype.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},Pu.prototype.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},Pu.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},Pu.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},Pu.prototype.getExtent=function(){return this._extent.slice()},Pu.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},Pu.prototype.isBlank=function(){return this._isBlank},Pu.prototype.setBlank=function(t){this._isBlank=t},Pu.prototype.getLabel=null,Ji(Pu),ir(Pu,{registerWhenExtend:!0}),Ou.createByAxisModel=function(t){var e=t.option,n=e.data,i=n&&p(n,Eu);return new Ou({categories:i,needCollect:!i,deduplication:e.dedplication!==!1})};var Sy=Ou.prototype;Sy.getOrdinal=function(t){return Lu(this).get(t)},Sy.parseAndCollect=function(t){var e,n=this._needCollect;if("string"!=typeof t&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=Lu(this);return e=i.get(t),null==e&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=0/0),e};var My=Pu.prototype,Ty=Pu.extend({type:"ordinal",init:function(t,e){(!t||x(t))&&(t=new Ou({categories:t})),this._ordinalMeta=t,this._extent=e||[0,t.categories.length-1]},parse:function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},contain:function(t){return t=this.parse(t),My.contain.call(this,t)&&null!=this._ordinalMeta.categories[t]},normalize:function(t){return My.normalize.call(this,this.parse(t))},scale:function(t){return Math.round(My.scale.call(this,t))},getTicks:function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push(n),n++;return t},getLabel:function(t){return this.isBlank()?void 0:this._ordinalMeta.categories[t]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:V,niceExtent:V});Ty.create=function(){return new Ty};var Cy=Ya,ky=Ya,Iy=Pu.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},unionExtent:function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),Iy.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Bu(t)},getTicks:function(){return Nu(this._interval,this._extent,this._niceExtent,this._intervalPrecision)},getLabel:function(t,e){if(null==t)return"";var n=e&&e.precision;return null==n?n=Qa(t)||0:"auto"===n&&(n=this._intervalPrecision),t=ky(t,n,!0),uo(t)},niceTicks:function(t,e,n){t=t||5;var i=this._extent,r=i[1]-i[0];if(isFinite(r)){0>r&&(r=-r,i.reverse());var a=Ru(i,t,e,n);this._intervalPrecision=a.intervalPrecision,this._interval=a.interval,this._niceExtent=a.niceTickExtent}},niceExtent:function(t){var e=this._extent;if(e[0]===e[1])if(0!==e[0]){var n=e[0];t.fixMax?e[0]-=n/2:(e[1]+=n/2,e[0]-=n/2)}else e[1]=1;var i=e[1]-e[0];isFinite(i)||(e[0]=0,e[1]=1),this.niceTicks(t.splitNumber,t.minInterval,t.maxInterval);var r=this._interval;t.fixMin||(e[0]=ky(Math.floor(e[0]/r)*r)),t.fixMax||(e[1]=ky(Math.ceil(e[1]/r)*r))}});Iy.create=function(){return new Iy};var Dy="__ec_stack_",Ay=.5,Py="undefined"!=typeof Float32Array?Float32Array:Array,Oy=({seriesType:"bar",plan:Yv(),reset:function(t){function e(t,e){for(var n,c=new Py(2*t.count),f=[],d=[],p=0;null!=(n=t.next());)d[u]=e.get(o,n),d[1-u]=e.get(s,n),f=i.dataToPoint(d,null,f),c[p++]=f[0],c[p++]=f[1]; +e.setLayout({largePoints:c,barWidth:h,valueAxisStart:Yu(r,a,!1),valueAxisHorizontal:l})}if(ju(t)&&Uu(t)){var n=t.getData(),i=t.coordinateSystem,r=i.getBaseAxis(),a=i.getOtherAxis(r),o=n.mapDimension(a.dim),s=n.mapDimension(r.dim),l=a.isHorizontal(),u=l?0:1,h=Xu(Gu([t]),r,t).width;return h>Ay||(h=Ay),{progress:e}}}},Iy.prototype),Ly=Math.ceil,Ey=Math.floor,Ry=1e3,By=60*Ry,zy=60*By,Fy=24*zy,Ny=function(t,e,n,i){for(;i>n;){var r=n+i>>>1;t[r][1]a&&(a=e),null!=n&&a>n&&(a=n);var o=Wy.length,s=Ny(Wy,a,0,o),l=Wy[Math.min(s,o-1)],u=l[1];if("year"===l[0]){var h=r/u,c=ao(h/t,!0);u*=c}var f=this.getSetting("useUTC")?0:60*new Date(+i[0]||+i[1]).getTimezoneOffset()*1e3,d=[Math.round(Ly((i[0]-f)/u)*u+f),Math.round(Ey((i[1]-f)/u)*u+f)];Fu(d,i),this._stepLvl=l,this._interval=u,this._niceExtent=d},parse:function(t){return+no(t)}});d(["contain","normalize"],function(t){Vy.prototype[t]=function(e){return Oy[t].call(this,this.parse(e))}});var Wy=[["hh:mm:ss",Ry],["hh:mm:ss",5*Ry],["hh:mm:ss",10*Ry],["hh:mm:ss",15*Ry],["hh:mm:ss",30*Ry],["hh:mm\nMM-dd",By],["hh:mm\nMM-dd",5*By],["hh:mm\nMM-dd",10*By],["hh:mm\nMM-dd",15*By],["hh:mm\nMM-dd",30*By],["hh:mm\nMM-dd",zy],["hh:mm\nMM-dd",2*zy],["hh:mm\nMM-dd",6*zy],["hh:mm\nMM-dd",12*zy],["MM-dd\nyyyy",Fy],["MM-dd\nyyyy",2*Fy],["MM-dd\nyyyy",3*Fy],["MM-dd\nyyyy",4*Fy],["MM-dd\nyyyy",5*Fy],["MM-dd\nyyyy",6*Fy],["week",7*Fy],["MM-dd\nyyyy",10*Fy],["week",14*Fy],["week",21*Fy],["month",31*Fy],["week",42*Fy],["month",62*Fy],["week",70*Fy],["quarter",95*Fy],["month",31*Fy*4],["month",31*Fy*5],["half-year",380*Fy/2],["month",31*Fy*8],["month",31*Fy*10],["year",380*Fy]];Vy.create=function(t){return new Vy({useUTC:t.ecModel.get("useUTC")})};var Hy=Pu.prototype,Gy=Iy.prototype,qy=Qa,Xy=Ya,jy=Math.floor,Uy=Math.ceil,Yy=Math.pow,Zy=Math.log,$y=Pu.extend({type:"log",base:10,$constructor:function(){Pu.apply(this,arguments),this._originalScale=new Iy},getTicks:function(){var t=this._originalScale,e=this._extent,n=t.getExtent();return p(Gy.getTicks.call(this),function(i){var r=Ya(Yy(this.base,i));return r=i===e[0]&&t.__fixMin?Zu(r,n[0]):r,r=i===e[1]&&t.__fixMax?Zu(r,n[1]):r},this)},getLabel:Gy.getLabel,scale:function(t){return t=Hy.scale.call(this,t),Yy(this.base,t)},setExtent:function(t,e){var n=this.base;t=Zy(t)/Zy(n),e=Zy(e)/Zy(n),Gy.setExtent.call(this,t,e)},getExtent:function(){var t=this.base,e=Hy.getExtent.call(this);e[0]=Yy(t,e[0]),e[1]=Yy(t,e[1]);var n=this._originalScale,i=n.getExtent();return n.__fixMin&&(e[0]=Zu(e[0],i[0])),n.__fixMax&&(e[1]=Zu(e[1],i[1])),e},unionExtent:function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=Zy(t[0])/Zy(e),t[1]=Zy(t[1])/Zy(e),Hy.unionExtent.call(this,t)},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},niceTicks:function(t){t=t||10;var e=this._extent,n=e[1]-e[0];if(!(1/0===n||0>=n)){var i=io(n),r=t/n*i;for(.5>=r&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var a=[Ya(Uy(e[0]/i)*i),Ya(jy(e[1]/i)*i)];this._interval=i,this._niceExtent=a}},niceExtent:function(t){Gy.niceExtent.call(this,t);var e=this._originalScale;e.__fixMin=t.fixMin,e.__fixMax=t.fixMax}});d(["contain","normalize"],function(t){$y.prototype[t]=function(e){return e=Zy(e)/Zy(this.base),Hy[t].call(this,e)}}),$y.create=function(){return new $y};var Qy={getMin:function(t){var e=this.option,n=t||null==e.rangeStart?e.min:e.rangeStart;return this.axis&&null!=n&&"dataMin"!==n&&"function"!=typeof n&&!k(n)&&(n=this.axis.scale.parse(n)),n},getMax:function(t){var e=this.option,n=t||null==e.rangeEnd?e.max:e.rangeEnd;return this.axis&&null!=n&&"dataMax"!==n&&"function"!=typeof n&&!k(n)&&(n=this.axis.scale.parse(n)),n},getNeedCrossZero:function(){var t=this.option;return null!=t.rangeStart||null!=t.rangeEnd?!1:!t.scale},getCoordSysModel:V,setRange:function(t,e){this.option.rangeStart=t,this.option.rangeEnd=e},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},Ky=Yr({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,i=e.cy,r=e.width/2,a=e.height/2;t.moveTo(n,i-a),t.lineTo(n+r,i+a),t.lineTo(n-r,i+a),t.closePath()}}),Jy=Yr({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,i=e.cy,r=e.width/2,a=e.height/2;t.moveTo(n,i-a),t.lineTo(n+r,i),t.lineTo(n,i+a),t.lineTo(n-r,i),t.closePath()}}),t_=Yr({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.x,i=e.y,r=e.width/5*3,a=Math.max(r,e.height),o=r/2,s=o*o/(a-o),l=i-a+o+s,u=Math.asin(s/o),h=Math.cos(u)*o,c=Math.sin(u),f=Math.cos(u),d=.6*o,p=.7*o;t.moveTo(n-h,l+s),t.arc(n,l,o,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(n+h-c*d,l+s+f*d,n,i-p,n,i),t.bezierCurveTo(n,i-p,n-h+c*d,l+s+f*d,n-h,l+s),t.closePath()}}),e_=Yr({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.height,i=e.width,r=e.x,a=e.y,o=i/3*2;t.moveTo(r,a),t.lineTo(r+o,a+n),t.lineTo(r,a+n/4*3),t.lineTo(r-o,a+n),t.lineTo(r,a),t.closePath()}}),n_={line:mg,rect:vg,roundRect:vg,square:vg,circle:sg,diamond:Jy,pin:t_,arrow:e_,triangle:Ky},i_={line:function(t,e,n,i,r){r.x1=t,r.y1=e+i/2,r.x2=t+n,r.y2=e+i/2},rect:function(t,e,n,i,r){r.x=t,r.y=e,r.width=n,r.height=i},roundRect:function(t,e,n,i,r){r.x=t,r.y=e,r.width=n,r.height=i,r.r=Math.min(n,i)/4},square:function(t,e,n,i,r){var a=Math.min(n,i);r.x=t,r.y=e,r.width=a,r.height=a},circle:function(t,e,n,i,r){r.cx=t+n/2,r.cy=e+i/2,r.r=Math.min(n,i)/2},diamond:function(t,e,n,i,r){r.cx=t+n/2,r.cy=e+i/2,r.width=n,r.height=i},pin:function(t,e,n,i,r){r.x=t+n/2,r.y=e+i/2,r.width=n,r.height=i},arrow:function(t,e,n,i,r){r.x=t+n/2,r.y=e+i/2,r.width=n,r.height=i},triangle:function(t,e,n,i,r){r.cx=t+n/2,r.cy=e+i/2,r.width=n,r.height=i}},r_={};d(n_,function(t,e){r_[e]=new t});var a_=Yr({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},beforeBrush:function(){var t=this.style,e=this.shape;"pin"===e.symbolType&&"inside"===t.textPosition&&(t.textPosition=["50%","40%"],t.textAlign="center",t.textVerticalAlign="middle")},buildPath:function(t,e,n){var i=e.symbolType,r=r_[i];"none"!==e.symbolType&&(r||(i="rect",r=r_[i]),i_[i](e.x,e.y,e.width,e.height,r.shape),r.buildPath(t,r.shape,n))}}),o_={isDimensionStacked:Cu,enableDataStack:Tu,getStackedDimension:ku},s_=(Object.freeze||Object)({createList:sh,getLayoutRect:xo,dataStack:o_,createScale:lh,mixinAxisModelCommonMethods:uh,completeDimensions:bu,createDimensions:by,createSymbol:oh}),l_=1e-8;fh.prototype={constructor:fh,properties:null,getBoundingRect:function(){var t=this._rect;if(t)return t;for(var e=Number.MAX_VALUE,n=[e,e],i=[-e,-e],r=[],a=[],o=this.geometries,s=0;si;i++)if("polygon"===n[i].type){var a=n[i].exterior,o=n[i].interiors;if(ch(a,t[0],t[1])){for(var s=0;s<(o?o.length:0);s++)if(ch(o[s]))continue t;return!0}}return!1},transformTo:function(t,e,n,i){var r=this.getBoundingRect(),a=r.width/r.height;n?i||(i=n/a):n=a*i;for(var o=new gn(t,e,n,i),s=r.calculateTransform(o),l=this.geometries,u=0;u0}),function(t){var e=t.properties,n=t.geometry,i=n.coordinates,r=[];"Polygon"===n.type&&r.push({type:"polygon",exterior:i[0],interiors:i.slice(1)}),"MultiPolygon"===n.type&&d(i,function(t){t[0]&&r.push({type:"polygon",exterior:t[0],interiors:t.slice(1)})});var a=new fh(e.name,r,e.cp);return a.properties=e,a})},h_=Xi(),c_=[0,1],f_=function(t,e,n){this.dim=t,this.scale=e,this._extent=n||[0,0],this.inverse=!1,this.onBand=!1};f_.prototype={constructor:f_,contain:function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&i>=t},containData:function(t){return this.contain(this.dataToCoord(t))},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(t){return Ka(t||this.scale.getExtent(),this._extent)},setExtent:function(t,e){var n=this._extent;n[0]=t,n[1]=e},dataToCoord:function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&(n=n.slice(),Ah(n,i.count())),ja(t,c_,n,e)},coordToData:function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&(n=n.slice(),Ah(n,i.count()));var r=ja(t,n,c_,e);return this.scale.scale(r)},pointToData:function(){},getTicksCoords:function(t){t=t||{};var e=t.tickModel||this.getTickModel(),n=vh(this,e),i=n.ticks,r=p(i,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this),a=e.get("alignWithLabel");return Ph(this,r,n.tickCategoryInterval,a,t.clamp),r},getViewLabels:function(){return gh(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return Th(this)}};var d_=u_,p_={};d(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],function(t){p_[t]=tf[t]});var g_={};d(["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","setHoverStyle","setLabelStyle","setTextStyle","setText","getFont","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","Group","Image","Text","Circle","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],function(t){g_[t]=Lg[t]}),Xv.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(){return Iu(this.getSource(),this)},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clipOverflow:!0,label:{position:"top"},lineStyle:{width:2,type:"solid"},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0}});var v_=Lh.prototype,m_=Lh.getSymbolSize=function(t,e){var n=t.getItemVisual(e,"symbolSize");return n instanceof Array?n.slice():[+n,+n]};v_._createSymbol=function(t,e,n,i,r){this.removeAll();var a=e.getItemVisual(n,"color"),o=oh(t,-1,-1,2,2,a,r);o.attr({z2:100,culling:!0,scale:Eh(i)}),o.drift=Rh,this._symbolType=t,this.add(o)},v_.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(t)},v_.getSymbolPath=function(){return this.childAt(0)},v_.getScale=function(){return this.childAt(0).scale},v_.highlight=function(){this.childAt(0).trigger("emphasis")},v_.downplay=function(){this.childAt(0).trigger("normal")},v_.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},v_.setDraggable=function(t){var e=this.childAt(0);e.draggable=t,e.cursor=t?"move":"pointer"},v_.updateData=function(t,e,n){this.silent=!1;var i=t.getItemVisual(e,"symbol")||"circle",r=t.hostModel,a=m_(t,e),o=i!==this._symbolType;if(o){var s=t.getItemVisual(e,"symbolKeepAspect");this._createSymbol(i,t,e,a,s)}else{var l=this.childAt(0);l.silent=!1,Aa(l,{scale:Eh(a)},r,e)}if(this._updateCommon(t,e,a,n),o){var l=this.childAt(0),u=n&&n.fadeIn,h={scale:l.scale.slice()};u&&(h.style={opacity:l.style.opacity}),l.scale=[0,0],u&&(l.style.opacity=0),Pa(l,h,r,e)}this._seriesModel=r};var y_=["itemStyle"],__=["emphasis","itemStyle"],x_=["label"],w_=["emphasis","label"];v_._updateCommon=function(t,e,n,i){function r(e){return b?t.getName(e):Oh(t,e)}var a=this.childAt(0),s=t.hostModel,l=t.getItemVisual(e,"color");"image"!==a.type&&a.useStyle({strokeNoScale:!0});var u=i&&i.itemStyle,h=i&&i.hoverItemStyle,c=i&&i.symbolRotate,f=i&&i.symbolOffset,d=i&&i.labelModel,p=i&&i.hoverLabelModel,g=i&&i.hoverAnimation,v=i&&i.cursorStyle;if(!i||t.hasItemOption){var m=i&&i.itemModel?i.itemModel:t.getItemModel(e);u=m.getModel(y_).getItemStyle(["color"]),h=m.getModel(__).getItemStyle(),c=m.getShallow("symbolRotate"),f=m.getShallow("symbolOffset"),d=m.getModel(x_),p=m.getModel(w_),g=m.getShallow("hoverAnimation"),v=m.getShallow("cursor")}else h=o({},h);var y=a.style;a.attr("rotation",(c||0)*Math.PI/180||0),f&&a.attr("position",[Ua(f[0],n[0]),Ua(f[1],n[1])]),v&&a.attr("cursor",v),a.setColor(l,i&&i.symbolInnerColor),a.setStyle(u);var _=t.getItemVisual(e,"opacity");null!=_&&(y.opacity=_);var x=t.getItemVisual(e,"liftZ"),w=a.__z2Origin;null!=x?null==w&&(a.__z2Origin=a.z2,a.z2+=x):null!=w&&(a.z2=w,a.__z2Origin=null);var b=i&&i.useNameLabel;_a(y,h,d,p,{labelFetcher:s,labelDataIndex:e,defaultText:r,isRectText:!0,autoColor:l}),a.off("mouseover").off("mouseout").off("emphasis").off("normal"),a.hoverStyle=h,ma(a),a.__symbolOriginalScale=Eh(n),g&&s.isAnimationEnabled()&&a.on("mouseover",Bh).on("mouseout",zh).on("emphasis",Fh).on("normal",Nh)},v_.fadeOut=function(t,e){var n=this.childAt(0);this.silent=n.silent=!0,!(e&&e.keepLabel)&&(n.style.text=null),Aa(n,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,t)},h(Lh,Zf);var b_=Vh.prototype;b_.updateData=function(t,e){e=Hh(e);var n=this.group,i=t.hostModel,r=this._data,a=this._symbolCtor,o=Gh(t);r||n.removeAll(),t.diff(r).add(function(i){var r=t.getItemLayout(i);if(Wh(t,r,i,e)){var s=new a(t,i,o);s.attr("position",r),t.setItemGraphicEl(i,s),n.add(s)}}).update(function(s,l){var u=r.getItemGraphicEl(l),h=t.getItemLayout(s);return Wh(t,h,s,e)?(u?(u.updateData(t,s,o),Aa(u,{position:h},i)):(u=new a(t,s),u.attr("position",h)),n.add(u),void t.setItemGraphicEl(s,u)):void n.remove(u)}).remove(function(t){var e=r.getItemGraphicEl(t);e&&e.fadeOut(function(){n.remove(e)})}).execute(),this._data=t},b_.isPersistent=function(){return!0},b_.updateLayout=function(){var t=this._data;t&&t.eachItemGraphicEl(function(e,n){var i=t.getItemLayout(n);e.attr("position",i)})},b_.incrementalPrepareUpdate=function(t){this._seriesScope=Gh(t),this._data=null,this.group.removeAll()},b_.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=t.useHoverLayer=!0)}n=Hh(n);for(var r=t.start;r0&&Yh(n[r-1]);r--);for(;r>i&&Yh(n[i]);i++);}for(;r>i;)i+=Zh(t,n,i,r,r,1,a.min,a.max,e.smooth,e.smoothMonotone,e.connectNulls)+1}}),O_=zr.extend({type:"ec-polygon",shape:{points:[],stackedOnPoints:[],smooth:0,stackedOnSmooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},brush:ug(zr.prototype.brush),buildPath:function(t,e){var n=e.points,i=e.stackedOnPoints,r=0,a=n.length,o=e.smoothMonotone,s=Kh(n,e.smoothConstraint),l=Kh(i,e.smoothConstraint);if(e.connectNulls){for(;a>0&&Yh(n[a-1]);a--);for(;a>r&&Yh(n[r]);r++);}for(;a>r;){var u=Zh(t,n,r,a,a,1,s.min,s.max,e.smooth,o,e.connectNulls);Zh(t,i,r+u-1,u,a,-1,l.min,l.max,e.stackedOnSmooth,o,e.connectNulls),r+=u+1,t.closePath()}}});Es.extend({type:"line",init:function(){var t=new Zf,e=new Vh;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t},render:function(t,e,n){var i=t.coordinateSystem,r=this.group,a=t.getData(),o=t.getModel("lineStyle"),l=t.getModel("areaStyle"),u=a.mapArray(a.getItemLayout),h="polar"===i.type,c=this._coordSys,f=this._symbolDraw,d=this._polyline,p=this._polygon,g=this._lineGroup,v=t.get("animation"),m=!l.isEmpty(),y=l.get("origin"),_=qh(i,a,y),x=nc(i,a,_),w=t.get("showSymbol"),b=w&&!h&&lc(t,a,i),S=this._data;S&&S.eachItemGraphicEl(function(t,e){t.__temp&&(r.remove(t),S.setItemGraphicEl(e,null))}),w||f.remove(),r.add(g);var M=!h&&t.get("step");d&&c.type===i.type&&M===this._step?(m&&!p?p=this._newPolygon(u,x,i,v):p&&!m&&(g.remove(p),p=this._polygon=null),g.setClipPath(ac(i,!1,!1,t)),w&&f.updateData(a,{isIgnore:b,clipShape:ac(i,!1,!0,t)}),a.eachItemGraphicEl(function(t){t.stopAnimation(!0)}),Jh(this._stackedOnPoints,x)&&Jh(this._points,u)||(v?this._updateAnimation(a,x,i,n,M,y):(M&&(u=oc(u,i,M),x=oc(x,i,M)),d.setShape({points:u}),p&&p.setShape({points:u,stackedOnPoints:x})))):(w&&f.updateData(a,{isIgnore:b,clipShape:ac(i,!1,!0,t)}),M&&(u=oc(u,i,M),x=oc(x,i,M)),d=this._newPolyline(u,i,v),m&&(p=this._newPolygon(u,x,i,v)),g.setClipPath(ac(i,!0,!1,t)));var T=sc(a,i)||a.getVisual("color");d.useStyle(s(o.getLineStyle(),{fill:"none",stroke:T,lineJoin:"bevel"}));var C=t.get("smooth");if(C=tc(t.get("smooth")),d.setShape({smooth:C,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")}),p){var k=a.getCalculationInfo("stackedOnSeries"),I=0;p.useStyle(s(l.getAreaStyle(),{fill:T,opacity:.7,lineJoin:"bevel"})),k&&(I=tc(k.get("smooth"))),p.setShape({smooth:C,stackedOnSmooth:I,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")})}this._data=a,this._coordSys=i,this._stackedOnPoints=x,this._points=u,this._step=M,this._valueOrigin=y},dispose:function(){},highlight:function(t,e,n,i){var r=t.getData(),a=qi(r,i);if(!(a instanceof Array)&&null!=a&&a>=0){var o=r.getItemGraphicEl(a);if(!o){var s=r.getItemLayout(a);if(!s)return;o=new Lh(r,a),o.position=s,o.setZ(t.get("zlevel"),t.get("z")),o.ignore=isNaN(s[0])||isNaN(s[1]),o.__temp=!0,r.setItemGraphicEl(a,o),o.stopSymbolAnimation(!0),this.group.add(o)}o.highlight()}else Es.prototype.highlight.call(this,t,e,n,i)},downplay:function(t,e,n,i){var r=t.getData(),a=qi(r,i);if(null!=a&&a>=0){var o=r.getItemGraphicEl(a);o&&(o.__temp?(r.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else Es.prototype.downplay.call(this,t,e,n,i)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new P_({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e,e},_newPolygon:function(t,e){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new O_({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(n),this._polygon=n,n},_updateAnimation:function(t,e,n,i,r,a){var o=this._polyline,s=this._polygon,l=t.hostModel,u=S_(this._data,t,this._stackedOnPoints,e,this._coordSys,n,this._valueOrigin,a),h=u.current,c=u.stackedOnCurrent,f=u.next,d=u.stackedOnNext;r&&(h=oc(u.current,n,r),c=oc(u.stackedOnCurrent,n,r),f=oc(u.next,n,r),d=oc(u.stackedOnNext,n,r)),o.shape.__points=u.current,o.shape.points=h,Aa(o,{shape:{points:f}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),Aa(s,{shape:{points:f,stackedOnPoints:d}},l));for(var p=[],g=u.status,v=0;ve&&(e=t[n]);return isFinite(e)?e:0/0},min:function(t){for(var e=1/0,n=0;n1){var u;"string"==typeof n?u=R_[n]:"function"==typeof n&&(u=n),u&&t.setData(e.downSample(e.mapDimension(a.dim),1/l,u,B_))}}}}},F_=function(t){this._axes={},this._dimList=[],this.name=t||""};F_.prototype={constructor:F_,type:"cartesian",getAxis:function(t){return this._axes[t]},getAxes:function(){return p(this._dimList,hc,this)},getAxesByScale:function(t){return t=t.toLowerCase(),v(this.getAxes(),function(e){return e.scale.type===t})},addAxis:function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},dataToCoord:function(t){return this._dataCoordConvert(t,"dataToCoord")},coordToData:function(t){return this._dataCoordConvert(t,"coordToData")},_dataCoordConvert:function(t,e){for(var n=this._dimList,i=t instanceof Array?[]:{},r=0;re[1]&&e.reverse(),e},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},toLocalCoord:null,toGlobalCoord:null},h(N_,f_);var V_={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},W_={};W_.categoryAxis=r({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},V_),W_.valueAxis=r({boundaryGap:[0,0],splitNumber:5},V_),W_.timeAxis=s({scale:!0,min:"dataMin",max:"dataMax"},W_.valueAxis),W_.logAxis=s({scale:!0,logBase:10},W_.valueAxis);var H_=["value","category","time","log"],G_=function(t,e,n,i){d(H_,function(o){e.extend({type:t+"Axis."+o,mergeDefaultAndTheme:function(e,i){var a=this.layoutMode,s=a?bo(e):{},l=i.getTheme();r(e,l.get(o+"Axis")),r(e,this.getDefaultOption()),e.type=n(t,e),a&&wo(e,s,a)},optionUpdated:function(){var t=this.option;"category"===t.type&&(this.__ordinalMeta=Ou.createByAxisModel(this))},getCategories:function(t){var e=this.option;return"category"===e.type?t?e.data:this.__ordinalMeta.categories:void 0},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:a([{},W_[o+"Axis"],i],!0)})}),rv.registerSubTypeDefaulter(t+"Axis",_(n,t))},q_=rv.extend({type:"cartesian2dAxis",axis:null,init:function(){q_.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){q_.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){q_.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});r(q_.prototype,Qy);var X_={offset:0};G_("x",q_,fc,X_),G_("y",q_,fc,X_),rv.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var j_=pc.prototype;j_.type="grid",j_.axisPointerEnabled=!0,j_.getRect=function(){return this._rect},j_.update=function(t,e){var n=this._axesMap;this._updateScale(t,this.model),d(n.x,function(t){Ku(t.scale,t.model)}),d(n.y,function(t){Ku(t.scale,t.model)});var i={};d(n.x,function(t){gc(n,"y",t,i)}),d(n.y,function(t){gc(n,"x",t,i)}),this.resize(this.model,e)},j_.resize=function(t,e,n){function i(){d(a,function(t){var e=t.isHorizontal(),n=e?[0,r.width]:[0,r.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),mc(t,e?r.x:r.y)})}var r=xo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});this._rect=r;var a=this._axesList;i(),!n&&t.get("containLabel")&&(d(a,function(t){if(!t.model.get("axisLabel.inside")){var e=ih(t);if(e){var n=t.isHorizontal()?"height":"width",i=t.model.get("axisLabel.margin");r[n]-=e[n]+i,"top"===t.position?r.y+=e.height+i:"left"===t.position&&(r.x+=e.width+i)}}}),i())},j_.getAxis=function(t,e){var n=this._axesMap[t];if(null!=n){if(null==e)for(var i in n)if(n.hasOwnProperty(i))return n[i];return n[e]}},j_.getAxes=function(){return this._axesList.slice()},j_.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}S(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;iu[1]?-1:1,c=["start"===r?u[0]-h*l:"end"===r?u[1]+h*l:(u[0]+u[1])/2,Cc(r)?t.labelOffset+a*l:0],f=e.get("nameRotate");null!=f&&(f=f*Y_/180);var d;Cc(r)?i=Q_(t.rotation,null!=f?f:t.rotation,a):(i=wc(t,r,f||0,u),d=t.axisNameAvailableWidth,null!=d&&(d=Math.abs(d/Math.sin(i.rotation)),!isFinite(d)&&(d=null)));var p=s.getFont(),g=e.get("nameTruncate",!0)||{},v=g.ellipsis,m=I(t.nameTruncateMaxWidth,g.maxWidth,d),y=null!=v&&null!=m?$g(n,m,p,v,{minChar:2,placeholder:g.placeholder}):n,_=e.get("tooltip",!0),x=e.mainType,w={componentType:x,name:n,$vars:["name"]};w[x+"Index"]=e.componentIndex;var b=new og({anid:"name",__fullText:n,__truncatedText:y,position:c,rotation:i.rotation,silent:bc(e),z2:1,tooltip:_&&_.show?o({content:n,formatter:function(){return n},formatterParams:w},_):null});xa(b.style,s,{text:y,textFont:p,textFill:s.getTextColor()||e.get("axisLine.lineStyle.color"),textAlign:i.textAlign,textVerticalAlign:i.textVerticalAlign}),e.get("triggerEvent")&&(b.eventData=xc(e),b.eventData.targetType="axisName",b.eventData.name=n),this._dumbGroup.add(b),b.updateTransform(),this.group.add(b),b.decomposeTransform()}}},Q_=Z_.innerTextLayout=function(t,e,n){var i,r,a=to(e-t);return eo(a)?(r=n>0?"top":"bottom",i="center"):eo(a-Y_)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=a>0&&Y_>a?n>0?"right":"left":n>0?"left":"right"),{rotation:a,textAlign:i,textVerticalAlign:r}},K_=Kl({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(t,e,n,i){this.axisPointerClass&&Dc(t),K_.superApply(this,"render",arguments),Ec(this,t,e,n,i,!0)},updateAxisPointer:function(t,e,n,i){Ec(this,t,e,n,i,!1)},remove:function(t,e){var n=this._axisPointer;n&&n.remove(e),K_.superApply(this,"remove",arguments)},dispose:function(t,e){Rc(this,e),K_.superApply(this,"dispose",arguments)}}),J_=[];K_.registerAxisPointerClass=function(t,e){J_[t]=e},K_.getAxisPointerClass=function(t){return t&&J_[t]};var tx=["axisLine","axisTickLabel","axisName"],ex=["splitArea","splitLine"],nx=K_.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(t,e,n,i){this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new Zf,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),o=Bc(a,t),s=new Z_(t,o);d(tx,s.add,s),this._axisGroup.add(s.getGroup()),d(ex,function(e){t.get(e+".show")&&this["_"+e](t,a)},this),Ra(r,this._axisGroup,t),nx.superCall(this,"render",t,e,n,i)}},remove:function(){this._splitAreaColors=null},_splitLine:function(t,e){var n=t.axis;if(!n.scale.isBlank()){var i=t.getModel("splitLine"),r=i.getModel("lineStyle"),a=r.get("color");a=x(a)?a:[a];for(var o=e.coordinateSystem.getRect(),l=n.isHorizontal(),u=0,h=n.getTicksCoords({tickModel:i}),c=[],f=[],d=r.getLineStyle(),p=0;p { + Object.defineProperty(ctx, style, { + set: value => { + if (style !== 'fillStyle' && style !== 'strokeStyle' + || value !== 'none' && value !== null + ) { + ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value); + } + } + }); + }); + + ctx.createRadialGradient = () => { + return ctx.createCircularGradient(arguments); + }; + } + + _initEvent() { + this.event = {}; + const eventNames = [{ + wxName: 'touchStart', + ecName: 'mousedown' + }, { + wxName: 'touchMove', + ecName: 'mousemove' + }, { + wxName: 'touchEnd', + ecName: 'mouseup' + }, { + wxName: 'touchEnd', + ecName: 'click' + }]; + + eventNames.forEach(name => { + this.event[name.wxName] = e => { + const touch = e.touches[0]; + this.chart._zr.handler.dispatch(name.ecName, { + zrX: name.wxName === 'tap' ? touch.clientX : touch.x, + zrY: name.wxName === 'tap' ? touch.clientY : touch.y + }); + }; + }); + } +} diff --git a/iconfont.ttss b/iconfont.ttss new file mode 100644 index 0000000..336a66a --- /dev/null +++ b/iconfont.ttss @@ -0,0 +1,74 @@ +@font-face { + font-family: "iconfont"; /* Project id 1353693 */ + src: url('//at.alicdn.com/t/font_1353693_dinubmjfutg.woff2?t=1631098323868') format('woff2'), + url('//at.alicdn.com/t/font_1353693_dinubmjfutg.woff?t=1631098323868') format('woff'), + url('//at.alicdn.com/t/font_1353693_dinubmjfutg.ttf?t=1631098323868') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-lingquanzhongxin:before { + content: "\e8e7"; +} + +.icon-wuliu:before { + content: "\e808"; +} + +.icon-youhuiquan:before { + content: "\e76d"; +} + +.icon-zhijiandan-:before { + content: "\e611"; +} + +.icon-jiesuan:before { + content: "\e682"; +} + +.icon-hexiao:before { + content: "\e687"; +} + +.icon-shouyintai:before { + content: "\e683"; +} + +.icon-jifen:before { + content: "\e61c"; +} + +.icon-icon-riliriqi:before { + content: "\e807"; +} + +.icon-shouye1:before { + content: "\e64e"; +} + +.icon-shouyintai1:before { + content: "\e64f"; +} + +.icon-quan:before { + content: "\e651"; +} + +.icon-shoufukuan:before { + content: "\e647"; +} + +.icon-jiantou-copy-copy:before { + content: "\e668"; +} + +.icon-jiantou-copy-copy-copy:before { + content: "\e669"; +} diff --git a/pages/Add/index.js b/pages/Add/index.js new file mode 100644 index 0000000..dfd1eaf --- /dev/null +++ b/pages/Add/index.js @@ -0,0 +1,115 @@ +// pages/Add/index.js +const config = require('../../config/config.js') +const Http = require('../../utils/http.js') +const HttpBasics = require('../../utils/HttpBasics.js') +const util = require('../../utils/util.js') +var app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + paramData:null, + isAdmin:null, + userData:null, + phoneIf:false, + businessId:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + console.log(options,88888888888888888) + let phoneIf = options.phone != 'undefined' ? true : false + options.phone = (options.phone != 'undefined' ? options.phone:'未绑定') + this.setData({ + paramData:options, + phoneIf + }); + console.log(options,"options") + this.getUserInfo() + }, + getUserInfo(){ + let _this=this; + app.globalData.userInfo().then(res => { + console.log(res) + if (res.businessId == 3){ + _this.setData({ + businessId:3 + }) + } + _this.setData({ + userData:res + }) + }).catch(err=>{ + tt.showToast({ + title: '商户信息获取出错', + icon: 'none', + duration: 2000, + mask: false + }); + }) + }, + gotoScore(e){ + // console.log(e.currentTarget.id,6666666666) + if (e.currentTarget.id == '1') { + tt.navigateTo({ + url: `/pages/operation/index?address=${this.data.paramData.address}&id=${this.data.paramData.id}&levelName=${this.data.paramData.levelName}&name=${this.data.paramData.name}&nickName=${this.data.paramData.nickName}&phone=${this.data.paramData.phone}&score=${this.data.paramData.score}&credit=${this.data.paramData.credit}&type=${e.currentTarget.id}&isAdmin=${this.data.userData.is_admin}&merchant_id=${this.data.userData.merchant_id}&businessId=${this.data.businessId}` + }) + } else { + tt.navigateTo({ + url: `/pages/exchange/index?address=${this.data.paramData.address}&id=${this.data.paramData.id}&levelName=${this.data.paramData.levelName}&name=${this.data.paramData.name}&nickName=${this.data.paramData.nickName}&phone=${this.data.paramData.phone}&score=${this.data.paramData.score}&credit=${this.data.paramData.credit}&type=${e.currentTarget.id}&merchant_id=${this.data.userData.merchant_id}` + }) + } + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/Add/index.json b/pages/Add/index.json new file mode 100644 index 0000000..756de57 --- /dev/null +++ b/pages/Add/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "会员积分", + "navigationBarTextStyle": "white" + } \ No newline at end of file diff --git a/pages/Add/index.ttml b/pages/Add/index.ttml new file mode 100644 index 0000000..c0eb5c7 --- /dev/null +++ b/pages/Add/index.ttml @@ -0,0 +1,28 @@ + + + + + + + + 会员姓名(昵称): + {{paramData.name!='undefined'?paramData.name:paramData.nickName!='undefined'?paramData.nickName:''}} + + + 会员等级: + {{paramData.levelName!='undefined'?paramData.levelName:''}} + + + 手机号码: + {{paramData.phone}} + + + 会员未授权手机号,请用户先去授权手机号! + + + + + + + + \ No newline at end of file diff --git a/pages/Add/index.ttss b/pages/Add/index.ttss new file mode 100644 index 0000000..f8c0b28 --- /dev/null +++ b/pages/Add/index.ttss @@ -0,0 +1,92 @@ +/* pages/Add/index.wxss */ +page{ + background: #f8f8fa; + } + .exchange { + width: 100%; + height: 100%; + background: #f8f8fa; + } + .exchangeBox{ + margin-top: -45rpx; + } + .radian{ + width: 100%; + height: 100rpx; + border-radius: 0 0 100rpx 100rpx; + background-color: #52A0FD; + } + + + .section { + width: 710rpx; + /* height: 176rpx; */ + margin-top: 8%; + background: #fff; + display: flex; + flex-direction: column; + border: 1px solid #eaeaea; + border-radius: 18rpx; + margin: auto; + } + + .section view { + position: relative; + width: 92%; + height: 88rpx; + line-height: 88rpx; + display: flex; + justify-content: space-between; + padding: 0 4%; + /* border-bottom: 1px solid #f5f5f5; */ + } + + .section view text { + font-size: 30rpx; + color: #999999; + letter-spacing: 1.16rpx; + } + + .section view text:nth-child(2) { + font-size: 28rpx; + color: #000; + letter-spacing: 1.16rpx; + text-align: right; + } + button{ + width: 710rpx; + height: 94rpx; + margin-top: 88rpx; + color: #FFF; + font-size: 36rpx; + background-color: #52A0FD; + box-shadow:0px 10px 22px 2px rgba(82,160,253,0.51); + } + .img { + margin-top: -60rpx; + display: block; + width: 100%; + } + .butBox{ + display: flex; + } + .butBox button{ + width: 344rpx; + height: 130rpx; + line-height: 130rpx; + border-radius: 30rpx; + } + .butBox :nth-child(1){ + background-color: #52A0FD; + box-shadow:0px 10px 22px 2px rgba(82,160,253,0.51); + } + .butBox :nth-child(2){ + background-color: #FF6A6B; + box-shadow:0px 10px 22px 2px rgba(255,106,107,0.51); + } + .phoneDes{ + font-size: 26rpx; + color: rgb(175, 168, 168); + text-align: center; + margin-top: 30rpx; + } \ No newline at end of file diff --git a/pages/creditOperate/index.js b/pages/creditOperate/index.js new file mode 100644 index 0000000..6301a2a --- /dev/null +++ b/pages/creditOperate/index.js @@ -0,0 +1,199 @@ +// pages/creditOperate/index.js +const config = require('../../config/config.js') +const Http = require('../../utils/HttpBasics.js') +const util = require('../../utils/util.js') +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + date: util.formatTime(new Date(), 'yyyy-MM-dddd'), //默认起始时间 + date2: util.formatTime(new Date(), 'yyyy-MM-dddd'), //默认结束时间 + endDate: util.formatTime(new Date(), 'yyyy-MM-dddd'), + list: [], + showNocontent: false, + todayDate: null, + pageNum: 1, + length: 0, + userInfo:null, + listData:[], + loading:false, + content:'正在加载中', + pages:null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getUser() + }, + bindDateChange(e) { + let that = this; + that.setData({ + date: e.detail.value, + }) + console.log(that.data.date) + }, + bindDateChange2(e) { + let that = this; + that.setData({ + date2: e.detail.value, + }) + console.log(that.data.date2) + }, + search(){ + this.getList(this.data.pageNum) + }, + getUser(){ + let _this=this; + app.globalData.userInfo().then(res => { + this.setData({ + userInfo: res + }) + _this.getList(1); + console.log(res); + }) + }, + formatData(data){ + let arr=[]; + data.map((item,index)=>{ + let a = {}; + a.value = [item]; + a.dateR = item.createDate01; + let indexSt=0; + let haveIf=false; + arr.map((item01,index01)=>{ + if (item.createDate01 == item01.dateR){ + indexSt = index01; + haveIf=true; + } + }) + if (haveIf && (new Date(item.createDate)).valueOf() >= (new Date((this.data.date + ' 00:00:00').replace(/-/g, "/"))).getTime() && (new Date(item.createDate)).valueOf() <= (new Date((this.data.date2 + ' 23:59:59').replace(/-/g, "/"))).getTime()){ + arr[indexSt].value.push(item) + } else if ((new Date(item.createDate)).valueOf() >= (new Date((this.data.date + ' 00:00:00').replace(/-/g, "/"))).getTime() && (new Date(item.createDate)).valueOf() <= (new Date((this.data.date2 + ' 23:59:59').replace(/-/g, "/"))).getTime()){ + arr.push(a) + } + }) + this.setData({ + list:arr + }) + }, + getList(page){ + let _this=this; + Http.get({ + url: config.api.getCreditList, + data: { + pageNum: page, + pageSize: 10, + startTime: this.data.date + " 00:00:00", + endTime: this.data.date2 + " 23:59:59", + merchantId: _this.data.userInfo.merchant_id + } + }) + .then(res => { + tt.stopPullDownRefresh(); + let data=res.data.list; + let listData = []; + if(page==1){ + listData = res.data.list; + }else{ + listData = _this.data.listData; + } + console.log(data) + data.map((item, index) => { + let haveIf = false; + item.createDate01 = util.formatTime(item.createDate, 'yyyy-MM-dddd') + listData.map((item02, index02) => { + if (item02.creditId == item.creditId) { + haveIf = true; + } + }) + if (!haveIf) { + listData.push(item) + } + }) + _this.formatData(listData) + + if (res.data.pages <= page) { + _this.setData({ + listData, + pageNum: res.data.pages-1, + content: '已经加载全部数据!' + }) + } else { + _this.setData({ + listData, + loading: false, + content:'小主,我在玩命加载中...' + }) + } + }) + .catch(err => { + tt.stopPullDownRefresh(); + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 刷新 + */ + onPullDownRefresh: function (e) { + let that = this; + that.setData({ + pageNum: 1, + list: [] + }); + that.getList(1); + }, + onReachBottom: function () { + var that = this; + that.data.pageNum++; + that.setData({ + pageNum: that.data.pageNum, + loading: true + }); + that.getList(that.data.pageNum); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/creditOperate/index.json b/pages/creditOperate/index.json new file mode 100644 index 0000000..697ee76 --- /dev/null +++ b/pages/creditOperate/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "积分操作记录", + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "navigationBarTextStyle": "white" + } \ No newline at end of file diff --git a/pages/creditOperate/index.ttml b/pages/creditOperate/index.ttml new file mode 100644 index 0000000..7691249 --- /dev/null +++ b/pages/creditOperate/index.ttml @@ -0,0 +1,48 @@ + + + + + + 开始日期 + + + {{date}} + + + + + + + + + 结束日期 + + + {{date2}} + + + + + + + + + {{item.dateR}} + + + {{item01.name}} + {{item01.createDate01}} + + + {{item01.creditNum>0?('+'+item01.creditNum):(item01.creditNum)}} + {{'操作人:'+item01.operator}} + + + + + + {{content}} + + \ No newline at end of file diff --git a/pages/creditOperate/index.ttss b/pages/creditOperate/index.ttss new file mode 100644 index 0000000..705e0ae --- /dev/null +++ b/pages/creditOperate/index.ttss @@ -0,0 +1,235 @@ +page { + background: #f6f6f6; + } + + .head { + height: 227rpx; + width: 681rpx; + margin: -45rpx auto 0; + position: relative; + } + + picker { + width: 180rpx; + text-align:center; + height: 45rpx; + font-size: 30rpx; + overflow: hidden; + color: rgba(85, 85, 85, 1); + margin: 0 auto; + } + + .head image { + position: absolute; + width: 100%; + height: 100% !important; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 1; + } + + .time { + position: relative; + display: flex; + flex: 2.5; + text-align: center; + z-index: 10; + align-items: center; + } + + .time >view:nth-of-type(1), .time >view:nth-of-type(3) { + flex: 1; + } + + .time >view:nth-of-type(2) { + flex: 0.5; + } + + .time >view text { + display: block; + } + + .time >view text:nth-of-type(2n+1) { + margin-top: 69rpx; + } + + .time >view text:nth-of-type(2n+1) { + color: #999; + font-size: 26rpx; + margin-bottom: 24rpx; + } + + .time >view text:nth-of-type(2n) { + color: rgba(153, 153, 153, 1); + font-size: 32rpx; + margin-top: 34rpx; + } + + .btn { + background: #51a0fc; + height: 76rpx; + line-height: 76rpx; + display: block; + width: 681rpx; + margin: 0 auto; + border-top-left-radius: 0 !important; + border-top-right-radius: 0 !important; + border-bottom-left-radius: 16rpx; + border-bottom-right-radius: 16rpx; + color: #fff; + font-size: 30rpx; + box-shadow: 0 9rpx 16rpx 0 rgba(81, 160, 252, 0.57); + } + + button::after { + border: none; + } + + .active { + opacity: 0.6; + } + + .acount { + width: 630rpx; + display: flex; + margin: 30rpx auto 0; + padding: 35rpx 0; + flex: 2; + text-align: center; + border-top: 1px solid #e3f0ff; + } + + .acount>view { + flex: 1; + } + + .acount>view text { + display: block; + color: #999; + font-size: 26rpx; + } + + .acount>view text:nth-of-type(2n) { + color: #333; + font-size: 40rpx; + margin-top: 20rpx; + } + + + .content { + position: relative; + padding: 0 35rpx; + height: 145rpx; + background: #fff; + border-bottom: 1px solid #eaeaea; + } + + .content>view:nth-of-type(2n+1) text { + display: block; + } + + .content>view:nth-of-type(2n+1) text:nth-of-type(1) { + margin-top: 27rpx; + } + + .content>view:nth-of-type(2n+1) text:nth-of-type(2) { + margin-top: 10rpx; + font-size: 26rpx; + font-family: PingFang-SC-Bold; + color: rgba(153, 153, 153, 1); + } + + .content>view:nth-of-type(2n+1) { + float: left; + width: 40%; + } + + .content>view:nth-of-type(2n) { + width: 55%; + float: right; + text-align: right; + } + + .nocontent { + text-align: center; + font-size: 30rpx; + padding: 30rpx 0; + } + + .contents { + margin-top: 20rpx; + } + + .content .fr text:nth-of-type(1) { + margin-top: 36rpx; + } + + .content .fr text:nth-of-type(1), .content .fr text:nth-of-type(3) { + color:rgba(51,51,51,1); + display: block; + font-size: 28rpx; + } + + .content .fr text:nth-of-type(2) { + display: block; + color:rgba(153,153,153,1); + font-size: 26rpx; + } + + .img { + display: block; + width: 100%; + } + + .title { + display: block; + text-align: center; + color: rgba(153, 153, 153, 1); + font-size: 26rpx; + } + + .total { + display: block; + text-align: center; + font-size: 70rpx; + margin: 36rpx 0; + font-family: PingFang-SC-Bold; + font-weight: bold; + color: rgba(51, 51, 51, 1); + } + + .acounts { + width: 680rpx; + margin: 48rpx auto 48rpx; + border: 1px solid #51a0fc; + border-radius: 16rpx; + padding: 40rpx 0 0; + background: #fff; + } + .daishou{ + width: 133rpx; + height: 79rpx; + position: absolute; + top: 0; + bottom: 0; + right:264rpx; + margin: auto; + } + .date-t{ + font-size:26rpx; + font-family:PingFang-SC-Regular; + font-weight:400; + color:rgba(153,153,153,1); + line-height:44rpx; + padding:0 35rpx; + margin: 10rpx 0; + } + .loading{ + color:rgba(51,51,51,1); + font-size:28rpx; + line-height: 40rpx; + margin:30rpx 0; + text-align: center; + } \ No newline at end of file diff --git a/pages/creditSelect/index.js b/pages/creditSelect/index.js new file mode 100644 index 0000000..dabbcd7 --- /dev/null +++ b/pages/creditSelect/index.js @@ -0,0 +1,73 @@ +const config = require('../../config/config.js') +const Http = require('../../utils/http.js') +const HttpBasics = require('../../utils/HttpBasics.js') +const util = require('../../utils/util.js') +import * as echarts from '../../ec-canvas/echarts'; +var app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + }, + gotoSaoyiSao: function () { + tt.scanCode({ + success: function (val) { + console.log(val.result); + if (util.isJSON(val.result)) { + let value = JSON.parse(val.result); + if (value.END == 'C' && value.TYPE == 'memberCode' && value.ID.length >= 18) { + Http.postRequest(config.api.memScan, app.globalData.token, '加载中', { + memCode: value.ID + }, (res) => { + console.log(res, 9999999999) + if (res.code == 200) { + if (res.data.discountRate != 100) { + var discountRate = res.data.discountRate / 10; + } else { + var discountRate = "暂无折扣"; + } + tt.navigateTo({ + url: `/pages/Add/index?address=${res.data.address}&id=${res.data.id}&levelName=${res.data.levelName}&nickName=${res.data.nickName}&name=${res.data.name}&phone=${res.data.phone}&score=${res.data.score}&discountRate=${discountRate}&credit=${res.data.credit}` + }) + } else { + tt.showModal({ + title: "抱歉", + content: res.message, + showCancel: false + }) + } + }) + } else { + tt.showToast({ + title: '请扫描正确的二维码', + icon: 'none', + duration: 1300 + }) + } + } else { + tt.showToast({ + title: '请扫描正确的二维码', + icon: 'none', + duration: 1300 + }) + } + }, + fail: function () { + tt.showToast({ + title: '请扫描正确的二维码', + icon: 'none', + duration: 1300 + }) + } + }) + }, + // 跳转到手动核销 + aoto: function () { + tt.navigateTo({ + url: '/pages/memberPhone/index?a=1', + }) + }, +}) + diff --git a/pages/creditSelect/index.json b/pages/creditSelect/index.json new file mode 100644 index 0000000..e69c7bc --- /dev/null +++ b/pages/creditSelect/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "积分操作形式", + "navigationBarTextStyle": "white" + } \ No newline at end of file diff --git a/pages/creditSelect/index.ttml b/pages/creditSelect/index.ttml new file mode 100644 index 0000000..77f2917 --- /dev/null +++ b/pages/creditSelect/index.ttml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pages/creditSelect/index.ttss b/pages/creditSelect/index.ttss new file mode 100644 index 0000000..275170a --- /dev/null +++ b/pages/creditSelect/index.ttss @@ -0,0 +1,41 @@ +/* pages/scan/scan.wxss */ +page{ + background: #52A0FD; + } + .content{ + width: 588rpx; + margin: 0 auto; + background: #fff; + border-radius:10rpx; + padding-bottom: 100rpx; + padding: 0 46rpx 46rpx; + } + .content image{ + width: 603rpx; + margin: 48rpx auto 0; + } + button::after{ border: none; } + .btn1{ + width: 550rpx; + margin: 50rpx auto 0; + background:#52A0FD; + border:1px solid #52A0FD; + border-radius:45rpx; + color: #fff; + font-weight:400; + font-size:36rpx; + box-shadow: 0 6px 20px 0 rgba(183, 216, 254, 1); + } + .btn2{ + width: 550rpx; + margin: 50rpx auto 0; + background:rgba(255,255,255,1); + border:1px solid rgba(180,212,249,1); + border-radius:45rpx; + font-weight:400; + font-size:36rpx; + color:rgba(81,160,252,1); + } + .active{ + opacity: .6; + } \ No newline at end of file diff --git a/pages/editSuccess/index.js b/pages/editSuccess/index.js new file mode 100644 index 0000000..cf56db7 --- /dev/null +++ b/pages/editSuccess/index.js @@ -0,0 +1,55 @@ +const config = require('../../config/config.js') +const Http = require('../../utils/http.js') +const HttpBasics = require('../../utils/HttpBasics.js') +const util = require('../../utils/util.js') +var app = getApp() +Page({ + /** + * 页面的初始数据 + */ + data: { + showDetailIf: true, + creditNum:0, + type:1, + creditAmount:0, + titleH:'', + title:[] + }, + goOn(){ + tt.navigateBack({ + delta: 1 + }) + }, + goBack(){ + tt.reLaunch({ + url: '/pages/index/index', + }) + }, + /** + * 生命周期函数--监听页面显示 + */ + onLoad: function (options) { + console.log(options) + if (options.titleH){ + this.setData({ + type: options.type, + titleH: options.titleH, + title: options.titleH.split(',') + }) + tt.setNavigationBarTitle({ + title: '会员赠券' + }) + }else{ + this.setData({ + creditNum: options.creditNum, + type: options.type, + creditAmount: options.creditAmount, + }) + tt.setNavigationBarTitle({ + title: '会员积分' + }) + } + + console.log(this.data.titleH, this.data.title) + }, +}) \ No newline at end of file diff --git a/pages/editSuccess/index.json b/pages/editSuccess/index.json new file mode 100644 index 0000000..dad8c2b --- /dev/null +++ b/pages/editSuccess/index.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarTitleText": "会员赠券", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#52A0FD" +} \ No newline at end of file diff --git a/pages/editSuccess/index.ttml b/pages/editSuccess/index.ttml new file mode 100644 index 0000000..13ae498 --- /dev/null +++ b/pages/editSuccess/index.ttml @@ -0,0 +1,24 @@ + + + + + 操作成功 + + + 本次积分:+{{creditNum}} + + + 消费积分:-{{creditNum}} + 剩余积分:{{creditAmount}} + + + + {{item}}赠送成功 + + + + + + + + \ No newline at end of file diff --git a/pages/editSuccess/index.ttss b/pages/editSuccess/index.ttss new file mode 100644 index 0000000..8a316c8 --- /dev/null +++ b/pages/editSuccess/index.ttss @@ -0,0 +1,110 @@ +page { + background: #f6f6f8; + height: 100%; + } + + .content { + width: 630rpx; + border-radius: 20rpx; + background: #fff; + margin: 60rpx auto 68rpx; + padding-bottom: 67rpx; + } + + .cBox { + display: flex; + } + + .image { + width: 70rpx; + height: 70rpx; + float: left; + } + + .tick { + width: 70rpx; + height: 70rpx; + margin-left: 189rpx; + margin-top: 73rpx; + margin-bottom: 21rpx; + } + + .txt1 { + display: block; + font-size: 40rpx; + font-family: PingFang-SC-Bold; + font-weight: Bold; + margin-left: 26rpx; + margin-top: 85rpx; + } + + .txt2 { + display: block; + width: 100%; + margin-left: 208rpx; + margin-bottom: 85rpx; + color: #333333; + font-size: 28rpx; + } + .txt3{ + color: #000; + font-weight: Regular; + } + .txt4 { + display: block; + width: 100%; + margin-left: 208rpx; + color: #333333; + font-size: 28rpx; + } + + .txt5 { + display: block; + width: 100%; + margin-left: 208rpx; + margin-bottom: 85rpx; + color: #333333; + font-size: 28rpx; + } + + .bBox { + display: flex; + } + + .goOn { + display: block; + width: 300rpx; + height: 90rpx; + line-height: 90rpx; + margin: 15rpx auto 0; + font-size: 32rpx; + color: #fff; + text-align: center; + background: rgba(81, 160, 252, 1); + border-radius: 100rpx; + margin-left: 60rpx; + } + + .goBack { + display: block; + width: 300rpx; + height: 90rpx; + line-height: 90rpx; + margin: 15rpx auto 0; + font-size: 32rpx; + color: #333; + text-align: center; + background: #fff; + border-radius: 45rpx; + border: 1rpx solid #d2d2d2; + margin-right: 60rpx; + } + .title{ + margin: 0 auto; + text-align: center; + display: block; + color: #333333; + font-size: 28rpx; + } + + \ No newline at end of file diff --git a/pages/errorPage/errorPage.js b/pages/errorPage/errorPage.js new file mode 100644 index 0000000..403a0f3 --- /dev/null +++ b/pages/errorPage/errorPage.js @@ -0,0 +1,22 @@ +// pages/index/solution/fail/fail.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + errTitle:"暂无结果" + }, + reBack(){ + tt.switchTab({ + url: '/pages/index/index', + }) + }, + onLoad(options) { + if (options.errTitle) { + this.setData({ + errTitle: options.errTitle + }) + } + }, +}) \ No newline at end of file diff --git a/pages/errorPage/errorPage.json b/pages/errorPage/errorPage.json new file mode 100644 index 0000000..b425c29 --- /dev/null +++ b/pages/errorPage/errorPage.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarTitleText": "查询", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#52A0FD" + } \ No newline at end of file diff --git a/pages/errorPage/errorPage.ttml b/pages/errorPage/errorPage.ttml new file mode 100644 index 0000000..6662993 --- /dev/null +++ b/pages/errorPage/errorPage.ttml @@ -0,0 +1,9 @@ + + + + {{errTitle}} + + + \ No newline at end of file diff --git a/pages/errorPage/errorPage.ttss b/pages/errorPage/errorPage.ttss new file mode 100644 index 0000000..e906825 --- /dev/null +++ b/pages/errorPage/errorPage.ttss @@ -0,0 +1,72 @@ +/* pages/index/solution/success/success.wxss */ + +@font-face {font-family: "iconfont"; + src: url('iconfont.eot?t=1534918788675'); /* IE9*/ + src: url('iconfont.eot?t=1534918788675#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAQMAAsAAAAABmAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8eUf1Y21hcAAAAYAAAABKAAABcOcrtbNnbHlmAAABzAAAAGEAAABsGZubU2hlYWQAAAIwAAAAKwAAADYSZIcFaGhlYQAAAlwAAAAcAAAAJAfeA4NobXR4AAACeAAAAAgAAAAICAAAAGxvY2EAAAKAAAAABgAAAAYANgAAbWF4cAAAAogAAAAeAAAAIAENAChuYW1lAAACqAAAAUUAAAJtPlT+fXBvc3QAAAPwAAAAHAAAAC1khnAFeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMT9jZm7438AQw9zA0AAUZgTJAQDdnQvpeJztkLENgEAMA89KoECMQEXNLFTsX7LGf97AFlg6Sz6lCjABURxFgi7EyFlW9sFin+y+yeHvaO3r2ulGM39W9/Yu/+oBdTBACXUAAHicY2BkAALmBmYGBmkGBlVORjMTNSV2TkY1JTYRcU5GNhExI3NORjEjMxPmkn/HGK14JBR5/h37d4xXQYKH0erfMR4JBV5GK6C4ooQ7iAaJQ9Qp8ILUAcWh6hQZALfsFpMAAAB4nGNgZGBgAOKvzEtux/PbfGXgZmEAgeuLFVuQaRYGZhDFwcAEogAbEAh3AHicY2BkYGBu+N/AEMPCAAJAkpEBFTABAEcIAmsEAAAABAAAAAAAAAAANgAAeJxjYGRgYGBikGEA0SAWAwMXEDIw/AfzGQALUwE2AAB4nGWPTU7DMBCFX/oHpBKqqGCH5AViASj9EatuWFRq911036ZOmyqJI8et1ANwHo7ACTgC3IA78EgnmzaWx9+8eWNPANzgBx6O3y33kT1cMjtyDRe4F65TfxBukF+Em2jjVbhF/U3YxzOmwm10YXmD17hi9oR3YQ8dfAjXcI1P4Tr1L+EG+Vu4iTv8CrfQ8erCPuZeV7iNRy/2x1YvnF6p5UHFockikzm/gple75KFrdLqnGtbxCZTg6BfSVOdaVvdU+zXQ+ciFVmTqgmrOkmMyq3Z6tAFG+fyUa8XiR6EJuVYY/62xgKOcQWFJQ6MMUIYZIjK6Og7VWb0r7FDwl57Vj3N53RbFNT/c4UBAvTPXFO6stJ5Ok+BPV8bUnV0K27LnpQ0kV7NSRKyQl7WtlRC6gE2ZVeOEXpc0Yk/KGdI/wAJWm7IAAAAeJxjYGKAAC4G7ICJkYmRmYE5uTSfgQEAB2cBYA==') format('woff'), + url('iconfont.ttf?t=1534918788675') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ + url('iconfont.svg?t=1534918788675#iconfont') format('svg'); /* iOS 4.1- */ + } + + .iconfont { + font-family:"iconfont" !important; + font-size:16px; + font-style:normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } + + .icon-cuo:before { content: "\e603"; } + + .success { + width: 100%; + height: 100%; + position: absolute; + } + + .success_logo { + width: 150rpx; + height: 150rpx; + margin: 0 auto; + display: flex; + flex-direction: column; + margin-top: 10%; + } + + .success_logo icon { + width: 150rpx; + height: 150rpx; + background: #ccc; + border-radius: 50%; + color: #fff; + font-size: 30px; + text-align: center; + line-height: 150rpx; + } + .info { + width: 100%; + display: flex; + flex-direction: column; + + } + .info text { + font-size: 36rpx; + text-align: center; + padding-top: 3%; + color:#999; + } + + + .reBack { + color: #fff; + width: 670rpx; + background: #52A0FD; + position: fixed; + bottom: 40rpx; + left: 0; + right: 0; + margin: auto; + } + .active{ + opacity: .6; + } \ No newline at end of file diff --git a/pages/exchange/index.js b/pages/exchange/index.js new file mode 100644 index 0000000..4b946d6 --- /dev/null +++ b/pages/exchange/index.js @@ -0,0 +1,167 @@ +// pages/operation/index.js +const config = require('../../config/config.js') +const Http = require('../../utils/HttpBasics.js') +const util = require('../../utils/util.js') +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + showDetailIf: true, + type: null, + paramData: '', + array: ['美国', '中国', '巴西', '日本'], + merchentList: [], + spendStr: null, + creditNum: 0, + submitAble: true, + thoroughfare:'', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + type: options.type, + paramData: options + }) + this.getMerchent(); + }, + /** + * 保存积分操作数据 + */ + submitForm() { + let _this = this; + const reg = /^[1-9]\d*$/; + if (!reg.test(_this.data.creditNum) || Number(_this.data.creditNum) > 9999999 || Number(_this.data.creditNum) <1) { + tt.showToast({ + title: '消费金额限制1~9999999的正整数!', + icon: 'none', + duration: 2000, + mask: false + }); + return; + } + _this.setData({ + submitAble: false + }) + Http.post({ + url: config.api.addCredit, + data: { + creditNum: _this.data.creditNum, + creditType: 12,//消费积分 + cuserId: _this.data.paramData.id, + operatorType: 3, + merchantId: _this.data.paramData.merchant_id, + changePurpose: _this.data.thoroughfare + } + }) + .then(res => { + _this.setData({ + merchentList: res.data, + submitAble: true + }) + tt.showToast({ + title: '保存成功!', + icon: 'none', + duration: 2000, + mask: false + }); + tt.navigateTo({ + url: '/pages/editSuccess/index?type=2&creditNum=' + _this.data.creditNum + '&creditAmount=' + res.data.creditAmount, + }) + }) + .catch(err => { + _this.setData({ + submitAble: true + }) + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + getPrice(e) { + this.setData({ + creditNum: e.detail.value + }) + }, + getThoroughfare(e){ + this.setData({ + thoroughfare: e.detail.value + }) + }, + getMerchent() { + let _this = this; + Http.get({ + url: config.api.getMerchentList + }) + .then(res => { + _this.setData({ + merchentList: res.data + }) + }) + .catch(err => { + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + bindPickerChange(e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + index: e.detail.value + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.setData({ + submitAble:true + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + } +}) \ No newline at end of file diff --git a/pages/exchange/index.json b/pages/exchange/index.json new file mode 100644 index 0000000..49cf710 --- /dev/null +++ b/pages/exchange/index.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarTitleText": "会员积分", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#52A0FD" + } \ No newline at end of file diff --git a/pages/exchange/index.ttml b/pages/exchange/index.ttml new file mode 100644 index 0000000..90c48b6 --- /dev/null +++ b/pages/exchange/index.ttml @@ -0,0 +1,33 @@ + + + + + + + + 会员姓名(昵称): + {{paramData.name!='undefined'?paramData.name:paramData.nickName!='undefined'?paramData.nickName:''}} + + + 会员等级: + {{paramData.levelName}} + + + 手机号码: + {{paramData.phone}} + + + + + 消费积分 + + + + 消费用途 + + + + + + + \ No newline at end of file diff --git a/pages/exchange/index.ttss b/pages/exchange/index.ttss new file mode 100644 index 0000000..d4d9be0 --- /dev/null +++ b/pages/exchange/index.ttss @@ -0,0 +1,99 @@ +/* pages/exchange/index.wxss */ + +.exchange { + width: 100%; + height: 100%; + background: #f8f8fa; + } + .exchangeBox{ + margin-top: -45rpx; + } + .radian{ + width: 100%; + height: 100rpx; + border-radius: 0 0 100rpx 100rpx; + background-color: #52A0FD; + } + + .footer { + width: 710rpx; + height: 126rpx; + line-height: 126rpx; + display: flex; + background: #fff; + border-radius: 20rpx; + margin: 100rpx auto 0; + box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); + } + .footerYt{ + width: 710rpx; + height: 126rpx; + line-height: 126rpx; + display: flex; + background: #fff; + border-radius: 20rpx; + margin: 30rpx auto 0; + box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); + } + .footer text { + margin-left: 31rpx; + font-size: 30rpx; + } + .footer input{ + width: 460rpx; + margin-left: 40rpx; + height: 126rpx; + line-height: 126rpx; + font-size: 30rpx; + text-align: right; + } + .section { + width: 710rpx; + /* height: 176rpx; */ + margin-top: 8%; + background: #fff; + display: flex; + flex-direction: column; + border: 1px solid #eaeaea; + border-radius: 18rpx; + margin: auto; + } + + .section view { + position: relative; + width: 92%; + height: 88rpx; + line-height: 88rpx; + display: flex; + justify-content: space-between; + padding: 0 4%; + /* border-bottom: 1px solid #f5f5f5; */ + } + + .section view text { + font-size: 30rpx; + color: #999999; + letter-spacing: 1.16rpx; + } + + .section view text:nth-child(2) { + font-size: 28rpx; + color: #000; + letter-spacing: 1.16rpx; + text-align: right; + } + button{ + width: 710rpx; + height: 94rpx; + margin-top: 88rpx; + color: #FFF; + font-size: 36rpx; + background-color: #52A0FD; + box-shadow:0px 10px 22px 2px rgba(82,160,253,0.51); + } + .img { + margin-top: -60rpx; + display: block; + width: 100%; + } + \ No newline at end of file diff --git a/pages/forgetpwd/forgetpwd.js b/pages/forgetpwd/forgetpwd.js new file mode 100644 index 0000000..d7a8481 --- /dev/null +++ b/pages/forgetpwd/forgetpwd.js @@ -0,0 +1,163 @@ +const config = require('../../config/config.js') +const Common = require('../../common/common.js') +const app = getApp() +var interval = null //倒计时函数 +Page({ + data: { + phone: '', + yzm: '', + flag: true, + retry: false, + time: 60, + phones: "", + date: '请选择日期', + fun_id: 2, + time: '获取验证码', //倒计时 + currentTime: 61, + disabled:false, + setInter:'' + }, + getCode: function (options) { + var that = this; + var currentTime = that.data.currentTime + that.data.setInter = setInterval(function () { + currentTime--; + that.setData({ + time: currentTime + '秒' + }) + if (currentTime <= 0) { + clearInterval(that.data.setInter) + that.setData({ + time: '获取验证码', + currentTime: 61, + disabled: false + }) + } + console.log(that.data.time) + }, 1000) + }, + onHide:function(){ + let that = this; + clearInterval(that.data.setInter); + that.setData({ + time: '获取验证码', + currentTime: 61, + disabled: false + }) + }, + onUnload:function(){ + let that = this; + clearInterval(that.data.setInter) + that.setData({ + time: '获取验证码', + currentTime: 61, + disabled: false + }) + }, + onLoad:function(options){ + console.log(options); + if(tt.getStorageSync("phone")){ + this.setData({ + phone: tt.getStorageSync("phone"), + }) + } + if(options.flags=='reset'){ + tt.setNavigationBarTitle({ + title: '修改密码' + }) + this.setData({ + flags: options.flags + }) + }else{ + tt.setNavigationBarTitle({ + title: '忘记密码' + }) + } + + }, + onShow: function () { + let that = this; + that.setData({ + phones: tt.getStorageSync("phone"), + disabled:false + }); + console.log(that.data.phones) + }, + getYZM(e) { + console.log(e); + if (e.detail.value.phone) { + this.setData({ + phone: e.detail.value.phone, + yzm: e.detail.value.yzm + }) + }else{ + this.setData({ + phone: tt.getStorageSync("phone"), + yzm: e.detail.value.yzm + }) + } + }, + next() { + setTimeout(() => { + console.log(this.data) + Common.hasValidationCode(this.data.phone, this.data.yzm) + .then(res => { + console.log(res) + setTimeout(() => { + console.log(res) + if (res.code == 200) { + tt.navigateTo({ + url: `/pages/setpwd/setpwd?phone=${this.data.phone}&code=${this.data.yzm}` + }) + } else { + tt.showToast({ + title: "验证码错误", + icon: "none", + duration: 2000 + }) + } + }, 500) + }) + }, 1000) + }, + send(e) { + console.log(this.data.phone); + var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/; + let that = this; + // setTimeout(() => { + let tel = that.data.phone; + console.log(tel) + if (phoneReg.test(tel)) { + Common.sendValidationCode(tel) + .then(res => { + console.log(res); + if (res.code == 200) { + that.getCode(); + that.setData({ + disabled: true + }) + tt.showToast({ + title: res.message, + image: '../../static/images/success.png' + }) + } else if (res.code == 12061){ + tt.showToast({ + title: "短息已发送,稍后重试", + icon: "none", + }) + } else { + tt.showToast({ + title: res.message, + icon: "none", + }) + } + }) + } else { + tt.showToast({ + title: '手机号有误', + icon: "none", + }) + } + // }, 500) + } +}) \ No newline at end of file diff --git a/pages/forgetpwd/forgetpwd.json b/pages/forgetpwd/forgetpwd.json new file mode 100644 index 0000000..16256a8 --- /dev/null +++ b/pages/forgetpwd/forgetpwd.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarTitleText": "", + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#fff" + } \ No newline at end of file diff --git a/pages/forgetpwd/forgetpwd.ttml b/pages/forgetpwd/forgetpwd.ttml new file mode 100644 index 0000000..0b82612 --- /dev/null +++ b/pages/forgetpwd/forgetpwd.ttml @@ -0,0 +1,18 @@ + +
+ + 修改密码 + 找回密码 + 请填写你的手机号,我们会发送验证码验证身份 + + + + + + + + + + +
+
\ No newline at end of file diff --git a/pages/forgetpwd/forgetpwd.ttss b/pages/forgetpwd/forgetpwd.ttss new file mode 100644 index 0000000..d5435d1 --- /dev/null +++ b/pages/forgetpwd/forgetpwd.ttss @@ -0,0 +1,116 @@ +.forgetpwd { + width: 100%; + display: flex; + flex-direction: column; + } + + .retrievepwd { + width: 100%; + display: flex; + flex-direction: column; + position: relative; + margin-bottom: 68rpx; + } + + /* .retrievepwd view { + width: 90%; + display: flex; + margin: 0 auto; + height: 94rpx; + line-height: 94rpx; + padding-left: 4%; + position: relative; + } */ + + .input01 { + text-indent: 40rpx; + font-size: 40rpx; + color: #000; + letter-spacing: 0; + margin-top: 28rpx; + } + + .input02 { + text-indent: 40rpx; + font-size: 28rpx; + margin-top: 16rpx; + color: #000; + letter-spacing: 0; + line-height: 32rpx; + } + + .line { + width: 2rpx; + height: 22rpx; + background: #d7d7d7; + position: absolute; + left: 20%; + top: 38rpx; + } + + .retrievepwd view input { + display: inline-block; + font-size: 30rpx; + width: 460rpx; + padding-left: 40rpx; + height: 94rpx; + color: #000!important; + letter-spacing: 0; + line-height: 32rpx; + } + + .pho { + margin-top: 40rpx; + } + + .retrievepwd view:nth-child(1) input { + width: 68%; + } + + .retrievepwd view text:nth-child(4) { + color: #52a0fd; + font-size: 28rpx; + } + + .forgetpwd button { + width: 92%; + height: 94rpx; + line-height: 94rpx; + background: #52a0fd; + color: #fff; + font-size: 36rpx; + } + + .active { + opacity: 0.6; + } + + .send { + display: inline-block; + width: 210rpx !important; + border-radius: 16rpx; + margin-top: 12rpx; + margin-right: 30rpx; + font-size: 30rpx!important; + letter-spacing: 0; + padding: 0!important; + } + + button::after { + border: none; + } + + .try { + width: 32%; + display: inline-block; + background: #52a0fd; + color: #fff; + border-radius: 16rpx; + text-align: center; + opacity: 0.6; + height: 70rpx !important; + font-size: 28rpx !important; + line-height: 70rpx !important; + margin-top: 12rpx; + } + \ No newline at end of file diff --git a/pages/getMerchant/index.js b/pages/getMerchant/index.js new file mode 100644 index 0000000..9255087 --- /dev/null +++ b/pages/getMerchant/index.js @@ -0,0 +1,147 @@ +// pages/getMerchant/index.js +const config = require('../../config/config.js') +const Http = require('../../utils/HttpBasics.js') +const util = require('../../utils/util.js') +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + selectList:[], + list: [], + selectMerchant:null, + businessId:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + paramData: options + }) + this.getMerchent() + }, + getMerchent() { + let _this = this; + Http.get({ + url: config.api.getMerchentList + }) + .then(res => { + _this.setData({ + list: res.data, + selectList:res.data + }) + }) + .catch(err => { + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + checkMerchant(e){ + console.log(e) + let id=e.target.id; + this.data.selectList.map((item,index)=>{ + if(id==item.id){ + console.log(item,item.businessId) + this.setData({ + selectMerchant:item, + businessId: item.businessId + }) + } + }) + }, + submitForm(){ + if (this.data.selectMerchant!=null){ + tt.redirectTo({ + url: `/pages/operation/index?address=${this.data.paramData.address}&id=${this.data.paramData.id}&levelName=${this.data.paramData.levelName}&name=${this.data.paramData.name}&nickName=${this.data.paramData.nickName}&phone=${this.data.paramData.phone}&score=${this.data.paramData.score}&credit=${this.data.paramData.credit}&type=1&merchantName=${this.data.selectMerchant.merchantName}&merchant_id=${this.data.selectMerchant.id}&isAdmin=1&merchantType=1&businessId=${this.data.businessId}`, + }) + }else{ + tt.showToast({ + title: '抱歉,您未选择门店', + icon: 'none', + duration: 2000, + mask: false + }); + } + }, + getList(e){ + console.log(e.detail.value) + let selectList = []; + var reg = new RegExp(e.detail.value.toUpperCase()); + this.data.list.map((item,index)=>{ + if (item.merchantName.toUpperCase().match(reg) || e.detail.value==''){ + selectList.push(item) + } + }) + let haveIf=false; + selectList.map((item,index)=>{ + console.log(item,this.data.selectMerchant) + if (this.data.selectMerchant!=null&&item.id == this.data.selectMerchant.id){ + haveIf=true + } + }) + if (!haveIf){ + this.setData({ + selectMerchant:null + }) + } + // debugger + this.setData({ + selectList + }) + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/getMerchant/index.json b/pages/getMerchant/index.json new file mode 100644 index 0000000..f5e41e4 --- /dev/null +++ b/pages/getMerchant/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "消费门店", + "navigationBarTextStyle": "white" + } \ No newline at end of file diff --git a/pages/getMerchant/index.ttml b/pages/getMerchant/index.ttml new file mode 100644 index 0000000..4ebd212 --- /dev/null +++ b/pages/getMerchant/index.ttml @@ -0,0 +1,14 @@ + + + + + 消费门店 + + + + + {{item.merchantName}} + + + + \ No newline at end of file diff --git a/pages/getMerchant/index.ttss b/pages/getMerchant/index.ttss new file mode 100644 index 0000000..92fee2e --- /dev/null +++ b/pages/getMerchant/index.ttss @@ -0,0 +1,57 @@ +/* pages/getMerchant/index.wxss */ +.top{ + position: fixed; + top: 0; + left: 0; + opacity: 1; + background: #fff; + } + .footer { + width: 710rpx; + height: 126rpx; + line-height: 126rpx; + display: flex; + background: #fff; + border-radius: 20rpx; + margin-top: 40rpx; + margin-left: 20rpx; + align-self: center; + box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); + } + + .footer text { + margin-left: 31rpx; + font-size: 30rpx; + } + + .footer input { + width: 450rpx; + margin-right: 19rpx; + height: 126rpx; + line-height: 126rpx; + font-size: 30rpx; + text-align: right; + } + .merchant-list{ + width: 690rpx; + margin: 230rpx auto; + border-top: 1px solid #EAEAEA; + } + .lists{ + height: 84rpx; + line-height: 84rpx; + border-bottom: 1px dashed #EAEAEA; + font-size:30rpx; + } + .sub-button{ + position: fixed; + bottom: 30rpx; + left: 20rpx; + width:710rpx; + height:94rpx; + background:rgba(82,160,253,1); + box-shadow:0px 10rpx 22rpx 2rpx rgba(82,160,253,0.51); + border-radius:10rpx; + color: #fff; + line-height: 94rpx; + } \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..74e32af --- /dev/null +++ b/pages/index/index.js @@ -0,0 +1,705 @@ +const config = require('../../config/config.js') +const Http = require('../../utils/http.js') +const HttpBasics = require('../../utils/HttpBasics.js') +const util = require('../../utils/util') +const changeNum = require('../../utils/changeNum.js') +import * as echarts from '../../ec-canvas/echarts'; +var app = getApp() + +function setOption(chart, xdata, ydata) { + const option = { + title: { + padding: [10, 0, 0, 20], + textStyle: { + fontSize: 14, + color: '#FF6A6A' + }, + }, + backgroundColor: "#fff", + color: ["#006EFF", "#67E0E3", "#9FE6B8"], + animation: true, + grid: { + top: '3%', + left: "5%", + right: "7%", + bottom: "4%", + containLabel: true, + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: xdata, + splitLine: { + show: false + }, //去除网格线 + axisLine: { + show: false + }, + axisTick: { + show: false + } + }, + yAxis: [{ + splitLine: { + lineStyle: { + type: 'none' + } + }, + axisLine: { + show: false + }, + axisTick: { + show: false + }, + axisLabel: { + rotate: 40, + formatter: function(a, b) { + return a + } + }, + type: 'value', + }], + series: [{ + type: 'line', + data: ydata, + smooth: true, //这句就是让曲线变平滑的 + lineStyle: { + normal: { + color: '#33cdff', + } + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient( + 0, 0, 0, 1, [{ + offset: 0, + color: '#FFF' + }, { + offset: 1, + color: '#52A0FD' + }] + ) + } + }, + }] + }; + chart.setOption(option) + console.log(chart) +} +/** + * 交易记录 + */ +function getBarOption(x, y) { + return { + color: ['#FF6A6A'], + fontSize: "14rpx", + grid: { + top: '3%', + left: "5%", + right: "7%", + bottom: "4%", + containLabel: true, + }, + xAxis: { + axisLine: { + show: false + }, + axisTick: { + show: false + }, + type: 'category', + boundaryGap: false, + data: x + }, + yAxis: { + axisLine: { + show: false + }, + axisTick: { + show: false + }, + type: 'value', + splitLine: { + lineStyle: { + type: 'none' + } + }, + axisLabel: { + rotate: 40, + } + }, + series: [{ + data: y, + type: 'line', + smooth: true, + lineStyle: { + normal: { + color: '#FF6A6A', + } + }, + areaStyle: {} + }] + }; +}; +/** + * 核销记录 + */ +function getScatterOption(x, y) { + return { + color: '#FFCE00', + fontSize: "14rpx", + grid: { + top: '3%', + left: "5%", + right: "7%", + bottom: "4%", + containLabel: true, + }, + xAxis: { + axisLine: { + show: false + }, + axisTick: { + show: false + }, + type: 'category', + boundaryGap: false, + data: x + }, + yAxis: { + axisLine: { + show: false + }, + axisTick: { + show: false + }, + type: 'value', + splitLine: { + lineStyle: { + type: 'none' + } + }, + axisLabel: { + rotate: 40, + } + }, + series: [{ + data: y, + type: 'line', + smooth: true, + areaStyle: {} + }] + }; +}; +/** + * 获取交易记录 + */ +function getTabletListOrder() { + let newArr = { + xList: [], + amountList: [] + } + return new Promise((resolve, reject) => { + Http.getRequest(config.api.dateAmountRecordListOrder, app.globalData.token, '', {}, (res) => { + // 日期 + res.data && res.data.map(file => { + newArr.xList.push(file.mouthAndDate) + newArr.amountList.push(file.amountStr) + }) + resolve(newArr); + }) + }) +}; + +/** + * 获取核销记录 + */ +function getTabletListVerify() { + let newArr = { + xList: [], + amountList: [] + } + return new Promise((resolve, reject) => { + Http.getRequest(config.api.dateAmountRecordListVerified, app.globalData.token, '', {}, (res) => { + // 日期 + res.data && res.data.map(file => { + newArr.xList.push(file.mouthAndDate) + newArr.amountList.push(file.amountStr) + }) + resolve(newArr) + }) + }) +}; +Page({ + data: { + token:'', + currentIndex: 0, + userInfo: {}, + recordMoney: 0, + recordData: [], + userInfoLoadIf: false, + ec: { + lazyLoad: true + }, + classIfyList: [ + // { + // text: '收银台', + // icon: 'iconfont icon-shouyintai1', + // id: 3 + // }, + { + text: '会员核销', + icon: 'iconfont icon-hexiao', + id: 0 + }, + // { + // text: '消费卡收款', + // icon: 'iconfont icon-shouye1', + // id: 1 + // }, + // { + // text: '当日解单', + // icon: 'iconfont icon-shoufukuan', + // id: 2 + // }, + { + text: '会员积分', + icon: 'iconfont icon-jifen', + id: 4 + }, + // { + // text: '会员赠券', + // icon: 'iconfont icon-quan', + // id: 5 + // }, + { + text: '营销结算', + icon: 'iconfont icon-jiesuan', + id: 6 + }, + // { + // text: '商户建券', + // icon: 'iconfont icon-lingquanzhongxin', + // id: 7 + // }, + // { + // text: '商品配送', + // icon: 'iconfont icon-wuliu', + // id: 8 + // } + + ], + amountMoney: '', + djZmoney:'', + writeOffMoney: '', + getFullYear: new Date().getFullYear(), + getMonth: new Date().getMonth() + 1, + getDate: new Date().getDate(), + dateTime: '', + show: null, + billList: [], + ifShowChart: null, + ifShowChart1: null, + ifShowChart2: null, + ecBar: { + lazyLoad: true + }, + ecScatter: { + lazyLoad: true + }, + djArr:[], + djMoney:[], + count:'' + }, + //获取商户信息 + getUserInfo() { + return new Promise((resolve, reject) => { + Http.getRequest(config.api.userDetail, app.globalData.token, '', {}, (res) => { + resolve(res.data); + }) + }) + }, + //今日交易额 + getUnverifiedAmountOnDate() { + let { + getFullYear, + getMonth, + getDate, + amountMoney, + writeOffMoney + } = this.data + let dateTimer = getFullYear + '-' + getMonth + '-' + getDate + Http.getRequest(config.api.getUnverifiedAmountOnDate, app.globalData.token, '', { + date: dateTimer + }, (res) => { + console.log(res) + this.setData({ + amountMoney: res.data.amount, + count: res.data.orderCount, + }) + }) + }, + //今日核销额 + getVerifiedAmountOnDate() { + let { + getFullYear, + getMonth, + getDate + } = this.data + let dateTimer = getFullYear + '-' + getMonth + '-' + getDate + Http.getRequest(config.api.getVerifiedAmountOnDate, app.globalData.token, '', { + date: dateTimer + }, (res) => { + this.setData({ + writeOffMoney: res.data.amount + }) + }) + }, + onPullDownRefresh: function() { + let that = this; + // that.getUnverifiedAmountOnDate() + // that.getVerifiedAmountOnDate(); + that.getpaybill(); + if (that.oneComponent) { + that.getrecordData(); + } + if (that.jiaoyiComponent) { + that.getTabletListOrder(); + } + if (that.hexiaoComponent) { + that.getTabletListVerify(); + } + tt.hideNavigationBarLoading(); + tt.stopPullDownRefresh(); + }, + onLoad: function (options) { + var that = this; + this.checkuserstatus() + }, + onReady() { + // this.oneComponent = this.selectComponent('#mychart-pament'); + // this.jiaoyiComponent = this.selectComponent('#mychart-jiaoyi'); + // this.hexiaoComponent = this.selectComponent('#mychart-hexiao'); + this.getrecordData(); + this.getTabletListOrder(); + this.getTabletListVerify(); + this.getUserInfo().then(res => { + this.setData({ + userInfo: res, + userInfoLoadIf:true + }) + app.globalData.merchant = res; + tt.setNavigationBarTitle({ + title: res.mall_name + "(" + res.merchant_name + ")" + }) + }) + app.globalData.userInfo = this.getUserInfo; + }, + /** + * gotolook + */ + gotobill: function(e) { + console.log(e) + let owe = e.currentTarget.dataset.data.owe; + let status = e.currentTarget.dataset.data.status; + let receivedate = e.currentTarget.dataset.data.receiveDate; + let starttime = e.currentTarget.dataset.data.starttime; + let endtime = e.currentTarget.dataset.data.endtime; + let id = e.currentTarget.dataset.data.id; + var transactionId = e.currentTarget.dataset.data.transactionId; + var priceDetail = e.currentTarget.dataset.data.priceDetail; + var freeze = e.currentTarget.dataset.data.freeze; + + let pay = e.currentTarget.dataset.data.pay ? e.currentTarget.dataset.data.pay : 0; + let latePayPrice = e.currentTarget.dataset.data.latePayPrice ? e.currentTarget.dataset.data.latePayPrice : 0; + let serviceChargePay = e.currentTarget.dataset.data.serviceChargePay ? e.currentTarget.dataset.data.serviceChargePay : 0; + if (starttime && endtime) { + var end = starttime + "至" + endtime; + } else { + var end = ""; + } + if (transactionId) { + var tradeTime = e.currentTarget.dataset.data.tradeTime; + } else { + var tradeTime = e.currentTarget.dataset.data.payDate; + } + console.log(e.currentTarget.dataset.data, tradeTime, 6666666) + var billTypeValue = e.currentTarget.dataset.data.billTypeValue; + let receivePay = e.currentTarget.dataset.data.receivePay; + tt.navigateTo({ + url: `/pages/bill/billdetail/index?owe=${owe}&receivedate=${receivedate}&status=${status}&end=${end}&id=${id}&tradeTime=${tradeTime}&transactionId=${transactionId}&priceDetail=${priceDetail}&billTypeValue=${billTypeValue}&receivePay=${receivePay}&freeze=${freeze}&pay=${pay}&latePayPrice=${latePayPrice}&serviceChargePay=${serviceChargePay}`, + }) + }, + /** + * 核销记录 + */ + // hexiaoInit: function(heXiaox, heXiaoYiy) { + // this.hexiaoComponent.init((canvas, width, height) => { + // const barChart = echarts.init(canvas, null, { + // width: width, + // height: height + // }); + // canvas.setChart(barChart); + // barChart.setOption(getScatterOption(heXiaox, heXiaoYiy)); + // return barChart; + // }); + // }, + /** + * 交易记录 + */ + // jiaoyiInit: function(jiaoYix, jiaoYiy) { + // this.jiaoyiComponent.init((canvas, width, height) => { + // const barChart = echarts.init(canvas, null, { + // width: width, + // height: height + // }); + // canvas.setChart(barChart); + // barChart.setOption(getBarOption(jiaoYix, jiaoYiy)); + // return barChart; + // }); + // }, + + // init_one: function(xdata, ydata) { //初始化第一个图表 + // console.log(this.oneComponent, xdata, ydata) + // this.oneComponent.init((canvas, width, height) => { + // const chart = echarts.init(canvas, null, { + // width: width, + // height: height + // }); + // console.log(chart, xdata, ydata) + // setOption(chart, xdata, ydata) + // this.chart = chart; + // return chart; + // }); + // }, + toWriteoff(e) { + console.log(e) + let id = e.currentTarget.dataset.id + console.log(id) + if (id == 0) { + tt.navigateTo({ + url: '/pages/scan/scan', + }) + } else if (id == 1) { + // 优惠卡收款 + tt.navigateTo({ + url: '/pages/cardReceive/cardReceive', + }) + } else if (id == 2) { + tt.navigateTo({ + url: '/pages/main/solution/solution', + }) + } else if (id == 3) { + tt.navigateTo({ + url: '/pages/payment/index', + }) + } else if (id == 4) { + tt.navigateTo({ + url: '/pages/creditSelect/index', + }) + } else if (id == 5) { + tt.navigateTo({ + url: '/pages/incouponSelect/index', + }) + } else if (id == 6) { + tt.navigateTo({ + url: '/pages/marktingsettlement/marktingsettlement', + }) + }else if(id==7){//用户发卷 + tt.navigateTo({ + url: '/pages/sendDiscounts/sendDiscounts', + }) + } else if (id == 8) {//商品配送 + tt.navigateTo({ + url: '/pages/delivery/delivery', + }) + } + }, + toTran(e) { + let type = e.currentTarget.dataset.type + tt.navigateTo({ + url: `./transaction/transaction?type=${type}`, + }) + }, + onShow() { + let that = this; + /** + * 交易记录 + */ + if (that.oneComponent) { + that.getrecordData(); + } + if (that.jiaoyiComponent) { + that.getTabletListOrder(); + } + if (that.hexiaoComponent) { + that.getTabletListVerify(); + } + /** + * 获得交易记录和核销额 + */ + that.getUnverifiedAmountOnDate(); + that.getVerifiedAmountOnDate(); + that.getpaybill(); + that.setData({ + currentIndex: 0 + }) + }, + getpaybill: function() { + let that = this; + that.getUserInfo().then(res => { + Http.postRequest(config.api.listBillOweAndWaitPay, app.globalData.token, '', { + merchantId: res.merchant_id, + tenantId: res.tenant_id, + }, (res) => { + console.log(res); + if (res) { + res.data.map(file => { + if (file.starttime && file.endtime) { + file.end = file.starttime.substring(0, 7).replace(/-/g, ".") + "-" + file.endtime.substring(0, 7).replace(/-/g, "."); + } else { + file.end = ""; + file.endtime = "" + } + file.receiveDate = util.fmtDate(file.receiveDate); + }) + that.setData({ + billList: res.data, + djArr : res.data.filter(item => item.status == 2), + }) + that.data.djMoney = that.data.djArr.map(item => parseInt(item.owe / 100)) + let money = 0 + that.data.djMoney.filter(function (item, index) { + money += item; + }) + that.setData({ + djZmoney: changeNum.changePeoNumber(money) + }) + } + }) + }) + }, + + getTabletListVerify: function() { + let that = this; + getTabletListVerify() + .then(res => { + if (res.xList.length > 0 && res.amountList.length > 0) { + that.setData({ + ifShowChart1: 'show1' + }) + // that.hexiaoInit(res.xList, res.amountList) + } else { + /** + * 判断是否显示数据表 + */ + that.setData({ + ifShowChart1: 'show' + }) + } + }) + }, + /** + * 交易 + */ + getTabletListOrder: function() { + let that = this; + getTabletListOrder() + .then(res => { + console.log(res); + if (res.xList.length > 0 && res.amountList.length > 0) { + // that.jiaoyiInit(res.xList, res.amountList) + that.setData({ + ifShowChart: 'show1' + }) + } else { + /** + * 判断是否显示数据表 + */ + that.setData({ + ifShowChart: 'show' + }) + } + }) + }, + /** + * 收银记录 + */ + getrecordData() { + let _this = this; + HttpBasics.get({ + url: config.api.getMicroPayAmountOnDate + }) + .then(res => { + _this.setData({ + recordMoney: res.data.amount + }) + }) + .catch(err => { + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + HttpBasics.get({ + url: config.api.listMicropay + }) + .then(res => { + let dataX = []; + let dataY = []; + if (res.data && res.data.length > 0) { + _this.setData({ + ifShowChart2: "show1" + }) + res.data.map((item, index) => { + dataX.push(item.mouthAndDate) + dataY.push(Number(item.amountStr)) + }) + // _this.init_one(dataX, dataY) + } else { + _this.setData({ + ifShowChart2: "show" + }) + } + }) + .catch(err => { + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + toTran(e) { + let type = e.currentTarget.dataset.type + tt.navigateTo({ + url: `/pages/transaction/transaction?type=${type}`, + }) + }, + toRecord() { + tt.navigateTo({ + url: `/pages/record/list/index`, + }) + }, + + checkuserstatus() { + let _this = this; + HttpBasics.get({ + url: config.api.checkPhoneStatus + }) + .then(res => { + }) + .catch(err => { + if (err.code == 11005) { + tt.redirectTo({ + url: `/pages/getuserinfo/index` + }) + } + }); + }, + +}) + diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..04b9459 --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1,10 @@ +{ + "backgroundTextStyle": "dark", + "navigationBarBackgroundColor": "#52A0FD", + "navigationBarTitleText": "", + "navigationBarTextStyle": "white", + "enablePullDownRefresh": true, + "usingComponents": { + "ec-canvas": "../../ec-canvas/ec-canvas" + } +} \ No newline at end of file diff --git a/pages/index/index.ttml b/pages/index/index.ttml new file mode 100644 index 0000000..9ff615d --- /dev/null +++ b/pages/index/index.ttml @@ -0,0 +1,106 @@ + + + + + + + + + + + {{userInfo.mall_name}}({{userInfo.merchant_name}}) + + + + + + + {{billList.length}} + + + + + + 欠缴 + 待缴 + {{item.name}}{{item.end}} + {{item.owe/100}}元 + + + + + + + + + + + + {{item.text}} + + + + + + + 交易记录 + + 今日交易额:{{amountMoney/100}}元 + + + + + + + 暂无数据 + + + + + + 核销记录 + + 今日核销额:{{writeOffMoney/100}}元 + + + + + + + + \ No newline at end of file diff --git a/pages/index/index.ttss b/pages/index/index.ttss new file mode 100644 index 0000000..1a92830 --- /dev/null +++ b/pages/index/index.ttss @@ -0,0 +1,431 @@ +@import "../../iconfont.ttss"; + +/* .top { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 10 80; + padding-bottom: 200rpx; +} */ + +page { + background: #f8f8fa; +} +.img{ + display: block; + width: 160rpx; + margin: 0 auto; +} +@font-face { + font-family: 'iconfont'; /* project id 1353693 */ + src: url('//at.alicdn.com/t/font_1353693_mi95v4vvx8n.eot'); + src: url('//at.alicdn.com/t/font_1353693_mi95v4vvx8n.eot?#iefix') format('embedded-opentype'), + url('//at.alicdn.com/t/font_1353693_mi95v4vvx8n.woff2') format('woff2'), + url('//at.alicdn.com/t/font_1353693_mi95v4vvx8n.woff') format('woff'), + url('//at.alicdn.com/t/font_1353693_mi95v4vvx8n.ttf') format('truetype'), + url('//at.alicdn.com/t/font_1353693_mi95v4vvx8n.svg#iconfont') format('svg'); +} +.iconfonts { + display: inline-block; + vertical-align: middle; + width: 40rpx; + height: 40rpx; + margin-top: -7rpx; + margin-right: -26rpx; +} + +.firstPage { + width: 100%; + height: 100%; +} + +.location { + position: relative; + width: 100%; + font-size: 30rpx; + text-align: left; + color: #fff; +} +.fix image { + position: absolute; + top: 0; + width: 100%; + height: 168rpx; + left: 0; + right: 0; + z-index: 10; +} +.location image { + position: absolute; + top: 0; + width: 100%; + height: 168rpx; + left: 0; + right: 0; + z-index: 10; +} + +.location text { + display: block; + text-align: left; + position: relative; + z-index: 100; + font-size: 30rpx; + color: #000; + letter-spacing: 1.16rpx; +} +.fix{ + margin-bottom: 10rpx; +} +.writeOff { + width: 100%; + height: 24.5%; + margin-top: 10rpx; +} +.writeOff>text { + width: 92%; + height: 50rpx; + display: block; + font-size: 30rpx; + font-weight: bold; + padding-top: 1.4%; + margin: 0 auto; +} +.topBox{ + position: relative; + z-index: 1000; + background: #fff; + width: 570rpx; + margin: 20rpx auto 0; + border-top: 1px solid #f6f5f5; + padding: 30rpx 70rpx; + box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.05); + color: #000; + border-radius:32rpx; +} +.topBox view{ + display: flex; + flex-direction: column; + text-align: center; +} +.topBox2{ + position: relative; + z-index: 1000; + background: #fff; + height: 240rpx; + width: 710rpx; + margin: 20rpx auto; + color: #000099; + display: flex; + flex-direction: column; + text-align: center; + border-radius:32rpx; +} +.imgBox{ + width: 120rpx; + height: 120rpx; + margin: 20rpx auto; +} +.topBox2 image{ + width: 120rpx; + height: 120rpx; + margin: 20rpx auto; +} +.name{ + font-size: 30rpx; + text-align: center; + height: 60rpx; + line-height: 60rpx; +} +.left>text:nth-child(2), .right>text:nth-child(2){ + font-size: 80rpx; + margin: 10rpx 0; + color:#FD782D; +} +.left>text,.right>text{ + width: 255rpx; + overflow: hidden; + text-overflow:ellipsis; + white-space: nowrap; + color: #475669; +} + +.left>text:nth-child(3),.right>text:nth-child(3){ + color:#475669; +} +.classification { + position: relative; + z-index: 1000; + width: 710rpx; + margin: 0 auto; + display: flex; + flex-wrap: wrap; +} + +.classification>view { + background: #FFF; + text-align: center; + width: 19.5%; + border: .1rpx #eee solid; + display: flex; + flex-direction: column; + padding-bottom: 30rpx ; + border-left: none!important; +} +.classification>view:nth-child(1) { + border-radius: 16rpx 0 0 0; +} +.classification>view:nth-child(6) { + border-radius:0 0 0 16rpx; + border-top: none!important; +} +.classification>view:nth-child(7),.classification>view:nth-child(8) { + border-top: none!important; +} +.classification>view:nth-child(5) { + border-right: none!important; + border-radius:0 16rpx 0 0; +} +.classification>view:nth-child(10) { + border-top: none!important; + border-right: none!important; + border-radius:0 0 16rpx 0; +} +.classification>view>view { + width: 110rpx; + height: 110rpx; + border-radius: 50%; + text-align: center; + margin: 0 auto; + line-height:110rpx; +} +.icon-shoufukuan{ + color: rgb(91, 115, 255); +} +.icon-hexiao{ + color: #EEAF5C; +} +.icon-shouye1{ + color: #FF3A1D; +} +.icon-shouyintai1{ + color: rgb(33, 158, 214); +} +.icon-jifen{ + color: #00cd00; +} +.icon-quan{ + color: #FF5183; +} +.icon-jiesuan{ + color:#1296db; +} +.icon-lingquanzhongxin{ + color: #EEAF5C; +} +.icon-wuliu{ + color:#1296db; + font-size: 72rpx !important; +} +.active { + opacity: 0.6; +} + +.actives { + opacity: 0.6; +} +.classification>view>view icon { + font-size: 60rpx; +} +.classification>view>text { + font-size: 24rpx; + color: #475669; + letter-spacing: 2rpx; + line-height: 26rpx; +} + +.transaction { + position: relative; + height:280rpx; +} +.reportForm { + background: #fff; +} + +.toTransaction { + width: 92%; + height: 87rpx; + display: flex; + justify-content: space-between; + padding: 0 4% 20rpx; + line-height: 87rpx; + background: #fff; +} + +.toTransaction>view:nth-child(1) text { + font-size: 30rpx; + color: #000; + letter-spacing: 1.16rpx; +} + +.toTransaction>view:nth-child(2) { + font-size: 28rpx; + color: #919191; + text-align: right; +} + +.reportForm { + position: relative; + width: 100%; + height: 245rpx; +} + +.Fill { + color: #fff; + background: #fff; +} + +.jiaoyi { + position: relative; + z-index: 1; + width: 710rpx; + margin: 0 auto; + border-radius: 16rpx; + margin-top: 30rpx; + overflow: hidden; + margin-bottom: 30rpx; + background:#fff; + padding-bottom: 30rpx; + box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.05); +} + +.swiper_container { + position: relative; + z-index: 100; + height: 80rpx; + line-height: 80rpx; + width: 100%; +} + +.swiper_item { + position: relative; + z-index: 1000; + font-size: 28rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + letter-spacing: 2px; + color: #fff; +} + +.swiper_item text { + display: inline-block; + text-align: left; +} + +.title { + height: 80rpx; + line-height: 80rpx; + text-indent: 0.5em; + font-size: 28rpx; + color: #fff; + background: #52a0fd; +} + +.number { + color: red; +} + +.message { + position: absolute; + z-index: 1000; + left: 20rpx; + top: 0; + bottom: 0; + margin: auto; + width: 40rpx; + height: 40rpx; +} + +.message text { + font-size: 26rpx; + display: block; + height: 40rpx; + line-height: 36rpx; + width: 100%; + text-align: center !important; + position: relative; + z-index: 10; + text-indent: 0 !important; + color: #FFF; +} + +.message image { + position: absolute��important; + z-index: 1; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin: auto; +} + +.state1 { + color: red !important; + margin-left: 80rpx; + margin-right: 10rpx; +} + +.state2 { + color: #ffce00 !important; + margin-left: 80rpx; + margin-right: 10rpx; +} + +.billtype { + margin-right: 10rpx; +} +.nothave{ + text-align: center; + color: #afd9eb; + font-size: 30rpx; + margin-top: 15rpx; +} +.nothave1{ + font-size: 30rpx; + color: #ffc3c2; + text-align: center; + margin-top: 15rpx; +} +.nothave2{ + font-size: 30rpx; + color: #FFCE00; + text-align: center; + margin-top: 15rpx; +} +.container{ + width: 100%; + height: 240rpx; + position: relative; +} + +#mychart-pament { + position: absolute; + top: 0; + height: 100%; + left: 0; + right: 0; +} +/* .fix{ + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 10; +} */ +.jiaoyi2{ + /* margin-top: 333rpx; */ + position: relative; + z-index: 1; +} diff --git a/pages/login/login.js b/pages/login/login.js new file mode 100644 index 0000000..71e0813 --- /dev/null +++ b/pages/login/login.js @@ -0,0 +1,216 @@ +const config = require('../../config/config.js') +const app = getApp() +const Common = require('../../common/common.js') +const Http = require('../../utils/http.js') +const HttpBasics = require('../../utils/HttpBasics.js') + +Page({ + data: { + logo: '../../assets/images/logo.png', + phone: '', + pwd: '', + status:'', + showpass: "hidepass", + focus:false, + password: true + }, + onLoad() { + Common.getMallIcon() + .then(data => { + // debugge + console.log(data,777) + this.setData({ + logo: data.data&&data.data.mallImgUrl ? data.data.mallImgUrl : '../../assets/images/logo.png', + }) + }) + }, + onShow() { + var that = this; + var phone = tt.getStorageSync("phone"); + var pwd = tt.getStorageSync("pwd"); + that.ttLogin(); + if (phone) { + that.setData({ + phone: phone + }); + } + if (pwd) { + that.setData({ + pwd: pwd + }); + } + }, + //显示具体的密码 + showpassword:function(){ + console.log(this.data.password); + let that = this; + if (that.data.password){ + that.setData({ + password: false, + focus:true + }) + }else{ + that.setData({ + password: true, + focus: true + }) + } + }, + ttLogin(flag){ + let that = this; + tt.login({ + success: res => { + Common.getSuperOpenId(res.code) + .then(res => { + console.log(res) + if (res.data&& res.data.data&&res.data.data.openId){ + app.globalData.superopenId = res.data.data.openId; + } + if (res.data && res.data.data && res.data.data.session_key){ + app.globalData.session_key = res.data.data.session_key; + } + if (res.data.code == 200) { + app.globalData.phone = res.data.data.phone; + that.setData({ + ifAlBoss: true, + status: "use" + }) + if (flag =='fromgetPhoneNumber'){ + tt.navigateTo({ + url: `/pages/datatower/datatower?superopenId=${app.globalData.superopenId}&phone=${app.globalData.phone}`, + }) + } + + } else { + if (flag =='fromgetPhoneNumber'){ + tt.showToast({ + title: res.data.message, + icon: "none", + duration: 2000 + }) + } + } + }).catch(error => { + console.log(error,"error"); + that.setData({ + error: error.message + }) + }) + } + }) + }, + showpass: function () { + let that = this; + }, + forgetPwd: function () { + tt.navigateTo({ + url: '/pages/index/forgetpwd/forgetpwd', + }) + }, + getLoginInfo(e) { + var phoneReg = /^1[0|1|2|3|4|5|6|7|8|9]\d{9}$/; + let { + phone, + pwd + } = e.detail.value; + if (phoneReg.test(phone)) { + if (pwd != '') { + Common.userLogin(phone, pwd, app.globalData.latitude, app.globalData.longitude) + .then(res => { + console.log(res); + if (res.code == 200) { + HttpBasics.setBUserId(res.data.bUserId); + tt.setStorageSync("phone", phone); + tt.setStorageSync("pwd", pwd); + tt.setStorageSync("bUserId", res.data.bUserId); + app.globalData.bUserId = res.data.bUserId; + tt.setStorage({ + key: 'bUserId', + data: res.data.bUserId, + }) + tt.login({ + success:function(res){ + Common.getOpenId(res.code,app.globalData.bUserId) + .then(res => { + console.log(res,888) + app.globalData.openId = res.data.data.openId; + app.globalData.token = res.data.data.token; + HttpBasics.setToken(res.data.data.token); + tt.setStorageSync("openId", res.data.data.openId); + tt.setStorageSync("session_key", res.data.data.session_key); + tt.showToast({ + image: './../../assets/images/success.png', + title: '登录成功', + }) + tt.switchTab({ + url: '/pages/index/index', + success(res) { + console.log(`${res}`); + }, + fail(err) { + console.log(err,`switchTab调用失败`); + }, + }) + }) + } + }) + } else { + tt.showToast({ + image:'./../../assets/images/fail.png', + title: res.message, + icon: "none" + }) + } + }) + } else { + tt.showToast({ + image: './../../assets/images/fail.png', + title: '密码不能为空', + icon: "none", + }) + } + } else { + tt.showToast({ + image: './../../assets/images/fail.png', + title: '手机号有误', + icon: "none" + }) + } + }, + /** + * 获得超级管理员手机号 + */ + getPhoneNumber: function (e) { + this.ttLogin("fromgetPhoneNumber"); + if (app.globalData.superopenId && app.globalData.session_key){ + let { encryptedData, iv } = { encryptedData: e.detail.encryptedData, iv: e.detail.iv }; + if (encryptedData && iv) { + Common.getUserPhone(encryptedData, iv, app.globalData.superopenId, app.globalData.session_key) + .then(res => { + if (res.data.code == 200 && res.data.data.admin == 1) { + app.globalData.phone = res.data.data.phone; + tt.navigateTo({ + url: `/pages/datatower/datatower?superopenId=${app.globalData.superopenId}&phone=${app.globalData.phone}`, + }) + } + }) + } + } + }, + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function (res) { + let _this = this; + return { + title: '数据塔台', + path: 'pages/index/index', + success: function (res) { + // 转发成功 + }, + fail: function (res) { + // 转发失败 + } + } + }, +}) \ No newline at end of file diff --git a/pages/login/login.json b/pages/login/login.json new file mode 100644 index 0000000..cbb1095 --- /dev/null +++ b/pages/login/login.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarTitleText": "登录", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#52A0FD" +} \ No newline at end of file diff --git a/pages/login/login.ttml b/pages/login/login.ttml new file mode 100644 index 0000000..61c8b48 --- /dev/null +++ b/pages/login/login.ttml @@ -0,0 +1,30 @@ + + +
+ + + + + + +
+ +
\ No newline at end of file diff --git a/pages/login/login.ttss b/pages/login/login.ttss new file mode 100644 index 0000000..edc0a23 --- /dev/null +++ b/pages/login/login.ttss @@ -0,0 +1,142 @@ +.adminlogo{ + width: 100rpx; + display: block; + margin: 0 auto; + } + .logoin_wrap { + width: 100%; + display: flex; + flex-direction: column; + } + + .login { + width: 100%; + display: flex; + flex-direction: column; + position: relative; + } + .inp{ + color: #666; + } + .login view { + position: relative; + width: 88%; + display: flex; + margin: 0 auto; + height: 100rpx; + line-height: 100rpx; + border-bottom: 1rpx solid #DADADA; + } + + .line { + width: 2rpx; + height: 22rpx; + background: #d7d7d7; + position: absolute; + left: 20%; + top: 38rpx; + } + + .login view input { + font-size: 34rpx; + height: 100rpx; + line-height: 100rpx; + } + + .login view:nth-child(1) input { + /* padding-left: 60rpx; */ + font-size: 34rpx; + height: 100rpx; + line-height: 100rpx; + } + .eye{ + display: inline-block; + width: 50rpx; + margin-top:26rpx; + } + + .logo { + width: 320rpx; + margin: 100rpx auto 30rpx; + } + + .logo image { + display: block; + width: 320rpx; + } + + .button { + background: #52A0FD; + border-radius: 8rpx; + color: #fff; + margin-top: 8%; + font-size: 36rpx; + width: 90%; + } + .active{ + opacity: .4; + } + + .logoin_wrap navigator { + display: block; + width: 25%; + margin: 0 auto; + text-align: right; + margin-top: 15rpx; + } + + .logoin_wrap navigator text { + display: block; + text-align: center; + /* padding-top: 1.5%; */ + font-size: 26rpx; + height: 45rpx; + color: #404040; + letter-spacing: 0; + line-height: 45rpx; + } + .forget{ + text-align: right; + padding:0 40rpx; + color: #999; + margin-top: 20rpx; + } + .forget text{ + font-size: 26rpx; + } + .defaultLogo{ + position: absolute; + bottom: 40rpx; + left: 0; + right: 0; + margin: auto; + } + .defaultLogo text { + display: block; + text-align: center; + color: #52A0FD; + font-size: 22rpx; + } + + .defaultLogo image { + width: 200rpx; + } + .phone{ + display: block!important; + background: none!important; + color: #999!important; + font-size: 26rpx!important; + padding: 0!important; + margin-top: 40rpx!important; + } + button::after{ border: none; } + .showpassword{ + padding: 30rpx; + width: 40rpx; + position: absolute; + z-index: 100; + right: 20rpx; + top: 0; + bottom: 0; + margin: auto; + } \ No newline at end of file diff --git a/pages/marktingsettlement/marktingsettlement.js b/pages/marktingsettlement/marktingsettlement.js new file mode 100644 index 0000000..8938f7b --- /dev/null +++ b/pages/marktingsettlement/marktingsettlement.js @@ -0,0 +1,373 @@ +var app = getApp(); +const config = require('../../config/config.js') +const util = require('../../utils/util.js') +const Http = require('../../utils/HttpBasics.js') +Page({ + data: { + data: { + list: [] + }, //数据 + crollTop: 0, + scrollHeight: 0, + house_type: 0, //户型 + house_style: 0, //风格 + house_area: 0, //面积 + flagdate: null, + list: [], + tabTxt: [{ + title: '全部', + idss: 0 + }, + { + title: '日期', + idss: 1 + }, + { + title: '类型', + idss: 2 + }, + { + title: '状态', + idss: 3 + }, + { + title: '来源', + idss: 4 + } + ], + showList: null, + loading: "", + tab: [true, true, true, true, true], + disabled: false, //加载更多按钮状态 + page: 1, //当前页码 + hasMore: false, //加载更多按钮 + moreTxt: '点击加载更多', + dataNull: true, + status:'', + type:'', + source:'', + date: "", + date2: "", + idss: 0, + subsidy:'', + pageNum: 1, //第几页 + height: null, + billtypes: [{ + name: '自主结算', + billTypeValue: 1, + id: 1 + }, + { + name: '微信分账', + billTypeValue: 2, + id: 2 + } + ], + statustypes: [ + { + name: '未结算', + status: 0, + id: 0 + }, + { + name: '已结算', + status: 1, + id: 1 + } + ], + //结算来源 + auditWayOptions: [ + /* { + name: "全部", + value: '' + }, */ + { + name: "补贴", + value: 0, + id: 0 + }, + { + name: "卡消费", + value: 1, + id: 1 + }, + { + name: "券核销", + value: 2, + id: 2 + }, + { + name: "砍价核销", + value: 3, + id: 3 + }, + { + name: "拼团核销", + value: 4, + id: 4 + }, + { + name: "收银分账", + value: 5, + id: 5 + }, + { + name: "可配送商品", + value: 6, + id: 6 + }, + ], + starttime: null, + endtime: null, + billTypeValue: null + }, + // 选项卡 + filterTab: function (e) { + let that = this; + console.log(e); + that.setData({ + loading: "" + }) + that.setData({ + idss: e.target.dataset.idss || e.currentTarget.dataset.idss, + pageNum: 1 + }) + if (e.currentTarget.dataset.idss===0){ + this.setData({ + source: '', + type: '', + status: '', + date: '', + date2: '' + }) + this.getList(1) + this.getTotleData() + } + var data = [true, true, true, true, true], + index = e.currentTarget.dataset.index; + data[index] = !that.data.tab[index]; + that.setData({ + tab: data + }) + }, + bindDateChange1: function (e) { + if (new Date(e.detail.value).getTime() > new Date(this.data.date2).getTime()){ + tt.showToast({ + title: '抱歉,开始日期不能大于结束日期', + icon: 'none', + duration: 2000, + mask: false + }); + return; + } + this.setData({ + date: e.detail.value, + }) + }, + bindDateChange2: function (e) { + if (new Date(e.detail.value).getTime() < new Date(this.data.date).getTime()) { + tt.showToast({ + title: '抱歉,结束日期不能小于开始日期', + icon: 'none', + duration: 2000, + mask: false + }); + return; + } + this.setData({ + date2: e.detail.value + }) + }, + search(e){ + console.log(e.currentTarget.dataset.ids) + let type = e.currentTarget.dataset.ids; + if(type==0){ + this.setData({ + source:'', + type:'', + status:'', + date:'', + date2:'' + }) + } else if(type == 1){ + if(!this.data.date){ + tt.showToast({ + title: '抱歉请选择开始日期', + icon: 'none', + duration: 2000, + mask: false + }); + return; + } else if (!this.data.date2){ + tt.showToast({ + title: '抱歉请选择结束日期', + icon: 'none', + duration: 2000, + mask: false + }); + return; + } + } else if (type == 2) { + this.setData({ + type:e.currentTarget.dataset.id + }) + } else if (type == 3) { + console.log(e.currentTarget.dataset.id) + this.setData({ + status: e.currentTarget.dataset.id + }) + } else if (type == 4) { + this.setData({ + source: e.currentTarget.dataset.id + }) + } + var data = [true, true, true, true, true]; + this.setData({ + tab: data + }) + this.getList(1) + this.getTotleData() + }, + onShow() { + this.getList(1) + this.getTotleData() + }, + formatData(data) { + let arr = []; + data.map((item, index) => { + let a = {}; + a.value = [item]; + a.dateR = item.createDate01; + let indexSt = 0; + let haveIf = false; + console.log(item, this.data.auditWayOptions, 1111) + console.log(item.sourceStr, item.typeStr, item.statusStr, 222) + arr.map((item01, index01) => { + if (item.id == item01.id) { + indexSt = index01; + haveIf = true; + } + }) + if (haveIf && (new Date(item.createDate)).valueOf() >= (new Date(this.data.date + ' 00:00:00')).valueOf() && (new Date(item.createDate)).valueOf() <= (new Date(this.data.date2 + ' 23:59:59')).valueOf()) { + arr[indexSt].value.push(item) + } else if ((new Date(item.createDate)).valueOf() >= (new Date(this.data.date + ' 00:00:00')).valueOf() && (new Date(item.createDate)).valueOf() <= (new Date(this.data.date2 + ' 23:59:59')).valueOf()) { + arr.push(a) + } + }) + this.setData({ + allBillList: arr + }) + console.log(arr, 888888888888) + }, + getTotleData(){ + let _this = this; + Http.get({ + url: config.api.getSubsidySummary, + data: { + startdate: this.data.date?this.data.date + " 00:00:00":'', + enddate: this.data.date2?this.data.date2 + " 23:59:59":'', + source: this.data.source, + type: this.data.type, + status: this.data.status + } + }) + .then(res => { + console.log(res,777) + _this.setData({ + subsidy: Number(Number(res.data.subsidy)/100).toFixed(2) + }) + tt.stopPullDownRefresh(); + }) + .catch(err => { + tt.stopPullDownRefresh(); + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + getList: function (page) { + let _this = this; + Http.get({ + url: config.api.getSubsidyList, + data: { + pageNum: page, + pageSize: 10, + startdate: this.data.date ? this.data.date + " 00:00:00" : '', + enddate: this.data.date2 ? this.data.date2 + " 23:59:59" : '', + source: this.data.source, + type: this.data.type, + status: this.data.status + } + }) + .then(res => { + tt.stopPullDownRefresh(); + let data = res.data.list; + let allBillList = []; + if (page == 1) { + allBillList = res.data.list; + } else { + allBillList = _this.data.allBillList; + } + data.map((item, index) => { + let haveIf = false; + item.createDate01 = util.formatTime(item.createDate, 'yyyy-MM-dddd hh:mm:ss') + item.sourceStr = this.data.auditWayOptions.filter(e => e.value == item.source).length > 0 ? this.data.auditWayOptions.filter(e => e.value == item.source)[0].name : ''; + item.typeStr = this.data.billtypes.filter(e => e.id == item.type).length > 0 ? this.data.billtypes.filter(e => e.id == item.type)[0].name : ''; + item.statusStr = item.status===0?'未结算' : "已结算"; + allBillList.map((item02, index02) => { + if (item02.id == item.id) { + haveIf = true; + } + }) + if (!haveIf) { + allBillList.push(item) + } + }) + console.log(allBillList,444) + if (res.data.pages <= page) { + _this.setData({ + allBillList, + pageNum: res.data.pages - 1, + content: '已经加载全部数据!' + }) + } else { + _this.setData({ + allBillList, + loading: false, + content: '小主,我在玩命加载中...' + }) + } + }) + .catch(err => { + tt.stopPullDownRefresh(); + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + onPullDownRefresh: function (e) { + let that = this; + that.setData({ + pageNum: 1, + list: [] + }); + that.getList(1); + this.getTotleData() + }, + onReachBottom() { + var that = this; + that.data.pageNum++; + that.setData({ + pageNum: that.data.pageNum, + loading: true + }); + that.getList(that.data.pageNum); + this.getTotleData() + } +}); \ No newline at end of file diff --git a/pages/marktingsettlement/marktingsettlement.json b/pages/marktingsettlement/marktingsettlement.json new file mode 100644 index 0000000..459d165 --- /dev/null +++ b/pages/marktingsettlement/marktingsettlement.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "营销结算", + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#52A0FD" + } \ No newline at end of file diff --git a/pages/marktingsettlement/marktingsettlement.ttml b/pages/marktingsettlement/marktingsettlement.ttml new file mode 100644 index 0000000..edea515 --- /dev/null +++ b/pages/marktingsettlement/marktingsettlement.ttml @@ -0,0 +1,66 @@ + + + + {{tabTxt[0].title}} + {{item.title}} + + + + + + + + + + + + + + + + {{item.orderId}} + {{item.createDate01}} + + + {{item.sourceStr+" "+item.typeStr}} + 应收:{{item.subsidyStr}} + + {{item.statusStr}} + {{item.statusStr}} + + + + + {{content}} + + + 暂无数据! + + 总计应收 + ¥{{subsidy}} + \ No newline at end of file diff --git a/pages/marktingsettlement/marktingsettlement.ttss b/pages/marktingsettlement/marktingsettlement.ttss new file mode 100644 index 0000000..020fd3c --- /dev/null +++ b/pages/marktingsettlement/marktingsettlement.ttss @@ -0,0 +1,299 @@ +page { + padding: 90rpx 0 30rpx; + } + .tabTit { + height: 90rpx; + line-height: 82rpx; + position: fixed; + top: 0; + width: 750rpx; + z-index: 1; + } + + .tabTit > view:nth-of-type(1) { + border-left: 0; + } + + .tabTit > view:nth-of-type(4) { + border-right: 0; + } + + + .tabTit .active image { + transform: rotate(180deg); + background: none; + } + + .tabTit image { + width: 18rpx; + height: 9rpx; + vertical-align: middle; + margin-left: 5px; + } + + .tabLayer { + width: 750rpx; + overflow: hidden; + position: fixed; + top: 90rpx; + z-index: 1; + background: #fff; + padding-bottom: 26rpx; + box-shadow:2px 9px 10px rgba(0, 0, 0, 0.05); + bottom: 0; + border-top:1px solid #eee; + } + + .tabLayer a { + float: left; + width: 210rpx; + height: 80rpx; + line-height: 80rpx; + margin: 30rpx 0 0 26rpx; + text-align: center; + color: #888; + font-size: 30rpx; + background: rgba(255, 255, 255, 1); + border: 1px solid rgba(234, 234, 234, 1); + border-radius: 10rpx; + } + + + .tabLayer .active { + text-align: center; + height: 80rpx; + background: rgba(255, 255, 255, 1); + border: 1px solid rgba(101, 158, 246, 1); + border-radius: 10rpx; + color: #659ef6; + } + .tabTit .active { + background: #fff; + font-size: 32prx; + font-weight: 500; + color: rgba(101, 158, 246, 1); + } + /*弹性盒模型*/ + + .box { + background: #fff; + border-bottom:1px solid #eee; + } + + .flex1 { + overflow: hidden; + width: 20%; + display: block; + text-align: center; + } + + .flex1 text,.text { + font-size: 30rpx; + } + .text{ + display: block; + width: 25%; + text-align: center; + } + /* 日期选择 */ + + .picker_group { + height: 85rpx; + line-height: 85rpx; + justify-content: center; + display: flex; + align-items: center; + font-size: 30rpx; + color: #888; + } + + .picker_group picker { + height: 55rpx; + line-height: 55rpx; + margin: 0 2%; + padding: 2% 5%; + border-bottom: 1px solid #eee; + } + + .view view:nth-of-type(1) { + font-size: 28rpx; + color: #888; + } + + .list { + position: relative; + width: 644rpx; + border-radius: 16rpx; + padding: 32rpx; + margin: 40rpx auto; + box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.1); + } + + .list >view { + height: 60rpx; + line-height: 60rpx; + font-size: 30rpx; + } + + .txt1 { + font-size: 24rpx; + font-weight: 500; + color: rgba(85, 85, 85, 1); + } + + .txt2 { + font-size: 28rpx; + font-weight: 500; + color: rgba(255, 106, 106, 1); + } + + .money { + font-weight: 500; + color: rgba(255, 106, 106, 1); + font-size: 26rpx; + /* width: 123rpx; */ + padding-right: 20rpx; + } + + .time { + font-size: 28rpx; + font-weight: 500; + color: rgba(125, 125, 125, 1); + } + .status{ + position: absolute; + top: 60rpx; + left: 250rpx; + width: auto; + padding: 0 20rpx; + height: 50rpx; + text-align: center; + line-height: 50rpx; + border-radius: 8rpx; + transform:rotate(-30deg); + } + .status1 { + color: #659ef6; + border: 2px solid #659ef6; + } + + .status2 { + color: #eea959; + } + + .status3 { + color: #ff6a6a; + border: 2px solid #ff6a6a; + } + + .status4 { + color: #8aaa6b; + } + + .btn { + float: right; + height: 52rpx; + line-height: 52rpx; + background: rgba(101, 158, 246, 1); + border-radius: 10rpx; + font-size: 28rpx; + font-weight: 500; + padding: 0 25rpx; + color: rgba(255, 255, 255, 1); + } + + .active1 { + opacity: 0.6; + } + + .btns { + width:137rpx; + margin-top: 21rpx; + background: #52a0fd; + border-radius: 8rpx; + color: #fff; + font-size: 26rpx; + height: 64rpx; + line-height: 64rpx; + } + .activeDefault{ + float: left; + width: 210rpx; + height: 80rpx; + line-height: 80rpx; + margin: 30rpx 0 0 26rpx; + text-align: center; + color: #888; + font-size: 30rpx; + background: rgba(255, 255, 255, 1); + border: 1px solid rgba(234, 234, 234, 1); + border-radius: 10rpx; + } + .active2{ + border: 1px solid #52a0fd!important; + color: #52a0fd!important; + float: left; + width: 210rpx; + height: 80rpx; + line-height: 80rpx; + margin: 30rpx 0 0 26rpx; + text-align: center; + color: #888; + font-size: 30rpx; + background: rgba(255, 255, 255, 1); + border: 1px solid rgba(234, 234, 234, 1); + border-radius: 10rpx; + } + .recond{ + text-align: center; + font-size: 30rpx; + margin-top: 60rpx; + } + .active3{ + color: #659ef6; + } + .loading{ + text-align: center; + font-size: 28rpx; + color: #999; + margin-bottom: 80rpx; + /* padding: 20rpx 0 40rpx; */ + } + .mr{ + margin-top: 200rpx!important; + } + .lists{ + height: 100%; + position: relative; + } + .bottom{ + position: fixed; + width: 100%; + height: 80rpx; + bottom: 0; + left: 0; + background: #fff; + z-index: 1000; + overflow: hidden; + box-shadow: 1rpx -5rpx 11rpx rgb(202, 201, 201); + } + .b-left{ + width: 50%; + line-height: 80rpx; + padding-left: 20rpx; + font-size: 32rpx; + color: #333; + float: left; + box-sizing: border-box; + } + .b-right{ + width: 50%; + float: left; + line-height: 80rpx; + text-align: right; + padding-right: 30rpx; + color: #ff6a6a; + font-size: 32rpx; + box-sizing: border-box; + } + \ No newline at end of file diff --git a/pages/memberPhone/index.js b/pages/memberPhone/index.js new file mode 100644 index 0000000..6207dfd --- /dev/null +++ b/pages/memberPhone/index.js @@ -0,0 +1,158 @@ +// pages/getMerchant/index.js +const config = require('../../config/config.js') +const Http = require('../../utils/HttpBasics.js') +const util = require('../../utils/util.js') +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + phone:'', + paramData:[] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + console.log(options) + this.setData({ + paramData: options + }) + if (options.a == 2){ + tt.setNavigationBarTitle({ + title: '会员赠券' + }) + }else{ + tt.setNavigationBarTitle({ + title: '会员积分' + }) + } + + + },//204391258 + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + checkMerchant(e) { + let id = e.target.id; + this.data.selectList.map((item, index) => { + if (id == item.id) { + this.setData({ + selectMerchant: item`` + }) + } + }) + }, + submitForm() { + const reg = /^1[0|1|2|3|4|5|6|7|8|9]\d{9}$/; + let _this=this; + if (!reg.test(this.data.phone)) { + tt.showToast({ + title: '抱歉,请输入正确的手机号', + icon: 'none', + duration: 2000, + mask: false + }); + return; + } + Http.get({ + url: config.api.findByPhone, + data: { + phone: _this.data.phone, + } + }) + .then(res => { + if (res.data.id){ + if(res.data.status == 1){ + tt.showModal({ + title: "抱歉", + content: "会员已被锁定", + showCancel: false + }) + return; + } + if (this.data.paramData.a == 1){ + tt.setStorageSync("avatarUrl", res.data.avatarUrl?res.data.avatarUrl:''); + tt.navigateTo({ + url: `/pages/Add/index?id=${res.data.id}&levelName=${res.data.level}&nickName=${res.data.nickName}&name=${res.data.name}&phone=${res.data.phone}&score=${res.data.score}&credit=${res.data.credit}` + }) + } + if (this.data.paramData.a == 2) { + tt.setStorageSync("avatarUrl", res.data.avatarUrl?res.data.avatarUrl:''); + tt.navigateTo({ + url: `/pages/giveCoupon/index?id=${res.data.id}&levelName=${res.data.level}&nickName=${res.data.nickName}&name=${res.data.name}&phone=${res + .data.phone}&score=${res.data.score}&credit=${res.data.credit}` + }) + } + }else{ + tt.showToast({ + title: '抱歉,会员信息不存在!', + icon: 'none', + duration: 2000, + mask: false + }); + } + }) + .catch(err => { + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + getList(e) { + console.log(e.detail.value) + this.setData({ + phone: e.detail.value + }) + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/memberPhone/index.json b/pages/memberPhone/index.json new file mode 100644 index 0000000..f093b02 --- /dev/null +++ b/pages/memberPhone/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/memberPhone/index.ttml b/pages/memberPhone/index.ttml new file mode 100644 index 0000000..3172101 --- /dev/null +++ b/pages/memberPhone/index.ttml @@ -0,0 +1,12 @@ + + + + + 手机号 + + + + + + + \ No newline at end of file diff --git a/pages/memberPhone/index.ttss b/pages/memberPhone/index.ttss new file mode 100644 index 0000000..c6215ad --- /dev/null +++ b/pages/memberPhone/index.ttss @@ -0,0 +1,56 @@ +/* pages/getMerchant/index.wxss */ +.top{ + position: fixed; + top: 0; + left: 0; + opacity: 1; + background: #fff; + } + .footer { + width: 710rpx; + height: 126rpx; + line-height: 126rpx; + display: flex; + background: #fff; + border-radius: 20rpx; + margin-top: 40rpx; + margin-left: 20rpx; + align-self: center; + box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); + } + + .footer text { + margin-left: 31rpx; + font-size: 30rpx; + } + + .footer input { + width: 560rpx; + margin-right: 19rpx; + height: 126rpx; + line-height: 126rpx; + font-size: 30rpx; + text-align: right; + } + .merchant-list{ + width: 690rpx; + margin: 230rpx auto; + border-top: 1px solid #EAEAEA; + } + .lists{ + height: 84rpx; + line-height: 84rpx; + border-bottom: 1px dashed #EAEAEA; + } + .sub-button{ + position: fixed; + top: 265rpx; + left: 20rpx; + width:710rpx; + height:94rpx; + background:rgba(82,160,253,1); + box-shadow:0px 10rpx 22rpx 2rpx rgba(82,160,253,0.51); + border-radius:10rpx; + color: #fff; + line-height: 94rpx; + } \ No newline at end of file diff --git a/pages/operation/index.js b/pages/operation/index.js new file mode 100644 index 0000000..34f2b7a --- /dev/null +++ b/pages/operation/index.js @@ -0,0 +1,339 @@ +// pages/operation/index.js +const config = require('../../config/config.js') +const Http = require('../../utils/HttpBasics.js') +const util = require('../../utils/util.js') +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + showDetailIf: true, + receiptUrl:null, + type:null, + paramData:'', + array: ['美国', '中国', '巴西', '日本'], + merchentList:[], + spendStr:null, + creditNum:0, + submitAble:true, + shoesList:[], + clothList:[], + business:'', + selectTag:null, + selectTag1:null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + console.log(options,7777) + console.log(options.business) + this.setData({ + businessId: options.businessId ? options.businessId :'' , + type: options.type, + isAdmin: options.isAdmin ? options.isAdmin:0, + paramData:options, + flag: "cloth", + }) + this.getMerchent(); + this.getTag() + }, + getTag() { + let that = this; + Http.get({ + url: config.api.getTag + }) + .then(res => { + console.log(res.data.data) + that.setData({ + shoesList: res.data.data['28'], + clothList: res.data.data['27'], + }) + }) + .catch(err => { + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + //切换衣服尺码 + getCloth() { + this.setData({ + flag: "cloth", + }) + }, + //切换鞋子尺码 + getShoes() { + this.setData({ + flag: "shoes", + }) + }, + //点击选中衣服鞋子尺码 + checkTags(e) { + console.log(e) + let id = e.target.id; + if (this.data.flag == "cloth"){ + this.data.clothList.map((item, index) => { + if (id == item.id) { + this.setData({ + selectTag: item.id, + }) + } + }) + }else{ + this.data.shoesList.map((item, index) => { + if (id == item.id) { + this.setData({ + selectTag1: item.id, + }) + } + }) + } + }, + + /** + * 跳转门店选择页面 + */ + checkMerchant(){ + tt.navigateTo({ + url: `/pages/getMerchant/index?address=${this.data.paramData.address}&id=${this.data.paramData.id}&levelName=${this.data.paramData.levelName}&name=${this.data.paramData.name}&nickName=${this.data.paramData.nickName}&phone=${this.data.paramData.phone}&score=${this.data.paramData.score}&credit=${this.data.paramData.credit}&type=1`, + }) + }, + /** + * 保存积分操作数据 + */ + submitForm(){ + let _this=this; + if (_this.data.receiptUrl == null || !_this.data.receiptUrl){ + tt.showToast({ + title: '请先上传小票照片!', + icon: 'none', + duration: 2000, + mask: false + }); + return; + } + const reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/; + if (!reg.test(_this.data.spendStr) || Number(_this.data.spendStr) > 9999999.99 || Number(_this.data.spendStr)<=0) { + tt.showToast({ + title: '消费金额限制为大于0且小于9999999.99的保留两位小数的数字!', + icon: 'none', + duration: 2000, + mask: false + }); + return; + } + /** + * 判断服务台操作选择店铺 + */ + if (_this.data.paramData.isAdmin=='1'&&!_this.data.paramData.merchantType && _this.data.paramData.isAdmin == 1) { + tt.showToast({ + title: '请选择消费店铺!', + icon: 'none', + duration: 2000, + mask: false + }); + return; + } + if (_this.data.creditNum <= 0 || !_this.data.creditNum){ + tt.showToast({ + title: '本业态消费无积分!', + icon: 'none', + duration: 2000, + mask: false + }); + return; + } + _this.setData({ + submitAble: false + }) + Http.post({ + url: config.api.addCredit, + data: { + spendStr: _this.data.spendStr, + creditType: 10,//新增积分 + cuserId: _this.data.paramData.id, + operatorType: 3, + receiptUrl: _this.data.receiptUrl, + merchantId: _this.data.paramData.merchant_id, + tags: [_this.data.selectTag, _this.data.selectTag1] + } + }) + .then(res => { + this.setData({ + submitAble:false + }) + tt.showToast({ + title: '保存成功!', + icon: 'none', + duration: 2000, + mask: false + }); + tt.navigateTo({ + url: '/pages/editSuccess/index?type=1&creditNum=' + res.data.creditNum + '&creditAmount='+res.data.creditAmount, + }) + _this.setData({ + merchentList: res.data, + submitAble: true + }) + }) + .catch(err => { + _this.setData({ + submitAble: true + }) + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + getPrice(e){ + let _this=this; + this.setData({ + spendStr:e.detail.value + }) + const reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/; + if ((!reg.test(e.detail.value) && e.detail.value != "")||Number(_this.data.spendStr) > 9999999.99 || Number(_this.data.spendStr) <= 0) { + tt.showToast({ + title: "消费金额限制为大于0且小于9999999.99的保留两位小数的数字!", + icon: 'none', + duration: 2000, + mask: false + }); + return; + } + Http.get({ + url: config.api.getCreditNum, + data:{ + spendStr: e.detail.value, + merchantId: _this.data.paramData.merchant_id, + userId:_this.data.paramData.id + } + }) + .then(res => { + _this.setData({ + creditNum: res.data.credit + }) + }) + .catch(err => { + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + getMerchent(){ + let _this=this; + Http.get({ + url: config.api.getMerchentList + }) + .then(res => { + _this.setData({ + merchentList: res.data + }) + }) + .catch(err => { + tt.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }); + }, + bindPickerChange(e) { + this.setData({ + index: e.detail.value + }) + }, + uploadImg(){ + console.log(123); + let that=this; + tt.chooseImage({ + count: 1, // 默认9 + sizeType: ['compressed'], + success(res) { + const tempFilePaths = res.tempFilePaths + tt.uploadFile({ + url:`https://btest.malls.iformall.com/B/api/upload/awsFileUpload`, // 仅为示例,非真实的接口地址 + filePath: tempFilePaths[0], + name: 'file', + header: { + 'token': app.globalData.token, + // "content-type": "multipart/form-data", + // "cookie": "TOUTIAOID" + id, // 此处添加cookie + }, + success(res) { + that.setData({ + receiptUrl:JSON.parse(res.data).data.url + }) + // do something + console.log(JSON.parse(res.data).data,"url"); + }, + fail: (err) => { + console.log("上传失败", err); + }, + }) + }, + fail(err){ + console.log(err); + } + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + // this.setData({ + // receiptUrl: null + // }) + this.setData({ + submitAble: true + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + } +}) \ No newline at end of file diff --git a/pages/operation/index.json b/pages/operation/index.json new file mode 100644 index 0000000..cea2f55 --- /dev/null +++ b/pages/operation/index.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarTitleText": "会员积分", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#52A0FD" +} \ No newline at end of file diff --git a/pages/operation/index.ttml b/pages/operation/index.ttml new file mode 100644 index 0000000..c2d940c --- /dev/null +++ b/pages/operation/index.ttml @@ -0,0 +1,64 @@ + + + + + + + + 会员姓名(昵称): + {{paramData.name!='undefined'?paramData.name:paramData.nickName!='undefined'?paramData.nickName:''}} + + + 会员等级: + {{paramData.levelName!='undefined'?paramData.levelName:''}} + + + 手机号码: + {{paramData.phone}} + + + + + + 消费门店 + {{paramData.merchantName?paramData.merchantName:'点击选择消费门店'}} + + + + 消费金额 + + + + + + + 消费金额 + 元 + + + + + + + 服装尺码 + 鞋尺码 + + + + {{item.name}} + + + {{item.name}} + + + + + + 拍摄小票凭证 + + 本次积分 {{creditNum}} + + + + + \ No newline at end of file diff --git a/pages/operation/index.ttss b/pages/operation/index.ttss new file mode 100644 index 0000000..e44c7c4 --- /dev/null +++ b/pages/operation/index.ttss @@ -0,0 +1,230 @@ +/* pages/operation/index.wxss */ + +.exchange { + width: 100%; + height: 100%; + background: #f8f8fa; + } + + .exchangeBox { + margin-top: -45rpx; + } + .footer { + width: 710rpx; + height: 126rpx; + line-height: 126rpx; + display: flex; + background: #fff; + border-radius: 20rpx; + margin: 20rpx auto 0; + box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); + } + + .footer text { + margin-left: 31rpx; + font-size: 30rpx; + } + + .footer input { + width: 450rpx; + margin-right: 19rpx; + height: 126rpx; + line-height: 126rpx; + font-size: 30rpx; + text-align: right; + } + + .inpBox { + width: 710rpx; + height: 194rpx; + background: rgba(255, 255, 255, 1); + box-shadow: 0rpx 10rpx 27rpx 0rpx rgba(15, 15, 15, 0.09); + border-radius: 20rpx; + margin: 20rpx auto 0; + } + .foot { + width: 710rpx; + height: 96rpx; + line-height: 96rpx; + display: flex; + background: #fff; + } + .foot text { + margin-left: 31rpx; + font-size: 30rpx; + } + .foot input { + width: 450rpx; + height: 96rpx; + line-height: 96rpx; + font-size: 30rpx; + text-align: right; + } + .inp{ + margin-left: 45rpx; + } + .footer2{ + border-bottom: 1rpx solid #ccc; + } + .section { + width: 710rpx; + /* height: 176rpx; */ + margin-top: 8%; + background: #fff; + display: flex; + flex-direction: column; + border: 1px solid #eaeaea; + border-radius: 18rpx; + margin: auto; + } + .border { + width: 660rpx !important; + height: 1rpx !important; + } + /* .list-item{ + border-bottom: 1px solid #eaeaea; + } + .section .list-item:nth-last-of-type(2){ + border: 0; + } */ + .section view { + position: relative; + width: 92%; + height: 88rpx; + line-height: 88rpx; + display: flex; + justify-content: space-between; + padding: 0 4%; + } + + .section view text { + font-size: 30rpx; + color: #999; + letter-spacing: 1.16rpx; + } + + .section view text:nth-child(2) { + font-size: 28rpx; + color: #000; + letter-spacing: 1.16rpx; + text-align: right; + } + + .camera { + height: 340rpx; + width: 310rpx; + margin: 88rpx auto; + border: 1px solid #52a0fd; + color: #52a0fd; + } + + .camera image { + width: 59rpx; + height: 45rpx; + margin: 113rpx 125rpx 35rpx 126rpx; + } + + .camera text { + display: block; + text-align: center; + } + + button { + margin-bottom: 36rpx; + width: 710rpx; + height: 94rpx; + color: #fff; + font-size: 36rpx; + background-color: #52a0fd; + box-shadow: 0px 10px 22px 2px rgba(82, 160, 253, 0.51); + } + + .integral { + padding-right: 30rpx; + font-size: 28rpx; + font-family: PingFang-SC-Regular; + font-weight: 400; + color: rgba(51, 51, 51, 1); + line-height: 87rpx; + text-align: right; + } + + .integralNum { + color: red; + font-size: 28rpx; + } + + .img { + margin-top: -60rpx; + display: block; + width: 100%; + } + .up-img{ + width: 600rpx; + margin: 40rpx auto 0; + height: auto; + padding: 10rpx; + border: 1px dashed #52A0FD; + } + .up-img image{ + width: 600rpx; + } + .select{ + width: 500rpx; + text-align: right; + line-height:96rpx; + font-size:30rpx; + } + .labelBox{ + width: 710rpx; + height: 194rpx; + display: flex; + flex-direction: column; + margin: 40rpx auto 0; + } + .title{ + margin-bottom: 40rpx; + } + .title > view{ + width: 170rpx; + padding: 10rpx 20rpx; + text-align: center; + } + .content{ + padding: 0 10rpx; + display: flex; + flex-wrap: wrap; + /* justify-content: center; */ + align-items: center; + } + .shoes,.cloth { + margin:0 5rpx 10rpx; + text-align: center; + background: #fff; + font-size: 30rpx; + } + .shoes{ + padding: 10rpx 0; + width: 13% + } + .cloth{ + padding: 10rpx 0; + width: 13% + } + .title{ + display: flex; + justify-content: center; + align-items: center; + } + .couponsL{ + background: #51a0fc; + color: #fff; + } + .couponsR{ + background: #FFF; + color: #000; + } + .money{ + overflow: hidden; + } + /* 15136028756 */ \ No newline at end of file diff --git a/pages/scan/scan.js b/pages/scan/scan.js new file mode 100644 index 0000000..36275b6 --- /dev/null +++ b/pages/scan/scan.js @@ -0,0 +1,92 @@ +const config = require('../../config/config.js') +const Http = require('../../utils/http.js') +const HttpBasics = require('../../utils/HttpBasics.js') +const util = require('../../utils/util.js') +import * as echarts from '../../ec-canvas/echarts'; +var app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + gotoSaoyiSao: function () {//扫码核销、识别会员码 + tt.setStorageSync("verifyRemark", 12) + tt.scanCode({ + success: function(val) { + console.log(val.result); + if (util.isJSON(val.result)) { + let value = JSON.parse(val.result); + if (value.END == 'C' && value.TYPE == 'couponorder' && value.ID.length >= 18) { + Http.getRequest(config.api.couponOrderDetail, app.globalData.token, '加载中', { + couponOrderId: value.ID + }, (res) => { + tt.setStorageSync("verifyRemark", 12) + tt.setStorageSync("couponOrderId", value.ID) + if (res.code == 200) { + tt.navigateTo({ + url: `/pages/writeoffPage/writeoffPage` + }) + } else { + tt.reLaunch({ + url: `/pages/errorPage/errorPage?errTitle=${res.message}`, + }) + } + }) + } else if (value.END == 'C' && value.TYPE == 'memberCode' && value.ID.length >= 18) { + Http.postRequest(config.api.memScan, app.globalData.token, '加载中', { + memCode: value.ID + }, (res) => { + if (res.code == 200) { + if (res.data.discountRate != 100) { + var discountRate = res.data.discountRate / 10; + } else { + var discountRate = "暂无折扣"; + } + tt.navigateTo({ + url: `/pages/member/member?address=${res.data.address}&avatarUrl=${tt.getStorageSync("avatarUrl")}&levelName=${res.data.levelName}&name=${res.data.name}&phone=${res.data.phone}&score=${res.data.score}&discountRate=${discountRate}` + }) + } else { + tt.showModal({ + title: "抱歉", + content: res.message, + showCancel: false + }) + } + }) + } else { + tt.showToast({ + title: '请扫描正确的二维码', + icon: 'none', + duration: 1300 + }) + } + } else { + tt.showToast({ + title: '请扫描正确的二维码', + icon: 'none', + duration: 1300 + }) + } + }, + fail:function(){ + tt.showToast({ + title: '请扫描正确的二维码', + icon: 'none', + duration: 1300 + }) + } + }) + }, + // 跳转到手动核销 + aoto: function() { + tt.setStorageSync("verifyRemark", 11) + tt.setStorageSync + tt.navigateTo({ + url: '/pages/write0ff/write0ff', + }) + }, +}) + diff --git a/pages/scan/scan.json b/pages/scan/scan.json new file mode 100644 index 0000000..b3c3cce --- /dev/null +++ b/pages/scan/scan.json @@ -0,0 +1,5 @@ +{ + "navigationBarTitleText": "会员核销", + "navigationBarBackgroundColor": "#52A0FD", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/scan/scan.ttml b/pages/scan/scan.ttml new file mode 100644 index 0000000..8748052 --- /dev/null +++ b/pages/scan/scan.ttml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pages/scan/scan.ttss b/pages/scan/scan.ttss new file mode 100644 index 0000000..275170a --- /dev/null +++ b/pages/scan/scan.ttss @@ -0,0 +1,41 @@ +/* pages/scan/scan.wxss */ +page{ + background: #52A0FD; + } + .content{ + width: 588rpx; + margin: 0 auto; + background: #fff; + border-radius:10rpx; + padding-bottom: 100rpx; + padding: 0 46rpx 46rpx; + } + .content image{ + width: 603rpx; + margin: 48rpx auto 0; + } + button::after{ border: none; } + .btn1{ + width: 550rpx; + margin: 50rpx auto 0; + background:#52A0FD; + border:1px solid #52A0FD; + border-radius:45rpx; + color: #fff; + font-weight:400; + font-size:36rpx; + box-shadow: 0 6px 20px 0 rgba(183, 216, 254, 1); + } + .btn2{ + width: 550rpx; + margin: 50rpx auto 0; + background:rgba(255,255,255,1); + border:1px solid rgba(180,212,249,1); + border-radius:45rpx; + font-weight:400; + font-size:36rpx; + color:rgba(81,160,252,1); + } + .active{ + opacity: .6; + } \ No newline at end of file diff --git a/pages/setpwd/setpwd.js b/pages/setpwd/setpwd.js new file mode 100644 index 0000000..16ad041 --- /dev/null +++ b/pages/setpwd/setpwd.js @@ -0,0 +1,63 @@ +// pages/setpwd/setpwd.js +const config = require('../../config/config.js') +const Common = require("../../common/common.js") +const app = getApp() + +Page({ + data: { + phone: '', + yzm: '' + }, + onLoad(e) { + this.setData({ + phone: e.phone, + yzm: e.code + }) + }, + setPwd(e) { + let { + newPwd, + pwd + } = e.detail.value + var regx = /^(?![0-9]+$)(?![a-zA-Z]+$)[a-zA-Z\d]{8,16}$/; + if (newPwd.match(regx) == null) { + tt.showToast({ + title: '密码为8-16位字母和数字的组合', + icon: "none" + // image: './../../static/images/fail.png', + }) + } else { + console.log(newPwd) + console.log(pwd) + if (newPwd == pwd) { + Common.updateUserPassword(this.data.phone, this.data.yzm, newPwd) + .then(res => { + if (res.code == 200) { + tt.showToast({ + title: "修改成功", + icon: "none", + duration:1200 + }) + setTimeout(function () { + tt.reLaunch({ + url: '/pages/index/index', + }) + }, 1200) + + } else { + tt.showToast({ + title: res.message, + icon: "none" + }) + } + }) + } else { + tt.showToast({ + title: '密码不一致', + icon: "none" + // image: './../../static/images/fail.png', + }) + } + } + } +}) \ No newline at end of file diff --git a/pages/setpwd/setpwd.json b/pages/setpwd/setpwd.json new file mode 100644 index 0000000..b52a5b3 --- /dev/null +++ b/pages/setpwd/setpwd.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "设置密码", + "navigationBarTextStyle": "black" + } \ No newline at end of file diff --git a/pages/setpwd/setpwd.ttml b/pages/setpwd/setpwd.ttml new file mode 100644 index 0000000..7d1c310 --- /dev/null +++ b/pages/setpwd/setpwd.ttml @@ -0,0 +1,12 @@ +重置密码 + +
+ + + + + + + +
+
\ No newline at end of file diff --git a/pages/setpwd/setpwd.ttss b/pages/setpwd/setpwd.ttss new file mode 100644 index 0000000..7007a5d --- /dev/null +++ b/pages/setpwd/setpwd.ttss @@ -0,0 +1,48 @@ +/* pages/setpwd/setpwd.wxss */ +.setpwd{ + width: 100%; + display: flex; + flex-direction: column; + } + .input01 { + text-indent: 40rpx; + font-size: 40rpx; + color: #000; + letter-spacing: 0; + margin-top: 28rpx; + } + + .input02 { + text-indent: 40rpx; + font-size: 28rpx; + margin-top: 16rpx; + color: #000; + letter-spacing: 0; + line-height: 32rpx; + } + .setpwd{ + width: 100%; + display: flex; + flex-direction: column; + position: relative; + margin-top: 30rpx; + } + .setpwd view{ + width: 88%; + display: flex; + margin: 0 auto; + /* border-bottom: 1rpx solid #D7D7D7; */ + padding: 3.3% 0; + padding-left: 0; + } + .setpwd view input { + font-size: 30rpx; + } + .setpwd button{ + width: 92%; + height: 6.6%; + background: #52A0FD; + color:#fff; + margin-top:10.3%; + font-size: 36rpx; + } \ No newline at end of file diff --git a/pages/success/success.js b/pages/success/success.js new file mode 100644 index 0000000..11e94db --- /dev/null +++ b/pages/success/success.js @@ -0,0 +1,17 @@ +// pages/index/success/success.js +Page({ + data: { + + }, + returnPage(){ + tt.switchTab({ + url: '/pages/index/index', + }) + }, + checkList(e){ + let type = e.currentTarget.dataset.type + tt.navigateTo({ + url: `../transaction/transaction?type=${type}`, + }) + } +}) \ No newline at end of file diff --git a/pages/success/success.json b/pages/success/success.json new file mode 100644 index 0000000..2222e76 --- /dev/null +++ b/pages/success/success.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "核销成功", + "navigationBarTextStyle": "black" +} \ No newline at end of file diff --git a/pages/success/success.ttml b/pages/success/success.ttml new file mode 100644 index 0000000..de0c1d5 --- /dev/null +++ b/pages/success/success.ttml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/pages/success/success.ttss b/pages/success/success.ttss new file mode 100644 index 0000000..8976879 --- /dev/null +++ b/pages/success/success.ttss @@ -0,0 +1,70 @@ + +@font-face {font-family: "iconfont"; + src: url('iconfont.eot?t=1534659384595'); /* IE9*/ + src: url('iconfont.eot?t=1534659384595#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAPYAAsAAAAABhwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8z0hLY21hcAAAAYAAAABLAAABcOeBtrVnbHlmAAABzAAAACgAAAAoHY4LQWhlYWQAAAH0AAAALQAAADYSXJwsaGhlYQAAAiQAAAAcAAAAJAfeA4NobXR4AAACQAAAAAgAAAAICAAAAGxvY2EAAAJIAAAABgAAAAYAFAAAbWF4cAAAAlAAAAAeAAAAIAENABJuYW1lAAACcAAAAUUAAAJtPlT+fXBvc3QAAAO4AAAAHwAAADDa4m9xeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeRT6LZG7438AQw9zA0AAUZgTJAQDrDQyVeJxjYGBgZWBgYAZiHSBmYWBgDGFgZAABP6AoI1icmYELLM7CoARWwwISfxb5/z+MBPJZwCQDIxvDKOABkzJQHjisIJiBEQACmwrNAAABAAAAAAO3Ar8ABQAACQEnBwkBA3D+EfFGATcCNQK+/hHxR/7JAjZ4nGNgZGBgAOL/SbOL4vltvjJwszCAwPX5OhbINAsD034gxcHABOIBABYpCKIAAAB4nGNgZGBgbvjfwBDDwgACQJKRARUwAQBHCAJrBAAAAAQAAAAAAAAAABQAAHicY2BkYGBgYmBjANEgFgMDFxAyMPwH8xkACS0BIAAAeJxlj01OwzAQhV/6B6QSqqhgh+QFYgEo/RGrblhUavdddN+mTpsqiSPHrdQDcB6OwAk4AtyAO/BIJ5s2lsffvHljTwDc4Acejt8t95E9XDI7cg0XuBeuU38QbpBfhJto41W4Rf1N2MczpsJtdGF5g9e4YvaEd2EPHXwI13CNT+E69S/hBvlbuIk7/Aq30PHqwj7mXle4jUcv9sdWL5xeqeVBxaHJIpM5v4KZXu+Sha3S6pxrW8QmU4OgX0lTnWlb3VPs10PnIhVZk6oJqzpJjMqt2erQBRvn8lGvF4kehCblWGP+tsYCjnEFhSUOjDFCGGSIyujoO1Vm9K+xQ8Jee1Y9zed0WxTU/3OFAQL0z1xTurLSeTpPgT1fG1J1dCtuy56UNJFezUkSskJe1rZUQuoBNmVXjhF6XNGJPyhnSP8ACVpuyAAAAHicY2BigAAuBuyAiZGJkZmBLS0zL7M4g4EBABBxAp0A') format('woff'), + url('iconfont.ttf?t=1534659384595') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ + url('iconfont.svg?t=1534659384595#iconfont') format('svg'); /* iOS 4.1- */ + } + + .iconfont { + font-family:"iconfont" !important; + font-size:16px; + font-style:normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } + + .icon-finish:before { content: "\e659"; } + + .success { + width: 100%; + height: 100%; + position: absolute; + + } + + .success_logo { + width: 201rpx; + height: 281rpx; + margin: 10% auto; + display: flex; + flex-direction: column; + margin-bottom: 20%; + } + + .success_logo icon { + width: 201rpx; + height: 201rpx; + background: #52A0FD; + border-radius: 50%; + color: #fff; + font-size: 40px; + text-align: center; + line-height: 201rpx; + } + + .success_logo text { + font-size: 36rpx; + text-align: center; + padding-top: 3%; + } + + .success button { + width: 640rpx; + height: 88rpx; + line-height: 84rpx; + background: #52A0FD; + color: #fff; + margin: 3% auto; + font-size: 36rpx; + } + + .check { + background: #fff!important; + color: #52A0FD!important; + border:1px solid #52A0FD; + } + .active{ + opacity: .6; + } \ No newline at end of file diff --git a/pages/transaction/transaction.js b/pages/transaction/transaction.js new file mode 100644 index 0000000..ff7f672 --- /dev/null +++ b/pages/transaction/transaction.js @@ -0,0 +1,194 @@ +const config = require('../../config/config.js') +const Http = require('../../utils/http.js') +const app = getApp() +const format = require('../../utils/util.js') + +Page({ + data: { + list: [], + getFullYear: new Date().getFullYear(), + getMonth: new Date().getMonth() + 1, + getDate: new Date().getDate(), + dateTime: '', + flag: true, + defaultId: 0, + text: '', + page: 1, + dataList: [], + nowDateTime: '', + hide: false, + name: '', + timeName: '' + }, + //进到记录页面初始化显示的数据 + getList(statetId, page, dateTime) { + let { + dataList, + show, + isShow, + listInfo + } = this.data + if (statetId == 0) { + //今日交易额记录 + return new Promise((resolve, reject) => { + Http.getRequest(config.api.couponOrderListUnVerified, app.globalData.token, '加载中', { + date: dateTime, + pageNum: page, + pageSize: 8, + }, (res) => { + console.log(res) + if(res.data.list &&res.data.list.list.length &&res.data.list.list.length > 0){ + res.data && res.data.list.list.map(file => { + file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss') + file.createDate = format.formatTime(file.createDate, 'yyyy-MM-dddd hh:mm:ss') + file.updateDate = format.formatTime(file.updateDate, 'yyyy-MM-dddd hh:mm:ss') + dataList.push(file) + }) + + } + + this.setData({ + list: dataList, + hide: res.data.list.list == 0 ? true : false + }) + + console.log(this.data.list) + resolve(res) + }) + }) + } else { + //今日核销记录 + return new Promise((resolve, reject) => { + Http.getRequest(config.api.couponOrderListVerified, app.globalData.token, '加载中', { + date: dateTime, + pageNum: page, + pageSize: 10, + }, (res) => { + console.log(res) + if(res.data.list &&res.data.list.list.length &&res.data.list.list.length > 0){ + res.data && res.data.list.list.map(file => { + file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss') + file.createDate = format.formatTime(file.createDate, 'yyyy-MM-dddd hh:mm:ss') + file.updateDate = format.formatTime(file.updateDate, 'yyyy-MM-dddd hh:mm:ss') + dataList.push(file) + }) + } + + this.setData({ + list: dataList, + hide: res.data.list.list == 0 ? true : false + }) + resolve(res) + }) + }) + } + }, + onLoad(e) { + let { + page, + getFullYear, + getMonth, + getDate, + dateTime + } = this.data + let nowTime = getFullYear + '-' + getMonth + '-' + getDate + this.setData({ + dateTime: nowTime, + nowDateTime: nowTime + }) + this.getList(e.type, page, nowTime) + if (e.type == '0') { // 交易流水 + this.setData({ + flag: true, + text: '未核销', + defaultId: e.type, + name: '购买用户', + timeName: '购买时间' + }) + tt.setNavigationBarTitle({ + title: '交易记录', + }) + } + else { // 核销 + this.setData({ + flag: false, + text: '已核销', + defaultId: e.type, + name: '核销员', + timeName: '核销时间' + }) + tt.setNavigationBarTitle({ + title: '核销记录', + }) + } + }, + onReachBottom() { + let { + page, + defaultId, + dateTime, + } = this.data + var pageInd = ''; + tt.showLoading({ + title: '玩命加载中', + }) + this.setData({ + page: page = ++page + }) + + this.getList(defaultId, page, dateTime).then(res => { + if (res.code == 200) { + tt.hideLoading(); + } + }) + }, + refund(e) { + console.log(e.currentTarget.dataset.id) //从这里拿到当前的id + Http.postRequest(config.api.refundOrderCreate, app.globalData.token, '加载中', { + couponOrderId: e.currentTarget.dataset.id + }, (res) => { + if (res.code == 200) { + // 退券退款申请成功 + tt.showToast({ + title: res.message, + image:'../../static/images/success.png' + }) + setTimeout(() => { + tt.switchTab({ + url: '/pages/main/main' + }) + }, 1000) + } else { + tt.showModal({ + title: '错误', + content: res.message, + showCancel:false + }) + } + }, (err) =>{ + console.log("err", err) + tt.showModal({ + title: '错误', + content: err.message, + showCancel: false + }) + }) + }, + //往回传用户选择的日期渲染不同的数据 + bindDateChange(e) { + let { + page, + defaultId + } = this.data + this.setData({ + dateTime: e.detail.value, + dataList: [], + list:[] + }) + page = 1 + this.setData({ + page: page + }) + this.getList(defaultId, page, e.detail.value) + } +}) \ No newline at end of file diff --git a/pages/transaction/transaction.json b/pages/transaction/transaction.json new file mode 100644 index 0000000..1fcf5d2 --- /dev/null +++ b/pages/transaction/transaction.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarTitleText": "", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#52A0FD" + } \ No newline at end of file diff --git a/pages/transaction/transaction.ttml b/pages/transaction/transaction.ttml new file mode 100644 index 0000000..49d941b --- /dev/null +++ b/pages/transaction/transaction.ttml @@ -0,0 +1,90 @@ + + + + {{dateTime}} + + + + + 暂无数据 + + + + 券状态 + 未核销 + + + + 券状态 + 已核销 + + + + 券状态 + 已过期 + + + + 券状态 + 已退款 + + + 券名称 + {{item.title}} + + + 券码 + {{item.id}} + + + {{timeName}} + {{item.createDate}} + + + 核销时间 + {{item.updateDate}} + + + 退款时间 + {{item.updateDate}} + + + 购买用户 + {{item.cuserPhone}} + + + 核销员 + {{item.buserName}} + + + + + 券面额 + 原价 + {{item.price/100}}元 + + + 券售价 + 底价 + {{item.couponPrice/100}}元 + + + + + + + + + + + + + + + + + + 已经加载完成喽 + + + \ No newline at end of file diff --git a/pages/transaction/transaction.ttss b/pages/transaction/transaction.ttss new file mode 100644 index 0000000..8f4b3cc --- /dev/null +++ b/pages/transaction/transaction.ttss @@ -0,0 +1,252 @@ +/* pages/index/transaction/transaction.wxss */ +@import '../../iconfont.ttss'; + +@font-face { + font-family: "iconfont"; + src: url('iconfont.eot?t=1534051835210'); /* IE9*/ + src: url('iconfont.eot?t=1534051835210#iefix') format('embedded-opentype'), + /* IE6-IE8 */ url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAWAAAsAAAAACIwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFZW7knxY21hcAAAAYAAAABdAAABhqFUBr5nbHlmAAAB4AAAAa4AAAJ0BhJPQWhlYWQAAAOQAAAALwAAADYSSxHLaGhlYQAAA8AAAAAcAAAAJAfeA4RobXR4AAAD3AAAAAwAAAAMC+kAAGxvY2EAAAPoAAAACAAAAAgAdgE6bWF4cAAAA/AAAAAfAAAAIAEWAJhuYW1lAAAEEAAAAUUAAAJtPlT+fXBvc3QAAAVYAAAAJQAAADbl5lfgeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2Bk/sE4gYGVgYOpk+kMAwNDP4RmfM1gxMjBwMDEwMrMgBUEpLmmMDgwVLxgZ27438AQw9zA0AAUZgTJAQAkCQx1eJzFkMENgDAMAy9taSXEIDwYiBdzdORuUUwoDyaoJceKYylRgAWI4iEmsAvjwSnX3I+s7ifPZKkRqK30rv5TRTTLrkElMw02b/Ufm9d9dPoKdVAntvKScANkHwuzAAAAeJxtUE2L01AUvefFpB/TpualadqkH3lN2yijAfs1C5lOBDcVF4IrceXKlbNxMRvBuBAEZfAniAj+iVnMT1H0bzTjzbRoCj4e95x737n3ch7pRFc/tQutTTbdonv0kJ4QwTjE0BQ9qGgei0M4SnfcpqlFYaRK4TDWjuEOjWZrupxPXKNkNGCij5maLqNYRFjMV+I+pq0e0PG9p3LcldpnVNtR/332SHyFMwi7jdXdbH3npDkN7PJZTcqOlJ/Khq6XhbjRMPHKbVX0StXIvukNz7kY3BYD1DqR9/hZPfDliw/z097YrQBpCtsPzO8nlmfxfeO1bNkp3ayX2149HDVx9vugbdd6k1/Ep8JeL7VLjeiAXDqiB/ScXtJreksf2fMsd8O+2Zdb4AgX88nQ4L/YYWiiZPXhqhWOrBg2pypGZKmFWnBp5uT/cgy1wxlLi7PHBa4KXC/u/JGYUpr7Aaep7Mor4pAu18B6KbZYxcjfpP4IGm2IeS7DtYxrmy//Bpz/pdn5/6rXTXnfFkQS5C/BNvK+jHZ7GTfveDgvQ5okzPaUIz9L9ibtJfQHm05cZgAAeJxjYGRgYADi9FdzVeL5bb4ycLMwgMD1qc9+I+j/B1gYmCWAXA4GJpAoAF4EDEUAeJxjYGRgYG7438AQw8IAAkCSkQEVMAMARwkCbAQAAAAD6QAABAAAAAAAAAAAdgE6eJxjYGRgYGBm6GHgZAABJiDmAkIGhv9gPgMAFxYBrwB4nGWPTU7DMBCFX/oHpBKqqGCH5AViASj9EatuWFRq911036ZOmyqJI8et1ANwHo7ACTgC3IA78EgnmzaWx9+8eWNPANzgBx6O3y33kT1cMjtyDRe4F65TfxBukF+Em2jjVbhF/U3YxzOmwm10YXmD17hi9oR3YQ8dfAjXcI1P4Tr1L+EG+Vu4iTv8CrfQ8erCPuZeV7iNRy/2x1YvnF6p5UHFockikzm/gple75KFrdLqnGtbxCZTg6BfSVOdaVvdU+zXQ+ciFVmTqgmrOkmMyq3Z6tAFG+fyUa8XiR6EJuVYY/62xgKOcQWFJQ6MMUIYZIjK6Og7VWb0r7FDwl57Vj3N53RbFNT/c4UBAvTPXFO6stJ5Ok+BPV8bUnV0K27LnpQ0kV7NSRKyQl7WtlRC6gE2ZVeOEXpc0Yk/KGdI/wAJWm7IAAAAeJxjYGKAAC4G7ICZkYmRmZGFgbGCoygzJ7MoszCTgQEAH40EAgAAAA==') format('woff'), + url('iconfont.ttf?t=1534051835210') format('truetype'), + /* chrome, + firefox, + opera, + Safari, + Android, + iOS 4.2+*/ url('iconfont.svg?t=1534051835210#iconfont') format('svg'); /* iOS 4.1- */ +} + +.iconfont { + display: inline-block; + font-family: "iconfont" !important; + font-size: 75rpx; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + color: #fff; + /* margin-right: 20rpx; */ + /* line-height: 190rpx; + margin-left: 17rpx; + margin-top: -41rpx; */ +} +.active{ + opacity: .6; +} + +.icon-riliriqi:before { + content: "\e807"; +} + +page { + background: #f8f8fa; + padding-bottom: 144rpx; +} + +.location { + position: fixed; + z-index: 100; + width: 100%; + top: -31rpx; + left: 0; + right: 0; + font-size: 30rpx; + text-align: center; + color: #fff; + /* margin-top: -100rpx; */ +} + +.txt { + position: fixed; + z-index: 10000; + display: block; + left: 0; + top: 0; + right: 0; + text-align: center; + color: #fff; + /* padding-top: 20rpx; */ +} + +.location image { + position: absolute; + top: -82rpx; + width: 100%; + height: 168rpx; + left: 0; + right: 0; + z-index: 10; +} + +.location text { + display: block; + text-align: left; + text-indent: 32rpx; + position: relative; + z-index: 100; + font-size: 30rpx; + color: #fff; + letter-spacing: 1.16rpx; +} + +.xia { + width: 40rpx; + vertical-align: middle; + margin-top: -5rpx; + margin-left: -10rpx; +} + +.transaction { + width: 710rpx; + height: 100%; + line-height: 87rpx; + margin: 69rpx auto 0; + display: flex; + flex-direction: column; +} + +.transaction_msg { + width: 710rpx; + margin: 0 auto 30rpx; + height: 100%; + display: flex; + flex-direction: column; + border-radius: 16rpx; + overflow: hidden; + padding-bottom: 20rpx; + padding-top: 20rpx; + background: #fff; + box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.05); + /* border-bottom: 20rpx solid #f5f5f5;*//* margin-bottom: 70rpx; */ +} + +.transaction_msg view { + width: 100%; + height: 70rpx; + line-height: 70rpx; + background: #fff; + display: flex; + justify-content: space-between; +} + +.transaction_msg view text { + padding: 0 4%; +} + +.transaction_msg view:nth-child(1) text { + font-size: 30rpx !important; + color: #333 !important; +} + +.jiaoyi { + width: 160rpx; + display: block; + margin: 200rpx auto 0; +} + +.transaction_msg view text:nth-child(2) { + font-size: 28rpx; + color: #b8b8b8; +} + +.transaction_msg view text:nth-child(1) { + font-size: 30rpx; + color: #000; + letter-spacing: 1.16rpx; +} + +.transaction_msg view:last-child { + position: relative; +} + +.transaction_msg view:last-child text:nth-child(2) { + font-size: 30rpx !important; +} + +.date { + width: 110rpx; + height: 110rpx; + border-radius: 50%; + background: #52a0fd; + display: flex; + line-height: 110rpx; + position: fixed; + bottom: 20rpx; + left: 0rpx; + right: 0rpx; + z-index: 999; + margin: auto; + box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); + /* height: 60rpx; *//* border-radius:16rpx; *//* border-top: 1px solid #ccc; *//* padding-bottom: 25rpx; */ +} + +.date>view { + font-size: 28rpx; +} + +.date>view text { + display: inline-block; + padding-right: 20rpx; + color: #fff; + font-size: 26rpx; +} + +.picker { + /* width: 645rpx; */ + display: block; + height: 60rpx; + font-size: 30rpx; + line-height: 60rpx; + /* text-align: center; */ +} + +picker { + display: block; +} + +.picker button { + /* width: 422rpx; */ + display: inline-block; + background: #52a0fd; + margin-left: 30rpx; + border-radius: 0 !important; + border: 0 !important; + outline: 0 !important; +} + +.picker button::after { + border: none; +} + +.picker button icon { + font-size: 45rpx; + color: #fff; + position: relative; + bottom: 12rpx; +} + +#refund { + width: 140rpx; + height: 50rpx; + display: inline-block; + background: #ffae00; + border-radius: 10rpx; + color: #fff; + text-align: center; + line-height: 46rpx; + font-size: 28rpx; + position: absolute; + right: 25rpx; + top: 20rpx; +} + +.hide { + width: 100%; + height: 55rpx; + line-height: 55rpx; +} + +.hide text { + color: #999; + display: block; + text-align: center; + font-size: 28rpx; +} diff --git a/pages/user/user.js b/pages/user/user.js new file mode 100644 index 0000000..e35c50b --- /dev/null +++ b/pages/user/user.js @@ -0,0 +1,157 @@ +// const extConfig = tt.getExtConfigSync ? tt.getExtConfigSync() : {} +// let appVersion = extConfig.appVersion; +var app = getApp(); +const config = require('../../config/config.js') +const Http = require('../../utils/HttpBasics.js') + +Page({ + data: { + cashOutOpenHeadImg:"",//用户头像 + cashOutOpenNickName:"",//用户名 + cashOutCount: "",//当日已提现次数 + cashOutNumber: "", // 可提现余额 + cashOutSupport: "",// 1 - 支持提现 0-不支持提现 + cashOutLimit: "",// 当日提现次数限制 + city: '', + userInfo: {}, + flag: 'hidden', + isSet:false, + haveData: false + }, + toDetail() { + tt.navigateTo({ + url: `./signInDetail/signInDetail?userInfo=${this.data.userInfo}` + }) + }, + phone(e){ + tt.makePhoneCall({ + phoneNumber: e.currentTarget.dataset.phone + }) + }, + toExit() { + console.log(1) + tt.reLaunch({ + url: '/pages/login/login', + }) + }, + showVersion: function () { + /** + * 长按显示版本号 + */ + let that = this; + if (that.data.flag == 'hidden') { + that.setData({ + flag: 'show' + }); + } + console.log(that.data.flag) + }, + //获取提现信息 + getTx(){ + Http.get({ + url: config.api.balance + }).then(res=>{ + console.log(111) + this.setData({ + cashOutCount: res.data.cashOutCount,//当日已提现次数 + cashOutNumber: res.data.cashOutNumber, // 可提现余额 + cashOutSupport: res.data.cashOutSupport,// 1 - 支持提现 0-不支持提现 + cashOutLimit: res.data.cashOutLimit,// 当日提现次数限制 + withdrawNun: res.data.cashOutLimit - res.data.cashOutCount, + cashOutOpenHeadImg: res.data.cashOutOpenHeadImg, + cashOutOpenNickName: res.data.cashOutOpenNickName + + }) + }).catch(err=>{ + tt.showToast({ + title: err.message, + icon:"none", + duration:2000 + }) + }) + }, + onLoad(){ + // this.findJurisdiction() + }, + onShow(){ + this.getTx() + app.globalData.userInfo().then(res => { + this.setData({ + userInfo: res + }) + console.log(this.data.userInfo) + if (this.data.userInfo.merchant_id){ + this.findAccountById(this.data.userInfo.merchant_id); + } + }) + // this.setData({ + // appVersion:appVersion + // }) + }, + //提现按钮 + withdraw(){ + console.log(this.data.cashOutOpenNickName) + tt.navigateTo({ + url: `/pages/withdraw/withdraw?money=${this.data.cashOutNumber}&userTop=${this.data.cashOutOpenHeadImg}&userName=${this.data.cashOutOpenNickName}`, + }) + }, + /** + * 查询是否有修改账户权限 + */ + findJurisdiction(){ + Http.get({ + url: config.api.permitModifiy, + }).then(res => { + console.log(res) + /** + * data:true + * 如有:显示 + * 没有;不显示 + */ + if (res && res.data == true) { + this.setData({ + haveData: true, + }) + } else { + this.setData({ + haveData: false, + }) + } + }).catch(error => { + console.log(error) + }) + }, + + /** + * 查询收款账户状态 + */ + findAccountById(merchant_id){ + Http.get({ + url: config.api.findAccountById, + data:{ + id: merchant_id + } + }).then(res=>{ + console.log(res) + /** + * receiverAccount + * 如有:已设置收款账户 + * 没有;未设置收款账户 + */ + if (res && res.data && res.data.receiverAccount){ + this.setData({ + isSet: true, + receiverAccount: res.data.receiverAccount, + receiverComments: res.data.receiverComments, + receiverType: res.data.receiverType + }) + }else{ + this.setData({ + isSet: false + }) + } + }).catch(error=>{ + console.log(error) + }) + } +}) \ No newline at end of file diff --git a/pages/user/user.json b/pages/user/user.json new file mode 100644 index 0000000..7f5a4d7 --- /dev/null +++ b/pages/user/user.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#52A0FD", + "navigationBarTextStyle": "white", + "navigationBarTitleText": "我的" + } \ No newline at end of file diff --git a/pages/user/user.ttml b/pages/user/user.ttml new file mode 100644 index 0000000..0d10156 --- /dev/null +++ b/pages/user/user.ttml @@ -0,0 +1,79 @@ + + + + + + + + + + {{userInfo.mall_name}}({{userInfo.merchant_name}}) + {{userInfo.phone}} + + + + + + + + + 修改密码 + + + + + + + + 积分操作记录 + + + + + + + 客服电话 + {{userInfo.service_phone}} + + + + + + + + + \ No newline at end of file diff --git a/pages/user/user.ttss b/pages/user/user.ttss new file mode 100644 index 0000000..15953f1 --- /dev/null +++ b/pages/user/user.ttss @@ -0,0 +1,195 @@ +/* pages/mine/mine.wxss */ +@import '../../iconfont.ttss'; + +.mine { + width: 100%; + height: 100%; + position: absolute; + background: #f8f8fa; +} +.version{ + width: 600rpx; + line-height: 160rpx; + text-align: center; + font-size: 30rpx; + color: #999; + margin: 0 auto; +} +.header { + position: relative; + width: 710rpx; + height: 200rpx; + display: flex; + background: #fff; + border-radius: 16rpx; + margin: -100rpx auto 0; + box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); +} + +.header>view:nth-child(1) { + width: 132rpx; + height: 132rpx; + margin-top: 4%; + border-radius: 50%; + overflow: hidden; + margin-left: 40rpx; +} + +.header>view:nth-child(1) image { + width: 100%; + height: 100%; +} + +.header>view:nth-child(2) { + display: flex; + width: 400rpx; + flex-direction: column; + margin-top: 53rpx; + margin-left: 20rpx; + position: relative; +} + +.header>view:nth-child(2) text { + font-size: 30rpx; +} + +.header>view:nth-child(2) text:nth-child(2) { + font-size: 30rpx; + color: #b8b8b8; + padding-top: 1.5%; +} + +.header>view:nth-child(2) text:nth-child(2) { + display: inline-block; + width: 400rpx; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} + +.header>view:nth-child(3) { + line-height: 186rpx; + position: absolute; + right: 4%; +} + +.imgs { + position: absolute; + right: 30rpx; + top: 0; + bottom: 0; + margin: auto; + width: 40rpx; + height: 40rpx; +} + +.section { + width: 100%; + /* height: 176rpx; */ + margin-top: 8%; + background: #fff; + display: flex; + flex-direction: column; +} + +.img { + display: block; + width: 100%; +} + +.section view { + position: relative; + width: 92%; + height: 88rpx; + line-height: 88rpx; + display: flex; + justify-content: space-between; + padding: 0 4%; + /* border-bottom: 1px solid #f5f5f5; */ +} + +.section view text { + font-size: 30rpx; + color: #000; + letter-spacing: 1.16rpx; +} + +.section view text:nth-child(2) { + font-size: 28rpx; + color: #888; + letter-spacing: 1.16rpx; + text-align: right; + margin-right: 40rpx; +} + +.exit { + width: 670rpx; + height: 94rpx; + font-size: 30rpx; + margin: 6% auto 0; + background: #fff; + line-height: 94rpx; + bottom: 44rpx; + color: #333; +} + +.active { + opacity: 0.6; +} +.withdrawBox{ +width: 710rpx; +/* height: 200rpx; */ +background: #fff; +border-radius: 16rpx; +margin:60rpx auto 0 auto; +/* box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); */ + +} +.textBox{ + overflow: hidden; +} +.balanceTitle{ + margin-left:20rpx; + font-weight: 700; + font-size: 36rpx; + padding: 10rpx; + float: left; +} +.hint{ + float: left; + padding-top: 12rpx; +} +.balanceNum{ + color: red; + margin-left: 20rpx; + font-weight: 700; + padding: 20rpx; + font-size: 36rpx; +} +.operationNum{ + margin-left: 50rpx; + font-size: 28rpx; + padding-bottom:40rpx; +} +.operationBut{ + width: 80%; + margin: auto; + text-align: center; + height: 80rpx; + line-height: 80rpx; + color: #fff; + background-color: rgba(22, 155, 213, 1); + font-size: 30rpx; + font-weight: 700; +} +.noOperationBut{ + width: 80%; + margin: auto; + text-align: center; + height: 80rpx; + line-height: 80rpx; + color: #fff; + background-color: rgba(0, 0, 0, 0.5); + font-size: 30rpx; + font-weight: 700; +} \ No newline at end of file diff --git a/pages/write0ff/write0ff.js b/pages/write0ff/write0ff.js new file mode 100644 index 0000000..8cbfe98 --- /dev/null +++ b/pages/write0ff/write0ff.js @@ -0,0 +1,202 @@ +const Http = require('../../utils/http.js') +const Common = require('../../common/common.js') +const app = getApp() + +Page({ + data: { + inputValue:"", + keyBordList: [{ + id: "1", + num: '1', + }, + { + id: "2", + num: '2' + }, + { + id: "3", + num: '3' + }, + { + id: "4", + num: '4' + }, + { + id: "5", + num: '5' + }, + { + id: "6", + num: '6' + }, + { + id: "7", + num: '7' + }, + { + id: "8", + num: '8' + }, + { + id: "9", + num: '9' + }, + { + id: "10", + num: '.' + }, + { + id: "11", + num: '0', + } + ], + flag: true, + val: '' + }, + hideKey() { + this.setData({ + flag: false + }) + }, + onClick(e) { + let { + id, + num + } = e.currentTarget.dataset.val + if (this.data.val == '请输入券码') { + this.setData({ + val: '' + }) + } + switch (num) { + case '1': + this.setData({ + val: this.data.val += num + }) + break; + case '2': + this.setData({ + val: this.data.val += num + }) + break; + case '3': + this.setData({ + val: this.data.val += num + }) + break; + case '4': + this.setData({ + val: this.data.val += num + }) + break; + case '5': + this.setData({ + val: this.data.val += num + }) + break; + case '6': + this.setData({ + val: this.data.val += num + }) + break; + case '7': + this.setData({ + val: this.data.val += num + }) + break; + case '8': + this.setData({ + val: this.data.val += num + }) + break; + case '9': + this.setData({ + val: this.data.val += num + }) + break; + case '.': + this.setData({ + val: this.data.val += num + }) + break; + case '0': + this.setData({ + val: this.data.val += num + }) + break; + } + }, + search() { + this.setData({ + flag: true + }) + }, + // delVal() { + // let { + // val + // } = this.data + // val = val.substr(0, val.length - 1) + // this.setData({ + // val + // }) + // }, + + /** + * 获取当前网络状态 + */ + getNetWorkType: function() { + tt.getNetworkType({ + success: function(res) { + console.log(res) + } + }) + }, + /** + * 获取系统信息 + */ + getSystemInfo: function() { + tt.getSystemInfo({ + success: function(res) { + console.log(res) + } + }) + }, + setVale(e){ + console.log(e.detail.value); + this.setData({ + inputValue:e.detail.value + }) + }, + toWriteoffPage() { + let val = this.data.inputValue; + console.log(val); + + if (val != '请输入券码' && val != '') { + console.log(val) + Common.getCouponOrderDetail(val) + .then(res => { + console.log(res); + if (res.code != 200) { + tt.reLaunch({ + url: `/pages/errorPage/errorPage?errTitle=${res.message}`, + }) + } else { + tt.setStorageSync("couponOrderId", val) + tt.navigateTo({ + url: `/pages/writeoffPage/writeoffPage` + }) + } + }) + } else if (val == '') { + tt.showToast({ + title: '券码不能为空', + image: '../../static/images/fail.png' + }) + } else { + tt.showToast({ + title: '券码不能为空', + image: '../../static/images/fail.png' + }) + } + } +}) \ No newline at end of file diff --git a/pages/write0ff/write0ff.json b/pages/write0ff/write0ff.json new file mode 100644 index 0000000..1138237 --- /dev/null +++ b/pages/write0ff/write0ff.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarTitleText": "核销券", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#52A0FD" + } \ No newline at end of file diff --git a/pages/write0ff/write0ff.ttml b/pages/write0ff/write0ff.ttml new file mode 100644 index 0000000..e4c30ac --- /dev/null +++ b/pages/write0ff/write0ff.ttml @@ -0,0 +1,27 @@ + +
+ + + 券码 + + + + + + + + + + +
\ No newline at end of file diff --git a/pages/write0ff/write0ff.ttss b/pages/write0ff/write0ff.ttss new file mode 100644 index 0000000..b9bdf60 --- /dev/null +++ b/pages/write0ff/write0ff.ttss @@ -0,0 +1,140 @@ +@import '../../iconfont.ttss'; +.write0ff { + width: 100%; + height: 100%; + background: #f8f8fa; + position: absolute; + border-top: 1rpx solid #f5f5f5; +} + +.write0ff>view { + width: 710rpx; + margin: 0 auto; + height: 160rpx; + display: flex; + line-height: 88rpx; + position: relative; + background: #fff; + margin-top: 250rpx; + box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); + border-radius: 15rpx; +} + +.write0ff>view>text:nth-child(1) { + width: 77rpx; + color: #333; + font-size: 30rpx; + margin-left: 4%; + margin-right: 2.2%; + line-height: 160rpx; +} + +.line { + width: 3rpx; + height: 40rpx; + background: #999; + display: inline-block; + margin-top: 8.2%; +} + +.search { + width: 400rpx; + overflow: hidden; + margin-left: 4%; + font-size: 30rpx; + color: #bfbfbf; + letter-spacing: 0; + line-height: 160rpx; + height: 160rpx; +} +.iconfont{ + display: inline-block; + width: 110rpx; + line-height: 110rpx; + height: 110rpx; + color: #fff; + background: #52A0FD; + font-size: 60rpx; + border-radius: 100rpx; + margin-right: 20rpx; + margin-top: 27rpx; + box-shadow:0 6px 20px 0 ; +} + +.write0ff>view>text:nth-child(4) { + width: 40%; + background: #52a0fd; + color: #fff; + text-align: center; + line-height: 160rpx; + font-size: 59rpx; + border-radius: 16rpx; +} +.actives{ + opacity: .6!important; +} + +.softkey { + width: 100% !important; + height: 0rpx !important; + display: flex !important; +} + +.softkey view:nth-child(1) { + height: 401rpx; + width: 82%; + background: #fff; + position: fixed; + bottom: 0; + left: 0; + display: flex; + flex-wrap: wrap; + text-align: center; +} + +.active { + opacity: 0.6; +} + +.softkey view:nth-child(1) text { + width: 30.3%; + border-top: 1rpx solid #ccc; + border-left: 1rpx solid #ccc; +} + +.softkey view:nth-child(2) { + height: 399rpx; + border-top: 1rpx solid #ccc; + width: 25%; + background: #fff; + position: fixed; + bottom: 0; + right: 0; + display: flex; + flex-direction: column; + text-align: center; + line-height: 198rpx; +} + +.softkey view:nth-child(2) text { + width: 100%; + height: 50%; + border-left: 1rpx solid #ccc; +} + +.softkey view:nth-child(2) text:nth-child(1) { + font-size: 48rpx; +} + +.sure { + width: 100%; + padding: 0 5rpx; + display: block; + background: #52a0fd; + color: #fff; + font-size: 42rpx; +} + +.hideKey { + font-size: 48rpx; +} diff --git a/pages/writeoffPage/writeoffPage.js b/pages/writeoffPage/writeoffPage.js new file mode 100644 index 0000000..a8e11fb --- /dev/null +++ b/pages/writeoffPage/writeoffPage.js @@ -0,0 +1,135 @@ + +const config = require('../../config/config.js') +const Common = require('../../common/common.js') +const format = require('../../utils/util.js') +var app = getApp() +Page({ + data: { + val: '请输入券码', + couponOrderId: null, + couponOrderDetail: null, + statusImg: '', + statusText: '', + flag: false, + detail: '', + remark: '', + contentType: 0, + + }, + rule() { + tt.navigateTo({ + url: `/pages/main/rule/rule?detail=${this.data.couponOrderDetail.detail}&remark=${this.data.couponOrderDetail.remark}&contentType=${this.data.contentType}` + }) + }, + onLoad(options) { + if (tt.getStorageSync("couponOrderId")) { + this.setData({ + couponOrderId: tt.getStorageSync("couponOrderId") + }) + this.detailInfo(tt.getStorageSync("couponOrderId")) + } + }, + detailInfo(couponOrderId) { + var that = this; + Common.getCouponOrderDetail(couponOrderId) + .then(res => { + console.log(res) + if (res.code == 200) { + + this.setData({ + contentType: res.data.contentType ? res.data.contentType : 0 + }) + console.log(this.data.contentType) + if (res.data.contentType != undefined && res.data.contentType == 1) { + Common.getHtml(couponOrderId).then(res => { + if (res.data.html && res.data.html != '') { + app.globalData.curHtml = decodeURI(res.data.html); + } + }) + } + + res.data.createDate = format.formatTime(res.data.createDate, 'yyyy-MM-dddd hh:mm:ss') + res.data.expiredTime = format.formatTime(res.data.expiredTime, 'yyyy-MM-dddd hh:mm:ss') + switch (res.data.couponOrderStatus) { + case 0: + //待使用 + that.setData({ + statusText: '未核销', + flag: true + }) + break; + case 1: + //已核销 + that.setData({ + statusImg: '/static/images/use.png', + statusText: '已核销', + flag: false + }) + break; + case 2: + that.setData({ + statusImg: '/static/images/beOverdue.png', + statusText: '已过期', + flag: false + }) + //已过期 + break; + case 3: + that.setData({ + statusImg: '/static/images/refund.png', + statusText: '已退款', + flag: false + }) + //已作废 + break; + default: + tt.showToast({ + title: '数据有误', + image:'../../static/images/fail.png' + }) + } + console.log(res) + console.log("我是请求回来的数据") + that.setData({ + couponOrderDetail: res.data + }) + } else { + tt.reLaunch({ + url: 'pages/main/writeoffPage/errorPage/errorPage', + }) + } + }) + }, + user() { + console.log(tt.getStorageSync("verifyRemark")) + // return + Common.couponOrderVerify(this.data.couponOrderId, tt.getStorageSync("verifyRemark")) + .then(res => { + console.log(res) + if (res.code == 200) { + tt.redirectTo({ + url: '../success/success', + }) + }else{ + tt.showModal({ + title: '抱歉', + content: res.message, + showCancel:false + }) + } + }) + .catch(error=>{ + console.log(error) + tt.showModal({ + title: '抱歉', + content: error.message, + showCancel: false + }) + }) + }, + reBuck() { + tt.switchTab({ + url: '/pages/main/main', + }) + } +}) \ No newline at end of file diff --git a/pages/writeoffPage/writeoffPage.json b/pages/writeoffPage/writeoffPage.json new file mode 100644 index 0000000..1138237 --- /dev/null +++ b/pages/writeoffPage/writeoffPage.json @@ -0,0 +1,6 @@ +{ + "backgroundTextStyle": "light", + "navigationBarTitleText": "核销券", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#52A0FD" + } \ No newline at end of file diff --git a/pages/writeoffPage/writeoffPage.ttml b/pages/writeoffPage/writeoffPage.ttml new file mode 100644 index 0000000..053a55f --- /dev/null +++ b/pages/writeoffPage/writeoffPage.ttml @@ -0,0 +1,49 @@ + + + + + + + + + {{couponOrderDetail.title}} + 有效期至:{{couponOrderDetail.expiredTime}} + ¥{{couponOrderDetail.couponPrice/100}} + ¥{{couponOrderDetail.salePrice/100}} + + + + 领券时间 + {{couponOrderDetail.createDate}} + + + 券码 + {{couponOrderDetail.id}} + + + + + 活动规则 + + + + 原价 + 券面额 + {{couponOrderDetail.price/100}}元 + + + 券售价 + 底价 + {{couponOrderDetail.couponPrice/100}} + + + 券状态 + {{statusText}} + + + + + + + + \ No newline at end of file diff --git a/pages/writeoffPage/writeoffPage.ttss b/pages/writeoffPage/writeoffPage.ttss new file mode 100644 index 0000000..d5a13f8 --- /dev/null +++ b/pages/writeoffPage/writeoffPage.ttss @@ -0,0 +1,162 @@ +/* pages/index/writeoffPage/writeoffPage.wxss */ +@import '../../iconfont.ttss'; + +.write0ffPage { + width: 100%; + height: 100%; + background: #f5f5f5; + position: absolute; + border-top: 1px solid #f5f5f5; +} + +.user { + position: fixed; + left: 0; + right: 0; + margin: auto; + bottom: 40rpx; + width: 92%; + background: #52a0fd; + border-radius: 8rpx; + color: #fff; + font-size: 36rpx; + height: 94rpx; + line-height: 94rpx; +} + +.detail_msg { + width: 100%; + height: 416rpx !important; + background: #fff; + display: flex; + flex-direction: column; +} + +.active{ + opacity: .6; +} +.detail_msg>view:nth-child(1) { + width: 100%; + height: 244rpx; + display: flex; +} + +.detail_msg>view:nth-child(1) view:nth-child(1) { + width: 248rpx; + height: 184rpx; +} + +.detail_msg>view:nth-child(1)>view:nth-child(1) image { + width: 100%; + height: 100%; + margin: 20rpx 0 0 30rpx; + border: 1px solid #eee; + border-radius: 16rpx; +} + +.detail_msg>view:nth-child(1)>view:nth-child(2) { + width: 50%; + margin-left: 7%; + display: flex; + flex-direction: column; +} + + +.detail_msg>view:nth-child(1)>view:nth-child(2)>text:nth-child(1) { + width: 374rpx; + height: 72rpx; + overflow: hidden; + font-size: 26rpx; + font-weight: bold; + margin-top: 27rpx; +} + +.detail_msg>view:nth-child(1)>view:nth-child(2) text:nth-child(2) { + font-size: 22rpx; + color: #333; +} + +.detail_msg>view:nth-child(1)>view:nth-child(2) text:nth-child(2) text { + font-size: 22rpx; + color: #ff3434; +} + +.detail_msg>view:nth-child(1)>view:nth-child(2) text:nth-child(3) { + font-size: 36rpx; + color: #ff3434; + margin-top: 15rpx; + font-weight: bold; +} + +.detail_msg>view:nth-child(1)>view:nth-child(2) text:nth-child(3) text { + font-size: 24rpx; + color: #b4b4b4; + text-decoration: line-through; +} + +.detail_msg>view:nth-child(2) text { + font-size: 28rpx; +} + +.detail_msg>view:nth-child(2), .detail_msg>view:nth-child(3) { + width: 92%; + height: 88rpx; + line-height: 88rpx; + border-top: 1px solid #f5f5f5; + display: flex; + justify-content: space-between; + padding: 0 4%; +} + +.detail_msg>view:nth-child(2), .detail_msg>view:nth-child(3) text { + font-size: 28rpx; +} + +.detail_msg>view:nth-child(2) text:nth-child(2), +.detail_msg>view:nth-child(3) text:nth-child(2) { + color: #b8b8b8; +} + +.detail_info { + width: 100%; + height: 352rpx !important; + background: #fff; + margin-top: 2%; + display: flex; + flex-direction: column; +} + +.detail_info view { + width: 92%; + height: 88rpx; + border-top: 1px solid #f5f5f5; + display: flex; + justify-content: space-between; + padding: 0 4%; + line-height: 88rpx; +} + +.detail_info view text { + font-size: 28rpx; +} + +.detail_info view text:nth-child(2) { + color: #b8b8b8; +} + +.detail_info view:nth-child(4) text:nth-child(2) { + color: #ffae00; +} + +.status { + width: 320rpx; + height: 320rpx; + position: fixed; + right: 0; + bottom: 20%; +} + +.status image { + width: 100%; + height: 100%; +} diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..fc7f890 --- /dev/null +++ b/project.config.json @@ -0,0 +1,32 @@ +{ + "setting": { + "urlCheck": true, + "es6": true, + "newFeature": false, + "postcss": false, + "autoCompile": true, + "mockUpdate": true, + "minified": false, + "autoPush": false, + "scripts": false, + "mockLogin": false + }, + "appid": "tt7af40c49e5cd8d5001", + "projectname": "tt富茂B", + "condition": { + "miniprogram": { + "current": -1, + "list": [ + { + "id": 1637139224806, + "name": "11", + "pathName": "pages/index/index", + "query": "", + "scene": "990001", + "launchFrom": "scan", + "location": "qr_code" + } + ] + } + } +} diff --git a/static/images/admin.png b/static/images/admin.png new file mode 100644 index 0000000..3447603 Binary files /dev/null and b/static/images/admin.png differ diff --git a/static/images/arrow.png b/static/images/arrow.png new file mode 100644 index 0000000..de0feea Binary files /dev/null and b/static/images/arrow.png differ diff --git a/static/images/bannerbg.png b/static/images/bannerbg.png new file mode 100644 index 0000000..2261718 Binary files /dev/null and b/static/images/bannerbg.png differ diff --git a/static/images/beOverdue.png b/static/images/beOverdue.png new file mode 100644 index 0000000..c4f0fa9 Binary files /dev/null and b/static/images/beOverdue.png differ diff --git a/static/images/bg.png b/static/images/bg.png new file mode 100644 index 0000000..f110435 Binary files /dev/null and b/static/images/bg.png differ diff --git a/static/images/bill.png b/static/images/bill.png new file mode 100644 index 0000000..11a8405 Binary files /dev/null and b/static/images/bill.png differ diff --git a/static/images/bill1.png b/static/images/bill1.png new file mode 100644 index 0000000..7211144 Binary files /dev/null and b/static/images/bill1.png differ diff --git a/static/images/camera.png b/static/images/camera.png new file mode 100644 index 0000000..79c9241 Binary files /dev/null and b/static/images/camera.png differ diff --git a/static/images/cuoo.jpg b/static/images/cuoo.jpg new file mode 100644 index 0000000..47ef7dd Binary files /dev/null and b/static/images/cuoo.jpg differ diff --git a/static/images/daijiao.png b/static/images/daijiao.png new file mode 100644 index 0000000..c9e2bc0 Binary files /dev/null and b/static/images/daijiao.png differ diff --git a/static/images/data1.png b/static/images/data1.png new file mode 100644 index 0000000..1ed67ba Binary files /dev/null and b/static/images/data1.png differ diff --git a/static/images/data2.png b/static/images/data2.png new file mode 100644 index 0000000..e60eeb8 Binary files /dev/null and b/static/images/data2.png differ diff --git a/static/images/eye.png b/static/images/eye.png new file mode 100644 index 0000000..e58bfe1 Binary files /dev/null and b/static/images/eye.png differ diff --git a/static/images/fail.png b/static/images/fail.png new file mode 100644 index 0000000..8919125 Binary files /dev/null and b/static/images/fail.png differ diff --git a/static/images/hide.png b/static/images/hide.png new file mode 100644 index 0000000..ed77b22 Binary files /dev/null and b/static/images/hide.png differ diff --git a/static/images/home-n.png b/static/images/home-n.png new file mode 100644 index 0000000..dc6434e Binary files /dev/null and b/static/images/home-n.png differ diff --git a/static/images/home-y.png b/static/images/home-y.png new file mode 100644 index 0000000..68365e6 Binary files /dev/null and b/static/images/home-y.png differ diff --git a/static/images/jian.png b/static/images/jian.png new file mode 100644 index 0000000..c33a54c Binary files /dev/null and b/static/images/jian.png differ diff --git a/static/images/jiaoyi.png b/static/images/jiaoyi.png new file mode 100644 index 0000000..a5f20b2 Binary files /dev/null and b/static/images/jiaoyi.png differ diff --git a/static/images/logo.png b/static/images/logo.png new file mode 100644 index 0000000..f4d3142 Binary files /dev/null and b/static/images/logo.png differ diff --git a/static/images/logo1.png b/static/images/logo1.png new file mode 100644 index 0000000..26de594 Binary files /dev/null and b/static/images/logo1.png differ diff --git a/static/images/logo1111.png b/static/images/logo1111.png new file mode 100644 index 0000000..4bcbff5 Binary files /dev/null and b/static/images/logo1111.png differ diff --git a/static/images/mess.png b/static/images/mess.png new file mode 100644 index 0000000..49890d1 Binary files /dev/null and b/static/images/mess.png differ diff --git a/static/images/nohave03.png b/static/images/nohave03.png new file mode 100644 index 0000000..1db75b9 Binary files /dev/null and b/static/images/nohave03.png differ diff --git a/static/images/nothave01.png b/static/images/nothave01.png new file mode 100644 index 0000000..d683c2d Binary files /dev/null and b/static/images/nothave01.png differ diff --git a/static/images/nothave02.png b/static/images/nothave02.png new file mode 100644 index 0000000..108703a Binary files /dev/null and b/static/images/nothave02.png differ diff --git a/static/images/password.png b/static/images/password.png new file mode 100644 index 0000000..4417051 Binary files /dev/null and b/static/images/password.png differ diff --git a/static/images/refund.png b/static/images/refund.png new file mode 100644 index 0000000..acab85c Binary files /dev/null and b/static/images/refund.png differ diff --git a/static/images/reviveimg.png b/static/images/reviveimg.png new file mode 100644 index 0000000..9b51d6e Binary files /dev/null and b/static/images/reviveimg.png differ diff --git a/static/images/scan.png b/static/images/scan.png new file mode 100644 index 0000000..5612c22 Binary files /dev/null and b/static/images/scan.png differ diff --git a/static/images/selected2.png b/static/images/selected2.png new file mode 100644 index 0000000..cccac1e Binary files /dev/null and b/static/images/selected2.png differ diff --git a/static/images/success.png b/static/images/success.png new file mode 100644 index 0000000..d5946be Binary files /dev/null and b/static/images/success.png differ diff --git a/static/images/tick.png b/static/images/tick.png new file mode 100644 index 0000000..82f323d Binary files /dev/null and b/static/images/tick.png differ diff --git a/static/images/use.png b/static/images/use.png new file mode 100644 index 0000000..7679f2d Binary files /dev/null and b/static/images/use.png differ diff --git a/static/images/user-n.png b/static/images/user-n.png new file mode 100644 index 0000000..5df5f66 Binary files /dev/null and b/static/images/user-n.png differ diff --git a/static/images/user-y.png b/static/images/user-y.png new file mode 100644 index 0000000..c2426be Binary files /dev/null and b/static/images/user-y.png differ diff --git a/static/images/weidaozhang.png b/static/images/weidaozhang.png new file mode 100644 index 0000000..92f2e4e Binary files /dev/null and b/static/images/weidaozhang.png differ diff --git a/static/images/xia.png b/static/images/xia.png new file mode 100644 index 0000000..6fd5402 Binary files /dev/null and b/static/images/xia.png differ diff --git a/utils/HttpBasics.js b/utils/HttpBasics.js new file mode 100644 index 0000000..59bfe05 --- /dev/null +++ b/utils/HttpBasics.js @@ -0,0 +1,126 @@ +const config = require("../config/config.js"); +class HttpBasics { + constructor(address) { + if (address) { + this.address = address; + } + } + /** + * 配置 + */ + config = config; + /** + * 请求路径前缀 + */ + + address ='https://btest.malls.iformall.com/B';// + /** + * 请求头 + */ + headers = { + "Content-Type": "application/json;charset=UTF-8", + token: "" + // token: "0b272d7d-d669-401a-8d4b-a9eef9340dc1:1027:tt-cuser" + }; + + /** + * 设置token + * @param {*} token + */ + setToken(token) { + this.headers.token = token; + } + /** + * 设置bUserId + */ + setBUserId(bUserId){ + this.headers.bid = bUserId; + } + /** + * 获取数据 + * @param {url,data,headers} param0 + */ + get({ url, data, headers }) { + headers = { ...this.headers, ...headers }; + url = `${this.address}${url}`; + return new Promise((resolve, reject) => { + tt.request({ + url: url, + header: headers, + data: data, + method: "get", + success: res => { + this.responseMap(res, resolve, reject); + }, + fail: err => { + console.log(err) + if (err.errMsg == 'request:fail timeout') { + err.errMsg = '请求超时,请检查您的网络设置!' + } else if (err.errMsg == 'request:fail'){ + err.errMsg = '未检查到您的网络,请检查您的网络设置!' + } else if (err.errMsg == 'request:fail request connect error') { + err.errMsg = '连接失败' + } + reject(err); + } + }); + }); + } + /** + * 提交数据 + * @param {url,data,headers} param0 + */ + post({ url, data, headers }) { + headers = { ...this.headers, ...headers }; + url = `${this.address}${url}`; + return new Promise((resolve, reject) => { + tt.request({ + url: url, + header: headers, + data: data, + method: "post", + success: res => { + this.responseMap(res, resolve, reject); + }, + fail: err => { + if (err.errMsg == 'request:fail timeout') { + err.errMsg = '请求超时,请检查您的网络设置!' + } else if (err.errMsg == 'request:fail') { + err.errMsg = '未检查到您的网络,请检查您的网络设置!' + } else if (err.errMsg == 'request:fail request connect error') { + err.errMsg = '连接失败' + } + reject(err); + }, + complete: res => {} + }); + }); + } + /** + * 过滤 请求信息 + * @param {*} res + * @param {*} resolve + * @param {*} reject + */ + responseMap = (res, resolve, reject) => { + // 网络状态码200 + if (res.statusCode == 200) { + // 服务器code 200 成功 + if (res.data.code == 200) { + resolve(res.data); + } else if (res.data.code == 1052) { + tt.reLaunch({ + url: '/pages/index/index' + }) + } else { + reject(res.data); + } + } else { + console.log("请求出错:", res); + reject(res.data); + } + }; + /** 日志 */ + log(url, body, headers) {} +} +module.exports = new HttpBasics(); diff --git a/utils/barcode.js b/utils/barcode.js new file mode 100644 index 0000000..0a94287 --- /dev/null +++ b/utils/barcode.js @@ -0,0 +1,392 @@ +var CHAR_TILDE = 126; +var CODE_FNC1 = 102; + +var SET_STARTA = 103; +var SET_STARTB = 104; +var SET_STARTC = 105; +var SET_SHIFT = 98; +var SET_CODEA = 101; +var SET_CODEB = 100; +var SET_STOP = 106; + + +var REPLACE_CODES = { + CHAR_TILDE: CODE_FNC1 //~ corresponds to FNC1 in GS1-128 standard +} + +var CODESET = { + ANY: 1, + AB: 2, + A: 3, + B: 4, + C: 5 +}; + +function getBytes(str) { + var bytes = []; + for (var i = 0; i < str.length; i++) { + bytes.push(str.charCodeAt(i)); + } + return bytes; +} + +exports.code128 = function(ctx, text, width, height) { + + width = parseInt(width); + + height = parseInt(height); + + var codes = stringToCode128(text); + + var g = new Graphics(ctx, width, height); + + var barWeight = g.area.width / ((codes.length - 3) * 11 + 35); + + var x = g.area.left; + var y = g.area.top; + for (var i = 0; i < codes.length; i++) { + var c = codes[i]; + //two bars at a time: 1 black and 1 white + for (var bar = 0; bar < 8; bar += 2) { + var barW = PATTERNS[c][bar] * barWeight; + // var barH = height - y - this.border; + var barH = height - y; + var spcW = PATTERNS[c][bar + 1] * barWeight; + + //no need to draw if 0 width + if (barW > 0) { + g.fillFgRect(x, y, barW, barH); + } + + x += barW + spcW; + } + } + + ctx.draw(); +} + + +function stringToCode128(text) { + + var barc = { + currcs: CODESET.C + }; + + var bytes = getBytes(text); + //decide starting codeset + var index = bytes[0] == CHAR_TILDE ? 1 : 0; + + var csa1 = bytes.length > 0 ? codeSetAllowedFor(bytes[index++]) : CODESET.AB; + var csa2 = bytes.length > 0 ? codeSetAllowedFor(bytes[index++]) : CODESET.AB; + barc.currcs = getBestStartSet(csa1, csa2); + barc.currcs = perhapsCodeC(bytes, barc.currcs); + + //if no codeset changes this will end up with bytes.length+3 + //start, checksum and stop + var codes = new Array(); + + switch (barc.currcs) { + case CODESET.A: + codes.push(SET_STARTA); + break; + case CODESET.B: + codes.push(SET_STARTB); + break; + default: + codes.push(SET_STARTC); + break; + } + + + for (var i = 0; i < bytes.length; i++) { + var b1 = bytes[i]; //get the first of a pair + //should we translate/replace + if (b1 in REPLACE_CODES) { + codes.push(REPLACE_CODES[b1]); + i++ //jump to next + b1 = bytes[i]; + } + + //get the next in the pair if possible + var b2 = bytes.length > (i + 1) ? bytes[i + 1] : -1; + + codes = codes.concat(codesForChar(b1, b2, barc.currcs)); + //code C takes 2 chars each time + if (barc.currcs == CODESET.C) i++; + } + + //calculate checksum according to Code 128 standards + var checksum = codes[0]; + for (var weight = 1; weight < codes.length; weight++) { + checksum += (weight * codes[weight]); + } + codes.push(checksum % 103); + + codes.push(SET_STOP); + + //encoding should now be complete + return codes; + + function getBestStartSet(csa1, csa2) { + //tries to figure out the best codeset + //to start with to get the most compact code + var vote = 0; + vote += csa1 == CODESET.A ? 1 : 0; + vote += csa1 == CODESET.B ? -1 : 0; + vote += csa2 == CODESET.A ? 1 : 0; + vote += csa2 == CODESET.B ? -1 : 0; + //tie goes to B due to my own predudices + return vote > 0 ? CODESET.A : CODESET.B; + } + + function perhapsCodeC(bytes, codeset) { + for (var i = 0; i < bytes.length; i++) { + var b = bytes[i] + if ((b < 48 || b > 57) && b != CHAR_TILDE) + return codeset; + } + return CODESET.C; + } + + //chr1 is current byte + //chr2 is the next byte to process. looks ahead. + function codesForChar(chr1, chr2, currcs) { + var result = []; + var shifter = -1; + + if (charCompatible(chr1, currcs)) { + if (currcs == CODESET.C) { + if (chr2 == -1) { + shifter = SET_CODEB; + currcs = CODESET.B; + } else if ((chr2 != -1) && !charCompatible(chr2, currcs)) { + //need to check ahead as well + if (charCompatible(chr2, CODESET.A)) { + shifter = SET_CODEA; + currcs = CODESET.A; + } else { + shifter = SET_CODEB; + currcs = CODESET.B; + } + } + } + } else { + //if there is a next char AND that next char is also not compatible + if ((chr2 != -1) && !charCompatible(chr2, currcs)) { + //need to switch code sets + switch (currcs) { + case CODESET.A: + shifter = SET_CODEB; + currcs = CODESET.B; + break; + case CODESET.B: + shifter = SET_CODEA; + currcs = CODESET.A; + break; + } + } else { + //no need to shift code sets, a temporary SHIFT will suffice + shifter = SET_SHIFT; + } + } + + //ok some type of shift is nessecary + if (shifter != -1) { + result.push(shifter); + result.push(codeValue(chr2)); + } else { + if (currcs == CODESET.C) { + //include next as well + result.push(codeValue(chr1, chr2)); + } else { + result.push(codeValue(chr1)); + } + } + barc.currcs = currcs; + + return result; + } +} + +//reduce the ascii code to fit into the Code128 char table +function codeValue(chr1, chr2) { + if (typeof chr2 == "undefined") { + return chr1 >= 32 ? chr1 - 32 : chr1 + 64; + } else { + return parseInt(String.fromCharCode(chr1) + String.fromCharCode(chr2)); + } +} + +function charCompatible(chr, codeset) { + var csa = codeSetAllowedFor(chr); + if (csa == CODESET.ANY) return true; + //if we need to change from current + if (csa == CODESET.AB) return true; + if (csa == CODESET.A && codeset == CODESET.A) return true; + if (csa == CODESET.B && codeset == CODESET.B) return true; + return false; +} + +function codeSetAllowedFor(chr) { + if (chr >= 48 && chr <= 57) { + //0-9 + return CODESET.ANY; + } else if (chr >= 32 && chr <= 95) { + //0-9 A-Z + return CODESET.AB; + } else { + //if non printable + return chr < 32 ? CODESET.A : CODESET.B; + } +} + +var Graphics = function(ctx, width, height) { + + this.width = width; + this.height = height; + this.quiet = Math.round(this.width / 40); + + this.border_size = 0; + this.padding_width = 0; + + this.area = { + width: width - this.padding_width * 2 - this.quiet * 2, + height: height - this.border_size * 2, + top: this.border_size - 4, + left: this.padding_width + this.quiet + }; + + this.ctx = ctx; + this.fg = "#000000"; + this.bg = "#ffffff"; + + // fill background + this.fillBgRect(0, 0, width, height); + + // fill center to create border + this.fillBgRect(0, this.border_size, width, height - this.border_size * 2); +} + +//use native color +Graphics.prototype._fillRect = function(x, y, width, height, color) { + this.ctx.setFillStyle(color) + this.ctx.fillRect(x, y, width, height) +} + +Graphics.prototype.fillFgRect = function(x, y, width, height) { + this._fillRect(x, y, width, height, this.fg); +} + +Graphics.prototype.fillBgRect = function(x, y, width, height) { + this._fillRect(x, y, width, height, this.bg); +} + +var PATTERNS = [ + [2, 1, 2, 2, 2, 2, 0, 0], // 0 + [2, 2, 2, 1, 2, 2, 0, 0], // 1 + [2, 2, 2, 2, 2, 1, 0, 0], // 2 + [1, 2, 1, 2, 2, 3, 0, 0], // 3 + [1, 2, 1, 3, 2, 2, 0, 0], // 4 + [1, 3, 1, 2, 2, 2, 0, 0], // 5 + [1, 2, 2, 2, 1, 3, 0, 0], // 6 + [1, 2, 2, 3, 1, 2, 0, 0], // 7 + [1, 3, 2, 2, 1, 2, 0, 0], // 8 + [2, 2, 1, 2, 1, 3, 0, 0], // 9 + [2, 2, 1, 3, 1, 2, 0, 0], // 10 + [2, 3, 1, 2, 1, 2, 0, 0], // 11 + [1, 1, 2, 2, 3, 2, 0, 0], // 12 + [1, 2, 2, 1, 3, 2, 0, 0], // 13 + [1, 2, 2, 2, 3, 1, 0, 0], // 14 + [1, 1, 3, 2, 2, 2, 0, 0], // 15 + [1, 2, 3, 1, 2, 2, 0, 0], // 16 + [1, 2, 3, 2, 2, 1, 0, 0], // 17 + [2, 2, 3, 2, 1, 1, 0, 0], // 18 + [2, 2, 1, 1, 3, 2, 0, 0], // 19 + [2, 2, 1, 2, 3, 1, 0, 0], // 20 + [2, 1, 3, 2, 1, 2, 0, 0], // 21 + [2, 2, 3, 1, 1, 2, 0, 0], // 22 + [3, 1, 2, 1, 3, 1, 0, 0], // 23 + [3, 1, 1, 2, 2, 2, 0, 0], // 24 + [3, 2, 1, 1, 2, 2, 0, 0], // 25 + [3, 2, 1, 2, 2, 1, 0, 0], // 26 + [3, 1, 2, 2, 1, 2, 0, 0], // 27 + [3, 2, 2, 1, 1, 2, 0, 0], // 28 + [3, 2, 2, 2, 1, 1, 0, 0], // 29 + [2, 1, 2, 1, 2, 3, 0, 0], // 30 + [2, 1, 2, 3, 2, 1, 0, 0], // 31 + [2, 3, 2, 1, 2, 1, 0, 0], // 32 + [1, 1, 1, 3, 2, 3, 0, 0], // 33 + [1, 3, 1, 1, 2, 3, 0, 0], // 34 + [1, 3, 1, 3, 2, 1, 0, 0], // 35 + [1, 1, 2, 3, 1, 3, 0, 0], // 36 + [1, 3, 2, 1, 1, 3, 0, 0], // 37 + [1, 3, 2, 3, 1, 1, 0, 0], // 38 + [2, 1, 1, 3, 1, 3, 0, 0], // 39 + [2, 3, 1, 1, 1, 3, 0, 0], // 40 + [2, 3, 1, 3, 1, 1, 0, 0], // 41 + [1, 1, 2, 1, 3, 3, 0, 0], // 42 + [1, 1, 2, 3, 3, 1, 0, 0], // 43 + [1, 3, 2, 1, 3, 1, 0, 0], // 44 + [1, 1, 3, 1, 2, 3, 0, 0], // 45 + [1, 1, 3, 3, 2, 1, 0, 0], // 46 + [1, 3, 3, 1, 2, 1, 0, 0], // 47 + [3, 1, 3, 1, 2, 1, 0, 0], // 48 + [2, 1, 1, 3, 3, 1, 0, 0], // 49 + [2, 3, 1, 1, 3, 1, 0, 0], // 50 + [2, 1, 3, 1, 1, 3, 0, 0], // 51 + [2, 1, 3, 3, 1, 1, 0, 0], // 52 + [2, 1, 3, 1, 3, 1, 0, 0], // 53 + [3, 1, 1, 1, 2, 3, 0, 0], // 54 + [3, 1, 1, 3, 2, 1, 0, 0], // 55 + [3, 3, 1, 1, 2, 1, 0, 0], // 56 + [3, 1, 2, 1, 1, 3, 0, 0], // 57 + [3, 1, 2, 3, 1, 1, 0, 0], // 58 + [3, 3, 2, 1, 1, 1, 0, 0], // 59 + [3, 1, 4, 1, 1, 1, 0, 0], // 60 + [2, 2, 1, 4, 1, 1, 0, 0], // 61 + [4, 3, 1, 1, 1, 1, 0, 0], // 62 + [1, 1, 1, 2, 2, 4, 0, 0], // 63 + [1, 1, 1, 4, 2, 2, 0, 0], // 64 + [1, 2, 1, 1, 2, 4, 0, 0], // 65 + [1, 2, 1, 4, 2, 1, 0, 0], // 66 + [1, 4, 1, 1, 2, 2, 0, 0], // 67 + [1, 4, 1, 2, 2, 1, 0, 0], // 68 + [1, 1, 2, 2, 1, 4, 0, 0], // 69 + [1, 1, 2, 4, 1, 2, 0, 0], // 70 + [1, 2, 2, 1, 1, 4, 0, 0], // 71 + [1, 2, 2, 4, 1, 1, 0, 0], // 72 + [1, 4, 2, 1, 1, 2, 0, 0], // 73 + [1, 4, 2, 2, 1, 1, 0, 0], // 74 + [2, 4, 1, 2, 1, 1, 0, 0], // 75 + [2, 2, 1, 1, 1, 4, 0, 0], // 76 + [4, 1, 3, 1, 1, 1, 0, 0], // 77 + [2, 4, 1, 1, 1, 2, 0, 0], // 78 + [1, 3, 4, 1, 1, 1, 0, 0], // 79 + [1, 1, 1, 2, 4, 2, 0, 0], // 80 + [1, 2, 1, 1, 4, 2, 0, 0], // 81 + [1, 2, 1, 2, 4, 1, 0, 0], // 82 + [1, 1, 4, 2, 1, 2, 0, 0], // 83 + [1, 2, 4, 1, 1, 2, 0, 0], // 84 + [1, 2, 4, 2, 1, 1, 0, 0], // 85 + [4, 1, 1, 2, 1, 2, 0, 0], // 86 + [4, 2, 1, 1, 1, 2, 0, 0], // 87 + [4, 2, 1, 2, 1, 1, 0, 0], // 88 + [2, 1, 2, 1, 4, 1, 0, 0], // 89 + [2, 1, 4, 1, 2, 1, 0, 0], // 90 + [4, 1, 2, 1, 2, 1, 0, 0], // 91 + [1, 1, 1, 1, 4, 3, 0, 0], // 92 + [1, 1, 1, 3, 4, 1, 0, 0], // 93 + [1, 3, 1, 1, 4, 1, 0, 0], // 94 + [1, 1, 4, 1, 1, 3, 0, 0], // 95 + [1, 1, 4, 3, 1, 1, 0, 0], // 96 + [4, 1, 1, 1, 1, 3, 0, 0], // 97 + [4, 1, 1, 3, 1, 1, 0, 0], // 98 + [1, 1, 3, 1, 4, 1, 0, 0], // 99 + [1, 1, 4, 1, 3, 1, 0, 0], // 100 + [3, 1, 1, 1, 4, 1, 0, 0], // 101 + [4, 1, 1, 1, 3, 1, 0, 0], // 102 + [2, 1, 1, 4, 1, 2, 0, 0], // 103 + [2, 1, 1, 2, 1, 4, 0, 0], // 104 + [2, 1, 1, 2, 3, 2, 0, 0], // 105 + [2, 3, 3, 1, 1, 1, 2, 0] // 106 +] \ No newline at end of file diff --git a/utils/changeNum.js b/utils/changeNum.js new file mode 100644 index 0000000..5df8463 --- /dev/null +++ b/utils/changeNum.js @@ -0,0 +1,22 @@ +//货币单位转换 +export function changeNumber(num) { + var changeNum = 0; + if (num < 1000000) { + return num / 100; + } else if (num >= 1000000 && num < 10000000000) { + return (num / 1000000).toFixed(2) + '万' + } else if (num > 10000000000) { + return (num / 10000000000).toFixed(2) + '亿' + } +} +//人数单位转换 +export function changePeoNumber(num) { + var changeNum = 0; + if (num < 10000) { + return num; + } else if (num >= 10000 && num < 100000000) { + return (num / 10000).toFixed(2) + '万' + } else if (num > 100000000) { + return (num / 100000000).toFixed(2) + '亿' + } +} \ No newline at end of file diff --git a/utils/http.js b/utils/http.js new file mode 100644 index 0000000..6abfaf1 --- /dev/null +++ b/utils/http.js @@ -0,0 +1,78 @@ +//let host = 'https://biformall.youlane.cn/B' +//let host = 'http://17168c59.ngrok.io/B' +let host = 'https://btest.malls.iformall.com/B' + +const postRequest = (url, token, message, postData, doSuccess, doFail) => { + let body = { ...postData }; + if (message != "") { + tt.showLoading({ + title: message, + }) + } + tt.request({ + //项目的真正接口,通过字符串拼接方式实现 + url: host + url, + header: { + "content-type": "application/json;charset=UTF-8", + "token": token + // "token": "0b272d7d-d669-401a-8d4b-a9eef9340dc1:1027:tt-cuser" + }, + data: body, + method: 'POST', + success: function (res) { + //参数值为res.data,直接将返回的数据传入 + if (message != "") { + tt.hideLoading() + }; + doSuccess(res.data); + }, + fail: function (res) { + if (message != "") { + tt.hideLoading() + }; + tt.showToast({ + title: '网络错误', + icon:"none" + }) + }, + }) +} +const getRequest = (url, token, message, getData, doSuccess, doFail) => { + let body = { ...getData }; + if (message != "") { + tt.showLoading({ + title: message, + }) + } + tt.request({ + url: host + url, + header: { + "content-type": "application/json;charset=UTF-8", + "token": token + // "token": "0b272d7d-d669-401a-8d4b-a9eef9340dc1:1027:tt-cuser" + }, + data: body, + method: 'GET', + success: function (res) { + if (message != "") { + tt.hideLoading() + }; + doSuccess(res.data); + }, + fail: function (err) { + console.log(err); + if (message != "") { + tt.hideLoading() + }; + tt.showToast({ + title: '网络错误', + icon:"none" + }) + }, + + }) +} +module.exports = { + postRequest: postRequest, + getRequest: getRequest +} \ No newline at end of file diff --git a/utils/iti.js b/utils/iti.js new file mode 100644 index 0000000..7b25455 --- /dev/null +++ b/utils/iti.js @@ -0,0 +1,87 @@ +const config = require("../config/config.js") +const Http = require("./HttpBasics.js") +function order(id) {//支付 + Http.post({//下订单 + url:config.api.order, + data:{ + couponId:this.data.id + } + }).then(res=>{ + console.log(res.data,"订单成功"); + let id = res.data.id + console.log(id); + Http.post({//拿orderInfo + url:config.api.pay, + data:{ + orderId:res.data.id + } + }).then(item=>{ + console.log(item,"orderId"); + tt.pay({ + service: 5, + orderInfo:{ + order_id:item.data.orderId, + order_token:item.data.token, + }, + success(res) { + if (res.code === 0) { + tt.showToast({ + title: '支付成功!', // 内容 + }); + + // 支付成功处理逻辑,只有res.code=0时,才表示支付成功 + // 但是最终状态要以商户后端结果为准 + }else if(res.code === 1){ + tt.showToast({ + title: '支付超时', // 内容 + icon:"none" + }); + Http.post({ + url:config.api.ifPayOk, + data:{ + code:1, + orderId:res.data.id + } + }) + }else if(res.code === 2){ + tt.showToast({ + title: '支付失败', // 内容 + icon:"none" + }); + }else if(res.code === 3){ + tt.showToast({ + title: '支付关闭', // 内容 + icon:"none" + }); + }else if(res.code === 4){ + tt.showToast({ + title: '支付取消', // 内容 + icon:"none" + }); + }else if(res.code === 9){ + tt.showToast({ + title: '订单状态开发者自行获取', // 内容 + icon:"none" + }); + } + }, + fail(res) { + // handle fail + }, + }) + }).catch(err=>{ + tt.showToast({ + title: '唤起支付失败', // 内容 + icon:"none" + }); + }) + }).catch(err=>{ + tt.showToast({ + title: err.message, // 内容 + icon:"none" + }); + }) +} +module.exports={ + order +} \ No newline at end of file diff --git a/utils/qrcode.js b/utils/qrcode.js new file mode 100644 index 0000000..e4c994e --- /dev/null +++ b/utils/qrcode.js @@ -0,0 +1,778 @@ +var QR = (function () { + + // alignment pattern + var adelta = [ + 0, 11, 15, 19, 23, 27, 31, // force 1 pat + 16, 18, 20, 22, 24, 26, 28, 20, 22, 24, 24, 26, 28, 28, 22, 24, 24, + 26, 26, 28, 28, 24, 24, 26, 26, 26, 28, 28, 24, 26, 26, 26, 28, 28 + ]; + + // version block + var vpat = [ + 0xc94, 0x5bc, 0xa99, 0x4d3, 0xbf6, 0x762, 0x847, 0x60d, + 0x928, 0xb78, 0x45d, 0xa17, 0x532, 0x9a6, 0x683, 0x8c9, + 0x7ec, 0xec4, 0x1e1, 0xfab, 0x08e, 0xc1a, 0x33f, 0xd75, + 0x250, 0x9d5, 0x6f0, 0x8ba, 0x79f, 0xb0b, 0x42e, 0xa64, + 0x541, 0xc69 + ]; + + // final format bits with mask: level << 3 | mask + var fmtword = [ + 0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976, //L + 0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0, //M + 0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed, //Q + 0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b //H + ]; + + // 4 per version: number of blocks 1,2; data width; ecc width + var eccblocks = [ + 1, 0, 19, 7, 1, 0, 16, 10, 1, 0, 13, 13, 1, 0, 9, 17, + 1, 0, 34, 10, 1, 0, 28, 16, 1, 0, 22, 22, 1, 0, 16, 28, + 1, 0, 55, 15, 1, 0, 44, 26, 2, 0, 17, 18, 2, 0, 13, 22, + 1, 0, 80, 20, 2, 0, 32, 18, 2, 0, 24, 26, 4, 0, 9, 16, + 1, 0, 108, 26, 2, 0, 43, 24, 2, 2, 15, 18, 2, 2, 11, 22, + 2, 0, 68, 18, 4, 0, 27, 16, 4, 0, 19, 24, 4, 0, 15, 28, + 2, 0, 78, 20, 4, 0, 31, 18, 2, 4, 14, 18, 4, 1, 13, 26, + 2, 0, 97, 24, 2, 2, 38, 22, 4, 2, 18, 22, 4, 2, 14, 26, + 2, 0, 116, 30, 3, 2, 36, 22, 4, 4, 16, 20, 4, 4, 12, 24, + 2, 2, 68, 18, 4, 1, 43, 26, 6, 2, 19, 24, 6, 2, 15, 28, + 4, 0, 81, 20, 1, 4, 50, 30, 4, 4, 22, 28, 3, 8, 12, 24, + 2, 2, 92, 24, 6, 2, 36, 22, 4, 6, 20, 26, 7, 4, 14, 28, + 4, 0, 107, 26, 8, 1, 37, 22, 8, 4, 20, 24, 12, 4, 11, 22, + 3, 1, 115, 30, 4, 5, 40, 24, 11, 5, 16, 20, 11, 5, 12, 24, + 5, 1, 87, 22, 5, 5, 41, 24, 5, 7, 24, 30, 11, 7, 12, 24, + 5, 1, 98, 24, 7, 3, 45, 28, 15, 2, 19, 24, 3, 13, 15, 30, + 1, 5, 107, 28, 10, 1, 46, 28, 1, 15, 22, 28, 2, 17, 14, 28, + 5, 1, 120, 30, 9, 4, 43, 26, 17, 1, 22, 28, 2, 19, 14, 28, + 3, 4, 113, 28, 3, 11, 44, 26, 17, 4, 21, 26, 9, 16, 13, 26, + 3, 5, 107, 28, 3, 13, 41, 26, 15, 5, 24, 30, 15, 10, 15, 28, + 4, 4, 116, 28, 17, 0, 42, 26, 17, 6, 22, 28, 19, 6, 16, 30, + 2, 7, 111, 28, 17, 0, 46, 28, 7, 16, 24, 30, 34, 0, 13, 24, + 4, 5, 121, 30, 4, 14, 47, 28, 11, 14, 24, 30, 16, 14, 15, 30, + 6, 4, 117, 30, 6, 14, 45, 28, 11, 16, 24, 30, 30, 2, 16, 30, + 8, 4, 106, 26, 8, 13, 47, 28, 7, 22, 24, 30, 22, 13, 15, 30, + 10, 2, 114, 28, 19, 4, 46, 28, 28, 6, 22, 28, 33, 4, 16, 30, + 8, 4, 122, 30, 22, 3, 45, 28, 8, 26, 23, 30, 12, 28, 15, 30, + 3, 10, 117, 30, 3, 23, 45, 28, 4, 31, 24, 30, 11, 31, 15, 30, + 7, 7, 116, 30, 21, 7, 45, 28, 1, 37, 23, 30, 19, 26, 15, 30, + 5, 10, 115, 30, 19, 10, 47, 28, 15, 25, 24, 30, 23, 25, 15, 30, + 13, 3, 115, 30, 2, 29, 46, 28, 42, 1, 24, 30, 23, 28, 15, 30, + 17, 0, 115, 30, 10, 23, 46, 28, 10, 35, 24, 30, 19, 35, 15, 30, + 17, 1, 115, 30, 14, 21, 46, 28, 29, 19, 24, 30, 11, 46, 15, 30, + 13, 6, 115, 30, 14, 23, 46, 28, 44, 7, 24, 30, 59, 1, 16, 30, + 12, 7, 121, 30, 12, 26, 47, 28, 39, 14, 24, 30, 22, 41, 15, 30, + 6, 14, 121, 30, 6, 34, 47, 28, 46, 10, 24, 30, 2, 64, 15, 30, + 17, 4, 122, 30, 29, 14, 46, 28, 49, 10, 24, 30, 24, 46, 15, 30, + 4, 18, 122, 30, 13, 32, 46, 28, 48, 14, 24, 30, 42, 32, 15, 30, + 20, 4, 117, 30, 40, 7, 47, 28, 43, 22, 24, 30, 10, 67, 15, 30, + 19, 6, 118, 30, 18, 31, 47, 28, 34, 34, 24, 30, 20, 61, 15, 30 + ]; + + // Galois field log table + var glog = [ + 0xff, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b, + 0x04, 0x64, 0xe0, 0x0e, 0x34, 0x8d, 0xef, 0x81, 0x1c, 0xc1, 0x69, 0xf8, 0xc8, 0x08, 0x4c, 0x71, + 0x05, 0x8a, 0x65, 0x2f, 0xe1, 0x24, 0x0f, 0x21, 0x35, 0x93, 0x8e, 0xda, 0xf0, 0x12, 0x82, 0x45, + 0x1d, 0xb5, 0xc2, 0x7d, 0x6a, 0x27, 0xf9, 0xb9, 0xc9, 0x9a, 0x09, 0x78, 0x4d, 0xe4, 0x72, 0xa6, + 0x06, 0xbf, 0x8b, 0x62, 0x66, 0xdd, 0x30, 0xfd, 0xe2, 0x98, 0x25, 0xb3, 0x10, 0x91, 0x22, 0x88, + 0x36, 0xd0, 0x94, 0xce, 0x8f, 0x96, 0xdb, 0xbd, 0xf1, 0xd2, 0x13, 0x5c, 0x83, 0x38, 0x46, 0x40, + 0x1e, 0x42, 0xb6, 0xa3, 0xc3, 0x48, 0x7e, 0x6e, 0x6b, 0x3a, 0x28, 0x54, 0xfa, 0x85, 0xba, 0x3d, + 0xca, 0x5e, 0x9b, 0x9f, 0x0a, 0x15, 0x79, 0x2b, 0x4e, 0xd4, 0xe5, 0xac, 0x73, 0xf3, 0xa7, 0x57, + 0x07, 0x70, 0xc0, 0xf7, 0x8c, 0x80, 0x63, 0x0d, 0x67, 0x4a, 0xde, 0xed, 0x31, 0xc5, 0xfe, 0x18, + 0xe3, 0xa5, 0x99, 0x77, 0x26, 0xb8, 0xb4, 0x7c, 0x11, 0x44, 0x92, 0xd9, 0x23, 0x20, 0x89, 0x2e, + 0x37, 0x3f, 0xd1, 0x5b, 0x95, 0xbc, 0xcf, 0xcd, 0x90, 0x87, 0x97, 0xb2, 0xdc, 0xfc, 0xbe, 0x61, + 0xf2, 0x56, 0xd3, 0xab, 0x14, 0x2a, 0x5d, 0x9e, 0x84, 0x3c, 0x39, 0x53, 0x47, 0x6d, 0x41, 0xa2, + 0x1f, 0x2d, 0x43, 0xd8, 0xb7, 0x7b, 0xa4, 0x76, 0xc4, 0x17, 0x49, 0xec, 0x7f, 0x0c, 0x6f, 0xf6, + 0x6c, 0xa1, 0x3b, 0x52, 0x29, 0x9d, 0x55, 0xaa, 0xfb, 0x60, 0x86, 0xb1, 0xbb, 0xcc, 0x3e, 0x5a, + 0xcb, 0x59, 0x5f, 0xb0, 0x9c, 0xa9, 0xa0, 0x51, 0x0b, 0xf5, 0x16, 0xeb, 0x7a, 0x75, 0x2c, 0xd7, + 0x4f, 0xae, 0xd5, 0xe9, 0xe6, 0xe7, 0xad, 0xe8, 0x74, 0xd6, 0xf4, 0xea, 0xa8, 0x50, 0x58, 0xaf + ]; + + // Galios field exponent table + var gexp = [ + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26, + 0x4c, 0x98, 0x2d, 0x5a, 0xb4, 0x75, 0xea, 0xc9, 0x8f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, + 0x9d, 0x27, 0x4e, 0x9c, 0x25, 0x4a, 0x94, 0x35, 0x6a, 0xd4, 0xb5, 0x77, 0xee, 0xc1, 0x9f, 0x23, + 0x46, 0x8c, 0x05, 0x0a, 0x14, 0x28, 0x50, 0xa0, 0x5d, 0xba, 0x69, 0xd2, 0xb9, 0x6f, 0xde, 0xa1, + 0x5f, 0xbe, 0x61, 0xc2, 0x99, 0x2f, 0x5e, 0xbc, 0x65, 0xca, 0x89, 0x0f, 0x1e, 0x3c, 0x78, 0xf0, + 0xfd, 0xe7, 0xd3, 0xbb, 0x6b, 0xd6, 0xb1, 0x7f, 0xfe, 0xe1, 0xdf, 0xa3, 0x5b, 0xb6, 0x71, 0xe2, + 0xd9, 0xaf, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88, 0x0d, 0x1a, 0x34, 0x68, 0xd0, 0xbd, 0x67, 0xce, + 0x81, 0x1f, 0x3e, 0x7c, 0xf8, 0xed, 0xc7, 0x93, 0x3b, 0x76, 0xec, 0xc5, 0x97, 0x33, 0x66, 0xcc, + 0x85, 0x17, 0x2e, 0x5c, 0xb8, 0x6d, 0xda, 0xa9, 0x4f, 0x9e, 0x21, 0x42, 0x84, 0x15, 0x2a, 0x54, + 0xa8, 0x4d, 0x9a, 0x29, 0x52, 0xa4, 0x55, 0xaa, 0x49, 0x92, 0x39, 0x72, 0xe4, 0xd5, 0xb7, 0x73, + 0xe6, 0xd1, 0xbf, 0x63, 0xc6, 0x91, 0x3f, 0x7e, 0xfc, 0xe5, 0xd7, 0xb3, 0x7b, 0xf6, 0xf1, 0xff, + 0xe3, 0xdb, 0xab, 0x4b, 0x96, 0x31, 0x62, 0xc4, 0x95, 0x37, 0x6e, 0xdc, 0xa5, 0x57, 0xae, 0x41, + 0x82, 0x19, 0x32, 0x64, 0xc8, 0x8d, 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6, + 0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef, 0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09, + 0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5, 0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16, + 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x00 + ]; + + // Working buffers: + // data input and ecc append, image working buffer, fixed part of image, run lengths for badness + var strinbuf=[], eccbuf=[], qrframe=[], framask=[], rlens=[]; + // Control values - width is based on version, last 4 are from table. + var version, width, neccblk1, neccblk2, datablkw, eccblkwid; + var ecclevel = 2; + // set bit to indicate cell in qrframe is immutable. symmetric around diagonal + function setmask(x, y) + { + var bt; + if (x > y) { + bt = x; + x = y; + y = bt; + } + // y*y = 1+3+5... + bt = y; + bt *= y; + bt += y; + bt >>= 1; + bt += x; + framask[bt] = 1; + } + + // enter alignment pattern - black to qrframe, white to mask (later black frame merged to mask) + function putalign(x, y) + { + var j; + + qrframe[x + width * y] = 1; + for (j = -2; j < 2; j++) { + qrframe[(x + j) + width * (y - 2)] = 1; + qrframe[(x - 2) + width * (y + j + 1)] = 1; + qrframe[(x + 2) + width * (y + j)] = 1; + qrframe[(x + j + 1) + width * (y + 2)] = 1; + } + for (j = 0; j < 2; j++) { + setmask(x - 1, y + j); + setmask(x + 1, y - j); + setmask(x - j, y - 1); + setmask(x + j, y + 1); + } + } + + //======================================================================== + // Reed Solomon error correction + // exponentiation mod N + function modnn(x) + { + while (x >= 255) { + x -= 255; + x = (x >> 8) + (x & 255); + } + return x; + } + + var genpoly = []; + + // Calculate and append ECC data to data block. Block is in strinbuf, indexes to buffers given. + function appendrs(data, dlen, ecbuf, eclen) + { + var i, j, fb; + + for (i = 0; i < eclen; i++) + strinbuf[ecbuf + i] = 0; + for (i = 0; i < dlen; i++) { + fb = glog[strinbuf[data + i] ^ strinbuf[ecbuf]]; + if (fb != 255) /* fb term is non-zero */ + for (j = 1; j < eclen; j++) + strinbuf[ecbuf + j - 1] = strinbuf[ecbuf + j] ^ gexp[modnn(fb + genpoly[eclen - j])]; + else + for( j = ecbuf ; j < ecbuf + eclen; j++ ) + strinbuf[j] = strinbuf[j + 1]; + strinbuf[ ecbuf + eclen - 1] = fb == 255 ? 0 : gexp[modnn(fb + genpoly[0])]; + } + } + + //======================================================================== + // Frame data insert following the path rules + + // check mask - since symmetrical use half. + function ismasked(x, y) + { + var bt; + if (x > y) { + bt = x; + x = y; + y = bt; + } + bt = y; + bt += y * y; + bt >>= 1; + bt += x; + return framask[bt]; + } + + //======================================================================== + // Apply the selected mask out of the 8. + function applymask(m) + { + var x, y, r3x, r3y; + + switch (m) { + case 0: + for (y = 0; y < width; y++) + for (x = 0; x < width; x++) + if (!((x + y) & 1) && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + break; + case 1: + for (y = 0; y < width; y++) + for (x = 0; x < width; x++) + if (!(y & 1) && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + break; + case 2: + for (y = 0; y < width; y++) + for (r3x = 0, x = 0; x < width; x++, r3x++) { + if (r3x == 3) + r3x = 0; + if (!r3x && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + break; + case 3: + for (r3y = 0, y = 0; y < width; y++, r3y++) { + if (r3y == 3) + r3y = 0; + for (r3x = r3y, x = 0; x < width; x++, r3x++) { + if (r3x == 3) + r3x = 0; + if (!r3x && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + } + break; + case 4: + for (y = 0; y < width; y++) + for (r3x = 0, r3y = ((y >> 1) & 1), x = 0; x < width; x++, r3x++) { + if (r3x == 3) { + r3x = 0; + r3y = !r3y; + } + if (!r3y && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + break; + case 5: + for (r3y = 0, y = 0; y < width; y++, r3y++) { + if (r3y == 3) + r3y = 0; + for (r3x = 0, x = 0; x < width; x++, r3x++) { + if (r3x == 3) + r3x = 0; + if (!((x & y & 1) + !(!r3x | !r3y)) && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + } + break; + case 6: + for (r3y = 0, y = 0; y < width; y++, r3y++) { + if (r3y == 3) + r3y = 0; + for (r3x = 0, x = 0; x < width; x++, r3x++) { + if (r3x == 3) + r3x = 0; + if (!(((x & y & 1) + (r3x && (r3x == r3y))) & 1) && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + } + break; + case 7: + for (r3y = 0, y = 0; y < width; y++, r3y++) { + if (r3y == 3) + r3y = 0; + for (r3x = 0, x = 0; x < width; x++, r3x++) { + if (r3x == 3) + r3x = 0; + if (!(((r3x && (r3x == r3y)) + ((x + y) & 1)) & 1) && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + } + break; + } + return; + } + + // Badness coefficients. + var N1 = 3, N2 = 3, N3 = 40, N4 = 10; + + // Using the table of the length of each run, calculate the amount of bad image + // - long runs or those that look like finders; called twice, once each for X and Y + function badruns(length) + { + var i; + var runsbad = 0; + for (i = 0; i <= length; i++) + if (rlens[i] >= 5) + runsbad += N1 + rlens[i] - 5; + // BwBBBwB as in finder + for (i = 3; i < length - 1; i += 2) + if (rlens[i - 2] == rlens[i + 2] + && rlens[i + 2] == rlens[i - 1] + && rlens[i - 1] == rlens[i + 1] + && rlens[i - 1] * 3 == rlens[i] + // white around the black pattern? Not part of spec + && (rlens[i - 3] == 0 // beginning + || i + 3 > length // end + || rlens[i - 3] * 3 >= rlens[i] * 4 || rlens[i + 3] * 3 >= rlens[i] * 4) + ) + runsbad += N3; + return runsbad; + } + + // Calculate how bad the masked image is - blocks, imbalance, runs, or finders. + function badcheck() + { + var x, y, h, b, b1; + var thisbad = 0; + var bw = 0; + + // blocks of same color. + for (y = 0; y < width - 1; y++) + for (x = 0; x < width - 1; x++) + if ((qrframe[x + width * y] && qrframe[(x + 1) + width * y] + && qrframe[x + width * (y + 1)] && qrframe[(x + 1) + width * (y + 1)]) // all black + || !(qrframe[x + width * y] || qrframe[(x + 1) + width * y] + || qrframe[x + width * (y + 1)] || qrframe[(x + 1) + width * (y + 1)])) // all white + thisbad += N2; + + // X runs + for (y = 0; y < width; y++) { + rlens[0] = 0; + for (h = b = x = 0; x < width; x++) { + if ((b1 = qrframe[x + width * y]) == b) + rlens[h]++; + else + rlens[++h] = 1; + b = b1; + bw += b ? 1 : -1; + } + thisbad += badruns(h); + } + + // black/white imbalance + if (bw < 0) + bw = -bw; + + var big = bw; + var count = 0; + big += big << 2; + big <<= 1; + while (big > width * width) + big -= width * width, count++; + thisbad += count * N4; + + // Y runs + for (x = 0; x < width; x++) { + rlens[0] = 0; + for (h = b = y = 0; y < width; y++) { + if ((b1 = qrframe[x + width * y]) == b) + rlens[h]++; + else + rlens[++h] = 1; + b = b1; + } + thisbad += badruns(h); + } + return thisbad; + } + + function genframe(instring) + { + var x, y, k, t, v, i, j, m; + + // find the smallest version that fits the string + t = instring.length; + version = 0; + do { + version++; + k = (ecclevel - 1) * 4 + (version - 1) * 16; + neccblk1 = eccblocks[k++]; + neccblk2 = eccblocks[k++]; + datablkw = eccblocks[k++]; + eccblkwid = eccblocks[k]; + k = datablkw * (neccblk1 + neccblk2) + neccblk2 - 3 + (version <= 9); + if (t <= k) + break; + } while (version < 40); + + // FIXME - insure that it fits insted of being truncated + width = 17 + 4 * version; + + // allocate, clear and setup data structures + v = datablkw + (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2; + for( t = 0; t < v; t++ ) + eccbuf[t] = 0; + strinbuf = instring.slice(0); + + for( t = 0; t < width * width; t++ ) + qrframe[t] = 0; + + for( t = 0 ; t < (width * (width + 1) + 1) / 2; t++) + framask[t] = 0; + + // insert finders - black to frame, white to mask + for (t = 0; t < 3; t++) { + k = 0; + y = 0; + if (t == 1) + k = (width - 7); + if (t == 2) + y = (width - 7); + qrframe[(y + 3) + width * (k + 3)] = 1; + for (x = 0; x < 6; x++) { + qrframe[(y + x) + width * k] = 1; + qrframe[y + width * (k + x + 1)] = 1; + qrframe[(y + 6) + width * (k + x)] = 1; + qrframe[(y + x + 1) + width * (k + 6)] = 1; + } + for (x = 1; x < 5; x++) { + setmask(y + x, k + 1); + setmask(y + 1, k + x + 1); + setmask(y + 5, k + x); + setmask(y + x + 1, k + 5); + } + for (x = 2; x < 4; x++) { + qrframe[(y + x) + width * (k + 2)] = 1; + qrframe[(y + 2) + width * (k + x + 1)] = 1; + qrframe[(y + 4) + width * (k + x)] = 1; + qrframe[(y + x + 1) + width * (k + 4)] = 1; + } + } + + // alignment blocks + if (version > 1) { + t = adelta[version]; + y = width - 7; + for (;;) { + x = width - 7; + while (x > t - 3) { + putalign(x, y); + if (x < t) + break; + x -= t; + } + if (y <= t + 9) + break; + y -= t; + putalign(6, y); + putalign(y, 6); + } + } + + // single black + qrframe[8 + width * (width - 8)] = 1; + + // timing gap - mask only + for (y = 0; y < 7; y++) { + setmask(7, y); + setmask(width - 8, y); + setmask(7, y + width - 7); + } + for (x = 0; x < 8; x++) { + setmask(x, 7); + setmask(x + width - 8, 7); + setmask(x, width - 8); + } + + // reserve mask-format area + for (x = 0; x < 9; x++) + setmask(x, 8); + for (x = 0; x < 8; x++) { + setmask(x + width - 8, 8); + setmask(8, x); + } + for (y = 0; y < 7; y++) + setmask(8, y + width - 7); + + // timing row/col + for (x = 0; x < width - 14; x++) + if (x & 1) { + setmask(8 + x, 6); + setmask(6, 8 + x); + } + else { + qrframe[(8 + x) + width * 6] = 1; + qrframe[6 + width * (8 + x)] = 1; + } + + // version block + if (version > 6) { + t = vpat[version - 7]; + k = 17; + for (x = 0; x < 6; x++) + for (y = 0; y < 3; y++, k--) + if (1 & (k > 11 ? version >> (k - 12) : t >> k)) { + qrframe[(5 - x) + width * (2 - y + width - 11)] = 1; + qrframe[(2 - y + width - 11) + width * (5 - x)] = 1; + } + else { + setmask(5 - x, 2 - y + width - 11); + setmask(2 - y + width - 11, 5 - x); + } + } + + // sync mask bits - only set above for white spaces, so add in black bits + for (y = 0; y < width; y++) + for (x = 0; x <= y; x++) + if (qrframe[x + width * y]) + setmask(x, y); + + // convert string to bitstream + // 8 bit data to QR-coded 8 bit data (numeric or alphanum, or kanji not supported) + v = strinbuf.length; + + // string to array + for( i = 0 ; i < v; i++ ) + eccbuf[i] = strinbuf.charCodeAt(i); + strinbuf = eccbuf.slice(0); + + // calculate max string length + x = datablkw * (neccblk1 + neccblk2) + neccblk2; + if (v >= x - 2) { + v = x - 2; + if (version > 9) + v--; + } + + // shift and repack to insert length prefix + i = v; + if (version > 9) { + strinbuf[i + 2] = 0; + strinbuf[i + 3] = 0; + while (i--) { + t = strinbuf[i]; + strinbuf[i + 3] |= 255 & (t << 4); + strinbuf[i + 2] = t >> 4; + } + strinbuf[2] |= 255 & (v << 4); + strinbuf[1] = v >> 4; + strinbuf[0] = 0x40 | (v >> 12); + } + else { + strinbuf[i + 1] = 0; + strinbuf[i + 2] = 0; + while (i--) { + t = strinbuf[i]; + strinbuf[i + 2] |= 255 & (t << 4); + strinbuf[i + 1] = t >> 4; + } + strinbuf[1] |= 255 & (v << 4); + strinbuf[0] = 0x40 | (v >> 4); + } + // fill to end with pad pattern + i = v + 3 - (version < 10); + while (i < x) { + strinbuf[i++] = 0xec; + // buffer has room if (i == x) break; + strinbuf[i++] = 0x11; + } + + // calculate and append ECC + + // calculate generator polynomial + genpoly[0] = 1; + for (i = 0; i < eccblkwid; i++) { + genpoly[i + 1] = 1; + for (j = i; j > 0; j--) + genpoly[j] = genpoly[j] + ? genpoly[j - 1] ^ gexp[modnn(glog[genpoly[j]] + i)] : genpoly[j - 1]; + genpoly[0] = gexp[modnn(glog[genpoly[0]] + i)]; + } + for (i = 0; i <= eccblkwid; i++) + genpoly[i] = glog[genpoly[i]]; // use logs for genpoly[] to save calc step + + // append ecc to data buffer + k = x; + y = 0; + for (i = 0; i < neccblk1; i++) { + appendrs(y, datablkw, k, eccblkwid); + y += datablkw; + k += eccblkwid; + } + for (i = 0; i < neccblk2; i++) { + appendrs(y, datablkw + 1, k, eccblkwid); + y += datablkw + 1; + k += eccblkwid; + } + // interleave blocks + y = 0; + for (i = 0; i < datablkw; i++) { + for (j = 0; j < neccblk1; j++) + eccbuf[y++] = strinbuf[i + j * datablkw]; + for (j = 0; j < neccblk2; j++) + eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))]; + } + for (j = 0; j < neccblk2; j++) + eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))]; + for (i = 0; i < eccblkwid; i++) + for (j = 0; j < neccblk1 + neccblk2; j++) + eccbuf[y++] = strinbuf[x + i + j * eccblkwid]; + strinbuf = eccbuf; + + // pack bits into frame avoiding masked area. + x = y = width - 1; + k = v = 1; // up, minus + /* inteleaved data and ecc codes */ + m = (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2; + for (i = 0; i < m; i++) { + t = strinbuf[i]; + for (j = 0; j < 8; j++, t <<= 1) { + if (0x80 & t) + qrframe[x + width * y] = 1; + do { // find next fill position + if (v) + x--; + else { + x++; + if (k) { + if (y != 0) + y--; + else { + x -= 2; + k = !k; + if (x == 6) { + x--; + y = 9; + } + } + } + else { + if (y != width - 1) + y++; + else { + x -= 2; + k = !k; + if (x == 6) { + x--; + y -= 8; + } + } + } + } + v = !v; + } while (ismasked(x, y)); + } + } + + // save pre-mask copy of frame + strinbuf = qrframe.slice(0); + t = 0; // best + y = 30000; // demerit + // for instead of while since in original arduino code + // if an early mask was "good enough" it wouldn't try for a better one + // since they get more complex and take longer. + for (k = 0; k < 8; k++) { + applymask(k); // returns black-white imbalance + x = badcheck(); + if (x < y) { // current mask better than previous best? + y = x; + t = k; + } + if (t == 7) + break; // don't increment i to a void redoing mask + qrframe = strinbuf.slice(0); // reset for next pass + } + if (t != k) // redo best mask - none good enough, last wasn't t + applymask(t); + + // add in final mask/ecclevel bytes + y = fmtword[t + ((ecclevel - 1) << 3)]; + // low byte + for (k = 0; k < 8; k++, y >>= 1) + if (y & 1) { + qrframe[(width - 1 - k) + width * 8] = 1; + if (k < 6) + qrframe[8 + width * k] = 1; + else + qrframe[8 + width * (k + 1)] = 1; + } + // high byte + for (k = 0; k < 7; k++, y >>= 1) + if (y & 1) { + qrframe[8 + width * (width - 7 + k)] = 1; + if (k) + qrframe[(6 - k) + width * 8] = 1; + else + qrframe[7 + width * 8] = 1; + } + + // return image + return qrframe; + } + + var _canvas = null, + _size = null; + + var api = { + + get ecclevel () { + return ecclevel; + }, + + set ecclevel (val) { + ecclevel = val; + }, + + get size () { + return _size; + }, + + set size (val) { + _size = val + }, + + get canvas () { + return _canvas; + }, + + set canvas (el) { + _canvas = el; + }, + + getFrame: function (string) { + return genframe(string); + }, + + draw: function (string, canvas, size, ecc) { + + ecclevel = ecc || ecclevel; + canvas = canvas || _canvas; + + if (!canvas) { + console.warn('No canvas provided to draw QR code in!') + return; + } + + size = size || _size || Math.min(canvas.width, canvas.height); + + var frame = genframe(string), + ctx = canvas.ctx, + px = Math.round(size / (width + 8)); + + var roundedSize = px * (width + 8), + offset = Math.floor((size - roundedSize) / 2); + + size = roundedSize; + + ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.setFillStyle('#000000'); + + for (var i = 0; i < width; i++) { + for (var j = 0; j < width; j++) { + if (frame[j * width + i]) { + ctx.fillRect(px * (4 + i) + offset, px * (4 + j) + offset, px, px); + } + } + } + ctx.draw(); + } + } + + module.exports = { + api: api + } + +})() \ No newline at end of file diff --git a/utils/util.js b/utils/util.js new file mode 100644 index 0000000..62980e9 --- /dev/null +++ b/utils/util.js @@ -0,0 +1,207 @@ +var barcode = require("./barcode"); +var qrcode = require("./qrcode"); + +const extConfig = tt.getExtConfigSync ? tt.getExtConfigSync() : {} + + +function convertUTCTimeToLocalTime(UTCDateString) { + if (!UTCDateString) { + return '-'; + } + function formatFunc(str) { //格式化显示 + return str > 9 ? str : '0' + str + } + var date2 = new Date(UTCDateString); //这步是关键 + var year = date2.getFullYear(); + var mon = formatFunc(date2.getMonth() + 1); + var day = formatFunc(date2.getDate()); + var hour = date2.getHours(); + var noon = hour >= 12 ? 'PM' : 'AM'; + hour = hour >= 24 ? hour - 24 : hour; + hour = formatFunc(hour); + var min = formatFunc(date2.getMinutes()); + var dateStr = ' ' + hour + ':' + min ; + return dateStr; +} + +// function fmtDate(date) { +// var dateee = new Date(date).toJSON(); +// return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); +// } + +function moodsText(Num){//人气值处理 Num人气值 返回字符串 处理到万位 + let sing = "" + if(Num>10000){ + sing = (Num/10000).toFixed(2)+"w" + + }else{ + sing =Num + } + return sing +} + +const formatTime = (date, fmt) => { + try { + if (!date) { + return date; + } + if (typeof date === 'string' && date.length === 13) { + date = Number(date); + } + if (typeof date == "number") { + date = new Date(date); + } + var o = { + "M+": date.getMonth() + 1, //月份 + "d+": date.getDate(), //日 + "h+": date.getHours(), //小时 + "m+": date.getMinutes(), //分 + "s+": date.getSeconds(), //秒 + "q+": Math.floor((date.getMonth() + 3) / 3), //季度 + S: date.getMilliseconds() //毫秒 + }; + if (/(y+)/.test(fmt)) + fmt = fmt.replace( + RegExp.$1, + (date.getFullYear() + "").substr(4 - RegExp.$1.length) + ); + for (var k in o) + if (new RegExp("(" + k + ")").test(fmt)) + fmt = fmt.replace( + RegExp.$1, + RegExp.$1.length == 1 + ? o[k] + : ("00" + o[k]).substr(("" + o[k]).length) + ); + return fmt; + } catch (error) { + return date; + } +}; + +const formatNumber = n => { + n = n.toString(); + return n[1] ? n : "0" + n; +}; + +function convert_length(length) { + return Math.round((tt.getSystemInfoSync().windowWidth * length) / 750); +} + +function barc(id, code, width, height) { + barcode.code128( + tt.createCanvasContext(id), + code, + convert_length(width), + convert_length(height) + ); +} + +function qrc(id, code, width, height) { + qrcode.api.draw(code, { + ctx: tt.createCanvasContext(id), + width: convert_length(width), + height: convert_length(height) + }); +} +// function fmtDate(obj) { +// if (typeof obj === 'string' && obj.length === 13) { +// obj = Number(obj); +// } +// var date = new Date(obj); +// var y = 1900 + date.getYear(); +// var m = "0" + (date.getMonth() + 1); +// var d = "0" + date.getDate(); +// return ( +// y + +// "-" + +// m.substring(m.length - 2, m.length) + +// "-" + +// d.substring(d.length - 2, d.length) +// ); +// } + +//计算下单的时间与现在的时间的 +function timechuo(startTime) { + var s1 = new Date(startTime.replace(/-/g, "/")); + var s2 = new Date(); + var runTime = parseInt((s1.getTime() - s2.getTime()) / 1000); + var year = Math.floor(runTime / 86400 / 365); + var runTime = runTime % (86400 * 365); + var month = Math.floor(runTime / 86400 / 30); + var runTime = runTime % (86400 * 30); + var day = Math.floor(runTime / 86400); + var runTime = runTime % 86400; + var hour = Math.floor(runTime / 3600); + var runTime = runTime % 3600; + var minute = Math.floor(runTime / 60); + var runTime = runTime % 60; + var second = runTime; + if (day && !year && !month){ + return (day + '天' + hour + "小时" + minute + "分钟") + } else if (month && !year){ + return ((month*30+day) +'天' + hour + "小时" + minute + "分钟") + } else if (year) { + return ((year*365 + month*30+ day) + '天' + hour + "小时" + minute + "分钟") + }else{ + return (hour + "小时" + minute + "分钟") + } +} + + +//计算时间差 +function timecha(endTime,startTime) { + var s1 = new Date(endTime.replace(/-/g, "/")); + var s2 = new Date(startTime.replace(/-/g, "/")); + var runTime = parseInt((s1.getTime() - s2.getTime()) / 1000); + var year = Math.floor(runTime / 86400 / 365); + var runTime = runTime % (86400 * 365); + var month = Math.floor(runTime / 86400 / 30); + var runTime = runTime % (86400 * 30); + var day = Math.floor(runTime / 86400); + var runTime = runTime % 86400; + var hour = Math.floor(runTime / 3600); + var runTime = runTime % 3600; + var minute = Math.floor(runTime / 60); + var runTime = runTime % 60; + var second = runTime; + return (month+"月"+day+"天"+hour+"小时"+minute+"分钟") +} +function isJSON(str) { + if (typeof str == 'string') { + console.log("string") + try { + var obj = JSON.parse(str); + if (typeof obj == 'object' && obj) { + return true; + } else { + return false; + } + } catch (e) { + console.log(e); + tt.showToast({ + title: '请扫描正确的二维码', + icon: 'none', + duration: 1300 + }) + } + } else { + tt.showToast({ + title: '请扫描正确的二维码', + icon: 'none', + duration: 1300 + }) + } +} + +module.exports = { + formatTime: formatTime, + barcode: barc, + qrcode: qrc, + isJSON: isJSON, + // fmtDate: fmtDate, + timechuo: timechuo, + timecha: timecha, + moodsText:moodsText, + convertUTCTimeToLocalTime: convertUTCTimeToLocalTime +};