index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <template>
  2. <view class="page" :style="{'padding-top':mt+'px'}">
  3. <c-nav-bar title="统计" :showIcon="false"></c-nav-bar>
  4. <view class="hander">
  5. <!-- 2024年1月 -->
  6. <view
  7. class="tn-flex tn-flex-col-center tn-margin-right tn-padding-xs tn-text-sm tn-bg-gray--light tn-radius tn-color-gray--dark"
  8. style="border-radius: 12rpx; width: 160rpx;">
  9. <picker @change="bindDateChange" mode="date" :value="date" :start="startDate" :end="endDate"
  10. fields="month">
  11. <text class="tn-padding-left-xs tn-padding-right-xs">{{date}}
  12. </text>
  13. </picker>
  14. </view>
  15. <view style="width: 60rpx; line-height: 48rpx; height: 48rpx; margin: 15rpx 0 ; ">
  16. <u-icon name="arrow-down" color="#000000" size="20"></u-icon>
  17. </view>
  18. </view>
  19. <view class="hander-price">
  20. <view class="one">
  21. <view class="left">
  22. 总营业额
  23. </view>
  24. <view class="right">
  25. 共{{list.totalNums}}笔
  26. </view>
  27. </view>
  28. <view class="two">
  29. <text>¥</text>
  30. <text>{{list.totalAmount}}</text>
  31. </view>
  32. </view>
  33. <view class="echarts-one">
  34. <view class="title">
  35. 营业概况
  36. </view>
  37. <view class="hander-content">
  38. <view class="list">
  39. <view class="title">
  40. 房费
  41. </view>
  42. <view class="price">
  43. {{list.roomAmount}}
  44. </view>
  45. </view>
  46. <view class="list">
  47. <view class="title">
  48. 商品
  49. </view>
  50. <view class="price">
  51. {{list.breakfastAmount}}
  52. </view>
  53. </view>
  54. <view class="list">
  55. <view class="title">
  56. 其他
  57. </view>
  58. <view class="price">
  59. {{list.othersAmount}}
  60. </view>
  61. </view>
  62. </view>
  63. <view class="Pie_charts">
  64. <PieCharts></PieCharts>
  65. </view>
  66. </view>
  67. <view class="echarts-two">
  68. <view class="title">
  69. 交易趋势
  70. </view>
  71. <view class="title1">
  72. 单位:元
  73. </view>
  74. <view class="line_charts_one">
  75. <LineOne />
  76. </view>
  77. </view>
  78. <view class="echarts-three">
  79. <view>
  80. <view class="title">
  81. 入住率
  82. </view>
  83. <view class="title1">
  84. 入住率(%)
  85. </view>
  86. </view>
  87. <view class="line_charts_two">
  88. <LineTwo />
  89. </view>
  90. </view>
  91. <Tabbar :tabbarIndex="2"></Tabbar>
  92. </view>
  93. </template>
  94. <script>
  95. // import uCharts from '@/utils/u-charts.js';
  96. import PieCharts from "@/components/Charts/PieCharts.vue"
  97. import LineOne from "@/components/Charts/LineOne.vue"
  98. import LineTwo from "@/components/Charts/LineTwo.vue"
  99. export default {
  100. components: {
  101. PieCharts,
  102. LineOne,
  103. LineTwo
  104. },
  105. data() {
  106. return {
  107. h: uni.getSystemInfoSync().windowHeight,
  108. mt: uni.getSystemInfoSync().statusBarHeight + 54,
  109. date: '2024-01',
  110. fromData: {
  111. dateDay: '2024-01',
  112. homestayId: '1744620500506251265'
  113. },
  114. list: {}
  115. }
  116. },
  117. onReady() {
  118. this.getList()
  119. },
  120. methods: {
  121. bindDateChange(e) {
  122. this.date = e.detail.value
  123. this.fromData.dateDay = e.detail.value
  124. this.getList()
  125. },
  126. // 时间
  127. startDate() {
  128. return this.getDate('start')
  129. },
  130. endDate() {
  131. return this.getDate('end')
  132. },
  133. getList() {
  134. this.$api.get('/merchant/hotel/mine/getHotelCountInfo', this.fromData).then(res => {
  135. console.log(res);
  136. this.list = res.data.data
  137. wx.setStorageSync('fromData', this.list)
  138. })
  139. },
  140. }
  141. }
  142. </script>
  143. <style scoped lang="less">
  144. .charts-box {
  145. width: 100%;
  146. height: 630rpx;
  147. }
  148. .page {
  149. background: #F3F4F4;
  150. padding-bottom: 40rpx;
  151. box-sizing: border-box;
  152. // overflow-y: auto;
  153. padding: 20rpx 30rpx;
  154. // height: 100%;
  155. }
  156. .hander {
  157. height: 48rpx;
  158. width: 216rpx;
  159. border-radius: 8rpx;
  160. background-color: #fff;
  161. text-align: center;
  162. line-height: 48rpx;
  163. display: flex !important;
  164. justify-content: space-between !important;
  165. }
  166. .hander-price {
  167. margin-top: 20rpx;
  168. width: 100%;
  169. height: 192rpx;
  170. padding: 30rpx;
  171. box-sizing: border-box;
  172. border-radius: 10rpx;
  173. background-color: #fff;
  174. .one {
  175. display: flex;
  176. justify-content: space-between;
  177. .left {
  178. font-size: 32rpx;
  179. color: #333333;
  180. font-weight: Heavy;
  181. font-family: PingFang SC-Heavy;
  182. }
  183. .right {
  184. font-size: 24rpx;
  185. color: #333333;
  186. font-weight: Regular;
  187. font-family: PingFang SC-Regular;
  188. }
  189. }
  190. .two {
  191. margin-top: 20rpx;
  192. font-size: 48rpx;
  193. color: #1372FF;
  194. font-weight: Heavy;
  195. font-family: PingFang SC-Heavy;
  196. }
  197. }
  198. .echarts-one {
  199. box-sizing: border-box;
  200. width: 100%;
  201. height: 829rpx;
  202. background-color: #fff;
  203. margin: 20rpx 0;
  204. border-radius: 10rpx;
  205. padding: 30rpx;
  206. .title {
  207. font-size: 32rpx;
  208. color: #333333;
  209. font-weight: Heavy;
  210. font-family: PingFang SC-Heavy;
  211. }
  212. .hander-content {
  213. margin-top: 40rpx;
  214. display: flex;
  215. justify-content: space-between;
  216. height: 110rpx;
  217. .title {
  218. font-size: 28rpx;
  219. color: #777777;
  220. font-weight: Regular;
  221. font-family: PingFang SC-Regular;
  222. }
  223. .price {
  224. margin-top: 10rpx;
  225. font-size: 28rpx;
  226. color: #333;
  227. font-weight: Bold;
  228. font-family: PingFang SC-Bold;
  229. }
  230. }
  231. .Pie_charts {
  232. height: 600rpx;
  233. width: 630rpx;
  234. // background-color: aqua;
  235. }
  236. }
  237. .echarts-two {
  238. box-sizing: border-box;
  239. width: 100%;
  240. height: 543rpx;
  241. background-color: #fff;
  242. margin: 20rpx 0;
  243. border-radius: 10rpx;
  244. padding: 30rpx;
  245. .title {
  246. font-size: 32rpx;
  247. color: #333333;
  248. font-weight: Heavy;
  249. font-family: PingFang SC-Heavy;
  250. }
  251. .title1 {
  252. margin-left: 20rpx;
  253. margin-top: 20rpx;
  254. font-size: 20rpx;
  255. color: #333333;
  256. font-weight: Regular;
  257. font-family: PingFang SC-Regular;
  258. }
  259. .line_charts_one {
  260. width: 630rpx;
  261. height: 388rpx;
  262. // background-color: aqua;
  263. }
  264. }
  265. .echarts-three {
  266. box-sizing: border-box;
  267. width: 100%;
  268. height: 540rpx;
  269. background-color: #fff;
  270. margin: 20rpx 0;
  271. border-radius: 10rpx;
  272. padding: 30rpx;
  273. .title {
  274. font-size: 32rpx;
  275. color: #333333;
  276. font-weight: Heavy;
  277. font-family: PingFang SC-Heavy;
  278. }
  279. .title1 {
  280. margin-left: 20rpx;
  281. margin-top: 20rpx;
  282. font-size: 20rpx;
  283. color: #333333;
  284. font-weight: Regular;
  285. font-family: PingFang SC-Regular;
  286. }
  287. .line_charts_two {
  288. width: 630rpx;
  289. height: 388rpx;
  290. // background-color: aqua;
  291. }
  292. }
  293. </style>