index.vue 17 KB

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