123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- <template>
- <view class="content">
- <view class="user-info-box">
- <image class="user-image" :src="userData.headImage"></image>
- <view class="user-info">
- <view class="user-logoin-title">{{userData.tenantName}}</view>
- <view class="user-type">
- <view class="iconfont iconshangjia-shanghu"></view>
- <view>商家用户</view>
- </view>
- </view>
- </view>
- <view class="order-box">
- <view class="order-item" @click="orderClick(2)">
- <view class="iconfont icondaifahuo order-item-icon">
- <view v-if="num.unSend" class="order-item-icon-num">{{num.unSend}}</view>
- </view>
- <view class="order-item-text">待发货</view>
- </view>
- <view class="order-item" @click="orderClick(3)">
- <view class="iconfont icondaishouhuo order-item-icon">
- <view v-if="num.unReceive" class="order-item-icon-num">{{num.unReceive}}</view>
- </view>
- <view class="order-item-text">已发货</view>
- </view>
- <view class="order-item" @click="orderClick(4)">
- <view class="iconfont iconyishouhuo order-item-icon">
- <view v-if="num.unComment" class="order-item-icon-num">{{num.unComment}}</view>
- </view>
- <view class="order-item-text">已收货</view>
- </view>
- <view class="order-item" @click="orderClick(5)">
- <view class="iconfont icondaipingjia order-item-icon">
- <view v-if="num.finished" class="order-item-icon-num">{{num.finished}}</view>
- </view>
- <view class="order-item-text">已评价</view>
- </view>
- </view>
- <view class="cell-group">
- <view class="item-btn" @click="pickClick()">
- <view class="iconfont iconcaizhai item-btn-icon"></view>
- <view class="item-btn-text" v-if="num.selfOrder">自助采摘 ({{num.selfOrder}})</view>
- <view class="item-btn-text" v-if="!num.selfOrder">自助采摘</view>
- <view class="iconfont iconfangxiang"></view>
- </view>
- <view class="item-btn" @click="authorizeClick()" v-if="userData.isMaster">
- <view class="iconfont iconquanxian item-btn-icon"></view>
- <view class="item-btn-text">授权</view>
- <view class="iconfont iconfangxiang"></view>
- </view>
- <view class="item-btn" @click="couponClick()">
- <view class="iconfont iconyouhuiquan item-btn-icon"></view>
- <view class="item-btn-text">优惠券管理</view>
- <view class="iconfont iconfangxiang"></view>
- </view>
- </view>
- <view class="cell-group">
- <view class="item-btn" @click="infoClick()">
- <view class="iconfont icondianpu item-btn-icon"></view>
- <view class="item-btn-text">商户信息</view>
- <view class="iconfont iconfangxiang"></view>
- </view>
- <view class="item-btn" @click="aboutUsClick()">
- <view class="iconfont iconguanyu item-btn-icon"></view>
- <view class="item-btn-text">关于我们</view>
- <view class="iconfont iconfangxiang"></view>
- </view>
- <view class="item-btn" @click="modalShow=true">
- <view class="iconfont iconguanyu item-btn-icon"></view>
- <view class="item-btn-text">后台管理信息</view>
- <view class="iconfont iconfangxiang"></view>
- </view>
- <view class="item-btn" @click="loginModal=true">
- <view class="iconfont iconguanyu item-btn-icon"></view>
- <view class="item-btn-text">退出登录</view>
- <view class="iconfont iconfangxiang"></view>
- </view>
- </view>
- <u-top-tips ref="uTips"></u-top-tips>
- <u-modal v-model="modalShow" title="后台管理信息" :content="'账号:'+manageInfo.account+',密码'+ manageInfo.password"></u-modal>
- <u-modal v-model="loginModal" content="确定退出登录?" @confirm="loginOut()" :async-close="true" :show-cancel-button="true"></u-modal>
- </view>
- </template>
- <script>
- const NET = require('@/utils/request')
- const API = require('@/config/api')
- export default {
- data() {
- return {
- integral: '',
- userData: {
- userId: '',
- userName: '',
- headImage: '',
- isMaster: 0,
- },
- manageInfo: {},
- modalShow: false,
- loginModal: false,
- num: {
- unComment: 0, // 待评价
- unPay: 0, // 待付款
- unReceive: 0, // 待收货
- unSend: 0, // 待发货
- finished: 0, // 已评价
- selfOrder: 0,// 自助采摘订单
- }
- }
- },
- onShow() {
- this.userData = uni.getStorageSync("userData")||{}
- NET.request(API.getManageInfo, {}, 'POST').then(res => {
- this.manageInfo = res.data
- }).catch(error => {
- this.$refs.uTips.show({
- title: error.data.msg,
- type: 'warning',
- })
- })
- this.getNum()
- },
- methods: {
- // 注销
- loginOut() {
- try {
- uni.clearStorageSync();
- this.loginModal = false
- uni.reLaunch({
- url: '/pages/index/index'
- });
- } catch (e) {
- console.log(e, '退出登录')
- }
- },
- // 我的订单
- orderClick(type) {
- if(!this.userData.roleInfos.some(v=>v.menuInfos.some(vv=>vv.label == '订单管理'))){
- this.$refs.uTips.show({
- title: '没有授权使用,请联系商户负责人',
- type: 'warning',
- })
- return;
- }
-
- uni.navigateTo({
- url: '/pagesMain/orderList?type=' + type
- });
- },
- // 获取订单数量
- getNum() {
- NET.request(API.getOrderNum, {}, 'GET').then(res => {
- if (res.isSuccess) {
- this.num = res.data
- } else {
- this.$refs.uTips.show({
- title: res.msg,
- type: 'warning',
- })
- }
- }).catch(error => {
- this.$refs.uTips.show({
- title: '获取个人信息失败',
- type: 'warning',
- })
- })
- },
- // 自助采摘
- pickClick() {
- if(!this.userData.roleInfos.some(v=>v.menuInfos.some(vv=>vv.label == '订单管理'))){
- this.$refs.uTips.show({
- title: '没有授权使用,请联系商户负责人',
- type: 'warning',
- })
- return;
- }
- uni.navigateTo({
- // url: '/pagesMedia/pickVideo',
- url: '/pagesMain/pickOrderList?type=' + 6
- });
- },
- // 授权
- authorizeClick() {
- uni.navigateTo({
- url: '/pagesMain/authorizeList'
- });
- },
- // 优惠券管理
- couponClick() {
- if(!this.userData.roleInfos.some(v=>v.menuInfos.some(vv=>vv.label == '优惠券管理'))){
- this.$refs.uTips.show({
- title: '没有授权使用,请联系商户负责人',
- type: 'warning',
- })
- return;
- }
- uni.navigateTo({
- url: '/pagesMain/couponList'
- });
- },
- // 商户信息
- infoClick() {
- if(!this.userData.isMaster) {
- this.$refs.uTips.show({
- title: '没有授权使用,请联系商户负责人',
- type: 'warning',
- })
- return;
- }
- uni.navigateTo({
- url: '/pagesMain/registerForm'
- });
- },
- // 关于我们
- aboutUsClick() {
- uni.navigateTo({
- url: '/pagesMain/aboutUs'
- });
- },
- // 获取后台管理账号密码
- manageInfoClick(){
- this.modalShow = true
- }
- }
- }
- </script>
- <style lang='scss'>
- page {
- width: 100%;
- height: 100%;
- }
- .content {
- width: 100%;
- height: 100%;
- float: left;
- background-color: #F3F3F3;
- .user-info-box {
- width: 100%;
- height: 120px;
- float: left;
- box-sizing: border-box;
- padding: 15px;
- position: relative;
- background-size: 100% 195px;
- background-position: center top;
- background-repeat: no-repeat;
- background-image: url(@/static/images/userBg.png);
- .user-image {
- width: 65px;
- height: 65px;
- object-fit: cover;
- border-radius: 50%;
- float: left;
- }
- .user-info {
- width: calc(100% - 85px);
- float: left;
- display: flex;
- flex-direction: column;
- padding: 10px 15px;
- box-sizing: border-box;
- z-index: 10;
- .user-logoin-title {
- font-size: 36upx;
- font-weight: 500;
- color: rgba(255, 255, 255, 1);
- }
- .user-type {
- width: 70px;
- height: 20px;
- background: #FFFFFF;
- color: #55AF3D;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 12px;
- }
- }
- }
- .order-box {
- width: 690upx;
- height: 170upx;
- float: left;
- background: rgba(255, 255, 255, 1);
- box-shadow: 0px 0px 10upx 0px rgba(51, 51, 51, 0.1);
- border-radius: 10upx;
- display: flex;
- flex-direction: row;
- align-items: center;
- z-index: 10;
- position: relative;
- left: 50%;
- transform: translateX(-50%);
- margin-top: -20px;
- margin-bottom: 10px;
- .order-line {
- width: 12upx;
- height: 106upx;
- }
- .order-item {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- .order-item-icon {
- color: #52A63A;
- font-size: 30px;
- display: flex;
- position: relative;
- .order-item-icon-num {
- background: #ffffff;
- width: 22px;
- height: 20px;
- font-size: 12px;
- border-radius: 50%;
- color: #52A63A;
- text-align: center;
- position: absolute;
- left: 20px;
- border: 1px solid #52A63A;
- line-height: 20px;
- }
- }
- .order-item-text {
- font-size: 28upx;
- margin-top: 10upx;
- font-weight: 500;
- }
- }
- }
- .cell-group {
- width: 100%;
- float: left;
- margin-bottom: 10px;
- .item-btn {
- width: 100%;
- height: 50px;
- display: flex;
- flex-direction: row;
- align-items: center;
- box-sizing: border-box;
- background-color: #fff;
- padding: 0 15px;
- .item-btn-icon {
- color: #52A63A;
- font-size: 20px;
- }
- .item-btn-text {
- font-size: 28upx;
- margin-left: 20upx;
- font-weight: 500;
- flex: 1;
- color: rgba(102, 102, 102, 1);
- }
- }
- }
- }
- </style>
|