index.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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"></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"></u--image>
  16. <view class='information' v-if='hasLogin'>
  17. <view class='flex items-center'>
  18. <view class='username'>{{userName}}</view>
  19. <view v-if='status' class='currectstatus'>已认证</view>
  20. <view v-if='!status' class='currectstatus1'>未认证</view>
  21. </view>
  22. <view class='phone'>{{phone}}</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 class='flex items-center' @click="toMyRelease">
  37. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/wodefabu.png"
  38. width="42px" height="42px"></u--image>我发布的
  39. </view>
  40. <view class='flex items-center'>
  41. <u--image style='margin-right:8px;' :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" @click="goDetailPage('/pages/mine/company/index')">
  48. <view class='flex items-center'>
  49. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/wodegongsi.png"
  50. width="20px" height="20px"></u--image>我的公司
  51. </view>
  52. <view class='flex'>
  53. <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
  54. </view>
  55. </view>
  56. <view class="flex flex-space-between content1-item"
  57. @click="goDetailPage('/pages/mine/cargoowner/cargoowner')">
  58. <view class='flex items-center'>
  59. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/huozhu.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/helpDescription')">
  68. <view class='flex items-center'>
  69. <u--image style='margin-right:8px;' :showLoading="true"
  70. src="../../static/mine/bangzhushuoming.png" 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/agentCargoOwner')">
  78. <view class='flex items-center'>
  79. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/dailihuozhu.png"
  80. width="20px" height="20px"></u--image>代理货主
  81. </view>
  82. <view>
  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" @click="goDetailPage('/pages/mine/set')">
  87. <view class='flex items-center'>
  88. <u--image style='margin-right:8px;' :showLoading="true" src="../../static/mine/dailihuozhu.png"
  89. width="20px" height="20px"></u--image>设置
  90. </view>
  91. <view>
  92. <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
  98. :showCancelButton='true' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
  99. @cancel="cancelClick"></u-modal>
  100. <u-toast ref="uToast"></u-toast>
  101. </view>
  102. </template>
  103. <script>
  104. import {
  105. mapState
  106. } from 'vuex';
  107. export default {
  108. data() {
  109. return {
  110. isShowAlert:false,
  111. alertTitle: '',
  112. userName: '',
  113. phone: '',
  114. status: false,
  115. alertContent: '您尚未登录,是否立即登录?',
  116. };
  117. },
  118. onShow() {
  119. if (!this.hasLogin) {
  120. this.isShowAlert = true
  121. return
  122. }
  123. },
  124. onLoad() {
  125. uni.showLoading({
  126. title: '加载中',
  127. mask: true
  128. })
  129. this.$request.baseRequest('get', '/cargoOwnerInfo/selectCargoOwner', {
  130. commonId: this.userInfo.id
  131. }).then(res => {
  132. uni.hideLoading()
  133. if (res.data) {
  134. if (res.data.authenticationStatus == '审核中' || res.data.authenticationStatus == '已驳回') {
  135. this.status = false
  136. } else {
  137. this.status = true
  138. }
  139. } else {
  140. this.status = false
  141. }
  142. })
  143. .catch(res => {
  144. uni.hideLoading()
  145. uni.showToast({
  146. title: res.message,
  147. icon: 'none',
  148. duration: 2000
  149. })
  150. });
  151. //
  152. this.userName = this.userInfo.userName
  153. this.phone = this.userInfo.phone.replace(this.userInfo.phone.substring(3, 7), "****")
  154. },
  155. computed: {
  156. ...mapState(['hasLogin', 'userInfo']),
  157. // 手机号中间4位加*
  158. // starUserphone() {
  159. // let reg = /^(\d{3})\d{4}(\d{4})$/;
  160. // if (this.userphone) {
  161. // return this.userphone.replace(reg, "$1****$2");
  162. // }
  163. // }
  164. },
  165. methods: {
  166. confirmClick() {
  167. this.isShowAlert = false
  168. uni.$u.route('/pages/public/login');
  169. },
  170. cancelClick() {
  171. this.isShowAlert = false
  172. },
  173. toMyRelease() {
  174. uni.$u.route('/pages/release/record');
  175. },
  176. goDetailPage(src) {
  177. uni.$u.route(src);
  178. },
  179. toLogin() {
  180. console.log("userInfo", this.userInfo)
  181. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  182. uni.$u.route('/pages/public/login');
  183. } else {}
  184. // else if(!this.userInfo.nickname){
  185. // this.inputShow = true
  186. // this.inputStatus = 'inline'
  187. // this.feild = "nickname"
  188. // this.inputContent = ''
  189. // }
  190. },
  191. }
  192. }
  193. </script>
  194. <style lang="scss" scoped>
  195. .container {
  196. padding-top: 85px;
  197. padding-top: 35px;
  198. background-color: #F5F6FA;
  199. position: relative;
  200. width: 100vw;
  201. overflow: hidden;
  202. background: url('~@/static/mine/bg@3x.png');
  203. background-size: 100% 100%;
  204. margin: 0 auto;
  205. height: calc(100vh - 0px);
  206. .container_content {
  207. padding: 18px;
  208. }
  209. }
  210. .image {
  211. margin: 0 7px;
  212. }
  213. .username {
  214. font-size: 21px;
  215. }
  216. .information {
  217. margin: 0 0 10px 17px;
  218. }
  219. .currectstatus {
  220. display: flex;
  221. align-items: center;
  222. justify-content: center;
  223. width: 100rpx;
  224. height: 40rpx;
  225. background: #161111;
  226. border-radius: 16px;
  227. color: #D6B798;
  228. font-size: 24rpx;
  229. margin-left: 10rpx;
  230. }
  231. .currectstatus1 {
  232. display: flex;
  233. align-items: center;
  234. justify-content: center;
  235. width: 100rpx;
  236. height: 40rpx;
  237. background: linear-gradient(145deg, #C1C3CC 0%, #85909E 100%);
  238. ;
  239. border-radius: 16px;
  240. color: #D6B798;
  241. font-size: 24rpx;
  242. margin-left: 10rpx;
  243. }
  244. .phone {
  245. color: #8F97AB;
  246. font-size: 13px;
  247. margin-top: 5px;
  248. }
  249. .operate {
  250. font-size: 16px;
  251. font-weight: 600;
  252. background: #fff;
  253. border-radius: 10px;
  254. padding: 10px 15px;
  255. margin: 15px 0;
  256. }
  257. .content1 {
  258. background: #fff;
  259. padding: 10px;
  260. border-radius: 10px;
  261. .content1-item {
  262. padding: 10px;
  263. }
  264. }
  265. .authentication {
  266. border: 1px solid #F3EACF;
  267. margin: 10px 0;
  268. height: 64px;
  269. border-radius: 10px;
  270. padding: 15px;
  271. box-sizing: border-box;
  272. background: linear-gradient(144deg, #FEFAEE 0%, #FEFDF8 100%);
  273. }
  274. .promptlyAuthentication {
  275. font-size: 13px;
  276. padding: 8px 16px;
  277. border-radius: 15px;
  278. background: linear-gradient(327deg, #EDBB63 0%, #FFDEA5 100%);
  279. ;
  280. }
  281. .items-center {
  282. align-items: center;
  283. }
  284. </style>