index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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">
  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. debugger
  112. // console.log("111111111111111111111111111", this.firstAuthentication)
  113. //获取认证状态
  114. this.getAuthenticationStatus()
  115. },
  116. onLoad() {
  117. that = this
  118. },
  119. computed: {
  120. ...mapState(['hasLogin', 'userInfo']),
  121. // 手机号中间4位加*
  122. // starUserphone() {
  123. // let reg = /^(\d{3})\d{4}(\d{4})$/;
  124. // if (this.userphone) {
  125. // return this.userphone.replace(reg, "$1****$2");
  126. // }
  127. // }
  128. },
  129. methods: {
  130. async getAuthenticationStatus() {
  131. await this.$request.baseRequest('', '/driverInfo/firstAuthentication', {
  132. driverPhone: this.userInfo.phone,
  133. }).then(res => {
  134. debugger
  135. this.firstAuthentication = res.data
  136. if (this.firstAuthentication) {
  137. this.userName = this.firstAuthentication.driverCall
  138. if (this.firstAuthentication.authenticationStatus == '审核中') {
  139. this.statusVal = '身份认证审核中'
  140. } else if (this.firstAuthentication.authenticationStatus == '未通过') {
  141. this.statusVal = '身份认证未通过'
  142. } else {
  143. this.statusVal = '已认证'
  144. }
  145. } else {
  146. this.statusVal = '你还没有完成身份认证'
  147. this.userName = this.userInfo.userName
  148. this.isFirstSH = true
  149. }
  150. this.phone = this.userInfo.phone
  151. if (this.userInfo) {
  152. if (!this.userInfo.avatarUrl) {
  153. this.headUrl = "../../static/images/myimg/YongHu@3x.png"
  154. } else {
  155. this.headUrl = this.userInfo.avatarUrl
  156. }
  157. this.userphone = this.userInfo.phone
  158. } else {
  159. this.headUrl = "../../static/images/myimg/YongHu@3x.png"
  160. this.username = "立即登录"
  161. }
  162. })
  163. .catch(res => {
  164. uni.$u.toast(res.message);
  165. });
  166. },
  167. confirmClick() {
  168. this.isShowAlert = false
  169. uni.$u.route('/pages/public/login');
  170. },
  171. cancelClick() {
  172. this.isShowAlert = false
  173. },
  174. goDetailPage(src, type) {
  175. if (!this.hasLogin) {
  176. this.isShowAlert = true;
  177. } else {
  178. if (type == 1 && this.statusVal == '已认证') {
  179. src = '/pages/mine/editDriverCertification'
  180. }
  181. if ((type == 2 || type == 3) && this.isFirstSH) {
  182. this.$refs.uToast.show({
  183. type: 'error',
  184. message: "请先完成司机身份认证",
  185. })
  186. } else {
  187. uni.$u.route(src);
  188. }
  189. }
  190. },
  191. toLogin() {
  192. console.log("userInfo", this.userInfo)
  193. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  194. uni.$u.route('/pages/public/login');
  195. } else {}
  196. // else if(!this.userInfo.nickname){
  197. // this.inputShow = true
  198. // this.inputStatus = 'inline'
  199. // this.feild = "nickname"
  200. // this.inputContent = ''
  201. // }
  202. },
  203. }
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. .content {
  208. background: url(../../static/images/mine/bg@2x.png);
  209. background-size: 100% 100%;
  210. height: 100vh;
  211. padding: 0 20rpx;
  212. }
  213. .top-height {
  214. height: var(--status-bar-height);
  215. }
  216. .head {
  217. .row1 {
  218. display: flex;
  219. justify-content: flex-end;
  220. margin-top: 46rpx;
  221. }
  222. .row2 {
  223. .right-text {
  224. margin-left: 40rpx;
  225. }
  226. .name {
  227. font-size: 42rpx;
  228. font-weight: 700;
  229. color: #333333;
  230. }
  231. .phone {
  232. font-size: 26rpx;
  233. font-weight: 500;
  234. color: #8F97AB;
  235. }
  236. }
  237. }
  238. .content1 {
  239. display: flex;
  240. justify-content: space-between;
  241. margin-top: 60rpx;
  242. .left,
  243. .right {
  244. width: 49%;
  245. padding: 30rpx 20rpx;
  246. background: white;
  247. border-radius: 25rpx;
  248. box-sizing: border-box;
  249. display: flex;
  250. align-items: center;
  251. .sfrz-icon {
  252. width: 42rpx;
  253. height: 42rpx;
  254. }
  255. .right-text {
  256. margin-left: 20rpx;
  257. .top {
  258. font-size: 28rpx;
  259. font-weight: 700;
  260. color: #000000;
  261. }
  262. .bottom {
  263. margin-top: 6rpx;
  264. font-size: 24rpx;
  265. color: #898989;
  266. }
  267. }
  268. }
  269. }
  270. .content2 {
  271. background: white;
  272. padding: 20rpx;
  273. border-radius: 20rpx;
  274. margin-top: 20rpx;
  275. .img {
  276. margin-right: 10rpx;
  277. width: 40rpx;
  278. height: 40rpx;
  279. }
  280. .flex-space-between {
  281. margin: 40rpx 0;
  282. }
  283. }
  284. </style>