index.vue 11 KB

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