index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <!-- 我的 -->
  2. <template>
  3. <view class="content">
  4. <view class="top-height"></view>
  5. <view class="head">
  6. <view class="row1">
  7. <u--image class="flex-end" :showLoading="true" src="../../static/images/mine/saoma.png" width="30px"
  8. height="30px"></u--image>
  9. </view>
  10. <view class="row2 flex align-center">
  11. <u--image class="flex-end" :showLoading="true" :src="headUrl" width="60px" height="60px" shape='circle'>
  12. </u--image>
  13. <view class="right-text">
  14. <view @click="toLogin" class="name">{{hasLogin? userName : '立即登录' }}</view>
  15. <view @click="toLogin" class="phone" v-if="hasLogin">{{phone}}</view>
  16. </view>
  17. </view>
  18. <view></view>
  19. </view>
  20. <view class="content1">
  21. <view class="left">
  22. <view class="icon">
  23. <image class="sfrz-icon" src="@/static/images/mine/sfrz.png" mode='widthFix'>
  24. </image>
  25. </view>
  26. <view class="right-text" @click="goDetailPage('/pages/mine/driverCertification',1)">
  27. <view class="top">司机认证</view>
  28. <view class="bottom">{{hasLogin? statusVal : '你还没有完成身份认证' }}</view>
  29. </view>
  30. </view>
  31. <view class="right">
  32. <view class="icon">
  33. <image class="sfrz-icon" src="@/static/images/mine/pingjia@2x.png" mode='widthFix'>
  34. </image>
  35. </view>
  36. <view class="right-text" @click="goDetailPage('/pages/mine/driverCertification')">
  37. <view class="top">货主评价</view>
  38. <view class="bottom">看看货主对你的评价吧</view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="content2">
  43. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/manageBankCards/index',2)">
  44. <view class="flex align-center">
  45. <image class="img" src="@/static/images/mine/yhk@2x.png" mode='widthFix'>
  46. </image>
  47. <view>管理银行卡</view>
  48. </view>
  49. <view> > </view>
  50. </view>
  51. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/manageVehicles/index',3)">
  52. <view class="flex align-center">
  53. <image class="img" src="@/static/images/mine/cheliang@2x.png" mode='widthFix'>
  54. </image>
  55. <view>管理车辆</view>
  56. </view>
  57. <view> > </view>
  58. </view>
  59. <view class="flex flex-space-between" @click="$helper.contactCustomerService">
  60. <view class="flex align-center">
  61. <image class="img" src="@/static/images/mine/kf.png" mode='widthFix'>
  62. </image>
  63. <view>联系客服</view>
  64. </view>
  65. <view> > </view>
  66. </view>
  67. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/helpDescription')">
  68. <view class="flex align-center">
  69. <image class="img" src="@/static/images/mine/icon-help@2x.png" mode='widthFix'>
  70. </image>
  71. <view>帮助说明</view>
  72. </view>
  73. <view> > </view>
  74. </view>
  75. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/set')">
  76. <view class="flex align-center">
  77. <image class="img" src="@/static/images/mine/set.png" mode='widthFix'>
  78. </image>
  79. <view>设置</view>
  80. </view>
  81. <view> > </view>
  82. </view>
  83. </view>
  84. <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
  85. :showCancelButton='true' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
  86. @cancel="cancelClick"></u-modal>
  87. <u-toast ref="uToast"></u-toast>
  88. </view>
  89. </template>
  90. <script>
  91. import {
  92. mapState
  93. } from 'vuex';
  94. var that;
  95. export default {
  96. data() {
  97. return {
  98. userName: '',
  99. phone: '',
  100. headUrl: "../../static/images/myimg/YongHu@3x.png",
  101. isShowAlert: false,
  102. alertTitle: '提示',
  103. alertContent: '您尚未登录,是否立即登录?',
  104. statusVal: '',
  105. isFirstRZ: null,
  106. driverCall: '',
  107. isFirstSH:false
  108. };
  109. },
  110. onShow() {
  111. console.log("111111111111111111111111111", this.firstAuthentication)
  112. if (this.firstAuthentication) {
  113. this.userName = this.firstAuthentication.driverCall
  114. if (this.firstAuthentication.authenticationStatus == '审核中') {
  115. this.statusVal = '身份认证审核中'
  116. } else if (this.firstAuthentication.authenticationStatus == '未通过') {
  117. this.statusVal = '身份认证未通过'
  118. } else {
  119. this.statusVal = '已认证'
  120. }
  121. } else {
  122. this.statusVal = '你还没有完成身份认证'
  123. this.userName = this.userInfo.userName
  124. this.isFirstSH = true
  125. }
  126. this.phone = this.userInfo.phone
  127. if (this.userInfo) {
  128. if (!this.userInfo.avatarUrl) {
  129. this.headUrl = "../../static/images/myimg/YongHu@3x.png"
  130. } else {
  131. this.headUrl = this.userInfo.avatarUrl
  132. }
  133. this.userphone = this.userInfo.phone
  134. } else {
  135. this.headUrl = "../../static/images/myimg/YongHu@3x.png"
  136. this.username = "立即登录"
  137. }
  138. },
  139. onLoad() {
  140. that = this
  141. },
  142. computed: {
  143. ...mapState(['hasLogin', 'userInfo', 'firstAuthentication']),
  144. // 手机号中间4位加*
  145. // starUserphone() {
  146. // let reg = /^(\d{3})\d{4}(\d{4})$/;
  147. // if (this.userphone) {
  148. // return this.userphone.replace(reg, "$1****$2");
  149. // }
  150. // }
  151. },
  152. methods: {
  153. confirmClick() {
  154. this.isShowAlert = false
  155. uni.$u.route('/pages/public/login');
  156. },
  157. cancelClick() {
  158. this.isShowAlert = false
  159. },
  160. goDetailPage(src,type) {
  161. if (!this.hasLogin) {
  162. this.isShowAlert = true;
  163. } else {
  164. if(type==1&&this.statusVal == '已认证'){
  165. src='/pages/mine/editDriverCertification'
  166. }
  167. if((type==2||type==3)&&this.isFirstSH){
  168. this.$refs.uToast.show({
  169. type: 'error',
  170. message: "请先完成司机身份认证",
  171. })
  172. }else{
  173. uni.$u.route(src);
  174. }
  175. }
  176. },
  177. toLogin() {
  178. console.log("userInfo", this.userInfo)
  179. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  180. uni.$u.route('/pages/public/login');
  181. } else {}
  182. // else if(!this.userInfo.nickname){
  183. // this.inputShow = true
  184. // this.inputStatus = 'inline'
  185. // this.feild = "nickname"
  186. // this.inputContent = ''
  187. // }
  188. },
  189. }
  190. }
  191. </script>
  192. <style lang="scss" scoped>
  193. .content {
  194. background: url(../../static/images/mine/bg@2x.png);
  195. background-size: 100% 100%;
  196. height: 100vh;
  197. padding: 0 20rpx;
  198. }
  199. .top-height {
  200. height: var(--status-bar-height);
  201. }
  202. .head {
  203. .row1 {
  204. display: flex;
  205. justify-content: flex-end;
  206. margin-top: 46rpx;
  207. }
  208. .row2 {
  209. .right-text {
  210. margin-left: 40rpx;
  211. }
  212. .name {
  213. font-size: 42rpx;
  214. font-weight: 700;
  215. color: #333333;
  216. }
  217. .phone {
  218. font-size: 26rpx;
  219. font-weight: 500;
  220. color: #8F97AB;
  221. }
  222. }
  223. }
  224. .content1 {
  225. display: flex;
  226. justify-content: space-between;
  227. margin-top: 60rpx;
  228. .left,
  229. .right {
  230. width: 49%;
  231. padding: 30rpx 20rpx;
  232. background: white;
  233. border-radius: 25rpx;
  234. box-sizing: border-box;
  235. display: flex;
  236. align-items: center;
  237. .sfrz-icon {
  238. width: 42rpx;
  239. height: 42rpx;
  240. }
  241. .right-text {
  242. margin-left: 20rpx;
  243. .top {
  244. font-size: 28rpx;
  245. font-weight: 700;
  246. color: #000000;
  247. }
  248. .bottom {
  249. margin-top: 6rpx;
  250. font-size: 24rpx;
  251. color: #898989;
  252. }
  253. }
  254. }
  255. }
  256. .content2 {
  257. background: white;
  258. padding: 20rpx;
  259. border-radius: 20rpx;
  260. margin-top: 20rpx;
  261. .img {
  262. margin-right: 10rpx;
  263. width: 40rpx;
  264. height: 40rpx;
  265. }
  266. .flex-space-between {
  267. margin: 40rpx 0;
  268. }
  269. }
  270. </style>