index.vue 10 KB

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