index.vue 11 KB

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