index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107
  1. <template>
  2. <view class="home">
  3. <view class="top_view">
  4. <u-navbar :title-bold="true" :border-bottom="false" :background="{ background: `rgba(64, 118, 214, ${scroll_top / 100})` }" :is-back="false" title=" ">
  5. <view class="title">{{ enterprise.enterpriseName || '工作台' }}</view>
  6. </u-navbar>
  7. <!-- <uniStatusBar></uniStatusBar> -->
  8. <!-- <view class="title">{{ enterprise.enterpriseName || '--' }}</view> -->
  9. <view class="user_img clearfix">
  10. <view class="img">
  11. <image :src="enterprise.logo" mode="aspectFill"></image>
  12. <span class="img_title">{{ userInfo.name }}</span>
  13. </view>
  14. <view class="Icon">
  15. <view class="btn-li" @click="goPage('/pages/enterprise/index', 'reLaunch')">
  16. <u-icon name="qiehuan-" custom-prefix="custom-icon" size="36" color="#4076D6"></u-icon>
  17. </view>
  18. <view class="btn-li" @click="overview('reset')"><u-icon name="shuaxin" size="36" color="#4076D6" custom-prefix="custom-icon"></u-icon></view>
  19. <view class="btn-li" @click="goPage('/pages/index/WxCode')"><u-icon name="erweima" size="32" custom-prefix="custom-icon" color="#4076D6"></u-icon></view>
  20. <view class="btn-li" @click="goPage('/pagesT/notice/notice')"><u-icon name="bell" size="36" color="#4076D6"></u-icon></view>
  21. <view class="btn-li" @click="logout"><u-icon name="zhuxiao" custom-prefix="custom-icon" size="34" color="#4076D6"></u-icon></view>
  22. </view>
  23. </view>
  24. <view class="top_money clearfix" v-if="$accessCheck($Access.overview)">
  25. <view class="float_left" style="font-weight: 400;">
  26. <u-icon name="jinbi" size="36" color="#ffffff" margin-left="12" label-color="#ffffff" label-size="24" label="应收账款" custom-prefix="custom-icon"></u-icon>
  27. </view>
  28. <view class="float_right">
  29. <text class="rmb-icon">¥</text>
  30. {{ $utils.formatNub(now.totalShouldReceive) }}
  31. </view>
  32. </view>
  33. </view>
  34. <view class="top_bottom" v-if="$accessCheck($Access.overview)">
  35. <view class="money-li">
  36. <view>
  37. <u-icon name="jinbi" size="36" color="#f69844" margin-left="12" label-color="#BABBC6" label-size="24" label="应付账款" custom-prefix="custom-icon"></u-icon>
  38. </view>
  39. <view class="num">
  40. ¥
  41. <text class="written">{{ $utils.formatNub(now.totalShouldPay) }}</text>
  42. </view>
  43. </view>
  44. <view class="money-li">
  45. <navigator open-type="switchTab" url="/pages/customer/CustomerList">
  46. <view>
  47. <u-icon
  48. name="customer"
  49. size="36"
  50. color="#7a15ff"
  51. margin-left="12"
  52. label-color="#BABBC6"
  53. label-size="24"
  54. label="当前客户数"
  55. custom-prefix="custom-icon"
  56. ></u-icon>
  57. <view class="num">
  58. <text class="written">{{ Number(now.customerTotalNum) || 0 }}</text>
  59. </view>
  60. </view>
  61. </navigator>
  62. </view>
  63. <view class="money-li">
  64. <view>
  65. <u-icon
  66. name="shangpin1"
  67. size="36"
  68. color="#3f64d9"
  69. margin-left="12"
  70. label-color="#BABBC6"
  71. label-size="24"
  72. label="库存商品数"
  73. custom-prefix="custom-icon"
  74. ></u-icon>
  75. </view>
  76. <view class="num">
  77. <text class="written">{{ Number(now.numberOfProductsInStock) || 0 }}</text>
  78. </view>
  79. </view>
  80. <view class="money-li">
  81. <view>
  82. <u-icon name="jine" size="36" color="#f54957" margin-left="12" label-color="#BABBC6" label-size="24" label="库存总金额" custom-prefix="custom-icon"></u-icon>
  83. </view>
  84. <view class="num">
  85. ¥
  86. <text class="written">{{ $utils.formatNub(now.totalMoneyOfInventory) }}</text>
  87. </view>
  88. </view>
  89. </view>
  90. <!-- 内容 -->
  91. <view class="content">
  92. <!-- 工作台 -->
  93. <view class="content_main" style="margin-top: 0;">
  94. <view class="content_top clearfix" style="background: linear-gradient(270deg, #FDFFFE 0%, #EAFEEE 100%);">
  95. <image src="../../static/img/ic-work.png" class="img"></image>
  96. <text class="title-text">工作台</text>
  97. <view class="edit-btn float_right" @click="goPage('/pages/app/index')">
  98. <u-icon name="edit-pen-fill" color="#4076D6" label-color="#4076D6" size="28" label="编辑" label-size="28"></u-icon>
  99. </view>
  100. </view>
  101. <view class="cont">
  102. <swiper class="swiper" indicator-color="#B8C0C8" indicator-active-color="#4076D6" :indicator-dots="true" :autoplay="false" :interval="2000" :duration="500">
  103. <swiper-item v-for="(item, index) in nav_list" :key="index">
  104. <view class="app-ul">
  105. <block v-for="(app, appi) in item" :key="appi">
  106. <view class="app-li" @click="goPage(app.url)" v-if="$accessCheck($Access[app.access])">
  107. <view class="icon-view" :style="{ background: app.color }"><text :class="[app.icon]" class="custom-icon"></text></view>
  108. <view class="label ellipsis">{{ app.label }}</view>
  109. </view>
  110. </block>
  111. </view>
  112. </swiper-item>
  113. </swiper>
  114. </view>
  115. </view>
  116. <view class="content_main" v-if="$accessCheck($Access.overview)">
  117. <view class="content_top">
  118. <image src="../../static/img/ic-jy.png" class="img" mode="aspectFill"></image>
  119. <text class="title-text">经营概况</text>
  120. </view>
  121. <!-- 经营概况 -->
  122. <view class="content_text">
  123. <ul class="content-ul">
  124. <li class="li-list">
  125. <view class="order_money">下单金额</view>
  126. <view class="num">{{ businessOverview.orderTotalMoney }}</view>
  127. <!-- <view class='txt'>同比<span style='margin-left: 3rpx;color: #2CB244;'>+10%</span><span>
  128. <image src="../../static/img/ic-sh.png" style="width: 16rpx;height: 16rpx;">
  129. </image>
  130. </span></view> -->
  131. <!-- <view class="time">
  132. 昨日
  133. <span style="margin-left: 4rpx;">13409.00</span>
  134. </view> -->
  135. </li>
  136. <li class="li-list">
  137. <view class="order_money">营业金额</view>
  138. <view class="num">{{ businessOverview.orderConfirmedMoney }}</view>
  139. <!-- <view class='txt'>同比<span style='margin-left: 8rpx;color: #FA6400;'>+10%</span><span>
  140. <image src="../../static/img/ic-xd.png" style="width: 16rpx;height: 16rpx;">
  141. </image>
  142. </span></view> -->
  143. <!-- <view class="time">
  144. 昨日
  145. <span style="margin-left: 4rpx;">13409.00</span>
  146. </view> -->
  147. </li>
  148. <li class="li-list">
  149. <view class="order_money">今日毛利</view>
  150. <view class="num">{{ businessOverview.todayGrossProfit }}</view>
  151. <!-- <view class='txt'>同比<span style='margin-left: 3rpx;color: #2CB244;'>+10%</span><span>
  152. <image src="../../static/img/ic-sh.png" style="width: 16rpx;height: 16rpx;">
  153. </image>
  154. </span></view> -->
  155. <!-- <view class="time">
  156. 昨日
  157. <span style="margin-left: 4rpx;">13409.00</span>
  158. </view> -->
  159. </li>
  160. <li class="li-list bottom-li">
  161. <view class="order_money">今日收款</view>
  162. <view class="num">{{ businessOverview.todayReceivedMoney }}</view>
  163. <!-- <view class='txt'>同比<span style='margin-left: 3rpx;color: #2CB244;'>+10%</span><span>
  164. <image src="../../static/img/ic-sh.png" style="width: 16rpx;height: 16rpx;">
  165. </image>
  166. </span></view> -->
  167. <!-- <view class="time">
  168. 昨日
  169. <span style="margin-left: 4rpx;">13409.00</span>
  170. </view> -->
  171. </li>
  172. <li class="li-list bottom-li">
  173. <view class="order_money">今日新增客户数</view>
  174. <view class="num">{{ businessOverview.todayNewCustomerNum }}</view>
  175. <!-- <view class='txt'>同比<span style='margin-left: 3rpx;color: #2CB244;'>+10%</span><span>
  176. <image src="../../static/img/ic-sh.png" style="width: 16rpx;height: 16rpx;">
  177. </image>
  178. </span></view> -->
  179. <!-- <view class="time">
  180. 昨日
  181. <span style="margin-left: 4rpx;">13409.00</span>
  182. </view> -->
  183. </li>
  184. </ul>
  185. </view>
  186. </view>
  187. <!-- 订单概况 -->
  188. <view class="content_main" v-if="$accessCheck($Access.overview)">
  189. <view class="content_top clearfix" style="background: linear-gradient(270deg, #FFFFFF 0%, #FDF6E8 100%); ">
  190. <view class="float_left">
  191. <image src="../../static/img/ic-jyh3.png" class="img" mode="aspectFill"></image>
  192. <text class="title-text">订单概况</text>
  193. </view>
  194. <!-- <view class="float_right" style="color: #B8C0C8;">选择店铺</view> -->
  195. </view>
  196. <view class="content_text">
  197. <ul class="content-ul">
  198. <li class="li-list">
  199. <view class="order_money">今日订单</view>
  200. <view class="num">{{ businessOverview.todayConfirmedOrderNum }}</view>
  201. <!-- <view class='txt'>同比<span style='margin-left: 3rpx;color: #2CB244;'>+10%</span><span>
  202. <image src="../../static/img/ic-sh.png" style="width: 16rpx;height: 16rpx;">
  203. </image>
  204. </span></view> -->
  205. <!-- <view class="time">
  206. 昨日
  207. <span style="margin-left: 4rpx;">13409.00</span>
  208. </view> -->
  209. </li>
  210. <li class="li-list">
  211. <view class="order_money">下单客户</view>
  212. <view class="num">{{ businessOverview.todayConfirmedOrderCustomerNum }}</view>
  213. <!-- <view class='txt'>同比<span style='margin-left: 8rpx;color: #FA6400;'>+10%</span><span>
  214. <image src="../../static/img/ic-xd.png" style="width: 16rpx;height: 16rpx;">
  215. </image>
  216. </span></view> -->
  217. <!-- <view class="time">
  218. 昨日
  219. <span style="margin-left: 4rpx;">13409.00</span>
  220. </view> -->
  221. </li>
  222. <li class="li-list">
  223. <view class="order_money">今日客单价</view>
  224. <view class="num">{{ businessOverview.customerAverageMoney }}</view>
  225. <!-- <view class='txt'>同比<span style='margin-left: 3rpx;color: #2CB244;'>+10%</span><span>
  226. <image src="../../static/img/ic-sh.png" style="width: 16rpx;height: 16rpx;">
  227. </image>
  228. </span></view> -->
  229. <!-- <view class="time">
  230. 昨日
  231. <span style="margin-left: 4rpx;">13409.00</span>
  232. </view> -->
  233. </li>
  234. <li class="li-list bottom-li">
  235. <view class="order_money">未出库订单</view>
  236. <view class="num">{{ businessOverview.orderNumOfNotOutOfStock }}</view>
  237. <!-- <view class='txt'>同比<span style='margin-left: 3rpx;color: #2CB244;'>+10%</span><span>
  238. <image src="../../static/img/ic-sh.png" style="width: 16rpx;height: 16rpx;">
  239. </image>
  240. </span></view> -->
  241. <!-- <view class="time">
  242. 昨日
  243. <span style="margin-left: 4rpx;">13409.00</span>
  244. </view> -->
  245. </li>
  246. <li class="li-list bottom-li">
  247. <view class="order_money">今日取消订单</view>
  248. <view class="num">{{ businessOverview.todayCanceledOrder }}</view>
  249. <!-- <view class='txt'>同比<span style='margin-left: 3rpx;color: #2CB244;'>+10%</span><span>
  250. <image src="../../static/img/ic-sh.png" style="width: 16rpx;height: 16rpx;">
  251. </image>
  252. </span></view> -->
  253. <!-- <view class="time">
  254. 昨日
  255. <span style="margin-left: 4rpx;">13409.00</span>
  256. </view> -->
  257. </li>
  258. </ul>
  259. </view>
  260. </view>
  261. <!-- 近7日交易统计图 -->
  262. <view class="content_main" v-if="$accessCheck($Access.overview)">
  263. <view class="content_top" style="background: linear-gradient(270deg, #FDFFFF 0%, #EAFAFE 100%);">
  264. <image src="../../static/img/ic-jyh2.png" class="img" style="vertical-align: middle;"></image>
  265. <text class="title-text">近7日交易趋势</text>
  266. </view>
  267. <view class="charts-box"><qiun-data-charts type="area" :chartData="chartData" :echartsH5="true" :echartsApp="true" background="none" :animation="false" /></view>
  268. </view>
  269. <!-- tab -->
  270. <view class="content_main" v-if="$accessCheck($Access.overview)">
  271. <view class="content_top tabs-ul">
  272. <ul class="ul_tag">
  273. <li v-for="(item, index) in tag" :key="index" @click="changeTag(item.value)" class="ul_tag_item" :class="[item.value === rank_on ? 'hover' : '']">
  274. {{ item.label }}
  275. </li>
  276. </ul>
  277. </view>
  278. <view class="content_bottom">
  279. <view class="bottom_top clearfix">
  280. <view class="float_left">
  281. <text class="sale" @click="changeSel(1)" :class="[ranking_sel === 1 ? 'show-on' : '']">销额</text>
  282. <text style="width: 1rpx;height: 24rpx;display: inline-block;border-left: 1rpx solid #ECF0F7;"></text>
  283. <text class="sale_num" @click="changeSel(2)" :class="[ranking_sel === 2 ? 'show-on' : '']">销量</text>
  284. </view>
  285. <view v-if="false" class="float_right" @click="goPage('/pagesT/shop/selShop')">
  286. <u-icon
  287. name="arrow-down-fill"
  288. color="#B8C0C8"
  289. margin-right="20"
  290. label-size="28rpx"
  291. label-color="#B8C0C8"
  292. size="14"
  293. label="选择店铺"
  294. label-pos="left"
  295. ></u-icon>
  296. </view>
  297. </view>
  298. <view style="margin-top:40rpx">
  299. <ul class="progress-ul" v-if="rank_on === 1">
  300. <li class="clearfix progress-li" v-for="(item, index) in ranking.categoryRanking" :key="index">
  301. <view class="float_left label ellipsis">{{ item.categoryName }}</view>
  302. <view class="float_left line">
  303. <u-line-progress
  304. active-color="#4076D6"
  305. :percent="item.percent"
  306. :show-percent="false"
  307. height="16prx"
  308. width="423prx"
  309. :round="true"
  310. ></u-line-progress>
  311. </view>
  312. <view class="float_right num">{{ item.numberOrMoney }}</view>
  313. </li>
  314. </ul>
  315. <ul class="progress-ul" v-if="rank_on === 2">
  316. <li class="clearfix progress-li" v-for="(item, index) in ranking.goodsRanking" :key="index">
  317. <view class="float_left label ellipsis">{{ item.goodsName || '未设置' }}</view>
  318. <view class="float_left line">
  319. <u-line-progress
  320. active-color="#4076D6"
  321. :percent="item.percent"
  322. :show-percent="false"
  323. height="16prx"
  324. width="423prx"
  325. :round="true"
  326. ></u-line-progress>
  327. </view>
  328. <view class="float_right num">{{ item.numberOrMoney }}</view>
  329. </li>
  330. </ul>
  331. <ul class="progress-ul" v-if="rank_on === 3">
  332. <li class="clearfix progress-li" v-for="(item, index) in ranking.customerRanking" :key="index">
  333. <view style="width: 450rpx;border: 0;" class="float_left label ellipsis">{{ item.customerName }}</view>
  334. <view style="width: 200rpx;text-align: left;" class="float_right num">{{ item.numberOrMoney }}</view>
  335. </li>
  336. </ul>
  337. <ul class="progress-ul" v-if="rank_on === 4">
  338. <li class="clearfix progress-li ellipsis" v-for="(item, index) in ranking.supplierRanking" :key="index">
  339. <view style="width: 450rpx;border: 0;" class="float_left label">{{ item.supplierName }}</view>
  340. <view style="width: 200rpx;text-align: left;" class="float_right num">{{ item.numberOrMoney }}</view>
  341. </li>
  342. </ul>
  343. </view>
  344. </view>
  345. </view>
  346. </view>
  347. <u-popup
  348. v-model="noticePop"
  349. border-radius="18"
  350. mode="center"
  351. height="905"
  352. :custom-style="{
  353. background: 'rgba(0,0,0,0)'
  354. }"
  355. >
  356. <view class="mag-view">
  357. <view class="mag-top"><image class="notice-i" src="../../static/img/notice-i.png" mode=""></image></view>
  358. <view class="msg-cont">
  359. <image class="msg-yun" src="../../static/img/notice-bg.png" mode=""></image>
  360. <view class="mag-tit">{{ notice_data.title }}</view>
  361. <scroll-view class="mag-main" scroll-y>{{ notice_data.content }}</scroll-view>
  362. </view>
  363. <view class="confirm-btn primary-btn-pain" @click="noticePop = false">我知道了</view>
  364. </view>
  365. </u-popup>
  366. <!-- 底部tabbar -->
  367. <Tabbar v-model="tabbar_current"></Tabbar>
  368. </view>
  369. </template>
  370. <script>
  371. import { mapActions } from 'vuex';
  372. import uniStatusBar from '../../components/uni-status-bar.vue';
  373. export default {
  374. data() {
  375. return {
  376. tabbar_current: 0,
  377. notice_data: {
  378. title: '',
  379. content: ''
  380. },
  381. noticePop: false,
  382. shopData: '',
  383. ranking: [],
  384. now: {}, //
  385. type: true,
  386. businessOverview: {},
  387. active: false,
  388. rank_on: 1,
  389. list: ['快销品', '包装食品', '饼干糕点', '保健品', '营养保健品', '速冻面店', '办公器材', '美容化妆'],
  390. tag: [
  391. {
  392. value: 1,
  393. label: '类目排行',
  394. active: true
  395. },
  396. {
  397. value: 2,
  398. label: '商品排行',
  399. active: false
  400. },
  401. {
  402. value: 3,
  403. label: '客户排行',
  404. active: false
  405. },
  406. {
  407. value: 4,
  408. label: '供应商排行',
  409. active: false
  410. }
  411. ],
  412. chartData: {
  413. categories: [],
  414. series: []
  415. },
  416. tabs_current: 0,
  417. tabs_list: [
  418. {
  419. name: '订单金额'
  420. },
  421. {
  422. name: '客户统计'
  423. },
  424. {
  425. name: '资金统计'
  426. },
  427. {
  428. name: '订单数'
  429. }
  430. ],
  431. ranking_sel: 1,
  432. nav_list: [
  433. [
  434. {
  435. url: '/pages/order/OrderAdd',
  436. label: '代客下单',
  437. icon: 'custom-icon-piliangxiadan',
  438. color: '#f29611',
  439. access: 'OrderAdd'
  440. },
  441. {
  442. url: '/pagesT/stock/SalesOrder',
  443. label: '出库单',
  444. icon: 'custom-icon-quehuoshangpinshu',
  445. color: '#5c6aff',
  446. access: 'InventoryOut'
  447. },
  448. {
  449. url: '/pagesT/customer/StaffList',
  450. label: '销售排行',
  451. icon: 'custom-icon-paihangbang',
  452. color: '#f29611',
  453. access: 'salesRanking'
  454. },
  455. {
  456. url: '/pagesT/customer/CommunicationLogs',
  457. label: '客户拜访',
  458. icon: 'custom-icon-fuwu',
  459. color: '#f29611',
  460. access: 'CustomerListvisitedLogs'
  461. }
  462. ]
  463. ],
  464. scroll_top: 0
  465. };
  466. },
  467. onPageScroll(e) {
  468. this.scroll_top = e.scrollTop;
  469. },
  470. components: {
  471. uniStatusBar
  472. },
  473. computed: {
  474. hasLogin() {
  475. return this.$store.state.hasLogin;
  476. },
  477. userInfo() {
  478. return this.$store.state.userInfo;
  479. },
  480. enterprise() {
  481. return this.$store.state.enterprise;
  482. }
  483. },
  484. watch: {
  485. shopData(val) {}
  486. },
  487. async onLoad() {
  488. // this.noticePop=true
  489. if (!this.hasLogin) {
  490. this.logout();
  491. return;
  492. }
  493. await this.overview();
  494. await this.getupStatusAnnouncementInfo();
  495. await this.getBasicSetup();
  496. },
  497. async onShow() {
  498. await this.getCommonAppInfo();
  499. },
  500. async onPullDownRefresh() {
  501. await this.overview();
  502. await this.getupStatusAnnouncementInfo();
  503. await this.getBasicSetup();
  504. },
  505. onShareAppMessage(res) {},
  506. methods: {
  507. ...mapActions({
  508. logout: 'logout'
  509. }),
  510. setChartData(timeData, orderMoney, goodsNum, orderNum) {
  511. this.chartData = {
  512. categories: timeData,
  513. series: [
  514. {
  515. name: '金额',
  516. data: orderMoney,
  517. // pointShape: 'circle',
  518. legendShape: 'line'
  519. },
  520. {
  521. name: '商品数量',
  522. data: goodsNum,
  523. // pointShape: 'circle',
  524. legendShape: 'line'
  525. },
  526. {
  527. name: '订单数量',
  528. data: orderNum,
  529. // pointShape: 'circle',
  530. legendShape: 'line'
  531. }
  532. ]
  533. };
  534. },
  535. changeTag(val) {
  536. this.rank_on = val;
  537. },
  538. changeSel(val) {
  539. this.ranking_sel = val;
  540. this.overview();
  541. },
  542. async overview(isReset) {
  543. if (isReset) {
  544. uni.showLoading({
  545. title: '加载中...'
  546. });
  547. }
  548. await this.$u.api
  549. .overview({
  550. ranking: this.ranking_sel, // "1销量排行 2销额排行",
  551. businessOverviewShopId: '', // "经营概况按店铺筛选:为空则筛选全店",
  552. categoryRankingShopId: '', // "类目排行按店铺筛选:为空则筛选全店",
  553. goodsRankingShopId: '', // "商品排行按店铺筛选:为空则筛选全店",
  554. supplierRankingShopId: '' // 供应商排行按店铺筛选:为空则筛选全店"
  555. })
  556. .then(res => {
  557. uni.stopPullDownRefresh();
  558. uni.hideLoading();
  559. this.businessOverview = res.data.businessOverview;
  560. this.now = res.data.aggregateStatistics;
  561. this.ranking = res.data.ranking;
  562. const timeData = [];
  563. const goodsNumData = [];
  564. const orderMoneyData = [];
  565. const orderNumData = [];
  566. this.$nextTick(() => {
  567. res.data.chartData.forEach(value => {
  568. const arr = value.date.split('-');
  569. timeData.push(arr[1] + '-' + arr[2]);
  570. goodsNumData.push(Number(value.goodsNum));
  571. orderMoneyData.push(Number(value.orderMoney));
  572. orderNumData.push(Number(value.orderNum));
  573. });
  574. this.setChartData(timeData, orderMoneyData, goodsNumData, orderNumData);
  575. });
  576. })
  577. .catch(err => {
  578. uni.hideLoading();
  579. uni.stopPullDownRefresh();
  580. });
  581. },
  582. async getupStatusAnnouncementInfo() {
  583. await this.$u.api.getupStatusAnnouncementInfo().then(res => {
  584. if (res.data.upStatus === 5) {
  585. this.noticePop = true;
  586. this.notice_data.title = res.data.title;
  587. this.notice_data.content = res.data.content;
  588. } else {
  589. this.noticePop = false;
  590. }
  591. });
  592. },
  593. async getCommonAppInfo() {
  594. await this.$u.api.getCommonAppInfo(this.userInfo.userCenterId).then(res => {
  595. if (res.data.jsonKey) {
  596. const jsonKey = res.data.jsonKey;
  597. if (jsonKey[0].icon.indexOf('ibon') > -1) {
  598. return;
  599. }
  600. //可对一个数进行上舍入
  601. let num = Math.ceil(jsonKey.length / 8);
  602. let arr = [];
  603. for (let i = 0; i < num; i++) {
  604. arr[i] = jsonKey.slice(i * 8, i * 8 + 8);
  605. }
  606. this.nav_list = arr;
  607. }
  608. });
  609. },
  610. // 获取基本设置
  611. async getBasicSetup() {
  612. await this.$u.api.getBasicSetup().then(res => {
  613. if (res.data.basicData) {
  614. this.$store.commit('commit_basicSet', res.data.basicData);
  615. }
  616. });
  617. }
  618. }
  619. };
  620. </script>
  621. <style lang="scss" scoped>
  622. .charts-box {
  623. width: 710rpx;
  624. height: 530rpx;
  625. padding: 24rpx 24rpx 0 0;
  626. background-color: #ffffff;
  627. }
  628. .show {
  629. color: #2d405e;
  630. }
  631. .home {
  632. font-family: DIN-Medium;
  633. .top_bottom {
  634. width: 686rpx;
  635. margin: 0 auto;
  636. background-color: #ffffff;
  637. border-radius: 8rpx;
  638. display: flex;
  639. padding: 32rpx;
  640. flex-wrap: wrap;
  641. transform: translateY(-146rpx);
  642. .money-li {
  643. padding-left: 42rpx;
  644. width: 50%;
  645. color: #2d405e;
  646. padding-top: 20rpx;
  647. &:nth-child(odd) {
  648. border-right: 1px solid #ecf0f7;
  649. }
  650. &:nth-child(2) {
  651. padding-top: 0;
  652. border-bottom: 1px solid #ecf0f7;
  653. }
  654. &:first-child {
  655. padding-top: 0;
  656. border-bottom: 1px solid #ecf0f7;
  657. }
  658. .num {
  659. padding-top: 8px;
  660. font-size: 24rpx;
  661. font-weight: 500;
  662. color: #2d405e;
  663. line-height: 50rpx;
  664. .written {
  665. font-size: 40rpx;
  666. }
  667. }
  668. }
  669. }
  670. .top_view {
  671. padding: 0 32rpx 164rpx;
  672. // height: calc(500rpx + var(--status-bar-height));
  673. background: linear-gradient(#4076d6, #4076d6, #4076d6, #4076d6, #f5f5f6 100%);
  674. .title {
  675. padding-left: 32rpx;
  676. font-size: 32rpx;
  677. font-weight: 500;
  678. color: #ffffff;
  679. }
  680. .user_img {
  681. margin-top: 52rpx;
  682. .img {
  683. float: left;
  684. image {
  685. margin-right: 8rpx;
  686. vertical-align: middle;
  687. width: 68rpx;
  688. height: 68rpx;
  689. border-radius: 100%;
  690. border: 4rpx solid #ffffff;
  691. background-color: #ffffff;
  692. }
  693. .img_title {
  694. line-height: 68rpx;
  695. vertical-align: middle;
  696. font-size: 28rpx;
  697. font-weight: 500;
  698. color: #ffffff;
  699. }
  700. }
  701. .Icon {
  702. float: right;
  703. line-height: 72rpx;
  704. .btn-li {
  705. font-weight: bold;
  706. width: 50rpx;
  707. height: 50rpx;
  708. background-color: #ffffff;
  709. display: inline-block;
  710. text-align: center;
  711. vertical-align: middle;
  712. margin-left: 30rpx;
  713. line-height: 50rpx;
  714. border-radius: 6rpx;
  715. }
  716. }
  717. }
  718. .top_money {
  719. color: #ffffff;
  720. margin-top: 52rpx;
  721. .float_right {
  722. font-size: 34rpx;
  723. font-weight: 400;
  724. font-family: DINPro-Regular;
  725. .rmb-icon {
  726. margin-right: 4rpx;
  727. font-size: 24rpx;
  728. }
  729. }
  730. }
  731. .txst {
  732. width: 141rpx;
  733. height: 33px;
  734. font-size: 24px;
  735. font-weight: 400;
  736. color: #2d405e;
  737. line-height: 33px;
  738. }
  739. }
  740. .content {
  741. transform: translateY(-120rpx);
  742. .content_main {
  743. margin: 24rpx auto;
  744. width: 710rpx;
  745. border-radius: 12rpx;
  746. overflow: hidden;
  747. .content_top {
  748. background: linear-gradient(270deg, #fcfdff 0%, #e2ebff 100%);
  749. line-height: 40rpx;
  750. height: 80rpx;
  751. line-height: 80rpx;
  752. padding: 0 24rpx;
  753. overflow: hidden;
  754. .img {
  755. width: 40rpx;
  756. height: 40rpx;
  757. display: inline-block;
  758. margin-right: 16rpx;
  759. vertical-align: middle;
  760. }
  761. .title-text {
  762. font-size: 32rpx;
  763. font-weight: 600;
  764. color: #2d405e;
  765. vertical-align: middle;
  766. }
  767. .edit-btn {
  768. margin-left: 20rpx;
  769. display: inline-block;
  770. }
  771. &.tabs-ul {
  772. overflow: auto;
  773. height: 88rpx;
  774. padding: 0rpx;
  775. background: transparent;
  776. .ul_tag {
  777. display: flex;
  778. width: 710rpx;
  779. height: 72rpx;
  780. line-height: 72rpx;
  781. transform: translateY(16rpx);
  782. background: linear-gradient(217deg, #ffffff 0%, #ecf0f7 100%);
  783. .ul_tag_item {
  784. flex: 4;
  785. width: 177rpx;
  786. text-align: center;
  787. font-size: 24rpx;
  788. font-weight: 400;
  789. color: #62738e;
  790. }
  791. .hover {
  792. font-weight: 400;
  793. height: 88rpx;
  794. line-height: 88rpx;
  795. background-color: #4076d6;
  796. color: #ffffff;
  797. font-size: 28rpx;
  798. transform: translateY(-16rpx);
  799. border-radius: 8rpx 8rpx 0rpx 0rpx;
  800. }
  801. }
  802. }
  803. }
  804. .content_bottom {
  805. width: 710rpx;
  806. background-color: #ffffff;
  807. padding-top: 38rpx;
  808. .bottom_top {
  809. padding: 0 32rpx;
  810. height: 50rpx;
  811. line-height: 50rpx;
  812. font-size: 28rpx;
  813. .float_right {
  814. width: 210rpx;
  815. height: 50rpx;
  816. border-radius: 25rpx;
  817. border: 2rpx solid #b8c0c8;
  818. text-align: center;
  819. line-height: 36rpx;
  820. }
  821. .sale {
  822. font-size: 28rpx;
  823. width: 56rpx;
  824. height: 40rpx;
  825. color: #b8c0c8;
  826. margin-left: 32rpx;
  827. margin-right: 20rpx;
  828. }
  829. .sale_num {
  830. font-size: 28rpx;
  831. width: 56rpx;
  832. font-weight: 400;
  833. color: #b8c0c8;
  834. margin-left: 20rpx;
  835. }
  836. .show-on {
  837. font-size: 28rpx;
  838. font-weight: 500;
  839. color: #2d405e;
  840. }
  841. .sel {
  842. padding: 10rpx;
  843. font-size: 28rpx;
  844. width: 210rpx;
  845. border-radius: 25rpx;
  846. border: 2rpx solid #b8c0c8;
  847. margin-left: 320rpx;
  848. color: #b8c0c8;
  849. }
  850. }
  851. }
  852. .content_text {
  853. background-color: #ffffff;
  854. .content-ul {
  855. display: flex;
  856. flex-wrap: wrap;
  857. padding: 0 24rpx;
  858. .li-list {
  859. width: 33.3333%;
  860. text-align: center;
  861. margin-top: 10rpx;
  862. padding-bottom: 32rpx;
  863. padding-top: 40rpx;
  864. border-bottom: 1px solid #ecf0f7;
  865. position: relative;
  866. &::after {
  867. content: '';
  868. display: block;
  869. width: 1px;
  870. height: 120rpx;
  871. position: absolute;
  872. background-color: #ecf0f7;
  873. right: 0;
  874. top: 50%;
  875. transform: translateY(-48%);
  876. }
  877. &:nth-child(5),
  878. &:nth-child(4) {
  879. padding-top: 32rpx;
  880. padding-bottom: 40rpx;
  881. border-bottom: 0;
  882. }
  883. &:nth-child(3),
  884. &:last-child {
  885. &::after {
  886. height: 0;
  887. width: 0;
  888. }
  889. }
  890. .num {
  891. font-size: 44rpx;
  892. font-weight: 500;
  893. color: #2d405e;
  894. line-height: 56rpx;
  895. height: 56rpx;
  896. padding-top: 12rpx;
  897. }
  898. .order_money {
  899. font-size: 24rpx;
  900. font-weight: 400;
  901. color: #b8c0c8;
  902. line-height: 33rpx;
  903. }
  904. .txt {
  905. font-size: 20rpx;
  906. font-weight: 400;
  907. color: #62738e;
  908. line-height: 28rpx;
  909. }
  910. .time {
  911. font-size: 20rpx;
  912. font-weight: 400;
  913. color: #62738e;
  914. line-height: 45rpx;
  915. }
  916. &.bottom-li {
  917. width: 50%;
  918. }
  919. }
  920. }
  921. }
  922. }
  923. }
  924. }
  925. .cont {
  926. .swiper {
  927. width: 710rpx;
  928. height: 400rpx;
  929. .app-ul {
  930. padding: 40rpx 0 0;
  931. display: flex;
  932. flex-wrap: wrap;
  933. background-color: #ffffff;
  934. height: 400rpx;
  935. .app-li {
  936. text-align: center;
  937. width: 25%;
  938. margin-bottom: 40rpx;
  939. .icon-view {
  940. width: 72rpx;
  941. height: 72rpx;
  942. line-height: 72rpx;
  943. border-radius: 30rpx;
  944. margin: 0 auto;
  945. .custom-icon {
  946. font-size: 42rpx;
  947. color: #ffffff;
  948. }
  949. }
  950. .label {
  951. font-size: 26rpx;
  952. line-height: 36rpx;
  953. padding-top: 16rpx;
  954. color: #2d405e;
  955. }
  956. }
  957. }
  958. }
  959. }
  960. .progress-ul {
  961. padding-bottom: 40rpx;
  962. .progress-li {
  963. line-height: 90rpx;
  964. .label {
  965. width: 152rpx;
  966. text-align: right;
  967. border-right: 1px solid #dddddd;
  968. padding-right: 12rpx;
  969. color: #2d405e;
  970. font-size: 24rpx;
  971. font-weight: 400;
  972. }
  973. .line {
  974. width: 400rpx;
  975. }
  976. .num {
  977. color: #5c79b0;
  978. font-size: 24rpx;
  979. margin-right: 30rpx;
  980. }
  981. }
  982. }
  983. .mag-view {
  984. text-align: center;
  985. transform: translateY(100rpx);
  986. background-color: #ffffff;
  987. width: 612rpx;
  988. border-radius: 18rpx;
  989. padding-bottom: 46rpx;
  990. .mag-top {
  991. height: 242rpx;
  992. border-radius: 18rpx;
  993. background-color: $uni-color-primary;
  994. width: 100%;
  995. position: relative;
  996. .notice-i {
  997. width: 422rpx;
  998. height: 312rpx;
  999. position: absolute;
  1000. top: -100rpx;
  1001. left: 140rpx;
  1002. }
  1003. }
  1004. .msg-cont {
  1005. padding: 0 50rpx;
  1006. padding-top: 56rpx;
  1007. position: relative;
  1008. .msg-yun {
  1009. position: absolute;
  1010. width: 622rpx;
  1011. height: 215rpx;
  1012. left: 0;
  1013. top: -116rpx;
  1014. z-index: 1;
  1015. }
  1016. .mag-main {
  1017. height: 200rpx;
  1018. }
  1019. .mag-tit {
  1020. position: relative;
  1021. z-index: 9;
  1022. font-size: 38upx;
  1023. font-weight: bold;
  1024. padding-bottom: 30rpx;
  1025. }
  1026. }
  1027. .confirm-btn {
  1028. line-height: 90rpx;
  1029. height: 90rpx;
  1030. font-size: 34rpx;
  1031. width: 506rpx;
  1032. margin: 30rpx auto 0;
  1033. border: 1px solid $uni-color-primary;
  1034. color: $uni-color-primary;
  1035. border-radius: 12rpx;
  1036. }
  1037. }
  1038. </style>