consumer模块完成度95%,准备部署消费者端测试

This commit is contained in:
cyh666666
2026-03-05 08:45:00 +08:00
parent cceb556c62
commit 7f7f723d93
1043 changed files with 53958 additions and 3445 deletions

View File

@@ -1,4 +1,4 @@
<!-- 结算页面 -->
<!-- 结算页面 -->
<template>
<view class="checkout-page">
<scroll-view class="checkout-content" scroll-y>
@@ -137,7 +137,7 @@
<text class="popup-close" @click="showAddressPopup = false">×</text>
</view>
<scroll-view class="address-list-container" scroll-y>
<scroll-view class="address-list-container" scroll-y="true" :scroll-with-animation="true">
<!-- 登录提示 -->
<view v-if="isLoggedIn == false" class="login-prompt" @click="goToLogin">
<text class="login-prompt-icon">🔒</text>
@@ -210,53 +210,63 @@
<view class="address-form-popup" @click.stop>
<view class="form-header">
<text class="form-title">新建收货地址</text>
<text class="form-close" @click="cancelNewAddress">×</text>
<view class="form-close-btn" @click="cancelNewAddress">
<text class="form-close-icon">✕</text>
</view>
</view>
<scroll-view class="form-content" scroll-y>
<view class="form-item">
<text class="form-label">收货人</text>
<input class="form-input" v-model="newAddress.recipient_name"
placeholder="请输入收货人姓名" />
</view>
<view class="form-item">
<text class="form-label">手机号</text>
<input class="form-input" v-model="newAddress.phone"
placeholder="请输入手机号码" type="number" />
</view>
<view class="form-item">
<text class="form-label">智能填写地址</text>
<textarea class="form-textarea smart-address-input"
v-model="smartAddressInput"
placeholder="粘贴如北京市朝阳区三里屯SOHO A座 张三 13800138000"
@input="parseSmartAddress"
maxlength="200" />
<text class="smart-tip">自动识别:地址+姓名+电话(支持粘贴文本)</text>
</view>
<view class="form-item">
<text class="form-label">所在地区</text>
<view class="region-inputs">
<input class="form-input region-input form-input-readonly" v-model="newAddress.province"
placeholder="省" readonly />
<input class="form-input region-input form-input-readonly" v-model="newAddress.city"
placeholder="市" readonly />
<input class="form-input region-input form-input-readonly" v-model="newAddress.district"
placeholder="区/县" readonly />
<scroll-view class="form-content" scroll-y="true">
<view class="form-section">
<view class="form-item">
<text class="form-label">收货人</text>
<input class="form-input" v-model="newAddress.recipient_name"
placeholder="请输入收货人姓名" />
</view>
<view class="form-item">
<text class="form-label">手机号</text>
<input class="form-input" v-model="newAddress.phone"
placeholder="请输入手机号码" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">详细地址</text>
<textarea class="form-textarea" v-model="newAddress.detail"
placeholder="街道、小区、楼栋、门牌号等"
maxlength="100" />
<view class="form-section">
<view class="form-item">
<view class="label-row">
<text class="form-label">智能填写</text>
<text class="smart-tag">识别姓名/电话/地址</text>
</view>
<textarea class="form-textarea smart-address-input"
v-model="smartAddressInput"
placeholder="粘贴收货信息文本,自动拆分字段"
@input="parseSmartAddress"
maxlength="200" />
</view>
</view>
<view class="form-section">
<view class="form-item">
<text class="form-label">所在地区</text>
<view class="region-inputs">
<input class="form-input region-input form-input-readonly" v-model="newAddress.province"
placeholder="省" readonly />
<input class="form-input region-input form-input-readonly" v-model="newAddress.city"
placeholder="市" readonly />
<input class="form-input region-input form-input-readonly" v-model="newAddress.district"
placeholder="区/县" readonly />
</view>
</view>
<view class="form-item">
<text class="form-label">详细地址</text>
<textarea class="form-textarea detail-textarea" v-model="newAddress.detail"
placeholder="如街道、楼栋、门牌号等"
maxlength="100" />
</view>
</view>
<view class="form-item checkbox-item">
<view class="checkbox-wrapper" @click="newAddress.is_default = newAddress.is_default ? false : true">
<view class="checkbox-wrapper" @click="newAddress.is_default = !newAddress.is_default">
<view :class="['checkbox', { checked: newAddress.is_default }]">
<text v-if="newAddress.is_default" class="checkbox-check">✓</text>
</view>
@@ -266,8 +276,7 @@
</scroll-view>
<view class="form-buttons">
<button class="form-cancel-btn" @click="cancelNewAddress">取消</button>
<button class="form-submit-btn" @click="saveNewAddress">保存</button>
<button class="form-submit-btn" @click="saveNewAddress">保存并使用</button>
</view>
</view>
</view>
@@ -1511,58 +1520,259 @@ const goToLogin = () => {
/* 弹窗样式 */
.address-popup-mask, .address-form-mask, .confirm-popup-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.5); z-index: 9998; }
.address-popup-mask { display: flex; align-items: flex-end; justify-content: center; }
.address-form-mask, .confirm-popup-mask { display: flex; align-items: center; justify-content: center; }
.address-popup { background-color: #ffffff; width: 100%; height: 500px; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; }
.address-form-popup { background-color: #ffffff; width: 90%; max-width: 500px; height: 600px; border-radius: 12px; display: flex; flex-direction: column; }
.address-form-mask, .confirm-popup-mask { display: flex; align-items: center; justify-content: center; z-index: 10000; }
.address-popup {
background-color: #ffffff;
width: 100%;
border-radius: 20px 20px 0 0;
display: flex;
flex-direction: column;
position: relative;
z-index: 9999;
}
.address-form-popup {
background-color: #f8f8f8;
width: 92%;
max-width: 500px;
height: 85vh;
border-radius: 16px;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
z-index: 10001;
}
.popup-header {
padding: 16px;
border-bottom: 0.5px solid #eee;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex-shrink: 0;
position: relative;
}
.popup-title { font-size: 17px; font-weight: bold; color: #333333; }
.popup-close { position: absolute; right: 16px; font-size: 20px; color: #999999; padding: 4px; }
.address-list-container {
flex: 1;
width: 100%;
padding: 12px;
box-sizing: border-box;
}
.popup-address-item {
padding: 16px;
margin-bottom: 12px;
background-color: #fff;
border: 1px solid #f0f0f0;
border-radius: 12px;
position: relative;
}
.popup-address-header {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 8px;
}
.popup-address-name { font-size: 15px; font-weight: bold; color: #333333; margin-right: 12px; }
.popup-address-phone { font-size: 14px; color: #666666; margin-right: 8px; }
.popup-default-tag { background-color: #fff0eb; padding: 1px 6px; border-radius: 4px; }
.popup-tag-text { color: #ff5000; font-size: 10px; }
.popup-address-detail { font-size: 13px; color: #666; line-height: 1.4; }
.popup-selected-indicator {
position: absolute;
right: 16px;
top: 50%;
transform: translateY(-50%);
color: #ff5000;
font-weight: bold;
font-size: 18px;
}
.popup-empty-address { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; }
.popup-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }
.popup-empty-text { font-size: 14px; color: #999; }
.popup-add-address-btn {
background-color: #ff5000;
margin: 12px 16px 30px;
height: 44px;
border-radius: 22px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.popup-btn-icon { color: #ffffff; font-size: 20px; margin-right: 6px; font-weight: 300; }
.popup-btn-text { color: #ffffff; font-size: 15px; font-weight: bold; }
.address-form-popup {
background-color: #f8f8f8;
width: 92%;
max-width: 500px;
height: 85vh;
border-radius: 16px;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
z-index: 10000;
}
.form-header {
padding: 16px;
background-color: #ffffff;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
position: relative;
border-bottom: 0.5px solid #eee;
flex-shrink: 0;
}
.form-title { font-size: 17px; font-weight: bold; color: #333333; }
.form-close-btn { position: absolute; right: 12px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.form-close-icon { font-size: 18px; color: #999; }
.form-content {
flex: 1;
height: 100px; /* 进一步减小初始高度,确保安卓端 flex:1 接管 */
min-height: 0;
padding: 12px;
}
.address-form-popup {
background-color: #f8f8f8;
width: 92%;
max-width: 500px;
height: 80vh; /* 稍微压低高度确保不在边缘产生冲突 */
border-radius: 16px;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
z-index: 10001;
}
.form-section {
background-color: #ffffff;
border-radius: 12px;
padding: 0 12px;
margin-bottom: 12px;
}
.form-item {
padding: 16px 0;
border-bottom: 0.5px solid #f5f5f5;
}
.form-item:last-child {
border-bottom: none;
}
.form-label {
font-size: 14px;
color: #333;
margin-bottom: 10px;
display: block;
}
.label-row {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.smart-tag {
font-size: 11px;
color: #ff5000;
background-color: #fff0eb;
padding: 2px 6px;
border-radius: 4px;
}
.form-input {
width: 100%;
height: 32px;
font-size: 15px;
color: #333;
}
.form-input-readonly { color: #888; }
.region-inputs {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.region-input { flex: 1; text-align: center; }
.form-textarea {
width: 100%;
background-color: #f9f9f9;
border-radius: 8px;
padding: 10px;
font-size: 14px;
color: #333;
box-sizing: border-box;
}
.smart-address-input { height: 80px; }
.detail-textarea { height: 60px; }
.checkbox-item {
background-color: #ffffff;
border-radius: 12px;
padding: 16px;
}
.checkbox-wrapper { display: flex; flex-direction: row; align-items: center; }
.checkbox { width: 18px; height: 18px; border: 1.5px solid #ddd; border-radius: 50%; margin-right: 10px; display: flex; align-items: center; justify-content: center; }
.checkbox.checked { background-color: #ff5000; border-color: #ff5000; }
.checkbox-check { color: #ffffff; font-size: 12px; }
.checkbox-label { font-size: 14px; color: #333; }
.form-buttons {
padding: 12px 16px 30px;
background-color: #ffffff;
flex-shrink: 0;
}
.form-submit-btn {
width: 100%;
background-color: #ff5000;
color: #ffffff;
height: 44px;
line-height: 44px;
border-radius: 22px;
font-size: 16px;
font-weight: bold;
border: none;
}
/* 确认保存弹窗 */
.confirm-popup-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.5); z-index: 9998; display: flex; align-items: center; justify-content: center; }
.confirm-popup { background-color: #ffffff; width: 80%; max-width: 320px; border-radius: 12px; overflow: hidden; }
.popup-header, .form-header { padding: 20px 15px; border-bottom: 1px solid #e5e5e5; display: flex; align-items: center; justify-content: space-between; }
.popup-title, .form-title { font-size: 18px; font-weight: bold; color: #333333; }
.popup-close, .form-close { font-size: 24px; color: #999999; padding: 5px; }
.address-list-container, .form-content { flex: 1; padding: 15px; }
.popup-address-item { padding: 15px; margin-bottom: 10px; border: 1px solid #e5e5e5; border-radius: 8px; position: relative; }
.popup-address-header { display: flex; align-items: center; margin-bottom: 10px; }
.popup-address-name { font-size: 16px; font-weight: bold; color: #333333; margin-right: 15px; }
.popup-address-phone { font-size: 14px; color: #666666; margin-right: 10px; }
.popup-default-tag { background-color: #ff4757; padding: 2px 8px; border-radius: 10px; }
.popup-tag-text { color: #ffffff; font-size: 12px; }
.popup-address-detail { font-size: 14px; color: #333333; line-height: 1.4; }
.popup-empty-address { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; }
.popup-empty-icon { font-size: 60px; margin-bottom: 15px; }
.popup-empty-text { font-size: 16px; color: #999999; }
.popup-add-address-btn { background-color: #007aff; margin: 15px; padding: 15px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.popup-btn-icon { color: #ffffff; font-size: 20px; margin-right: 10px; }
.popup-btn-text { color: #ffffff; font-size: 16px; font-weight: bold; }
.form-item { margin-bottom: 20px; }
.form-label { font-size: 14px; color: #333333; margin-bottom: 8px; }
.form-input { width: 100%; padding: 12px; border: 1px solid #e5e5e5; border-radius: 8px; font-size: 14px; color: #333333; box-sizing: border-box; }
.form-input-readonly { background-color: #f9f9f9; color: #666666; }
.region-inputs { display: flex; justify-content: space-between; }
.region-input { flex: 1; margin-right: 10px; }
.region-input:last-child { margin-right: 0; }
.form-textarea { width: 100%; min-height: 80px; padding: 12px; border: 1px solid #e5e5e5; border-radius: 8px; font-size: 14px; color: #333333; box-sizing: border-box; }
.smart-address-input { min-height: 60px; }
.smart-tip { font-size: 12px; color: #999999; margin-top: 5px; }
.checkbox-item { margin-top: 20px; }
.checkbox-wrapper { display: flex; align-items: center; }
.checkbox { width: 20px; height: 20px; border: 1px solid #e5e5e5; border-radius: 4px; margin-right: 10px; display: flex; align-items: center; justify-content: center; }
.checkbox.checked { background-color: #007aff; border-color: #007aff; }
.checkbox-check { color: #ffffff; font-size: 14px; }
.checkbox-label { font-size: 14px; color: #333333; }
.form-buttons { display: flex; padding: 15px; border-top: 1px solid #e5e5e5; }
.form-cancel-btn { flex: 1; background-color: #f5f5f5; color: #333333; padding: 12px; border-radius: 8px; font-size: 16px; border: none; margin-right: 10px; }
.form-submit-btn { flex: 1; background-color: #007aff; color: #ffffff; padding: 12px; border-radius: 8px; font-size: 16px; border: none; }
.confirm-header { padding: 20px 0 10px; text-align: center; }
.confirm-title { font-size: 18px; font-weight: bold; color: #333333; }
.confirm-content { padding: 0 20px 20px; text-align: center; }
.confirm-message { font-size: 16px; color: #666666; }
.confirm-buttons { display: flex; border-top: 1px solid #e5e5e5; }
.confirm-btn { flex: 1; height: 50px; line-height: 50px; text-align: center; font-size: 16px; background-color: #ffffff; border: none; border-radius: 0; }
.confirm-btn.cancel { color: #666666; border-right: 1px solid #e5e5e5; }
.confirm-btn.confirm { color: #007aff; font-weight: bold; }
</style>
.confirm-header { padding: 24px 0 12px; text-align: center; }
.confirm-title { font-size: 17px; font-weight: bold; color: #333; }
.confirm-content { padding: 0 24px 24px; text-align: center; }
.confirm-message { font-size: 14px; color: #666; line-height: 1.5; }
.confirm-buttons { display: flex; flex-direction: row; border-top: 0.5px solid #eee; }
.confirm-btn { flex: 1; height: 48px; line-height: 48px; text-align: center; font-size: 16px; background-color: #ffffff; border: none; border-radius: 0; }
.confirm-btn.cancel { color: #666; border-right: 0.5px solid #eee; }
.confirm-btn.confirm { color: #ff5000; font-weight: bold; }
</style>