Files
lucky_shop/components-diy/diy-store.vue
ZF sun 5f41febd70 chore(i18n): 清理死代码 + 遗留 lang 文件 + 旧工具
## 删除的死代码脚本
- scripts/i18n_class_c.py (脚本自承'新架构下永远输出 0',纯防御性)
- scripts/full_migrate_i18n.py (其产出违反 CLAUDE.md 1.2 中文 key 铁律,已标 DEPRECATED)
- scripts/__pycache__/ (Python 缓存)

## 删除的旧 per-page lang 文件
- lang/zh-cn/<page>/<file>.js (140 个)
- lang/en-us/<page>/<file>.js (139 个)
- 共 279 个文件,运行时不再加载,0 个 key 被 .vue 调用(经 diagnose_keys.py 验证)

## 删除的备份和迁移表
- lang/_backup/ (git 已跟踪原文件)
- lang/_migration_map.json / lang/_migration-map.json (运行时不用)

## 删除的中间产物 JSON
- docs/i18n-rename-*.json (smart_rename 中间产物,已用完)
- docs/i18n-ambiguous.json / i18n-audit.json / i18n-call-rewrite.log /
  i18n-clean-dead.log / i18n-file-texts.json / i18n-page-titles.json /
  i18n-vue-extract.json (前一会话残留,无引用方)
- docs/i18n-{naming,shadow,strict}-audit.json (脚本会自动重新生成)

## 删除的 modular lang 文件
- lang/zh-cn/*.js / lang/en-us/*.js (20 个模块文件,内容是上一会话产生的死代码)
- lang/zh-cn/index.js / lang/en-us/index.js (聚合入口)
- lang/DEPRECATED.md (已不再相关)

## 删除的不成熟脚本
- scripts/check_perpage.py (诊断用,已完成)
- scripts/diagnose_keys.py (诊断用,已完成)
- scripts/smart_rename_i18n.py (v1-v3 都 bug,未修完)

## 现状
- lang/ 现在只有 zh-cn.js + en-us.js (单文件,运行时实际加载)
- 这两个文件已被 smart_rename 部分修复: camelCase → snake_case (8 个 key)
- 命名违规从 8236 降到 3505 (剩余都在单文件,可独立 commit 修复)
- 1362 个 orphan () 调用仍存在,详见 docs/i18n-handoff.md
2026-06-25 10:48:15 +08:00

290 lines
6.9 KiB
Vue

<template>
<view data-component-name="diy-store" class="store-wrap">
<block v-if="value.style == 1">
<view class="store-box store-one">
<view class="store-info">
<view class="info-box" :style="{ color: value.textColor }" @tap.stop="toStoreList()">
<block v-if="globalStoreInfo && globalStoreInfo.store_id">
<text class="title">{{ globalStoreInfo.store_name }}</text>
<text>
<text class="change margin-left">{{ $lang("diy.diy-store.l10.t0") }}</text>
<text class="iconfont icon-right"></text>
</text>
</block>
<text class="title" v-else>{{ $lang("common.ns-navbar.l39.t0") }}</text>
</view>
<view class="address-wrap" :style="{ color: value.textColor }">
<text class="iconfont icon-dizhi"></text>
<text v-if="globalStoreInfo && globalStoreInfo.store_id" @tap.stop="mapRoute" class="address">{{
globalStoreInfo.show_address }}</text>
<text v-else>{{ $lang("diy.diy-store.l20.t0") }}</text>
</view>
</view>
<view class="store-image" @tap.stop="selectStore()">
<image :src="$util.img(globalStoreInfo.store_image)"
v-if="globalStoreInfo && globalStoreInfo.store_image" mode="aspectFill" show-menu-by-longpress></image>
<image :src="$util.getDefaultImage().store" v-else mode="aspectFill" show-menu-by-longpress></image>
</view>
</view>
</block>
<block v-if="value.style == 2">
<view class="store-box store-three" @tap.stop="toStoreList()">
<view class="store-info">
<view class="store-image" @tap.stop="selectStore()">
<image :src="$util.img(globalStoreInfo.store_image)"
v-if="globalStoreInfo && globalStoreInfo.store_image" mode="aspectFill" show-menu-by-longpress></image>
<image :src="$util.getDefaultImage().store" v-else mode="aspectFill" show-menu-by-longpress></image>
</view>
<view class="info-box" :style="{ color: value.textColor }">
<block v-if="globalStoreInfo && globalStoreInfo.store_id">
<text class="title">{{ globalStoreInfo.store_name }}</text>
<text>
<text class="change margin-left">{{ $lang("diy.diy-store.l10.t0") }}</text>
<text class="iconfont icon-right"></text>
</text>
</block>
<text class="title" v-else>{{ $lang("common.ns-navbar.l39.t0") }}</text>
</view>
</view>
<view class="store-icon" @tap.stop="search()"><text class="iconfont icon-sousuo3"
:style="{ color: value.textColor }"></text></view>
</view>
</block>
<block v-if="value.style == 3">
<view class="store-box store-four" @tap.stop="toStoreList()">
<view class="store-left-wrap">
<block v-if="globalStoreInfo && globalStoreInfo.store_id">
<text class="iconfont icon-weizhi" :style="{ color: value.textColor }"></text>
<text class="title" :style="{ color: value.textColor }">{{ globalStoreInfo.store_name }}</text>
<text class="iconfont icon-unfold" :style="{ color: value.textColor }"></text>
</block>
<text class="title" v-else>{{ $lang("common.ns-navbar.l39.t0") }}</text>
</view>
<view class="store-right-search">
<input type="text" class="uni-input font-size-tag" disabled placeholder=$lang("diy.diy-store.l66.t0")
@tap.stop="search()" />
<text class="iconfont icon-sousuo3" @tap.stop="search()"></text>
</view>
</view>
</block>
</view>
</template>
<script>
// 门店展示
import Map from '@/common/js/map/openMap.js';
import DiyMinx from './minx.js'
export default {
name: 'diy-store',
props: {
value: {
type: Object
}
},
mixins: [DiyMinx],
data() {
return {};
},
computed: {},
watch: {
// 组件刷新监听
componentRefresh: function (nval) { }
},
created() { },
methods: {
//跳转至门店列表
toStoreList() {
this.$util.redirectTo('/pages_tool/store/list');
},
selectStore() {
if (this.globalStoreInfo) {
this.$util.redirectTo('/pages_tool/store/detail', { store_id: this.globalStoreInfo.store_id });
}
},
search() {
this.$util.redirectTo('/pages_tool/goods/search');
},
mapRoute() {
if (!isNaN(Number(this.globalStoreInfo.latitude)) && !isNaN(Number(this.globalStoreInfo.longitude))) {
Map.openMap(Number(this.globalStoreInfo.latitude), Number(this.globalStoreInfo.longitude), this.globalStoreInfo.store_name, 'gcj02');
}
}
}
};
</script>
<style lang="scss">
.store-wrap {
.store-box {
box-sizing: border-box;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.store-info {
height: 100rpx;
display: flex;
flex: 1;
flex-direction: column;
justify-content: space-around;
margin-right: 20rpx;
.info-box {
display: flex;
align-items: flex-end;
margin-bottom: 6rpx;
text {
line-height: 1.2;
}
.title {
max-width: 480rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: $font-size-toolbar;
flex: 1;
}
.change {
font-size: $font-size-goods-tag;
}
.iconfont {
font-size: $font-size-goods-tag;
}
}
.address-wrap {
line-height: 1.2;
font-size: $font-size-goods-tag;
display: flex;
align-items: center;
.iconfont {
font-size: $font-size-goods-tag;
margin-right: 6rpx;
}
.address {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.store-image {
width: 72rpx;
height: 72rpx;
border-radius: 50%;
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
}
.store-one,
.store-three {
// padding: 0 20rpx;
}
.store-two {
.store-image {
align-self: flex-start;
margin-right: 14rpx;
}
.info-box {
margin-bottom: 0 !important;
}
.store-info {
height: 106rpx;
}
.switchover {
display: flex;
width: 120rpx;
}
}
.store-three {
.store-info {
height: auto;
justify-content: flex-start;
flex-direction: inherit;
align-items: center;
}
.info-box {
margin-left: 18rpx;
margin-bottom: 0 !important;
}
.store-icon text {
font-size: 36rpx;
color: #fff;
}
}
.store-four {
padding: 0 !important;
.store-left-wrap {
display: flex;
align-items: center;
line-height: 1;
.icon-weizhi {
margin-right: 6rpx;
font-size: 28rpx;
}
.icon-unfold {
margin-left: 6rpx;
}
.title {
display: inline-block;
max-width: 160rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.store-right-search {
width: calc(100% - 260rpx);
position: relative;
input {
width: 100%;
height: 72rpx;
line-height: 72rpx;
background-color: #ffffff;
border: none;
border-radius: 72rpx;
padding-left: 30rpx;
box-sizing: border-box;
}
.icon-sousuo3 {
position: absolute;
right: 30rpx;
top: 10rpx;
font-size: 28rpx;
color: #909399;
}
}
}
</style>