me.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="w-h-100">
  3. <view class="cu-bar">
  4. <u-row gutter="20">
  5. <u-col span="4">
  6. <view><u-avatar :src="src"></u-avatar></view>
  7. </u-col>
  8. <u-col span="8">
  9. <view class="avatar-txt">
  10. <span>{{driverInfo.driverName}}(<b
  11. style="color: #e4493c;">{{driverInfo.driverState == 1? '已审核' : '未审核'}}</b>)</span>
  12. <span>{{driverInfo.defaultTruckCode}}</span>
  13. </view>
  14. </u-col>
  15. </u-row>
  16. </view>
  17. <view class="list-con">
  18. <u-cell-group>
  19. <u-cell :isLink="true" title="我的资料" icon="account"></u-cell>
  20. <u-cell :isLink="true" title="我的车辆" icon="car" url="/pages/index/myTruckList"></u-cell>
  21. <u-cell :isLink="true" title="已配送订单(当月)" icon="order"></u-cell>
  22. </u-cell-group>
  23. </view>
  24. <view class="padding-lr padding-tb-xs">
  25. <button class="cu-btn block shadow bg-white margin text-red" @tap="logout">退出登录</button>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import request from '@/common/libs/request.js';
  31. export default {
  32. mounted() {
  33. this.initData()
  34. },
  35. data() {
  36. return {
  37. src: 'http://dn-dounengyin.qbox.me/Fvz4y4_hhBt0CaY9_8PMm8IeXc8p',
  38. driverInfo: {
  39. driverName: '',
  40. driverState: 0,
  41. defaultTruckCode: ''
  42. }
  43. }
  44. },
  45. methods: {
  46. initData() {
  47. let _that = this;
  48. request.httpPost("/dnyDriver/getDriverInfo", {}).then(res => {
  49. if (res.httpCode == 200) {
  50. console.log("3333", res.data)
  51. _that.driverInfo = res.data
  52. } else {
  53. uni.showToast({
  54. title: res.msg,
  55. icon: "error"
  56. })
  57. }
  58. });
  59. },
  60. logout() {
  61. uni.removeStorageSync('erpToken');
  62. uni.reLaunch({
  63. url: '/pages/login/login'
  64. });
  65. }
  66. }
  67. }
  68. </script>
  69. <style>
  70. .cu-bar {
  71. padding-left: 60rpx;
  72. padding-top: 30rpx;
  73. }
  74. .avatar-txt span {
  75. display: block;
  76. width: 100;
  77. }
  78. .list-con {
  79. margin-top: 50rpx;
  80. }
  81. .w-h-100 {
  82. height: 100%;
  83. width: 100%;
  84. }
  85. .uni-row .flex-item-30 {
  86. color: #8799a3;
  87. }
  88. .flex-item-30 {
  89. flex-basis: 30%;
  90. }
  91. .flex-item-70 {
  92. flex-basis: 70%;
  93. }
  94. </style>