info.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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="userInfo" @click.capture="toUserInfo">
  11. <!-- <u-avatar :src="userInfo.avatar" size="120rpx"></u-avatar> -->
  12. <view class="logo-title">
  13. <view class="user-name">
  14. <span>退出登录</span>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <!-- <template v-if="isDealerUser || isDriverUser">
  20. <view class="menu-wrap">
  21. <u-cell :isLink="true" arrow-direction="right" @click="doSomething(allOrder)" :border="false"
  22. :customStyle="{'background':'#fff','font-weight':'bold','padding':'10rpx 10rpx','borderBottom':'2rpx solid #f5f7fa'}"
  23. :title="$t('mine.order')"></u-cell>
  24. <uni-grid class="grid" :column="5" :showBorder="false" :square="true">
  25. <uni-grid-item class="item" v-for="(item,index) in gridList" @click.native="toOrdering(item)"
  26. :key="index">
  27. <image :src="item.icon" class="grid-icon" />
  28. <text class="grid-text">{{item.title}}</text>
  29. </uni-grid-item>
  30. </uni-grid>
  31. </view>
  32. <view class="menu-wrap">
  33. <u-cell :border="false"
  34. :customStyle="{'background':'#f5f7fa','font-weight':'bold','padding':'10rpx 10rpx'}"
  35. :title="$t('mine.service')"></u-cell>
  36. <template v-if="isDealerUser">
  37. <u-cell-group class="cell-wrap" :border="false">
  38. <u-cell :isLink="true" arrow-direction="right" :border="false" class="cell-item"
  39. v-for="(item,index) in dealerMenuList" @click.native="doSomething(item)" :key="index"
  40. :title="item.title">
  41. <u-icon slot="icon" :name="item.icon" color="#2979ff" size="24" class="cell-icon"></u-icon>
  42. </u-cell>
  43. </u-cell-group>
  44. </template>
  45. <template v-if="isDriverUser">
  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 driverMenuList" @click.native="doSomething(item)" :key="index"
  49. :title="item.title">
  50. <u-icon slot="icon" :name="item.icon" color="#2979ff" size="24" class="cell-icon"></u-icon>
  51. </u-cell>
  52. </u-cell-group>
  53. </template>
  54. </view>
  55. </template> -->
  56. <Bars></Bars>
  57. </view>
  58. </template>
  59. <script>
  60. import {
  61. mapGetters,
  62. mapMutations
  63. } from "vuex";
  64. import {
  65. getTenantCacheList
  66. } from '../../utils/util.js'
  67. import Bars from '../../components/tabBar/tabBar.vue';
  68. import imgUtil from '../../utils/imgUtil'
  69. export default {
  70. components: {
  71. Bars
  72. },
  73. // #ifdef APP
  74. onBackPress({
  75. from
  76. }) {
  77. if (from == "backbutton") {
  78. this.$nextTick(function() {
  79. uniShare.hide();
  80. });
  81. return uniShare.isShow;
  82. }
  83. },
  84. // #endif
  85. data() {
  86. return {
  87. img:imgUtil,
  88. setting: {
  89. title: this.$t("mine.settings"),
  90. to: "/pages/ucenter/settings",
  91. icon: "gear",
  92. show: true,
  93. },
  94. allOrder: {
  95. title: this.$t("mine.all"),
  96. icon: "file-text",
  97. to: '/subpages/order/dealerList?index=0'
  98. },
  99. role: [],
  100. userType: "0",
  101. tenantCount: 0,
  102. version: "",
  103. versionCode: "",
  104. mpVersion: "",
  105. isAuditUser: false,
  106. isDealerUser: false,
  107. isDriverUser: false,
  108. isAcceptUser: false,
  109. isDeliverUser: false,
  110. isTransUser: false,
  111. };
  112. },
  113. onLoad() {
  114. this.isAuditUser = uni.getStorageSync('isAuditUser')
  115. this.isDealerUser = uni.getStorageSync('isDealerUser')
  116. this.isDriverUser = uni.getStorageSync('isDriverUser')
  117. this.isAcceptUser = uni.getStorageSync('isAcceptUser')
  118. this.isDeliverUser = uni.getStorageSync('isDeliverUser')
  119. this.isTransUser = uni.getStorageSync('isTransUser')
  120. // const routers = getCurrentPages();
  121. // console.log(routers);
  122. if(this.isDealerUser){
  123. this.allOrder.to = '/subpages/order/dealerList?index=0'
  124. }else if(this.isDriverUser){
  125. this.allOrder.to = '/subpages/order/driverList'
  126. }
  127. console.log("开始加载");
  128. uni.hideTabBar()
  129. this.userType = uni.getStorageSync('userType')
  130. this.bindUserInfo()
  131. var that = this;
  132. uni.getSystemInfo({
  133. success: function(res) {
  134. console.log("系统信息、", res)
  135. console.log("系统版本号、", res.appVersionCode, res.appVersion)
  136. that.version = res.appVersion;
  137. that.versionCode = res.appVersionCode;
  138. console.log("系统版本号、", that.version, that.versionCode)
  139. }
  140. });
  141. // #ifdef MP-WEIXIN
  142. const accountInfo = wx.getAccountInfoSync();
  143. this.mpVersion = accountInfo.miniProgram.version // 小程序 版本号
  144. // #endif
  145. },
  146. computed: {
  147. ...mapGetters({
  148. userInfo: "user/info",
  149. hasLogin: "user/hasLogin",
  150. }),
  151. // #ifdef APP-PLUS
  152. appVersion() {
  153. return getApp().appVersion;
  154. },
  155. // #endif
  156. appConfig() {
  157. return getApp().globalData.config;
  158. },
  159. },
  160. methods: {
  161. bindUserInfo() {
  162. var tenantList = getTenantCacheList();
  163. console.log("当前租户信息、", tenantList);
  164. },
  165. //宫格点击事件
  166. doSomething(item) {
  167. if (item.to) {
  168. uni.navigateTo({
  169. url: item.to,
  170. });
  171. }
  172. if (item.event) {
  173. this[item.event]
  174. }
  175. },
  176. toOrdering(item) {
  177. if (this.isDealerUser == true) {
  178. uni.navigateTo({
  179. url: item.dealerTo,
  180. });
  181. } else {
  182. uni.navigateTo({
  183. url: item.driverTo,
  184. });
  185. }
  186. },
  187. ...mapMutations({
  188. setUserInfo: "user/login",
  189. }),
  190. toUserInfo() {
  191. uni.showModal({
  192. title: this.$t('settings.tips'),
  193. content: this.$t('settings.exitLogin'),
  194. cancelText: this.$t('settings.cancelText'),
  195. confirmText: this.$t('settings.confirmText'),
  196. success: res => {
  197. if (res.confirm) {
  198. uni.removeStorageSync('token')
  199. uni.removeStorageSync('tenantId')
  200. uni.removeStorageSync('userId')
  201. uni.removeStorageSync('userName')
  202. uni.removeStorageSync('userInfo')
  203. uni.removeStorageSync('userType')
  204. uni.removeStorageSync('tenantInfo')
  205. uni.removeStorageSync('currentTenantId')
  206. uni.removeStorageSync('currentVehicleInfo')
  207. uni.removeStorageSync('isAuditUser')
  208. uni.removeStorageSync('isDealerUser')
  209. uni.removeStorageSync('isDriverUser')
  210. uni.removeStorageSync('enterpriseInfo')
  211. uni.removeStorageSync('serverAddress');
  212. uni.removeStorageSync('serverPrefix');
  213. uni.reLaunch({
  214. url: '/pages/login/login'
  215. });
  216. getApp().globalData.tabIndex = 'home';
  217. }
  218. },
  219. fail: () => {},
  220. complete: () => {}
  221. });
  222. },
  223. toPage(url) {
  224. uni.navigateTo({
  225. url: url,
  226. });
  227. },
  228. tapGrid(item) {
  229. // uni.showToast({
  230. // // title: '你点击了,第' + (index + 1) + '个',
  231. // title: this.$t('mine.clicked') + " " + (index + 1) ,
  232. // icon: 'none'
  233. // });
  234. },
  235. },
  236. };
  237. </script>
  238. <style lang="scss" scoped>
  239. /* #ifndef APP-NVUE */
  240. view {
  241. display: flex;
  242. box-sizing: border-box;
  243. flex-direction: column;
  244. }
  245. page {
  246. background-color: #f5f7fa;
  247. }
  248. /* #endif */
  249. .center {
  250. flex: 1;
  251. flex-direction: column;
  252. min-height: 100vh;
  253. background-color: #f5f7fa;
  254. .sevice {
  255. display: flex;
  256. flex-direction: row;
  257. justify-content: space-between;
  258. border-radius: 20rpx;
  259. margin-bottom: 24rpx;
  260. padding: 24rpx 0;
  261. overflow: hidden;
  262. background-color: #fff;
  263. .sevice-item {
  264. display: flex;
  265. width: 25%;
  266. text-align: center;
  267. .count {
  268. line-height: 48rpx;
  269. font-size: 32rpx;
  270. font-weight: bold;
  271. color: #333;
  272. }
  273. .title {
  274. line-height: 48rpx;
  275. font-size: 24rpx;
  276. color: #333;
  277. }
  278. }
  279. }
  280. .menu-wrap {
  281. // padding: 32rpx 0;
  282. // border-radius: 20rpx;
  283. overflow: hidden;
  284. background-color: #fff;
  285. .title {
  286. padding: 44rpx 44rpx 12rpx;
  287. display: flex;
  288. font-size: 32rpx;
  289. flex-direction: row;
  290. justify-content: space-between;
  291. .all {
  292. font-size: 28rpx;
  293. color: #999;
  294. display: flex;
  295. flex-direction: row;
  296. align-items: center;
  297. }
  298. }
  299. .version {
  300. padding: 8rpx 8rpx 8rpx;
  301. display: flex;
  302. font-size: 32rpx;
  303. flex-direction: row;
  304. justify-content: space-between;
  305. }
  306. .cell-icon {
  307. width: 65rpx;
  308. height: 65rpx;
  309. }
  310. .cell-wrap {
  311. padding-bottom: 40rpx;
  312. .cell-item {
  313. border-bottom: 1rpx solid #f5f7fa;
  314. }
  315. }
  316. .grid-icon {
  317. width: 60rpx;
  318. height: 60rpx;
  319. }
  320. .grid-text {
  321. margin-top: 8rpx;
  322. font-size: 24rpx;
  323. color: #333333;
  324. line-height: 48rpx;
  325. text-align: center;
  326. }
  327. }
  328. .top-set-user {
  329. background-size: 750rpx auto;
  330. background-color: #fff;
  331. padding: 40rpx 40rpx 56rpx;
  332. }
  333. .top-setting {
  334. position: absolute;
  335. top: 0rpx;
  336. right: 0rpx;
  337. z-index: 2001;
  338. .main {
  339. display: flex;
  340. flex-direction: row;
  341. align-items: center;
  342. justify-content: center;
  343. width: 100rpx;
  344. height: 100rpx;
  345. .setting-version {
  346. text-align: left;
  347. width: 50%;
  348. font-size: 24rpx;
  349. color: #999;
  350. }
  351. .setting-icon {
  352. width: 38rpx;
  353. height: 35rpx;
  354. }
  355. }
  356. }
  357. .message-wrap {
  358. margin: 40rpx 32rpx;
  359. background-color: #fff;
  360. padding: 40rpx;
  361. border-radius: 10rpx;
  362. .message-title {
  363. display: flex;
  364. flex-direction: row;
  365. justify-content: space-between;
  366. line-height: 32rpx;
  367. .label {
  368. color: #222;
  369. font-size: 28rpx;
  370. font-weight: bold;
  371. }
  372. .message {
  373. display: flex;
  374. flex-direction: row;
  375. color: #999;
  376. font-size: 24rpx;
  377. }
  378. }
  379. .message-item {
  380. margin-top: 32rpx;
  381. background-color: #f9f9f9;
  382. border-radius: 10rpx;
  383. padding: 28rpx 32rpx;
  384. .title {
  385. justify-content: space-between;
  386. display: flex;
  387. flex-direction: row;
  388. // width: 176rpx;
  389. color: #999;
  390. font-size: 24rpx;
  391. align-items: center;
  392. justify-content: space-between;
  393. margin-bottom: 32rpx;
  394. }
  395. .info {
  396. flex-direction: row;
  397. .cell-icon {
  398. width: 50rpx;
  399. height: 50rpx;
  400. background-color: #E1EBFF;
  401. border-radius: 10rpx;
  402. display: flex;
  403. justify-content: space-around;
  404. align-items: center;
  405. margin-right: 32rpx;
  406. }
  407. .info-text {
  408. flex: 1;
  409. overflow: hidden;
  410. text-overflow: ellipsis;
  411. white-space: nowrap;
  412. font-size: 22rpx;
  413. color: #666;
  414. }
  415. }
  416. }
  417. }
  418. }
  419. .versionInfo {
  420. position: absolute;
  421. bottom: 0px;
  422. right: 10rpx;
  423. size: 10pt;
  424. color: #fff;
  425. font-size: 13px;
  426. height: 28px;
  427. line-height: 28px;
  428. }
  429. .userInfo {
  430. // position: relative;
  431. flex-direction: row;
  432. align-items: center;
  433. // margin-bottom: 24rpx;
  434. }
  435. .logo-img {
  436. width: 150rpx;
  437. height: 150rpx;
  438. border-radius: 150rpx;
  439. }
  440. .logo-title {
  441. flex: 1;
  442. margin-left: 32rpx;
  443. // align-items: center;
  444. justify-content: space-between;
  445. flex-direction: column;
  446. }
  447. .user-name {
  448. height: 48rpx;
  449. line-height: 48rpx;
  450. font-size: 30rpx;
  451. display: flex;
  452. flex-direction: row;
  453. align-items: center;
  454. font-weight: bold;
  455. color: #fff;
  456. .role-tag {
  457. font-size: 20rpx;
  458. padding: 0 18rpx;
  459. border-radius: 8rpx;
  460. margin-left: 24rpx;
  461. background-color: #6695F9;
  462. box-shadow: 0px 0px 24px 0px rgba(46, 56, 181, 0.44);
  463. color: #fff;
  464. font-weight: normal;
  465. }
  466. }
  467. .user-phone {
  468. color: #fff;
  469. font-size: 26rpx;
  470. height: 56rpx;
  471. line-height: 56rpx;
  472. }
  473. .grid {
  474. background-color: #fff;
  475. // padding: 32rpx;
  476. }
  477. .uni-grid .text {
  478. font-size: 16px;
  479. height: 25px;
  480. line-height: 25px;
  481. color: #817f82;
  482. }
  483. .uni-grid .item ::v-deep .uni-grid-item__box {
  484. justify-content: center;
  485. align-items: center;
  486. }
  487. /deep/ .u-grid-item {
  488. padding: 20rpx 0;
  489. }
  490. </style>