index.vue 13 KB

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