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