index.vue 14 KB

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