index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  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 class='flex align-center' style="margin: auto;margin-right: 10px">
  22. <u--image class='image scan' :showLoading="true" src="../../static/images/mine/saoma.png" width="20px"
  23. height="20px" @click="scanCode()" v-if='hasLogin'></u--image>
  24. <u-image @click="goDetailPage('/pages/mine/set')" style='margin-top: -6px;' class='image'
  25. :showLoading="true" src="@/static/images/mine/set.png" width="25px" height="25px"></u-image>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="content1">
  30. <view @click="goDetailPage('/pages/mine/driverCertification',1)" class="left">
  31. <view class="icon">
  32. <image class="sfrz-icon" src="@/static/images/mine/sfrz.png" mode='widthFix'>
  33. </image>
  34. </view>
  35. <view class="right-text">
  36. <view class="top">司机认证</view>
  37. <view class="bottom">{{hasLogin? statusVal : '你还没有完成身份认证' }}</view>
  38. </view>
  39. </view>
  40. <view @click="goDetailPage('/pages/mine/evaluate')" class="right">
  41. <view class="icon">
  42. <image class="sfrz-icon" src="@/static/images/mine/pingjia@2x.png" mode='widthFix'>
  43. </image>
  44. </view>
  45. <view class="right-text">
  46. <view class="top">货主评价</view>
  47. <view class="bottom">看看货主对你的评价吧</view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="content2">
  52. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/manageBankCards/index',2)">
  53. <view class="flex align-center">
  54. <image class="img" src="@/static/images/mine/yhk@2x.png" mode='widthFix'>
  55. </image>
  56. <view>管理银行卡</view>
  57. </view>
  58. <view>
  59. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  60. </view>
  61. </view>
  62. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/manageVehicles/index',3)">
  63. <view class="flex align-center">
  64. <image class="img" src="@/static/images/mine/cheliang@2x.png" mode='widthFix'>
  65. </image>
  66. <view>管理车辆</view>
  67. </view>
  68. <view>
  69. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  70. </view>
  71. </view>
  72. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/fleet/bindingCarCaptain',3)">
  73. <view class="flex align-center">
  74. <image class="img" src="@/static/images/mine/cheliang@2x.png" mode='widthFix'>
  75. </image>
  76. <view>绑定车队长</view>
  77. </view>
  78. <view>
  79. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  80. </view>
  81. </view>
  82. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/fleet/fleetManage',3)">
  83. <view class="flex align-center">
  84. <image class="img" src="@/static/images/mine/cheliang@2x.png" mode='widthFix'>
  85. </image>
  86. <view>车队管理</view>
  87. </view>
  88. <view>
  89. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  90. </view>
  91. </view>
  92. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/often/oftenRoute',3)">
  93. <view class="flex align-center">
  94. <image class="img" src="@/static/images/mine/changyongluxian.png" mode='widthFix'>
  95. </image>
  96. <view>常用路线</view>
  97. </view>
  98. <view>
  99. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  100. </view>
  101. </view>
  102. <view class="flex flex-space-between" @click="goDetailPage('/pages/riders/index',3)">
  103. <view class="flex align-center">
  104. <image class="img" src="@/static/images/mine/changyongluxian.png" mode='widthFix'>
  105. </image>
  106. <view>车友车队</view>
  107. </view>
  108. <view>
  109. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  110. </view>
  111. </view>
  112. <view class="flex flex-space-between" @click="$helper.contactCustomerService()">
  113. <view class="flex align-center">
  114. <image class="img" src="@/static/images/mine/kf.png" mode='widthFix'>
  115. </image>
  116. <view>联系客服</view>
  117. </view>
  118. <view>
  119. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  120. </view>
  121. </view>
  122. <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/helpDescription')">
  123. <view class="flex align-center">
  124. <image class="img" src="@/static/images/mine/icon-help@2x.png" mode='widthFix' style="top: 6rpx;">
  125. </image>
  126. <view>操作流程</view>
  127. </view>
  128. <view>
  129. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  130. </view>
  131. </view>
  132. <view class="flex flex-space-between">
  133. <view class="flex align-center">
  134. <image class="img" src="@/static/images/mine/appUpdate.png" mode='widthFix'>
  135. </image>
  136. <view>检查更新</view>
  137. </view>
  138. <view>
  139. <view class="version_css" @click="onAPPUpdate">
  140. {{version}}
  141. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  142. </view>
  143. </view>
  144. </view>
  145. <!-- <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/set')">
  146. <view class="flex align-center">
  147. <image class="img" src="@/static/images/mine/set.png" mode='widthFix'>
  148. </image>
  149. <view>设置</view>
  150. </view>
  151. <view>
  152. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  153. </view>
  154. </view> -->
  155. <!-- <view class="flex flex-space-between" @click="goDetailPage('/pages/mine/index1')">
  156. <view class="flex align-center">
  157. <image class="img" src="@/static/images/mine/set.png" mode='widthFix'>
  158. </image>
  159. <view>测试</view>
  160. </view>
  161. <view>
  162. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  163. </view>
  164. </view> -->
  165. <!--<view class="flex flex-space-between" @click="goDetailPage('/pages/mine/evaluate')">
  166. <view class="flex align-center">
  167. <image class="img" src="@/static/images/mine/set.png" mode='widthFix'>
  168. </image>
  169. <view>货主评价</view>
  170. </view>
  171. <view>
  172. <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
  173. </view>
  174. </view> -->
  175. </view>
  176. <!-- <view class="version_css">当前版本: {{ version}}</view> -->
  177. <u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :confirmText='confirmText'
  178. :showCancelButton='showCancelButton' confirmColor='#F5BA3C' @confirm="confirmClick" @close="cancelClick"
  179. @cancel="cancelClick"></u-modal>
  180. <u-toast ref="uToast"></u-toast>
  181. </view>
  182. </template>
  183. <script>
  184. var that;
  185. import {
  186. mapState
  187. } from 'vuex';
  188. // #ifdef APP-PLUS
  189. import APPUpdate, {
  190. getCurrentNo
  191. } from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate';
  192. import * as config from '@/config/index.js'
  193. // #endif
  194. export default {
  195. data() {
  196. return {
  197. confirmText: '确定',
  198. showCancelButton: true,
  199. userName: '',
  200. phone: '',
  201. headUrl: "../../static/images/myimg/YongHu@3x.png",
  202. isShowAlert: false,
  203. alertTitle: '您尚未登录,是否立即登录?',
  204. // alertContent: '您尚未登录,是否立即登录?',
  205. statusVal: '',
  206. isFirstRZ: null,
  207. driverCall: '',
  208. isFirstSH: false,
  209. driverSex: "",
  210. id:'',
  211. version: "1.1.0" //版本号
  212. };
  213. },
  214. onShow() {
  215. // #ifdef APP-PLUS
  216. plus.runtime.getProperty(plus.runtime.appid, (info) => {
  217. //版本号
  218. this.version = info.version;
  219. console.log("当前版本为:", this.version)
  220. this.checkVersion()
  221. })
  222. // this.version = plus.runtime.version
  223. // this.checkVersion()
  224. // #endif
  225. uni.setTabBarItem({
  226. index: 0,
  227. text: '货源',
  228. iconPath: 'static/images/common/huoyuan@2x(1).png',
  229. selectedIconPath: 'static/images/common/huoyuan@2x.png'
  230. })
  231. uni.setTabBarItem({
  232. index: 2,
  233. text: '订单',
  234. iconPath: 'static/images/common/dingdan@2x(1).png',
  235. selectedIconPath: 'static/images/common/dingdan@2x.png'
  236. })
  237. //获取认证状态
  238. // console.log(userInfo)
  239. // console.log(hasLogin)
  240. if (!this.hasLogin) {
  241. this.isShowAlert = true
  242. return
  243. }
  244. this.getAuthenticationStatus()
  245. that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
  246. reCommonId: this.userInfo.id,
  247. }).then(res3 => {
  248. if (res3.data || res3.data == 0) {
  249. let name = 'myTip';
  250. let value = res3.data
  251. if (value == 0) {
  252. uni.removeTabBarBadge({
  253. index: 3
  254. })
  255. }
  256. that.$store.commit('$uStore', {
  257. name,
  258. value
  259. });
  260. if (value != 0 && value) {
  261. uni.setTabBarBadge({
  262. index: 3,
  263. text: value + ""
  264. })
  265. }
  266. }
  267. })
  268. },
  269. async onLoad() {
  270. that = this
  271. // let _status = await that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
  272. // driverPhone: this.userInfo.phone,
  273. // }).then(res => {
  274. // return res.data.authenticationStatus
  275. // })
  276. // if (_status == '已禁用') {
  277. // this.isShowAlert = true
  278. // this.alertTitle = '账号审核中'
  279. // this.confirmText = '退出APP'
  280. // this.showCancelButton = false
  281. // } else {
  282. // console.log(1231233212332312312213)
  283. // }
  284. },
  285. computed: {
  286. ...mapState(['hasLogin', 'userInfo']),
  287. // 手机号中间4位加*
  288. starUserphone() {
  289. let reg = /^(\d{3})\d{4}(\d{4})$/;
  290. if (this.phone) {
  291. return this.phone.replace(reg, "$1****$2");
  292. }
  293. }
  294. },
  295. methods: {
  296. scanCode() {
  297. let _this = this;
  298. uni.scanCode({
  299. onlyFromCamera: false,
  300. success: function(res) {
  301. console.log('条码内容:' + res.result);
  302. _this.id=res.result.split(',')[1]
  303. console.log(_this.id)
  304. _this.mobileScanOk();
  305. }
  306. });
  307. },
  308. mobileScanOk() {
  309. uni.$u.route('/pages/goodSource/shippingDetails', {
  310. id: this.id,
  311. });
  312. // this.$request.baseRequest('get', '/publishTaskInfo/seeTask', {
  313. // id: this.id
  314. // }).then(res => {
  315. // res.data.driverCommonId=this.userInfo.id
  316. // res.data.driverName=uni.getStorageSync("firstAuthentication").driverName
  317. // res.data.driverPhone=uni.getStorageSync("firstAuthentication").driverPhone
  318. // this.$request.baseRequest('post', '/publishTaskInfo/api/addOrder ', res.data).then(res => {
  319. // console.log(res)
  320. // if (res.code == 200) {
  321. // this.$refs.uToast.show({
  322. // type: 'success',
  323. // message: "抢单成功!",
  324. // complete() {
  325. // uni.switchTab({
  326. // url: "/pages/order/index"
  327. // })
  328. // }
  329. // })
  330. // } else {
  331. // this.$refs.uToast.show({
  332. // type: 'error',
  333. // message: res.message,
  334. // })
  335. // }
  336. // })
  337. // })
  338. },
  339. // 检查APP是否有新版本
  340. onAPPUpdate() {
  341. // true 没有新版本的时候有提示,默认:false
  342. if (this.version == "发现新版本,立即更新") {
  343. // #ifdef APP-PLUS
  344. APPUpdate(true);
  345. // #endif
  346. }
  347. },
  348. checkVersion() {
  349. const baseUrlNew = config.def().baseUrlNew
  350. uni.request({
  351. url: baseUrlNew + '/appVersion/selectInfo',
  352. data: {
  353. appid: plus.runtime.appid,
  354. version: this.version,
  355. imei: "1",
  356. type: 'sj'
  357. },
  358. method: 'GET',
  359. success: (res) => {
  360. console.log("查看1111", this.version)
  361. console.log("查看11111", res)
  362. if (!res.data.data.version) { //有返回值证明需要更新 没有则不需要
  363. this.version = "当前为最新版" + this.version
  364. } else {
  365. this.version = "发现新版本,立即更新"
  366. }
  367. }
  368. })
  369. },
  370. async getAuthenticationStatus() {
  371. await this.$request.baseRequest('', '/driverInfo/firstAuthentication', {
  372. driverPhone: this.userInfo.phone,
  373. }).then(res => {
  374. if (res.data) {
  375. uni.setStorageSync("firstAuthentication", res.data) //更新缓存数据(解决pc端审核后未及时更新缓存 用于车友判断)
  376. }
  377. this.firstAuthentication = res.data
  378. if (this.firstAuthentication) {
  379. this.isFirstSH = false
  380. if (this.firstAuthentication.driverSex == '女') {
  381. this.driverSex = "女士"
  382. this.userName = this.firstAuthentication.driverCall
  383. } else if (this.firstAuthentication.driverSex == '男') {
  384. this.userName = this.firstAuthentication.driverCall
  385. this.driverSex = "先生"
  386. } else {
  387. // this.userName = this.firstAuthentication.driverCall
  388. this.userName = this.userInfo.userName //未认证时 显示(用户 + 电话号)未认证没有性别,通过性别判断认证或未认证
  389. this.driverSex = ""
  390. }
  391. if (this.firstAuthentication.authenticationStatus == '审核中') {
  392. this.statusVal = '身份认证审核中'
  393. } else if (this.firstAuthentication.authenticationStatus == '未通过') {
  394. this.statusVal = '身份认证未通过'
  395. } else if (this.firstAuthentication.authenticationStatus == '已驳回') {
  396. this.statusVal = '已驳回'
  397. } else if (this.firstAuthentication.authenticationStatus == '已过期') {
  398. this.statusVal = '证件已过期'
  399. } else if (this.firstAuthentication.authenticationStatus == '未认证') {
  400. this.statusVal = '未认证'
  401. } else {
  402. this.statusVal = '已认证'
  403. }
  404. } else {
  405. this.statusVal = '你还没有完成身份认证'
  406. this.userName = this.userInfo.userName
  407. this.isFirstSH = true
  408. }
  409. this.phone = this.userInfo.phone
  410. if (this.userInfo) {
  411. if (!this.userInfo.avatarUrl) {
  412. this.headUrl = "../../static/images/myimg/YongHu@3x.png"
  413. } else {
  414. this.headUrl = this.userInfo.avatarUrl
  415. }
  416. this.userphone = this.userInfo.phone
  417. } else {
  418. this.headUrl = "../../static/images/myimg/YongHu@3x.png"
  419. this.username = "立即登录"
  420. }
  421. })
  422. .catch(res => {
  423. uni.$u.toast(res.message);
  424. });
  425. },
  426. confirmClick() {
  427. // #ifdef APP-PLUS
  428. if (this.alertTitle == '账号审核中') {
  429. if (uni.getSystemInfoSync().platform == 'ios') {
  430. plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
  431. } else if (uni.getSystemInfoSync().platform == 'android') {
  432. plus.runtime.quit();
  433. }
  434. return
  435. }
  436. // #endif
  437. this.isShowAlert = false
  438. uni.$u.route('/pages/public/login');
  439. },
  440. cancelClick() {
  441. this.isShowAlert = false
  442. },
  443. goDetailPage(src, type) {
  444. if (!this.hasLogin) {
  445. this.isShowAlert = true;
  446. } else {
  447. if (type == 1 && this.statusVal == '已认证' || type == 1 && this.statusVal == '证件已过期' || type == 1 && this
  448. .statusVal == '身份认证未通过' || type == 1 && this.statusVal == '已驳回') {
  449. src = '/pages/mine/editDriverCertification'
  450. }
  451. if ((type == 2 || type == 3) && this.isFirstSH) {
  452. this.$refs.uToast.show({
  453. type: 'error',
  454. message: "请先完成司机身份认证",
  455. })
  456. } else if (type == 1 && this.statusVal == '身份认证审核中') {
  457. this.$refs.uToast.show({
  458. type: 'error',
  459. message: "正在审核中,请耐心等待!",
  460. })
  461. return
  462. } else {
  463. uni.$u.route(src);
  464. }
  465. }
  466. },
  467. toLogin() {
  468. console.log("userInfo", this.userInfo)
  469. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  470. uni.$u.route('/pages/public/login');
  471. } else {}
  472. // else if(!this.userInfo.nickname){
  473. // this.inputShow = true
  474. // this.inputStatus = 'inline'
  475. // this.feild = "nickname"
  476. // this.inputContent = ''
  477. // }
  478. },
  479. }
  480. }
  481. </script>
  482. <style lang="scss" scoped>
  483. .content {
  484. background: url(../../static/images/mine/bg@2x.png);
  485. background-size: 100% 100%;
  486. height: 100vh;
  487. padding: 0 25rpx;
  488. }
  489. .top-height {
  490. height: var(--status-bar-height);
  491. }
  492. .arrow {
  493. margin-left: 15px;
  494. width: 8px;
  495. height: 12px;
  496. // justify-content: flex-end
  497. }
  498. .head {
  499. .row1 {
  500. display: flex;
  501. justify-content: flex-end;
  502. margin-top: 46rpx;
  503. }
  504. .row2 {
  505. .right-text {
  506. margin-left: 40rpx;
  507. }
  508. .name {
  509. font-size: 42rpx;
  510. font-weight: 700;
  511. color: #333333;
  512. }
  513. .phone {
  514. font-size: 26rpx;
  515. font-weight: 500;
  516. color: #8F97AB;
  517. }
  518. }
  519. }
  520. .content1 {
  521. display: flex;
  522. justify-content: space-between;
  523. margin-top: 60rpx;
  524. .left,
  525. .right {
  526. width: 49%;
  527. padding: 30rpx 20rpx;
  528. background: white;
  529. border-radius: 25rpx;
  530. box-sizing: border-box;
  531. display: flex;
  532. align-items: center;
  533. .sfrz-icon {
  534. width: 42rpx;
  535. height: 42rpx;
  536. }
  537. .right-text {
  538. margin-left: 20rpx;
  539. .top {
  540. font-size: 28rpx;
  541. font-weight: 700;
  542. color: #000000;
  543. }
  544. .bottom {
  545. margin-top: 6rpx;
  546. font-size: 24rpx;
  547. color: #898989;
  548. }
  549. }
  550. }
  551. }
  552. .content2 {
  553. background: white;
  554. padding: 20rpx;
  555. border-radius: 20rpx;
  556. margin-top: 20rpx;
  557. .img {
  558. margin-right: 10rpx;
  559. width: 40rpx;
  560. height: 40rpx;
  561. top: 2rpx;
  562. }
  563. .flex-space-between {
  564. margin: 10rpx 0 50rpx 0;
  565. }
  566. }
  567. .version_css {
  568. // margin-right: 10rpx;
  569. color: #9D9D9D;
  570. font-size: 32rpx;
  571. text-align: center;
  572. }
  573. .scan{
  574. position:relative;
  575. top: -1px;
  576. left: -4px;
  577. }
  578. </style>