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