index.vue 12 KB

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