Commit 996fe370 by 姜雷

Merge branch 'develop' into test

parents 2c6eebb1 876a0654
......@@ -62,29 +62,35 @@ function findMaxIndex(list, key) {
}
Component({
lifetimes: {
attached() {
const query = wx.createSelectorQuery().in(this);
query
.select('#PlatformFeeChart')
.boundingClientRect(res => {
// res.top; // 这个组件内 #the-id 节点的上边界坐标
console.log(res);
this.setData({
x: res.left,
y: res.top,
});
})
.exec();
},
},
// lifetimes: {
// attached() {
// const query = wx.createSelectorQuery().in(this);
// query
// .select('#PlatformFeeChart')
// .boundingClientRect(res => {
// // res.top; // 这个组件内 #the-id 节点的上边界坐标
// console.log(res);
// this.setData({
// x: res.left,
// y: res.top,
// });
// })
// .exec();
// },
// },
properties: {
dataList: {
type: Array,
value: [],
observer(newVal) {
platforFeeChart && platforFeeChart.changeData(newVal);
if (platforFeeChart) {
platforFeeChart.changeData(newVal);
} else {
setTimeout(() => {
platforFeeChart.changeData(newVal);
}, 1000);
}
if (platforFeeChart) {
let index = findMaxIndex(newVal, 'totalMoney');
if (index !== -1) {
......@@ -107,14 +113,18 @@ Component({
opts: {
onInit: initChart,
},
x: 0,
y: 0,
},
methods: {
clickHandle(e) {
console.log(e.detail);
let x = e.detail.x - this.data.x;
let y = e.detail.y - this.data.y;
console.log(e);
const { touches } = e.detail;
let x = 0;
let y = 0;
if (touches && touches.length) {
x = touches[0].x;
y = touches[0].y;
}
const objArr = platforFeeChart.getSnapRecords({ x, y });
if (objArr.length) this.triggerEvent('selectedData', objArr[0]._origin);
},
......
<!-- pages/components/PlatformFeeChart/PlatformFeeChart.wxml -->
<ff-canvas id="PlatformFeeChart" canvas-id="PlatformFeeChart" opts="{{ opts }}" bind:tap="clickHandle" />
\ No newline at end of file
<ff-canvas id="PlatformFeeChart" canvas-id="PlatformFeeChart" opts="{{ opts }}" bindcanvastouch="clickHandle" />
\ No newline at end of file
/* pages/components/PlatformFeeChart/PlatformFeeChart.wxss */
\ No newline at end of file
/* pages/components/PlatformFeeChart/PlatformFeeChart.wxss */
.PlatformFeeChart {
width: 660rpx;
height: 350rpx;
}
......@@ -3,6 +3,7 @@ import { IMyApp } from '../../../app';
const app = getApp<IMyApp>();
let timer = null;
let payTimer = null;
let fetchedPlatform = false;
// pages/components/PlatformFeeDialog/PlatformFeeDialog.js
Component({
......@@ -177,6 +178,8 @@ Component({
});
if (this.data.type === 2) {
this.fetchRechargeOrderQRcode();
} else {
payTimer && clearInterval(payTimer);
}
},
fetchRechargeOrderQRcode() {
......@@ -210,7 +213,7 @@ Component({
})
.then(res => {
wx.hideLoading();
const { payQrUrl } = res;
const { payQrUrl, orderNum } = res;
this.setData({
payQrUrl,
});
......@@ -233,6 +236,30 @@ Component({
});
}
}, 1000);
payTimer = setInterval(() => {
console.log('in setInterval');
operatorFetch({
url: '/operateBalance/rechage/sure',
method: 'POST',
data: { orderNum: orderNum },
})
.then(res => {
const { rechargeState } = res;
if (rechargeState === '1') {
wx.showToast({
title: res.msg || '',
icon: 'success',
});
clearInterval(payTimer);
this.setData({
showDialog: false,
});
}
})
.catch(err => {
console.log(err);
});
}, 3000);
})
.catch(err => {
wx.hideLoading();
......
......@@ -12,6 +12,7 @@
<view class="platformFee-title-text">共计{{areaCount}}个校区</view>
</view>
<view class="platformFee-canvas">
<!-- <canvas class="platformFee-canvas" canvas-id="platformFee-canvas" bindtouchstart="selectedData" /> -->
<platform-fee-chart dataList="{{dataList}}" bind:selectedData="selectedData" />
</view>
</view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment