info.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. <template>
  2. <view class="center">
  3. <view
  4. :style="'position: relative;border:0;background:url('+img.infoBg+');background-size:100% 100%;background-color: #fff;padding:80rpx 56rpx;margin:32rpx;border-style: none;'">
  5. <view class="top-setting" @click="doSomething(setting)">
  6. <view class="main">
  7. <image src="../../static/czzn-img/info/info-setting.png" class="setting-icon" />
  8. </view>
  9. </view>
  10. <view class="versionInfo">
  11. {{versionCode}}-{{version}} {{(mpVersion?' mp:'+mpVersion:mpVersion)}}
  12. </view>
  13. <view class="userInfo" @click.capture="toUserInfo">
  14. <!-- <u-avatar :src="userInfo.avatar" size="120rpx"></u-avatar> -->
  15. <view class="logo-title">
  16. <view class="user-name" v-if="hasLogin">
  17. <span>{{userInfo.displayName||userInfo.username}}</span>
  18. <span class="role-tag" v-if="isDriverUser">{{$t('mine.driver')}}</span>
  19. <span class="role-tag" v-if="isDealerUser">{{$t('mine.dealer')}}</span>
  20. <span class="role-tag" v-if="isAuditUser">{{$t('mine.auditUser')}}</span>
  21. <span class="role-tag" v-if="isTransUser">{{$t('order.transporter')}}</span>
  22. </view>
  23. <text class="user-name" v-else>{{$t('mine.notLogged')}}</text>
  24. <text class="user-phone">{{userInfo.phone}}</text>
  25. </view>
  26. </view>
  27. </view>
  28. <template v-if="isDealerUser || isDriverUser">
  29. <view class="menu-wrap">
  30. <u-cell :isLink="true" arrow-direction="right" @click="doSomething(allOrder)" :border="false"
  31. :customStyle="{'background':'#fff','font-weight':'bold','padding':'10rpx 10rpx','borderBottom':'2rpx solid #f5f7fa'}"
  32. :title="$t('mine.order')"></u-cell>
  33. <uni-grid class="grid" :column="5" :showBorder="false" :square="true">
  34. <uni-grid-item class="item" v-for="(item,index) in gridList" @click.native="toOrdering(item)"
  35. :key="index">
  36. <image :src="item.icon" class="grid-icon" />
  37. <text class="grid-text">{{item.title}}</text>
  38. </uni-grid-item>
  39. </uni-grid>
  40. </view>
  41. <view class="menu-wrap">
  42. <u-cell :border="false"
  43. :customStyle="{'background':'#f5f7fa','font-weight':'bold','padding':'10rpx 10rpx'}"
  44. :title="$t('mine.service')"></u-cell>
  45. <template v-if="isDealerUser">
  46. <u-cell-group class="cell-wrap" :border="false">
  47. <u-cell :isLink="true" arrow-direction="right" :border="false" class="cell-item"
  48. v-for="(item,index) in dealerMenuList" @click.native="doSomething(item)" :key="index"
  49. :title="item.title">
  50. <!-- <image slot="icon" :src="item.icon" class="cell-icon" /> -->
  51. <u-icon slot="icon" :name="item.icon" color="#2979ff" size="24" class="cell-icon"></u-icon>
  52. </u-cell>
  53. </u-cell-group>
  54. </template>
  55. <template v-if="isDriverUser">
  56. <u-cell-group class="cell-wrap" :border="false">
  57. <u-cell :isLink="true" arrow-direction="right" :border="false" class="cell-item"
  58. v-for="(item,index) in driverMenuList" @click.native="doSomething(item)" :key="index"
  59. :title="item.title">
  60. <u-icon slot="icon" :name="item.icon" color="#2979ff" size="24" class="cell-icon"></u-icon>
  61. </u-cell>
  62. </u-cell-group>
  63. </template>
  64. </view>
  65. </template>
  66. <!-- <template v-else>
  67. <view class="message-wrap" style="padding:32rpx">
  68. <view class="message-title" @click="toPage('/subpages/approval/messageList')">
  69. <span class="label">消息通知</span>
  70. <span class="message">
  71. 3条未读信息
  72. <u-icon name="arrow-right" color="#222222"></u-icon>
  73. </span>
  74. </view>
  75. <view class="message-item">
  76. <view class="title">
  77. <span style="color:#222">价格申请</span>
  78. <span>23分钟前</span>
  79. </view>
  80. <view class="info">
  81. <view class="cell-icon">
  82. <uni-icons custom-prefix="elicon" type="el-icon-s-promotion" size="16"
  83. color="#4680F9"></uni-icons>
  84. </view>
  85. <span class="info-text">善良的咖啡机提交了关于什么什么价格申请,阿姆斯特朗登月</span>
  86. </view>
  87. </view>
  88. </view>
  89. </template> -->
  90. <Bars></Bars>
  91. </view>
  92. </template>
  93. <script>
  94. import {
  95. mapGetters,
  96. mapMutations
  97. } from "vuex";
  98. import {
  99. getTenantCacheList
  100. } from '../../utils/util.js'
  101. import Bars from '../../components/tabBar/tabBar.vue';
  102. import imgUtil from '../../utils/imgUtil'
  103. export default {
  104. components: {
  105. Bars
  106. },
  107. // #ifdef APP
  108. onBackPress({
  109. from
  110. }) {
  111. if (from == "backbutton") {
  112. this.$nextTick(function() {
  113. uniShare.hide();
  114. });
  115. return uniShare.isShow;
  116. }
  117. },
  118. // #endif
  119. data() {
  120. return {
  121. img:imgUtil,
  122. setting: {
  123. title: this.$t("mine.settings"),
  124. to: "/subpages/ucenter/settings/settings",
  125. icon: "gear",
  126. show: true,
  127. },
  128. allOrder: {
  129. title: this.$t("mine.all"),
  130. icon: "file-text",
  131. to: '/subpages/order/dealerList?index=0'
  132. },
  133. gridList: [{
  134. title: this.$t("mine.reviewed"),
  135. icon: "../../static/czzn-img/info/info-order.png",
  136. dealerTo: '/subpages/order/dealerList?orderType=0&orderStatus=0',
  137. driverTo: '/subpages/order/driverList?orderType=0&orderStatus=0'
  138. },
  139. {
  140. title: this.$t("mine.unpaid"),
  141. icon: "../../static/czzn-img/info/info-jc.png",
  142. dealerTo: '/subpages/order/dealerList?orderType=0&orderStatus=1',
  143. driverTo: '/subpages/order/driverList?orderType=0&orderStatus=1'
  144. },
  145. {
  146. title: this.$t("mine.weigh"),
  147. icon: "../../static/czzn-img/info/info-gb.png",
  148. dealerTo: '/subpages/order/dealerList?orderType=0&orderStatus=3',
  149. driverTo: '/subpages/order/driverList?orderType=0&orderStatus=3'
  150. },
  151. {
  152. title: this.$t("mine.ongoing"),
  153. icon: "../../static/czzn-img/info/info-cc.png",
  154. dealerTo: '/subpages/order/dealerList?orderType=0&orderStatus=2',
  155. driverTo: '/subpages/order/driverList?orderType=0&orderStatus=2'
  156. },
  157. {
  158. title: this.$t("mine.invalid"),
  159. icon: "../../static/czzn-img/info/info-zf.png",
  160. dealerTo: '/subpages/order/dealerList?orderType=0&orderStatus=4',
  161. driverTo: '/subpages/order/driverList?orderType=0&orderStatus=4'
  162. },
  163. ],
  164. driverMenuList: [{
  165. title: this.$t("mine.vehicle"),
  166. icon: "../../static/czzn-img/info/info-cl.png",
  167. to: '/subpages/driver/driverList',
  168. count: 0,
  169. },
  170. {
  171. title: this.$t("mine.feedback"),
  172. icon: imgUtil.feedbackIcon,
  173. to: '/substaticpages/info/feedback',
  174. count: 0,
  175. },
  176. // {
  177. // title: this.$t("mine.mp"),
  178. // icon: "../../static/czzn-img/info/info-msg.png",
  179. // to: '/subpages/mp/index',
  180. // count: 0,
  181. // },
  182. ],
  183. dealerMenuList: [{
  184. title: this.$t("mine.enterprise"),
  185. icon: imgUtil.enterpriseIcon,
  186. to: '/subpages/tenant/list',
  187. count: 0,
  188. },
  189. {
  190. title: this.$t("mine.driver"),
  191. icon: imgUtil.driverIcon,
  192. to: '/subpages/driver/dealerList',
  193. count: 0,
  194. },
  195. {
  196. title: this.$t("mine.feedback"),
  197. icon: imgUtil.feedbackIcon,
  198. to: '/substaticpages/info/feedback',
  199. count: 0,
  200. },
  201. // {
  202. // title: this.$t("mine.mp"),
  203. // icon: "../../static/czzn-img/info/info-msg.png",
  204. // to: '/subpages/mp/index',
  205. // count: 0,
  206. // },
  207. ],
  208. role: [],
  209. userType: "0",
  210. tenantCount: 0,
  211. version: "",
  212. versionCode: "",
  213. mpVersion: "",
  214. isAuditUser: false,
  215. isDealerUser: false,
  216. isDriverUser: false,
  217. isAcceptUser: false,
  218. isDeliverUser: false,
  219. isTransUser: false,
  220. };
  221. },
  222. onLoad() {
  223. this.isAuditUser = uni.getStorageSync('isAuditUser')
  224. this.isDealerUser = uni.getStorageSync('isDealerUser')
  225. this.isDriverUser = uni.getStorageSync('isDriverUser')
  226. this.isAcceptUser = uni.getStorageSync('isAcceptUser')
  227. this.isDeliverUser = uni.getStorageSync('isDeliverUser')
  228. this.isTransUser = uni.getStorageSync('isTransUser')
  229. // const routers = getCurrentPages();
  230. // console.log(routers);
  231. if(this.isDealerUser){
  232. this.allOrder.to = '/subpages/order/dealerList?index=0'
  233. }else if(this.isDriverUser){
  234. this.allOrder.to = '/subpages/order/driverList'
  235. }
  236. console.log("开始加载");
  237. uni.hideTabBar()
  238. this.userType = uni.getStorageSync('userType')
  239. this.bindUserInfo()
  240. var that = this;
  241. uni.getSystemInfo({
  242. success: function(res) {
  243. console.log("系统信息、", res)
  244. console.log("系统版本号、", res.appVersionCode, res.appVersion)
  245. that.version = res.appVersion;
  246. that.versionCode = res.appVersionCode;
  247. console.log("系统版本号、", that.version, that.versionCode)
  248. }
  249. });
  250. // #ifdef MP-WEIXIN
  251. const accountInfo = wx.getAccountInfoSync();
  252. this.mpVersion = accountInfo.miniProgram.version // 小程序 版本号
  253. // #endif
  254. },
  255. computed: {
  256. ...mapGetters({
  257. userInfo: "user/info",
  258. hasLogin: "user/hasLogin",
  259. }),
  260. // #ifdef APP-PLUS
  261. appVersion() {
  262. return getApp().appVersion;
  263. },
  264. // #endif
  265. appConfig() {
  266. return getApp().globalData.config;
  267. },
  268. },
  269. methods: {
  270. bindUserInfo() {
  271. var tenantList = getTenantCacheList();
  272. console.log("当前租户信息、", tenantList);
  273. },
  274. //宫格点击事件
  275. doSomething(item) {
  276. if (item.to) {
  277. uni.navigateTo({
  278. url: item.to,
  279. });
  280. }
  281. if (item.event) {
  282. this[item.event]
  283. }
  284. },
  285. toOrdering(item) {
  286. if (this.isDealerUser == true) {
  287. uni.navigateTo({
  288. url: item.dealerTo,
  289. });
  290. } else {
  291. uni.navigateTo({
  292. url: item.driverTo,
  293. });
  294. }
  295. },
  296. ...mapMutations({
  297. setUserInfo: "user/login",
  298. }),
  299. toUserInfo() {
  300. if(this.hasLogin){
  301. uni.navigateTo({
  302. url: "/substaticpages/info/userInfo",
  303. });
  304. }else{
  305. uni.reLaunch({
  306. url: "/pages/login/login"
  307. })
  308. }
  309. },
  310. toPage(url) {
  311. uni.navigateTo({
  312. url: url,
  313. });
  314. },
  315. tapGrid(item) {
  316. // uni.showToast({
  317. // // title: '你点击了,第' + (index + 1) + '个',
  318. // title: this.$t('mine.clicked') + " " + (index + 1) ,
  319. // icon: 'none'
  320. // });
  321. },
  322. },
  323. };
  324. </script>
  325. <style lang="scss" scoped>
  326. /* #ifndef APP-NVUE */
  327. view {
  328. display: flex;
  329. box-sizing: border-box;
  330. flex-direction: column;
  331. }
  332. page {
  333. background-color: #f5f7fa;
  334. }
  335. /* #endif */
  336. .center {
  337. flex: 1;
  338. flex-direction: column;
  339. min-height: 100vh;
  340. background-color: #f5f7fa;
  341. .sevice {
  342. display: flex;
  343. flex-direction: row;
  344. justify-content: space-between;
  345. border-radius: 20rpx;
  346. margin-bottom: 24rpx;
  347. padding: 24rpx 0;
  348. overflow: hidden;
  349. background-color: #fff;
  350. .sevice-item {
  351. display: flex;
  352. width: 25%;
  353. text-align: center;
  354. .count {
  355. line-height: 48rpx;
  356. font-size: 32rpx;
  357. font-weight: bold;
  358. color: #333;
  359. }
  360. .title {
  361. line-height: 48rpx;
  362. font-size: 24rpx;
  363. color: #333;
  364. }
  365. }
  366. }
  367. .menu-wrap {
  368. // padding: 32rpx 0;
  369. // border-radius: 20rpx;
  370. overflow: hidden;
  371. background-color: #fff;
  372. .title {
  373. padding: 44rpx 44rpx 12rpx;
  374. display: flex;
  375. font-size: 32rpx;
  376. flex-direction: row;
  377. justify-content: space-between;
  378. .all {
  379. font-size: 28rpx;
  380. color: #999;
  381. display: flex;
  382. flex-direction: row;
  383. align-items: center;
  384. }
  385. }
  386. .version {
  387. padding: 8rpx 8rpx 8rpx;
  388. display: flex;
  389. font-size: 32rpx;
  390. flex-direction: row;
  391. justify-content: space-between;
  392. }
  393. .cell-icon {
  394. width: 65rpx;
  395. height: 65rpx;
  396. }
  397. .cell-wrap {
  398. padding-bottom: 40rpx;
  399. .cell-item {
  400. border-bottom: 1rpx solid #f5f7fa;
  401. }
  402. }
  403. .grid-icon {
  404. width: 60rpx;
  405. height: 60rpx;
  406. }
  407. .grid-text {
  408. margin-top: 8rpx;
  409. font-size: 24rpx;
  410. color: #333333;
  411. line-height: 48rpx;
  412. text-align: center;
  413. }
  414. }
  415. .top-set-user {
  416. background-size: 750rpx auto;
  417. background-color: #fff;
  418. padding: 40rpx 40rpx 56rpx;
  419. }
  420. .top-setting {
  421. position: absolute;
  422. top: 0rpx;
  423. right: 0rpx;
  424. z-index: 2001;
  425. .main {
  426. display: flex;
  427. flex-direction: row;
  428. align-items: center;
  429. justify-content: center;
  430. width: 100rpx;
  431. height: 100rpx;
  432. .setting-version {
  433. text-align: left;
  434. width: 50%;
  435. font-size: 24rpx;
  436. color: #999;
  437. }
  438. .setting-icon {
  439. width: 38rpx;
  440. height: 35rpx;
  441. }
  442. }
  443. }
  444. .message-wrap {
  445. margin: 40rpx 32rpx;
  446. background-color: #fff;
  447. padding: 40rpx;
  448. border-radius: 10rpx;
  449. .message-title {
  450. display: flex;
  451. flex-direction: row;
  452. justify-content: space-between;
  453. line-height: 32rpx;
  454. .label {
  455. color: #222;
  456. font-size: 28rpx;
  457. font-weight: bold;
  458. }
  459. .message {
  460. display: flex;
  461. flex-direction: row;
  462. color: #999;
  463. font-size: 24rpx;
  464. }
  465. }
  466. .message-item {
  467. margin-top: 32rpx;
  468. background-color: #f9f9f9;
  469. border-radius: 10rpx;
  470. padding: 28rpx 32rpx;
  471. .title {
  472. justify-content: space-between;
  473. display: flex;
  474. flex-direction: row;
  475. // width: 176rpx;
  476. color: #999;
  477. font-size: 24rpx;
  478. align-items: center;
  479. justify-content: space-between;
  480. margin-bottom: 32rpx;
  481. }
  482. .info {
  483. flex-direction: row;
  484. .cell-icon {
  485. width: 50rpx;
  486. height: 50rpx;
  487. background-color: #E1EBFF;
  488. border-radius: 10rpx;
  489. display: flex;
  490. justify-content: space-around;
  491. align-items: center;
  492. margin-right: 32rpx;
  493. }
  494. .info-text {
  495. flex: 1;
  496. overflow: hidden;
  497. text-overflow: ellipsis;
  498. white-space: nowrap;
  499. font-size: 22rpx;
  500. color: #666;
  501. }
  502. }
  503. }
  504. }
  505. }
  506. .versionInfo {
  507. position: absolute;
  508. bottom: 0px;
  509. right: 10rpx;
  510. size: 10pt;
  511. color: #fff;
  512. font-size: 13px;
  513. height: 28px;
  514. line-height: 28px;
  515. }
  516. .userInfo {
  517. // position: relative;
  518. flex-direction: row;
  519. align-items: center;
  520. // margin-bottom: 24rpx;
  521. }
  522. .logo-img {
  523. width: 150rpx;
  524. height: 150rpx;
  525. border-radius: 150rpx;
  526. }
  527. .logo-title {
  528. flex: 1;
  529. margin-left: 32rpx;
  530. // align-items: center;
  531. justify-content: space-between;
  532. flex-direction: column;
  533. }
  534. .user-name {
  535. height: 48rpx;
  536. line-height: 48rpx;
  537. font-size: 30rpx;
  538. display: flex;
  539. flex-direction: row;
  540. align-items: center;
  541. font-weight: bold;
  542. color: #fff;
  543. .role-tag {
  544. font-size: 20rpx;
  545. padding: 0 18rpx;
  546. border-radius: 8rpx;
  547. margin-left: 24rpx;
  548. background-color: #6695F9;
  549. box-shadow: 0px 0px 24px 0px rgba(46, 56, 181, 0.44);
  550. color: #fff;
  551. font-weight: normal;
  552. }
  553. }
  554. .user-phone {
  555. color: #fff;
  556. font-size: 26rpx;
  557. height: 56rpx;
  558. line-height: 56rpx;
  559. }
  560. .grid {
  561. background-color: #fff;
  562. // padding: 32rpx;
  563. }
  564. .uni-grid .text {
  565. font-size: 16px;
  566. height: 25px;
  567. line-height: 25px;
  568. color: #817f82;
  569. }
  570. .uni-grid .item ::v-deep .uni-grid-item__box {
  571. justify-content: center;
  572. align-items: center;
  573. }
  574. /deep/ .u-grid-item {
  575. padding: 20rpx 0;
  576. }
  577. </style>