index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view>
  3. <view class="head" />
  4. <view class="carousel">
  5. <u-swiper :list="list" mode="rect" bg-color="#ffffff"></u-swiper>
  6. </view>
  7. <view class="lantern">
  8. <u-icon color="#348CF5" size="36" name="volume-fill" label="公告"
  9. style="float: left;margin-top: 15rpx;padding-left: 20rpx;"></u-icon>
  10. <view style="width: 100%;margin-top: 20rpx;">
  11. <u-notice-bar :volume-icon="false" type="primary" bg-color="#fff" volume-size="50" mode="vertical"
  12. :list="liSt">
  13. </u-notice-bar>
  14. </view>
  15. </view>
  16. <view class="order">
  17. <view class="box">
  18. <view @click="myorder">
  19. <text class="numer">{{meter.count}}</text>
  20. <view class="grid-text">新订单</view>
  21. </view>
  22. <view>
  23. <text class="numer">{{meter.countOrders}}</text>
  24. <view class="grid-text">本月订单</view>
  25. </view>
  26. <view>
  27. <text class="numer">{{meter.miles}}<text>km</text></text>
  28. <view class="grid-text">本月里程</view>
  29. </view>
  30. <view>
  31. <text class="numer">{{meter.freightAmtDr}}<text>元</text></text>
  32. <view class="grid-text">本月运费</view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="service">
  37. <view @click="myorder">
  38. <img style="width: 80rpx;height: 80rpx;" src="./../../static/我的订单.png" alt="">
  39. <view>我的订单</view>
  40. </view>
  41. <view @click="exceptionEntry">
  42. <img style="width: 80rpx;height: 80rpx;" src="./../../static/我的绩效.png" alt="">
  43. <view>我的绩效</view>
  44. </view>
  45. <view @click="exceptionEntry">
  46. <img style="width: 80rpx;height: 80rpx;" src="./../../static/异常录入.png" alt="">
  47. <view>异常录入</view>
  48. </view>
  49. <view @click="expenseEntry">
  50. <img style="width: 80rpx;height: 80rpx;" src="./../../static/费用录入.png" alt="">
  51. <view>费用录入</view>
  52. </view>
  53. </view>
  54. <u-toast ref="repeat" position="bottom" />
  55. </view>
  56. </template>
  57. <script>
  58. import {
  59. request
  60. } from '@/common/request/request'
  61. export default {
  62. data() {
  63. return {
  64. list: [{
  65. image: 'https://www.dmu.com.cn/images/banner/banner41.jpg?v=2',
  66. title: '昨夜星辰昨夜风,画楼西畔桂堂东'
  67. },
  68. {
  69. image: 'https://www.dmu.com.cn/images/banner/banner1.jpg?v=1',
  70. title: '身无彩凤双飞翼,心有灵犀一点通'
  71. },
  72. {
  73. image: 'https://www.dmu.com.cn/images/banner/banner2.jpg?v=1',
  74. title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
  75. }
  76. ],
  77. liSt: [
  78. '庆祝靖润物流小程序上线'
  79. ],
  80. meter: {
  81. count: 0, //新订单
  82. miles: 0, //里程
  83. freightAmtDr: 0, //运费
  84. countOrders: 0
  85. }
  86. }
  87. },
  88. created() {
  89. uni.showLoading({
  90. title: '加载中'
  91. });
  92. setTimeout(function() {
  93. uni.hideLoading();
  94. }, 1000);
  95. // #ifdef MP-WEIXIN
  96. if (wx.hideHomeButton) {
  97. wx.hideHomeButton();
  98. }
  99. // #endif
  100. },
  101. onShow() {
  102. this.statistics()
  103. },
  104. onPullDownRefresh() {
  105. //监听下拉刷新动作的执行方法,每次手动下拉刷新都会执行一次
  106. this.statistics()
  107. setTimeout(function() {
  108. uni.stopPullDownRefresh(); //停止下拉刷新动画
  109. }, 1000);
  110. },
  111. methods: {
  112. myorder() {
  113. uni.navigateTo({
  114. url: 'myorder/index'
  115. });
  116. },
  117. statistics() {
  118. request({
  119. url: '/fleet/ftmsorderbillscars/selectDriverPerformance',
  120. method: 'get',
  121. params: {
  122. phonenumber: uni.getStorageSync('cell_phone')
  123. }
  124. }).then(res => {
  125. console.log(res)
  126. if (res.data.code == 500) {
  127. uni.showToast({
  128. icon: 'none',
  129. title: res.data.msg,
  130. position: "bottom"
  131. })
  132. } else if (res.data.code == 200) {
  133. this.meter = res.data.data
  134. console.log(this.meter)
  135. if (!this.meter.count) {
  136. this.meter.count = 0
  137. }
  138. if (!this.meter.miles) {
  139. this.meter.miles = 0
  140. }
  141. if (!this.meter.freightAmtDr) {
  142. this.meter.freightAmtDr = 0
  143. }
  144. if (!this.meter.countOrders) {
  145. this.meter.countOrders = 0
  146. }
  147. }
  148. }).catch(err => {
  149. uni.showToast({
  150. icon: 'none',
  151. title: '网络繁忙请稍后再试',
  152. position: "bottom"
  153. })
  154. })
  155. },
  156. exceptionEntry() {
  157. this.$refs.repeat.show({
  158. title: '功能完善中~',
  159. type: 'default',
  160. position: 'bottom'
  161. })
  162. },
  163. expenseEntry() {
  164. this.$refs.repeat.show({
  165. title: '功能完善中~',
  166. type: 'default',
  167. position: 'bottom'
  168. })
  169. }
  170. }
  171. }
  172. </script>
  173. <style scoped lang="scss">
  174. .service {
  175. width: 84%;
  176. display: flex;
  177. justify-content: space-between;
  178. flex-wrap: wrap;
  179. margin: 0 auto;
  180. margin-top: 30rpx;
  181. view {
  182. width: 300rpx;
  183. border-radius: 30rpx;
  184. text-align: center;
  185. }
  186. }
  187. .service>view {
  188. background-color: #ffffff;
  189. margin-bottom: 25rpx;
  190. padding-top: 45rpx;
  191. padding-bottom: 45rpx;
  192. box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);
  193. }
  194. .numer {
  195. color: #348CF5;
  196. font-size: 38rpx;
  197. font-weight: bold;
  198. text {
  199. font-size: 24rpx;
  200. color: #909399;
  201. }
  202. }
  203. .head {
  204. width: 100%;
  205. height: 300rpx;
  206. background-color: #3A63CF;
  207. border-bottom-left-radius: 100%;
  208. border-bottom-right-radius: 100%;
  209. margin-top: -100rpx;
  210. }
  211. .order {
  212. width: 98%;
  213. height: 118rpx;
  214. margin: 0 auto;
  215. background: #fff;
  216. box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);
  217. border-radius: 20rpx;
  218. margin-top: 10rpx;
  219. text-align: center;
  220. padding-top: 20rpx;
  221. }
  222. .box {
  223. width: 92%;
  224. display: flex;
  225. justify-content: space-between;
  226. margin: 0 auto;
  227. }
  228. .carousel {
  229. width: 98%;
  230. margin: 0 auto;
  231. margin-top: -190rpx;
  232. box-shadow: 12rpx 9rpx 12rpx 1rpx rgba(79, 119, 225, 0.23);
  233. }
  234. .wrap {
  235. padding: 40rpx;
  236. }
  237. .lantern {
  238. width: 100%;
  239. height: 70rpx;
  240. }
  241. .grid-text {
  242. font-size: 22rpx;
  243. margin-top: 4rpx;
  244. color: $u-type-info;
  245. }
  246. </style>