index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  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. console.log('111111111111111111111')
  234. console.log(res)
  235. let resultData = res;
  236. console.log(resultData);
  237. uni.navigateTo({
  238. url: `./confirm?token=${this.token}`
  239. });
  240. })
  241. },
  242. confirmClick() {
  243. // #ifdef APP-PLUS
  244. if (this.alertTitle == '账号审核中') {
  245. if (uni.getSystemInfoSync().platform == 'ios') {
  246. plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
  247. } else if (uni.getSystemInfoSync().platform == 'android') {
  248. plus.runtime.quit();
  249. }
  250. return
  251. }
  252. // #endif
  253. this.isShowAlert = false
  254. uni.$u.route('/pages/public/login');
  255. },
  256. cancelClick() {
  257. this.isShowAlert = false
  258. },
  259. toMyRelease() {
  260. uni.$u.route('/pages/release/record');
  261. },
  262. goDetailPage(src) {
  263. uni.$u.route(src);
  264. },
  265. toLogin() {
  266. console.log("userInfo", this.userInfo)
  267. if (!this.hasLogin || !this.userInfo || this.userName == "立即登录") {
  268. uni.$u.route('/pages/public/login');
  269. } else {}
  270. // else if(!this.userInfo.nickname){
  271. // this.inputShow = true
  272. // this.inputStatus = 'inline'
  273. // this.feild = "nickname"
  274. // this.inputContent = ''
  275. // }
  276. }
  277. }
  278. }
  279. </script>
  280. <style lang="scss" scoped>
  281. .container {
  282. padding-top: 85px;
  283. padding-top: 35px;
  284. background-color: #F5F6FA;
  285. position: relative;
  286. width: 100vw;
  287. overflow: hidden;
  288. background: url('~@/static/mine/bg@3x.png');
  289. background-size: 100% 100%;
  290. margin: 0 auto;
  291. height: calc(100vh - 0px);
  292. .container_content {
  293. padding: 18px;
  294. }
  295. }
  296. .image {
  297. margin: 0 7px;
  298. }
  299. .username {
  300. font-size: 21px;
  301. }
  302. .information {
  303. margin: 0 0 10px 17px;
  304. }
  305. .currectstatus {
  306. display: flex;
  307. align-items: center;
  308. justify-content: center;
  309. width: 100rpx;
  310. height: 40rpx;
  311. background: #161111;
  312. border-radius: 16px;
  313. color: #D6B798;
  314. font-size: 24rpx;
  315. margin-left: 10rpx;
  316. }
  317. .currectstatus1 {
  318. display: flex;
  319. align-items: center;
  320. justify-content: center;
  321. width: 100rpx;
  322. height: 40rpx;
  323. background: linear-gradient(145deg, #C1C3CC 0%, #85909E 100%);
  324. ;
  325. border-radius: 16px;
  326. color: #D6B798;
  327. font-size: 24rpx;
  328. margin-left: 10rpx;
  329. }
  330. .phone {
  331. color: #8F97AB;
  332. font-size: 13px;
  333. margin-top: 5px;
  334. }
  335. .operate {
  336. font-size: 16px;
  337. font-weight: 600;
  338. background: #fff;
  339. border-radius: 10px;
  340. padding: 10px 15px;
  341. margin: 15px 0;
  342. }
  343. .content1 {
  344. background: #fff;
  345. padding: 10px;
  346. border-radius: 10px;
  347. .content1-item {
  348. padding: 10px;
  349. }
  350. }
  351. .authentication {
  352. border: 1px solid #F3EACF;
  353. margin: 10px 0;
  354. height: 64px;
  355. border-radius: 10px;
  356. padding: 15px;
  357. box-sizing: border-box;
  358. background: linear-gradient(144deg, #FEFAEE 0%, #FEFDF8 100%);
  359. }
  360. .promptlyAuthentication {
  361. font-size: 13px;
  362. padding: 8px 16px;
  363. border-radius: 15px;
  364. background: linear-gradient(327deg, #EDBB63 0%, #FFDEA5 100%);
  365. ;
  366. }
  367. .items-center {
  368. align-items: center;
  369. }
  370. </style>