index.vue 11 KB

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