## 删除的死代码脚本
- 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
197 lines
4.4 KiB
Vue
197 lines
4.4 KiB
Vue
<template>
|
|
<view :style="themeColor" class="nc-modify-content">
|
|
<view class="modify">
|
|
<view>
|
|
<image v-if="newImg == ''" :src="memberImg ? $util.img(memberImg) : $util.getDefaultImage().head"
|
|
@error="memberImg = $util.getDefaultImage().head" mode="aspectFill" show-menu-by-longpress/>
|
|
<image v-else :src="$util.img(newImg)" @error="newImg = $util.getDefaultImage().head"
|
|
mode="aspectFill" show-menu-by-longpress/>
|
|
</view>
|
|
</view>
|
|
<view class="opection-box">
|
|
<block v-if="newImg == ''">
|
|
<!-- #ifdef MP-ALIPAY -->
|
|
<button type="primary" @click="uploadFace()">{{ $lang("member.modify_face.l14") }}</button>
|
|
<!-- #endif -->
|
|
<!-- #ifndef MP-ALIPAY -->
|
|
<button type="primary" @click="chooseImage()">{{ $lang("member.modify_face.l14") }}</button>
|
|
<!-- #endif -->
|
|
</block>
|
|
<block v-else>
|
|
<view class="opec">
|
|
<button size="mini" class="mini" type="primary" @click="save()">{{ $lang("member.modify_face.l22") }}</button>
|
|
<button size="mini" class="mini" type="primary" @click="chooseImage()">{{ $lang("member.modify_face.l23") }}</button>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
|
|
<img-cropping selWidth="300" selHeight="300" @upload="myUpload" ref="imgCropping"></img-cropping>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import imgCropping from '../_components/img-cropping/img-cropping.vue';
|
|
|
|
export default {
|
|
components: {
|
|
imgCropping,
|
|
},
|
|
data() {
|
|
return {
|
|
memberImg: '',
|
|
newImg: '',
|
|
imgurl: ''
|
|
};
|
|
},
|
|
onShow() {
|
|
if (!this.storeToken) {
|
|
this.$util.redirectTo(
|
|
this.$util.LOGIN_PAGE_URL, {
|
|
back: '/pages_tool/member/modify_face'
|
|
},
|
|
'redirectTo'
|
|
);
|
|
return;
|
|
}
|
|
|
|
this.memberImg = this.memberInfo.headimg;
|
|
this.imgurl = this.memberInfo.headimg;
|
|
},
|
|
methods: {
|
|
chooseImage() {
|
|
this.$refs.imgCropping.fSelect();
|
|
},
|
|
//上传返回图片
|
|
myUpload(rsp) {
|
|
let app_type = 'h5';
|
|
let app_type_name = 'H5';
|
|
|
|
// #ifdef MP
|
|
app_type = 'weapp';
|
|
app_type_name = 'weapp';
|
|
// #endif
|
|
uni.request({
|
|
url: this.$config.baseUrl + '/api/upload/headimgBase64',
|
|
method: 'POST',
|
|
data: {
|
|
app_type: app_type,
|
|
app_type_name: app_type_name,
|
|
images: rsp.base64
|
|
},
|
|
header: {
|
|
'content-type': 'application/x-www-form-urlencoded;application/json'
|
|
},
|
|
dataType: 'json',
|
|
responseType: 'text',
|
|
success: res => {
|
|
if (res.data.code == 0) {
|
|
this.newImg = res.data.data.pic_path;
|
|
this.imgurl = res.data.data.pic_path;
|
|
}
|
|
},
|
|
fail: () => {
|
|
this.$util.showToast({
|
|
title: $lang('member.modify_face.l95')
|
|
});
|
|
}
|
|
});
|
|
},
|
|
previewImage() {
|
|
uni.previewImage({
|
|
current: 0,
|
|
urls: this.images
|
|
});
|
|
},
|
|
save() {
|
|
this.$api.sendRequest({
|
|
url: '/api/member/modifyheadimg',
|
|
data: {
|
|
headimg: this.imgurl
|
|
},
|
|
success: res => {
|
|
if (res.code == 0) {
|
|
this.memberInfo.headimg = this.imgurl;
|
|
this.$store.commit('setMemberInfo', this.memberInfo);
|
|
this.$util.showToast({
|
|
title: $lang('member.modify_face.l117')
|
|
});
|
|
setTimeout(() => {
|
|
this.$util.redirectTo('/pages_tool/member/info', {}, 'redirectTo');
|
|
}, 2000);
|
|
} else {
|
|
this.$util.showToast({
|
|
title: res.message
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
uploadFace() {
|
|
uni.chooseImage({
|
|
count: 1,
|
|
sizeType: ['compressed'],
|
|
success: (chooseImageRes) => {
|
|
const tempFilePaths = chooseImageRes.tempFilePaths;
|
|
this.$api.upload({
|
|
url: '/api/upload/headimg',
|
|
filePath: tempFilePaths[0],
|
|
fileType: 'image',
|
|
success: (res) => {
|
|
if (res.code) {
|
|
this.newImg = res.data.pic_path;
|
|
this.imgurl = res.data.pic_path;
|
|
}
|
|
}
|
|
})
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
page {
|
|
overflow: hidden;
|
|
}
|
|
|
|
.modify {
|
|
position: relative;
|
|
padding-top: 50rpx;
|
|
|
|
view {
|
|
width: 500rpx;
|
|
height: 500rpx;
|
|
margin: 0 auto;
|
|
overflow: hidden;
|
|
background-color: #ffffff;
|
|
border: 4rpx solid #ffffff;
|
|
border-radius: 100%;
|
|
|
|
image {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
}
|
|
|
|
.opection-box {
|
|
margin-top: 50rpx;
|
|
}
|
|
|
|
.opec {
|
|
width: 100%;
|
|
padding: 0 10%;
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
|
|
button {
|
|
padding: 0 30rpx;
|
|
height: 60rpx;
|
|
line-height: 60rpx;
|
|
border: none;
|
|
}
|
|
}
|
|
</style> |