Commit 76427263 by Jaxon

style: 格式化 WXML/WXSS/JSON 文件并优化 Prettier 配置

- 添加 .json 文件到 Prettier 格式化范围
- 统一 WXML 属性换行和缩进风格
- 优化 WXSS 选择器和属性格式
- 调整 JSON 文件缩进为制表符
- 更新 Prettier 插件处理 WXML 内联表达式逻辑
- 扩展 ESLint 配置支持更多小程序文件类型
- 改进样式检查配置支持 BEM 和下划线命名
- 统一 VSCode 设置中格式化工具配置
1 parent b891c63b
Showing 43 changed files with 967 additions and 704 deletions
......@@ -9,3 +9,4 @@ uni_modules
# 只格式化 wxml
!*.wxml
!*.json
......@@ -41,10 +41,16 @@
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[css]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[wxss]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint"
},
"[scss]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
......@@ -52,9 +58,6 @@
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[json]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[markdown]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
......@@ -67,6 +70,9 @@
"[wxml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// extensions
"extensions.ignoreRecommendations": true,
......@@ -118,7 +124,7 @@
"**/yarn.lock": true
},
"typescript.tsserver.exclude": ["**/node_modules", "**/dist", "**/.turbo","**/uni_modules","**/miniprogram_npm"],
"typescript.tsserver.exclude": ["**/node_modules", "**/dist", "**/.turbo", "**/uni_modules", "**/miniprogram_npm"],
// search
"search.searchEditor.singleClickBehaviour": "peekDefinition",
......@@ -169,9 +175,11 @@
"stylelint.enable": true,
"stylelint.packageManager": "pnpm",
"stylelint.validate": ["css", "less", "postcss", "scss", "vue","wxss"],
"stylelint.customSyntax": "postcss-html",
"stylelint.snippet": ["css", "less", "postcss", "scss", "vue","wxss"],
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "wxss"],
"stylelint.snippet": ["css", "less", "postcss", "scss", "vue", "wxss"],
"stylelint.reportInvalidScopeDisables": true,
"stylelint.reportNeedlessDisables": true,
"stylelint.runtimeEnvironment": "node",
"typescript.inlayHints.enumMemberValues.enabled": true,
"typescript.preferences.preferTypeOnlyAutoImports": true,
......
.btn-add-box-popup .t {
font-size: 36rpx;
text-align: center;
height: 88rpx;
line-height: 88rpx;
font-weight: bold;
height: 88rpx;
font-size: 36rpx;
font-weight: bold;
line-height: 88rpx;
text-align: center;
}
.btn-add-box-popup .bd {
padding: 0 32rpx;
padding-bottom: 32rpx;
padding: 0 32rpx;
padding-bottom: 32rpx;
}
.btn-add-box-popup .del-btn {
margin-top: 32rpx;
margin-top: 32rpx;
}
.content {
......@@ -19,14 +21,17 @@
font-size: 32rpx;
line-height: 54rpx;
}
.link {
color: #10AEFF;
color: #10aeff;
}
.btn-group {
padding: 32rpx;
display: flex;
justify-content: space-around;
display: flex;
justify-content: space-around;
padding: 32rpx;
}
.mt32 {
margin-top: 32rpx;
}
\ No newline at end of file
}
/* pages/order-list/cps.wxss */
\ No newline at end of file
/* pages/order-list/cps.wxss */
<canvas canvas-id="bubble" style="width:{{width}}px;height:{{height}}px" class="like-fx" ></canvas>
\ No newline at end of file
<canvas canvas-id="bubble"
style="width:{{ width }}px;height:{{ height }}px"
class="like-fx"></canvas>
<view class="page-container">
<!-- 快捷功能 -->
<block wx:if="{{!id && provinces}}">
<view class="quick-action-card">
<view class="quick-action-btn" bindtap="readFromWx">
<view class="quick-icon">📍</view>
<view class="quick-text">
<view class="quick-title">一键导入</view>
<view class="quick-desc">使用微信收货地址</view>
</view>
<view class="quick-arrow">›</view>
</view>
</view>
</block>
<!-- 地址信息卡片 -->
<view class="form-card">
<view class="card-title">
<view class="title-icon">📮</view>
<text>收货地址</text>
</view>
<view class="form-section">
<picker bindchange="provinceChange" value="{{pIndex}}" range="{{provinces}}" range-key="name">
<van-cell custom-class="custom-cell" title="省份" value="{{provinces[pIndex].name}}" is-link />
</picker>
<picker wx:if="{{cities}}" bindchange="cityChange" value="{{cIndex}}" range="{{cities}}" range-key="name">
<van-cell custom-class="custom-cell" title="城市" value="{{cities[cIndex].name}}" is-link />
</picker>
<picker wx:if="{{areas}}" bindchange="areaChange" value="{{aIndex}}" range="{{areas}}" range-key="name">
<van-cell custom-class="custom-cell" title="区县" value="{{areas[aIndex].name}}" is-link />
</picker>
<picker wx:if="{{streets}}" bindchange="streetChange" value="{{sIndex}}" range="{{streets}}" range-key="name">
<van-cell custom-class="custom-cell" title="街道/镇" value="{{streets[sIndex].name}}" is-link />
</picker>
<picker wx:if="{{communities}}" bindchange="communityChange" value="{{ccIndex}}" range="{{communities}}" range-key="name">
<van-cell custom-class="custom-cell" title="社区/村委会" value="{{communities[ccIndex].name}}" is-link />
</picker>
<van-field
custom-class="custom-field"
label="详细地址"
model:value="{{ address }}"
placeholder="如街道、楼栋号、门牌号等"
input-align="right"
clearable
type="textarea"
autosize
/>
<van-cell wx:if="{{ shipping_address_gps === '1' }}" custom-class="custom-cell" title="GPS定位" value="{{ addressData.latitude ? '已定位' : '点击定位' }}" is-link bind:click="chooseLocation" />
</view>
</view>
<!-- 联系人信息卡片 -->
<view class="form-card">
<view class="card-title">
<view class="title-icon">👤</view>
<text>联系人信息</text>
</view>
<view class="form-section">
<van-field
custom-class="custom-field"
label="收货人"
model:value="{{ linkMan }}"
placeholder="请输入收货人姓名"
input-align="right"
clearable
/>
<van-field
custom-class="custom-field"
label="手机号码"
model:value="{{ mobile }}"
placeholder="请输入11位手机号"
input-align="right"
type="number"
clearable
/>
</view>
</view>
<!-- 底部操作按钮 -->
<view class="bottom-actions">
<button class="save-btn primary-btn" bindtap="bindSave">
<text class="btn-text">保存地址</text>
</button>
<button class="save-btn danger-btn" bindtap="deleteAddress" data-id="{{id}}" wx:if="{{id}}">
<text class="btn-text">删除地址</text>
</button>
</view>
<!-- 底部安全区域 -->
<view class="safe-area-bottom"></view>
<!-- 快捷功能 -->
<block wx:if="{{ !id && provinces }}">
<view class="quick-action-card">
<view class="quick-action-btn" bindtap="readFromWx">
<view class="quick-icon">📍</view>
<view class="quick-text">
<view class="quick-title">一键导入</view>
<view class="quick-desc">使用微信收货地址</view>
</view>
<view class="quick-arrow">›</view>
</view>
</view>
</block>
<!-- 地址信息卡片 -->
<view class="form-card">
<view class="card-title">
<view class="title-icon">📮</view>
<text>收货地址</text>
</view>
<view class="form-section">
<picker bindchange="provinceChange"
value="{{ pIndex }}"
range="{{ provinces }}"
range-key="name">
<van-cell custom-class="custom-cell"
title="省份"
value="{{ provinces[pIndex].name }}"
is-link />
</picker>
<picker wx:if="{{ cities }}"
bindchange="cityChange"
value="{{ cIndex }}"
range="{{ cities }}"
range-key="name">
<van-cell custom-class="custom-cell"
title="城市"
value="{{ cities[cIndex].name }}"
is-link />
</picker>
<picker wx:if="{{ areas }}"
bindchange="areaChange"
value="{{ aIndex }}"
range="{{ areas }}"
range-key="name">
<van-cell custom-class="custom-cell"
title="区县"
value="{{ areas[aIndex].name }}"
is-link />
</picker>
<picker wx:if="{{ streets }}"
bindchange="streetChange"
value="{{ sIndex }}"
range="{{ streets }}"
range-key="name">
<van-cell custom-class="custom-cell"
title="街道/镇"
value="{{ streets[sIndex].name }}"
is-link />
</picker>
<picker wx:if="{{ communities }}"
bindchange="communityChange"
value="{{ ccIndex }}"
range="{{ communities }}"
range-key="name">
<van-cell custom-class="custom-cell"
title="社区/村委会"
value="{{ communities[ccIndex].name }}"
is-link />
</picker>
<van-field custom-class="custom-field"
label="详细地址"
model:value="{{ address }}"
placeholder="如街道、楼栋号、门牌号等"
input-align="right"
clearable
type="textarea"
autosize />
<van-cell wx:if="{{ shipping_address_gps === '1' }}"
custom-class="custom-cell"
title="GPS定位"
value="{{ addressData.latitude ? '已定位' : '点击定位' }}"
is-link
bind:click="chooseLocation" />
</view>
</view>
<!-- 联系人信息卡片 -->
<view class="form-card">
<view class="card-title">
<view class="title-icon">👤</view>
<text>联系人信息</text>
</view>
<view class="form-section">
<van-field custom-class="custom-field"
label="收货人"
model:value="{{ linkMan }}"
placeholder="请输入收货人姓名"
input-align="right"
clearable />
<van-field custom-class="custom-field"
label="手机号码"
model:value="{{ mobile }}"
placeholder="请输入11位手机号"
input-align="right"
type="number"
clearable />
</view>
</view>
<!-- 底部操作按钮 -->
<view class="bottom-actions">
<button class="save-btn primary-btn" bindtap="bindSave">
<text class="btn-text">
保存地址
</text>
</button>
<button class="save-btn danger-btn"
bindtap="deleteAddress"
data-id="{{ id }}"
wx:if="{{ id }}">
<text class="btn-text">
删除地址
</text>
</button>
</view>
<!-- 底部安全区域 -->
<view class="safe-area-bottom"></view>
</view>
<import src="/template/login/index.wxml" />
<view class="asset-container">
<!-- 顶部装饰背景 -->
<view class="header-bg">
<view class="bg-circle circle-1"></view>
<view class="bg-circle circle-2"></view>
<view class="bg-circle circle-3"></view>
</view>
<!-- 资产卡片 -->
<view class="asset-card">
<view class="asset-header">
<view class="header-title">我的资产</view>
<view class="header-subtitle">Asset Overview</view>
</view>
<view class="balance-main">
<view class="balance-label">可用余额(元)</view>
<view class="balance-amount">
<text class="currency-symbol">¥</text>
<text class="amount-number">{{balance}}</text>
</view>
</view>
<view class="asset-stats">
<view class='stat-item'>
<view class="stat-value">¥{{freeze}}</view>
<view class="stat-label">冻结金额</view>
</view>
<view class="stat-divider"></view>
<view class='stat-item'>
<view class="stat-value">¥{{totleConsumed}}</view>
<view class="stat-label">累计消费</view>
</view>
</view>
</view>
<!-- 操作按钮区 -->
<view class='action-buttons'>
<button class="action-btn btn-primary" hover-class="btn-hover" bind:tap="recharge">
<view class="btn-icon">💰</view>
<view class="btn-text">充值</view>
</button>
<button class='action-btn btn-primary' hover-class="btn-hover" bind:tap="payDeposit">
<view class="btn-icon">🔒</view>
<view class="btn-text">押金</view>
</button>
<button wx:if="{{ withdrawal === '1' }}" class='action-btn btn-primary' hover-class="btn-hover" bind:tap="withdraw">
<view class="btn-icon">💸</view>
<view class="btn-text">提现</view>
</button>
</view>
<!-- 顶部装饰背景 -->
<view class="header-bg">
<view class="bg-circle circle-1">
</view>
<view class="bg-circle circle-2">
</view>
<view class="bg-circle circle-3">
</view>
</view>
<!-- 资产卡片 -->
<view class="asset-card">
<view class="asset-header">
<view class="header-title">
我的资产
</view>
<view class="header-subtitle">
Asset Overview
</view>
</view>
<view class="balance-main">
<view class="balance-label">
可用余额(元)
</view>
<view class="balance-amount">
<view class="balance-label">
可用余额(元)
</view>
<text class="currency-symbol">
¥
</text>
<text class="amount-number">
{{balance}}
</text>
</view>
</view>
<view class="asset-stats">
<view class="stat-item">
<view class="stat-value">
¥{{freeze}}
</view>
<view class="stat-label">
冻结金额
</view>
</view>
<view class="stat-divider">
</view>
<view class="stat-item">
<view class="stat-value">
¥{{totleConsumed}}
</view>
<view class="stat-label">
累计消费
</view>
</view>
</view>
</view>
<!-- 操作按钮区 -->
<view class="action-buttons">
<button class="action-btn btn-primary"
hover-class="btn-hover"
bind:tap="recharge">
<view class="btn-icon">
💰
</view>
<view class="btn-text">
充值
</view>
</button>
<button class="action-btn btn-primary"
hover-class="btn-hover"
bind:tap="payDeposit">
<view class="btn-icon">
🔒
</view>
<view class="btn-text">
押金
</view>
</button>
<button wx:if="{{ withdrawal === '1' }}"
class="action-btn btn-primary"
hover-class="btn-hover"
bind:tap="withdraw">
<view class="btn-icon">
💸
</view>
<view class="btn-text">
提现
</view>
</button>
</view>
</view>
<!-- 交易记录区域 -->
<view class="records-section">
<van-tabs active="{{ active }}" bind:change="tabClick" color="#5B7FFF" title-active-color="#5B7FFF">
<van-tab wx:for="{{tabs}}" wx:key="*this" title="{{item}}" />
</van-tabs>
<view class="filter-section" wx:if="{{activeIndex === 0}}">
<picker mode="date" value="{{ dateAddBegin }}" bindchange="dateAddBeginChange">
<van-cell title="交易开始日期" value="{{ dateAddBegin ? dateAddBegin : '请选择' }}" is-link border="{{false}}" />
</picker>
<picker mode="date" value="{{ dateAddEnd }}" bindchange="dateAddEndChange">
<van-cell title="交易结束日期" value="{{ dateAddEnd ? dateAddEnd : '请选择' }}" is-link border="{{false}}" />
</picker>
</view>
<view class="list-container">
<van-cell-group wx:if="{{activeIndex === 0}}" border="{{false}}">
<van-empty wx:if="{{!cashlogs}}" description="暂无资金明细" />
<van-cell wx:for="{{cashlogs}}" wx:key="index" title="{{ item.typeStr }}" label="{{ item.dateAdd }}" value="{{ item.amount }}" border="{{false}}" />
</van-cell-group>
<van-cell-group wx:if="{{activeIndex === 1}}" border="{{false}}">
<van-empty wx:if="{{!withDrawlogs}}" description="暂无提现记录" />
<van-cell wx:for="{{withDrawlogs}}" wx:key="index" title="{{ item.statusStr }}" label="{{ item.dateAdd }}{{ item.rejectionReason ? ' 驳回原因:' + item.rejectionReason : '' }}" border="{{false}}">
<view slot="">
<view class="price"><text>¥</text>{{ item.money }}</view>
<view wx:if="{{ item.status === 3 && item.packageInfo }}">
<van-button type="primary" size="mini" bind:click="confirmTX" data-item="{{ item }}" color="#5B7FFF">确认收款</van-button>
</view>
</view>
</van-cell>
</van-cell-group>
<van-cell-group wx:if="{{activeIndex === 2}}" border="{{false}}">
<van-empty wx:if="{{!depositlogs}}" description="暂无押金记录" />
<van-cell wx:for="{{depositlogs}}" wx:key="index" title="{{ item.statusStr }}" label="{{ item.dateAdd }}" border="{{false}}">
<view slot="">
<view class="price"><text>¥</text>{{ item.amount }}</view>
<view wx:if="{{ item.status === -1 }}">
<van-button type="primary" size="mini" color="#5B7FFF" data-item="{{ item }}" bind:click="payStatusDepositV2">支付押金</van-button>
</view>
<view wx:if="{{ item.status === 1 }}">
<van-button type="primary" size="mini" color="#5B7FFF" data-item="{{ item }}" bind:click="depositBackApplyV2">申请退回</van-button>
</view>
</view>
</van-cell>
</van-cell-group>
</view>
<van-tabs active="{{ active }}"
bind:change="tabClick"
color="#5B7FFF"
title-active-color="#5B7FFF">
<van-tab wx:for="{{tabs}}"
wx:key="*this"
title="{{item}}" />
</van-tabs>
<view class="filter-section" wx:if="{{activeIndex === 0}}">
<picker mode="date"
value="{{ dateAddBegin }}"
bindchange="dateAddBeginChange">
<van-cell title="交易开始日期"
value="{{ dateAddBegin ? dateAddBegin : '请选择' }}"
is-link
border="{{false}}" />
</picker>
<picker mode="date"
value="{{ dateAddEnd }}"
bindchange="dateAddEndChange">
<van-cell title="交易结束日期"
value="{{ dateAddEnd ? dateAddEnd : '请选择' }}"
is-link
border="{{false}}" />
</picker>
</view>
<view class="list-container">
<van-cell-group wx:if="{{activeIndex === 0}}" border="{{false}}">
<van-empty wx:if="{{!cashlogs}}" description="暂无资金明细" />
<van-cell wx:for="{{cashlogs}}"
wx:key="index"
title="{{ item.typeStr }}"
label="{{ item.dateAdd }}"
value="{{ item.amount }}"
border="{{false}}" />
</van-cell-group>
<van-cell-group wx:if="{{activeIndex === 1}}" border="{{false}}">
<van-empty wx:if="{{!withDrawlogs}}" description="暂无提现记录" />
<van-cell wx:for="{{withDrawlogs}}"
wx:key="index"
title="{{ item.statusStr }}"
label="{{ item.dateAdd }}{{ item.rejectionReason ? ' 驳回原因:' + item.rejectionReason : '' }}"
border="{{false}}">
<view slot="">
<view class="price">
<text>¥</text>
{{ item.money }}
</view>
<view wx:if="{{ item.status === 3 && item.packageInfo }}">
<van-button type="primary"
size="mini"
bind:click="confirmTX"
data-item="{{ item }}"
color="#5B7FFF">
确认收款
</van-button>
</view>
</view>
</van-cell>
</van-cell-group>
<van-cell-group wx:if="{{activeIndex === 2}}" border="{{false}}">
<van-empty wx:if="{{!depositlogs}}" description="暂无押金记录" />
<van-cell wx:for="{{depositlogs}}"
wx:key="index"
title="{{ item.statusStr }}"
label="{{ item.dateAdd }}"
border="{{false}}">
<view slot="">
<view class="price">
<text>¥</text>
{{ item.amount }}
</view>
<view wx:if="{{ item.status === -1 }}">
<van-button type="primary"
size="mini"
color="#5B7FFF"
data-item="{{ item }}"
bind:click="payStatusDepositV2">
支付押金
</van-button>
</view>
<view wx:if="{{ item.status === 1 }}">
<van-button type="primary"
size="mini"
color="#5B7FFF"
data-item="{{ item }}"
bind:click="depositBackApplyV2">
申请退回
</van-button>
</view>
</view>
</van-cell>
</van-cell-group>
</view>
</view>
<van-empty wx:if="{{!cmsArticles}}" description="暂无记录" />
<van-cell wx:for="{{cmsArticles}}" wx:key="id" title="{{item.title}}" is-link url="/pages/help/detail?id={{item.id}}" />
\ No newline at end of file
<van-empty wx:if="{{ !cmsArticles }}" description="暂无记录" />
<van-cell wx:for="{{ cmsArticles }}"
wx:key="id"
title="{{ item.title }}"
is-link
url="/pages/help/detail?id={{ item.id }}"></van-cell>
/* pages/cms/list.wxss */
\ No newline at end of file
/* pages/cms/list.wxss */
/* pages/coupons/merge.wxss */
\ No newline at end of file
/* pages/coupons/merge.wxss */
/* pages/goods-details/day.wxss */
\ No newline at end of file
/* pages/goods-details/day.wxss */
/* pages/goods-details/times01.wxss */
\ No newline at end of file
/* pages/goods-details/times01.wxss */
/* pages/goods-details/times02.wxss */
\ No newline at end of file
/* pages/goods-details/times02.wxss */
<view class="live-page">
<block wx:if="{{aliveRooms}}">
<view class="live-container">
<view class="live-card" wx:for="{{aliveRooms}}" wx:key="id" bindtap="goLiveRoom" data-id="{{item.roomid}}" data-status="{{item.live_status}}">
<!-- 直播封面 -->
<view class="live-cover">
<image src="{{item.share_img}}" class="cover-image" mode="aspectFill" lazy-load="true" />
<!-- 直播状态标签 -->
<view class="status-badge status-{{item.live_status}}">
<block wx:if="{{item.live_status === 101}}">
<view class="status-dot"></view>
<text class="status-text">正在直播</text>
</block>
<block wx:elif="{{item.live_status === 102}}">
<text class="status-text">即将开播</text>
</block>
<block wx:elif="{{item.live_status === 103}}">
<text class="status-text">已结束</text>
</block>
<block wx:else>
<text class="status-text">已过期</text>
</block>
</view>
<!-- 渐变遮罩 -->
<view class="cover-mask"></view>
</view>
<!-- 直播信息 -->
<view class="live-info">
<view class="live-title">{{item.name}}</view>
<view class="live-meta">
<view class="meta-item">
<van-icon size="28rpx" name="manager-o" color="#666" />
<text class="meta-text">{{item.anchor_name}}</text>
</view>
<view class="meta-item">
<van-icon size="28rpx" name="clock-o" color="#666" />
<text class="meta-text">{{item.start_time_str}}</text>
</view>
</view>
<!-- 操作按钮 -->
<view class="live-action">
<view wx:if="{{item.live_status === 107 || item.live_status === 106 || item.live_status === 104}}" class="action-btn btn-disabled">
<text>已过期</text>
</view>
<view wx:elif="{{item.live_status === 102}}" class="action-btn btn-upcoming">
<van-icon size="28rpx" name="bell" />
<text>预约提醒</text>
</view>
<view wx:elif="{{item.live_status === 103}}" class="action-btn btn-ended">
<van-icon size="28rpx" name="replay" />
<text>查看回放</text>
</view>
<view wx:else class="action-btn btn-live">
<view class="live-pulse"></view>
<text>进入直播间</text>
</view>
</view>
</view>
</view>
</view>
</block>
<!-- 空状态 -->
<block wx:else>
<view class="empty-state">
<!-- 高版本系统:emoji -->
<text wx:if="{{useFingerprintEmoji}}"
class="empty-emoji">🫆</text>
<!-- 低版本或未知系统:原图 -->
<image wx:else
class="empty-image"
src="/images/zw.png"
mode="aspectFit" />
<text class="empty-text">暂无直播内容</text>
</view>
</block>
<block wx:if="{{ aliveRooms }}">
<view class="live-container">
<view class="live-card"
wx:for="{{ aliveRooms }}"
wx:key="id"
bindtap="goLiveRoom"
data-id="{{ item.roomid }}"
data-status="{{ item.live_status }}">
<!-- 直播封面 -->
<view class="live-cover">
<image src="{{ item.share_img }}"
class="cover-image"
mode="aspectFill"
lazy-load="true" />
<!-- 直播状态标签 -->
<view class="status-badge status-{{ item.live_status }}">
<block wx:if="{{ item.live_status === 101 }}">
<view class="status-dot"></view>
<text class="status-text">
正在直播
</text>
</block>
<block wx:elif="{{ item.live_status === 102 }}">
<text class="status-text">
即将开播
</text>
</block>
<block wx:elif="{{ item.live_status === 103 }}">
<text class="status-text">
已结束
</text>
</block>
<block wx:else>
<text class="status-text">
已过期
</text>
</block>
</view>
<!-- 渐变遮罩 -->
<view class="cover-mask"></view>
</view>
<!-- 直播信息 -->
<view class="live-info">
<view class="live-title">{{ item.name }}</view>
<view class="live-meta">
<view class="meta-item">
<van-icon size="28rpx"
name="manager-o"
color="#666" />
<text class="meta-text">
{{ item.anchor_name }}
</text>
</view>
<view class="meta-item">
<van-icon size="28rpx"
name="clock-o"
color="#666" />
<text class="meta-text">
{{ item.start_time_str }}
</text>
</view>
</view>
<!-- 操作按钮 -->
<view class="live-action">
<view wx:if="{{ item.live_status === 107 || item.live_status === 106 || item.live_status === 104 }}"
class="action-btn btn-disabled">
<text>已过期</text>
</view>
<view wx:elif="{{ item.live_status === 102 }}" class="action-btn btn-upcoming">
<van-icon size="28rpx" name="bell" />
<text>预约提醒</text>
</view>
<view wx:elif="{{ item.live_status === 103 }}" class="action-btn btn-ended">
<van-icon size="28rpx" name="replay" />
<text>查看回放</text>
</view>
<view wx:else class="action-btn btn-live">
<view class="live-pulse"></view>
<text>进入直播间</text>
</view>
</view>
</view>
</view>
</view>
</block>
<!-- 空状态 -->
<block wx:else>
<view class="empty-state">
<!-- 高版本系统:emoji -->
<text wx:if="{{ useFingerprintEmoji }}" class="empty-emoji">
🫆
</text>
<!-- 低版本或未知系统:原图 -->
<image wx:else
class="empty-image"
src="/images/zw.png"
mode="aspectFit" />
<text class="empty-text">
暂无直播内容
</text>
</view>
</block>
</view>
<van-tabs active="{{ active }}" bind:change="tabClick">
<van-tab wx:for="{{ tabs }}" wx:key="*this" title="{{ item }}"></van-tab>
<van-tab wx:for="{{ tabs }}"
wx:key="*this"
title="{{ item }}"></van-tab>
</van-tabs>
<van-empty wx:if="{{ !list }}" description="暂无统计" />
<van-cell wx:for="{{ list }}" wx:key="*this" title="{{ item.day }}" value="共 {{ item.orders }} 单" label="累计销售额 ¥{{ item.amountOrders }}" />
\ No newline at end of file
<van-cell wx:for="{{ list }}"
wx:key="*this"
title="{{ item.day }}"
value="共 {{ item.orders }} 单"
label="累计销售额 ¥{{ item.amountOrders }}"></van-cell>
/* pages/test/wifi.wxss */
\ No newline at end of file
/* pages/test/wifi.wxss */
<!-- pages/goods_detail/index.wxml -->
<import src="../../wxParse/wxParse.wxml" />
<view class="detail_swiper">
<swiper indicator-dots="{{true}}"
autoplay="{{true}}"
circular="{{true}}">
<swiper-item wx:for="{{goodsObj.pics}}"
<swiper indicator-dots="{{ true }}"
autoplay="{{ true }}"
circular="{{ true }}">
<swiper-item wx:for="{{ goodsObj.pics }}"
wx:key="id"
bindtap="handlePrevewImage"
data-url="{{item.pic}}">
<image src="{{item.pic}}" mode="widthFix">
</image>
data-url="{{ item.pic }}">
<image src="{{ item.pic }}" mode="widthFix"></image>
</swiper-item>
</swiper>
</view>
<view class="goods_price">
¥{{goodsObj.goods_price}}
¥{{ goodsObj.goods_price }}
</view>
<view class="goods_name_row">
<view class="goods_name">
{{goodsObj.goods_name}}
{{ goodsObj.goods_name }}
</view>
<view class="goods_collect" bindtap="handleCollect">
<text class="iconfont {{isCollect?'icon-shoucang1':'icon-shoucang'}}">
<text class="iconfont {{ isCollect?'icon-shoucang1':'icon-shoucang' }}">
</text>
<view class="collect_text">
收藏
......@@ -36,29 +36,24 @@
<!-- 富文本 -->
<!-- {{goodsObj.goods_introduce}} -->
<!-- <rich-text is="wxParse" nodes="{{goodsObj.goods_introduce}}"></rich-text> -->
<template is="wxParse" data="{{wxParseData:article.nodes}}" />
<template is="wxParse" data="{{ wxParseData:article.nodes }}" />
</view>
</view>
<view class="btm_tool">
<view class="tool_item">
<view class="iconfont icon-kefu1">
</view>
<view class="iconfont icon-kefu1"></view>
<view>客服</view>
<button open-type="contact">
</button>
<button open-type="contact"></button>
</view>
<view class="tool_item">
<view class="iconfont icon-fenxiang">
</view>
<view class="iconfont icon-fenxiang"></view>
<view>分享</view>
<button open-type="share">
</button>
<button open-type="share"></button>
</view>
<navigator open-type="switchTab"
url="/pages/cart/index"
class="tool_item">
<view class="iconfont .icon-shopcart">
</view>
<view class="iconfont .icon-shopcart"></view>
<view>购物车</view>
</navigator>
<view class="tool_item btn_cart " bindtap="handleCartAdd">
......
{
"usingComponents": {},
"navigationBarTitleText": "商品支付"
}
\ No newline at end of file
"usingComponents": {},
"navigationBarTitleText": "商品支付"
}
<!-- 购物车内容 -->
<view class="cart_content">
<!-- <view class="cart_title">商品列表</view> -->
<view class="cart_main">
<view class="cart_item" wx:for="{{cart}}" wx:key="goods_id">
<!-- 商品图片 -->
<navigator class="cart_img_wrap">
<image mode="widthFix" src="{{item.basicInfo.pic}}"></image>
</navigator>
<!-- 商品信息 -->
<view class="cart_info_wrap">
<view class="goods_name">{{item.basicInfo.name}}</view>
<view class="goods_price_wrap">
<view class="goods_price">¥{{item.basicInfo.minPrice}}</view>
<view class="cart_num_tool" wx:if="{{item.num}}">
<view class="goods_num">X {{item.num}}</view>
</view>
</view>
</view>
</view>
</view>
<!-- <view class="cart_title">商品列表</view> -->
<view class="cart_main">
<view class="cart_item"
wx:for="{{cart}}"
wx:key="goods_id">
<!-- 商品图片 -->
<navigator class="cart_img_wrap">
<image mode="widthFix" src="{{item.basicInfo.pic}}">
</image>
</navigator>
<!-- 商品信息 -->
<view class="cart_info_wrap">
<view class="goods_name">
{{item.basicInfo.name}}
</view>
<view class="goods_price_wrap">
<view class="goods_price">
¥{{item.basicInfo.minPrice}}
</view>
<view class="cart_num_tool" wx:if="{{item.num}}">
<view class="goods_num">
X {{item.num}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="peisong-way">
<view class="address-box">
<view class="add-address" hidden="{{curAddressData}}">
<view class="title" bindtap="addAddress">新增收货地址</view>
</view>
<view class="show-address" hidden="{{!curAddressData}}" bindtap="selectAddress">
<view class="name-tel">{{curAddressData.linkMan}} {{curAddressData.mobile}}</view>
<view class="addr-text">{{curAddressData.address}}</view>
</view>
</view>
<view class="address-box">
<view class="add-address" hidden="{{curAddressData}}">
<view class="title" bindtap="addAddress">
新增收货地址
</view>
</view>
<view class="show-address"
hidden="{{!curAddressData}}"
bindtap="selectAddress">
<view class="name-tel">
{{curAddressData.linkMan}} {{curAddressData.mobile}}
</view>
<view class="addr-text">
{{curAddressData.address}}
</view>
</view>
</view>
</view>
<!-- 底部工具栏 -->
<view class="footer_tool">
<!-- 总价格 -->
<view class="total_price_wrap">
<view class="total_price">
合计:
<text class="total_price_text">¥{{totalPrice}}</text>
</view>
<view>包含运费</view>
</view>
<view class="order_pay_wrap" bindtap="handleOrderPay">支付({{totalNum}})</view>
</view>
\ No newline at end of file
<!-- 总价格 -->
<view class="total_price_wrap">
<view class="total_price">
合计:
<text class="total_price_text">
¥{{totalPrice}}
</text>
</view>
<view>包含运费</view>
</view>
<view class="order_pay_wrap" bindtap="handleOrderPay">
支付({{totalNum}})
</view>
</view>
......@@ -2,168 +2,176 @@
@import "/template/login/index.wxss";
page {
padding-bottom: 90rpx;
padding-bottom: 90rpx;
}
.revice_address_row .user_info_row {
display: flex;
padding: 20rpx;
display: flex;
padding: 20rpx;
}
.revice_address_row .user_info_row .user_info {
flex: 5;
flex: 5;
}
.revice_address_row .user_info_row .user_phone {
flex: 3;
text-align: right;
position: relative;
display: flex;
flex: 3;
width: 30px;
height: 1000%;
height: 30px;
text-align: right;
}
.cart_content .cart_title {
padding: 20rpx;
font-size: 36rpx;
color: var(--themeColor);
border-top: 1rpx solid currentColor;
border-bottom: 1rpx solid currentColor;
padding: 20rpx;
font-size: 36rpx;
color: var(--themeColor);
border-top: 1rpx solid currentcolor;
border-bottom: 1rpx solid currentcolor;
}
.cart_content .cart_main .cart_item {
display: flex;
padding: 10rpx;
border-bottom: 1rpx solid #ccc;
display: flex;
padding: 10rpx;
border-bottom: 1rpx solid #ccc;
}
.cart_content .cart_main .cart_item .cart_img_wrap {
flex: 2;
display: flex;
justify-content: center;
align-items: center;
display: flex;
flex: 2;
align-items: center;
justify-content: center;
}
.cart_content .cart_main .cart_item .cart_img_wrap image {
width: 80%;
width: 80%;
}
.cart_content .cart_main .cart_item .cart_info_wrap {
flex: 4;
display: flex;
flex-direction: column;
justify-content: space-around;
display: flex;
flex: 4;
flex-direction: column;
justify-content: space-around;
}
.cart_content .cart_main .cart_item .cart_info_wrap .goods_name {
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
color: #666;
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
color: #666;
}
.cart_content .cart_main .cart_item .cart_info_wrap .goods_price_wrap {
display: flex;
justify-content: space-between;
display: flex;
justify-content: space-between;
}
.cart_content .cart_main .cart_item .cart_info_wrap .goods_price_wrap .goods_price {
color: var(--themeColor);
font-size: 34rpx;
font-size: 34rpx;
color: var(--themeColor);
}
.cart_content .cart_main .cart_item .cart_info_wrap .goods_price_wrap .cart_num_tool {
display: flex;
display: flex;
}
.cart_content .cart_main .cart_item .cart_info_wrap .goods_price_wrap .cart_num_tool .goods_num {
width: 55rpx;
height: 55rpx;
display: flex;
justify-content: center;
align-items: center;
display: flex;
align-items: center;
justify-content: center;
width: 55rpx;
height: 55rpx;
}
.footer_tool {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 90rpx;
background-color: #fff;
display: flex;
border-top: 1rpx solid #ccc;
position: fixed;
bottom: 0;
left: 0;
display: flex;
width: 100%;
height: 90rpx;
background-color: #fff;
border-top: 1rpx solid #ccc;
}
.footer_tool .total_price_wrap {
flex: 5;
padding-right: 15rpx;
text-align: right;
flex: 5;
padding-right: 15rpx;
text-align: right;
}
.footer_tool .total_price_wrap .total_price .total_price_text {
color: var(--themeColor);
font-size: 34rpx;
font-weight: 600;
font-size: 34rpx;
font-weight: 600;
color: var(--themeColor);
}
.footer_tool .order_pay_wrap {
flex: 3;
background-color: #1CD8D2;
color: #fff;
font-size: 32rpx;
font-weight: 600;
display: flex;
justify-content: center;
align-items: center;
display: flex;
flex: 3;
align-items: center;
justify-content: center;
font-size: 32rpx;
font-weight: 600;
color: #fff;
background-color: #1cd8d2;
}
.peisong-way {
width: 100%;
background-color: #fff;
margin-bottom: 20rpx;
width: 100%;
margin-bottom: 20rpx;
background-color: #fff;
}
.address-box {
width: 100%;
background: url(https://cdn.it120.cc/images/weappshop/arrow-right.png) no-repeat 705rpx center,
url(https://cdn.it120.cc/images/weappshop/addr-line.png) no-repeat center bottom;
background-size: 16rpx auto, 750rpx auto;
background-color: #fff;
margin: 20rpx 0;
width: 100%;
margin: 20rpx 0;
background:
url("https://cdn.it120.cc/images/weappshop/arrow-right.png") no-repeat 705rpx center,
url("https://cdn.it120.cc/images/weappshop/addr-line.png") no-repeat center bottom;
background-color: #fff;
background-size:
16rpx auto,
750rpx auto;
}
.add-addres {
width: 100%;
width: 100%;
}
.add-address .title {
font-size: 28rpx;
color: #000;
margin-left: 30rpx;
background: url(https://cdn.it120.cc/images/weappshop/ico-add-addr.png) no-repeat left center;
background-size: 60rpx auto;
padding: 40rpx 0 40rpx 90rpx;
padding: 40rpx 0 40rpx 90rpx;
margin-left: 30rpx;
font-size: 28rpx;
color: #000;
background: url("https://cdn.it120.cc/images/weappshop/ico-add-addr.png") no-repeat left center;
background-size: 60rpx auto;
}
.show-address {
width: 664rpx;
box-sizing: border-box;
padding-left: 100rpx;
background: url(https://cdn.it120.cc/images/weappshop/ico-addr.png) no-repeat 30rpx 35rpx;
background-size: 30rpx auto;
box-sizing: border-box;
width: 664rpx;
padding-left: 100rpx;
background: url("https://cdn.it120.cc/images/weappshop/ico-addr.png") no-repeat 30rpx 35rpx;
background-size: 30rpx auto;
}
.show-address .name-tel {
font-size: 28rpx;
color: #000;
padding: 30rpx 0 20rpx 0;
padding: 30rpx 0 20rpx;
font-size: 28rpx;
color: #000;
}
.show-address .addr-text {
font-size: 24rpx;
color: #888;
padding-bottom: 34rpx;
line-height: 36rpx;
padding-bottom: 34rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #888;
}
form {
width: 100%;
}
\ No newline at end of file
width: 100%;
}
<!-- pages/user/index.wxml -->
<import src="/template/login/index.wxml" />
<view class="user_info_wrap">
<view wx:if="{{userinfo.avatarUrl}}" class="user_img_wrap">
<image class="user_bg" src="{{userinfo.avatarUrl}}"></image>
<view class="user_info">
<image class="user_icon" src="{{userinfo.avatarUrl}}"></image>
<view class="user_name">{{userinfo.nickName}}</view>
</view>
</view>
<view wx:else class="user_btn">
<image class="nologin" mode="widthFix" src="../../images/nologin.png"></image>
<view bindtap="login">点击登录账户</view>
</view>
<view wx:if="{{userinfo.avatarUrl}}" class="user_img_wrap">
<image class="user_bg" src="{{userinfo.avatarUrl}}"></image>
<view class="user_info">
<image class="user_icon" src="{{userinfo.avatarUrl}}"></image>
<view class="user_name">
{{userinfo.nickName}}
</view>
</view>
</view>
<view wx:else class="user_btn">
<image class="nologin"
mode="widthFix"
src="../../images/nologin.png"></image>
<view bindtap="login">
点击登录账户
</view>
</view>
</view>
<view class="user_content">
<view class="user_main">
<!-- 历史足迹 -->
<view class="history_wrap">
<navigator>
<view class="his_num">0</view>
<view class="his_name">收藏的店铺</view>
</navigator>
<navigator url="/pages/collect/index">
<view class="his_num">{{collectNums}}</view>
<view class="his_name">收藏的商品</view>
</navigator>
<navigator>
<view class="his_num">0</view>
<view class="his_name">关注的商品</view>
</navigator>
<navigator>
<view class="his_num">0</view>
<view class="his_name">我的足迹</view>
</navigator>
</view>
<!-- 我的订单 -->
<view class="orders_wrap">
<view class="orders_title">我的订单</view>
<view class="order_content">
<navigator url="/pages/order/index?type=0">
<view class="iconfont icon-daifukuan"></view>
<view class="order_name">待付款</view>
</navigator>
<navigator url="/pages/order/index?type=1">
<view class="iconfont icon-daifahuo"></view>
<view class="order_name">待发货</view>
</navigator>
<navigator url="/pages/order/index?type=2">
<view class="iconfont icon-ziyuan"></view>
<view class="order_name">待收货</view>
</navigator>
<navigator url="/pages/order/index?type=3">
<view class="iconfont icon-daipingjia"></view>
<view class="order_name">待评价</view>
</navigator>
<navigator url="/pages/order/index?type=4">
<view class="iconfont icon-yiwancheng"></view>
<view class="order_name">已完成</view>
</navigator>
</view>
</view>
<!-- 收货地址管理 -->
<navigator url="/pages/select-address/index" class="address_wrap">收货地址管理</navigator>
<!-- 应用信息相关 -->
<view class="app_info_wrap">
<view class="app_info_item app_info_contact">
<text>联系客服</text>
<text>13944362281</text>
</view>
<navigator url="/pages/feedback/index" class="app_info_item">意见反馈</navigator>
<view class="app_info_item">关于我们</view>
</view>
<!-- 推荐 -->
<view class="recommend_wrap">把应用推荐给其他人</view>
</view>
<view class="user_main">
<!-- 历史足迹 -->
<view class="history_wrap">
<navigator>
<view class="his_num">
0
</view>
<view class="his_name">
收藏的店铺
</view>
</navigator>
<navigator url="/pages/collect/index">
<view class="his_num">
{{collectNums}}
</view>
<view class="his_name">
收藏的商品
</view>
</navigator>
<navigator>
<view class="his_num">
0
</view>
<view class="his_name">
关注的商品
</view>
</navigator>
<navigator>
<view class="his_num">
0
</view>
<view class="his_name">
我的足迹
</view>
</navigator>
</view>
<!-- 我的订单 -->
<view class="orders_wrap">
<view class="orders_title">
我的订单
</view>
<view class="order_content">
<navigator url="/pages/order/index?type=0">
<view class="iconfont icon-daifukuan"></view>
<view class="order_name">
待付款
</view>
</navigator>
<navigator url="/pages/order/index?type=1">
<view class="iconfont icon-daifahuo"></view>
<view class="order_name">
待发货
</view>
</navigator>
<navigator url="/pages/order/index?type=2">
<view class="iconfont icon-ziyuan"></view>
<view class="order_name">
待收货
</view>
</navigator>
<navigator url="/pages/order/index?type=3">
<view class="iconfont icon-daipingjia"></view>
<view class="order_name">
待评价
</view>
</navigator>
<navigator url="/pages/order/index?type=4">
<view class="iconfont icon-yiwancheng"></view>
<view class="order_name">
已完成
</view>
</navigator>
</view>
</view>
<!-- 收货地址管理 -->
<navigator url="/pages/select-address/index" class="address_wrap">
收货地址管理
</navigator>
<!-- 应用信息相关 -->
<view class="app_info_wrap">
<view class="app_info_item app_info_contact">
<text>联系客服</text>
<text>13944362281</text>
</view>
<navigator url="/pages/feedback/index" class="app_info_item">
意见反馈
</navigator>
<view class="app_info_item">
关于我们
</view>
</view>
<!-- 推荐 -->
<view class="recommend_wrap">
把应用推荐给其他人
</view>
</view>
</view>
<template is="apifmLogin" data="{{wxlogin: wxlogin}}" />
\ No newline at end of file
<template is="apifmLogin" data="{{wxlogin: wxlogin}}" />
......@@ -2,143 +2,144 @@
@import "/template/login/index.wxss";
page {
background-color: #edece8;
background-color: #edece8;
}
.user_info_wrap {
height: 45vh;
overflow: hidden;
background-color: #1CD8D2;
/* background: linear-gradient(-90deg, rgba(252, 88, 89, 1) 0%, rgba(255, 167, 124, 1) 100%) no-repeat; */
position: relative;
/* background: linear-gradient(-90deg, rgba(252, 88, 89, 1) 0%, rgba(255, 167, 124, 1) 100%) no-repeat; */
position: relative;
height: 45vh;
overflow: hidden;
background-color: #1cd8d2;
}
.nologin {
width: 120rpx;
margin: 0 auto;
width: 120rpx;
margin: 0 auto;
}
.user_info_wrap .user_img_wrap {
position: relative;
position: relative;
}
.user_info_wrap .user_img_wrap .user_bg {
height: 50vh;
filter: blur(10rpx);
height: 50vh;
filter: blur(10rpx);
}
.user_info_wrap .user_img_wrap .user_info {
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 20%;
text-align: center;
position: absolute;
top: 20%;
left: 50%;
text-align: center;
transform: translateX(-50%);
}
.user_info_wrap .user_img_wrap .user_info .user_icon {
width: 150rpx;
height: 150rpx;
border-radius: 50%;
width: 150rpx;
height: 150rpx;
border-radius: 50%;
}
.user_info_wrap .user_img_wrap .user_info .user_name {
color: #fff;
margin-top: 40rpx;
margin-top: 40rpx;
color: #fff;
}
.user_info_wrap .user_btn {
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 20%;
/* border: 1rpx solid greenyellow; */
color: #fff;
font-size: 38rpx;
padding: 30rpx;
border-radius: 10rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: absolute;
top: 20%;
left: 50%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 30rpx;
font-size: 38rpx;
/* border: 1rpx solid greenyellow; */
color: #fff;
border-radius: 10rpx;
transform: translateX(-50%);
}
.user_content {
position: relative;
position: relative;
}
.user_content .user_main {
padding-bottom: 100rpx;
color: #666;
position: absolute;
width: 90%;
left: 50%;
transform: translateX(-50%);
top: -40rpx;
position: absolute;
top: -40rpx;
left: 50%;
width: 90%;
padding-bottom: 100rpx;
color: #666;
transform: translateX(-50%);
}
.user_content .user_main .history_wrap {
background-color: #fff;
display: flex;
display: flex;
background-color: #fff;
}
.user_content .user_main .history_wrap navigator {
flex: 1;
text-align: center;
padding: 10rpx 0;
flex: 1;
padding: 10rpx 0;
text-align: center;
}
.user_content .user_main .history_wrap navigator .his_num {
color: var(--themeColor);
color: var(--themeColor);
}
.user_content .user_main .orders_wrap {
background-color: #fff;
margin-top: 30rpx;
margin-top: 30rpx;
background-color: #fff;
}
.user_content .user_main .orders_wrap .orders_title {
padding: 20rpx;
border-bottom: 1rpx solid #ccc;
padding: 20rpx;
border-bottom: 1rpx solid #ccc;
}
.user_content .user_main .orders_wrap .order_content {
display: flex;
display: flex;
}
.user_content .user_main .orders_wrap .order_content navigator {
padding: 15rpx 0;
flex: 1;
text-align: center;
flex: 1;
padding: 15rpx 0;
text-align: center;
}
.user_content .user_main .orders_wrap .order_content navigator .iconfont {
color: var(--themeColor);
font-size: 40rpx;
font-size: 40rpx;
color: var(--themeColor);
}
.user_content .user_main .address_wrap {
margin-top: 30rpx;
background-color: #fff;
padding: 20rpx;
padding: 20rpx;
margin-top: 30rpx;
background-color: #fff;
}
.user_content .user_main .app_info_wrap {
margin-top: 30rpx;
background-color: #fff;
margin-top: 30rpx;
background-color: #fff;
}
.user_content .user_main .app_info_wrap .app_info_item {
padding: 20rpx;
border-bottom: 1rpx solid #ccc;
padding: 20rpx;
border-bottom: 1rpx solid #ccc;
}
.user_content .user_main .app_info_wrap .app_info_contact {
display: flex;
justify-content: space-between;
display: flex;
justify-content: space-between;
}
.user_content .user_main .recommend_wrap {
margin-top: 30rpx;
background-color: #fff;
padding: 20rpx;
}
\ No newline at end of file
padding: 20rpx;
margin-top: 30rpx;
background-color: #fff;
}
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
/*!
/* !
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
......
......@@ -7,9 +7,19 @@
// 上面的代码在 scss里面格式化是OK的,在Vue里面会有问题
.test {
background: #fff;
background: #fff;
.test1 {
color: #f9ff99;
}
.test1 {
color: #f9ff99;
}
}
.revice_address_row .user_info_row .user_phone {
position: relative;
display: flex;
flex: 3;
width: 30px;
height: 1000%;
height: 30px;
text-align: right;
}
......@@ -20,7 +20,7 @@ export async function jsonc(): Promise<Linter.Config[]> {
return [
{
files: [ "*.json", "**/*.json5", "**/*.jsonc", "*.code-workspace" ],
files: [ "**/*.json", "**/*.json5", "**/*.jsonc", "*.code-workspace" ],
languageOptions: {
parser: parserJsonc as any,
},
......
......@@ -5,7 +5,7 @@ import type { Linter } from "eslint";
export function customConfigMiniprogram (): Linter.Config[] {
return [
{
files: [ "apps/**/miniprogram/**/**" ],
files: [ "apps/**/miniprogram/**/*.?([cm])[jt]s?(x)" ],
rules: {
// ==================== CommonJS 相关 ====================
// 小程序强制使用 CommonJS,不支持 ES Modules 语法
......
......@@ -6,30 +6,62 @@ const { group, hardline, indent, join, softline } = doc.builders;
const originalPrinter = prettierPluginMp.printers.wxml;
function printEndTag(path) {
const node = path.getValue();
return `</${node.name}>`;
// Helper: indent each line of a string by the given number of spaces
function indentLines(content, indentSize) {
if (typeof content !== "string") return content;
const spaces = " ".repeat(indentSize);
return content.split("\n").map(line => line ? spaces + line : line).join("\n");
}
function replaceLineWithSoftline(node) {
if (!node || typeof node === "string") return node;
if (Array.isArray(node)) return node.map(item => replaceLineWithSoftline(item));
if (node.type === "line") {
return softline;
// Helper: format WXS JavaScript code
function formatWxsByBabelCompat(jsCode, opts) {
try {
// Simple formatting: preserve structure but normalize spacing
let formatted = jsCode;
// Normalize line endings
formatted = formatted.replaceAll("\r\n", "\n");
// Remove trailing whitespace from each line
formatted = formatted.split("\n").map(line => line.trimEnd()).join("\n");
return formatted;
} catch {
return jsCode; // Return original on error
}
}
if (node.contents) {
return {
...node,
contents: replaceLineWithSoftline(node.contents),
};
// Helper: enforce quote style for WXS string literals
function enforceWxsStringQuotes(code, useSingle) {
if (typeof code !== "string") return code;
// Simple quote normalization for string literals
// Only replace quotes that are clearly string delimiters
if (useSingle) {
// Replace double quotes with single quotes where safe
return code.replaceAll(/"([^"\n]*)"/g, (match, content) => {
if (content.includes("'")) return match; // Keep double if contains single
return `'${content}'`;
});
} else {
// Replace single quotes with double quotes where safe
return code.replaceAll(/'([^'\n]*)'/g, (match, content) => {
if (content.includes('"')) return match; // Keep single if contains double
return `"${content}"`;
});
}
}
return node;
// Helper: check if mustache content is a simple identifier
function isSimpleMustacheIdentifier(innerLines) {
if (!Array.isArray(innerLines) || innerLines.length !== 1) return false;
const line = innerLines[0].trim();
// Simple identifier: letters, numbers, underscore, dots only
return /^[a-z_$][\w$.]*$/i.test(line);
}
function printEndTag(path) {
const node = path.getValue();
return `</${node.name}>`;
}
function printMisc(path, opts) {
const node = path.getValue();
......@@ -96,12 +128,11 @@ function printCharData(path, opts, print) {
const { value } = node;
if (!value) return "";
if (value.trim() === "") {
// Return whitespace as-is; element-level logic decides whether to keep it
return value;
// Return empty string for whitespace-only nodes to ensure consistency
return "";
}
// Normalize inline template expressions
const normalized = formatWxmlInterpolations(value, opts);
// Do not trim() here to avoid silently removing significant leading/trailing spaces in text nodes
return normalized;
}
// Helper: build doc for multi-line mustache printed text, or return null if not applicable
......@@ -253,36 +284,8 @@ function printElement(path, opts, print) {
const hasAnyAttrs = attrsArr.length > 0;
// Simplified: treat <block> as always-block, selected tags as prefer-break.
// 如果标签有任何属性且有子节点,强制不内联子节点
let shouldInline = (singleTextInline || smallInlineMix) && !isAlwaysBlock && !isPreferBlock && !hasAnyAttrs;
// Only <text> strictly checks: if it has any attributes, force break (no inline)
if (lowerName === "text" && hasAnyAttrs) {
shouldInline = false;
}
// For <text>, baseline: do not inline unless content is short/simple and structure is trivial
if (lowerName === "text") {
shouldInline = false;
if (!hasAnyAttrs && onlyTextualChildren && !hasNewline && node.children.length === 1) {
const only = node.children[0];
const rawCombined = getNodeString(only);
const trimmed = typeof rawCombined === "string" ? rawCombined.trim() : "";
const isSingleMustache = trimmed.startsWith("{{") && trimmed.endsWith("}}");
const containsMustache = typeof rawCombined === "string" && rawCombined.includes("{{");
if (containsMustache && isSingleMustache) {
const inner = trimmed.slice(2, -2);
// Complexity heuristics: break if contains object/array literal, or has multiple &&, or both && and ||
const hasObjectLiteral = /\{[^}]*:/.test(inner);
const hasArrayLiteral = /\[[^,\]]*,[^\]]*\]/.test(inner) || /^\s*\[/.test(inner.trim());
const andCount = (inner.match(/&&/g) || []).length;
const hasOr = inner.includes("||");
const complex = hasObjectLiteral || hasArrayLiteral || andCount >= 2 || (andCount >= 1 && hasOr);
shouldInline = !complex;
} else if (isTextNodeType(only)) {
// single pure text: inline if reasonably short
shouldInline = trimmed.length <= 50;
}
}
}
// Determine shouldInline based on tag type and content
const shouldInline = (singleTextInline || smallInlineMix) && !isAlwaysBlock && !isPreferBlock && !hasMultipleAttrs;
// Note: <text> is handled via early return above; strict text mode is unused.
......@@ -310,18 +313,8 @@ function printElement(path, opts, print) {
for (const [ i, printed ] of childrenParts.entries()) {
if (i > 0) childrenWithBreaks.push(hardline);
const entry = childEntries[i];
// Split multi-line text nodes into doc parts separated by hardline
if (entry && (entry.node.type === "WXText" || entry.node.type === "WXCharData") && typeof printed === "string" && printed.includes("\n")) {
const lines = printed.split("\n");
for (const [ li, line_ ] of lines.entries()) {
if (li > 0) childrenWithBreaks.push(hardline);
if (line_ !== "") {
childrenWithBreaks.push(line_);
}
}
} else {
childrenWithBreaks.push(printed);
}
// Don't split multi-line text to avoid instability; trust the printed output
childrenWithBreaks.push(printed);
}
{
// Special-case: multi-line mustache block like "{{\n title\n}}" inside non-<text> tag
......@@ -348,15 +341,6 @@ function printElement(path, opts, print) {
}
}
if (node.endTag) {
// 检查是否有属性且没有子节点
const hasAttrs = attrsArr.length > 0;
const hasChildren = node.children && node.children.length > 0;
// 如果有属性但没有子节点,结束标签应该换行
if (hasAttrs && !hasChildren) {
parts.push(hardline);
}
parts.push(path.call(print, "endTag"));
}
return group(parts);
......@@ -365,8 +349,10 @@ function formatInlineJsExpression(expr, opts) {
if (typeof expr !== "string") return expr;
// 1) Collapse any newlines (and surrounding spaces) into a single space
let s = expr.replaceAll(/[ \t]*[\r\n]+[ \t]*/g, " ");
// 2) Normalize spaces around logical operators without touching others
// 2) Normalize spaces around logical operators
s = s.replaceAll(/\s*&&\s*/g, " && ").replaceAll(/\s*\|\|\s*/g, " || ");
// 3) Normalize multiple spaces to single space
s = s.replaceAll(/ {2,}/g, " ");
return s.trim();
}
function isPlaceholderLikeValue(value) {
......@@ -411,11 +397,11 @@ function formatWxmlInterpolations(text, opts) {
if (typeof text !== "string" || !text.includes("{{")) return text;
return text.replaceAll(/\{\{([\s\S]*?)\}\}/g, (match) => {
const inner = match.slice(2, -2); // 去掉 {{ }}
const leadingWs = inner.match(/^\s*/)[0];
const trailingWs = inner.match(/\s*$/)[0];
const expr = inner.slice(leadingWs.length, inner.length - trailingWs.length);
const formatted = formatInlineJsExpression(expr, opts);
return `{{${leadingWs}${formatted}${trailingWs}}}`;
const trimmedExpr = inner.trim();
if (!trimmedExpr) return "{{}}";
const formatted = formatInlineJsExpression(trimmedExpr, opts);
// Always use single space for consistency
return `{{ ${formatted} }}`;
});
}
......
......@@ -6,10 +6,11 @@ type ConfigOverride = NonNullable<Config["overrides"]>[number];
export function configMiniprogram():ConfigOverride[] {
return [
// WXSS 文件的配置(纯样式文件)
{
// 使用 postcss-html 解析器处理 HTML/Vue 中的样式块
files: [ "**/apps/miniprogram/**/*.{wxss,css,scss,less,vue}", "**/apps/uniapp/**/*.{css,scss,less,vue}" ],
customSyntax: "postcss-html",
files: [ "**/apps/miniprogram/**/*.wxss", "**/apps/uniapp/**/*.css" ],
customSyntax: "postcss",
extends: [ "stylelint-config-recess-order" ],
rules: {
// 允许 rpx 单位(uni-app 响应式单位)
"unit-no-unknown": [
......@@ -18,11 +19,38 @@ export function configMiniprogram():ConfigOverride[] {
ignoreUnits: [ "rpx" ]
}
],
// 允许未知的属性值(uni-app 特有值)
// 允许未知的属性值(uni-app 特有值)
"declaration-property-value-no-unknown": null,
// 允许 uni-app 的条件编译注释
"comment-no-empty": null,
// 小程序特有的选择器
"selector-type-no-unknown": [
true,
{
ignore: [ "custom-elements" ],
ignoreTypes: [ "/^(page|view|text|image|button|input|scroll-view|swiper|navigator)/" ]
}
],
},
},
// Vue 和 HTML 中的样式块
{
files: [ "**/apps/miniprogram/**/*.{vue,html}", "**/apps/uniapp/**/*.{vue,html}" ],
customSyntax: "postcss-html",
extends: [ "stylelint-config-recess-order" ],
rules: {
// 允许 rpx 单位
"unit-no-unknown": [
true,
{
ignoreUnits: [ "rpx" ]
}
],
// 允许未知的属性值
"declaration-property-value-no-unknown": null,
// 允许 uni-app 的条件编译注释
// 允许 uni-app 的条件编译注释
"comment-no-empty": null,
// 小程序特有的选择器
// 小程序特有的选择器
"selector-type-no-unknown": [
true,
{
......
......@@ -72,7 +72,7 @@ export default {
plugins: [
"stylelint-order", // CSS 声明顺序
"@stylistic/stylelint-plugin", // 代码风格
// "stylelint-prettier", // 与 Prettier 集成
// "stylelint-prettier", // 与 Prettier 集成(已禁用,改用 stylelint 扩展)
"stylelint-scss", // SCSS 特定规则
],
......@@ -187,10 +187,13 @@ export default {
// 禁用 SCSS 操作符后换行规则
"scss/operator-no-newline-after": null,
// CSS 类名规则(支持 BEM、工具类、状态类等规范)
// 允许的格式:o-, c-, u-, t-, s-, is-, has-, _-, js-, qa- 前缀,支持 BEM __ -- 语法
// CSS 类名规则(支持 BEM、工具类、状态类、下划线分隔等规范)
// 允许的格式:o-, c-, u-, t-, s-, is-, has-, _-, js-, qa- 前缀,支持 BEM __ -- 语法,支持下划线分隔
"selector-class-pattern":
"^(?:(?:o|c|u|t|s|is|has|_|js|qa)-)?[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:[.+])?$",
"^(?:(?:o|c|u|t|s|is|has|_|js|qa)-)?[a-zA-Z0-9]+(?:[_-][a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:[_-][a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:[_-][a-zA-Z0-9]+)*)?(?:[.+])?$",
// CSS 自定义属性规则(支持 kebab-case 和 camelCase)
"custom-property-pattern": "^[a-zA-Z][a-zA-Z0-9_-]*$",
// 禁用 :not() 伪类符号规则
"selector-not-notation": null,
......
......@@ -57,7 +57,7 @@ pre-commit:
glob: '*.{js,jsx,ts,tsx}'
lint-style:
run: pnpm stylelint --fix --allow-empty-input {staged_files}
glob: '*.{scss,less,styl,html,vue,css}'
glob: '*.{scss,less,styl,html,vue,css,wxss}'
lint-package:
run: pnpm eslint --cache --fix {staged_files}
glob: 'package.json'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!