index.vue 13 KB

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