index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <!-- 我的 -->
  2. <template>
  3. <view class="container">
  4. <view class='container_content'>
  5. <view class="head">
  6. <view style='margin-bottom:14px;' class="row flex flex-end">
  7. <u--image class='image' :showLoading="true" src="../../static/mine/saoma.png" width="20px"
  8. height="20px" @click="scanCode()" v-if='hasLogin'></u--image>
  9. <u--image @click="goDetailPage('/pages/mine/set',true)" style='margin-right:0;' class='image'
  10. :showLoading="true" src="../../static/mine/shezhi.png" width="20px" height="20px"></u--image>
  11. </view>
  12. <view class="flex">
  13. <u--image :showLoading="true"
  14. :src="userInfo.avatarUrl?userInfo.avatarUrl:'../../static/mine/avatar1.png'" width="56px"
  15. height="56px" shape='circle'></u--image>
  16. <view class='information' v-if='hasLogin'>
  17. <view class='flex items-center'>
  18. <view v-if='userName' class='username'>{{userName}} {{cargoCall}}</view>
  19. <view v-else class='username'>{{userInfo.userName}} </view>
  20. <view @click="goDetailPage('/pages/mine/cargoowner/cargoowner',true)" v-if='status'
  21. class='currectstatus'>已认证</view>
  22. <view@click="goDetailPage(' /pages/mine/cargoowner/cargoowner',true)" v-if='!status'
  23. class='currectstatus1'>
  24. {{CargoOwner.authenticationStatus?CargoOwner.authenticationStatus:'未认证'}}
  25. </view>
  26. </view>
  27. <view class='phone'>{{starUserphone}}</view>
  28. </view>
  29. <view class='information' v-else @click="toLogin">立即登录</view>
  30. </view>
  31. <view v-if='hasLogin&&!status1' class='authentication flex flex-space-between'>
  32. <view>
  33. <view style='font-size:14px;'>货主身份认证</view>
  34. <view style='color:#DDA558;font-size:12px;'>您还没有完成货主认证哦~</view>
  35. </view>
  36. <view @click="goDetailPage('/pages/mine/cargoowner/cargoowner',true)" class='promptlyAuthentication'>立即认证
  37. </view>
  38. </view>
  39. </view>
  40. <view class='flex operate flex-space-around'>
  41. <view style='font-size:14px;' class='flex items-center' @click="toMyRelease">
  42. <u--image style='margin-right:8px;position:relative;top:3px;' :showLoading="true"
  43. src="../../static/mine/wodefabu.png" width="42px" height="42px"></u--image>我的发布
  44. </view>
  45. <view style='font-size:14px;' class='flex items-center' @click="goDetailPage('/pages/mine/evaluate')">
  46. <u--image style='margin-right:8px;position:relative;top:3px;' :showLoading="true"
  47. src="../../static/mine/pingjia.png" width="42px" height="42px"></u--image>
  48. 司机评价
  49. </view>
  50. </view>
  51. <view class="content1">
  52. <view class="flex flex-space-between content1-item"
  53. @click="goDetailPage('/pages/mine/myAccount/index',false)">
  54. <view class='flex items-center'>
  55. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/zhanghu.png"
  56. width="20px" height="20px"></u--image>我的账户
  57. </view>
  58. <view>
  59. <image class='right' src="@/static/mine/right.png" mode=""></image>
  60. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  61. </view>
  62. </view>
  63. <view class="flex flex-space-between content1-item"
  64. @click="goDetailPage('/pages/mine/company/index',false)">
  65. <view class='flex items-center'>
  66. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/wodegongsi.png"
  67. width="20px" height="20px"></u--image>我的公司
  68. </view>
  69. <view class='flex'>
  70. <image class='right' src="@/static/mine/right.png" mode=""></image>
  71. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  72. </view>
  73. </view>
  74. <view class="flex flex-space-between content1-item"
  75. @click="goDetailPage('/pages/mine/manageBankCards/index',false)">
  76. <view class='flex items-center'>
  77. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/yinhangka.png"
  78. width="20px" height="20px"></u--image>我的银行卡
  79. </view>
  80. <view>
  81. <image class='right' src="@/static/mine/right.png" mode=""></image>
  82. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  83. </view>
  84. </view>
  85. <view class="flex flex-space-between content1-item"
  86. @click="goDetailPage('/pages/mine/cargoowner/cargoowner',true)">
  87. <view class='flex items-center'>
  88. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/huozhu.png"
  89. width="20px" height="20px"></u--image>货主认证
  90. </view>
  91. <view class='flex'>
  92. <image class='right' src="@/static/mine/right.png" mode=""></image>
  93. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  94. </view>
  95. </view>
  96. <view class="flex flex-space-between content1-item"
  97. @click="goDetailPage('/pages/mine/agentCargoOwner',false)">
  98. <view class='flex items-center'>
  99. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/dailihuozhu.png"
  100. width="20px" height="20px"></u--image>代理货主
  101. </view>
  102. <view>
  103. <image class='right' src="@/static/mine/right.png" mode=""></image>
  104. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  105. </view>
  106. </view>
  107. <view class="flex flex-space-between content1-item"
  108. @click="goDetailPage('/pages/mine/helpDescription',true)">
  109. <view class='flex items-center'>
  110. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/bangzhushuoming.png"
  111. width="20px" height="20px"></u--image>帮助说明
  112. </view>
  113. <view>
  114. <image class='right' src="@/static/mine/right.png" mode=""></image>
  115. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  116. </view>
  117. </view>
  118. <!-- <view class="flex flex-space-between content1-item"
  119. @click="goDetailPage('/pages/mine/driverEvaluation')">
  120. <view class='flex items-center'>
  121. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/dailihuozhu.png"
  122. width="20px" height="20px"></u--image>司机评价
  123. </view>
  124. <view>
  125. <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
  126. </view>
  127. </view> -->
  128. <!-- <view class="flex flex-space-between content1-item" @click="goDetailPage('/pages/mine/set')">
  129. <view class='flex items-center'>
  130. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/dailihuozhu.png"
  131. width="20px" height="20px"></u--image>设置
  132. </view>
  133. <view>
  134. <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
  135. </view>
  136. </view> -->
  137. </view>
  138. </view>
  139. <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
  140. :showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
  141. @cancel="cancelClick"></u-modal>
  142. <u-toast ref="uToast"></u-toast>
  143. </view>
  144. </template>
  145. <script>
  146. import {
  147. mapState
  148. } from 'vuex';
  149. export default {
  150. data() {
  151. return {
  152. confirmText: '',
  153. CargoOwner: {},
  154. showCancelButton: true,
  155. isShowAlert: false,
  156. alertTitle: '',
  157. userName: '',
  158. phone: '',
  159. status: false,
  160. status1: false,
  161. alertContent: '您尚未登录,是否立即登录?',
  162. cargoCall: "",
  163. };
  164. },
  165. onShow() {
  166. if (this.hasLogin) {
  167. uni.showLoading({
  168. title: '加载中',
  169. mask: true
  170. })
  171. this.$request.baseRequest('get', '/cargoOwnerInfo/selectCargoOwner', {
  172. commonId: this.userInfo.id
  173. }).then(res => {
  174. uni.hideLoading()
  175. if (res.data) {
  176. this.CargoOwner = res.data
  177. if (res.data.authenticationStatus == '审核中' || res.data.authenticationStatus == '已驳回' || res
  178. .data.authenticationStatus == '未认证' || res.data.authenticationStatus == '已过期') {
  179. if (res.data.authenticationStatus == '未认证') {
  180. this.status1 = false
  181. } else {
  182. this.status1 = true
  183. }
  184. this.status = false
  185. } else {
  186. this.status = true
  187. this.status1 = true
  188. }
  189. } else {
  190. this.status = false
  191. this.status1 = false
  192. }
  193. })
  194. .catch(res => {
  195. uni.hideLoading()
  196. uni.showToast({
  197. title: res.message,
  198. icon: 'none',
  199. duration: 2000
  200. })
  201. });
  202. this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
  203. phone: this.userInfo.phone
  204. }).then(res => {
  205. uni.setStorageSync("firstAuthentication", res.data)
  206. if (res.data) {
  207. this.userName = res.data.call
  208. if (res.data.sex) {
  209. if (res.data.sex == '男') {
  210. this.cargoCall = "先生"
  211. } else {
  212. this.cargoCall = "女士"
  213. }
  214. }
  215. }
  216. this.$forceUpdate()
  217. })
  218. // this.phone = this.userInfo.phone ? this.userInfo.phone.replace(this.userInfo.phone.substring(3, 7),"****") : ''
  219. this.phone = this.userInfo.phone
  220. if (!this.cargoCall) {
  221. this.userName = this.userInfo.userName
  222. }
  223. if (!this.hasLogin) {
  224. this.isShowAlert = true
  225. return
  226. }
  227. }
  228. },
  229. onLoad() {
  230. },
  231. computed: {
  232. ...mapState(['hasLogin', 'userInfo', "firstAuthentication"]),
  233. // 手机号中间4位加*
  234. starUserphone() {
  235. let reg = /^(\d{3})\d{4}(\d{4})$/;
  236. if (this.phone) {
  237. return this.phone.replace(reg, "$1****$2");
  238. }
  239. }
  240. },
  241. methods: {
  242. scanCode() {
  243. let _this = this;
  244. uni.scanCode({
  245. onlyFromCamera: true,
  246. success: function(res) {
  247. console.log('条码内容:' + res.result);
  248. _this.token = res.result.split('?token=')[1];
  249. _this.mobileScanOk();
  250. }
  251. });
  252. },
  253. mobileScanOk() {
  254. this.$request.baseRequest('get', '/login/loginInfo', {
  255. token: this.token
  256. }).then(res => {
  257. console.log('111111111111111111111')
  258. console.log(res)
  259. let resultData = res;
  260. console.log(resultData);
  261. uni.navigateTo({
  262. url: `./confirm?token=${this.token}`
  263. });
  264. })
  265. },
  266. confirmClick() {
  267. // #ifdef APP-PLUS
  268. if (this.alertTitle == '账号审核中') {
  269. if (uni.getSystemInfoSync().platform == 'ios') {
  270. plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
  271. } else if (uni.getSystemInfoSync().platform == 'android') {
  272. plus.runtime.quit();
  273. }
  274. return
  275. }
  276. // #endif
  277. this.isShowAlert = false
  278. uni.$u.route('/pages/public/login');
  279. },
  280. cancelClick() {
  281. this.isShowAlert = false
  282. },
  283. toMyRelease() {
  284. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  285. uni.$u.route('/pages/public/login');
  286. } else {
  287. uni.$u.route('/pages/release/record');
  288. }
  289. },
  290. goDetailPage(src, isClick) {
  291. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  292. // if(src!='/pages/mine/helpDescription'){
  293. uni.$u.route('/pages/public/login');
  294. // }else{
  295. // uni.$u.route(src);
  296. // }
  297. } else {
  298. this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
  299. phone: this.userInfo.phone
  300. }).then(res => {
  301. uni.setStorageSync("firstAuthentication", res.data)
  302. if (res.data.authenticationStatus!='已认证'&&!isClick) {
  303. uni.$u.toast('请先完成货主认证!')
  304. }else{
  305. uni.$u.route(src);
  306. }
  307. })
  308. // if (isClick) {
  309. // uni.$u.route(src);
  310. // } else {
  311. // uni.$u.toast('请先完成货主认证!')
  312. // }
  313. }
  314. },
  315. toLogin() {
  316. console.log("userInfo", this.userInfo)
  317. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  318. uni.$u.route('/pages/public/login');
  319. } else {}
  320. // else if(!this.userInfo.nickname){
  321. // this.inputShow = true
  322. // this.inputStatus = 'inline'
  323. // this.feild = "nickname"
  324. // this.inputContent = ''
  325. // }
  326. }
  327. }
  328. }
  329. </script>
  330. <style lang="scss" scoped>
  331. .container {
  332. padding-top: 85px;
  333. padding-top: 35px;
  334. background-color: #F5F6FA;
  335. position: relative;
  336. width: 100vw;
  337. overflow: hidden;
  338. background: url('~@/static/mine/bg@3x.png');
  339. background-size: 100% 100%;
  340. margin: 0 auto;
  341. height: calc(100vh - 85px);
  342. .container_content {
  343. padding: 18px;
  344. }
  345. }
  346. .image {
  347. margin: 0 7px;
  348. }
  349. .username {
  350. font-size: 21px;
  351. }
  352. .information {
  353. margin: 0 0 10px 17px;
  354. }
  355. .currectstatus {
  356. display: flex;
  357. align-items: center;
  358. justify-content: center;
  359. width: 100rpx;
  360. height: 40rpx;
  361. background: #161111;
  362. border-radius: 16px;
  363. color: #D6B798;
  364. font-size: 24rpx;
  365. margin-left: 10rpx;
  366. }
  367. .currectstatus1 {
  368. display: flex;
  369. align-items: center;
  370. justify-content: center;
  371. width: 100rpx;
  372. height: 40rpx;
  373. background: linear-gradient(145deg, #C1C3CC 0%, #85909E 100%);
  374. ;
  375. border-radius: 16px;
  376. color: #D6B798;
  377. font-size: 24rpx;
  378. margin-left: 10rpx;
  379. }
  380. .phone {
  381. color: #8F97AB;
  382. font-size: 13px;
  383. margin-top: 5px;
  384. }
  385. .operate {
  386. font-size: 16px;
  387. font-weight: 600;
  388. background: #fff;
  389. border-radius: 10px;
  390. padding: 10px 15px;
  391. margin: 15px 0;
  392. }
  393. .content1 {
  394. background: #fff;
  395. padding: 10px;
  396. border-radius: 10px;
  397. .content1-item {
  398. padding: 10px;
  399. }
  400. }
  401. .authentication {
  402. border: 1px solid #F3EACF;
  403. margin: 10px 0;
  404. height: 64px;
  405. border-radius: 10px;
  406. padding: 15px;
  407. box-sizing: border-box;
  408. background: linear-gradient(144deg, #FEFAEE 0%, #FEFDF8 100%);
  409. }
  410. .promptlyAuthentication {
  411. font-size: 13px;
  412. padding: 8px 16px;
  413. border-radius: 15px;
  414. background: linear-gradient(327deg, #EDBB63 0%, #FFDEA5 100%);
  415. ;
  416. }
  417. .items-center {
  418. align-items: center;
  419. }
  420. .right {
  421. width: 10px;
  422. height: 10px;
  423. }
  424. </style>