index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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" v-if='hasLogin'>
  7. <u--image class='image' :showLoading="true" src="../../static/mine/saoma.png" width="20px"
  8. height="20px" @click="scanCode()"></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'>未认证</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 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"
  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. showCancelButton: true,
  142. isShowAlert: false,
  143. alertTitle: '',
  144. userName: '',
  145. phone: '',
  146. status: false,
  147. alertContent: '您尚未登录,是否立即登录?',
  148. cargoCall: "",
  149. };
  150. },
  151. onShow() {
  152. if (this.hasLogin) {
  153. uni.showLoading({
  154. title: '加载中',
  155. mask: true
  156. })
  157. this.$request.baseRequest('get', '/cargoOwnerInfo/selectCargoOwner', {
  158. commonId: this.userInfo.id
  159. }).then(res => {
  160. uni.hideLoading()
  161. if (res.data) {
  162. if (res.data.authenticationStatus == '审核中' || res.data.authenticationStatus == '已驳回') {
  163. this.status = false
  164. } else {
  165. this.status = true
  166. }
  167. } else {
  168. this.status = false
  169. }
  170. })
  171. .catch(res => {
  172. uni.hideLoading()
  173. uni.showToast({
  174. title: res.message,
  175. icon: 'none',
  176. duration: 2000
  177. })
  178. });
  179. this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
  180. phone: this.userInfo.phone
  181. }).then(res => {
  182. uni.setStorageSync("firstAuthentication", res.data)
  183. if (res.data) {
  184. this.userName = res.data.call
  185. if (res.data.sex == '男') {
  186. this.cargoCall = "先生"
  187. } else {
  188. this.cargoCall = "女士"
  189. }
  190. }else{
  191. this.userName = this.userInfo.userName
  192. }
  193. })
  194. // this.phone = this.userInfo.phone ? this.userInfo.phone.replace(this.userInfo.phone.substring(3, 7),"****") : ''
  195. this.phone = this.userInfo.phone
  196. if (!this.cargoCall) {
  197. this.userName = this.userInfo.userName
  198. }
  199. if (!this.hasLogin) {
  200. this.isShowAlert = true
  201. return
  202. }
  203. }
  204. },
  205. onLoad() {
  206. },
  207. computed: {
  208. ...mapState(['hasLogin', 'userInfo', "firstAuthentication"]),
  209. // 手机号中间4位加*
  210. starUserphone() {
  211. let reg = /^(\d{3})\d{4}(\d{4})$/;
  212. if (this.phone) {
  213. return this.phone.replace(reg, "$1****$2");
  214. }
  215. }
  216. },
  217. methods: {
  218. scanCode() {
  219. let _this = this;
  220. uni.scanCode({
  221. onlyFromCamera: true,
  222. success: function(res) {
  223. console.log('条码内容:' + res.result);
  224. _this.token = res.result.split('?token=')[1];
  225. _this.mobileScanOk();
  226. }
  227. });
  228. },
  229. mobileScanOk() {
  230. this.$request.baseRequest('get', '/login/loginInfo', {
  231. token: this.token
  232. }).then(res => {
  233. let resultData = res;
  234. console.log(resultData);
  235. uni.navigateTo({
  236. url: `./confirm?token=${this.token}`
  237. });
  238. })
  239. },
  240. confirmClick() {
  241. // #ifdef APP-PLUS
  242. if (this.alertTitle == '账号审核中') {
  243. if (uni.getSystemInfoSync().platform == 'ios') {
  244. plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
  245. } else if (uni.getSystemInfoSync().platform == 'android') {
  246. plus.runtime.quit();
  247. }
  248. return
  249. }
  250. // #endif
  251. this.isShowAlert = false
  252. uni.$u.route('/pages/public/login');
  253. },
  254. cancelClick() {
  255. this.isShowAlert = false
  256. },
  257. toMyRelease() {
  258. uni.$u.route('/pages/release/record');
  259. },
  260. goDetailPage(src) {
  261. uni.$u.route(src);
  262. },
  263. toLogin() {
  264. console.log("userInfo", this.userInfo)
  265. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  266. uni.$u.route('/pages/public/login');
  267. } else {}
  268. // else if(!this.userInfo.nickname){
  269. // this.inputShow = true
  270. // this.inputStatus = 'inline'
  271. // this.feild = "nickname"
  272. // this.inputContent = ''
  273. // }
  274. }
  275. }
  276. }
  277. </script>
  278. <style lang="scss" scoped>
  279. .container {
  280. padding-top: 85px;
  281. padding-top: 35px;
  282. background-color: #F5F6FA;
  283. position: relative;
  284. width: 100vw;
  285. overflow: hidden;
  286. background: url('~@/static/mine/bg@3x.png');
  287. background-size: 100% 100%;
  288. margin: 0 auto;
  289. height: calc(100vh - 0px);
  290. .container_content {
  291. padding: 18px;
  292. }
  293. }
  294. .image {
  295. margin: 0 7px;
  296. }
  297. .username {
  298. font-size: 21px;
  299. }
  300. .information {
  301. margin: 0 0 10px 17px;
  302. }
  303. .currectstatus {
  304. display: flex;
  305. align-items: center;
  306. justify-content: center;
  307. width: 100rpx;
  308. height: 40rpx;
  309. background: #161111;
  310. border-radius: 16px;
  311. color: #D6B798;
  312. font-size: 24rpx;
  313. margin-left: 10rpx;
  314. }
  315. .currectstatus1 {
  316. display: flex;
  317. align-items: center;
  318. justify-content: center;
  319. width: 100rpx;
  320. height: 40rpx;
  321. background: linear-gradient(145deg, #C1C3CC 0%, #85909E 100%);
  322. ;
  323. border-radius: 16px;
  324. color: #D6B798;
  325. font-size: 24rpx;
  326. margin-left: 10rpx;
  327. }
  328. .phone {
  329. color: #8F97AB;
  330. font-size: 13px;
  331. margin-top: 5px;
  332. }
  333. .operate {
  334. font-size: 16px;
  335. font-weight: 600;
  336. background: #fff;
  337. border-radius: 10px;
  338. padding: 10px 15px;
  339. margin: 15px 0;
  340. }
  341. .content1 {
  342. background: #fff;
  343. padding: 10px;
  344. border-radius: 10px;
  345. .content1-item {
  346. padding: 10px;
  347. }
  348. }
  349. .authentication {
  350. border: 1px solid #F3EACF;
  351. margin: 10px 0;
  352. height: 64px;
  353. border-radius: 10px;
  354. padding: 15px;
  355. box-sizing: border-box;
  356. background: linear-gradient(144deg, #FEFAEE 0%, #FEFDF8 100%);
  357. }
  358. .promptlyAuthentication {
  359. font-size: 13px;
  360. padding: 8px 16px;
  361. border-radius: 15px;
  362. background: linear-gradient(327deg, #EDBB63 0%, #FFDEA5 100%);
  363. ;
  364. }
  365. .items-center {
  366. align-items: center;
  367. }
  368. </style>