Compare commits
3 Commits
d602ce4d6b
...
custom/281
| Author | SHA1 | Date | |
|---|---|---|---|
| 5509ca9d09 | |||
| fe9271659b | |||
| eb3dcf05ed |
@@ -760,6 +760,7 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.complete-info-popup {
|
.complete-info-popup {
|
||||||
.complete-info-wrap {
|
.complete-info-wrap {
|
||||||
|
z-index: 2147483646;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 50rpx 40rpx 40rpx;
|
padding: 50rpx 40rpx 40rpx;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"mp-weixin": "node scripts/mp-weixin.patch.js"
|
"mp-weixin": "node scripts/mp-weixin.patch.js",
|
||||||
|
"mp-weixin:patch": "node scripts/mp-weixin.patch.js --no-zip",
|
||||||
|
"mp-weixin:dev": "node scripts/mp-weixin.patch.js --mode development",
|
||||||
|
"mp-weixin:dev:patch": "node scripts/mp-weixin.patch.js --mode development --no-zip"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"dart-sass": "^1.25.0",
|
"dart-sass": "^1.25.0",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/index/index",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom"
|
"navigationBarTitleText": "首页"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ export default {
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.setPublicShare();
|
this.setPublicShare();
|
||||||
|
// 调用API隐藏返回首页按钮
|
||||||
|
wx.hideHomeButton();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getData(mescroll) {
|
getData(mescroll) {
|
||||||
|
|||||||
@@ -91,7 +91,11 @@ export default {
|
|||||||
tourl(url) {
|
tourl(url) {
|
||||||
this.$util.redirectTo(url);
|
this.$util.redirectTo(url);
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
this.setPublicShare();
|
||||||
|
// 调用API隐藏返回首页按钮
|
||||||
|
wx.hideHomeButton();
|
||||||
|
},
|
||||||
// 退出登录
|
// 退出登录
|
||||||
logout() {
|
logout() {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
@@ -143,6 +147,7 @@ export default {
|
|||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -9,7 +9,10 @@
|
|||||||
* 如果这个文件开头已经有了这行代码,则不追加
|
* 如果这个文件开头已经有了这行代码,则不追加
|
||||||
*
|
*
|
||||||
* 使用:
|
* 使用:
|
||||||
* node fix-wechat-miniapp.js
|
* node fix-wechat-miniapp.js # 打补丁并创建 ZIP 文件(默认 mode=production)
|
||||||
|
* node fix-wechat-miniapp.js --no-zip # 只打补丁,不创建 ZIP 文件
|
||||||
|
* node fix-wechat-miniapp.js --mode development # 使用 development 模式打补丁
|
||||||
|
* node fix-wechat-miniapp.js --mode production # 使用 production 模式打补丁(默认)
|
||||||
*
|
*
|
||||||
* 注意:
|
* 注意:
|
||||||
* - 在 Windows 上路径使用反斜杠也是可以的;脚本使用 path.join 来兼容不同平台。
|
* - 在 Windows 上路径使用反斜杠也是可以的;脚本使用 path.join 来兼容不同平台。
|
||||||
@@ -29,8 +32,6 @@ async function commonPatch(mode = 'production') {
|
|||||||
// 根据当前脚本所在目录(scripts),定位到项目根目录
|
// 根据当前脚本所在目录(scripts),定位到项目根目录
|
||||||
const cwd = path.join(__dirname, '..');
|
const cwd = path.join(__dirname, '..');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const srcSitePath = path.join(cwd, 'site.js');
|
const srcSitePath = path.join(cwd, 'site.js');
|
||||||
const destDir = path.join(cwd, 'unpackage', 'dist', mode === 'production' ? 'build' : 'dev', 'mp-weixin');
|
const destDir = path.join(cwd, 'unpackage', 'dist', mode === 'production' ? 'build' : 'dev', 'mp-weixin');
|
||||||
const destSitePath = path.join(destDir, 'site.js');
|
const destSitePath = path.join(destDir, 'site.js');
|
||||||
@@ -47,6 +48,22 @@ async function commonPatch(mode = 'production') {
|
|||||||
// 确保目标目录存在
|
// 确保目标目录存在
|
||||||
await ensureDir(destDir);
|
await ensureDir(destDir);
|
||||||
|
|
||||||
|
// 复制 project.config.json 及 project.private.config.json 文件到 destDir 下面
|
||||||
|
const configFiles = ['project.config.json', 'project.private.config.json'];
|
||||||
|
for (const fileName of configFiles) {
|
||||||
|
const srcPath = path.join(cwd, fileName);
|
||||||
|
const destPath = path.join(destDir, fileName);
|
||||||
|
|
||||||
|
// 检查源文件是否存在
|
||||||
|
const fileExists = await exists(srcPath);
|
||||||
|
if (fileExists) {
|
||||||
|
await fsp.copyFile(srcPath, destPath);
|
||||||
|
console.log(`已拷贝: ${srcPath} -> ${destPath}`);
|
||||||
|
} else {
|
||||||
|
console.warn(`源文件不存在,跳过复制: ${srcPath}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 复制 site.js 到目标目录(覆盖)
|
// 复制 site.js 到目标目录(覆盖)
|
||||||
await fsp.copyFile(srcSitePath, destSitePath);
|
await fsp.copyFile(srcSitePath, destSitePath);
|
||||||
console.log(`已拷贝: ${srcSitePath} -> ${destSitePath}`);
|
console.log(`已拷贝: ${srcSitePath} -> ${destSitePath}`);
|
||||||
@@ -96,22 +113,37 @@ async function commonPatch(mode = 'production') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
// 解析命令行参数
|
||||||
|
const argv = process.argv.slice(2);
|
||||||
|
const options = {
|
||||||
|
noZip: argv.includes('--no-zip'),
|
||||||
|
mode: 'production' // 默认值
|
||||||
|
};
|
||||||
|
|
||||||
|
// 解析 --mode 参数
|
||||||
|
const modeIndex = argv.indexOf('--mode');
|
||||||
|
if (modeIndex !== -1 && modeIndex + 1 < argv.length) {
|
||||||
|
options.mode = argv[modeIndex + 1];
|
||||||
|
}
|
||||||
|
|
||||||
// 1) 打补丁
|
// 1) 打补丁
|
||||||
await commonPatch('production');
|
await commonPatch(options.mode);
|
||||||
// await commonPatch('development');
|
// await commonPatch('development');
|
||||||
|
|
||||||
// 2) 创建 ZIP 文件
|
// 2) 创建 ZIP 文件(如果未指定 --no-zip)
|
||||||
const cwd = path.join(__dirname, '..');
|
if (!options.noZip) {
|
||||||
const sourceDir = path.join(cwd, 'unpackage', 'dist', 'build', 'mp-weixin');
|
const cwd = path.join(__dirname, '..');
|
||||||
const destDir = path.join(cwd, 'unpackage', 'dist', 'build');
|
const sourceDir = path.join(cwd, 'unpackage', 'dist', 'build', 'mp-weixin');
|
||||||
const zipFilePath = await createZipWithSystemCommand(sourceDir, destDir);
|
const destDir = path.join(cwd, 'unpackage', 'dist', 'build');
|
||||||
console.log(`ZIP 文件路径: ${zipFilePath}`);
|
const zipFilePath = await createZipWithSystemCommand(sourceDir, destDir);
|
||||||
|
console.log(`ZIP 文件路径: ${zipFilePath}`);
|
||||||
|
|
||||||
// 3) 自动打开zip所在的目录
|
// 3) 自动打开zip所在的目录
|
||||||
await openFileDirectory(zipFilePath);
|
await openFileDirectory(zipFilePath);
|
||||||
|
} else {
|
||||||
|
console.log('跳过创建 ZIP 文件和打开目录');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function exists(p) {
|
async function exists(p) {
|
||||||
|
|||||||
Reference in New Issue
Block a user