index.vue 17 KB

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