소스 검색

style(theming): 统一应用主题色变量替换硬编码颜色

- 将多处样式中原有的硬编码绿色色值替换为 CSS 变量 var(--them-color)
- 修正线性渐变背景使用主题色变量,提升主题适配性
- 替换部分图标及组件的颜色为主题色变量,包括导航栏背景色和按钮颜色
- 注释掉部分绿色图标图片,替换为符合主题色的黑色图标
- 更新字体资源的缓存标识符,提高资源管理可靠性
- 增加跨域
zhangtao 5 일 전
부모
커밋
6495da24b1

+ 1 - 1
src/App.vue

@@ -54,7 +54,7 @@ watch(themeColor, (val) => {
 }
 
 .xsb-linear {
-  background: linear-gradient(179deg, rgba(190, 255, 13, 0.4) 0%, rgba(220, 255, 125, 0.2) 49%, rgba(158, 214, 5, 0) 100%);
+  background: linear-gradient(179deg, var(--them-color) 0%,  rgba(158, 214, 5, 0) 100%);
 }
 
 /* 隐藏滚动条安卓机会出现滚动条 */

BIN
src/iconfont/iconfont.ttf


BIN
src/iconfont/iconfont.woff


BIN
src/iconfont/iconfont.woff2


+ 4 - 4
src/iconfont/index.css

@@ -1,9 +1,9 @@
 @font-face {
   font-family: "iconfont"; /* Project id 5175205 */
-  src: url('iconfont.woff2?t=1778492797980') format('woff2'),
-       url('iconfont.woff?t=1778492797980') format('woff'),
-       url('iconfont.ttf?t=1778492797980') format('truetype'),
-       url('iconfont.svg?t=1778492797980#iconfont') format('svg');
+  src: url('iconfont.woff2?t=1778550882188') format('woff2'),
+       url('iconfont.woff?t=1778550882188') format('woff'),
+       url('iconfont.ttf?t=1778550882188') format('truetype'),
+       url('iconfont.svg?t=1778550882188#iconfont') format('svg');
 }
 
 .iconfont {

+ 2 - 1
src/pages/cart/index.vue

@@ -54,7 +54,8 @@ async function handleSelectAddress() {
           <view class="mr-20rpx text-36rpx font-semibold">
             购物车
           </view>
-          <image :src="`${StaticUrl}/location-green.png`" class="h-33.8rpx w-29rpx" />
+          <!-- <image :src="`${StaticUrl}/location-green.png`" class="h-33.8rpx w-29rpx" /> -->
+          <image :src="`${StaticUrl}/location-black.png`" class="h-33.8rpx min-w-28.97rpx w-28.97rpx" />
           <view class="ml-10rpx max-w-280rpx truncate text-32rpx text-[#222] font-semibold">
             {{ smqjhSelectedAddress?.city || '请选择地址' }}
           </view>

+ 3 - 3
src/pages/classfiy/index.vue

@@ -37,14 +37,14 @@ getCategories()
     >
       <template #left>
         <view class="ml10rpx flex items-center" @click.stop="useAddressStore().getMapAddress()">
-          <image :src="`${StaticUrl}/location-green.png`" class="h33.8rpx w29rpx" />
-          <view class="ml10rpx max-w-280rpx truncate text-32rpx text-#222 font-semibold">
+          <!-- <image :src="`${StaticUrl}/location-green.png`" class="h33.8rpx w29rpx" /> -->
+          <image :src="`${StaticUrl}/location-black.png`" class="h-33.8rpx min-w-28.97rpx w-28.97rpx" />          <view class="ml10rpx max-w-280rpx truncate text-32rpx text-#222 font-semibold">
             {{ name }}
           </view>
         </view>
       </template>
     </wd-navbar>
-    <view class="h176rpx bg-#F4FFD1" />
+    <view class="h176rpx bg-[var(--them-color)]" />
     <view class="wraper">
       <scroll-view class="w200rpx" :scroll-into-view-offset="-150" enable-passive scroll-with-animation scroll-y :scroll-into-view="`id${active}`">
         <view v-for="item in classfiylist" :id="`id${item.id}`" :key="item.id" :class="[item.id == active ? 'bg-white' : '']" class="relative h100rpx flex items-center justify-center whitespace-nowrap text-28rpx">

+ 2 - 1
src/pages/my/index.vue

@@ -49,7 +49,8 @@ function handleGo(item: { name: string, status: string }) {
     <view class="relative h-408rpx rounded-[18px]" :style="{ background: `linear-gradient( 180deg, var(--them-color) 0%, rgba(255,255,255,0) 100%)` }">
       <view class="absolute bottom-100rpx left-0 box-border w-full flex items-center justify-between pl-48rpx pr-58rpx">
         <template v-if="!token">
-          <image :src="`${StaticUrl}/9.png`" alt="" class="h-100rpx w-100rpx" />
+          <!-- <image :src="`${StaticUrl}/9.png`" alt="" class="h-100rpx w-100rpx" /> -->
+          <i class="iconfont text-100rpx text-[var(--them-color)]">&#xe652;</i>
           <view class="text-32rpx font-semibold">
             请登录后使用完整功能
           </view>

+ 2 - 2
src/subPack-film/choose-film/index.vue

@@ -510,7 +510,7 @@ onLoad((options) => {
       }
       &.active{
         .choose-item-title{
-          color: #9ED605;
+          color: var(--them-color);
         }
       }
     }
@@ -603,7 +603,7 @@ onLoad((options) => {
         }
       }
       .name.active{
-          color: #9ED605;
+          color: var(--them-color);
       }
     }
   }

+ 2 - 3
src/subPack-film/choose-seat/components/pages/canvasOperator.js

@@ -25,10 +25,9 @@ export default class CanvasOperator {
     if (typeof Image !== 'undefined') {
       img = new Image()
     }
-    // if (typeof wx !== 'undefined') {
-    //   filePath = `/${filePath}` // 微信环境下添加前缀/
-    // }
+    // #ifndef H5
     img.crossOrigin = 'anonymous'
+    // #endif
     return new Promise((resolve, reject) => {
       img.src = filePath
       img.onload = () => resolve(img)

+ 3 - 1
src/subPack-film/choose-seat/components/pages/main.js

@@ -160,7 +160,9 @@ export default class seatmap {
     const { canvasX, canvasY } = this.calc.clientToCanvas({ x, y, panX, panY })
 
     const seat = this.seatList.find((item) => {
-      const { points: { startX, startY, endX, endY } } = item
+      if (!item.points)
+        return false
+      const { startX, startY, endX, endY } = item.points
       return (canvasX >= startX && canvasX <= endX && canvasY >= startY && canvasY <= endY)
     })
     if (!seat || ![AVAILABLE, SELECTED].includes(seat[STATUS_NAME])) {

+ 1 - 0
src/subPack-film/choose-seat/index.vue

@@ -340,6 +340,7 @@ function onError(e: { message: string }): void {
  */
 function onSeatTap(event: SeatTapEvent): void {
   chooseSeatList.value = event.chooseSeatList
+  console.log('chooseSeatList', event)
   console.log('zuoshsjd', chooseSeatList.value)
   // 遍历已选座位列表,累加价格(严格类型访问)
   let price = 0

+ 1 - 1
src/subPack-film/components/choose-time.vue

@@ -56,7 +56,7 @@ function handleTab(val: string) {
           transform: translateX(-50%);
           width: 28rpx;
           height: 6rpx;
-          background: #9ED605;
+          background: var(--them-color);
           border-radius: 4rpx 4rpx 4rpx 4rpx;
         }
       }

+ 3 - 3
src/subPack-xsb/commonTab/components/classfiy.vue

@@ -401,7 +401,7 @@ export default {
 <template>
   <view class="page-xsb">
     <wd-navbar
-      title="" custom-style="background-color:#F4FFD1" :bordered="false" :z-index="9999" safe-area-inset-top
+      title="" custom-style="background-color:var(--them-color)" :bordered="false" :z-index="9999" safe-area-inset-top
       fixed
     >
       <template #left>
@@ -429,11 +429,11 @@ export default {
       </template>
     </wd-navbar>
     <view
-      class="h162rpx flex items-center justify-between bg-#F4FFD1 pl24rpx"
+      class="h162rpx flex items-center justify-between bg-[var(--them-color)] pl24rpx"
       :style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }"
     >
       <scroll-view
-        :scroll-into-view-offset="-150" scroll-x enable-passive scroll-with-animation
+        :scroll-into-view-offset="-150" enable-passive scroll-with-animation scroll-x
         class="scrollx w-90% flex-shrink-0 whitespace-nowrap" :scroll-into-view="`id${topScrollView}`"
       >
         <view class="flex items-end pb10rpx">