index.vue 11 KB

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