123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597 |
- <template>
- <view class="center">
- <view
- :style="'position: relative;border:0;background:url('+img.infoBg+');background-size:100% 100%;background-color: #fff;padding:80rpx 56rpx;margin:32rpx;border-style: none;'">
- <view class="top-setting" @click="doSomething(setting)">
- <view class="main">
- <image src="../../static/czzn-img/info/info-setting.png" class="setting-icon" />
- </view>
- </view>
- <view class="userInfo" @click.capture="toUserInfo">
- <!-- <u-avatar :src="userInfo.avatar" size="120rpx"></u-avatar> -->
- <view class="logo-title">
- <view class="user-name" v-if="hasLogin">
- <span>{{userInfo.displayName||userInfo.username}}</span>
- <span class="role-tag" v-if="isDriverUser">{{$t('mine.driver')}}</span>
- <span class="role-tag" v-if="isDealerUser">{{$t('mine.dealer')}}</span>
- <span class="role-tag" v-if="isAuditUser">{{$t('mine.auditUser')}}</span>
- <span class="role-tag" v-if="isTransUser">{{$t('order.transporter')}}</span>
- </view>
- <text class="user-name" v-else>{{$t('mine.notLogged')}}</text>
- <text class="user-phone">{{userInfo.phone}}</text>
- </view>
- </view>
- </view>
- <!-- <template v-if="isDealerUser || isDriverUser">
- <view class="menu-wrap">
- <u-cell :isLink="true" arrow-direction="right" @click="doSomething(allOrder)" :border="false"
- :customStyle="{'background':'#fff','font-weight':'bold','padding':'10rpx 10rpx','borderBottom':'2rpx solid #f5f7fa'}"
- :title="$t('mine.order')"></u-cell>
- <uni-grid class="grid" :column="5" :showBorder="false" :square="true">
- <uni-grid-item class="item" v-for="(item,index) in gridList" @click.native="toOrdering(item)"
- :key="index">
- <image :src="item.icon" class="grid-icon" />
- <text class="grid-text">{{item.title}}</text>
- </uni-grid-item>
- </uni-grid>
- </view>
- <view class="menu-wrap">
- <u-cell :border="false"
- :customStyle="{'background':'#f5f7fa','font-weight':'bold','padding':'10rpx 10rpx'}"
- :title="$t('mine.service')"></u-cell>
- <template v-if="isDealerUser">
- <u-cell-group class="cell-wrap" :border="false">
- <u-cell :isLink="true" arrow-direction="right" :border="false" class="cell-item"
- v-for="(item,index) in dealerMenuList" @click.native="doSomething(item)" :key="index"
- :title="item.title">
- <u-icon slot="icon" :name="item.icon" color="#2979ff" size="24" class="cell-icon"></u-icon>
- </u-cell>
- </u-cell-group>
- </template>
- <template v-if="isDriverUser">
- <u-cell-group class="cell-wrap" :border="false">
- <u-cell :isLink="true" arrow-direction="right" :border="false" class="cell-item"
- v-for="(item,index) in driverMenuList" @click.native="doSomething(item)" :key="index"
- :title="item.title">
- <u-icon slot="icon" :name="item.icon" color="#2979ff" size="24" class="cell-icon"></u-icon>
- </u-cell>
- </u-cell-group>
- </template>
- </view>
- </template> -->
- <Bars></Bars>
- </view>
- </template>
- <script>
- import {
- mapGetters,
- mapMutations
- } from "vuex";
- import {
- getTenantCacheList
- } from '../../utils/util.js'
- import Bars from '../../components/tabBar/tabBar.vue';
- import imgUtil from '../../utils/imgUtil'
- export default {
- components: {
- Bars
- },
- // #ifdef APP
- onBackPress({
- from
- }) {
- if (from == "backbutton") {
- this.$nextTick(function() {
- uniShare.hide();
- });
- return uniShare.isShow;
- }
- },
- // #endif
- data() {
- return {
- img:imgUtil,
- setting: {
- title: this.$t("mine.settings"),
- to: "/pages/ucenter/settings",
- icon: "gear",
- show: true,
- },
- allOrder: {
- title: this.$t("mine.all"),
- icon: "file-text",
- to: '/subpages/order/dealerList?index=0'
- },
- gridList: [{
- title: this.$t("mine.reviewed"),
- icon: "../../static/czzn-img/info/info-order.png",
- dealerTo: '/subpages/order/dealerList?orderType=0&orderStatus=0',
- driverTo: '/subpages/order/driverList?orderType=0&orderStatus=0'
- },
- {
- title: this.$t("mine.unpaid"),
- icon: "../../static/czzn-img/info/info-jc.png",
- dealerTo: '/subpages/order/dealerList?orderType=0&orderStatus=1',
- driverTo: '/subpages/order/driverList?orderType=0&orderStatus=1'
- },
- {
- title: this.$t("mine.weigh"),
- icon: "../../static/czzn-img/info/info-gb.png",
- dealerTo: '/subpages/order/dealerList?orderType=0&orderStatus=3',
- driverTo: '/subpages/order/driverList?orderType=0&orderStatus=3'
- },
- {
- title: this.$t("mine.ongoing"),
- icon: "../../static/czzn-img/info/info-cc.png",
- dealerTo: '/subpages/order/dealerList?orderType=0&orderStatus=2',
- driverTo: '/subpages/order/driverList?orderType=0&orderStatus=2'
- },
- {
- title: this.$t("mine.invalid"),
- icon: "../../static/czzn-img/info/info-zf.png",
- dealerTo: '/subpages/order/dealerList?orderType=0&orderStatus=4',
- driverTo: '/subpages/order/driverList?orderType=0&orderStatus=4'
- },
- ],
- driverMenuList: [{
- title: this.$t("mine.vehicle"),
- icon: "../../static/czzn-img/info/info-cl.png",
- to: '/subpages/driver/driverList',
- count: 0,
- },
- {
- title: this.$t("mine.feedback"),
- icon: imgUtil.feedbackIcon,
- to: '/substaticpages/info/feedback',
- count: 0,
- },
- // {
- // title: this.$t("mine.mp"),
- // icon: "../../static/czzn-img/info/info-msg.png",
- // to: '/subpages/mp/index',
- // count: 0,
- // },
- ],
- dealerMenuList: [{
- title: this.$t("mine.enterprise"),
- icon: imgUtil.enterpriseIcon,
- to: '/subpages/tenant/list',
- count: 0,
- },
- {
- title: this.$t("mine.driver"),
- icon: imgUtil.driverIcon,
- to: '/subpages/driver/dealerList',
- count: 0,
- },
- {
- title: this.$t("mine.feedback"),
- icon: imgUtil.feedbackIcon,
- to: '/substaticpages/info/feedback',
- count: 0,
- },
- // {
- // title: this.$t("mine.mp"),
- // icon: "../../static/czzn-img/info/info-msg.png",
- // to: '/subpages/mp/index',
- // count: 0,
- // },
- ],
- role: [],
- userType: "0",
- tenantCount: 0,
- version: "",
- versionCode: "",
- mpVersion: "",
- isAuditUser: false,
- isDealerUser: false,
- isDriverUser: false,
- isAcceptUser: false,
- isDeliverUser: false,
- isTransUser: false,
- };
- },
- onLoad() {
- this.isAuditUser = uni.getStorageSync('isAuditUser')
- this.isDealerUser = uni.getStorageSync('isDealerUser')
- this.isDriverUser = uni.getStorageSync('isDriverUser')
- this.isAcceptUser = uni.getStorageSync('isAcceptUser')
- this.isDeliverUser = uni.getStorageSync('isDeliverUser')
- this.isTransUser = uni.getStorageSync('isTransUser')
- // const routers = getCurrentPages();
- // console.log(routers);
- if(this.isDealerUser){
- this.allOrder.to = '/subpages/order/dealerList?index=0'
- }else if(this.isDriverUser){
- this.allOrder.to = '/subpages/order/driverList'
- }
- console.log("开始加载");
- uni.hideTabBar()
- this.userType = uni.getStorageSync('userType')
- this.bindUserInfo()
- var that = this;
- uni.getSystemInfo({
- success: function(res) {
- console.log("系统信息、", res)
- console.log("系统版本号、", res.appVersionCode, res.appVersion)
- that.version = res.appVersion;
- that.versionCode = res.appVersionCode;
- console.log("系统版本号、", that.version, that.versionCode)
- }
- });
- // #ifdef MP-WEIXIN
- const accountInfo = wx.getAccountInfoSync();
- this.mpVersion = accountInfo.miniProgram.version // 小程序 版本号
- // #endif
- },
- computed: {
- ...mapGetters({
- userInfo: "user/info",
- hasLogin: "user/hasLogin",
- }),
- // #ifdef APP-PLUS
- appVersion() {
- return getApp().appVersion;
- },
- // #endif
- appConfig() {
- return getApp().globalData.config;
- },
- },
- methods: {
- bindUserInfo() {
- var tenantList = getTenantCacheList();
- console.log("当前租户信息、", tenantList);
- },
- //宫格点击事件
- doSomething(item) {
- if (item.to) {
- uni.navigateTo({
- url: item.to,
- });
- }
- if (item.event) {
- this[item.event]
- }
- },
- toOrdering(item) {
- if (this.isDealerUser == true) {
- uni.navigateTo({
- url: item.dealerTo,
- });
- } else {
- uni.navigateTo({
- url: item.driverTo,
- });
- }
- },
- ...mapMutations({
- setUserInfo: "user/login",
- }),
- toUserInfo() {
- if(this.hasLogin){
- uni.navigateTo({
- url: "/substaticpages/info/userInfo",
- });
- }else{
- uni.reLaunch({
- url: "/pages/login/login"
- })
- }
- },
- toPage(url) {
- uni.navigateTo({
- url: url,
- });
- },
- tapGrid(item) {
- // uni.showToast({
- // // title: '你点击了,第' + (index + 1) + '个',
- // title: this.$t('mine.clicked') + " " + (index + 1) ,
- // icon: 'none'
- // });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- /* #ifndef APP-NVUE */
- view {
- display: flex;
- box-sizing: border-box;
- flex-direction: column;
- }
- page {
- background-color: #f5f7fa;
- }
- /* #endif */
- .center {
- flex: 1;
- flex-direction: column;
- min-height: 100vh;
- background-color: #f5f7fa;
- .sevice {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- border-radius: 20rpx;
- margin-bottom: 24rpx;
- padding: 24rpx 0;
- overflow: hidden;
- background-color: #fff;
- .sevice-item {
- display: flex;
- width: 25%;
- text-align: center;
- .count {
- line-height: 48rpx;
- font-size: 32rpx;
- font-weight: bold;
- color: #333;
- }
- .title {
- line-height: 48rpx;
- font-size: 24rpx;
- color: #333;
- }
- }
- }
- .menu-wrap {
- // padding: 32rpx 0;
- // border-radius: 20rpx;
- overflow: hidden;
- background-color: #fff;
- .title {
- padding: 44rpx 44rpx 12rpx;
- display: flex;
- font-size: 32rpx;
- flex-direction: row;
- justify-content: space-between;
- .all {
- font-size: 28rpx;
- color: #999;
- display: flex;
- flex-direction: row;
- align-items: center;
- }
- }
- .version {
- padding: 8rpx 8rpx 8rpx;
- display: flex;
- font-size: 32rpx;
- flex-direction: row;
- justify-content: space-between;
- }
- .cell-icon {
- width: 65rpx;
- height: 65rpx;
- }
- .cell-wrap {
- padding-bottom: 40rpx;
- .cell-item {
- border-bottom: 1rpx solid #f5f7fa;
- }
- }
- .grid-icon {
- width: 60rpx;
- height: 60rpx;
- }
- .grid-text {
- margin-top: 8rpx;
- font-size: 24rpx;
- color: #333333;
- line-height: 48rpx;
- text-align: center;
- }
- }
- .top-set-user {
- background-size: 750rpx auto;
- background-color: #fff;
- padding: 40rpx 40rpx 56rpx;
- }
- .top-setting {
- position: absolute;
- top: 0rpx;
- right: 0rpx;
- z-index: 2001;
- .main {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- width: 100rpx;
- height: 100rpx;
- .setting-version {
- text-align: left;
- width: 50%;
- font-size: 24rpx;
- color: #999;
- }
- .setting-icon {
- width: 38rpx;
- height: 35rpx;
- }
- }
- }
- .message-wrap {
- margin: 40rpx 32rpx;
- background-color: #fff;
- padding: 40rpx;
- border-radius: 10rpx;
- .message-title {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- line-height: 32rpx;
- .label {
- color: #222;
- font-size: 28rpx;
- font-weight: bold;
- }
- .message {
- display: flex;
- flex-direction: row;
- color: #999;
- font-size: 24rpx;
- }
- }
- .message-item {
- margin-top: 32rpx;
- background-color: #f9f9f9;
- border-radius: 10rpx;
- padding: 28rpx 32rpx;
- .title {
- justify-content: space-between;
- display: flex;
- flex-direction: row;
- // width: 176rpx;
- color: #999;
- font-size: 24rpx;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 32rpx;
- }
- .info {
- flex-direction: row;
- .cell-icon {
- width: 50rpx;
- height: 50rpx;
- background-color: #E1EBFF;
- border-radius: 10rpx;
- display: flex;
- justify-content: space-around;
- align-items: center;
- margin-right: 32rpx;
- }
- .info-text {
- flex: 1;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: 22rpx;
- color: #666;
- }
- }
- }
- }
- }
- .versionInfo {
- position: absolute;
- bottom: 0px;
- right: 10rpx;
- size: 10pt;
- color: #fff;
- font-size: 13px;
- height: 28px;
- line-height: 28px;
- }
- .userInfo {
- // position: relative;
- flex-direction: row;
- align-items: center;
- // margin-bottom: 24rpx;
- }
- .logo-img {
- width: 150rpx;
- height: 150rpx;
- border-radius: 150rpx;
- }
- .logo-title {
- flex: 1;
- margin-left: 32rpx;
- // align-items: center;
- justify-content: space-between;
- flex-direction: column;
- }
- .user-name {
- height: 48rpx;
- line-height: 48rpx;
- font-size: 30rpx;
- display: flex;
- flex-direction: row;
- align-items: center;
- font-weight: bold;
- color: #fff;
- .role-tag {
- font-size: 20rpx;
- padding: 0 18rpx;
- border-radius: 8rpx;
- margin-left: 24rpx;
- background-color: #6695F9;
- box-shadow: 0px 0px 24px 0px rgba(46, 56, 181, 0.44);
- color: #fff;
- font-weight: normal;
- }
- }
- .user-phone {
- color: #fff;
- font-size: 26rpx;
- height: 56rpx;
- line-height: 56rpx;
- }
- .grid {
- background-color: #fff;
- // padding: 32rpx;
- }
- .uni-grid .text {
- font-size: 16px;
- height: 25px;
- line-height: 25px;
- color: #817f82;
- }
- .uni-grid .item ::v-deep .uni-grid-item__box {
- justify-content: center;
- align-items: center;
- }
- /deep/ .u-grid-item {
- padding: 20rpx 0;
- }
- </style>
|