index.vue 9.0 KB

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