Commit 8c6da1a4 by 姜雷

提交页面

parent f4a8de1b
......@@ -27,8 +27,23 @@ var fetch = function (req) {
}).then(function (res) {
var _a = res.data, code = _a.code, otherkeys = __rest(_a, ["code"]);
if (code === constants_1.successCode) {
console.log(res);
if (res.header['Set-Cookie'])
return {
header: res.header,
data: otherkeys,
};
return otherkeys;
}
else if (code === constants_1.logoutode) {
app.resetUserinfo();
wx.reLaunch({
url: '/pages/index/index',
});
throw {
errMsg: res.data.msg || '网络异常',
};
}
else {
throw {
errMsg: res.data.msg || '网络异常',
......@@ -42,5 +57,11 @@ exports.systemFetch = function (req) {
exports.statisticsFetch = function (req) {
return fetch(__assign({}, req, { url: constants_1.devUrl.STATISTICS_SERVER_URL + req.url }));
};
exports.customerFetch = function (req) {
return fetch(__assign({}, req, { url: constants_1.devUrl.CUSTOMER_SERVER_URL + req.url }));
};
exports.baseFetch = function (req) {
return fetch(__assign({}, req, { url: constants_1.devUrl.BASE_SERVER_URL + req.url }));
};
exports.default = fetch;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmV0Y2guanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJmZXRjaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsaURBQTBEO0FBRTFELElBQU0sR0FBRyxHQUFHLE1BQU0sRUFBVSxDQUFDO0FBRTdCLElBQU0sS0FBSyxHQUFHLFVBQUMsR0FBcUI7SUFDbEMsT0FBQSxJQUFJLE9BQU8sQ0FBQyxVQUFDLE9BQU8sRUFBRSxNQUFNO1FBQzFCLElBQU0sS0FBSyxHQUFHLEdBQUcsQ0FBQyxVQUFVLENBQUMsS0FBSyxDQUFDO1FBQ25DLEVBQUUsQ0FBQyxPQUFPLGNBQ0wsR0FBRyxJQUNOLE1BQU0sRUFBRSxLQUFLO2dCQUNYLENBQUMsWUFDRyxLQUFLLE9BQUEsSUFDRix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tZXJGZXRjaCA9IChyZXE6IHd4LlJlcXVlc3RPcHRpb24pID0+XG4gIGZldGNoKHsgLi4ucmVxLCB1cmw6IGRldlVybC5DVVNUT01FUl9TRVJWRVJfVVJMICsgcmVxLnVybCB9KTtcbmV4cG9ydCBjb25zdCBiYXNlRmV0Y2ggPSAocmVxOiB3eC5SZXF1ZXN0T3B0aW9uKSA9PlxuICBmZXRjaCh7IC4uLnJlcSwgdXJsOiBkZXZVcmwuQkFTRV9TRVJWRVJfVVJMICsgcmVxLnVybCB9KTtcbmV4cG9ydCBkZWZhdWx0IGZldGNoO1xuIl19
\ No newline at end of file
import { devUrl, successCode } from '../config/constants';
import { devUrl, successCode, logoutode } from '../config/constants';
import { IMyApp } from '../app';
const app = getApp<IMyApp>();
......@@ -20,7 +20,21 @@ const fetch = (req: wx.RequestOption) =>
}).then((res: wx.RequestSuccessCallbackResult) => {
const { code, ...otherkeys } = res.data;
if (code === successCode) {
console.log(res);
if (res.header['Set-Cookie'])
return {
header: res.header,
data: otherkeys,
};
return otherkeys;
} else if (code === logoutode) {
app.resetUserinfo();
wx.reLaunch({
url: '/pages/index/index',
});
throw {
errMsg: res.data.msg || '网络异常',
};
} else {
throw {
errMsg: res.data.msg || '网络异常',
......@@ -32,5 +46,8 @@ export const systemFetch = (req: wx.RequestOption) =>
fetch({ ...req, url: devUrl.SYSTEM_SERVER_URL + req.url });
export const statisticsFetch = (req: wx.RequestOption) =>
fetch({ ...req, url: devUrl.STATISTICS_SERVER_URL + req.url });
export const customerFetch = (req: wx.RequestOption) =>
fetch({ ...req, url: devUrl.CUSTOMER_SERVER_URL + req.url });
export const baseFetch = (req: wx.RequestOption) =>
fetch({ ...req, url: devUrl.BASE_SERVER_URL + req.url });
export default fetch;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var initUserinfo = function () { return ({
cellphone: '',
comment: '',
createAt: '',
id: 0,
isOpenOperLog: 0,
isSetPassword: 0,
lastLoginDate: '',
loginAccount: '',
loginCount: 0,
name: '',
operateId: 0,
operateName: '',
state: '',
updateAt: '',
}); };
App({
onLaunch: function () {
console.log('in onLaunch');
try {
var token = wx.getStorageSync('token');
if (token) {
this.globalData.token = token;
}
}
catch (error) { }
},
globalData: {
token: 'system:login:token:a1d0c6e83f027327d8461063f4ac58a61572317597980',
userInfo: initUserinfo(),
token: '',
userRoles: [],
},
getToken: function () {
return this.globalData.token;
},
resetUserinfo: function () {
this.globalData.token = '';
this.globalData.userInfo = initUserinfo();
this.globalData.userRoles = [];
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYXBwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBU0EsR0FBRyxDQUFTO0lBSVYsVUFBVSxFQUFFO1FBQ1YsS0FBSyxFQUFFLGtFQUFrRTtLQUMxRTtDQUNGLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8vYXBwLnRzXG5leHBvcnQgaW50ZXJmYWNlIElNeUFwcCB7XG4gIHVzZXJJbmZvUmVhZHlDYWxsYmFjaz8ocmVzOiB3eC5Vc2VySW5mbyk6IHZvaWQ7XG4gIGdsb2JhbERhdGE6IHtcbiAgICB1c2VySW5mbz86IHd4LlVzZXJJbmZvO1xuICAgIHRva2VuOiBzdHJpbmc7XG4gIH07XG59XG5cbkFwcDxJTXlBcHA+KHtcbiAgLy8gb25MYXVuY2goKSB7XG4gIC8vICAgY29uc29sZS5sb2coJ2luIG9uTGF1bmNoJyk7XG4gIC8vIH0sXG4gIGdsb2JhbERhdGE6IHtcbiAgICB0b2tlbjogJ3N5c3RlbTpsb2dpbjp0b2tlbjphMWQwYzZlODNmMDI3MzI3ZDg0NjEwNjNmNGFjNThhNjE1NzIzMTc1OTc5ODAnLFxuICB9LFxufSk7XG4iXX0=
\ No newline at end of file
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uI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VwZGF0ZUF0OiAnJyxcbn0pO1xuQXBwPElNeUFwcD4oe1xuICBvbkxhdW5jaCgpIHtcbiAgICBjb25zb2xlLmxvZygnaW4gb25MYXVuY2gnKTtcbiAgICB0cnkge1xuICAgICAgbGV0IHRva2VuID0gd3guZ2V0U3RvcmFnZVN5bmMoJ3Rva2VuJyk7XG4gICAgICBpZiAodG9rZW4pIHtcbiAgICAgICAgdGhpcy5nbG9iYWxEYXRhLnRva2VuID0gdG9rZW47XG4gICAgICB9XG4gICAgfSBjYXRjaCAoZXJyb3IpIHt9XG4gIH0sXG4gIGdsb2JhbERhdGE6IHtcbiAgICB1c2VySW5mbzogaW5pdFVzZXJpbmZvKCksXG4gICAgdG9rZW46ICcnLFxuICAgIHVzZXJSb2xlczogW10sXG4gIH0sXG4gIGdldFRva2VuKCkge1xuICAgIHJldHVybiB0aGlzLmdsb2JhbERhdGEudG9rZW47XG4gIH0sXG4gIHJlc2V0VXNlcmluZm8oKSB7XG4gICAgdGhpcy5nbG9iYWxEYXRhLnRva2VuID0gJyc7XG4gICAgdGhpcy5nbG9iYWxEYXRhLnVzZXJJbmZvID0gaW5pdFVzZXJpbmZvKCk7XG4gICAgdGhpcy5nbG9iYWxEYXRhLnVzZXJSb2xlcyA9IFtdO1xuICB9LFxufSk7XG4iXX0=
\ No newline at end of file
......@@ -5,7 +5,8 @@
"pages/report/report",
"pages/feedback/feedback",
"pages/monthOperator/monthOperator",
"pages/homeAndReport/homeAndReport"
"pages/homeAndReport/homeAndReport",
"pages/userGrowth/userGrowth"
],
"window": {
"backgroundTextStyle": "light",
......
import { Userinfo, UserRole } from './store/user';
//app.ts
export interface IMyApp {
userInfoReadyCallback?(res: wx.UserInfo): void;
resetUserinfo: () => void;
getToken: () => string;
globalData: {
userInfo?: wx.UserInfo;
userInfo: Userinfo;
token: string;
userRoles: UserRole[];
};
}
const initUserinfo = () => ({
cellphone: '',
comment: '',
createAt: '',
id: 0,
isOpenOperLog: 0,
isSetPassword: 0,
lastLoginDate: '',
loginAccount: '',
loginCount: 0,
name: '',
operateId: 0,
operateName: '',
state: '',
updateAt: '',
});
App<IMyApp>({
// onLaunch() {
// console.log('in onLaunch');
// },
onLaunch() {
console.log('in onLaunch');
try {
let token = wx.getStorageSync('token');
if (token) {
this.globalData.token = token;
}
} catch (error) {}
},
globalData: {
token: 'system:login:token:a1d0c6e83f027327d8461063f4ac58a61572317597980',
userInfo: initUserinfo(),
token: '',
userRoles: [],
},
getToken() {
return this.globalData.token;
},
resetUserinfo() {
this.globalData.token = '';
this.globalData.userInfo = initUserinfo();
this.globalData.userRoles = [];
},
});
......@@ -9,7 +9,7 @@
box-sizing: border-box;
}
input, .input {
input {
border: 1rpx solid #f8f8f8;
background-color: #f8f8f8;
padding: 0 40rpx;
......@@ -23,7 +23,8 @@ input, .input {
color: #a9a9ad;
}
input:hover, input:focus {
input:hover,
input:focus {
border-color: #6895fe;
}
......
......@@ -3,14 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.devUrl = {
SYSTEM_SERVER_URL: 'http://ex-dev-dcxy-system-manage.168cad.top',
STATISTICS_SERVER_URL: 'http://ex-dev-dcxy-statistics-manage.168cad.top',
CUSTOMER_SERVER_URL: 'http://ex-dev-customer-manage.168cad.top',
BASE_SERVER_URL: 'http://ex-dev-dcxy-base-manage.168cad.top',
};
exports.testUrl = {
SYSTEM_SERVER_URL: 'http://ex-dev-dcxy-system-manage.168cad.top',
STATISTICS_SERVER_URL: 'http://ex-dev-dcxy-statistics-manage.168cad.top',
CUSTOMER_SERVER_URL: 'http://ex-dev-customer-manage.168cad.top',
BASE_SERVER_URL: 'http://ex-dev-dcxy-base-manage.168cad.top',
};
exports.masterUrl = {
SYSTEM_SERVER_URL: 'http://ex-dev-dcxy-system-manage.168cad.top',
STATISTICS_SERVER_URL: 'http://ex-dev-dcxy-statistics-manage.168cad.top',
CUSTOMER_SERVER_URL: 'http://ex-dev-customer-manage.168cad.top',
BASE_SERVER_URL: 'http://ex-dev-dcx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lzdGljcy1tYW5hZ2UuMTY4Y2FkLnRvcCcsXG4gIENVU1RPTUVSX1NFUlZFUl9VUkw6ICdodHRwOi8vZXgtZGV2LWN1c3RvbWVyLW1hbmFnZS4xNjhjYWQudG9wJyxcbiAgQkFTRV9TRVJWRVJfVVJMOiAnaHR0cDovL2V4LWRldi1kY3h5LWJhc2UtbWFuYWdlLjE2OGNhZC50b3AnLFxufTtcblxuZXhwb3J0IGNvbnN0IHN1Y2Nlc3NDb2RlID0gMTAwMDtcbmV4cG9ydCBjb25zdCBsb2dvdXRvZGUgPSAtMjtcbiJdfQ==
\ No newline at end of file
export const devUrl = {
SYSTEM_SERVER_URL: 'http://ex-dev-dcxy-system-manage.168cad.top',
STATISTICS_SERVER_URL: 'http://ex-dev-dcxy-statistics-manage.168cad.top',
CUSTOMER_SERVER_URL: 'http://ex-dev-customer-manage.168cad.top',
BASE_SERVER_URL: 'http://ex-dev-dcxy-base-manage.168cad.top',
};
export const testUrl = {
SYSTEM_SERVER_URL: 'http://ex-dev-dcxy-system-manage.168cad.top',
STATISTICS_SERVER_URL: 'http://ex-dev-dcxy-statistics-manage.168cad.top',
CUSTOMER_SERVER_URL: 'http://ex-dev-customer-manage.168cad.top',
BASE_SERVER_URL: 'http://ex-dev-dcxy-base-manage.168cad.top',
};
export const masterUrl = {
SYSTEM_SERVER_URL: 'http://ex-dev-dcxy-system-manage.168cad.top',
STATISTICS_SERVER_URL: 'http://ex-dev-dcxy-statistics-manage.168cad.top',
CUSTOMER_SERVER_URL: 'http://ex-dev-customer-manage.168cad.top',
BASE_SERVER_URL: 'http://ex-dev-dcxy-base-manage.168cad.top',
};
export const successCode = 1000;
export const logoutode = -2;
"use strict";
var consumeChart = null;
var month = '';
function initChart(canvas, width, height, F2) {
var data = [];
consumeChart = new F2.Chart({
el: canvas,
width: width,
height: height,
});
consumeChart.source(data, {
days: {
min: 1,
max: 31,
},
});
consumeChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#6edb8f',
padding: [6, 10],
},
onShow: function (ev) {
var items = ev.items;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '元';
},
});
consumeChart
.line()
.position('days*payableMoney')
.color('#6edb8f')
.shape('smooth')
.size(4);
consumeChart
.area()
.position('days*payableMoney')
.color('l(90) 0:#6edb8f 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
consumeChart.axis('payableMoney', false);
consumeChart.render();
return consumeChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer: function (newVal) {
consumeChart && consumeChart.changeData(newVal);
},
},
month: {
type: String,
value: '',
observer: function (newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29uc3VtZUNoYXJ0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiQ29uc3VtZUNoYXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFJLFlBQVksR0FBRyxJQUFJLENBQUM7QUFDeEIsSUFBSSxLQUFLLEdBQUcsRUFBRSxDQUFDO0FBRWYsbUJBQW1CLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLEVBQUU7SUFDMUMsSUFBTSxJQUFJLEdBQUcsRUFBRSxDQUFDO0lBQ2hCLFlBQVksR0FBRyxJQUFJLEVBQUUsQ0FBQyxLQUFLLENBQUM7UUFDMUIsRUFBRSxFQUFFLE1BQU07UUFDVixLQUFLLE9BQUE7UUFDTCxNQUFNLFFBQUE7S0FDUCxDQUFDLENBQUM7SUFFSCxZQUFZLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRTtRQUN4QixJQUFJLEVBQUU7WUFDSixHQUFHLEVBQUUsQ0FBQztZQUNOLEdBQUcsRUFBRSxFQUFFO1NBQ1I7S0FDRixDQUFDLENBQUM7SUFDSCxZQUFZLENBQUMsT0FBTyx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ICB2YWx1ZTogW10sXG4gICAgICBvYnNlcnZlcihuZXdWYWwpIHtcbiAgICAgICAgY29uc3VtZUNoYXJ0ICYmIGNvbnN1bWVDaGFydC5jaGFuZ2VEYXRhKG5ld1ZhbCk7XG4gICAgICB9LFxuICAgIH0sXG4gICAgbW9udGg6IHtcbiAgICAgIHR5cGU6IFN0cmluZyxcbiAgICAgIHZhbHVlOiAnJyxcbiAgICAgIG9ic2VydmVyKG5ld1ZhbCkge1xuICAgICAgICBtb250aCA9IG5ld1ZhbDtcbiAgICAgIH0sXG4gICAgfSxcbiAgfSxcbiAgZGF0YToge1xuICAgIG9wdHM6IHtcbiAgICAgIG9uSW5pdDogaW5pdENoYXJ0LFxuICAgIH0sXG4gIH0sXG59KTtcbiJdfQ==
\ No newline at end of file
{
"component": true,
"usingComponents": {
"ff-canvas": "@antv/f2-canvas"
}
}
\ No newline at end of file
let consumeChart = null;
let month = '';
function initChart(canvas, width, height, F2) {
const data = [];
consumeChart = new F2.Chart({
el: canvas,
width,
height,
});
consumeChart.source(data, {
days: {
min: 1,
max: 31,
},
});
consumeChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#6edb8f',
padding: [6, 10],
},
onShow(ev) {
const { items } = ev;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '元';
},
});
consumeChart
.line()
.position('days*payableMoney')
.color('#6edb8f')
.shape('smooth')
.size(4);
consumeChart
.area()
.position('days*payableMoney')
.color('l(90) 0:#6edb8f 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
consumeChart.axis('payableMoney', false);
consumeChart.render();
return consumeChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer(newVal) {
consumeChart && consumeChart.changeData(newVal);
},
},
month: {
type: String,
value: '',
observer(newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
<!--pages/components/ConsumeChart/ConsumeChart.wxml-->
<ff-canvas id="ConsumeChart" canvas-id="ConsumeChart" opts="{{ opts }}" />
/* pages/components/ConsumeChart/ConsumeChart.wxss */
\ No newline at end of file
"use strict";
var consumeCountChart = null;
var month = '';
function initChart(canvas, width, height, F2) {
var data = [];
consumeCountChart = new F2.Chart({
el: canvas,
width: width,
height: height,
});
consumeCountChart.source(data, {
days: {
min: 1,
max: 31,
},
});
consumeCountChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#68d0fe',
padding: [6, 10],
},
onShow: function (ev) {
var items = ev.items;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '笔';
},
});
consumeCountChart
.line()
.position('days*payMen')
.color('#68d0fe')
.shape('smooth')
.size(4);
consumeCountChart
.area()
.position('days*payMen')
.color('l(90) 0:#68d0fe 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
consumeCountChart.axis('payMen', false);
consumeCountChart.render();
return consumeCountChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer: function (newVal) {
consumeCountChart && consumeCountChart.changeData(newVal);
},
},
month: {
type: String,
value: '',
observer: function (newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29uc3VtZUNvdW50Q2hhcnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJDb25zdW1lQ291bnRDaGFydC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsSUFBSSxpQkFBaUIsR0FBRyxJQUFJLENBQUM7QUFDN0IsSUFBSSxLQUFLLEdBQUcsRUFBRSxDQUFDO0FBRWYsbUJBQW1CLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLEVBQUU7SUFDMUMsSUFBTSxJQUFJLEdBQUcsRUFBRSxDQUFDO0lBQ2hCLGlCQUFpQixHQUFHLElBQUksRUFBRSxDQUFDLEtBQUssQ0FBQztRQUMvQixFQ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VuJylcbiAgICAuY29sb3IoJ2woOTApIDA6IzY4ZDBmZSAxOiNmZmYnKVxuICAgIC5zaGFwZSgnc21vb3RoJylcbiAgICAuc3R5bGUoe1xuICAgICAgZmlsbE9wYWNpdHk6IDAuNixcbiAgICB9KTtcbiAgY29uc3VtZUNvdW50Q2hhcnQuYXhpcygncGF5TWVuJywgZmFsc2UpO1xuICBjb25zdW1lQ291bnRDaGFydC5yZW5kZXIoKTtcbiAgcmV0dXJuIGNvbnN1bWVDb3VudENoYXJ0O1xufVxuXG5Db21wb25lbnQoe1xuICBwcm9wZXJ0aWVzOiB7XG4gICAgZGF0YUxpc3Q6IHtcbiAgICAgIHR5cGU6IEFycmF5LFxuICAgICAgdmFsdWU6IFtdLFxuICAgICAgb2JzZXJ2ZXIobmV3VmFsKSB7XG4gICAgICAgIGNvbnN1bWVDb3VudENoYXJ0ICYmIGNvbnN1bWVDb3VudENoYXJ0LmNoYW5nZURhdGEobmV3VmFsKTtcbiAgICAgIH0sXG4gICAgfSxcbiAgICBtb250aDoge1xuICAgICAgdHlwZTogU3RyaW5nLFxuICAgICAgdmFsdWU6ICcnLFxuICAgICAgb2JzZXJ2ZXIobmV3VmFsKSB7XG4gICAgICAgIG1vbnRoID0gbmV3VmFsO1xuICAgICAgfSxcbiAgICB9LFxuICB9LFxuICBkYXRhOiB7XG4gICAgb3B0czoge1xuICAgICAgb25Jbml0OiBpbml0Q2hhcnQsXG4gICAgfSxcbiAgfSxcbn0pO1xuIl19
\ No newline at end of file
{
"component": true,
"usingComponents": {
"ff-canvas": "@antv/f2-canvas"
}
}
// pages/components/ConsumeCountChart/ConsumeCountChart.js
let consumeCountChart = null;
let month = '';
function initChart(canvas, width, height, F2) {
const data = [];
consumeCountChart = new F2.Chart({
el: canvas,
width,
height,
});
consumeCountChart.source(data, {
days: {
min: 1,
max: 31,
},
});
consumeCountChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#68d0fe',
padding: [6, 10],
},
onShow(ev) {
const { items } = ev;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '笔';
},
});
consumeCountChart
.line()
.position('days*payMen')
.color('#68d0fe')
.shape('smooth')
.size(4);
consumeCountChart
.area()
.position('days*payMen')
.color('l(90) 0:#68d0fe 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
consumeCountChart.axis('payMen', false);
consumeCountChart.render();
return consumeCountChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer(newVal) {
consumeCountChart && consumeCountChart.changeData(newVal);
},
},
month: {
type: String,
value: '',
observer(newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
<!--pages/components/ConsumeCountChart/ConsumeCountChart.wxml-->
<ff-canvas id="ConsumeCountChart" canvas-id="ConsumeCountChart" opts="{{ opts }}" />
/* pages/components/ConsumeCountChart/ConsumeCountChart.wxss */
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fetch_1 = require("../../../api/fetch");
Component({
properties: {
feedbackData: {
type: Object,
value: {
phonecall: ''
}
areaId: 0,
areaName: '',
customerId: 0,
customerName: '',
customerPhone: '',
customerSex: '',
feedbackContent: '',
id: 0,
state: '',
},
},
},
data: {},
data: {
inputValue: '',
},
methods: {
makePhoneCallHandle: function () {
console.log('in makePhoneCallHandle');
wx.makePhoneCall({
phoneNumber: this.data.feedbackData.phonecall,
phoneNumber: this.data.feedbackData.customerPhone,
success: function () {
console.log('success');
},
fail: function () {
console.log('fail');
}
},
});
}
}
},
inputHandle: function (e) {
var val = e.detail.value;
this.setData({
inputValue: val,
});
},
sendFeedback: function () {
var _this = this;
var val = this.data.inputValue;
fetch_1.customerFetch({
url: '/feedback/feedback',
method: 'PUT',
data: {
id: this.data.feedbackData.id,
replayContent: val,
state: '2',
},
})
.then(function (res) {
wx.showToast({
title: res.msg,
});
_this.triggerEvent('refresh', {});
})
.catch(function (err) {
wx.showToast({
title: err.errMsg,
icon: 'none',
});
});
},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blxuICAvKipcbiAgICog57uE5Lu255qE5Yid5aeL5pWw5o2uXG4gICAqL1xuICBkYXRhOiB7XG5cbiAgfSxcblxuICAvKipcbiAgICog57uE5Lu255qE5pa55rOV5YiX6KGoXG4gICAqL1xuICBtZXRob2RzOiB7XG4gICAgbWFrZVBob25lQ2FsbEhhbmRsZSgpIHtcbiAgICAgIHd4Lm1ha2VQaG9uZUNhbGwoe1xuICAgICAgICBwaG9uZU51bWJlcjogdGhpcy5kYXRhLmZlZWRiYWNrRGF0YS5waG9uZWNhbGwsXG4gICAgICAgIHN1Y2Nlc3M6ICgpID0+IHtcbiAgICAgICAgICBjb25zb2xlLmxvZygnc3VjY2VzcycpXG4gICAgICAgIH0sXG4gICAgICAgIGZhaWw6ICgpID0+IHtcbiAgICAgICAgICBjb25zb2xlLmxvZygnZmFpbCcpXG5cbiAgICAgICAgfVxuICAgICAgfSlcbiAgICB9XG4gIH1cbn0pXG4iXX0=
\ No newline at end of file
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRmVlZGJhY2tJdGVtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiRmVlZGJhY2tJdGVtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsNENBQW1EO0FBR25ELFNBQVMsQ0FBQztJQUlSLFVBQVUsRUFBRTtRQUNWLFlBQVksRUFBRTtZQUNaLElBQUksRUFBRSxNQUFNO1lBQ1osS0FBSyxFQUFFO2dCQUNMLE1BQU0sRUFBRSxDQUFDO2dCQUNULFFBQVEsRUFBRSxFQUFFO2dCQUNaLFVBQVUsRUFBRSxDQUFDO2dCQUNiLFlBQVksRUFBRSxFQUFFO2dCQUNoQixhQUFhLEVBQUUsRUFBRTtnQkFDakIsV0FBVyxFQUFFLEVBQUU7Z0JBQ2YsZUFBZSxFQUFFLEVBQUU7Z0JBQ25CLEVBQUUsRUFBRSxDQUFDO2dCQUNMLEtBQUssRUFBRS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CxcbiAgICAgICAgICBzdGF0ZTogJzInLFxuICAgICAgICB9LFxuICAgICAgfSlcbiAgICAgICAgLnRoZW4ocmVzID0+IHtcbiAgICAgICAgICB3eC5zaG93VG9hc3Qoe1xuICAgICAgICAgICAgdGl0bGU6IHJlcy5tc2csXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgdGhpcy50cmlnZ2VyRXZlbnQoJ3JlZnJlc2gnLCB7fSk7XG4gICAgICAgIH0pXG4gICAgICAgIC5jYXRjaCgoZXJyOiB3eC5HZW5lcmFsQ2FsbGJhY2tSZXN1bHQpID0+IHtcbiAgICAgICAgICB3eC5zaG93VG9hc3Qoe1xuICAgICAgICAgICAgdGl0bGU6IGVyci5lcnJNc2csXG4gICAgICAgICAgICBpY29uOiAnbm9uZScsXG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgIH0sXG4gIH0sXG59KTtcbiJdfQ==
\ No newline at end of file
import { customerFetch } from '../../../api/fetch';
// pages/components/FeedbackItem/FeedbackItem.ts
Component({
/**
......@@ -7,8 +9,16 @@ Component({
feedbackData: {
type: Object,
value: {
phonecall: ''
}
areaId: 0,
areaName: '',
customerId: 0,
customerName: '',
customerPhone: '',
customerSex: '',
feedbackContent: '',
id: 0,
state: '',
},
},
},
......@@ -16,7 +26,7 @@ Component({
* 组件的初始数据
*/
data: {
inputValue: '',
},
/**
......@@ -24,16 +34,48 @@ Component({
*/
methods: {
makePhoneCallHandle() {
console.log('in makePhoneCallHandle');
wx.makePhoneCall({
phoneNumber: this.data.feedbackData.phonecall,
phoneNumber: this.data.feedbackData.customerPhone,
success: () => {
console.log('success')
console.log('success');
},
fail: () => {
console.log('fail')
console.log('fail');
},
});
},
inputHandle(e) {
const val = e.detail.value;
this.setData({
inputValue: val,
});
},
}
sendFeedback() {
const val = this.data.inputValue;
customerFetch({
url: '/feedback/feedback',
method: 'PUT',
data: {
id: this.data.feedbackData.id,
replayContent: val,
state: '2',
},
})
}
}
})
.then(res => {
wx.showToast({
title: res.msg,
});
this.triggerEvent('refresh', {});
})
.catch((err: wx.GeneralCallbackResult) => {
wx.showToast({
title: err.errMsg,
icon: 'none',
});
});
},
},
});
<!--pages/components/FeedbackItem/FeedbackItem.wxml-->
<!-- pages/components/FeedbackItem/FeedbackItem.wxml -->
<view class="FeedbackItem">
<view class="FeedbackItem-time">2019-09-28 8:46:32</view>
<view class="FeedbackItem-userinfo">
<view class="FeedbackItem-name">彰显则 男</view>
<view class="FeedbackItem-areaname">成都师范学院温江校区</view>
</view>
<view class="FeedbackItem-content">
佛 i 后 i 个问看见我发今晚看见短时间内夸父不期望你客气的接口就不算大看巴萨的咖色看巴萨的卡点半
<view class="FeedbackItem-name">
{{feedbackData.customerName}} {{feedbackData.customerSex==='1'?'男':'女'}}
</view>
<view class="FeedbackItem-areaname">{{feedbackData.areaName}}</view>
</view>
<input class="FeedbackItem-input"></input>
<view class="FeedbackItem-content">{{feedbackData.feedbackContent}}</view>
<input class="FeedbackItem-input" bindinput="inputHandle"></input>
<view class="FeedbackItem-option">
<view class="FeedbackItem-phone">
<view class="FeedbackItem-phone" bind:tap="makePhoneCallHandle">
<image class="FeedbackItem-phoneIcon" src="../../../images/ic_phone@2x.png"></image>
{{feedbackData.phonecall}}
{{feedbackData.customerPhone}}
</view>
<view class="FeedbackItem-send" bindtap="makePhoneCallHandle">发送</view>
<view class="FeedbackItem-send" bind:tap="sendFeedback">发送</view>
</view>
</view>
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("../../../utils/util");
var paytypeChart = null;
var month = '';
var colorMap = {
aimi: '#EB7E59',
bean: '#13C2C2',
discount: '#FACC14',
online: '#1890FF',
};
function initChart(canvas, width, height, F2) {
var data = [];
paytypeChart = new F2.Chart({
el: canvas,
width: width,
height: height,
});
paytypeChart.source(data, {
days: {
min: 1,
max: 31,
},
});
paytypeChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#f166fd',
padding: [6, 10],
},
onShow: function (ev) {
var items = ev.items;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '元';
},
});
paytypeChart.coord('polar', {
transposed: true,
innerRadius: 0.7,
});
paytypeChart.legend({
position: 'right',
marker: 'square',
});
paytypeChart.tooltip(false);
paytypeChart
.interval()
.position('a*count')
.color('key', function (val) {
return colorMap[val];
})
.adjust('stack');
paytypeChart.axis(false);
paytypeChart.render();
return paytypeChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer: function (newVal) {
paytypeChart &&
paytypeChart.legend({
position: 'right',
marker: 'square',
custom: true,
items: newVal.map(function (item) { return ({
name: item.name,
value: ' ' + util_1.formatPrice(item.count),
marker: {
symbol: 'square',
fill: colorMap[item.key],
radius: 4,
},
}); }),
});
paytypeChart && paytypeChart.changeData(newVal);
},
},
month: {
type: String,
value: '',
observer: function (newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGF5VHlwZUNoYXJ0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiUGF5VHlwZUNoYXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsNENBQWtEO0FBR2xELElBQUksWUFBWSxHQUFHLElBQUksQ0FBQztBQUN4QixJQUFJLEtBQUssR0FBRyxFQUFFLENBQUM7QUFDZixJQUFNLFFBQVEsR0FBRztJQUNmLElBQUksRUFBRSxTQUFTO0lBQ2YsSUFBSSxFQUFFLFNBQVM7SUFDZixRQUFRLEVBQUUsU0FBUztJQUNuQixNQUFNLEVBQUUsU0FBUztDQUNsQixDQUFDO0FBRUYsbUJBQW1CLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLEVBQUU7SUFDMUMsSUFBTSxJQUFJLEdBQUcsRUFBRSxDQUFDO0lBQ2hCLFlBQVksR0FBRyxJQUFJLEVBQUUsQ0F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ICAgICAgICBtb250aCA9IG5ld1ZhbDtcbiAgICAgIH0sXG4gICAgfSxcbiAgfSxcbiAgZGF0YToge1xuICAgIG9wdHM6IHtcbiAgICAgIG9uSW5pdDogaW5pdENoYXJ0LFxuICAgIH0sXG4gIH0sXG59KTtcbiJdfQ==
\ No newline at end of file
{
"component": true,
"usingComponents": {
"ff-canvas": "@antv/f2-canvas"
}
}
import { formatPrice } from '../../../utils/util';
// pages/components/PayTypeChart/PayTypeChart.js
let paytypeChart = null;
let month = '';
const colorMap = {
aimi: '#EB7E59',
bean: '#13C2C2',
discount: '#FACC14',
online: '#1890FF',
};
function initChart(canvas, width, height, F2) {
const data = [];
paytypeChart = new F2.Chart({
el: canvas,
width,
height,
});
paytypeChart.source(data, {
days: {
min: 1,
max: 31,
},
});
paytypeChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#f166fd',
padding: [6, 10],
},
onShow(ev) {
const { items } = ev;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '元';
},
});
paytypeChart.coord('polar', {
transposed: true,
innerRadius: 0.7,
});
paytypeChart.legend({
position: 'right',
marker: 'square',
});
paytypeChart.tooltip(false);
paytypeChart
.interval()
.position('a*count')
.color('key', val => {
return colorMap[val];
})
.adjust('stack');
paytypeChart.axis(false);
paytypeChart.render();
return paytypeChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer(newVal) {
paytypeChart &&
paytypeChart.legend({
position: 'right',
marker: 'square',
custom: true,
items: newVal.map(item => ({
name: item.name,
value: ' ' + formatPrice(item.count),
marker: {
symbol: 'square',
fill: colorMap[item.key],
radius: 4,
},
})),
});
paytypeChart && paytypeChart.changeData(newVal);
},
},
month: {
type: String,
value: '',
observer(newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
<!--pages/components/PayTypeChart/PayTypeChart.wxml-->
<ff-canvas id="PayTypeChart" canvas-id="PayTypeChart" opts="{{ opts }}" />
/* pages/components/PayTypeChart/PayTypeChart.wxss */
\ No newline at end of file
"use strict";
var rechargeChart = null;
var month = '';
function initChart(canvas, width, height, F2) {
var data = [];
rechargeChart = new F2.Chart({
el: canvas,
width: width,
height: height,
});
rechargeChart.source(data, {
days: {
min: 1,
max: 31,
},
});
rechargeChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#6895fe',
padding: [6, 10],
},
onShow: function (ev) {
var items = ev.items;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '元';
},
});
rechargeChart
.line()
.position('days*rechargeMoney')
.color('#6895fe')
.shape('smooth')
.size(4);
rechargeChart
.area()
.position('days*rechargeMoney')
.color('l(90) 0:#6895fe 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
rechargeChart.axis('rechargeMoney', false);
rechargeChart.render();
return rechargeChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer: function (newVal) {
rechargeChart && rechargeChart.changeData(newVal);
},
},
month: {
type: String,
value: '',
observer: function (newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVjaGFyZ2VDaGFydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIlJlY2hhcmdlQ2hhcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQUksYUFBYSxHQUFHLElBQUksQ0FBQztBQUN6QixJQUFJLEtBQUssR0FBRyxFQUFFLENBQUM7QUFFZixtQkFBbUIsTUFBTSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsRUFBRTtJQUMxQyxJQUFNLElBQUksR0FBRyxFQUFFLENBQUM7SUFDaEIsYUFBYSxHQUFHLElBQUksRUFBRSxDQUFDLEtBQUssQ0FBQztRQUMzQixFQUFFLEVBQUUsTUFBTTtRQUNWLEtBQUssT0FBQTtRQUNMLE1BQU0s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dyZWNoYXJnZU1vbmV5JywgZmFsc2UpO1xuICByZWNoYXJnZUNoYXJ0LnJlbmRlcigpO1xuICByZXR1cm4gcmVjaGFyZ2VDaGFydDtcbn1cblxuQ29tcG9uZW50KHtcbiAgcHJvcGVydGllczoge1xuICAgIGRhdGFMaXN0OiB7XG4gICAgICB0eXBlOiBBcnJheSxcbiAgICAgIHZhbHVlOiBbXSxcbiAgICAgIG9ic2VydmVyKG5ld1ZhbCkge1xuICAgICAgICByZWNoYXJnZUNoYXJ0ICYmIHJlY2hhcmdlQ2hhcnQuY2hhbmdlRGF0YShuZXdWYWwpO1xuICAgICAgfSxcbiAgICB9LFxuICAgIG1vbnRoOiB7XG4gICAgICB0eXBlOiBTdHJpbmcsXG4gICAgICB2YWx1ZTogJycsXG4gICAgICBvYnNlcnZlcihuZXdWYWwpIHtcbiAgICAgICAgbW9udGggPSBuZXdWYWw7XG4gICAgICB9LFxuICAgIH0sXG4gIH0sXG4gIGRhdGE6IHtcbiAgICBvcHRzOiB7XG4gICAgICBvbkluaXQ6IGluaXRDaGFydCxcbiAgICB9LFxuICB9LFxufSk7XG4iXX0=
\ No newline at end of file
{
"component": true,
"usingComponents": {
"ff-canvas": "@antv/f2-canvas"
}
}
\ No newline at end of file
let rechargeChart = null;
let month = '';
function initChart(canvas, width, height, F2) {
const data = [];
rechargeChart = new F2.Chart({
el: canvas,
width,
height,
});
rechargeChart.source(data, {
days: {
min: 1,
max: 31,
},
});
rechargeChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#6895fe',
padding: [6, 10],
},
onShow(ev) {
const { items } = ev;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '元';
},
});
rechargeChart
.line()
.position('days*rechargeMoney')
.color('#6895fe')
.shape('smooth')
.size(4);
rechargeChart
.area()
.position('days*rechargeMoney')
.color('l(90) 0:#6895fe 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
rechargeChart.axis('rechargeMoney', false);
rechargeChart.render();
return rechargeChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer(newVal) {
rechargeChart && rechargeChart.changeData(newVal);
},
},
month: {
type: String,
value: '',
observer(newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
<!--pages/components/RechargeChart/RechargeChart.wxml-->
<ff-canvas id="RechargeChart" canvas-id="RechargeChart" opts="{{ opts }}" />
\ No newline at end of file
/* pages/components/RechargeChart/RechargeChart.wxss */
\ No newline at end of file
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
var refundChart = null;
var month = '';
function initChart(canvas, width, height, F2) {
var data = [];
refundChart = new F2.Chart({
el: canvas,
width: width,
height: height,
});
refundChart.source(data, {
days: {
min: 1,
max: 31,
},
});
refundChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#f166fd',
padding: [6, 10],
},
onShow: function (ev) {
var items = ev.items;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '元';
},
});
refundChart
.line()
.position('days*refundMoney')
.color('#f166fd')
.shape('smooth')
.size(4);
refundChart
.area()
.position('days*refundMoney')
.color('l(90) 0:#f166fd 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
refundChart.axis('refundMoney', false);
refundChart.render();
return refundChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer: function (newVal) {
var list = newVal.map(function (item) { return (__assign({}, item, { refundMoney: Math.abs(item.refundMoney) })); });
refundChart && refundChart.changeData(list);
},
},
month: {
type: String,
value: '',
observer: function (newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVmdW5kQ2hhcnQuanMiLCJzb3VyY2VSb290Ij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7XG4gICAgICAgIHJlZnVuZENoYXJ0ICYmIHJlZnVuZENoYXJ0LmNoYW5nZURhdGEobGlzdCk7XG4gICAgICB9LFxuICAgIH0sXG4gICAgbW9udGg6IHtcbiAgICAgIHR5cGU6IFN0cmluZyxcbiAgICAgIHZhbHVlOiAnJyxcbiAgICAgIG9ic2VydmVyKG5ld1ZhbCkge1xuICAgICAgICBtb250aCA9IG5ld1ZhbDtcbiAgICAgIH0sXG4gICAgfSxcbiAgfSxcbiAgZGF0YToge1xuICAgIG9wdHM6IHtcbiAgICAgIG9uSW5pdDogaW5pdENoYXJ0LFxuICAgIH0sXG4gIH0sXG59KTtcbiJdfQ==
\ No newline at end of file
{
"component": true,
"usingComponents": {
"ff-canvas": "@antv/f2-canvas"
}
}
// pages/components/RefundChart/RefundChart.js
let refundChart = null;
let month = '';
function initChart(canvas, width, height, F2) {
const data = [];
refundChart = new F2.Chart({
el: canvas,
width,
height,
});
refundChart.source(data, {
days: {
min: 1,
max: 31,
},
});
refundChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#f166fd',
padding: [6, 10],
},
onShow(ev) {
const { items } = ev;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '元';
},
});
refundChart
.line()
.position('days*refundMoney')
.color('#f166fd')
.shape('smooth')
.size(4);
refundChart
.area()
.position('days*refundMoney')
.color('l(90) 0:#f166fd 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
refundChart.axis('refundMoney', false);
refundChart.render();
return refundChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer(newVal) {
let list = newVal.map(item => ({
...item,
refundMoney: Math.abs(item.refundMoney),
}));
refundChart && refundChart.changeData(list);
},
},
month: {
type: String,
value: '',
observer(newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
<!-- pages/components/RefundChart/RefundChart.wxml -->
<ff-canvas id="RefundChart" canvas-id="RefundChart" opts="{{ opts }}" />
\ No newline at end of file
/* pages/components/RefundChart/RefundChart.wxss */
\ No newline at end of file
"use strict";
Component({});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2VsZWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiU2VsZWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxTQUFTLENBQUMsRUFBRSxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJDb21wb25lbnQoe30pO1xuIl19
\ No newline at end of file
Component({
properties: {
placeholder: {
type: String,
value: '请选择',
},
range: {
type: Array,
value: [],
},
rangeKey: {
type: String,
value: 'key',
},
mode: {
type: String,
value: 'selector',
},
fields: {
type: String,
value: 'day',
},
value: {
type: String,
value: '',
observer: function (newVal) {
console.log('in select ob', newVal);
this.setData({ selected: newVal });
},
},
},
data: {
selected: '',
},
methods: {
bindPickerChange: function (e) {
var value = e.detail.value;
console.log(value);
this.setData({
selected: value,
});
this.triggerEvent('change', { value: value });
},
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2VsZWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiU2VsZWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxTQUFTLENBQUM7SUFDUixVQUFVLEVBQUU7UUFDVixXQUFXLEVBQUU7WUFDWCxJQUFJLEVBQUUsTUFBTTtZQUNaLEtBQUssRUFBRSxLQUFLO1NBQ2I7UUFDRCxLQUFLLEVBQUU7WUFDTCxJQUFJLEVBQUUsS0FBSztZQUNYLEtBQUssRUFBRSxFQUFFO1NBQ1Y7UUFDRCxRQUFRLEVBQUU7WUFDUixJQUFJLEVBQUUsTUFBTTtZQUNaLEtBQUssRUFBRSxLQUFLO1NBQ2I7UUFDRCxJQUFJLEVBQUU7WUFDSixJQUFJLEVBQUUsTUFBTTtZQUNaLEtBQUssR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ogU3RyaW5nLFxuICAgICAgdmFsdWU6ICdrZXknLFxuICAgIH0sXG4gICAgbW9kZToge1xuICAgICAgdHlwZTogU3RyaW5nLFxuICAgICAgdmFsdWU6ICdzZWxlY3RvcicsXG4gICAgfSxcbiAgICBmaWVsZHM6IHtcbiAgICAgIHR5cGU6IFN0cmluZyxcbiAgICAgIHZhbHVlOiAnZGF5JyxcbiAgICB9LFxuICAgIHZhbHVlOiB7XG4gICAgICB0eXBlOiBTdHJpbmcsXG4gICAgICB2YWx1ZTogJycsXG4gICAgICBvYnNlcnZlcihuZXdWYWwpIHtcbiAgICAgICAgY29uc29sZS5sb2coJ2luIHNlbGVjdCBvYicsIG5ld1ZhbCk7XG4gICAgICAgIHRoaXMuc2V0RGF0YSh7IHNlbGVjdGVkOiBuZXdWYWwgfSk7XG4gICAgICB9LFxuICAgIH0sXG4gIH0sXG4gIGRhdGE6IHtcbiAgICBzZWxlY3RlZDogJycsXG4gIH0sXG4gIG1ldGhvZHM6IHtcbiAgICBiaW5kUGlja2VyQ2hhbmdlKGUpIHtcbiAgICAgIGNvbnN0IHsgdmFsdWUgfSA9IGUuZGV0YWlsO1xuICAgICAgY29uc29sZS5sb2codmFsdWUpO1xuICAgICAgdGhpcy5zZXREYXRhISh7XG4gICAgICAgIHNlbGVjdGVkOiB2YWx1ZSxcbiAgICAgIH0pO1xuICAgICAgdGhpcy50cmlnZ2VyRXZlbnQoJ2NoYW5nZScsIHsgdmFsdWUgfSk7XG4gICAgfSxcbiAgfSxcbn0pO1xuIl19
\ No newline at end of file
Component({});
Component({
properties: {
placeholder: {
type: String,
value: '请选择',
},
range: {
type: Array,
value: [],
},
rangeKey: {
type: String,
value: 'key',
},
mode: {
type: String,
value: 'selector',
},
fields: {
type: String,
value: 'day',
},
value: {
type: String,
value: '',
observer(newVal) {
console.log('in select ob', newVal);
this.setData({ selected: newVal });
},
},
},
data: {
selected: '',
},
methods: {
bindPickerChange(e) {
const { value } = e.detail;
console.log(value);
this.setData!({
selected: value,
});
this.triggerEvent('change', { value });
},
},
});
<!--pages/components/Select/Select.wxml-->
<view class="input">
<text>pages/components/Select/Select.wxml</text>
<!-- pages/components/Select/Select.wxml -->
<view class="select-input">
<picker class="select-picker" mode="{{mode}}" bindchange="bindPickerChange" value="{{selected}}" range="{{range}}" range-key="{{rangeKey}}" fields="{{fields}}">
<view wx:if="{{selected && mode === 'date'}}" class="select-value">{{selected}}</view>
<view wx:elif="{{selected}}" class="select-value">{{range[selected][rangeKey]}}</view>
<view wx:else class="select-placeholder">{{placeholder}}</view>
<image class="select-icon" src="../../../images/btn_xiala@2x.png" mode="aspectFill" />
</picker>
</view>
\ No newline at end of file
/* pages/components/Select/Select.wxss */
\ No newline at end of file
/* pages/components/Select/Select.wxss */
.select-input {
position: relative;
border: 1rpx solid #f8f8f8;
background-color: #f8f8f8;
padding: 0 40rpx;
border-radius: 96rpx;
height: 96rpx;
line-height: 96rpx;
font-size: 28rpx;
}
.select-input:hover,
.select-input:focus {
border-color: #6895fe;
}
.select-placeholder {
color: #999;
}
.select-value {
color: #333;
}
.select-icon {
position: absolute;
width: 44rpx;
height: 44rpx;
right: 40rpx;
top: 26rpx;
}
/* pages/components/ServiceCount/ServiceCount.wxss */
.ServiceCount {
position: relative;
width: 296rpx;
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 22rpx 0 26rpx;
}
.ServiceCount:nth-child(odd)::after {
content: ' ';
position: absolute;
right: 0;
top: 30rpx;
width: 1rpx;
height: 40rpx;
}
.ServiceCount-color {
......@@ -18,7 +28,9 @@
background-color: #6a92ff;
}
.ServiceCount-tag, .ServiceCount-title, .ServiceCount-price {
.ServiceCount-tag,
.ServiceCount-title,
.ServiceCount-price {
font-size: 26rpx;
color: #666;
}
......@@ -35,6 +47,7 @@
}
.ServiceCount-price {
margin-top: 8rpx;
box-sizing: border-box;
width: 100%;
padding-left: 30rpx;
......
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("../../../utils/util");
Component({
properties: {
dataList: {
type: Array,
value: [],
observer: function (newVal) {
var maxnum = Math.ceil(Math.max.apply(Math, newVal.map(function (item) { return item.payableMoney; })) / 0.9);
var list = newVal.map(function (item) { return (__assign({}, item, { payableMoney: util_1.formatPrice(item.payableMoney), precent: Math.ceil((item.payableMoney / maxnum) * 100) })); });
this.setData({
list: list,
});
},
},
},
data: {
list: [],
},
methods: {},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2VydmljZVR5cGVDaGFydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIlNlcnZpY2VUeXBlQ2hhcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLDRDQUFrRDtBQUdsRCxTQUFTLENBQUM7SUFJUixVQUFVLEVBQUU7UUFDVixRQUFRLEVBQUU7WUFDUixJQUFJLEVBQUUsS0FBSztZQUNYLEtBQUssRUFBRSxFQUFFO1lBQ1QsUUFBUSxZQUFDLE1BQU07Z0JBQ2IsSUFBSSxNQUFNLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FDcEIsSUFBSSxDQUFDLEdBQUcsT0FBUixJQUFJLEVBQVEsTUFBTSxDQUFDLEdBQUcsQ0FBQyxVQUFBLElBQUksSUFBSSxPQUFBLElBQUksQ0FBQyxZQUFZLEVBQWpCLENBQWlCLENBQUMsSUFBSSxHQUFHLENBQ3pELENBQUM7Z0JBQ0YsSUFBSSxJQUFJLEdBQUcsTUFBTSxDQUFDLEdBQUcsQ0FBQyxVQUFBLElBQUksSUFBSSxPQUFBLGNBQ3pCLElBQUksSUFDUCxZQUFZLEVBQUUsa0JBQVcsQ0FBQyxJQUFJLENBQUMsWUFBWSxDQUFDLEVBQzVD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YXlhYmxlTW9uZXkgLyBtYXhudW0pICogMTAwKSxcbiAgICAgICAgfSkpO1xuICAgICAgICB0aGlzLnNldERhdGEoe1xuICAgICAgICAgIGxpc3QsXG4gICAgICAgIH0pO1xuICAgICAgfSxcbiAgICB9LFxuICB9LFxuXG4gIC8qKlxuICAgKiDnu4Tku7bnmoTliJ3lp4vmlbDmja5cbiAgICovXG4gIGRhdGE6IHtcbiAgICBsaXN0OiBbXSxcbiAgfSxcblxuICAvKipcbiAgICog57uE5Lu255qE5pa55rOV5YiX6KGoXG4gICAqL1xuICBtZXRob2RzOiB7fSxcbn0pO1xuIl19
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
import { formatPrice } from '../../../utils/util';
// pages/components/ServiceTypeChart/ServiceTypeChart.js
Component({
/**
* 组件的属性列表
*/
properties: {
dataList: {
type: Array,
value: [],
observer(newVal) {
let maxnum = Math.ceil(
Math.max(...newVal.map(item => item.payableMoney)) / 0.9,
);
let list = newVal.map(item => ({
...item,
payableMoney: formatPrice(item.payableMoney),
precent: Math.ceil((item.payableMoney / maxnum) * 100),
}));
this.setData({
list,
});
},
},
},
/**
* 组件的初始数据
*/
data: {
list: [],
},
/**
* 组件的方法列表
*/
methods: {},
});
<!-- pages/components/ServiceTypeChart/ServiceTypeChart.wxml -->
<view class="ServiceTypeChart">
<view wx:for="{{list}}" wx:key="{{item.serviceId}}" class="ServiceTypeChart-item">
<view class="ServiceTypeChart-title">
<view class="ServiceTypeChart-name">{{item.serviceName}}</view>
<view class="ServiceTypeChart-count">{{item.payableMoney}}</view>
</view>
<view class="ServiceTypeChart-precent">
<view class="ServiceTypeChart-innerprecent" style="width: {{item.precent}}%"></view>
</view>
</view>
</view>
\ No newline at end of file
/* pages/components/ServiceTypeChart/ServiceTypeChart.wxss */
.ServiceTypeChart {
padding-bottom: 20rpx;
}
.ServiceTypeChart-title {
display: flex;
justify-content: space-between;
font-size: 28rpx;
color: #6895fe;
margin-bottom: 20rpx;
}
.ServiceTypeChart-precent,
.ServiceTypeChart-innerprecent {
height: 12rpx;
border-radius: 12rpx;
}
.ServiceTypeChart-precent {
margin-bottom: 40rpx;
background-color: #f2f2f2;
}
.ServiceTypeChart-innerprecent {
width: 0;
background-color: #6F96F6;
}
"use strict";
var userActivityChart = null;
var month = '';
function initChart(canvas, width, height, F2) {
var data = [];
userActivityChart = new F2.Chart({
el: canvas,
width: width,
height: height,
});
userActivityChart.source(data, {
days: {
min: 1,
max: 31,
},
});
userActivityChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#6895fe',
padding: [6, 10],
},
onShow: function (ev) {
var items = ev.items;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '人';
},
});
userActivityChart
.line()
.position('days*count')
.color('#6895fe')
.shape('smooth')
.size(4);
userActivityChart
.area()
.position('days*count')
.color('l(90) 0:#6895fe 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
userActivityChart.axis('count', false);
userActivityChart.render();
return userActivityChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer: function (newVal) {
userActivityChart && userActivityChart.changeData(newVal);
},
},
month: {
type: String,
value: '',
observer: function (newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVXNlckFjdGl2aXR5Q2hhcnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJVc2VyQWN0aXZpdHlDaGFydC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsSUFBSSxpQkFBaUIsR0FBRyxJQUFJLENBQUM7QUFDN0IsSUFBSSxLQUFLLEdBQUcsRUFBRSxDQUFDO0FBRWYsbUJBQW1CLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLEVBQUU7SUFDMUMsSUFBTSxJQUFJLEdBQUcsRUFBRSxDQUFDO0lBQ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XG4gIHVzZXJBY3Rpdml0eUNoYXJ0XG4gICAgLmFyZWEoKVxuICAgIC5wb3NpdGlvbignZGF5cypjb3VudCcpXG4gICAgLmNvbG9yKCdsKDkwKSAwOiM2ODk1ZmUgMTojZmZmJylcbiAgICAuc2hhcGUoJ3Ntb290aCcpXG4gICAgLnN0eWxlKHtcbiAgICAgIGZpbGxPcGFjaXR5OiAwLjYsXG4gICAgfSk7XG4gIHVzZXJBY3Rpdml0eUNoYXJ0LmF4aXMoJ2NvdW50JywgZmFsc2UpO1xuICB1c2VyQWN0aXZpdHlDaGFydC5yZW5kZXIoKTtcbiAgcmV0dXJuIHVzZXJBY3Rpdml0eUNoYXJ0O1xufVxuXG5Db21wb25lbnQoe1xuICBwcm9wZXJ0aWVzOiB7XG4gICAgZGF0YUxpc3Q6IHtcbiAgICAgIHR5cGU6IEFycmF5LFxuICAgICAgdmFsdWU6IFtdLFxuICAgICAgb2JzZXJ2ZXIobmV3VmFsKSB7XG4gICAgICAgIHVzZXJBY3Rpdml0eUNoYXJ0ICYmIHVzZXJBY3Rpdml0eUNoYXJ0LmNoYW5nZURhdGEobmV3VmFsKTtcbiAgICAgIH0sXG4gICAgfSxcbiAgICBtb250aDoge1xuICAgICAgdHlwZTogU3RyaW5nLFxuICAgICAgdmFsdWU6ICcnLFxuICAgICAgb2JzZXJ2ZXIobmV3VmFsKSB7XG4gICAgICAgIG1vbnRoID0gbmV3VmFsO1xuICAgICAgfSxcbiAgICB9LFxuICB9LFxuICBkYXRhOiB7XG4gICAgb3B0czoge1xuICAgICAgb25Jbml0OiBpbml0Q2hhcnQsXG4gICAgfSxcbiAgfSxcbn0pO1xuIl19
\ No newline at end of file
{
"component": true,
"usingComponents": {
"ff-canvas": "@antv/f2-canvas"
}
}
\ No newline at end of file
// pages/components/UserActivityChart/UserActivityChart.js
let userActivityChart = null;
let month = '';
function initChart(canvas, width, height, F2) {
const data = [];
userActivityChart = new F2.Chart({
el: canvas,
width,
height,
});
userActivityChart.source(data, {
days: {
min: 1,
max: 31,
},
});
userActivityChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#6895fe',
padding: [6, 10],
},
onShow(ev) {
const { items } = ev;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '人';
},
});
userActivityChart
.line()
.position('days*count')
.color('#6895fe')
.shape('smooth')
.size(4);
userActivityChart
.area()
.position('days*count')
.color('l(90) 0:#6895fe 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
userActivityChart.axis('count', false);
userActivityChart.render();
return userActivityChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer(newVal) {
userActivityChart && userActivityChart.changeData(newVal);
},
},
month: {
type: String,
value: '',
observer(newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
<!--pages/components/UserActivityChart/UserActivityChart.wxml-->
<ff-canvas id="UserActivityChart" canvas-id="UserActivityChart" opts="{{ opts }}" />
/* pages/components/UserActivityChart/UserActivityChart.wxss */
\ No newline at end of file
"use strict";
var userGrouthChart = null;
var month = '';
function initChart(canvas, width, height, F2) {
var data = [];
userGrouthChart = new F2.Chart({
el: canvas,
width: width,
height: height,
});
userGrouthChart.source(data, {
days: {
min: 1,
max: 31,
},
});
userGrouthChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#6895fe',
padding: [6, 10],
},
onShow: function (ev) {
var items = ev.items;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '人';
},
});
userGrouthChart
.line()
.position('days*count')
.color('#6895fe')
.shape('smooth')
.size(4);
userGrouthChart
.area()
.position('days*count')
.color('l(90) 0:#6895fe 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
userGrouthChart.axis('count', false);
userGrouthChart.render();
return userGrouthChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer: function (newVal) {
userGrouthChart && userGrouthChart.changeData(newVal);
},
},
month: {
type: String,
value: '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uZXdWYWwpIHtcbiAgICAgICAgbW9udGggPSBuZXdWYWw7XG4gICAgICB9LFxuICAgIH0sXG4gIH0sXG4gIGRhdGE6IHtcbiAgICBvcHRzOiB7XG4gICAgICBvbkluaXQ6IGluaXRDaGFydCxcbiAgICB9LFxuICB9LFxufSk7XG5cbiJdfQ==
\ No newline at end of file
{
"component": true,
"usingComponents": {
"ff-canvas": "@antv/f2-canvas"
}
}
// pages/components/UserGrouthChart/UserGrouthChart.js
let userGrouthChart = null;
let month = '';
function initChart(canvas, width, height, F2) {
const data = [];
userGrouthChart = new F2.Chart({
el: canvas,
width,
height,
});
userGrouthChart.source(data, {
days: {
min: 1,
max: 31,
},
});
userGrouthChart.tooltip({
showItemMarker: false,
background: {
radius: 2,
fill: '#6895fe',
padding: [6, 10],
},
onShow(ev) {
const { items } = ev;
items[0].name = '';
items[0].value = month + '-' + items[0].title;
items[1].name = '';
items[1].value = items[1].value + '人';
},
});
userGrouthChart
.line()
.position('days*count')
.color('#6895fe')
.shape('smooth')
.size(4);
userGrouthChart
.area()
.position('days*count')
.color('l(90) 0:#6895fe 1:#fff')
.shape('smooth')
.style({
fillOpacity: 0.6,
});
userGrouthChart.axis('count', false);
userGrouthChart.render();
return userGrouthChart;
}
Component({
properties: {
dataList: {
type: Array,
value: [],
observer(newVal) {
userGrouthChart && userGrouthChart.changeData(newVal);
},
},
month: {
type: String,
value: '',
observer(newVal) {
month = newVal;
},
},
},
data: {
opts: {
onInit: initChart,
},
},
});
<!--pages/components/UserGrouthChart/UserGrouthChart.wxml-->
<ff-canvas id="UserGrouthChart" canvas-id="UserGrouthChart" opts="{{ opts }}" />
/* pages/components/UserGrouthChart/UserGrouthChart.wxss */
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fetch_1 = require("../../api/fetch");
Page({
onLoad: function () {
this.initData();
this.fetchAreaList();
},
data: {
userdata: {
phonecall: '18108096099'
},
areaId: 0,
array: [
{ value: 1, name: 'asdd' },
{ value: 2, name: 'bjgd' },
{ value: 3, name: 'gksf' },
]
},
bindPickerChange: function (val) {
console.log(val);
tabIndex: 1,
areaId: '',
list1: [],
list2: [],
areaList: [],
},
initData: function () {
this.fetchList(1);
this.fetchList(2);
},
toggleList: function (e) {
var tabindex = e.currentTarget.dataset.tabindex;
if (tabindex !== this.data.tabIndex) {
this.setData({
tabIndex: tabindex,
});
this.fetchList(tabindex);
}
},
fetchList: function (state) {
var _this = this;
if (!state)
state = this.data.tabIndex;
wx.showLoading({ title: '' });
fetch_1.statisticsFetch({
url: '/dcxy/reportInfo/queryFeedbackListV2',
data: this.data.areaId
? {
state: state,
areaId: this.data.areaId,
}
: { state: state },
})
.then(function (res) {
wx.hideLoading();
var list = res.data;
_this.setData((_a = {},
_a['list' + state] = list,
_a));
var _a;
})
.catch(function (err) {
console.log(err);
wx.showToast({
title: err.errMsg,
icon: 'none',
});
});
},
bindPickerChange: function (e) {
var _this = this;
console.log(e);
var value = e.detail.value;
this.setData({
areaId: this.data.areaList[value].id,
}, function () {
_this.initData();
});
},
refreshHandle: function (e) {
this.fetchList();
},
fetchAreaList: function () {
var _this = this;
fetch_1.baseFetch({
url: '/dcxy/baseArea/queryAll',
})
.then(function (res) {
if (res.data) {
_this.setData({
areaList: res.data,
});
}
else {
_this.setData({
areaList: [],
});
}
})
.catch(function (err) {
console.log(err);
});
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVlZGJhY2suanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJmZWVkYmFjay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsSUFBSSxDQUFDO0lBSUgsSUFBSSxFQUFFO1FBQ0osUUFBUSxFQUFFO1lBQ1IsU0FBUyxFQUFFLGFBQWE7U0FDekI7UUFDRCxNQUFNLEVBQUUsQ0FBQztRQUNULEtBQUssRUFBRTtZQUNMLEVBQUUsS0FBSyxFQUFFLENBQUMsRUFBRSxJQ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yciA9PiB7XG4gICAgICAgIGNvbnNvbGUubG9nKGVycik7XG4gICAgICAgIHd4LnNob3dUb2FzdCh7XG4gICAgICAgICAgdGl0bGU6IGVyci5lcnJNc2csXG4gICAgICAgICAgaWNvbjogJ25vbmUnLFxuICAgICAgICB9KTtcbiAgICAgIH0pO1xuICB9LFxuICBiaW5kUGlja2VyQ2hhbmdlKGUpIHtcbiAgICBjb25zb2xlLmxvZyhlKTtcbiAgICBjb25zdCB7IHZhbHVlIH0gPSBlLmRldGFpbDtcbiAgICB0aGlzLnNldERhdGEhKFxuICAgICAge1xuICAgICAgICBhcmVhSWQ6IHRoaXMuZGF0YS5hcmVhTGlzdFt2YWx1ZV0uaWQsXG4gICAgICB9LFxuICAgICAgKCkgPT4ge1xuICAgICAgICB0aGlzLmluaXREYXRhKCk7XG4gICAgICB9LFxuICAgICk7XG4gIH0sXG4gIHJlZnJlc2hIYW5kbGUoZSkge1xuICAgIHRoaXMuZmV0Y2hMaXN0KCk7XG4gIH0sXG4gIGZldGNoQXJlYUxpc3QoKSB7XG4gICAgYmFzZUZldGNoKHtcbiAgICAgIHVybDogJy9kY3h5L2Jhc2VBcmVhL3F1ZXJ5QWxsJyxcbiAgICB9KVxuICAgICAgLnRoZW4ocmVzID0+IHtcbiAgICAgICAgaWYgKHJlcy5kYXRhKSB7XG4gICAgICAgICAgdGhpcy5zZXREYXRhISh7XG4gICAgICAgICAgICBhcmVhTGlzdDogcmVzLmRhdGEsXG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGhpcy5zZXREYXRhISh7XG4gICAgICAgICAgICBhcmVhTGlzdDogW10sXG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgICAuY2F0Y2goZXJyID0+IHtcbiAgICAgICAgY29uc29sZS5sb2coZXJyKTtcbiAgICAgIH0pO1xuICB9LFxufSk7XG4iXX0=
\ No newline at end of file
{
"navigationBarTitleText": "反馈处理",
"usingComponents": {
"c-select": "../components/Select/Select",
"feedback-item": "../components/FeedbackItem/FeedbackItem"
}
}
\ No newline at end of file
}
import { statisticsFetch, baseFetch } from '../../api/fetch';
// miniprogram/pages/feedback/feedback.js
Page({
onLoad() {
this.initData();
this.fetchAreaList();
},
/**
* 页面的初始数据
*/
data: {
userdata: {
phonecall: '18108096099'
},
areaId: 0,
array: [
{ value: 1, name: 'asdd' },
{ value: 2, name: 'bjgd' },
{ value: 3, name: 'gksf' },
]
},
bindPickerChange(val) {
console.log(val)
tabIndex: 1,
areaId: '',
list1: [],
list2: [],
areaList: [],
},
})
\ No newline at end of file
initData() {
this.fetchList(1);
this.fetchList(2);
},
toggleList(e) {
const { tabindex } = e.currentTarget.dataset;
if (tabindex !== this.data.tabIndex) {
this.setData!({
tabIndex: tabindex,
});
this.fetchList(tabindex);
}
},
fetchList(state?: number) {
if (!state) state = this.data.tabIndex;
wx.showLoading({ title: '' });
statisticsFetch({
url: '/dcxy/reportInfo/queryFeedbackListV2',
data: this.data.areaId
? {
state,
areaId: this.data.areaId,
}
: { state },
})
.then(res => {
wx.hideLoading();
const list = res.data;
this.setData!({
['list' + state]: list,
});
})
.catch(err => {
console.log(err);
wx.showToast({
title: err.errMsg,
icon: 'none',
});
});
},
bindPickerChange(e) {
console.log(e);
const { value } = e.detail;
this.setData!(
{
areaId: this.data.areaList[value].id,
},
() => {
this.initData();
},
);
},
refreshHandle(e) {
this.fetchList();
},
fetchAreaList() {
baseFetch({
url: '/dcxy/baseArea/queryAll',
})
.then(res => {
if (res.data) {
this.setData!({
areaList: res.data,
});
} else {
this.setData!({
areaList: [],
});
}
})
.catch(err => {
console.log(err);
});
},
});
<!--miniprogram/pages/feedback/feedback.wxml-->
<!-- miniprogram/pages/feedback/feedback.wxml -->
<view class="container feedback">
<view class="feedback-area">
<picker class="feedback-areaSelect" mode="selector" bindchange="bindPickerChange" value="{{areaIndex}}" range="{{areaList}}" range-key="{{'name'}}">
<view class="picker">
当前选择:{{areaList[index].name}}
</view>
</picker>
<c-select mode="selector" range="{{areaList}}" range-key="{{'areaName'}}" bindchange="bindPickerChange" placeholder="所属区域选择" />
</view>
<view class="feedback-tabbar">
<view class="feedback-tabItem checked">
<view bind:tap="toggleList" data-tabIndex="{{1}}" class="feedback-tabItem {{tabIndex===1?'checked':''}}">
<text class="feedback-tabName">未处理</text>
<text class="feedback-tabCount">16</text>
<text class="feedback-tabCount">{{list1.length}}</text>
</view>
<view class="feedback-tabItem">
<view bind:tap="toggleList" data-tabIndex="{{2}}" class="feedback-tabItem {{tabIndex===2?'checked':''}}">
<text class="feedback-tabName">进行中</text>
<text class="feedback-tabCount">5</text>
<text class="feedback-tabCount">{{list2.length}}</text>
</view>
</view>
<view class="feedback-list">
<feedback-item feedback-data="{{userdata}}" />
<view wx:if="{{tabIndex===1}}" class="feedback-list">
<feedback-item wx:for="{{list1}}" wx:key="{{item.id}}" feedback-data="{{item}}" bind:refresh="refreshHandle" />
</view>
<view wx:elif="{{tabIndex===2}}" class="feedback-list">
<feedback-item wx:for="{{list2}}" wx:key="{{item.id}}" feedback-data="{{item}}" bind:refresh="refreshHandle" />
</view>
</view>
\ No newline at end of file
......@@ -3,8 +3,9 @@ import { formatTime } from '../../utils/util';
// miniprogram/pages/home/home.js
Component({
pageLifetimes: {
show() {
lifetimes: {
attached() {
console.log('in show ', this.data.fetched);
!this.data.fetched && this.fetchRechargeData();
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
......@@ -19,6 +20,7 @@ Component({
data: {
timeType: 0,
fetched: false,
serviceList: [],
rechargeData: {
title: '充值总额',
numberType: 'price',
......@@ -87,7 +89,9 @@ Component({
if (!timeType) timeType = this.data.timeType;
const today = formatTime(new Date());
let date = today.split(' ')[0];
let entity = {};
let entity = {
timeType,
};
if (timeType === 0) {
entity.date = date;
} else if (timeType === 1) {
......@@ -96,36 +100,73 @@ Component({
entity.year = date.slice(0, 4);
}
wx.showLoading({ title: '' });
statisticsFetch({
let rechargeDataFetch = statisticsFetch({
url: '/dcxy/reportInfo/queryRechargeOrderListV2',
method: 'POST',
data: entity,
})
.then(res => {
}).then(res => {
const data = res.rechargeOrderCountVo;
if (data) {
const {
rechargeMen,
rechargeMoney,
refundCount,
refundMoney,
offlineRechargeMen,
offlineRechargeMoney,
onlineRechargeMen,
onlineRechargeMoney,
} = data;
this.setData({
'rechargeData.count': rechargeMoney,
'rechargeCount.count': rechargeMen,
'refundData.count': refundMoney,
'refundCount.count': refundCount,
'onlineRechargeData.price': onlineRechargeMoney,
'onlineRechargeData.count': onlineRechargeMen,
'offlineRechargeData.price': offlineRechargeMoney,
'offlineRechargeData.count': offlineRechargeMen,
});
} else {
this.setData({
'rechargeData.count': 0,
'rechargeCount.count': 0,
'refundData.count': 0,
'refundCount.count': 0,
'onlineRechargeData.price': 0,
'onlineRechargeData.count': 0,
'offlineRechargeData.price': 0,
'offlineRechargeData.count': 0,
});
}
});
let consumeDataFetch = statisticsFetch({
url: '/dcxy/reportInfo/queryConsumeOrderList',
method: 'POST',
data: entity,
}).then(res => {
const { consumeCountVo, data } = res;
console.log(res);
this.setData({
serviceList: data.map(item => ({
serviceId: item.serviceId,
title: item.serviceName,
numberType: '1',
count: item.payMen,
price: item.payableMoney,
})),
'comsumerData.count':
consumeCountVo && consumeCountVo.payableMoney
? consumeCountVo.payableMoney
: 0,
'comsumerCount.count':
consumeCountVo && consumeCountVo.payMen ? consumeCountVo.payMen : 0,
});
});
Promise.all([consumeDataFetch, rechargeDataFetch])
.then(() => {
wx.hideLoading();
const data = res.rechargeOrderCountVo;
if (data) {
const {
rechargeMen,
rechargeMoney,
refundCount,
refundMoney,
offlineRechargeMen,
offlineRechargeMoney,
onlineRechargeMen,
onlineRechargeMoney,
} = data;
this.setData({
'rechargeData.count': rechargeMoney,
'rechargeCount.count': rechargeMen,
'refundData.count': refundMoney,
'refundCount.count': refundCount,
'onlineRechargeData.price': onlineRechargeMoney,
'onlineRechargeData.count': onlineRechargeMen,
'offlineRechargeData.price': offlineRechargeMoney,
'offlineRechargeData.count': offlineRechargeMen,
});
}
})
.catch((err: wx.GeneralCallbackResult) => {
wx.hideLoading();
......
......@@ -28,12 +28,7 @@
<price-and-count tag-data="{{comsumerData}}" />
<price-and-count tag-data="{{comsumerCount}}" />
<view class="padding"></view>
<service-count tag-data="{{testData2}}" />
<service-count tag-data="{{testData2}}" />
</view>
<view class="home-box">
<service-count tag-data="{{testData2}}" />
<service-count tag-data="{{testData2}}" />
<service-count wx:for="{{serviceList}}" wx:key="{{item.serviceId}}" tag-data="{{item}}" />
</view>
<view class="home-box">
<price-and-count tag-data="{{refundData}}" />
......
/* miniprogram/pages/home.wxss */
.home {
padding: 20rpx 0 96rpx;
}
.home-title {
display: flex;
justify-content: space-between;
......@@ -7,9 +9,11 @@
width: 100%;
padding: 0 40rpx 30rpx;
line-height: 40rpx;
border-bottom: 1px solid #efeff4;
}
.home-title-type, .title-type-item {
.home-title-type,
.title-type-item {
display: flex;
align-items: center;
}
......@@ -41,10 +45,10 @@
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
border-top: 1px solid #efeff4;
justify-content: space-between;
/* border-top: 1px solid #efeff4; */
width: 100%;
padding: 40rpx 48rpx;
padding: 40rpx 48rpx 20rpx;
}
.home-box:last-child {
......
"use strict";
Page({
data: {
userInfo: {},
selected: 0,
list: [
{
......@@ -25,4 +26,4 @@ Page({
});
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9tZUFuZFJlcG9ydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImhvbWVBbmRSZXBvcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQUksQ0FBQztJQUNILElBQUksRUFBRTtRQUNKLFFBQVEsRUFBRSxDQUFDO1FBQ1gsSUFBSSxFQUFFO1lBQ0o7Z0JBQ0UsUUFBUSxFQUFFLGtCQUFrQjtnQkFDNUIsUUFBUSx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AgIHNlbGVjdGVkOiBpbmRleCxcbiAgICB9KTtcbiAgfSxcbn0pO1xuIl19
\ No newline at end of file
Page({
data: {
userInfo: {},
selected: 0,
list: [
{
......@@ -17,7 +18,7 @@ Page({
],
},
clickHandle(e) {
console.log('in click', e)
console.log('in click', e);
let { path, index } = e.detail;
// console.log(path, index);
// wx.switchTab({ url: path });
......@@ -25,4 +26,4 @@ Page({
selected: index,
});
},
})
\ No newline at end of file
});
<!--miniprogram/pages/homeAndReport/homeAndReport.wxml-->
<!-- miniprogram/pages/homeAndReport/homeAndReport.wxml -->
<view class="container">
<home wx:if="{{selected === 0}}" />
<report wx:elif="{{selected === 1}}" />
<report wx:elif="{{selected === 1}}" userInfo="{{userInfo}}" />
<tab-bar checked="{{selected}}" listData="{{list}}" bindcustomevent="clickHandle"></tab-bar>
</view>
\ No newline at end of file
//index.js
import { systemFetch } from '../../api/fetch';
import md5 from 'blueimp-md5';
const md5 = require('blueimp-md5');
//获取应用实例
import { IMyApp } from '../../app';
const app = getApp<IMyApp>();
Page({
onLoad() {
if (app.globalData.token) {
this.tokenLoagin();
}
},
data: {
account: '',
pwd: '',
......@@ -32,10 +37,57 @@ Page({
}
return true;
},
tokenLoagin() {
wx.showLoading({ title: '登陆中' });
systemFetch({
url: '/login/verifyCode',
})
.then((res: wx.RequestSuccessCallbackResult) => {
console.log(res);
return {
code: res.data.verifyCode,
cookie: res.header['Set-Cookie'],
};
})
.then(({ cookie }: { code: string; cookie: string }) =>
systemFetch({
url: '/login',
method: 'POST',
header: {
cookie: cookie,
},
data: {
token: app.globalData.token,
},
}),
)
.then(res => {
console.log(res);
const {
data: { userInfo, userRoles },
} = res;
app.globalData.userInfo = userInfo;
app.globalData.userRoles = userRoles;
wx.hideLoading();
wx.redirectTo({
url: '/pages/homeAndReport/homeAndReport',
});
})
.catch(err => {
console.log(err);
wx.hideLoading();
wx.showToast({
title: err.errMsg,
icon: 'none',
});
});
},
loginHandle() {
console.log(app.globalData);
if (this.validateLoginData()) {
const { account, pwd } = this.data;
console.log(account, pwd);
wx.showLoading({ title: '' });
systemFetch({
url: '/login/verifyCode',
})
......@@ -46,8 +98,9 @@ Page({
cookie: res.header['Set-Cookie'],
};
})
.then(({ code, cookie }: { code: string; cookie: string }) =>
systemFetch({
.then(({ code, cookie }: { code: string; cookie: string }) => {
let mixpwd = md5(pwd);
return systemFetch({
url: '/login',
method: 'POST',
header: {
......@@ -55,16 +108,35 @@ Page({
},
data: {
account,
pwd: md5(pwd),
pwd: mixpwd,
varifyCode: code,
},
}),
)
});
})
.then(res => {
console.log(res);
const {
token,
data: { userInfo, userRoles },
} = res;
app.globalData.token = token;
app.globalData.userInfo = userInfo;
app.globalData.userRoles = userRoles;
try {
wx.setStorageSync('token', token);
} catch (error) {}
wx.hideLoading();
wx.redirectTo({
url: '/pages/homeAndReport/homeAndReport',
});
})
.catch(err => {
console.log(err);
wx.hideLoading();
wx.showToast({
title: err.errMsg,
icon: 'none',
});
});
}
// fetch()
......@@ -85,5 +157,4 @@ Page({
[key]: value,
});
},
onLoad() {},
});
{
"navigationBarTitleText": "月度运营分析",
"usingComponents": {
"ff-canvas": "@antv/f2-canvas",
"c-select": "../components/Select/Select",
"recharge-chart": "../components/RechargeChart/RechargeChart",
"refund-chart": "../components/RefundChart/RefundChart",
"consume-chart": "../components/ConsumeChart/ConsumeChart",
"consume-count-chart": "../components/ConsumeCountChart/ConsumeCountChart",
"service-type-chart": "../components/ServiceTypeChart/ServiceTypeChart",
"pay-type-chart": "../components/PayTypeChart/PayTypeChart",
"price-and-count": "../components/PriceAndCount/PriceAndCount"
}
}
\ No newline at end of file
}
let chart = null;
function initChart(canvas, width, height, F2) {
const data = [
{ year: '1951 年', sales: 38 },
{ year: '1952 年', sales: 52 },
{ year: '1956 年', sales: 61 },
{ year: '1957 年', sales: 145 },
{ year: '1958 年', sales: 48 },
{ year: '1959 年', sales: 38 },
{ year: '1960 年', sales: 38 },
{ year: '1962 年', sales: 38 },
];
chart = new F2.Chart({
el: canvas,
width,
height
});
chart.source(data, {
sales: {
tickCount: 5
}
});
chart.tooltip({
showItemMarker: false,
onShow(ev) {
const { items } = ev;
items[0].name = null;
items[0].name = items[0].title;
items[0].value = '¥ ' + items[0].value;
}
});
chart.interval().position('year*sales');
chart.axis('sales',false)
chart.render();
return chart;
}
import { baseFetch, statisticsFetch } from '../../api/fetch';
import { formatTime } from '../../utils/util';
Page({
onLoad() {
this.initData();
this.fetchAreaList();
},
data: {
opts: {
onInit: initChart
},
areaList: [],
month: '',
areaId: 0,
rechargeData: {
title: '充值总额',
numberType: 'price',
count: 12000,
count: 0,
},
rechargeCount: {
title: '充值笔数',
numberType: '',
count: 12000,
count: 0,
},
rechargeAndRefundList: [],
consumeData: {
title: '消费总额',
numberType: 'price',
count: 0,
},
consumeCount: {
title: '消费笔数',
numberType: '',
count: 0,
},
}
consumeList: [],
serviceTypeList: [],
payTypeList: [],
},
initData() {
let time = formatTime(new Date());
console.log(time);
this.setData!({ month: time.slice(0, 7) }, () => {
this.fetchList();
});
},
fetchAreaList() {
baseFetch({
url: '/dcxy/baseArea/queryAll',
})
.then(res => {
if (res.data) {
this.setData!({
areaList: res.data,
});
} else {
this.setData!({
areaList: [],
});
}
})
.catch(err => {
console.log(err);
});
},
areaChangeHandle(val) {
console.log('areaChangeHandle', val);
const { value } = val.detail;
this.fetchList({ areaId: [value] });
},
fetchList(entity?: { areaId?: number; month?: string }) {
this.fetchRechargeData(entity);
this.fetchConsumeData(entity);
this.fetchServiceTypeList(entity);
this.fetchPayTypeList(entity);
},
fetchConsumeData(entity?: { areaId?: number; month?: string }) {
let reqBody = {
month: this.data.month,
...entity,
};
if (this.data.areaId) reqBody.areaId = this.data.areaId;
statisticsFetch({
url: '/dcxy/reportInfo/dailyConsumeCount',
method: 'POST',
data: reqBody,
})
.then(res => {
let dayList = new Array(31)
.fill({
payMen: 0,
payableMoney: 0,
})
.map((v, idx) => ({ ...v, days: idx + 1 }));
let consumePrice = 0;
let consumeCount = 0;
if (res.data && res.data.length) {
let oList = res.data;
for (let index = 0; index < oList.length; index++) {
const element = oList[index];
consumePrice += element.payableMoney;
consumeCount += element.payMen;
let daysIndex = element.createDate.slice(-2);
dayList[daysIndex] = {
...dayList[daysIndex],
payMen: element.payMen,
payableMoney: element.payableMoney,
};
}
}
this.setData!({
consumeList: dayList,
'consumeData.count': consumePrice,
'consumeCount.count': consumeCount,
});
})
.catch(err => {
console.log(err);
});
},
fetchRechargeData(entity?: { areaId?: number; month?: string }) {
let reqBody = {
month: this.data.month,
...entity,
};
if (this.data.areaId) reqBody.areaId = this.data.areaId;
statisticsFetch({
url: '/dcxy/reportInfo/queryRechargeListDaily',
method: 'POST',
data: reqBody,
})
.then(res => {
let dayList = new Array(31)
.fill({
rechargeMoney: 0,
rechargeMen: 0,
refundCount: 0,
refundMoney: 0,
})
.map((v, idx) => ({ ...v, days: idx + 1 }));
let rechargePrice = 0;
let rechargeCount = 0;
if (res.data && res.data.length) {
let oList = res.data;
for (let index = 0; index < oList.length; index++) {
const element = oList[index];
rechargePrice += element.rechargeMoney;
rechargeCount += element.rechargeMen;
let daysIndex = element.completeAt.slice(-2);
dayList[daysIndex] = {
...dayList[daysIndex],
rechargeMoney: element.rechargeMoney,
rechargeMen: element.rechargeMen,
refundCount: element.refundCount,
refundMoney: element.refundMoney,
};
}
}
this.setData!({
rechargeAndRefundList: dayList,
'rechargeData.count': rechargePrice,
'rechargeCount.count': rechargeCount,
});
})
.catch(err => {
console.log(err);
});
},
fetchServiceTypeList(entity) {
let reqBody = {
month: this.data.month,
...entity,
};
if (this.data.areaId) reqBody.areaId = this.data.areaId;
statisticsFetch({
url: '/dcxy/reportInfo/serviceConsume',
method: 'POST',
data: reqBody,
})
.then(res => {
console.log(res);
this.setData!({
serviceTypeList: res.data,
});
})
.catch(err => {
console.log(err);
});
},
fetchPayTypeList(entity) {
let reqBody = {
month: this.data.month,
...entity,
};
if (this.data.areaId) reqBody.areaId = this.data.areaId;
statisticsFetch({
url: '/dcxy/reportInfo/payTypeConsume',
method: 'POST',
data: reqBody,
})
.then(res => {
console.log(res);
if (res.data) {
const keyMap = {
aimi: '艾米豆',
bean: '消费豆',
discount: '优惠金额',
online: '线上支付',
};
let dataList = Object.keys(res.data).map(key => ({
key,
a: '1',
name: keyMap[key],
count: res.data[key],
}));
this.setData!({
payTypeList: dataList,
});
}
})
.catch(err => {
console.log(err);
});
},
});
<!--miniprogram/pages/monthOperator/monthOperator.wxml-->
<!-- miniprogram/pages/monthOperator/monthOperator.wxml -->
<view class="monthOperator">
<view class="monthOperator-filter">
<view class="monthOperator-area">
<c-select mode="selector" range="{{areaList}}" range-key="{{'areaName'}}" bindchange="areaChangeHandle" placeholder="所属区域选择" />
</view>
<view class="monthOperator-time">
<c-select mode="date" fields="month" value="{{month}}" bindchange="bindPickerChange" />
</view>
</view>
<view class="monthOperator-block">
<view class="monthOperator-title">
<view class="monthOperator-title-color recharge"></view>
......@@ -10,7 +18,7 @@
<price-and-count tag-data="{{rechargeCount}}" />
</view>
<view class="monthOperator-canvas">
<ff-canvas id="column-dom" canvas-id="column" opts="{{ opts }}" />
<recharge-chart dataList="{{rechargeAndRefundList}}" month="{{month}}" />
</view>
</view>
<view class="monthOperator-block">
......@@ -19,27 +27,27 @@
<view class="monthOperator-title-text">消费趋势</view>
</view>
<view class="monthOperator-data">
<price-and-count tag-data="{{rechargeData}}" />
<price-and-count tag-data="{{rechargeCount}}" />
<price-and-count tag-data="{{consumeData}}" />
<price-and-count tag-data="{{consumeCount}}" />
</view>
<view class="monthOperator-canvas">
<consume-chart dataList="{{consumeList}}" month="{{month}}" />
</view>
</view>
<view class="monthOperator-block">
<view class="monthOperator-title">
<view class="monthOperator-title-text">消费服务分类</view>
</view>
<view class="monthOperator-canvas">
<view class="monthOperator-canvas autoheight">
<service-type-chart dataList="{{serviceTypeList}}" />
</view>
</view>
<view class="monthOperator-block">
<view class="monthOperator-title">
<view class="monthOperator-title-text">消费服务分类</view>
<view class="monthOperator-title-text">消费方式分类</view>
</view>
<view class="monthOperator-canvas">
<pay-type-chart dataList="{{payTypeList}}" />
</view>
</view>
<view class="monthOperator-block">
......@@ -47,7 +55,7 @@
<view class="monthOperator-title-text">消费时间分布</view>
</view>
<view class="monthOperator-canvas">
<consume-count-chart dataList="{{consumeList}}" month="{{month}}" />
</view>
</view>
<view class="monthOperator-block">
......@@ -56,7 +64,7 @@
<view class="monthOperator-title-text">退款趋势</view>
</view>
<view class="monthOperator-canvas">
<refund-chart dataList="{{rechargeAndRefundList}}" month="{{month}}" />
</view>
</view>
</view>
\ No newline at end of file
/* miniprogram/pages/monthOperator/monthOperator.wxss */
.monthOperator-filter {
padding: 20rpx 40rpx 0;
display: flex;
justify-content: space-between;
}
.monthOperator-area {
flex: 1;
}
.monthOperator-time {
width: 250rpx;
margin-left: 20rpx;
}
.monthOperator-block {
padding: 0 40rpx;
border-bottom: 8rpx solid #eef3fc;
......@@ -44,3 +55,6 @@
width: 660rpx;
height: 350rpx;
}
.monthOperator-canvas.autoheight{
height: auto;
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var app = getApp();
Component({
pageLifetimes: {
show: function () {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
selected: 1
selected: 1,
});
}
}
},
},
lifetimes: {
attached: function () {
console.log(app.globalData.userInfo);
this.setData({
userInfo: app.globalData.userInfo,
});
},
},
data: {
userInfo: app.globalData.userInfo,
itemList: [
{
name: '月度运营分析',
......@@ -51,4 +61,4 @@ Component({
],
},
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsicmVwb3J0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQSxTQUFTLENBQUM7SUFDUixhQUFhLEVBQUU7UUFDYixJQUFJO1lBQ0YsRUFBRSxDQU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gICAgaWNvbjogJy4uLy4uLy4uL2ltYWdlcy9idG5fZnNua3VpQDJ4LnBuZycsXG4gICAgICAgIHVybDogJy9wYWdlcy9mZWVkYmFjay9mZWVkYmFjaycsXG4gICAgICAgIHJlTGF1bmNoOiBmYWxzZSxcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIG5hbWU6ICfmnI3liqHotLnnvLTnurMnLFxuICAgICAgICBpY29uOiAnLi4vLi4vLi4vaW1hZ2VzL2J0bl9qaWFvbmFAMngucG5nJyxcbiAgICAgICAgdXJsOiAnJyxcbiAgICAgICAgcmVMYXVuY2g6IGZhbHNlLFxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgbmFtZTogJ+i0puaIt+aPkOeOsCcsXG4gICAgICAgIGljb246ICcuLi8uLi8uLi9pbWFnZXMvYnRuX3RpeGlhbkAyeC5wbmcnLFxuICAgICAgICB1cmw6ICcnLFxuICAgICAgICByZUxhdW5jaDogZmFsc2UsXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICBuYW1lOiAn6YCA5Ye655m75b2VJyxcbiAgICAgICAgaWNvbjogJy4uLy4uLy4uL2ltYWdlcy9idG5fU2lnbiBvdXRAMngucG5nJyxcbiAgICAgICAgdXJsOiAnL3BhZ2VzL2luZGV4L2luZGV4JyxcbiAgICAgICAgcmVMYXVuY2g6IHRydWUsXG4gICAgICB9LFxuICAgIF0sXG4gIH0sXG59KTtcbiJdfQ==
\ No newline at end of file
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsicmVwb3J0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBR0EsSUFBTSxHQUFHLEdBQUcsTUFBTSxFQUFVLENBQUM7QUFDN0IsU0FBUyxDQUFDO0lBQ1IsYUFBYSxFQUFFO1FBQ2IsSUFBSTtZQUNGLEVBQUUsQ0FBQyxDQUFDLE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DpobXpnaLnmoTliJ3lp4vmlbDmja5cbiAgICovXG4gIGRhdGE6IHtcbiAgICB1c2VySW5mbzogYXBwLmdsb2JhbERhdGEudXNlckluZm8sXG4gICAgaXRlbUxpc3Q6IFtcbiAgICAgIHtcbiAgICAgICAgbmFtZTogJ+aciOW6pui/kOiQpeWIhuaekCcsXG4gICAgICAgIGljb246ICcuLi8uLi8uLi9pbWFnZXMvYnRuX3l1ZWR1QDJ4LnBuZycsXG4gICAgICAgIHVybDogJy9wYWdlcy9tb250aE9wZXJhdG9yL21vbnRoT3BlcmF0b3InLFxuICAgICAgICByZUxhdW5jaDogZmFsc2UsXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICBuYW1lOiAn55So5oi35aKe6ZW/5YiG5p6QJyxcbiAgICAgICAgaWNvbjogJy4uLy4uLy4uL2ltYWdlcy9idG5feW9uZ2h1QDJ4LnBuZycsXG4gICAgICAgIHVybDogJy9wYWdlcy9tb250aE9wZXJhdG9yL21vbnRoT3BlcmF0b3InLFxuICAgICAgICByZUxhdW5jaDogZmFsc2UsXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICBuYW1lOiAn5Lya5ZGY5Y+N6aaIJyxcbiAgICAgICAgaWNvbjogJy4uLy4uLy4uL2ltYWdlcy9idG5fZnNua3VpQDJ4LnBuZycsXG4gICAgICAgIHVybDogJy9wYWdlcy9mZWVkYmFjay9mZWVkYmFjaycsXG4gICAgICAgIHJlTGF1bmNoOiBmYWxzZSxcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIG5hbWU6ICfmnI3liqHotLnnvLTnurMnLFxuICAgICAgICBpY29uOiAnLi4vLi4vLi4vaW1hZ2VzL2J0bl9qaWFvbmFAMngucG5nJyxcbiAgICAgICAgdXJsOiAnJyxcbiAgICAgICAgcmVMYXVuY2g6IGZhbHNlLFxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAgbmFtZTogJ+i0puaIt+aPkOeOsCcsXG4gICAgICAgIGljb246ICcuLi8uLi8uLi9pbWFnZXMvYnRuX3RpeGlhbkAyeC5wbmcnLFxuICAgICAgICB1cmw6ICcnLFxuICAgICAgICByZUxhdW5jaDogZmFsc2UsXG4gICAgICB9LFxuICAgICAge1xuICAgICAgICBuYW1lOiAn6YCA5Ye655m75b2VJyxcbiAgICAgICAgaWNvbjogJy4uLy4uLy4uL2ltYWdlcy9idG5fU2lnbiBvdXRAMngucG5nJyxcbiAgICAgICAgdXJsOiAnL3BhZ2VzL2luZGV4L2luZGV4JyxcbiAgICAgICAgcmVMYXVuY2g6IHRydWUsXG4gICAgICB9LFxuICAgIF0sXG4gIH0sXG59KTtcbiJdfQ==
\ No newline at end of file
import { IMyApp } from '../../app';
// miniprogram/pages/report/report.js
const app = getApp<IMyApp>();
Component({
pageLifetimes: {
show() {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
selected: 1
})
selected: 1,
});
}
}
},
},
lifetimes: {
attached() {
console.log(app.globalData.userInfo);
this.setData!({
userInfo: app.globalData.userInfo,
});
},
},
/**
* 页面的初始数据
*/
data: {
userInfo: app.globalData.userInfo,
itemList: [
{
name: '月度运营分析',
......
......@@ -4,10 +4,10 @@
<view class="report-header-user">
<view class="report-header-userInfo">
<view class="report-header-userName">
saddas
{{userInfo.name}}
</view>
<view class="report-header-userAccount">
124235345
{{userInfo.cellphone}}
</view>
</view>
<view class="report-header-userImg">
......
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var fetch_1 = require("../../api/fetch");
var util_1 = require("../../utils/util");
Page({
onLoad: function () {
this.initData();
this.fetchAreaList();
},
data: {
month: '',
areaId: 0,
areaList: [],
growthList: [],
customerCount: 0,
activeCount: 0,
},
initData: function () {
var _this = this;
var time = util_1.formatTime(new Date());
console.log(time);
this.setData({ month: time.slice(0, 7) }, function () {
_this.fetchList();
});
},
fetchAreaList: function () {
var _this = this;
fetch_1.baseFetch({
url: '/dcxy/baseArea/queryAll',
})
.then(function (res) {
if (res.data) {
_this.setData({
areaList: res.data,
});
}
else {
_this.setData({
areaList: [],
});
}
})
.catch(function (err) {
console.log(err);
});
},
fetchList: function (entity) {
this.fetchUserData(entity);
},
fetchUserData: function (entity) {
var _this = this;
var reqBody = __assign({ year: this.data.month.slice(0, 4), isAdmin: 1 }, entity);
if (this.data.areaId)
reqBody.areaId = this.data.areaId;
fetch_1.statisticsFetch({
url: '/dcxy/reportInfo/queryReportList',
data: reqBody,
})
.then(function (res) {
console.log(res);
var _a = res.data, customerCount = _a.customerCount, dayVos = _a.dayVos, activeCount = _a.activeCount;
var dayList = new Array(31)
.fill({
count: 0,
})
.map(function (v, idx) { return (__assign({}, v, { days: idx + 1 })); });
if (dayVos && dayVos.length) {
var oList = dayVos;
for (var index = 0; index < oList.length; index++) {
var element = oList[index];
var daysIndex = element.completeAt.slice(-2);
dayList[daysIndex] = __assign({}, dayList[daysIndex], { count: element.count });
}
}
console.log('dayList:', dayList);
_this.setData({
growthList: dayList,
customerCount: customerCount ? customerCount : 0,
activeCount: activeCount ? activeCount : 0,
});
})
.catch(function (err) {
console.log(err);
});
},
areaChangeHandle: function () { },
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlckdyb3d0aC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInVzZXJHcm93dGgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLHlDQUE2RDtBQUM3RCx5Q0FBOEM7QUFHOUMsSUFBSSxDQUFDO0lBQ0gsTUFBTTtRQUNKLElBQUksQ0FBQyxRQUFRLEVBQUUsQ0FBQztRQUNoQixJQUFJLENBQUMsYUFBYSxFQUFFLENBQUM7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gICAgICAgICAubWFwKCh2LCBpZHgpID0+ICh7IC4uLnYsIGRheXM6IGlkeCArIDEgfSkpO1xuXG4gICAgICAgIGlmIChkYXlWb3MgJiYgZGF5Vm9zLmxlbmd0aCkge1xuICAgICAgICAgIGxldCBvTGlzdCA9IGRheVZvcztcbiAgICAgICAgICBmb3IgKGxldCBpbmRleCA9IDA7IGluZGV4IDwgb0xpc3QubGVuZ3RoOyBpbmRleCsrKSB7XG4gICAgICAgICAgICBjb25zdCBlbGVtZW50ID0gb0xpc3RbaW5kZXhdO1xuICAgICAgICAgICAgbGV0IGRheXNJbmRleCA9IGVsZW1lbnQuY29tcGxldGVBdC5zbGljZSgtMik7XG4gICAgICAgICAgICBkYXlMaXN0W2RheXNJbmRleF0gPSB7XG4gICAgICAgICAgICAgIC4uLmRheUxpc3RbZGF5c0luZGV4XSxcbiAgICAgICAgICAgICAgY291bnQ6IGVsZW1lbnQuY291bnQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjb25zb2xlLmxvZygnZGF5TGlzdDonLCBkYXlMaXN0KTtcbiAgICAgICAgdGhpcy5zZXREYXRhISh7XG4gICAgICAgICAgZ3Jvd3RoTGlzdDogZGF5TGlzdCxcbiAgICAgICAgICBjdXN0b21lckNvdW50OiBjdXN0b21lckNvdW50ID8gY3VzdG9tZXJDb3VudCA6IDAsXG4gICAgICAgICAgYWN0aXZlQ291bnQ6IGFjdGl2ZUNvdW50ID8gYWN0aXZlQ291bnQgOiAwLFxuICAgICAgICB9KTtcbiAgICAgIH0pXG4gICAgICAuY2F0Y2goZXJyID0+IHtcbiAgICAgICAgY29uc29sZS5sb2coZXJyKTtcbiAgICAgIH0pO1xuICB9LFxuICBhcmVhQ2hhbmdlSGFuZGxlKCkge30sXG59KTtcbiJdfQ==
\ No newline at end of file
{
"navigationBarTitleText": "用户增长报表",
"usingComponents": {
"user-grouth-chart": "../components/UserGrouthChart/UserGrouthChart",
"user-activity-chart": "../components/UserActivityChart/UserActivityChart",
"c-select": "../components/Select/Select"
}
}
import { baseFetch, statisticsFetch } from '../../api/fetch';
import { formatTime } from '../../utils/util';
// miniprogram/pages/userGrowth/userGrowth.js
Page({
onLoad() {
this.initData();
this.fetchAreaList();
},
/**
* 页面的初始数据
*/
data: {
month: '',
areaId: 0,
areaList: [],
growthList: [],
customerCount: 0,
activeCount: 0,
},
initData() {
let time = formatTime(new Date());
console.log(time);
this.setData!({ month: time.slice(0, 7) }, () => {
this.fetchList();
});
},
fetchAreaList() {
baseFetch({
url: '/dcxy/baseArea/queryAll',
})
.then(res => {
if (res.data) {
this.setData!({
areaList: res.data,
});
} else {
this.setData!({
areaList: [],
});
}
})
.catch(err => {
console.log(err);
});
},
fetchList(entity?: { areaId?: number; month?: string }) {
this.fetchUserData(entity);
},
fetchUserData(entity) {
let reqBody = {
year: this.data.month.slice(0, 4),
isAdmin: 1,
...entity,
};
if (this.data.areaId) reqBody.areaId = this.data.areaId;
statisticsFetch({
url: '/dcxy/reportInfo/queryReportList',
data: reqBody,
})
.then(res => {
console.log(res);
const { customerCount, dayVos, activeCount } = res.data;
let dayList = new Array(31)
.fill({
count: 0,
})
.map((v, idx) => ({ ...v, days: idx + 1 }));
if (dayVos && dayVos.length) {
let oList = dayVos;
for (let index = 0; index < oList.length; index++) {
const element = oList[index];
let daysIndex = element.completeAt.slice(-2);
dayList[daysIndex] = {
...dayList[daysIndex],
count: element.count,
};
}
}
console.log('dayList:', dayList);
this.setData!({
growthList: dayList,
customerCount: customerCount ? customerCount : 0,
activeCount: activeCount ? activeCount : 0,
});
})
.catch(err => {
console.log(err);
});
},
areaChangeHandle() {},
});
<!-- miniprogram/pages/userGrowth/userGrowth.wxml -->
<view class="container userGrowth">
<view class="userGrowth-topBox">
<view class="userGrowth-titleItem">
<view class="userGrowth-titleName">注册人数</view>
<view class="userGrowth-titleValue">123412</view>
</view>
<view class="userGrowth-titleItem">
<view class="userGrowth-titleName">活跃人数</view>
<view class="userGrowth-titleValue">{{activeCount}}</view>
</view>
<view class="userGrowth-titleItem">
<view class="userGrowth-titleName">总用户数</view>
<view class="userGrowth-titleValue">{{customerCount}}</view>
</view>
</view>
<view class="userGrowth-filter">
<view class="userGrowth-area">
<c-select mode="selector" range="{{areaList}}" range-key="{{'areaName'}}" bindchange="areaChangeHandle" placeholder="所属区域选择" />
</view>
<view class="userGrowth-time">
<c-select mode="date" fields="month" value="{{month}}" bindchange="bindPickerChange" />
</view>
</view>
<view class="userGrowth-block">
<view class="userGrowth-title">
<view class="userGrowth-title-color user"></view>
<view class="userGrowth-title-text">新增用户</view>
</view>
<view class="userGrowth-canvas">
<user-grouth-chart dataList="{{growthList}}" month="{{month}}" />
</view>
</view>
<view class="userGrowth-block">
<view class="userGrowth-title">
<view class="userGrowth-title-color user"></view>
<view class="userGrowth-title-text">用户活跃</view>
</view>
<view class="userGrowth-canvas">
<user-activity-chart dataList="{{growthList}}" month="{{month}}" />
</view>
</view>
</view>
\ No newline at end of file
/* miniprogram/pages/userGrowth/userGrowth.wxss */
.userGrowth-topBox {
padding: 20rpx 0 0;
width: 100%;
display: flex;
justify-content: space-around;
}
.userGrowth-titleItem {
text-align: center;
font-size: 24rpx;
}
.userGrowth-titleValue {
font-size: 40rpx;
}
.userGrowth-filter {
display: flex;
box-sizing: border-box;
width: 100%;
padding: 50rpx 40rpx 0;
justify-content: space-between;
}
.userGrowth-area {
flex: 1;
}
.userGrowth-time {
width: 250rpx;
margin-left: 20rpx;
}
.userGrowth-block {
box-sizing: border-box;
width: 100%;
padding: 0 40rpx;
}
.userGrowth-title {
width: 100%;
display: flex;
align-items: center;
padding: 50rpx 0 20rpx;
}
.userGrowth-title-color {
width: 12rpx;
height: 12rpx;
margin-right: 12rpx;
border-radius: 50%;
}
.userGrowth-title-color.user {
background-color: #6895ef;
}
.userGrowth-canvas {
width: 660rpx;
height: 350rpx;
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var minii_1 = require("minii");
var UserStore = (function () {
function UserStore() {
this.token = '123';
}
UserStore.prototype.getUserInfo = function (data) {
this.token = data.token;
};
return UserStore;
}());
exports.default = minii_1.observe(new UserStore(), 'user');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInVzZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFFQSwrQkFBK0I7QUFFL0I7SUFDRTtRQUNFLElBQUksQ0FBQyxLQUFLLEdBQUcsS0FBSyxDQUFBO0lBQ3BCLENBQUM7SUFFRCwrQkFBVyxHQUFYLFVBQVksSUFBSTtRQUNkLElBQUksQ0FBQyxLQUFLLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQTtJQUN6QixDQUFDO0lBR0gsZ0JBQUM7QUFBRCxDQUFDLEFBVkQsSUFVQztBQUlELGtCQUFlLGVBQU8sQ0FBQyxJQUFJLFNBQVMsRUFBRSxFQUFFLE1BQU0sQ0FBQyxDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiLy8gc3RvcmVzL3VzZXIuanNcblxuaW1wb3J0IHsgb2JzZXJ2ZSB9IGZyb20gJ21pbmlpJ1xuXG5jbGFzcyBVc2VyU3RvcmUge1xuICBjb25zdHJ1Y3RvcigpIHtcbiAgICB0aGlzLnRva2VuID0gJzEyMydcbiAgfVxuXG4gIGdldFVzZXJJbmZvKGRhdGEpIHtcbiAgICB0aGlzLnRva2VuID0gZGF0YS50b2tlblxuICB9XG5cblxufVxuXG4vLyDnrKzkuozkuKrlj4LmlbAndXNlcifkvJrlsIblvZPliY1zdG9yZeeahOaJgOacieWGhemDqOWPmOmHj+e7keWumuWcqOWFqOWxgOWPmOmHj+eahHVzZXLlsZ7mgKfkuIpcbi8vIOWmguaenOesrOS6jOS4quWPguaVsOayoeacieWGme+8jOS8mum7mOiupOS9v+eUqOivpWNsYXNz5ZCN5a2X55qE5YWo5bCP5YaZXG5leHBvcnQgZGVmYXVsdCBvYnNlcnZlKG5ldyBVc2VyU3RvcmUoKSwgJ3VzZXInKSJdfQ==
\ No newline at end of file
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInVzZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8vIHN0b3Jlcy91c2VyLmpzXG5cbmV4cG9ydCB0eXBlIFVzZXJpbmZvID0ge1xuICBjZWxscGhvbmU6IHN0cmluZztcbiAgY29tbWVudDogc3RyaW5nO1xuICBjcmVhdGVBdDogc3RyaW5nO1xuICBpZDogbnVtYmVyO1xuICBpc09wZW5PcGVyTG9nOiBudW1iZXI7XG4gIGlzU2V0UGFzc3dvcmQ6IG51bWJlcjtcbiAgbGFzdExvZ2luRGF0ZTogc3RyaW5nO1xuICBsb2dpbkFjY291bnQ6IHN0cmluZztcbiAgbG9naW5Db3VudDogbnVtYmVyO1xuICBuYW1lOiBzdHJpbmc7XG4gIG9wZXJhdGVJZDogbnVtYmVyO1xuICBvcGVyYXRlTmFtZTogc3RyaW5nO1xuICBzdGF0ZTogc3RyaW5nO1xuICB1cGRhdGVBdDogc3RyaW5nO1xufTtcblxuZXhwb3J0IHR5cGUgVXNlclJvbGUgPSB7XG4gIGNoaWxkczogVXNlclJvbGVbXTtcbiAgaWQ6IG51bWJlcjtcbiAgbGlzdE1lbnVCdXR0b25WbzogW107XG4gIG1lbnVDb2RlOiBzdHJpbmc7XG4gIG1lbnVMaW5rOiBzdHJpbmc7XG4gIG1lbnVOYW1lOiBzdHJpbmc7XG4gIG1lbnVQaWNTbWFsbDogc3RyaW5nO1xuICBwYXJlbnRJZDogbnVsbCB8IG51bWJlcjtcbiAgcGFyZW50TmFtZTogbnVsbCB8IHN0cmluZztcbiAgc29ydElkOiBudW1iZXI7XG59O1xuIl19
\ No newline at end of file
// stores/user.js
import { observe } from 'minii'
export type Userinfo = {
cellphone: string;
comment: string;
createAt: string;
id: number;
isOpenOperLog: number;
isSetPassword: number;
lastLoginDate: string;
loginAccount: string;
loginCount: number;
name: string;
operateId: number;
operateName: string;
state: string;
updateAt: string;
};
class UserStore {
constructor() {
this.token = '123'
}
getUserInfo(data) {
this.token = data.token
}
}
// 第二个参数'user'会将当前store的所有内部变量绑定在全局变量的user属性上
// 如果第二个参数没有写,会默认使用该class名字的全小写
export default observe(new UserStore(), 'user')
\ No newline at end of file
export type UserRole = {
childs: UserRole[];
id: number;
listMenuButtonVo: [];
menuCode: string;
menuLink: string;
menuName: string;
menuPicSmall: string;
parentId: null | number;
parentName: null | string;
sortId: number;
};
......@@ -84,6 +84,12 @@
"pathName": "pages/monthOperator/monthOperator",
"query": "",
"scene": null
},
{
"id": -1,
"name": "userGrowth",
"pathName": "pages/userGrowth/userGrowth",
"scene": null
}
]
}
......
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