index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  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. <!-- <view class="" v-if="CargoOwner.authenticationStatus">{{CargoOwner.authenticationStatus=="已过期"?"身份已过期":CargoOwner.authenticationStatus}}</view>
  25. <view class="" v-else>未认证</view> -->
  26. <!-- {{CargoOwner.authenticationStatus?CargoOwner.authenticationStatus:'未认证'}} -->
  27. <!-- </view> -->
  28. </view>
  29. <view class='phone'>{{starUserphone}}</view>
  30. </view>
  31. <view class='information' v-else @click="toLogin">立即登录</view>
  32. </view>
  33. <view v-if='hasLogin&&!status1' class='authentication flex flex-space-between'>
  34. <view>
  35. <view style='font-size:14px;'>货主身份认证</view>
  36. <view style='color:#DDA558;font-size:12px;'>您还没有完成货主认证哦~</view>
  37. </view>
  38. <view @click="goDetailPage('/pages/mine/cargoowner/cargoowner',true)"
  39. class='promptlyAuthentication'>立即认证
  40. </view>
  41. </view>
  42. </view>
  43. <view class='flex operate flex-space-around'>
  44. <view style='font-size:14px;' class='flex items-center' @click="goDetailPage('/pages/release/record')">
  45. <u--image style='margin-right:8px;position:relative;top:3px;' :showLoading="true"
  46. src="../../static/mine/wodefabu.png" width="42px" height="42px"></u--image>我的发布
  47. </view>
  48. <view style='font-size:14px;' class='flex items-center' @click="goDetailPage('/pages/mine/evaluate')">
  49. <u--image style='margin-right:8px;position:relative;top:3px;' :showLoading="true"
  50. src="../../static/mine/pingjia.png" width="42px" height="42px"></u--image>
  51. 司机评价
  52. </view>
  53. </view>
  54. <view class="content1">
  55. <view class="flex flex-space-between content1-item"
  56. @click="goDetailPage('/pages/mine/myAccount/index',false)">
  57. <view class='flex items-center'>
  58. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/zhanghu.png"
  59. width="20px" height="20px"></u--image>我的账户
  60. </view>
  61. <view>
  62. <image class='right' src="@/static/mine/right.png" mode=""></image>
  63. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  64. </view>
  65. </view>
  66. <view class="flex flex-space-between content1-item"
  67. @click="goDetailPage('/pages/mine/company/index',false)">
  68. <view class='flex items-center'>
  69. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/wodegongsi.png"
  70. width="20px" height="20px"></u--image>我的公司
  71. </view>
  72. <view class='flex'>
  73. <image class='right' src="@/static/mine/right.png" mode=""></image>
  74. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  75. </view>
  76. </view>
  77. <view class="flex flex-space-between content1-item"
  78. @click="goDetailPage('/pages/mine/manageBankCards/index',false)">
  79. <view class='flex items-center'>
  80. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/yinhangka.png"
  81. width="20px" height="20px"></u--image>我的银行卡
  82. </view>
  83. <view>
  84. <image class='right' src="@/static/mine/right.png" mode=""></image>
  85. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  86. </view>
  87. </view>
  88. <view class="flex flex-space-between content1-item"
  89. @click="goDetailPage('/pages/mine/cargoowner/cargoowner',true)">
  90. <view class='flex items-center'>
  91. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/huozhu.png"
  92. width="20px" height="20px"></u--image>
  93. <view>货主认证</view>
  94. </view>
  95. <view>
  96. <text class="version_css"
  97. v-if="CargoOwner.authenticationStatus">{{CargoOwner.authenticationStatus == '已过期'?'认证已过期':CargoOwner.authenticationStatus}}</text>
  98. <text class="version_css" v-else>未认证</text>
  99. <image class='right' src="@/static/mine/right.png" mode=""></image>
  100. </view>
  101. </view>
  102. <!-- <view class="flex flex-space-between content1-item">
  103. <view class="flex align-center">
  104. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/images/mine/appUpdate.png"
  105. width="20px" height="20px"></u--image>
  106. <view>货主认证</view>
  107. </view>
  108. <view @click="onAPPUpdate">
  109. <text class="version_css">{{version}}</text>
  110. <image class='right' src="@/static/mine/right.png" mode=""></image>
  111. </view>
  112. </view> -->
  113. <view class="flex flex-space-between content1-item"
  114. @click="goDetailPage('/pages/mine/agentCargoOwner',false)">
  115. <view class='flex'>
  116. <view class='flex items-center'>
  117. <u--image style='margin-right:8px;' :showLoading="true"
  118. src="../../static/mine/dailihuozhu.png" width="20px" height="20px"></u--image>代理货主
  119. </view>
  120. <u-badge v-if='redDotPrompt==0 && hasLogin' :isDot="true" type="error"></u-badge>
  121. </view>
  122. <view>
  123. <image class='right' src="@/static/mine/right.png" mode=""></image>
  124. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  125. </view>
  126. </view>
  127. <view class="flex flex-space-between content1-item"
  128. @click="goDetailPage('/pages/carSource/index',false)">
  129. <view class='flex'>
  130. <view class='flex items-center'>
  131. <u--image style='margin-right:8px;' :showLoading="true"
  132. src="../../static/mine/dailihuozhu.png" width="20px" height="20px"></u--image>车源
  133. </view>
  134. <u-badge v-if='redDotPrompt==0 && hasLogin' :isDot="true" type="error"></u-badge>
  135. </view>
  136. <view>
  137. <image class='right' src="@/static/mine/right.png" mode=""></image>
  138. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  139. </view>
  140. </view>
  141. <view class="flex flex-space-between content1-item" @click="$helper.contactCustomerService()">
  142. <view class="flex align-center">
  143. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/images/mine/kf.png"
  144. width="20px" height="20px"></u--image>
  145. <view>联系客服</view>
  146. </view>
  147. <view>
  148. <image class='right' src="@/static/mine/right.png" mode=""></image>
  149. </view>
  150. </view>
  151. <view class="flex flex-space-between content1-item"
  152. @click="goDetailPage('/pages/mine/helpDescription',true)">
  153. <view class='flex items-center'>
  154. <u--image style='margin-right:8px;' :showLoading="true"
  155. src="../../static/mine/bangzhushuoming.png" width="20px" height="20px"></u--image>操作流程
  156. </view>
  157. <view>
  158. <image class='right' src="@/static/mine/right.png" mode=""></image>
  159. <!-- <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon> -->
  160. </view>
  161. </view>
  162. <view class="flex flex-space-between content1-item">
  163. <view class="flex align-center">
  164. <u--image style='margin-right:8px;' :showLoading="true"
  165. src="../../static/images/mine/appUpdate.png" width="20px" height="20px"></u--image>
  166. <view>检查更新</view>
  167. </view>
  168. <view @click="onAPPUpdate">
  169. <text class="version_css">{{version}}</text>
  170. <image class='right' src="@/static/mine/right.png" mode=""></image>
  171. </view>
  172. </view>
  173. <!-- <view class="flex flex-space-between content1-item"
  174. @click="goDetailPage('/pages/mine/driverEvaluation')">
  175. <view class='flex items-center'>
  176. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/dailihuozhu.png"
  177. width="20px" height="20px"></u--image>司机评价
  178. </view>
  179. <view>
  180. <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
  181. </view>
  182. </view> -->
  183. <!-- <view class="flex flex-space-between content1-item" @click="goDetailPage('/pages/mine/set')">
  184. <view class='flex items-center'>
  185. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/dailihuozhu.png"
  186. width="20px" height="20px"></u--image>设置
  187. </view>
  188. <view>
  189. <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
  190. </view>
  191. </view> -->
  192. </view>
  193. </view>
  194. <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
  195. :showCancelButton='showCancelButton' confirmColor='#F5BA3C' @confirm="confirmClick" @close="cancelClick"
  196. @cancel="cancelClick"></u-modal>
  197. <u-toast ref="uToast"></u-toast>
  198. </view>
  199. </template>
  200. <script>
  201. import {
  202. mapState
  203. } from 'vuex';
  204. import APPUpdate, {
  205. getCurrentNo
  206. } from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate';
  207. import * as config from '@/config/index.js'
  208. export default {
  209. data() {
  210. return {
  211. confirmText: '',
  212. CargoOwner: {},
  213. redDotPrompt: 1,
  214. showCancelButton: true,
  215. isShowAlert: false,
  216. alertTitle: '',
  217. userName: '',
  218. phone: '',
  219. status: false,
  220. status1: false,
  221. alertContent: '您尚未登录,是否立即登录?',
  222. cargoCall: "",
  223. version: "1.1.0"
  224. };
  225. },
  226. onShow() {
  227. // #ifdef APP-PLUS
  228. plus.runtime.getProperty(plus.runtime.appid, (info) => {
  229. //版本号
  230. this.version = info.version;
  231. console.log("当前版本为:", this.version)
  232. this.checkVersion()
  233. })
  234. // #endif
  235. uni.setTabBarItem({
  236. index: 0,
  237. text: '订单',
  238. iconPath: 'static/images/common/dingdan@2x(1).png',
  239. selectedIconPath: 'static/images/common/dingdan@2x.png'
  240. })
  241. if (this.hasLogin) {
  242. uni.showLoading({
  243. title: '加载中',
  244. mask: true
  245. })
  246. this.$request.baseRequest('get', '/cargoOwnerInfo/selectCargoOwner', {
  247. commonId: this.userInfo.id
  248. }).then(res => {
  249. uni.hideLoading()
  250. if (res.data) {
  251. this.CargoOwner = res.data
  252. if (res.data.authenticationStatus == '审核中' || res.data.authenticationStatus == '已驳回' || res
  253. .data.authenticationStatus == '未认证' || res.data.authenticationStatus == '已过期') {
  254. if (res.data.authenticationStatus == '未认证') {
  255. this.status1 = false
  256. } else {
  257. this.status1 = true
  258. }
  259. this.status = false
  260. } else {
  261. this.status = true
  262. this.status1 = true
  263. }
  264. } else {
  265. this.status = false
  266. this.status1 = false
  267. }
  268. })
  269. .catch(res => {
  270. uni.hideLoading()
  271. uni.showToast({
  272. title: res.message,
  273. icon: 'none',
  274. duration: 2000
  275. })
  276. });
  277. this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
  278. phone: this.userInfo.phone
  279. }).then(res => {
  280. uni.setStorageSync("firstAuthentication", res.data)
  281. if (res.data) {
  282. this.redDotPrompt = res.data.redDotPrompt
  283. this.userName = res.data.call
  284. if (res.data.sex) {
  285. if (res.data.sex == '男') {
  286. this.cargoCall = "先生"
  287. } else {
  288. this.cargoCall = "女士"
  289. }
  290. }
  291. }
  292. this.$forceUpdate()
  293. })
  294. // this.phone = this.userInfo.phone ? this.userInfo.phone.replace(this.userInfo.phone.substring(3, 7),"****") : ''
  295. this.phone = this.userInfo.phone
  296. if (!this.cargoCall) {
  297. this.userName = this.userInfo.userName
  298. }
  299. if (!this.hasLogin) {
  300. this.isShowAlert = true
  301. return
  302. }
  303. }
  304. },
  305. onLoad() {
  306. },
  307. computed: {
  308. ...mapState(['hasLogin', 'userInfo', "firstAuthentication"]),
  309. // 手机号中间4位加*
  310. starUserphone() {
  311. let reg = /^(\d{3})\d{4}(\d{4})$/;
  312. if (this.phone) {
  313. return this.phone.replace(reg, "$1****$2");
  314. }
  315. }
  316. },
  317. methods: {
  318. // 检查APP是否有新版本
  319. onAPPUpdate() {
  320. // true 没有新版本的时候有提示,默认:false
  321. if (this.version == "发现新版本,立即更新") {
  322. APPUpdate(true);
  323. }
  324. },
  325. checkVersion() {
  326. const baseUrlNew = config.def().baseUrlNew
  327. uni.request({
  328. url: baseUrlNew + '/appVersion/selectInfo',
  329. data: {
  330. appid: plus.runtime.appid,
  331. version: this.version,
  332. imei: "1",
  333. type: 'hz'
  334. },
  335. method: 'GET',
  336. success: (res) => {
  337. console.log("查看1111", this.version)
  338. console.log("查看11111", res)
  339. // var versionNo = plus.runtime.version
  340. // if (versionNo == res.data.data.version) {
  341. // this.version = "当前为最新版" + res.data.data.version
  342. // } else {
  343. // this.version = "发现新版本,立即更新"
  344. // }
  345. if (!res.data.data.version) { //有返回值证明需要更新 没有则不需要
  346. this.version = "当前为最新版" + this.version
  347. } else {
  348. this.version = "发现新版本,立即更新"
  349. }
  350. }
  351. })
  352. },
  353. scanCode() {
  354. let _this = this;
  355. uni.scanCode({
  356. onlyFromCamera: true,
  357. success: function(res) {
  358. console.log('条码内容:' + res.result);
  359. _this.token = res.result.split('?token=')[1];
  360. _this.mobileScanOk();
  361. }
  362. });
  363. },
  364. mobileScanOk() {
  365. this.$request.baseRequest('get', '/login/loginInfo', {
  366. token: this.token
  367. }).then(res => {
  368. console.log('111111111111111111111')
  369. console.log(res)
  370. let resultData = res;
  371. console.log(resultData);
  372. uni.navigateTo({
  373. url: `./confirm?token=${this.token}`
  374. });
  375. })
  376. },
  377. confirmClick() {
  378. // #ifdef APP-PLUS
  379. if (this.alertTitle == '账号审核中') {
  380. if (uni.getSystemInfoSync().platform == 'ios') {
  381. plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
  382. } else if (uni.getSystemInfoSync().platform == 'android') {
  383. plus.runtime.quit();
  384. }
  385. return
  386. }
  387. // #endif
  388. this.isShowAlert = false
  389. uni.$u.route('/pages/public/login');
  390. },
  391. cancelClick() {
  392. this.isShowAlert = false
  393. },
  394. toMyRelease() {
  395. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  396. uni.$u.route('/pages/public/login');
  397. } else {
  398. uni.$u.route('/pages/release/record');
  399. }
  400. },
  401. goDetailPage(src, isClick) {
  402. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  403. // if(src!='/pages/mine/helpDescription'){
  404. uni.$u.route('/pages/public/login');
  405. // }else{
  406. // uni.$u.route(src);
  407. // }
  408. } else {
  409. this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
  410. phone: this.userInfo.phone
  411. }).then(res => {
  412. uni.setStorageSync("firstAuthentication", res.data)
  413. if (res.data.authenticationStatus != '已认证' && !isClick) {
  414. uni.$u.toast('请先完成货主认证!')
  415. } else {
  416. if (src == '/pages/mine/agentCargoOwner') {
  417. this.$request.baseRequest('post', '/cargoOwnerInfo/api/readRed', {
  418. id: res.data.id
  419. }).then(res1 => {
  420. uni.$u.route(src);
  421. })
  422. } else {
  423. uni.$u.route(src);
  424. }
  425. }
  426. })
  427. // if (isClick) {
  428. // uni.$u.route(src);
  429. // } else {
  430. // uni.$u.toast('请先完成货主认证!')
  431. // }
  432. }
  433. },
  434. toLogin() {
  435. console.log("userInfo", this.userInfo)
  436. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  437. uni.$u.route('/pages/public/login');
  438. } else {}
  439. // else if(!this.userInfo.nickname){
  440. // this.inputShow = true
  441. // this.inputStatus = 'inline'
  442. // this.feild = "nickname"
  443. // this.inputContent = ''
  444. // }
  445. }
  446. }
  447. }
  448. </script>
  449. <style lang="scss" scoped>
  450. .container {
  451. // padding-top: 85px;
  452. padding-top: 35px;
  453. background-color: #F5F6FA;
  454. position: relative;
  455. width: 100vw;
  456. overflow: hidden;
  457. background: url('~@/static/mine/bg@3x.png');
  458. background-size: 100% 100%;
  459. margin: 0 auto;
  460. height: calc(100vh - 80rpx);
  461. .container_content {
  462. padding: 18px;
  463. }
  464. }
  465. .image {
  466. margin: 0 7px;
  467. }
  468. .username {
  469. font-size: 21px;
  470. }
  471. .information {
  472. margin: 0 0 10px 17px;
  473. }
  474. .currectstatus {
  475. display: flex;
  476. align-items: center;
  477. justify-content: center;
  478. width: 100rpx;
  479. height: 40rpx;
  480. background: #161111;
  481. border-radius: 16px;
  482. color: #D6B798;
  483. font-size: 24rpx;
  484. margin-left: 10rpx;
  485. }
  486. .currectstatus1 {
  487. display: flex;
  488. align-items: center;
  489. justify-content: center;
  490. width: 100rpx;
  491. height: 40rpx;
  492. background: linear-gradient(145deg, #C1C3CC 0%, #85909E 100%);
  493. ;
  494. border-radius: 16px;
  495. color: #D6B798;
  496. font-size: 24rpx;
  497. margin-left: 10rpx;
  498. }
  499. .phone {
  500. color: #8F97AB;
  501. font-size: 13px;
  502. margin-top: 5px;
  503. }
  504. .operate {
  505. font-size: 16px;
  506. font-weight: 600;
  507. background: #fff;
  508. border-radius: 10px;
  509. padding: 10px 15px;
  510. margin: 15px 0;
  511. }
  512. .content1 {
  513. background: #fff;
  514. padding: 10px;
  515. border-radius: 10px;
  516. .content1-item {
  517. padding: 10px;
  518. }
  519. }
  520. .authentication {
  521. border: 1px solid #F3EACF;
  522. margin: 10px 0;
  523. height: 64px;
  524. border-radius: 10px;
  525. padding: 15px;
  526. box-sizing: border-box;
  527. background: linear-gradient(144deg, #FEFAEE 0%, #FEFDF8 100%);
  528. }
  529. .promptlyAuthentication {
  530. font-size: 13px;
  531. padding: 8px 16px;
  532. border-radius: 15px;
  533. background: linear-gradient(327deg, #EDBB63 0%, #FFDEA5 100%);
  534. ;
  535. }
  536. .items-center {
  537. align-items: center;
  538. }
  539. .right {
  540. width: 10px;
  541. height: 10px;
  542. }
  543. .u-badge--error {
  544. background: #EE5032;
  545. width: 6px;
  546. height: 6px;
  547. }
  548. .version_css {
  549. margin-right: 10rpx;
  550. color: #9D9D9D;
  551. font-size: 32rpx;
  552. text-align: center;
  553. }
  554. </style>