update 修改样式问题

This commit is contained in:
qijq 2025-06-25 07:53:47 +08:00
parent c1e88872bf
commit b5b4d3c90d
6 changed files with 284 additions and 75 deletions

View File

@ -0,0 +1,18 @@
import http from "../utils/http";
import config from "../config/config";
/**
* @author Seven
* @data 2025-6-25
* @returns { }
* @see https://mall.gpxscs.cn/api/admin/shop/shop-store-base/update/storeBizState
*/
export function UpdateStoreBizState(params) {
return http({
url: "shop/shop-store-base/update/storeBizState",
method: "post",
baseURL: config.adminApi,
data: params,
});
}

View File

@ -143,6 +143,12 @@
"navigationBarTitleText": "设置" "navigationBarTitleText": "设置"
} }
}, },
{
"path": "pages/my/businessStatus",
"style": {
"navigationBarTitleText": "营业状态"
}
},
{ {
"path": "pages/my/contract", "path": "pages/my/contract",
"style": { "style": {

View File

@ -559,9 +559,8 @@ export default {
approval_remark: "", approval_remark: "",
approval_invalid_col: [], approval_invalid_col: [],
}; };
// this.auditInfo.has_apply_mer = 2;
if (!res.data) { if (!res.data || res.data.approval_status == 4) {
this.showLoading = false; this.showLoading = false;
return; return;
} }

View File

@ -0,0 +1,152 @@
<template>
<view class="businessStatus-container">
<view class="business-contetn">
<view class="title">营业状态</view>
<view class="business-box">
<view class="business-status">
<view class="status-name">店铺正常营业中</view>
<view class="business-time">
营业时间{{ dashboardInfo.store_info.info.store_opening_hours }} -
{{ dashboardInfo.store_info.info.store_close_hours }}
</view>
</view>
<u-switch
v-model="dashboardInfo.store_info.store_biz_state"
activeColor="#5ac725"
inactiveColor="#f56c6c"
:activeValue="1"
:inactiveValue="2"
@change="handerUpdateStoreBizState"
></u-switch>
</view>
</view>
</view>
</template>
<script>
import { GetAccountDashboard } from "../../api/user";
import { UpdateStoreBizState } from "../../api/store";
export default {
data() {
return {
dashboardInfo: {
data: {},
notice: {},
order: {
yestoday_num: 0,
},
product: {
illegal_num: 0,
normal_num: 0,
off_num: 0,
total_num: 0,
verify_passed_off_num: 0,
verify_refused_num: 0,
verify_waiting_num: 0,
},
return: {
fin_num: 0,
review_num: 0,
total_num: 0,
un_fin_num: 0,
},
store_info: {
store_id: 1,
store_name: "",
store_biz_state: 1,
info: {
store_opening_hours: "",
store_close_hours: "",
},
},
},
};
},
onShow() {
this.getAccountDashboard();
},
methods: {
async getAccountDashboard() {
let res = await GetAccountDashboard();
if (res && res.status == 200) {
uni.setStorageSync("accountDashboard", res.data);
this.dashboardInfo = res.data;
}
},
async handerUpdateStoreBizState(e) {
let params = {
store_id: this.dashboardInfo.store_info.store_id,
store_biz_state: e,
};
if (e == 2) {
uni.showModal({
title: "提示",
content: "你确定要暂时关闭店铺营业?",
success: async (res) => {
if (res.confirm) {
let res = await UpdateStoreBizState(params);
if (res && res.status == 200) {
uni.showToast({
title: `关闭成功`,
icon: "error",
duration: 1000,
});
}
}
},
});
} else {
let res = await UpdateStoreBizState(params);
if (res && res.status == 200) {
uni.showToast({
title: `打开成功`,
icon: "error",
duration: 1000,
});
}
}
},
},
};
</script>
<style lang="scss">
.businessStatus-container {
.business-contetn {
margin: 40rpx 20rpx;
background: #fff;
border-radius: 12rpx;
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
.title {
padding: 20rpx 32rpx;
font-weight: bold;
}
.business-status {
.status-name {
position: relative;
&::before {
content: "";
display: block;
width: 6px;
height: 6px;
background-color: #5ac725;
position: absolute;
right: 25%;
top: 36%;
border-radius: 50%;
}
}
}
.business-box {
padding: 20rpx 32rpx;
display: flex;
justify-content: space-between;
}
}
}
</style>

View File

@ -2,7 +2,7 @@
<view class="my-container"> <view class="my-container">
<status-bar <status-bar
:backgroundColor="'#fff'" :backgroundColor="'#fff'"
:background="'linear-gradient(-90deg, #e4effe, #fff)'" :background="'linear-gradient(to left, #ff3000, #a70300)'"
v-if="true" v-if="true"
></status-bar> ></status-bar>
<view class="hander"> <view class="hander">
@ -10,7 +10,7 @@
<view class="user-img"> <view class="user-img">
<u--image <u--image
:src=" :src="
accountInfo.store_info.store_logo || '../../static/user-img.png' dashboardInfo.store_info.store_logo || '../../static/user-img.png'
" "
shape="circle" shape="circle"
width="60" width="60"
@ -20,17 +20,17 @@
<view class="user-info"> <view class="user-info">
<view class="user-name-block" @click="skipu()"> <view class="user-name-block" @click="skipu()">
<view class="user-name"> <view class="user-name">
{{ accountInfo.store_info.store_name }} {{ dashboardInfo.store_info.store_name }}
</view> </view>
<u-icon <u-icon
style="display: inline-block; margin-left: 8rpx" style="display: inline-block; margin-left: 8rpx"
name="arrow-right" name="arrow-right"
size="12" size="12"
color="#aaaaaa" color="#fff"
></u-icon> ></u-icon>
</view> </view>
<view class="user-store-name"> <view class="user-store-name">
{{ accountInfo.store_info.store_grade_name }} {{ dashboardInfo.store_info.store_grade_name }}
</view> </view>
</view> </view>
</view> </view>
@ -40,7 +40,7 @@
class="icon-shezhi" class="icon-shezhi"
custom-prefix="custom-icon-kefu custom-icon" custom-prefix="custom-icon-kefu custom-icon"
size="25" size="25"
color="#000" color="#fff"
></u-icon> ></u-icon>
<view class="icon-label">平台客服</view> <view class="icon-label">平台客服</view>
</view> </view>
@ -49,52 +49,41 @@
class="icon-shezhi" class="icon-shezhi"
custom-prefix="custom-icon-shezhi custom-icon" custom-prefix="custom-icon-shezhi custom-icon"
size="22" size="22"
color="#000" color="#fff"
></u-icon> ></u-icon>
<view class="icon-label">设置</view> <view class="icon-label">设置</view>
</view> </view>
</view> </view>
</view> <view class="shop-info">
<view class="shop-info"> <view class="shop-info-item">
<view class="shop-info-item"> <u-count-to
<u-count-to class="item-value turnover-item turnover-item-num"
class="item-value turnover-item turnover-item-num" :start-val="0"
:start-val="0" :end-val="dashboardInfo.order.yestoday_num"
:end-val="accountInfo.order.yestoday_num" color="#fff"
></u-count-to> ></u-count-to>
<view class="item-label">昨日订单数</view> <view class="item-label">昨日订单数</view>
</view> </view>
<view class="shop-info-item"> <view class="shop-info-item">
<u-count-to <u-count-to
class="item-value turnover-item turnover-item-num" class="item-value turnover-item turnover-item-num"
:start-val="0" :start-val="0"
:end-val="accountInfo.order.month_num" :end-val="dashboardInfo.order.month_num"
></u-count-to> color="#fff"
<view class="item-label">当月订单数</view> ></u-count-to>
</view> <view class="item-label">当月订单数</view>
<view class="shop-info-item"> </view>
<u-count-to <view class="shop-info-item">
class="item-value turnover-item turnover-item-num" <u-count-to
:start-val="0" class="item-value turnover-item turnover-item-num"
:end-val="accountInfo.order.pay_amount" :start-val="0"
:decimals="2" :end-val="dashboardInfo.order.pay_amount"
separator="," :decimals="2"
></u-count-to> color="#fff"
<view class="item-label">成交总金额</view> separator=","
</view> ></u-count-to>
</view> <view class="item-label">成交总金额</view>
<view class="business-contetn">
<view class="title">营业状态</view>
<view class="business-box">
<view class="business-status">
<view class="status-name">店铺正常营业中</view>
<view class="business-time">营业时间0700 - 2230</view>
</view> </view>
<u-switch
v-model="isBusiness"
activeColor="#5ac725"
inactiveColor="#f56c6c"
></u-switch>
</view> </view>
</view> </view>
<view class="fm-content"> <view class="fm-content">
@ -105,19 +94,28 @@
class="fm-icon" class="fm-icon"
custom-prefix="custom-icon-dayinji custom-icon" custom-prefix="custom-icon-dayinji custom-icon"
size="25" size="25"
color="#000" color="#e62300"
></u-icon> ></u-icon>
打印机 打印机
</view> </view>
<view class="fm-item" @click="shipuQrCode"> <view class="fm-item" @click="skipuOrCode">
<u-icon <u-icon
class="fm-icon" class="fm-icon"
custom-prefix="custom-icon-erweima custom-icon" custom-prefix="custom-icon-erweima custom-icon"
size="25" size="25"
color="#000" color="#e62300"
></u-icon> ></u-icon>
店铺二维码 店铺二维码
</view> </view>
<view class="fm-item" @click="skipuBusinessStatus">
<u-icon
class="fm-icon"
custom-prefix="custom-icon-erweima custom-icon"
size="25"
color="#e62300"
></u-icon>
营业状态
</view>
<!-- <view class="fm-item"> <!-- <view class="fm-item">
<u-icon <u-icon
class="fm-icon" class="fm-icon"
@ -145,7 +143,7 @@ export default {
data() { data() {
return { return {
isBusiness: true, isBusiness: true,
accountInfo: { dashboardInfo: {
data: {}, data: {},
notice: {}, notice: {},
order: { order: {
@ -181,7 +179,7 @@ export default {
let res = await GetAccountDashboard(); let res = await GetAccountDashboard();
if (res && res.status == 200) { if (res && res.status == 200) {
uni.setStorageSync("accountDashboard", res.data); uni.setStorageSync("accountDashboard", res.data);
this.accountInfo = res.data; this.dashboardInfo = res.data;
} }
}, },
skipu() { skipu() {
@ -199,11 +197,16 @@ export default {
url: "/pages/my/printer/printerList", url: "/pages/my/printer/printerList",
}); });
}, },
shipuQrCode() { skipuOrCode() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/my/shopQRcode/shopQRcode", url: "/pages/my/shopQRcode/shopQRcode",
}); });
}, },
skipuBusinessStatus() {
uni.navigateTo({
url: "/pages/my/businessStatus",
});
},
}, },
}; };
</script> </script>
@ -214,12 +217,27 @@ export default {
height: calc(100vh - 100rpx); height: calc(100vh - 100rpx);
.hander { .hander {
position: relative;
padding: 20rpx 30rpx 40rpx 40rpx; padding: 20rpx 30rpx 40rpx 40rpx;
padding-top: 0; padding-top: 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
background: linear-gradient(-45deg, #e4effe, #fff); height: 200rpx;
background: linear-gradient(to left, #ff3000 0%, #a70300 100%);
&::after {
position: absolute;
left: 0;
right: 0;
bottom: -200rpx;
z-index: 1;
content: " ";
height: 200rpx;
width: 100%;
border-radius: 0 0 50% 50%;
background: linear-gradient(to left, #ff3000 0%, #a70300 100%);
}
.hander-left { .hander-left {
display: flex; display: flex;
@ -234,6 +252,8 @@ export default {
} }
.user-info { .user-info {
color: #fff;
.user-name-block { .user-name-block {
display: flex; display: flex;
align-items: center; align-items: center;
@ -258,7 +278,7 @@ export default {
border-radius: 24rpx; border-radius: 24rpx;
font-size: 24rpx; font-size: 24rpx;
color: #fff; color: #fff;
background: #ccc; background: red;
} }
} }
} }
@ -268,6 +288,7 @@ export default {
font-size: 24rpx; font-size: 24rpx;
color: #000; color: #000;
text-align: center; text-align: center;
color: #fff;
.right-item { .right-item {
display: flex; display: flex;
@ -284,23 +305,30 @@ export default {
align-items: end; align-items: end;
} }
} }
}
.shop-info { .shop-info {
display: flex; position: absolute;
justify-content: space-around; left: 0;
margin: 40rpx 0; bottom: -156rpx;
font-weight: bold; width: 100%;
font-size: 28rpx; z-index: 2;
.shop-info-item {
display: flex; display: flex;
flex-flow: column; justify-content: space-around;
align-items: center; margin: 40rpx 0;
text-align: center; font-weight: bold;
font-size: 28rpx;
color: #fff;
.item-value { .shop-info-item {
margin-bottom: 20rpx; display: flex;
flex-flow: column;
align-items: center;
text-align: center;
.item-value {
margin-bottom: 20rpx;
color: #fff;
}
} }
} }
} }
@ -326,7 +354,7 @@ export default {
height: 6px; height: 6px;
background-color: #5ac725; background-color: #5ac725;
position: absolute; position: absolute;
right: 68px; right: 25%;
top: 36%; top: 36%;
border-radius: 50%; border-radius: 50%;
} }
@ -342,6 +370,7 @@ export default {
.fm-content { .fm-content {
margin: 20rpx; margin: 20rpx;
margin-top: 240rpx;
.title { .title {
padding: 20rpx 32rpx; padding: 20rpx 32rpx;
@ -362,6 +391,7 @@ export default {
text-align: center; text-align: center;
height: 80rpx; height: 80rpx;
font-size: 28rpx; font-size: 28rpx;
font-weight: bold;
.fm-icon { .fm-icon {
height: 60rpx; height: 60rpx;

View File

@ -159,15 +159,17 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "@/styles/variables.scss";
.view-container { .view-container {
padding: 40rpx; padding: 40rpx 32rpx;
height: calc(100vh - 116rpx); height: calc(100vh - 116rpx);
background: #f6f6f6; background: #fff;
.item-content { .item-content {
padding: 20rpx; padding: 20rpx;
background: #fff; background: #fff;
border-radius: 12rpx; border-radius: 12rpx;
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
.item-list { .item-list {
display: flex; display: flex;
@ -196,6 +198,7 @@ export default {
padding-left: 20rpx; /* 给条状留出空间 */ padding-left: 20rpx; /* 给条状留出空间 */
font-size: 32rpx; font-size: 32rpx;
color: #333; color: #333;
font-weight: bold;
/* 通过伪元素添加左侧条状 */ /* 通过伪元素添加左侧条状 */
&::before { &::before {
@ -206,7 +209,7 @@ export default {
transform: translateY(-50%); transform: translateY(-50%);
width: 8rpx; /* 条状宽度 */ width: 8rpx; /* 条状宽度 */
height: 32rpx; /* 条状高度 */ height: 32rpx; /* 条状高度 */
background-color: #007aff; /* 条状颜色 */ background-color: $base-color; /* 条状颜色 */
border-radius: 4rpx; /* 可选圆角 */ border-radius: 4rpx; /* 可选圆角 */
} }
} }
@ -224,6 +227,7 @@ export default {
min-width: 26%; min-width: 26%;
border-radius: 12rpx; border-radius: 12rpx;
background: #41e6f9; background: #41e6f9;
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.4);
color: #fff; color: #fff;
.order-title { .order-title {