123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293 |
- <template>
- <view class="rf-index">
- <view class="index">
- <view class="header">
- <view class="header-warp">
- <view class="header-left">
- <view class="uni-list">
- <view class="uni-list-cell">
- <view class="uni-list-cell-db">
- <picker @change="bindPickerChange" :value="index" :range="shopArray" range-key="name">
- <view class="uni-input" >{{ shopArray[index].name }}</view>
- </picker>
- <image src="../../static/images/downicon.png" mode="" class="icon"></image>
- </view>
- </view>
- </view>
- </view>
- <view class="header-bar header-center">首页</view>
- <view class="header-right">
- <image src="../../static/images/seticon.png" mode="" class="icon" @tap="tosetting"></image>
- </view>
- </view>
- <view class="user">
- <view class="user-left">
- <open-data type="userAvatarUrl" class="usericon"></open-data>
- <!-- <image :src="userInfo.avatarUrl" mode="" class="usericon"></image> -->
- <view class="message">
- <!-- <view class="name">{{userInfo.nickName}}</view> -->
- <open-data type="userNickName" class="name"></open-data>
- <view class="tele"></view>
- </view>
- </view>
- <view class="user-right" @tap="scanCode">
- <image src="../../static/images/scan.png" mode="" class="sacnicon"></image>
- <view class="txt">
- 验证码核销
- </view>
- </view>
- </view>
- </view>
- <view class="" style="height: 284upx;"></view>
-
- <!-- 输入框 -->
- <view class="input-code">
- <input type="text" v-model="ordernum" maxlength="-1" placeholder-style="color:#b8bbbb;font-size:28upx;" class="code" placeholder="请输入验证码核验">
- <view class="search" @tap="searchOrder">搜索</view>
- </view>
- <view class="index-content">
- <!-- 关键指数 -->
- <view class="exponent">
- <view class="title-warp">
- <view class="name">
- 关键指数
- </view>
- <view class="time">
- 数据截至:2020.07.03 <text class="hour">10:10</text>
- </view>
- </view>
- <view class="exponent-list">
- <view class="item seale">
- <view class="left">
- <view class="title">
- 销售总额
- </view>
- <view class="num">
- {{sellSun.num}}
- </view>
- <view class="ratio">
- <view class="detail">
- <image src="../../static/images/down.png" class="icon" v-if="sellSun.num < 0">
- <image src="../../static/images/up.png" class="icon" v-if="sellSun.num>0"> {{ sellSun.percent }}% <text class="compare">{{ sellSun.status ? '无增长' :'同比上月' }}</text>
- </view>
- </view>
- </view>
- <view class="right">
- <image src="../../static/images/sealenum.png" mode="" class="logoicon"></image>
- </view>
- </view>
- <view class="item order">
- <view class="left">
- <view class="title">
- 订单总量
- </view>
- <view class="num">
- {{orderSun.num}}
- </view>
- <view class="ratio">
- <view class="detail">
- <image src="../../static/images/down.png" class="icon" v-if="orderSun.num < 0">
- <image src="../../static/images/up.png" class="icon" v-if="orderSun.num>0"> {{ orderSun.percent }}% <text class="compare">{{ orderSun.status ? '无增长' :'同比上月' }}</text>
- </view>
- </view>
- </view>
- <view class="right">
- <image src="../../static/images/sealenum.png" mode="" class="logoicon"></image>
- </view>
- </view>
- <view class="item todayseale">
- <view class="left">
- <view class="title">
- 今日销售额
- </view>
- <view class="num">
- {{todaysellSun.num}}
- </view>
- <view class="ratio">
- <view class="detail">
- <image src="../../static/images/down.png" class="icon" v-if="todaysellSun.num < 0">
- <image src="../../static/images/up.png" class="icon" v-if="todaysellSun.num>0"> {{ todaysellSun.percent }}% <text class="compare">{{ todaysellSun.status ? '无增长' :'同比上月' }}</text>
- </view>
- </view>
- </view>
- <view class="right">
- <image src="../../static/images/sealenum.png" mode="" class="logoicon"></image>
- </view>
- </view>
- <view class="item todayorder">
- <view class="left">
- <view class="title">
- 今日订单量
- </view>
- <view class="num">
- {{todayorderSun.num}}
- </view>
- <view class="ratio">
- <view class="detail">
- <image src="../../static/images/down.png" class="icon" v-if="todayorderSun.num < 0">
- <image src="../../static/images/up.png" class="icon" v-if="todayorderSun.num>0"> {{ todayorderSun.percent }}% <text class="compare">{{ todayorderSun.status ? '无增长' :'同比上月' }}</text>
- </view>
- </view>
- </view>
- <view class="right">
- <image src="../../static/images/sealenum.png" mode="" class="logoicon"></image>
- </view>
- </view>
- </view>
- </view>
- <!-- 待处理事物 -->
- <view class="something">
- <view class="title">
- 待处理事物
- </view>
- <view class="todo-list">
- <view class="item">
- <view class="title">
- 待审核店铺
- </view>
- <view class="num">
- {{ pendingData.store }}
- </view>
- </view>
- <view class="item">
- <view class="title">
- 待审核商品
- </view>
- <view class="num">
- {{ pendingData.shop }}
- </view>
- </view>
- <view class="item">
- <view class="title">
- 待上架产品
- </view>
- <view class="num">
- {{ pendingData.shelf }}
- </view>
- </view>
- <view class="item">
- <view class="title">
- 待退款订单
- </view>
- <view class="num">
- {{ pendingData.refund }}
- </view>
- </view>
- <view class="item ">
- <view class="title">
- 已支付订单
- </view>
- <view class="num">
- {{ pendingData.payorder }}
- </view>
- </view>
-
- </view>
- </view>
- <!-- 数据概况 -->
- <view class="data">
- <view class="qiun-bg-white qiun-title-bar qiun-common-mt">
- <view class="qiun-title-dot-light">数据概况</view>
- </view>
- <!-- 产品销售数量走势 -->
- <view class="echarts shopsell">
- <view class="title">
- <view class="left">
- <text class="future">产品销售数量走势:<text class="num">0</text>
- <text class="yesterday">昨日全天:<text class="daynum">0</text></text>
- </text>
- </view>
- <view class="right">
- <view class="today-icon"></view><text class="title">今日</text>
- <view class="yesterday-icon"></view><text class="title">昨日</text>
- </view>
- </view>
- <view class="qiun-charts">
- <canvas canvas-id="shopsellEcharts" id="shopsellEcharts" class="shopsellEcharts" disable-scroll=true @touchend="shopSellEndTouch"></canvas>
- </view>
- </view>
- <!-- 产品销售金额走势 -->
- <view class="echarts shopmoney">
- <view class="title">
- <view class="left">
- <text class="future">产品销售金额走势:<text class="num">0</text>
- <text class="yesterday">昨日全天:<text class="daynum">0</text></text>
- </text>
- </view>
- <view class="right">
- <view class="today-icon"></view><text class="title">今日</text>
- <view class="yesterday-icon"></view><text class="title">昨日</text>
- </view>
- </view>
- <view class="qiun-charts">
- <canvas canvas-id="shopmoneyEcharts" id="shopmoneyEcharts" class="shopmoneyEcharts" @touchstart="shopMoneyTouch"></canvas>
- </view>
- </view>
- <!-- 未来7天预定 -->
- <view class="echarts">
- <view class="title">
- <view class="left">
- <text class="future">未来七天预定:<text class="num">0</text>
- <text class="yesterday">昨日全天:<text class="daynum">0</text></text>
- </text>
- </view>
- <view class="right">
- <view class="today-icon"></view><text class="title">今日</text>
- </view>
- </view>
- <view class="qiun-charts">
- <canvas canvas-id="canvasLineA" id="canvasLineA" class="charts" @touchstart="touchLineA"></canvas>
- </view>
- </view>
- </view>
- <!-- 商品销售占比 -->
- <view class="shop-echarts-warp">
- <view class="title">
- 商品销售占比
- </view>
- <view class="shop-echarts">
- <canvas canvas-id="shopecharts" id="shopecharts" class="shopecharts" @touchstart="touchPie"></canvas>
- </view>
- </view>
- <view id="testecharts"></view>
- <view class="" style="height: 40upx;"></view>
- </view>
- </view>
- <mask :txt="masktxt" :iconShow="iconShow" v-if="isShowMask" @isSureConver="isSureConver"></mask>
- <rf-loading v-if="loading"></rf-loading>
- </view>
- </template>
- <script>
- import uCharts from '../../js_sdk/u-charts/u-charts/u-charts';
- import moment from '@/common/moment';
- import mask from '../components/mask'
- let _self;
- let canvaLineA = null;
- let canvaPie = null;
- let shopSellLine = null;
- let shopMoneyLine = null;
- export default {
- name: 'Header',
- components: {
- mask
- },
- data() {
- return {
- //用户信息
- userInfo:uni.getStorageSync('wechatUserInfo'),
- loading: true,
-
- // 遮罩层
- isShowMask: false,
- iconShow: false,
- masktxt:'',
- shopArray: [{ name: '全部', id: 0 }],
- shopID: 0,
- index: 0,
- // 商品销售走势
- shopwidth: '',
- shopheight: '',
- // 销售金额走势
- moneywidth: '',
- moneyheight: '',
- // 未来七天
- cWidth: '',
- cHeight: '',
- // 饼图数据
- bWidth: '',
- bHeight: '',
- pixelRatio: 1, // 像素比
- ordernum: '', // 订单号
- orderMessage: {},
- today: moment().format('YYYY-MM-DD'),
- // 数据还可以优化
- sellSun: {
- num: 0,
- percent: 0,
- status: null,
- },
- todaysellSun: {
- num: 0,
- percent: 0,
- status: null,
- },
- orderSun: {
- num: 0,
- percent: 0,
- status: null,
- },
- todayorderSun: {
- num: 0,
- percent: 0,
- status: null,
- },
- // 待处理事物
- pendingData: {
- store: 0,
- shop: 0,
- shelf: 0,
- payorder: 0,
- refund: 0,
- },
- };
- },
- // 此处定义传入的数据
- props: {
- shoplist: {
- type: Object,
- value: null,
- },
- },
- // 页面生命周期 监听页面加载
- onLoad() {
- _self = this;
- this.cWidth = uni.upx2px(690); // upx2px 转换为px
- this.cHeight = uni.upx2px(300);
- this.bWidth = uni.upx2px(690);
- this.bHeight = uni.upx2px(300);
- this.getShopList();
- this.loading = false;
-
- },
- methods: {
- // 监听遮罩层行为
- isSureConver(e) {
- this.isShowMask = false;
- this.$mRouter.back()
- },
- // 扫码订单
- scanCode() {
- // 允许从相机和相册扫码
- uni.scanCode({
- success: function (res) {
- _self.ordernum = res.result
- _self.searchOrder()
- },
- });
- },
- // 搜索框根据订单号查询订单
- searchOrder() {
- if (this.ordernum === '') {
- this.$mHelper.toast('请输入正确的订单号进行查询,不能为空!')
- return
- }
- this.$http.get('/orders/getOrdersByNo/'+this.ordernum).then(res=>{
- if (res.code === 200 ) {
- this.ordernum = ''
- if (res.data === "该订单已失效!") {
- this.iconShow = false
- this.isShowMask = true
- this.masktxt = res.data
- } else if (res.data === "未查询到该订单,请输入正确的核销码!") {
- this.iconShow = false
- this.isShowMask = true
- this.masktxt = "未查询到该订单,请重新输入!"
- } else {
- uni.setStorageSync('orderDetail', res.data);
- this.$mRouter.push({ route: '/pages/index/conversion' });
- }
- this.orderMessage = res.data
- }
-
- }).catch( error=>{
- this.ordernum = ''
- })
-
- },
- // 选择商铺
- bindPickerChange(e) {
- this.shopID = null;
- this.index = e.detail.value;
- this.shopID = this.shopArray[this.index].id;
- this.getExponentData();
- this.getPendingData();
- this.futureDayData();
- this.shopSellData();
- this.shopSellTrend();
- this.shopSellMoneyTrend();
- },
- // 跳转设置页
- tosetting() {
- this.$mRouter.push({ route: '/pages/index/setting/setting' });
- },
- // 获取店铺列表
- async getShopList() {
- await this.$http.get('/homePage/getShopByMerId').then((res) => {
- if (res.data && res.code === 200) {
- let newarr = [{ name: '全部', id: 0 }];
- this.shopArray = newarr.concat(res.data);
- this.getExponentData();
- this.getPendingData();
- this.shopSellTrend();
- this.shopSellMoneyTrend();
- this.futureDayData();
- this.shopSellData();
- }
- });
- },
- // 关键指数
- async getExponentData() {
- if (this.shopID === 0) {
- this.shopID = '';
- }
- await this.$http
- .get('/homePage/gjzs', {
- date: this.today,
- shopId: this.shopID,
- })
- .then(async (res) => {
- if (res.code === 200 && res.data) {
- let todaynum = 0;
- let yesnum = 0;
- // 销售总额
- this.dataDo(res.data.xsze, this.sellSun);
- // 今日销售总额
- this.dataDo(res.data.jrxxe, this.todaysellSun);
- // 订单总量
- this.dataDo(res.data.xsze, this.orderSun);
- // 今日订单总量
- this.dataDo(res.data.xsze, this.todayorderSun);
- }
- });
- },
- // 指数数据处理
- dataDo(data, itemEle) {
- let todaynum = 0;
- let yesnum = 0;
- data.forEach((element) => {
- if (element.time === 'all') {
- itemEle.num = (element.num / 100).toFixed(2);
- } else if (element.time === 'dy') {
- todaynum = element.num;
- } else if (element.time === 'sy') {
- yesnum = element.num;
- }
- });
- if (yesnum === 0) {
- itemEle.percent = 100;
- } else {
- itemEle.percent = ((todaynum - yesnum) / yesnum).toFixed(2);
- }
- if (yesnum === todaynum) {
- itemEle.percent = 0;
- itemEle.status = true;
- } else {
- itemEle.status = false;
- }
- return itemEle;
- },
- // 待处理事物
- async getPendingData() {
- if (this.shopID === 0) {
- this.shopID = '';
- }
- await this.$http
- .get('/homePage/pendingTransaction', {
- date: this.today,
- shopId: this.shopID,
- })
- .then(async (res) => {
- if (res.data) {
- this.pendingData.store = res.data.shopCheck;
- this.pendingData.shop = res.data.goodsCheck;
- this.pendingData.shelf = res.data.upGoods;
- this.pendingData.payorder = res.data.payNum;
- this.pendingData.refund = res.data.refundNum;
- }
- });
- },
- // 商品销售走势
- async shopSellTrend() {
- if (this.shopID === 0) {
- this.shopI = '';
- }
- await this.$http
- .get('/homePage/getData2', {
- date: this.today,
- shopId: this.shopID,
- })
- .then(async (res) => {
- if (res.data) {
- let shopSellData = {
- xdata: [],
- jrdata: [],
- zrdata: [],
- };
- res.data.forEach((ele) => {
- shopSellData.xdata.push(ele.time);
- shopSellData.jrdata.push(ele.jr);
- shopSellData.zrdata.push(ele.zr);
- });
- _self.shopSellEcharts('shopsellEcharts', shopSellData);
- }
- });
- },
- shopSellEcharts(id, echartsData) {
- shopSellLine = new uCharts({
- $this: _self,
- canvasId: id,
- type: 'line',
- fontSize: 12,
- legend: {
- show: false,
- },
- dataLabel: true,
- duration: 500,
- dataPointShape: false, // 折点
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- categories: echartsData.xdata, // x轴数据
- series: [
- {
- textColor:'#ffcc01',
- color: '#ffcc01',
- data: echartsData.jrdata,
- name: '今日',
- pointShape: 'circle',
- show: true,
- type: 'line',
- },
- {
- color: '#7d66f3',
- textColor:'#7d66f3',
- data: echartsData.zrdata,
- name: '昨日',
- pointShape: 'circle',
- show: true,
- type: 'line',
- },
- ], // 值
- animation: true,
- // enableScroll: true,
- xAxis: {
- type: 'grid',
- disableGrid: true,
- labelCount: 7
- },
- yAxis: {
- gridType: 'solid',
- gridColor: '#cccccc',
- min: 0,
- max: 180,
- data: [
- {
- axisLine: false,
- format: (val) => {
- return val.toFixed(0);
- },
- }],
- },
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- padding: [15,15,4,15],
- extra: {
- line: {
- type: 'curve', // 平滑曲线; straight直线
- },
- },
- });
- },
- shopSellEndTouch(e) {
- shopSellLine.showToolTip(e, {
- format: function (item, category) {
- return category + ' ' + item.name + ':' + item.data
- }
- });
- },
- // 商品销售金额走势
- async shopSellMoneyTrend() {
- if (this.shopID === 0) {
- this.shopI = '';
- }
- await this.$http
- .get('/homePage/getData3', {
- date: this.today,
- shopId: this.shopID,
- })
- .then(async (res) => {
- if (res.data) {
- let shopMoney = {
- xdata: [],
- jrdata: [],
- zrdata: [],
- };
- res.data.forEach((ele) => {
- shopMoney.xdata.push(ele.time);
- shopMoney.jrdata.push(ele.jr);
- shopMoney.zrdata.push(ele.zr);
- });
- _self.shopMoneyEcharts('shopmoneyEcharts', shopMoney);
- }
- });
- },
- shopMoneyEcharts(id, echartsData) {
- shopMoneyLine = new uCharts({
- $this: _self,
- canvasId: id,
- type: 'line',
- fontSize: 12,
- legend: {
- show: false,
- },
- dataLabel: true, // 图表中是否显示数据
- duration: 500,
- dataPointShape: false, // 折点
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- categories: echartsData.xdata, // x轴数据
- series: [
- {
- textColor: '#f79554',
- color: '#f79554',
- data: echartsData.jrdata,
- name: '今日',
- pointShape: 'circle',
- show: true,
- type: 'line',
- },
- {
- color: '#2ad3a1',
- textColor: '#2ad3a1',
- data: echartsData.zrdata,
- name: '昨日',
- pointShape: 'circle',
- show: true,
- type: 'line',
- },
- ], // 值
- animation: true,
- xAxis: {
- type: 'grid',
- disableGrid: true,
- labelCount: 7
- },
- yAxis: {
- gridType: 'solid',
- gridColor: '#CCCCCC',
- min: 0,
- max: 180,
- data: [{
- axisLine: false,
- format: (val) => {
- return val.toFixed(2);
- }
- }],
- },
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- padding: [15,15,4,15],
- extra: {
- line: {
- type: 'curve', // 平滑曲线; straight直线
- },
- },
- });
- },
- shopMoneyTouch(e) {
- shopMoneyLine.showToolTip(e, {
- format: function (item, category) {
- return category + ' ' + item.name + ':' + item.data;
- },
- });
- },
- // 未来七天
- async futureDayData() {
- if (this.shopID === 0) {
- this.shopID = '';
- }
- await this.$http
- .get('/homePage/getData0', {
- date: this.today,
- shopId: this.shopID,
- })
- .then(async (res) => {
- if (res.data) {
- let LineA = {
- categories: [],
- series: [],
- };
- res.data.forEach((ele) => {
- LineA.series.push(ele.num);
- LineA.categories.push(ele.date.slice(5));
- });
- _self.showLineA('canvasLineA', LineA);
- }
- });
- },
- // 折线图表
- showLineA(canvasId, chartData) {
- canvaLineA = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'line',
- fontSize: 12,
- legend: {
- show: false,
- },
- dataLabel: true, // 图表中是否显示数据
- duration: 500,
- dataPointShape: false, // 折点
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- categories: chartData.categories, // x轴数据
- series: [
- {
- color: '#ffcc01',
- data: chartData.series,
- name: '人次',
- pointShape: 'circle',
- show: true,
- type: 'line',
- },
- ], // 值
- animation: true,
- xAxis: {
- type: 'grid',
- disableGrid: true,
- },
- yAxis: {
- gridType: 'solid',
- gridColor: '#CCCCCC',
- min: 0,
- max: 180,
- data: [{
- axisLine: false,
- format: (val) => {
- return val.toFixed(0);
- },
- }],
- },
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- padding: [15,15,4,15],
- extra: {
- line: {
- type: 'curve', // 平滑曲线; straight直线
- },
- },
- });
- },
- touchLineA(e) {
- canvaLineA.showToolTip(e, {
- format: function (item, category) {
- return category + ' ' + item.name + ':' + item.data;
- },
- });
- },
- // 商品销售占比
- async shopSellData() {
- await this.$http
- .get('/homePage/getData1', {
- // date: this.today,
- date: '2020-07-28',
- shopId: this.shopID
- })
- .then(async (res) => {
- let pie = {
- series: [],
- };
- if (res.data.length > 0) {
- for (let i = 0; i < res.data.length; i++) {
- let element = res.data[i];
- pie.series.push({name: element.name, data: element.value})
- }
- _self.showPie('shopecharts', pie);
- } else {
- pie.series = [{ name: '无数据', data: 0 }];
- _self.showPie('shopecharts', pie);
- }
- });
- },
- // 饼图
- showPie(canvasId, chartData) {
- canvaPie = new uCharts({
- $this: _self,
- colors: ['#FFBC3C', '#F25051', '#FE7DDE', '#4880FF', '#47EDFB'],
- canvasId: canvasId,
- type: 'pie',
- fontSize: 12,
- legend: {
- show: true,
- position: 'left',
- float: 'center',
- itemGap: 10,
- padding: 5,
- lineHeight: 20,
- margin: 5,
- borderWidth: 1,
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- series: chartData.series,
- animation: true,
- width: _self.bWidth * _self.pixelRatio,
- height: _self.bHeight * _self.pixelRatio,
- dataLabel: true,
- extra: {
- pie: {
- lableWidth: 15,
- },
- },
- });
- },
- touchPie(e) {
- canvaPie.showToolTip(e, {
- format: function (item) {
- return item.name + ':' + item.data;
- },
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .header {
- width: 100%;
- padding: 0 30rpx;
- background-color: $barColor;
- position: fixed;
- top: 0;
- box-sizing: border-box;
- z-index: 99;
- .header-warp {
- display: flex;
- height: 80rpx;
- color: #231726;
- background-color: #ffcc01;
- position: relative;
- .header-left {
- position: absolute;
- font-size: 28rpx;
- .uni-list:after {
- border-color: transparent;
- }
- .uni-list-cell-db {
- height: 80rpx;
- font-size: 28rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- background-color: $barColor;
- .icon {
- width: 17rpx;
- height: 12rpx;
- margin-left: 10rpx;
- }
- }
- }
- .header-center {
- flex: 1;
- font-size: 36rpx;
- font-weight: 700;
- text-align: center;
- line-height: 80rpx;
- }
- .header-right {
- position: absolute;
- right: 0;
- top: 50%;
- margin-top: -20upx;
- .icon {
- width: 40rpx;
- height: 40rpx;
- }
- }
- }
- .user {
- padding: 30upx 30upx 75upx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .user-left {
- display: flex;
- justify-content: center;
- align-items: center;
- .usericon {
- width: 100upx;
- height: 100upx;
- border-radius: 50%;
- background-color: #ffffff;
- overflow: hidden;
- }
- .message {
- margin-left: 32rpx;
- color: #2c1b0a;
- .name {
- font-size: 30rpx;
- font-weight: 700;
- }
- .tele {
- font-size: 24rpx;
- }
- }
- }
- .user-right {
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- .sacnicon {
- width: 40rpx;
- height: 40rpx;
- }
- .txt {
- font-size: 24rpx;
- margin-top: 20rpx;
- }
- }
- }
- }
- .input-code {
- position: fixed;
- left: 50%;
- margin-left: -344upx;
- top: 234upx;
- background-color: #fff;
- width: 686upx;
- padding: 0 38upx;
- box-shadow: 0 10upx 10upx rgba($color: #f4f4f4, $alpha: 0.1);
- z-index: 100;
- border-radius: 10upx;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .code {
- flex: 1;
- height: 100upx;
- }
- .search {
- width: 60upx;
- height: 100upx;
- line-height: 100upx;
- font-size: 28upx;
- color: #ffcd00;
- margin-left: 20upx;
- }
- }
- .index {
- background-color: #fafafa;
- .index-content {
- padding: 85upx 33rpx;
- .exponent {
- .title-warp {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 30rpx 0;
- .name {
- font-size: 32rpx;
- font-weight: 700;
- }
- .time {
- font-size: 24rpx;
- color: #191919;
- .hour {
- margin-left: 15rpx;
- }
- }
- }
- .exponent-list {
- display: flex;
- flex-wrap: wrap;
- .item {
- width: 320rpx;
- border-radius: 10rpx;
- color: #ffffff;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 25rpx;
- box-sizing: border-box;
- margin-bottom: 32rpx;
- &:nth-child(odd) {
- margin-right: 44rpx;
- }
- &:nth-child(3),
- &:nth-child(4) {
- margin-bottom: 0;
- }
- .left {
- .title {
- font-size: 24rpx;
- }
- .num {
- font-size: 36rpx;
- font-weight: 700;
- margin-top: 5rpx;
- }
- .ratio {
- margin-top: 10rpx;
- font-size: 20rpx;
- .detail {
- display: flex;
- justify-content: center;
- align-items: center;
- .icon {
- width: 12rpx;
- height: 16rpx;
- margin-right: 5rpx;
- }
- .compare {
- margin-left: 10rpx;
- font-size: 20rpx;
- }
- }
- }
- }
- .right {
- width: 90rpx;
- height: 90rpx;
- border-radius: 50%;
- background-color: rgba($color: #ffffff, $alpha: 0.2);
- display: flex;
- justify-content: center;
- align-items: center;
- .logoicon {
- width: 44rpx;
- height: 53rpx;
- }
- }
- }
- .seale {
- background-image: linear-gradient(to top right, #e379d0, #f767b1);
- }
- .order {
- background-image: linear-gradient(to top right, #f38867, #fca43d);
- }
- .todayseale {
- background-image: linear-gradient(to top right, #9859fd, #d98afa);
- }
- .todayorder {
- background-image: linear-gradient(to top right, #17c1b1, #40e98f);
- }
- }
- }
- .something {
- margin-top: 30rpx;
- .title {
- font-size: 32rpx;
- font-weight: 700;
- color: $titleColor;
- }
- .todo-list {
- display: flex;
- // justify-content: center;
- align-items: center;
- flex-wrap: wrap;
- margin-top: 30rpx;
- background-color: #ffffff;
- box-sizing: border-box;
- padding: 43rpx 30rpx;
- border-radius: 10rpx;
- .item {
- width: 33.33%;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- margin-bottom: 30upx;
- .title {
- color: $subheadColor;
- font-size: 30rpx;
- }
- .num {
- color: $titleColor;
- }
- }
- }
- }
- .data {
- margin-top: 40rpx;
- .echarts {
- background-color: #ffffff;
- border-radius: 10rpx;
- margin-bottom: 30upx;
- }
- .title {
- display: flex;
- justify-content: space-between;
- color: #333333;
- padding-top: 30rpx;
- padding-left: 15rpx;
- padding-bottom: 30rpx;
- box-sizing: border-box;
- .left {
- .future {
- font-size: 28rpx;
- .num {
- font-size: 30rpx;
- }
- .yesterday {
- margin-left: 10rpx;
- }
- }
- }
- .right {
- display: flex;
- justify-content: center;
- align-items: center;
- box-sizing: border-box;
- .today-icon {
- width: 20rpx;
- height: 9rpx;
- background-color: #ff9c2f;
- margin-right: 10rpx;
- }
- .title {
- font-size: 20rpx;
- margin-right: 20rpx;
- }
- .yesterday-icon {
- width: 20rpx;
- height: 9rpx;
- background-color: #b15cfa;
- margin-left: 10rpx;
- }
- .title {
- font-size: 20rpx;
- }
- }
- }
- .qiun-title-dot-light {
- color: $titleColor;
- font-size: 32rpx;
- font-weight: 700;
- padding-bottom: 25rpx;
- }
- /* 样式的width和height一定要与定义的cWidth和cHeight相对应 */
- .qiun-charts {
- width: 690rpx;
- height: 300rpx;
- }
- .charts {
- width: 690rpx;
- height: 300rpx;
- }
- .shopsell {
- .shopsellEcharts {
- width: 690rpx;
- height: 300rpx;
- }
- }
- .shopmoney {
- .shopmoneyEcharts {
- width: 690rpx;
- height: 300rpx;
- }
- }
- }
- .shop-echarts-warp {
- background-color: #ffffff;
- border-radius: 10rpx;
- margin-top: 40rpx;
- .title {
- padding: 40rpx 24rpx 30rpx;
- font-size: 26rpx;
- color: $titleColor;
- }
- .shop-echarts {
- width: 690rpx;
- height: 300rpx;
- }
- .shopecharts {
- width: 690rpx;
- height: 300rpx;
- }
- }
- }
- }
- </style>
|