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