index.vue 10.0 KB

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