index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <view class="tongji">
  3. <view class="content">
  4. <view class="title-box">
  5. <view class="icon-box">
  6. <image class="icon" src="../../static/images/order/icon1.png" mode=""></image>
  7. <view class="title">服务数据</view>
  8. </view>
  9. </view>
  10. <view class="box">
  11. <view class="text-center">
  12. <view class="tit">{{ordersScore}}</view>
  13. <view class="label">综合评分</view>
  14. </view>
  15. <view class="text-center">
  16. <view class="tit">{{succeedRate}}%</view>
  17. <view class="label">成交量</view>
  18. </view>
  19. <view class="text-center">
  20. <view class="tit">{{sumCount}}</view>
  21. <view class="label">服务次数</view>
  22. </view>
  23. <view class="text-center">
  24. <view class="tit">{{creditScore}}</view>
  25. <view class="label">信用分</view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="content red">
  30. <view class="title-box">
  31. <view class="icon-box">
  32. <image class="icon" src="../../static/images/order/icon2.png" mode=""></image>
  33. <view class="title">收益数据</view>
  34. </view>
  35. <view class="flex align-center padding-left">
  36. <image src="../../static/images/data.png" style="width: 26upx;height: 26upx;"></image>
  37. <view class="margin-left-xs flex align-center time" >
  38. <view @click="bindData(5)">{{startTimes?startTimes:'开始时间'}}</view>
  39. <view @click="bindData(6)">{{endTimes?endTimes:'结束时间'}}</view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="box">
  44. <view class="text-center">
  45. <view class="tit">{{sumMoney5 ? sumMoney5 : 0}}</view>
  46. <view class="label">总收益</view>
  47. </view>
  48. <view class="text-center">
  49. <view class="tit">{{sumCount5}}</view>
  50. <view class="label">总销量</view>
  51. </view>
  52. <view class="text-center">
  53. <view class="tit">{{sumRefund5}}</view>
  54. <view class="label">退款金额</view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="content green">
  59. <view class="title-box">
  60. <view class="icon-box">
  61. <image class="icon" src="../../static/images/order/icon3.png" mode=""></image>
  62. <view class="title">订单数据</view>
  63. </view>
  64. <view class="flex align-center padding-left">
  65. <image src="../../static/images/data.png" style="width: 30rpx;height: 30rpx;"></image>
  66. <view class="margin-left-xs flex align-center time" >
  67. <view @click="bindData(1)">{{startTime?startTime:'开始时间'}}</view>
  68. <view @click="bindData(2)">{{endTime?endTime:'结束时间'}}</view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="box">
  73. <view class="text-center">
  74. <view class="tit">{{orderMoney}}</view>
  75. <view class="label">订单收入</view>
  76. </view>
  77. <view class="text-center">
  78. <view class="tit">{{sumCount1}}</view>
  79. <view class="label">总订单数</view>
  80. </view>
  81. <view class="text-center">
  82. <view class="tit">{{sumRefund}}</view>
  83. <view class="label">退款金额</view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="content yellow">
  88. <view class="title-box">
  89. <view class="icon-box">
  90. <image class="icon" src="../../static/images/order/icon4.png" mode=""></image>
  91. <view class="title">用户评价</view>
  92. </view>
  93. <view class="flex align-center padding-left">
  94. <image src="../../static/images/data.png" style="width: 26upx;height: 26upx;"></image>
  95. <view class="margin-left-xs flex align-center time" >
  96. <view @click="bindData(3)">{{startTime1?startTime1:'开始时间'}}</view>
  97. <view @click="bindData(4)">{{endTime1?endTime1:'结束时间'}}</view>
  98. </view>
  99. </view>
  100. </view>
  101. <view class="box1">
  102. <view class="bar-box">
  103. <view class="bar-content">
  104. <view class="label-title">
  105. 用户好评率
  106. </view>
  107. <view class="num">
  108. {{goodsRate}}%
  109. </view>
  110. </view>
  111. <view class="bar" :style="{width:goodsRate+'%'}"></view>
  112. </view>
  113. <view class="bar-box">
  114. <view class="bar-content">
  115. <view class="label-title">
  116. 用户差评率
  117. </view>
  118. <view class="num">
  119. {{loseRate}}%
  120. </view>
  121. </view>
  122. <view class="bar" :style="{width:loseRate+'%'}"></view>
  123. </view>
  124. </view>
  125. </view>
  126. <!-- 开始时间 -->
  127. <u-picker v-model="startshow" mode="time" :params="paramsStart" @confirm="startData"></u-picker>
  128. <!-- 结束时间 -->
  129. <u-picker v-model="endshow" mode="time" :params="paramsEnd" @confirm="endData"></u-picker>
  130. <!-- 开始时间 -->
  131. <u-picker v-model="startshows" mode="time" :params="paramsStarts" @confirm="startDatas"></u-picker>
  132. <!-- 结束时间 -->
  133. <u-picker v-model="endshows" mode="time" :params="paramsEnds" @confirm="endDatas"></u-picker>
  134. <!-- 开始时间 -->
  135. <u-picker v-model="startshow1" mode="time" :params="paramsStart1" @confirm="startData1"></u-picker>
  136. <!-- 结束时间 -->
  137. <u-picker v-model="endshow1" mode="time" :params="paramsEnd1" @confirm="endData1"></u-picker>
  138. </view>
  139. </view>
  140. </template>
  141. <script>
  142. export default {
  143. data() {
  144. return {
  145. succeedRate: 0,
  146. sumMoney5: 0,
  147. sumCount5: 0,
  148. sumRefund5: 0,
  149. sumMoney: 0,
  150. ordersScore: 0,
  151. creditScore: 0,
  152. orderMoney: 0,
  153. sumCount: 0,
  154. sumCount1: 0,
  155. sumRefund: 0,
  156. goodsRate: 0,
  157. loseRate: 0,
  158. startshow: false,
  159. endshow: false,
  160. paramsStart: {
  161. year: true,
  162. month: true,
  163. day: true,
  164. hour: false,
  165. minute: false,
  166. second: false
  167. },
  168. paramsEnd: {
  169. year: true,
  170. month: true,
  171. day: true,
  172. hour: false,
  173. minute: false,
  174. second: false
  175. },
  176. startTime: '',
  177. endTime: '',
  178. startTime1: '',
  179. endTime1: '',
  180. startshow1: false,
  181. endshow1: false,
  182. paramsStart1: {
  183. year: true,
  184. month: true,
  185. day: true,
  186. hour: false,
  187. minute: false,
  188. second: false
  189. },
  190. paramsEnd1: {
  191. year: true,
  192. month: true,
  193. day: true,
  194. hour: false,
  195. minute: false,
  196. second: false
  197. },
  198. startTimes: '',
  199. endTimes: '',
  200. startshows: false,
  201. endshows: false,
  202. paramsStarts: {
  203. year: true,
  204. month: true,
  205. day: true,
  206. hour: false,
  207. minute: false,
  208. second: false
  209. },
  210. paramsEnds: {
  211. year: true,
  212. month: true,
  213. day: true,
  214. hour: false,
  215. minute: false,
  216. second: false
  217. },
  218. }
  219. },
  220. onLoad() {
  221. this.getArtificer();
  222. this.getCount();
  223. this.getCount1();
  224. this.getCount5();
  225. this.getCount3();
  226. },
  227. onShow() {
  228. },
  229. methods: {
  230. //获取技师的信息
  231. getArtificer() {
  232. this.$Request.getT("/app/artificer/selectArtificer").then(res => {
  233. if (res.code == 0) {
  234. this.ordersScore = res.data.ordersScore ? res.data.ordersScore : 0;
  235. this.creditScore = res.data.creditScore ? res.data.creditScore : 0;
  236. // uni.setStorageSync("status", res.data.status)
  237. uni.setStorageSync('artificerId', res.data.artificerId)
  238. }
  239. });
  240. },
  241. getCount() {
  242. this.$Request.get("/app/artificer/selectArtificerIndex").then(res => {
  243. if (res.code == 0) {
  244. this.sumMoney = res.data.sumMoney;
  245. this.succeedRate = res.data.succeedRate ? parseFloat(parseFloat(res.data.succeedRate) * 100).toFixed(2) : 0;
  246. this.sumCount = res.data.sumCount;
  247. }
  248. })
  249. },
  250. getCount3() {
  251. this.$Request.get("/app/artificer/selectArtificerIndex?startTime=" + this.startTime1 + '&endTime=' + this
  252. .endTime1).then(res => {
  253. if (res.code == 0) {
  254. this.goodsRate = res.data.goodsRate ? parseFloat(parseFloat(res.data.goodsRate) * 100).toFixed(2): 0;
  255. this.loseRate = res.data.loseRate ? parseFloat(parseFloat(res.data.loseRate) * 100).toFixed(2) : 0;
  256. }
  257. })
  258. },
  259. getCount1() {
  260. this.$Request.get("/app/artificer/selectArtificerIndex?startTime=" + this.startTime + '&endTime=' + this
  261. .endTime).then(res => {
  262. if (res.code == 0) {
  263. this.sumRefund = res.data.sumRefund;
  264. this.sumCount1 = res.data.countOrder;
  265. this.orderMoney = res.data.orderMoney;
  266. }
  267. })
  268. },
  269. getCount5() {
  270. this.$Request.get("/app/artificer/selectArtificerIndex?startTime=" + this.startTimes + '&endTime=' + this
  271. .endTimes).then(res => {
  272. if (res.code == 0) {
  273. this.sumMoney5 = res.data.sumMoney;
  274. this.sumCount5 = res.data.countOrderNum;
  275. this.sumRefund5 = res.data.sumRefund;
  276. }
  277. })
  278. },
  279. //时间弹框开关
  280. bindData(index) {
  281. // console.log(index, 1111)
  282. if (index == 1) {
  283. this.startshow = true
  284. } else if (index == 2) {
  285. this.endshow = true
  286. } else if (index == 3) {
  287. this.startshow1 = true
  288. } else if (index == 4) {
  289. this.endshow1 = true
  290. } else if (index == 5) {
  291. this.startshows = true
  292. } else if (index == 6) {
  293. this.endshows = true
  294. }
  295. },
  296. //开始时间
  297. startData(e) {
  298. // console.log(e)
  299. this.startTime = e.year + '-' + e.month + '-' + e.day
  300. },
  301. // 结束时间
  302. endData(e) {
  303. if (this.startTime) {
  304. this.endTime = e.year + '-' + e.month + '-' + e.day
  305. this.getCount1();
  306. } else {
  307. this.$queue.showToast("请先选择开始时间");
  308. }
  309. },
  310. //开始时间
  311. startData1(e) {
  312. this.startTime1 = e.year + '-' + e.month + '-' + e.day
  313. },
  314. // 结束时间
  315. endData1(e) {
  316. if (this.startTime1) {
  317. this.endTime1 = e.year + '-' + e.month + '-' + e.day
  318. this.getCount3();
  319. } else {
  320. this.$queue.showToast("请先选择开始时间");
  321. }
  322. },
  323. //开始时间
  324. startDatas(e) {
  325. this.startTimes = e.year + '-' + e.month + '-' + e.day
  326. },
  327. // 结束时间
  328. endDatas(e) {
  329. if (this.startTimes) {
  330. this.endTimes = e.year + '-' + e.month + '-' + e.day
  331. this.getCount5();
  332. } else {
  333. this.$queue.showToast("请先选择开始时间");
  334. }
  335. },
  336. }
  337. }
  338. </script>
  339. <style lang="scss">
  340. .tongji {
  341. background: #F5F5F5;
  342. padding: 20rpx 32rpx;
  343. height: 100vh;
  344. .content{
  345. background: linear-gradient( 180deg, #ECF4FF 0%, #FFFFFF 100%);
  346. border-radius: 32rpx 32rpx 32rpx 32rpx;
  347. padding: 28rpx;
  348. margin-bottom: 20rpx;
  349. }
  350. .content.red{
  351. background: linear-gradient( 180deg, #FFF6F6 0%, #FFFFFF 100%);
  352. }
  353. .content.green{
  354. background: linear-gradient( 180deg, #ECFFF4 0%, #FFFFFF 100%);
  355. }
  356. .content.yellow{
  357. background: linear-gradient( 180deg, #FFF8EC 0%, #FFFFFF 100%);
  358. }
  359. .title-box{
  360. display: flex;
  361. align-items: center;
  362. justify-content: space-between;
  363. .icon-box{
  364. display: flex;
  365. align-items: center;
  366. .icon{
  367. width: 40rpx;
  368. height: 40rpx;
  369. }
  370. .title {
  371. font-weight: bold;
  372. font-size: 32rpx;
  373. color: #222222;
  374. font-family: PingFang SC, PingFang SC;
  375. margin-left: 16rpx;
  376. }
  377. }
  378. .time{
  379. font-size: 28rpx;
  380. color: #222222;
  381. }
  382. }
  383. .box {
  384. display: flex;
  385. justify-content: space-between;
  386. }
  387. .tit {
  388. font-family: PingFang SC, PingFang SC;
  389. font-weight: bold;
  390. font-size: 36rpx;
  391. color: #222222;
  392. margin-top: 24rpx;
  393. }
  394. .label{
  395. font-size: 28rpx;
  396. color: #222222;
  397. margin-top: 20rpx;
  398. }
  399. }
  400. .box1 {
  401. .bar-box{
  402. height: 60rpx;
  403. line-height: 60rpx;
  404. box-sizing: border-box;
  405. margin-top: 20rpx;
  406. position: relative;
  407. z-index: 10;
  408. background: #F5F6F6;
  409. border-radius: 30rpx 30rpx 30rpx 30rpx;
  410. .bar-content{
  411. display: flex;
  412. align-items: center;
  413. margin-left: 28rpx;
  414. .label-title{
  415. font-size: 28rpx;
  416. color: #222222;
  417. }
  418. .num{
  419. font-weight: bold;
  420. font-size: 36rpx;
  421. color: #222222;
  422. margin-left: 6rpx;
  423. }
  424. }
  425. .bar{
  426. position: absolute;
  427. top: 0%;
  428. left: 0;
  429. z-index: -1;
  430. background: #FFBC42;
  431. height: 60rpx;
  432. border-radius: 30rpx 30rpx 30rpx 30rpx;
  433. }
  434. }
  435. }
  436. </style>