index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  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 : '立即登录' }} -->
  15. <!-- {{hasLogin?driverSex:""}} -->
  16. <view @click="toLogin" class="name">{{hasLogin? userName : '立即登录' }} {{hasLogin?driverSex:""}}
  17. </view>
  18. <view @click="toLogin" class="phone" v-if="hasLogin">{{starUserphone}}</view>
  19. </view>
  20. </view>
  21. <view></view>
  22. </view>
  23. <view class="content1">
  24. <view @click="goDetailPage('/pages/mine/driverCertification',1)" class="left">
  25. <view class="icon">
  26. <image class="sfrz-icon" src="@/static/images/mine/sfrz.png" mode='widthFix'>
  27. </image>
  28. </view>
  29. <view class="right-text" >
  30. <view class="top">司机认证</view>
  31. <view class="bottom">{{hasLogin? statusVal : '你还没有完成身份认证' }}</view>
  32. </view>
  33. </view>
  34. <view @click="goDetailPage('/pages/mine/evaluate')" class="right">
  35. <view class="icon">
  36. <image class="sfrz-icon" src="@/static/images/mine/pingjia@2x.png" mode='widthFix'>
  37. </image>
  38. </view>
  39. <view class="right-text" >
  40. <view class="top">货主评价</view>
  41. <view class="bottom">看看货主对你的评价吧</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="content2">
  46. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/manageBankCards/index',2)">
  47. <view class="flex align-center">
  48. <image class="img" src="@/static/images/mine/yhk@2x.png" mode='widthFix'>
  49. </image>
  50. <view>管理银行卡</view>
  51. </view>
  52. <view>
  53. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  54. </view>
  55. </view>
  56. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/manageVehicles/index',3)">
  57. <view class="flex align-center">
  58. <image class="img" src="@/static/images/mine/cheliang@2x.png" mode='widthFix'>
  59. </image>
  60. <view>管理车辆</view>
  61. </view>
  62. <view>
  63. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  64. </view>
  65. </view>
  66. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/often/oftenRoute',3)">
  67. <view class="flex align-center">
  68. <image class="img" src="@/static/images/mine/changyongluxian.png" mode='widthFix'>
  69. </image>
  70. <view>常用路线</view>
  71. </view>
  72. <view>
  73. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  74. </view>
  75. </view>
  76. <view class="flex flex-space-between" @click="$helper.contactCustomerService()">
  77. <view class="flex align-center">
  78. <image class="img" src="@/static/images/mine/kf.png" mode='widthFix'>
  79. </image>
  80. <view>联系客服</view>
  81. </view>
  82. <view>
  83. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  84. </view>
  85. </view>
  86. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/helpDescription')">
  87. <view class="flex align-center">
  88. <image class="img" src="@/static/images/mine/icon-help@2x.png" mode='widthFix' style="top: 6rpx;">
  89. </image>
  90. <view>帮助说明</view>
  91. </view>
  92. <view>
  93. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  94. </view>
  95. </view>
  96. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/set')">
  97. <view class="flex align-center">
  98. <image class="img" src="@/static/images/mine/set.png" mode='widthFix'>
  99. </image>
  100. <view>设置</view>
  101. </view>
  102. <view>
  103. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  104. </view>
  105. </view>
  106. <!-- <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/evaluate')">
  107. <view class="flex align-center">
  108. <image class="img" src="@/static/images/mine/set.png" mode='widthFix'>
  109. </image>
  110. <view>货主评价</view>
  111. </view>
  112. <view>
  113. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  114. </view>
  115. </view> -->
  116. </view>
  117. <u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :confirmText='confirmText'
  118. :showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
  119. @cancel="cancelClick"></u-modal>
  120. <u-toast ref="uToast"></u-toast>
  121. </view>
  122. </template>
  123. <script>
  124. var that;
  125. import {
  126. mapState
  127. } from 'vuex';
  128. export default {
  129. data() {
  130. return {
  131. confirmText: '确定',
  132. showCancelButton: true,
  133. userName: '',
  134. phone: '',
  135. headUrl: "../../static/images/myimg/YongHu@3x.png",
  136. isShowAlert: false,
  137. alertTitle: '您尚未登录,是否立即登录?',
  138. // alertContent: '您尚未登录,是否立即登录?',
  139. statusVal: '',
  140. isFirstRZ: null,
  141. driverCall: '',
  142. isFirstSH: false,
  143. driverSex: ""
  144. };
  145. },
  146. onShow() {
  147. uni.setTabBarItem({
  148. index: 0,
  149. text: '货源',
  150. iconPath: 'static/images/common/huoyuan@2x(1).png',
  151. selectedIconPath: 'static/images/common/huoyuan@2x.png'
  152. })
  153. uni.setTabBarItem({
  154. index: 2,
  155. text: '订单',
  156. iconPath: 'static/images/common/dingdan@2x(1).png',
  157. selectedIconPath: 'static/images/common/dingdan@2x.png'
  158. })
  159. // console.log("111111111111111111111111111", this.firstAuthentication)
  160. //获取认证状态
  161. // console.log(userInfo)
  162. // console.log(hasLogin)
  163. if (!this.hasLogin) {
  164. this.isShowAlert = true
  165. return
  166. }
  167. this.getAuthenticationStatus()
  168. that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
  169. reCommonId: this.userInfo.id,
  170. }).then(res3 => {
  171. if (res3.data||res3.data==0) {
  172. let name = 'myTip';
  173. let value = res3.data
  174. if (value == 0) {
  175. uni.removeTabBarBadge({
  176. index: 3
  177. })
  178. }
  179. that.$store.commit('$uStore', {
  180. name,
  181. value
  182. });
  183. if (value != 0 && value) {
  184. uni.setTabBarBadge({
  185. index: 3,
  186. text: value + ""
  187. })
  188. }
  189. }
  190. })
  191. },
  192. async onLoad() {
  193. that = this
  194. // let _status = await that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
  195. // driverPhone: this.userInfo.phone,
  196. // }).then(res => {
  197. // return res.data.authenticationStatus
  198. // })
  199. // if (_status == '已禁用') {
  200. // this.isShowAlert = true
  201. // this.alertTitle = '账号审核中'
  202. // this.confirmText = '退出APP'
  203. // this.showCancelButton = false
  204. // } else {
  205. // console.log(1231233212332312312213)
  206. // }
  207. },
  208. computed: {
  209. ...mapState(['hasLogin', 'userInfo']),
  210. // 手机号中间4位加*
  211. starUserphone() {
  212. let reg = /^(\d{3})\d{4}(\d{4})$/;
  213. if (this.phone) {
  214. return this.phone.replace(reg, "$1****$2");
  215. }
  216. }
  217. },
  218. methods: {
  219. async getAuthenticationStatus() {
  220. await this.$request.baseRequest('', '/driverInfo/firstAuthentication', {
  221. driverPhone: this.userInfo.phone,
  222. }).then(res => {
  223. if(res.data){
  224. uni.setStorageSync("firstAuthentication", res.data) //更新缓存数据(解决pc端审核后未及时更新缓存 用于车友判断)
  225. }
  226. this.firstAuthentication = res.data
  227. if (this.firstAuthentication) {
  228. this.isFirstSH = false
  229. if (this.firstAuthentication.driverSex == '女') {
  230. this.driverSex = "女士"
  231. this.userName = this.firstAuthentication.driverCall
  232. } else if (this.firstAuthentication.driverSex == '男') {
  233. this.userName = this.firstAuthentication.driverCall
  234. this.driverSex = "先生"
  235. } else {
  236. this.userName = this.firstAuthentication.driverCall
  237. this.driverSex = ""
  238. }
  239. if (this.firstAuthentication.authenticationStatus == '审核中') {
  240. this.statusVal = '身份认证审核中'
  241. } else if (this.firstAuthentication.authenticationStatus == '未通过') {
  242. this.statusVal = '身份认证未通过'
  243. } else if (this.firstAuthentication.authenticationStatus == '已驳回') {
  244. this.statusVal = '已驳回'
  245. } else if (this.firstAuthentication.authenticationStatus == '已过期') {
  246. this.statusVal = '证件已过期'
  247. } else if (this.firstAuthentication.authenticationStatus == '未认证') {
  248. this.statusVal = '未认证'
  249. }else {
  250. this.statusVal = '已认证'
  251. }
  252. } else {
  253. this.statusVal = '你还没有完成身份认证'
  254. this.userName = this.userInfo.userName
  255. this.isFirstSH = true
  256. }
  257. this.phone = this.userInfo.phone
  258. if (this.userInfo) {
  259. if (!this.userInfo.avatarUrl) {
  260. this.headUrl = "../../static/images/myimg/YongHu@3x.png"
  261. } else {
  262. this.headUrl = this.userInfo.avatarUrl
  263. }
  264. this.userphone = this.userInfo.phone
  265. } else {
  266. this.headUrl = "../../static/images/myimg/YongHu@3x.png"
  267. this.username = "立即登录"
  268. }
  269. })
  270. .catch(res => {
  271. uni.$u.toast(res.message);
  272. });
  273. },
  274. confirmClick() {
  275. // #ifdef APP-PLUS
  276. if (this.alertTitle == '账号审核中') {
  277. if (uni.getSystemInfoSync().platform == 'ios') {
  278. plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
  279. } else if (uni.getSystemInfoSync().platform == 'android') {
  280. plus.runtime.quit();
  281. }
  282. return
  283. }
  284. // #endif
  285. this.isShowAlert = false
  286. uni.$u.route('/pages/public/login');
  287. },
  288. cancelClick() {
  289. this.isShowAlert = false
  290. },
  291. goDetailPage(src, type) {
  292. console.log(type)
  293. if (!this.hasLogin) {
  294. this.isShowAlert = true;
  295. } else {
  296. if (type == 1 && this.statusVal == '已认证' || type == 1 &&this.statusVal == '证件已过期' || type == 1 &&this.statusVal == '身份认证未通过'|| type == 1 &&this.statusVal == '已驳回') {
  297. src = '/pages/mine/editDriverCertification'
  298. }
  299. if ((type == 2 || type == 3) && this.isFirstSH) {
  300. this.$refs.uToast.show({
  301. type: 'error',
  302. message: "请先完成司机身份认证",
  303. })
  304. } else if (type == 1 && this.statusVal == '身份认证审核中') {
  305. this.$refs.uToast.show({
  306. type: 'error',
  307. message: "正在审核中,请耐心等待!",
  308. })
  309. return
  310. } else {
  311. uni.$u.route(src);
  312. }
  313. }
  314. },
  315. toLogin() {
  316. console.log("userInfo", this.userInfo)
  317. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  318. uni.$u.route('/pages/public/login');
  319. } else {}
  320. // else if(!this.userInfo.nickname){
  321. // this.inputShow = true
  322. // this.inputStatus = 'inline'
  323. // this.feild = "nickname"
  324. // this.inputContent = ''
  325. // }
  326. },
  327. }
  328. }
  329. </script>
  330. <style lang="scss" scoped>
  331. .content {
  332. background: url(../../static/images/mine/bg@2x.png);
  333. background-size: 100% 100%;
  334. height: 100vh;
  335. padding: 0 25rpx;
  336. }
  337. .top-height {
  338. height: var(--status-bar-height);
  339. }
  340. .arrow {
  341. margin-left: 15px;
  342. width: 8px;
  343. height: 12px;
  344. // justify-content: flex-end
  345. }
  346. .head {
  347. .row1 {
  348. display: flex;
  349. justify-content: flex-end;
  350. margin-top: 46rpx;
  351. }
  352. .row2 {
  353. .right-text {
  354. margin-left: 40rpx;
  355. }
  356. .name {
  357. font-size: 42rpx;
  358. font-weight: 700;
  359. color: #333333;
  360. }
  361. .phone {
  362. font-size: 26rpx;
  363. font-weight: 500;
  364. color: #8F97AB;
  365. }
  366. }
  367. }
  368. .content1 {
  369. display: flex;
  370. justify-content: space-between;
  371. margin-top: 60rpx;
  372. .left,
  373. .right {
  374. width: 49%;
  375. padding: 30rpx 20rpx;
  376. background: white;
  377. border-radius: 25rpx;
  378. box-sizing: border-box;
  379. display: flex;
  380. align-items: center;
  381. .sfrz-icon {
  382. width: 42rpx;
  383. height: 42rpx;
  384. }
  385. .right-text {
  386. margin-left: 20rpx;
  387. .top {
  388. font-size: 28rpx;
  389. font-weight: 700;
  390. color: #000000;
  391. }
  392. .bottom {
  393. margin-top: 6rpx;
  394. font-size: 24rpx;
  395. color: #898989;
  396. }
  397. }
  398. }
  399. }
  400. .content2 {
  401. background: white;
  402. padding: 20rpx;
  403. border-radius: 20rpx;
  404. margin-top: 20rpx;
  405. .img {
  406. margin-right: 10rpx;
  407. width: 40rpx;
  408. height: 40rpx;
  409. top: 2rpx;
  410. }
  411. .flex-space-between {
  412. margin: 10rpx 0 50rpx 0;
  413. }
  414. }
  415. </style>