index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. ],
  81. meter: {
  82. count: 0, //新订单
  83. miles: 0, //里程
  84. freightAmtDr: 0, //运费
  85. countOrders: 0
  86. }
  87. }
  88. },
  89. created() {
  90. uni.showLoading({
  91. title: '加载中'
  92. });
  93. setTimeout(function() {
  94. uni.hideLoading();
  95. }, 1000);
  96. // #ifdef MP-WEIXIN
  97. if (wx.hideHomeButton) {
  98. wx.hideHomeButton();
  99. }
  100. // #endif
  101. this.getNotice()
  102. },
  103. onShow() {
  104. this.statistics()
  105. },
  106. onPullDownRefresh() {
  107. //监听下拉刷新动作的执行方法,每次手动下拉刷新都会执行一次
  108. this.statistics()
  109. setTimeout(function() {
  110. uni.stopPullDownRefresh(); //停止下拉刷新动画
  111. }, 1000);
  112. },
  113. methods: {
  114. myorder() {
  115. uni.navigateTo({
  116. url: 'myorder/index'
  117. });
  118. },
  119. statistics() {
  120. request({
  121. url: '/fleet/ftmsorderbillscars/selectDriverPerformance',
  122. method: 'get',
  123. params: {
  124. phonenumber: uni.getStorageSync('cell_phone')
  125. }
  126. }).then(res => {
  127. console.log(res)
  128. if (res.data.code == 500) {
  129. uni.showToast({
  130. icon: 'none',
  131. title: res.data.msg,
  132. position: "bottom"
  133. })
  134. } else if (res.data.code == 200) {
  135. this.meter = res.data.data
  136. console.log(this.meter)
  137. if (!this.meter.count) {
  138. this.meter.count = 0
  139. }
  140. if (!this.meter.miles) {
  141. this.meter.miles = 0
  142. }
  143. if (!this.meter.freightAmtDr) {
  144. this.meter.freightAmtDr = 0
  145. }
  146. if (!this.meter.countOrders) {
  147. this.meter.countOrders = 0
  148. }
  149. }
  150. }).catch(err => {
  151. uni.showToast({
  152. icon: 'none',
  153. title: '网络繁忙请稍后再试',
  154. position: "bottom"
  155. })
  156. })
  157. },
  158. exceptionEntry() {
  159. this.$refs.repeat.show({
  160. title: '功能完善中~',
  161. type: 'default',
  162. position: 'bottom'
  163. })
  164. },
  165. expenseEntry() {
  166. this.$refs.repeat.show({
  167. title: '功能完善中~',
  168. type: 'default',
  169. position: 'bottom'
  170. })
  171. },
  172. // 获得公告功能
  173. getNotice() {
  174. request({
  175. url: '/system/notice/list?pageNum=1&status=0',
  176. method: 'get',
  177. }).then(res => {
  178. console.log(res)
  179. res.data.rows.forEach(item => {
  180. this.liSt.push(item.noticeTitle)
  181. })
  182. }).catch(err => {
  183. uni.showToast({
  184. icon: 'none',
  185. title: '网络繁忙请稍后再试',
  186. position: "bottom"
  187. })
  188. })
  189. },
  190. }
  191. }
  192. </script>
  193. <style scoped lang="scss">
  194. .service {
  195. width: 84%;
  196. display: flex;
  197. justify-content: space-between;
  198. flex-wrap: wrap;
  199. margin: 0 auto;
  200. margin-top: 30rpx;
  201. view {
  202. width: 300rpx;
  203. border-radius: 30rpx;
  204. text-align: center;
  205. }
  206. }
  207. .service>view {
  208. background-color: #ffffff;
  209. margin-bottom: 25rpx;
  210. padding-top: 45rpx;
  211. padding-bottom: 45rpx;
  212. box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);
  213. }
  214. .numer {
  215. color: #348CF5;
  216. font-size: 38rpx;
  217. font-weight: bold;
  218. text {
  219. font-size: 24rpx;
  220. color: #909399;
  221. }
  222. }
  223. .head {
  224. width: 100%;
  225. height: 300rpx;
  226. background-color: #3A63CF;
  227. border-bottom-left-radius: 100%;
  228. border-bottom-right-radius: 100%;
  229. margin-top: -100rpx;
  230. }
  231. .order {
  232. width: 98%;
  233. height: 118rpx;
  234. margin: 0 auto;
  235. background: #fff;
  236. box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);
  237. border-radius: 20rpx;
  238. margin-top: 10rpx;
  239. text-align: center;
  240. padding-top: 20rpx;
  241. }
  242. .box {
  243. width: 92%;
  244. display: flex;
  245. justify-content: space-between;
  246. margin: 0 auto;
  247. }
  248. .carousel {
  249. width: 98%;
  250. margin: 0 auto;
  251. margin-top: -190rpx;
  252. box-shadow: 12rpx 9rpx 12rpx 1rpx rgba(79, 119, 225, 0.23);
  253. }
  254. .wrap {
  255. padding: 40rpx;
  256. }
  257. .lantern {
  258. width: 100%;
  259. height: 70rpx;
  260. }
  261. .grid-text {
  262. font-size: 22rpx;
  263. margin-top: 4rpx;
  264. color: $u-type-info;
  265. }
  266. </style>