index.vue 13 KB

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