index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  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. uni.setTabBarItem({
  167. index: 0,
  168. text: '订单',
  169. iconPath: 'static/images/common/dingdan@2x(1).png',
  170. selectedIconPath: 'static/images/common/dingdan@2x.png'
  171. })
  172. if (this.hasLogin) {
  173. uni.showLoading({
  174. title: '加载中',
  175. mask: true
  176. })
  177. this.$request.baseRequest('get', '/cargoOwnerInfo/selectCargoOwner', {
  178. commonId: this.userInfo.id
  179. }).then(res => {
  180. uni.hideLoading()
  181. if (res.data) {
  182. this.CargoOwner = res.data
  183. if (res.data.authenticationStatus == '审核中' || res.data.authenticationStatus == '已驳回' || res
  184. .data.authenticationStatus == '未认证' || res.data.authenticationStatus == '已过期') {
  185. if (res.data.authenticationStatus == '未认证') {
  186. this.status1 = false
  187. } else {
  188. this.status1 = true
  189. }
  190. this.status = false
  191. } else {
  192. this.status = true
  193. this.status1 = true
  194. }
  195. } else {
  196. this.status = false
  197. this.status1 = false
  198. }
  199. })
  200. .catch(res => {
  201. uni.hideLoading()
  202. uni.showToast({
  203. title: res.message,
  204. icon: 'none',
  205. duration: 2000
  206. })
  207. });
  208. this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
  209. phone: this.userInfo.phone
  210. }).then(res => {
  211. uni.setStorageSync("firstAuthentication", res.data)
  212. if (res.data) {
  213. this.userName = res.data.call
  214. if (res.data.sex) {
  215. if (res.data.sex == '男') {
  216. this.cargoCall = "先生"
  217. } else {
  218. this.cargoCall = "女士"
  219. }
  220. }
  221. }
  222. this.$forceUpdate()
  223. })
  224. // this.phone = this.userInfo.phone ? this.userInfo.phone.replace(this.userInfo.phone.substring(3, 7),"****") : ''
  225. this.phone = this.userInfo.phone
  226. if (!this.cargoCall) {
  227. this.userName = this.userInfo.userName
  228. }
  229. if (!this.hasLogin) {
  230. this.isShowAlert = true
  231. return
  232. }
  233. }
  234. },
  235. onLoad() {
  236. },
  237. computed: {
  238. ...mapState(['hasLogin', 'userInfo', "firstAuthentication"]),
  239. // 手机号中间4位加*
  240. starUserphone() {
  241. let reg = /^(\d{3})\d{4}(\d{4})$/;
  242. if (this.phone) {
  243. return this.phone.replace(reg, "$1****$2");
  244. }
  245. }
  246. },
  247. methods: {
  248. scanCode() {
  249. let _this = this;
  250. uni.scanCode({
  251. onlyFromCamera: true,
  252. success: function(res) {
  253. console.log('条码内容:' + res.result);
  254. _this.token = res.result.split('?token=')[1];
  255. _this.mobileScanOk();
  256. }
  257. });
  258. },
  259. mobileScanOk() {
  260. this.$request.baseRequest('get', '/login/loginInfo', {
  261. token: this.token
  262. }).then(res => {
  263. console.log('111111111111111111111')
  264. console.log(res)
  265. let resultData = res;
  266. console.log(resultData);
  267. uni.navigateTo({
  268. url: `./confirm?token=${this.token}`
  269. });
  270. })
  271. },
  272. confirmClick() {
  273. // #ifdef APP-PLUS
  274. if (this.alertTitle == '账号审核中') {
  275. if (uni.getSystemInfoSync().platform == 'ios') {
  276. plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
  277. } else if (uni.getSystemInfoSync().platform == 'android') {
  278. plus.runtime.quit();
  279. }
  280. return
  281. }
  282. // #endif
  283. this.isShowAlert = false
  284. uni.$u.route('/pages/public/login');
  285. },
  286. cancelClick() {
  287. this.isShowAlert = false
  288. },
  289. toMyRelease() {
  290. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  291. uni.$u.route('/pages/public/login');
  292. } else {
  293. uni.$u.route('/pages/release/record');
  294. }
  295. },
  296. goDetailPage(src, isClick) {
  297. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  298. // if(src!='/pages/mine/helpDescription'){
  299. uni.$u.route('/pages/public/login');
  300. // }else{
  301. // uni.$u.route(src);
  302. // }
  303. } else {
  304. this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
  305. phone: this.userInfo.phone
  306. }).then(res => {
  307. uni.setStorageSync("firstAuthentication", res.data)
  308. if (res.data.authenticationStatus!='已认证'&&!isClick) {
  309. uni.$u.toast('请先完成货主认证!')
  310. }else{
  311. uni.$u.route(src);
  312. }
  313. })
  314. // if (isClick) {
  315. // uni.$u.route(src);
  316. // } else {
  317. // uni.$u.toast('请先完成货主认证!')
  318. // }
  319. }
  320. },
  321. toLogin() {
  322. console.log("userInfo", this.userInfo)
  323. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  324. uni.$u.route('/pages/public/login');
  325. } else {}
  326. // else if(!this.userInfo.nickname){
  327. // this.inputShow = true
  328. // this.inputStatus = 'inline'
  329. // this.feild = "nickname"
  330. // this.inputContent = ''
  331. // }
  332. }
  333. }
  334. }
  335. </script>
  336. <style lang="scss" scoped>
  337. .container {
  338. // padding-top: 85px;
  339. padding-top: 35px;
  340. background-color: #F5F6FA;
  341. position: relative;
  342. width: 100vw;
  343. overflow: hidden;
  344. background: url('~@/static/mine/bg@3x.png');
  345. background-size: 100% 100%;
  346. margin: 0 auto;
  347. height: calc(100vh - 35px);
  348. .container_content {
  349. padding: 18px;
  350. }
  351. }
  352. .image {
  353. margin: 0 7px;
  354. }
  355. .username {
  356. font-size: 21px;
  357. }
  358. .information {
  359. margin: 0 0 10px 17px;
  360. }
  361. .currectstatus {
  362. display: flex;
  363. align-items: center;
  364. justify-content: center;
  365. width: 100rpx;
  366. height: 40rpx;
  367. background: #161111;
  368. border-radius: 16px;
  369. color: #D6B798;
  370. font-size: 24rpx;
  371. margin-left: 10rpx;
  372. }
  373. .currectstatus1 {
  374. display: flex;
  375. align-items: center;
  376. justify-content: center;
  377. width: 100rpx;
  378. height: 40rpx;
  379. background: linear-gradient(145deg, #C1C3CC 0%, #85909E 100%);
  380. ;
  381. border-radius: 16px;
  382. color: #D6B798;
  383. font-size: 24rpx;
  384. margin-left: 10rpx;
  385. }
  386. .phone {
  387. color: #8F97AB;
  388. font-size: 13px;
  389. margin-top: 5px;
  390. }
  391. .operate {
  392. font-size: 16px;
  393. font-weight: 600;
  394. background: #fff;
  395. border-radius: 10px;
  396. padding: 10px 15px;
  397. margin: 15px 0;
  398. }
  399. .content1 {
  400. background: #fff;
  401. padding: 10px;
  402. border-radius: 10px;
  403. .content1-item {
  404. padding: 10px;
  405. }
  406. }
  407. .authentication {
  408. border: 1px solid #F3EACF;
  409. margin: 10px 0;
  410. height: 64px;
  411. border-radius: 10px;
  412. padding: 15px;
  413. box-sizing: border-box;
  414. background: linear-gradient(144deg, #FEFAEE 0%, #FEFDF8 100%);
  415. }
  416. .promptlyAuthentication {
  417. font-size: 13px;
  418. padding: 8px 16px;
  419. border-radius: 15px;
  420. background: linear-gradient(327deg, #EDBB63 0%, #FFDEA5 100%);
  421. ;
  422. }
  423. .items-center {
  424. align-items: center;
  425. }
  426. .right {
  427. width: 10px;
  428. height: 10px;
  429. }
  430. </style>