修改样式

This commit is contained in:
weiwei committed 2025-03-30 20:46:14 +08:00
1 parent 0e95a9df22
commit 0367d11e7b
3 files changed
+130 -66

No files matched your search

+102 -59
View File
@@ -1,4 +1,6 @@
<script lang="ts">
import isDevEnv from "./sheep/utils/isDevEnv"
// import { onLaunch, onShow, onHide } from "@dcloudio/uni-app"
// onLaunch(() => {})
// onShow(() => {})
@@ -11,20 +13,23 @@ const tabbar = [
text: "食堂",
iconPath: "/static/tabbar/canteen.png",
selectedIconPath: "/static/tabbar/canteen-select.png",
auth: ["zhezhengding", "shihua"],
authPath: ["pages/tabbar/canteen"],
auth: ["zhezhengding"],
},
{
pagePath: "pages/tabbar/selfMerchant",
text: "自营商家",
iconPath: "/static/tabbar/selfMerchant.png",
selectedIconPath: "/static/tabbar/selfMerchant-select.png",
auth: ["zhezhengding", "shihua"],
authPath: ["pages/tabbar/selfMerchant"],
auth: ["zhezhengding"],
},
{
pagePath: "pages/tabbar/coopMerchant",
text: "合作商家",
iconPath: "/static/tabbar/coopMerchant.png",
selectedIconPath: "/static/tabbar/coopMerchant-select.png",
authPath: ["pages/tabbar/selfMerchant"],
auth: ["zhezhengding"],
},
{
@@ -32,6 +37,7 @@ const tabbar = [
text: "订单",
iconPath: "/static/tabbar/order.png",
selectedIconPath: "/static/tabbar/order-select.png",
authPath: ["pages/tabbar/canteen", "pages/tabbar/selfMerchant"],
auth: ["zhezhengding"],
},
{
@@ -39,21 +45,24 @@ const tabbar = [
text: "流水统计",
iconPath: "/static/tabbar/order.png",
selectedIconPath: "/static/tabbar/order-select.png",
auth: ["shihua"],
authPath: [],
auth: [],
},
{
pagePath: "pages/tabbar/individualOrder",
text: "订单",
iconPath: "/static/tabbar/order.png",
selectedIconPath: "/static/tabbar/order-select.png",
auth: ["shihua"],
authPath: [],
auth: [],
},
{
pagePath: "pages/tabbar/my",
text: "我的",
iconPath: "/static/tabbar/my.png",
selectedIconPath: "/static/tabbar/my-select.png",
auth: ["zhezhengding", "shihua"],
authPath: ["pages/tabbar/canteen", "pages/tabbar/selfMerchant"],
auth: ["zhezhengding"],
},
]
@@ -64,62 +73,96 @@ export default {
methods: {
_initTabbar() {
console.log("环境判断")
const url = uni.getLaunchOptionsSync().path
console.log(uni.getLaunchOptionsSync())
if (url == "pages/tabbar/coopMerchant") {
console.log("xxx")
}
// console.log("环境判断")
// let appEnv = 1 // 1:浙政钉 2:诗画
let appEnv = 1 // 1:浙政钉 2:诗画
const launchPath = uni.getLaunchOptionsSync().path
console.log("启动路径", launchPath)
switch (appEnv) {
case 1:
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, auth }, index) => {
if (auth.includes("zhezhengding")) {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: true,
})
} else {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: false,
})
}
})
break
case 2:
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, auth }, index) => {
if (auth.includes("shihua")) {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: true,
})
} else {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: false,
})
}
})
break
if (isDevEnv()) {
switch (launchPath) {
case "pages/tabbar/canteen":
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, authPath }, index) => {
if (authPath.includes("pages/tabbar/canteen")) {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: true,
})
} else {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: false,
})
}
})
break
case "pages/tabbar/selfMerchant":
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, authPath }, index) => {
if (authPath.includes("pages/tabbar/selfMerchant")) {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: true,
})
} else {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: false,
})
}
})
break
default:
uni.hideTabBar()
// tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, authPath }, index) => {
// uni.setTabBarItem({
// index,
// pagePath,
// text,
// iconPath,
// selectedIconPath,
// visible: false,
// })
// })
break
}
} else {
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, authPath, auth }, index) => {
if (auth.includes("zhezhengding")) {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: true,
})
} else {
uni.setTabBarItem({
index,
pagePath,
text,
iconPath,
selectedIconPath,
visible: false,
})
}
})
}
},
},
+8 -5
View File
@@ -57,15 +57,18 @@ const toDetail = async (v: any) => {
router.jump("/pages/shop/detail", { id: v.id })
}
}
const swiperPic = computed(() => {
return state.detail?.swiperPic?.split(",")
})
</script>
<template>
<view class="h-full overflow-hidden">
<swiper class="w-100vw h-30vh" circular :indicator-dots="true" indicator-color="#ffffff" :autoplay="true">
<swiper
class="w-100vw h-30vh"
circular
:indicator-dots="true"
indicator-active-color="#0779FD"
indicator-color="#ffffff"
:autoplay="true"
>
<swiper-item v-for="(v, i) in state.detail?.swiperPic?.split(',')" :key="i">
<image class="w-full h-full" :src="filePath(v)" mode="aspectFill" />
</swiper-item>
+20 -2
View File
@@ -83,7 +83,12 @@
</view>
</tm-sticky-header>
<tm-alert v-if="state.detail?.discountsPrice" :showClose="false" color="#0779FD">{{ state.detail.discountsPrice }}</tm-alert>
<tm-alert v-if="state.detail?.discountsPrice" color="#0779FD" :border="['2']" :borderColor="['#89c0ff']">
<marquee class="flex items-center">{{ state.detail.discountsPrice }}</marquee>
<!-- <view class="w-full overflow-hidden flex">
<view class="scroll-text">{{ state.detail.discountsPrice }}</view>
</view> -->
</tm-alert>
<!-- start 商品 start -->
<view class="flex-row">
@@ -152,13 +157,13 @@ import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
import { router } from "@@/index"
import { foodApi, merchantApi, payApi, shopApi } from "@@/api"
import { filePath } from "@@/utils/file"
import zSwiper from "@zebra-ui/swiper/components/z-swiper/z-swiper.vue"
import zSwiperItem from "@zebra-ui/swiper/components/z-swiper-item/z-swiper-item.vue"
import ProductRow from "./components/product-row.vue"
import ProductCar from "./components/product-car.vue"
import ProductTotal from "./components/product-total.vue"
import ProductSku from "./components/product-sku.vue"
import { filePath } from "@@/utils/file"
// 商品详情相关数据
const state = reactive<any>({
@@ -479,4 +484,17 @@ const submitPay = async () => {
.car {
box-shadow: 0 8rpx 40rpx rgba(0, 0, 0, 0.1);
}
.scroll-text {
display: inline-block;
white-space: nowrap;
animation: scroll-left 10s linear infinite;
}
@keyframes scroll-left {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(-100%);
}
}
</style>