index.vue 13 KB

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