Compare commits

...

3 Commits

3 changed files with 68 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
<template>
<!-- #ifdef MP-WEIXIN -->
<view class="diy-wechat-channel" :style="channelWarpCss">
<view class="channel-header" @tap="handlerClick">
<image class="channel-avatar" :src="$util.img(value.avatarUrl)" mode="aspectFill"></image>
@@ -8,8 +9,7 @@
</view>
<image class="channel-arrow" :src="$util.img('addon/personnel/shop/view/enterprise/arrow.png')" mode="aspectFill"></image>
</view>
<!-- 嵌入式视频播放 -->
<!-- #ifdef MP-WEIXIN -->
<!-- 嵌入式视频播放 -->
<native-component v-if="value.embedMode && typeof wx !== 'undefined' && wx.canIUse('component.channel-video')">
<channel-video
:feed-id="value.feedId"
@@ -17,8 +17,7 @@
:feed-token="value.feedToken"
style="width: 100%; height: 320rpx;">
</channel-video>
</native-component>
<!-- #endif -->
</native-component>
<!-- 跳转式视频播放 -->
<view v-else class="channel-video" @tap="playVideo">
<image class="video-cover" :src="$util.img(value.coverUrl)" mode="aspectFill"></image>
@@ -33,8 +32,10 @@
</view>
</view>
</view>
<!-- #endif -->
</template>
<script>
// 微信视频号组件
import DiyMinx from './minx.js'

View File

@@ -90,10 +90,7 @@
<view class="goods-tag-list" v-if="goodsSkuDetail.label_name">
<text class="tag-item">{{ goodsSkuDetail.label_name }}</text>
</view>
<view class="logistics-wrap">
<text v-if="goodsSkuDetail.stock_show">{{$lang('stock')}}: {{ goodsSkuDetail.stock +goodsSkuDetail.unit}}</text>
<text v-if="goodsSkuDetail.sale_show">{{$lang('sales')}}: {{ goodsSkuDetail.sale_num+goodsSkuDetail.unit }}</text>
</view>
<!-- 会员卡 -->
<!-- <view class="member-card-wrap" @click="$util.redirectTo('/pages_tool/member/card_buy')" v-if="membercard">
<text class="iconfont icon-huiyuan"></text>

View File

@@ -0,0 +1,62 @@
const fs = require('fs');
const path = require('path');
/**
* 递归删除空目录
* @param {string} dirPath - 要检查的目录路径
* @param {boolean} dryRun - 是否只打印不删除
*/
function removeEmptyDirectories(dirPath, dryRun = false) {
try {
// 读取目录内容
const files = fs.readdirSync(dirPath);
// 递归检查子目录
for (const file of files) {
const fullPath = path.join(dirPath, file);
const stat = fs.statSync(fullPath);
if (stat.isDirectory()) {
removeEmptyDirectories(fullPath, dryRun);
}
}
// 再次读取目录内容,因为子目录可能已经被删除
const updatedFiles = fs.readdirSync(dirPath);
// 如果目录为空
if (updatedFiles.length === 0) {
console.log(`${dryRun ? 'Would remove' : 'Removing'} empty directory: ${dirPath}`);
if (!dryRun) {
fs.rmdirSync(dirPath);
}
}
} catch (error) {
console.error(`Error processing directory ${dirPath}:`, error.message);
}
}
/**
* 主函数
*/
function main() {
// 获取项目根目录
const projectRoot = path.resolve(__dirname, '..');
console.log('Starting to remove empty directories...');
console.log(`Project root: ${projectRoot}`);
console.log('====================================');
// 执行删除操作
removeEmptyDirectories(projectRoot);
console.log('====================================');
console.log('Empty directory cleanup completed!');
}
// 运行主函数
if (require.main === module) {
main();
}
module.exports = removeEmptyDirectories;