me.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. uni.setNavigationBarTitle({
  35. title:'个人中心'
  36. })
  37. },
  38. data() {
  39. return {
  40. src: 'http://dn-dounengyin.qbox.me/Fvz4y4_hhBt0CaY9_8PMm8IeXc8p',
  41. driverInfo: {
  42. driverName: '',
  43. driverState: 0,
  44. defaultTruckCode: ''
  45. }
  46. }
  47. },
  48. methods: {
  49. initData() {
  50. let _that = this;
  51. request.httpPost("/dnyDriver/getDriverInfo", {}).then(res => {
  52. if (res.httpCode == 200) {
  53. console.log("3333", res.data)
  54. _that.driverInfo = res.data
  55. } else {
  56. uni.showToast({
  57. title: res.msg,
  58. icon: "error"
  59. })
  60. }
  61. });
  62. },
  63. logout() {
  64. uni.removeStorageSync('erpToken');
  65. uni.reLaunch({
  66. url: '/pages/login/login'
  67. });
  68. }
  69. }
  70. }
  71. </script>
  72. <style>
  73. .cu-bar {
  74. padding-left: 60rpx;
  75. padding-top: 30rpx;
  76. }
  77. .avatar-txt span {
  78. display: block;
  79. width: 100;
  80. }
  81. .list-con {
  82. margin-top: 50rpx;
  83. }
  84. .w-h-100 {
  85. height: 100%;
  86. width: 100%;
  87. }
  88. .uni-row .flex-item-30 {
  89. color: #8799a3;
  90. }
  91. .flex-item-30 {
  92. flex-basis: 30%;
  93. }
  94. .flex-item-70 {
  95. flex-basis: 70%;
  96. }
  97. </style>