index.vue 15 KB

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