| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <template>
- <view class="w-h-100">
- <view class="cu-bar">
- <u-row gutter="20">
- <u-col span="4">
- <view>
- <u-avatar
- :text="text"
- fontSize="18"
- randomBgColor
- ></u-avatar>
- </view>
- </u-col>
- <u-col span="8">
- <view class="avatar-txt">
- <span>{{driverInfo.driverName}}(<b
- style="color: #e4493c;">{{driverInfo.driverState == 1? '已审核' : '未审核'}}</b>)</span>
- <span>{{driverInfo.defaultTruckCode}}</span>
- </view>
- </u-col>
- </u-row>
- </view>
- <view class="list-con">
- <u-cell-group>
- <u-cell :isLink="true" title="我的资料" icon="account"></u-cell>
- <u-cell :isLink="true" title="我的车辆" icon="car" url="/pages/index/myTruckList"></u-cell>
- <u-cell :isLink="true" title="已配送订单(当月)" icon="order"></u-cell>
- </u-cell-group>
- </view>
- <view class="padding-lr padding-tb-xs">
- <button class="cu-btn block shadow bg-white margin text-red" @tap="logout">退出登录</button>
- </view>
- </view>
- </template>
- <script>
- import request from '@/common/libs/request.js';
- export default {
- mounted() {
- this.initData()
- uni.setNavigationBarTitle({
- title:'个人中心'
- })
- },
- data() {
- return {
- text: '',
- driverInfo: {
- driverName: '',
- driverState: 0,
- defaultTruckCode: ''
- }
- }
- },
- methods: {
- initData() {
- let _that = this;
- request.httpPost("/dnyDriver/getDriverInfo", {}).then(res => {
- if (res.httpCode == 200) {
- // console.log("3333", res.data)
- _that.driverInfo = res.data
- _that.text = res.data.driverName.charAt(0)
- } else {
- uni.showToast({
- title: res.msg,
- icon: "error"
- })
- }
- });
- },
- logout() {
- uni.removeStorageSync('erpToken');
- uni.reLaunch({
- url: '/pages/login/login'
- });
- }
- }
- }
- </script>
- <style>
- .cu-bar {
- padding-left: 60rpx;
- padding-top: 30rpx;
- }
- .avatar-txt span {
- display: block;
- width: 100;
- }
- .list-con {
- margin-top: 50rpx;
- }
- .w-h-100 {
- height: 100%;
- width: 100%;
- }
- .uni-row .flex-item-30 {
- color: #8799a3;
- }
- .flex-item-30 {
- flex-basis: 30%;
- }
- .flex-item-70 {
- flex-basis: 70%;
- }
- </style>
|