|
|
@@ -12,6 +12,7 @@
|
|
|
</view>
|
|
|
</block>
|
|
|
<block v-else>
|
|
|
+ <!-- ========== 完整功能界面 ========== -->
|
|
|
<view class="app-main app-content" v-if="loginStyle == 2">
|
|
|
<template v-if="lookMoney == 1">
|
|
|
<view class="today-overview-card">
|
|
|
@@ -258,14 +259,66 @@
|
|
|
</template>
|
|
|
|
|
|
</view>
|
|
|
+
|
|
|
+ <!-- ========== 简化功能界面 ========== -->
|
|
|
<view class="order-page" v-else>
|
|
|
<view class="ghs_list_page flex-col">
|
|
|
- <view style="background-color:white;margin-bottom:20upx;">
|
|
|
- <button class="admin-button-com mini-btn blue" style="margin-left:11upx;padding-top:17upx;padding-bottom:17upx;" @click="pageTo({url:'/admin/shop/myShop'})">我的门店</button>
|
|
|
- <button class="admin-button-com mini-btn blue" style="margin-left:11upx;padding-top:17upx;padding-bottom:17upx;" @click="pageTo({url:'/admin/staff/list'})">我的员工</button>
|
|
|
- <button class="admin-button-com mini-btn blue" style="margin-left:11upx;padding-top:17upx;padding-bottom:17upx;" @click="pageTo({url:'/admin/shop/add?id='+loginInfo.shopId})">我的地址</button>
|
|
|
- <button class="admin-button-com mini-btn blue" style="margin-left:11upx;padding-top:17upx;padding-bottom:17upx;" @click="pageTo({url:'/admin/stat/cgItem'})">采购统计</button>
|
|
|
- <button class="admin-button-com mini-btn blue" style="margin-left:11upx;padding-top:17upx;padding-bottom:17upx;" @click="goMore()">更多</button>
|
|
|
+ <view class="profile-section">
|
|
|
+ <view class="profile-header">
|
|
|
+ <view class="avatar-container">
|
|
|
+ <button
|
|
|
+ class="avatar-button"
|
|
|
+ open-type="chooseAvatar"
|
|
|
+ @chooseavatar="onChooseAvatar"
|
|
|
+ >
|
|
|
+ <image
|
|
|
+ class="avatar"
|
|
|
+ :src="shopAvatar()"
|
|
|
+ mode="aspectFill"
|
|
|
+ />
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ <view class="user-info">
|
|
|
+ <text class="username">{{ (shopInfo && shopInfo.shopName == '首店') ? (shopInfo.merchantName || '') : (((shopInfo && shopInfo.merchantName) ? shopInfo.merchantName : '') + (shopInfo && shopInfo.shopName ? (' ' + shopInfo.shopName) : '')) }}</text>
|
|
|
+ <text class="user-id">ID {{ shopInfo && shopInfo.id ? shopInfo.id : '' }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="more-icon">
|
|
|
+ <zui-svg-icon icon="home-more" :width="26" color="#FFFFFF" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="function-grid function-grid--overlay">
|
|
|
+ <view class="function-item function-item--overlay" @click="pageTo({url:'/admin/shop/myShop'})">
|
|
|
+ <view class="function-icon">
|
|
|
+ <zui-svg-icon icon="home-shop" :width="32" :height="32" color="#FFFFFF" />
|
|
|
+ </view>
|
|
|
+ <text class="function-text function-text--overlay">我的门店</text>
|
|
|
+ </view>
|
|
|
+ <view class="function-item function-item--overlay" @click="pageTo({url:'/admin/staff/list'})">
|
|
|
+ <view class="function-icon">
|
|
|
+ <zui-svg-icon icon="home-staffs" :width="32" :height="32" color="#FFFFFF" />
|
|
|
+ </view>
|
|
|
+ <text class="function-text function-text--overlay">我的员工</text>
|
|
|
+ </view>
|
|
|
+ <view class="function-item function-item--overlay" @click="pageTo({url:'/admin/shop/add?id='+loginInfo.shopId})">
|
|
|
+ <view class="function-icon">
|
|
|
+ <zui-svg-icon icon="home-address" :width="32" :height="32" color="#FFFFFF" />
|
|
|
+ </view>
|
|
|
+ <text class="function-text function-text--overlay">我的地址</text>
|
|
|
+ </view>
|
|
|
+ <view class="function-item function-item--overlay" @click="pageTo({url:'/admin/stat/cgItem'})">
|
|
|
+ <view class="function-icon">
|
|
|
+ <zui-svg-icon icon="home-statistics" :width="32" :height="32" color="#FFFFFF" />
|
|
|
+ </view>
|
|
|
+ <text class="function-text function-text--overlay">采购统计</text>
|
|
|
+ </view>
|
|
|
+ <view class="function-item function-item--overlay" @click="goMore()">
|
|
|
+ <view class="function-icon">
|
|
|
+ <zui-svg-icon icon="home-more-2" :width="30" :height="30" color="#FFFFFF" />
|
|
|
+ </view>
|
|
|
+ <text class="function-text function-text--overlay">更多</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view style="text-align:center;font-size:29upx;">您好,{{ loginInfo.admin && loginInfo.admin.name ? loginInfo.admin.name : '' }} {{ loginInfo.admin && loginInfo.admin.mobile ? loginInfo.admin.mobile : '' }}</view>
|
|
|
<view v-if="!$util.isEmpty(data.warning)" style="color:red;font-size:36upx;font-weight:bold;text-align: center;margin-bottom:15upx;margin-top:20upx;">{{ data.warning }}</view>
|
|
|
@@ -457,9 +510,10 @@ import { consoleIndex } from "@/api/workbench";
|
|
|
import autoUpdateMixins from "@/mixins/autoUpdate";
|
|
|
import { ghsList } from "@/api/purchase";
|
|
|
import { changeDelStatus,hasMoreGhs } from "@/api/ghs";
|
|
|
-import {currentShop} from "@/api/shop";
|
|
|
+import {currentShop, uploadShopAvatar} from "@/api/shop";
|
|
|
import { clearLogin,hasNotice } from "@/api/admin";
|
|
|
import { unReadMsgCount } from "@/api/chat";
|
|
|
+import { APIHOST } from "@/config";
|
|
|
export default {
|
|
|
name: "workbench",
|
|
|
mixins: [autoUpdateMixins],
|
|
|
@@ -543,6 +597,67 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ onChooseAvatar(e){
|
|
|
+ if(this.loginInfo && this.loginInfo.staff && this.loginInfo.staff.founder != 2){
|
|
|
+ this.$msg('无权修改头像')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if(e && e.detail && e.detail.avatarUrl){
|
|
|
+ let avatarUrl = e.detail.avatarUrl
|
|
|
+ this.updateShopAvatar(avatarUrl)
|
|
|
+ }else{
|
|
|
+ this.$msg('获取头像失败')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ updateShopAvatar(avatarUrl){
|
|
|
+ let token = uni.getStorageSync('token') || ''
|
|
|
+ let url = APIHOST + '/upload/save-file'
|
|
|
+ uni.uploadFile({
|
|
|
+ url: url,
|
|
|
+ filePath: avatarUrl,
|
|
|
+ name: 'file',
|
|
|
+ header: { token: token },
|
|
|
+ formData: {},
|
|
|
+ success: (res) => {
|
|
|
+ try{
|
|
|
+ const ret = JSON.parse(res.data)
|
|
|
+ if(ret.code == 1){
|
|
|
+ this.shopInfo.avatar = ret.data.shortUrl
|
|
|
+ this.$msg('头像已更新')
|
|
|
+ uni.setStorageSync('shopAvatar', this.shopInfo.avatar)
|
|
|
+
|
|
|
+ //请后端,上传新的头像地址,同步更新xhGhsCustom里面的头像地址
|
|
|
+ uploadShopAvatar({ id: this.shopInfo.id, avatar: ret.data.shortUrl }).then(res => {
|
|
|
+ if(res.code == 1){
|
|
|
+ // this.$msg('头像上传成功')
|
|
|
+ }else{
|
|
|
+ // this.$msg(res.msg || '上传失败')
|
|
|
+ console.log(res.msg || '上传失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$msg(ret.msg || '上传失败')
|
|
|
+ }
|
|
|
+ }catch(err){
|
|
|
+ this.$msg('服务异常')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ this.$msg('上传失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ shopAvatar(){
|
|
|
+ const avatar = (this.shopInfo && this.shopInfo.avatar) ? this.shopInfo.avatar : '/hhb_small.png?x-oss-process=image/resize,m_fill,h_130,w_130'
|
|
|
+ if(!avatar){
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ if(/^https?:\/\//i.test(avatar)){
|
|
|
+ return avatar
|
|
|
+ }
|
|
|
+ return this.$constant.imgUrl + (avatar.indexOf('/') === 0 ? avatar : ('/' + avatar))
|
|
|
+ },
|
|
|
buyItem() {
|
|
|
let that = this
|
|
|
// #ifdef MP-WEIXIN
|
|
|
@@ -1365,6 +1480,104 @@ export default {
|
|
|
position: relative;
|
|
|
width: 750upx;
|
|
|
overflow: hidden;
|
|
|
+ .profile-section {
|
|
|
+ background-color: #09C567;
|
|
|
+ padding: 24upx;
|
|
|
+ border-radius: 0;
|
|
|
+ .profile-header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .avatar-container {
|
|
|
+ width: 120upx;
|
|
|
+ height: 120upx;
|
|
|
+ border-radius: 60upx;
|
|
|
+ overflow: hidden;
|
|
|
+ background-color: rgba(255,255,255,0.2);
|
|
|
+ border: 1upx solid #ffffff;
|
|
|
+ .avatar-button {
|
|
|
+ background: none !important;
|
|
|
+ border: none !important;
|
|
|
+ padding: 0 !important;
|
|
|
+ margin: 0 !important;
|
|
|
+ line-height: 1;
|
|
|
+ display: block;
|
|
|
+ width: 120upx;
|
|
|
+ height: 120upx;
|
|
|
+ color: transparent !important;
|
|
|
+ &::after { border: none !important; }
|
|
|
+ }
|
|
|
+ .avatar {
|
|
|
+ width: 120upx;
|
|
|
+ height: 120upx;
|
|
|
+ border-radius: 60upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .user-info {
|
|
|
+ flex: 1;
|
|
|
+ margin-left: 24upx;
|
|
|
+ .username {
|
|
|
+ display: block;
|
|
|
+ font-size: 36upx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ .user-id {
|
|
|
+ display: block;
|
|
|
+ margin-top: 6upx;
|
|
|
+ font-size: 26upx;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .more-icon {
|
|
|
+ margin-left: 12upx;
|
|
|
+ width: 60upx;
|
|
|
+ height: 60upx;
|
|
|
+ border-radius: 30upx;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ display: flex;
|
|
|
+ // background: rgba(255,255,255,0.15);
|
|
|
+ // border: 1upx solid rgba(255,255,255,0.35);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .function-grid {
|
|
|
+ margin-top: 24upx;
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ justify-content: space-between;
|
|
|
+ gap: 0;
|
|
|
+ }
|
|
|
+ .function-grid--overlay {
|
|
|
+ background: transparent;
|
|
|
+ padding: 12upx 0 0 0;
|
|
|
+ }
|
|
|
+ .function-item {
|
|
|
+ width: 20%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ padding: 20upx 0;
|
|
|
+ border-radius: 16upx;
|
|
|
+ border: 1upx solid rgba(255,255,255,0.5);
|
|
|
+ background: rgba(255,255,255,0.12);
|
|
|
+ backdrop-filter: blur(8upx);
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+ .function-item--overlay {
|
|
|
+ border-color: rgba(255,255,255,0.5);
|
|
|
+ background: rgba(255,255,255,0.12);
|
|
|
+ }
|
|
|
+ .function-icon {
|
|
|
+ margin-bottom: 10upx;
|
|
|
+ }
|
|
|
+ .function-text {
|
|
|
+ font-size: 26upx;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ .function-text--overlay {
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ }
|
|
|
.flex-col {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|