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