index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  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'>
  99. <view class='flex items-center'><u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/dailihuozhu.png"
  100. width="20px" height="20px"></u--image>代理货主</view>
  101. <u-badge v-if='redDotPrompt==0' :isDot="true" type="error"></u-badge>
  102. </view>
  103. <view >
  104. <image class='right' src="@/static/mine/right.png" mode=""></image>
  105. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  106. </view>
  107. </view>
  108. <view class="flex flex-space-between content1-item" @click="$helper.contactCustomerService()">
  109. <view class="flex align-center">
  110. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/images/mine/kf.png"
  111. width="20px" height="20px"></u--image>
  112. <view>联系客服</view>
  113. </view>
  114. <view>
  115. <image class='right' src="@/static/mine/right.png" mode=""></image>
  116. </view>
  117. </view>
  118. <view class="flex flex-space-between content1-item"
  119. @click="goDetailPage('/pages/mine/helpDescription',true)">
  120. <view class='flex items-center'>
  121. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/bangzhushuoming.png"
  122. width="20px" height="20px"></u--image>帮助说明
  123. </view>
  124. <view>
  125. <image class='right' src="@/static/mine/right.png" mode=""></image>
  126. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  127. </view>
  128. </view>
  129. <!-- <view class="flex flex-space-between content1-item"
  130. @click="goDetailPage('/pages/mine/driverEvaluation')">
  131. <view class='flex items-center'>
  132. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/dailihuozhu.png"
  133. width="20px" height="20px"></u--image>司机评价
  134. </view>
  135. <view>
  136. <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
  137. </view>
  138. </view> -->
  139. <!-- <view class="flex flex-space-between content1-item" @click="goDetailPage('/pages/mine/set')">
  140. <view class='flex items-center'>
  141. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/dailihuozhu.png"
  142. width="20px" height="20px"></u--image>设置
  143. </view>
  144. <view>
  145. <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
  146. </view>
  147. </view> -->
  148. </view>
  149. </view>
  150. <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
  151. :showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
  152. @cancel="cancelClick"></u-modal>
  153. <u-toast ref="uToast"></u-toast>
  154. </view>
  155. </template>
  156. <script>
  157. import {
  158. mapState
  159. } from 'vuex';
  160. export default {
  161. data() {
  162. return {
  163. confirmText: '',
  164. CargoOwner: {},
  165. redDotPrompt:1,
  166. showCancelButton: true,
  167. isShowAlert: false,
  168. alertTitle: '',
  169. userName: '',
  170. phone: '',
  171. status: false,
  172. status1: false,
  173. alertContent: '您尚未登录,是否立即登录?',
  174. cargoCall: "",
  175. };
  176. },
  177. onShow() {
  178. uni.setTabBarItem({
  179. index: 0,
  180. text: '订单',
  181. iconPath: 'static/images/common/dingdan@2x(1).png',
  182. selectedIconPath: 'static/images/common/dingdan@2x.png'
  183. })
  184. if (this.hasLogin) {
  185. uni.showLoading({
  186. title: '加载中',
  187. mask: true
  188. })
  189. this.$request.baseRequest('get', '/cargoOwnerInfo/selectCargoOwner', {
  190. commonId: this.userInfo.id
  191. }).then(res => {
  192. uni.hideLoading()
  193. if (res.data) {
  194. this.CargoOwner = res.data
  195. if (res.data.authenticationStatus == '审核中' || res.data.authenticationStatus == '已驳回' || res
  196. .data.authenticationStatus == '未认证' || res.data.authenticationStatus == '已过期') {
  197. if (res.data.authenticationStatus == '未认证') {
  198. this.status1 = false
  199. } else {
  200. this.status1 = true
  201. }
  202. this.status = false
  203. } else {
  204. this.status = true
  205. this.status1 = true
  206. }
  207. } else {
  208. this.status = false
  209. this.status1 = false
  210. }
  211. })
  212. .catch(res => {
  213. uni.hideLoading()
  214. uni.showToast({
  215. title: res.message,
  216. icon: 'none',
  217. duration: 2000
  218. })
  219. });
  220. this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
  221. phone: this.userInfo.phone
  222. }).then(res => {
  223. uni.setStorageSync("firstAuthentication", res.data)
  224. if (res.data) {
  225. this.redDotPrompt=res.data.redDotPrompt
  226. this.userName = res.data.call
  227. if (res.data.sex) {
  228. if (res.data.sex == '男') {
  229. this.cargoCall = "先生"
  230. } else {
  231. this.cargoCall = "女士"
  232. }
  233. }
  234. }
  235. this.$forceUpdate()
  236. })
  237. // this.phone = this.userInfo.phone ? this.userInfo.phone.replace(this.userInfo.phone.substring(3, 7),"****") : ''
  238. this.phone = this.userInfo.phone
  239. if (!this.cargoCall) {
  240. this.userName = this.userInfo.userName
  241. }
  242. if (!this.hasLogin) {
  243. this.isShowAlert = true
  244. return
  245. }
  246. }
  247. },
  248. onLoad() {
  249. },
  250. computed: {
  251. ...mapState(['hasLogin', 'userInfo', "firstAuthentication"]),
  252. // 手机号中间4位加*
  253. starUserphone() {
  254. let reg = /^(\d{3})\d{4}(\d{4})$/;
  255. if (this.phone) {
  256. return this.phone.replace(reg, "$1****$2");
  257. }
  258. }
  259. },
  260. methods: {
  261. scanCode() {
  262. let _this = this;
  263. uni.scanCode({
  264. onlyFromCamera: true,
  265. success: function(res) {
  266. console.log('条码内容:' + res.result);
  267. _this.token = res.result.split('?token=')[1];
  268. _this.mobileScanOk();
  269. }
  270. });
  271. },
  272. mobileScanOk() {
  273. this.$request.baseRequest('get', '/login/loginInfo', {
  274. token: this.token
  275. }).then(res => {
  276. console.log('111111111111111111111')
  277. console.log(res)
  278. let resultData = res;
  279. console.log(resultData);
  280. uni.navigateTo({
  281. url: `./confirm?token=${this.token}`
  282. });
  283. })
  284. },
  285. confirmClick() {
  286. // #ifdef APP-PLUS
  287. if (this.alertTitle == '账号审核中') {
  288. if (uni.getSystemInfoSync().platform == 'ios') {
  289. plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
  290. } else if (uni.getSystemInfoSync().platform == 'android') {
  291. plus.runtime.quit();
  292. }
  293. return
  294. }
  295. // #endif
  296. this.isShowAlert = false
  297. uni.$u.route('/pages/public/login');
  298. },
  299. cancelClick() {
  300. this.isShowAlert = false
  301. },
  302. toMyRelease() {
  303. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  304. uni.$u.route('/pages/public/login');
  305. } else {
  306. uni.$u.route('/pages/release/record');
  307. }
  308. },
  309. goDetailPage(src, isClick) {
  310. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  311. // if(src!='/pages/mine/helpDescription'){
  312. uni.$u.route('/pages/public/login');
  313. // }else{
  314. // uni.$u.route(src);
  315. // }
  316. } else {
  317. this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
  318. phone: this.userInfo.phone
  319. }).then(res => {
  320. uni.setStorageSync("firstAuthentication", res.data)
  321. if (res.data.authenticationStatus!='已认证'&&!isClick) {
  322. uni.$u.toast('请先完成货主认证!')
  323. }else{
  324. if(src=='/pages/mine/agentCargoOwner'){
  325. this.$request.baseRequest('post', '/cargoOwnerInfo/api/readRed', {
  326. id: res.data.id
  327. }).then(res1 => {
  328. uni.$u.route(src);
  329. })
  330. }else{
  331. uni.$u.route(src);
  332. }
  333. }
  334. })
  335. // if (isClick) {
  336. // uni.$u.route(src);
  337. // } else {
  338. // uni.$u.toast('请先完成货主认证!')
  339. // }
  340. }
  341. },
  342. toLogin() {
  343. console.log("userInfo", this.userInfo)
  344. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  345. uni.$u.route('/pages/public/login');
  346. } else {}
  347. // else if(!this.userInfo.nickname){
  348. // this.inputShow = true
  349. // this.inputStatus = 'inline'
  350. // this.feild = "nickname"
  351. // this.inputContent = ''
  352. // }
  353. }
  354. }
  355. }
  356. </script>
  357. <style lang="scss" scoped>
  358. .container {
  359. // padding-top: 85px;
  360. padding-top: 35px;
  361. background-color: #F5F6FA;
  362. position: relative;
  363. width: 100vw;
  364. overflow: hidden;
  365. background: url('~@/static/mine/bg@3x.png');
  366. background-size: 100% 100%;
  367. margin: 0 auto;
  368. height: calc(100vh - 35px);
  369. .container_content {
  370. padding: 18px;
  371. }
  372. }
  373. .image {
  374. margin: 0 7px;
  375. }
  376. .username {
  377. font-size: 21px;
  378. }
  379. .information {
  380. margin: 0 0 10px 17px;
  381. }
  382. .currectstatus {
  383. display: flex;
  384. align-items: center;
  385. justify-content: center;
  386. width: 100rpx;
  387. height: 40rpx;
  388. background: #161111;
  389. border-radius: 16px;
  390. color: #D6B798;
  391. font-size: 24rpx;
  392. margin-left: 10rpx;
  393. }
  394. .currectstatus1 {
  395. display: flex;
  396. align-items: center;
  397. justify-content: center;
  398. width: 100rpx;
  399. height: 40rpx;
  400. background: linear-gradient(145deg, #C1C3CC 0%, #85909E 100%);
  401. ;
  402. border-radius: 16px;
  403. color: #D6B798;
  404. font-size: 24rpx;
  405. margin-left: 10rpx;
  406. }
  407. .phone {
  408. color: #8F97AB;
  409. font-size: 13px;
  410. margin-top: 5px;
  411. }
  412. .operate {
  413. font-size: 16px;
  414. font-weight: 600;
  415. background: #fff;
  416. border-radius: 10px;
  417. padding: 10px 15px;
  418. margin: 15px 0;
  419. }
  420. .content1 {
  421. background: #fff;
  422. padding: 10px;
  423. border-radius: 10px;
  424. .content1-item {
  425. padding: 10px;
  426. }
  427. }
  428. .authentication {
  429. border: 1px solid #F3EACF;
  430. margin: 10px 0;
  431. height: 64px;
  432. border-radius: 10px;
  433. padding: 15px;
  434. box-sizing: border-box;
  435. background: linear-gradient(144deg, #FEFAEE 0%, #FEFDF8 100%);
  436. }
  437. .promptlyAuthentication {
  438. font-size: 13px;
  439. padding: 8px 16px;
  440. border-radius: 15px;
  441. background: linear-gradient(327deg, #EDBB63 0%, #FFDEA5 100%);
  442. ;
  443. }
  444. .items-center {
  445. align-items: center;
  446. }
  447. .right {
  448. width: 10px;
  449. height: 10px;
  450. }
  451. .u-badge--error{
  452. background:#EE5032;
  453. width:6px;
  454. height:6px;
  455. }
  456. </style>