Commit c03517f0 authored by spc's avatar spc

fixed

parent 7aa5295c
<template>
<uni-popup ref="answerPopup" type="bottom" :maskClick="false" :safe-area="true">
<uni-popup ref="answerPopup" type="bottom" :maskClick="false" :safe-area="true" :backgroundColor="'rgba(0, 0, 0, 0.5)'">
<view class="answer-popup-container">
<view class="answer-popup">
<!-- 关闭按钮 -->
......@@ -151,9 +151,21 @@ export default {
},
methods: {
openPopup() {
// 禁止背景页面滚动(小程序原生方式)
wx.setPageStyle({
style: {
overflow: 'hidden'
}
});
this.$refs.answerPopup.open();
},
closePopup() {
// 恢复背景页面滚动(小程序原生方式)
wx.setPageStyle({
style: {
overflow: 'auto'
}
});
if (this.$refs.answerPopup) {
this.$refs.answerPopup.close();
}
......
......@@ -75,7 +75,7 @@
<!-- 悬浮授权手机号模块 -->
<view class="auth-phone-module" v-if="true ||!userStore.memberInfo?.mobile">
<view class="auth-phone-module" v-if="!userStore.memberInfo?.mobile">
<image class="auth-phone-bg" :src="$baseUrl + 'homepage/Q3Res/accessBg3.png'"></image>
<view class="auth-phone-btn-container">
<image class="auth-phone-btn" :src="$baseUrl + 'homepage/Q3Res/accessBtn3.png'" @tap="handleAuthPhoneClick">
......
......@@ -3,7 +3,8 @@
<view class="form-container">
<view class="form-item">
<text class="label">收货人</text>
<input class="input" v-model="formData.name" placeholder="请输入收货人姓名" maxlength="30" @input="limitNameInput" />
<input class="input" v-model="formData.name" placeholder="请输入收货人姓名" maxlength="30"
@input="limitNameInput" />
<view class="wechat-import" @tap="importFromWechat">
<image class="wechat-icon" :src="$baseUrl + 'homepage/Q3Res/wechatIcon.png'" mode="aspectFit">
</image>
......@@ -60,23 +61,18 @@
<!-- 面包屑导航 -->
<view class="breadcrumb-container">
<view class="breadcrumb-item"
:class="{ 'active': currentLevel === 0 }"
@tap="switchToLevel(0)">
<view class="breadcrumb-item" :class="{ 'active': currentLevel === 0 }" @tap="switchToLevel(0)">
{{ selectedProvince ? selectedProvince.name : '请选择' }}
</view>
<view v-if="showCityLevel" class="breadcrumb-item"
:class="{ 'active': currentLevel === 1 }"
<view v-if="showCityLevel" class="breadcrumb-item" :class="{ 'active': currentLevel === 1 }"
@tap="switchToLevel(1)">
{{ selectedCity ? selectedCity.name : '请选择' }}
</view>
<view v-if="showDistrictLevel" class="breadcrumb-item"
:class="{ 'active': currentLevel === 2 }"
<view v-if="showDistrictLevel" class="breadcrumb-item" :class="{ 'active': currentLevel === 2 }"
@tap="switchToLevel(2)">
{{ selectedDistrict ? selectedDistrict.name : '请选择' }}
</view>
<view v-if="showStreetLevel" class="breadcrumb-item"
:class="{ 'active': currentLevel === 3 }"
<view v-if="showStreetLevel" class="breadcrumb-item" :class="{ 'active': currentLevel === 3 }"
@tap="switchToLevel(3)">
{{ selectedStreet ? selectedStreet.name : '请选择' }}
</view>
......@@ -86,11 +82,8 @@
<text class="loading-text">加载中...</text>
</view>
<view v-else class="picker-list">
<view v-for="(item, index) in currentLevelData"
:key="index"
class="picker-item"
:class="{ 'selected': isItemSelected(item, index) }"
@tap="selectItem(item, index)">
<view v-for="(item, index) in currentLevelData" :key="index" class="picker-item"
:class="{ 'selected': isItemSelected(item, index) }" @tap="selectItem(item, index)">
<text class="item-text">{{ item.name }}</text>
<text v-if="isItemSelected(item, index)" class="check-icon"></text>
</view>
......@@ -670,8 +663,7 @@ export default {
// 设置为默认地址
async setAsDefault() {
// 防连点检查
if (this.isSubmitting) return;
this.isSubmitting = true;
try {
// 先获取当前地址列表,检查是否已有默认地址
const response = await getAddressList();
......@@ -699,7 +691,7 @@ export default {
icon: 'none'
});
} finally {
this.isSubmitting = false;
}
},
......@@ -732,7 +724,12 @@ export default {
handleSave() {
// 防连点检查
if (this.isSubmitting) return;
if (!this.validateForm()) return;
this.isSubmitting = true
console.warn("保存")
if (!this.validateForm()) {
this.isSubmitting = false
return
};
// 构建完整地址
const addressInfo = {
......@@ -751,8 +748,7 @@ export default {
// 保存地址(新增)
async saveAddress(addressInfo) {
// 防连点检查
if (this.isSubmitting) return;
this.isSubmitting = true;
this.isLoading = true;
try {
// 如果要设为默认地址,先处理其他默认地址
......@@ -780,18 +776,20 @@ export default {
if (response.ok && response.success) {
uni.showToast({
title: '添加成功',
icon: 'success',
icon: 'none',
success: () => {
setTimeout(() => {
this.isSubmitting = false;
uni.navigateBack();
}, 1500);
}
});
} else {
uni.showToast({
title: response.msg || '保存失败',
title: response.message || '保存失败',
icon: 'none'
});
this.isSubmitting = false;
}
} catch (error) {
console.error('保存地址失败:', error);
......@@ -799,17 +797,17 @@ export default {
title: '网络错误,请重试',
icon: 'none'
});
this.isSubmitting = false;
} finally {
this.isLoading = false;
this.isSubmitting = false;
}
},
// 更新地址(编辑)
async updateAddress(addressInfo) {
// 防连点检查
if (this.isSubmitting) return;
this.isSubmitting = true;
this.isLoading = true;
try {
// 如果要设为默认地址,先处理其他默认地址
......@@ -838,18 +836,20 @@ export default {
if (response.ok && response.success) {
uni.showToast({
title: '更新成功',
icon: 'success',
icon: 'none',
success: () => {
setTimeout(() => {
this.isSubmitting = false;
uni.navigateBack();
}, 1500);
}
});
} else {
uni.showToast({
title: response.msg || '更新失败',
title: response.message || '更新失败',
icon: 'none'
});
this.isSubmitting = false;
}
} catch (error) {
console.error('更新地址失败:', error);
......@@ -857,9 +857,9 @@ export default {
title: '网络错误,请重试',
icon: 'none'
});
this.isSubmitting = false;
} finally {
this.isLoading = false;
this.isSubmitting = false;
}
},
......@@ -881,53 +881,7 @@ export default {
}
},
// 删除地址
deleteAddress() {
// 防连点检查
if (this.isSubmitting) return;
uni.showModal({
title: '确认删除',
content: '确定要删除这个地址吗?',
confirmText: '确定',
cancelText: '取消',
success: async (res) => {
if (res.confirm) {
this.isSubmitting = true;
this.isLoading = true;
try {
const response = await deleteAddress({ id: this.addressId });
console.log('删除地址接口返回:', response);
if (response.ok && response.success) {
uni.showToast({
title: '删除成功',
icon: 'success',
success: () => {
setTimeout(() => {
uni.navigateBack();
}, 1500);
}
});
} else {
uni.showToast({
title: response.msg || '删除失败',
icon: 'none'
});
}
} catch (error) {
console.error('删除地址失败:', error);
uni.showToast({
title: '网络错误,请重试',
icon: 'none'
});
} finally {
this.isLoading = false;
this.isSubmitting = false;
}
}
}
});
},
// 返回上一页
goBack() {
......@@ -1190,6 +1144,7 @@ export default {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
......
......@@ -239,7 +239,7 @@ export default {
this.addressList.splice(this.currentDeleteIndex, 1);
uni.showToast({
title: '删除成功',
icon: 'success'
icon: 'none'
});
} else {
uni.showToast({
......
......@@ -65,13 +65,15 @@
<text class="copy-btn" @click="copyCouponCode(orderData.coupon.cards[0].code)">复制</text>
</view>
<!-- 卡密展示 - 如果存在pwd字段 -->
<text v-if="orderData.coupon.cards[0].pwd" class="coupon-label">卡密</text>
<view v-if="orderData.coupon.cards[0].pwd" class="coupon-code-content">
<!-- 卡密展示 - 如果存在pwd字段,换行显示 -->
<view v-if="orderData.coupon.cards[0].pwd" class="pwd-section">
<text class="coupon-label">卡密</text>
<view class="coupon-code-content">
<text class="coupon-code">{{ orderData.coupon.cards[0].pwd }}</text>
<text class="copy-btn" @click="copyCouponCode(orderData.coupon.cards[0].pwd)">复制</text>
</view>
</view>
</view>
<!-- 过期时间 -->
<view v-if="orderData.expireTime" class="expire-time-item">
......@@ -159,9 +161,11 @@
<!-- 操作按钮 - 实物订单退货按钮在右下角 -->
<view v-if="showActionButton" class="action-container">
<button class="action-btn" :class="{
<view v-if="orderData.productType === 'virtual' && orderData.virtualType === 'coupon'" class="action-btn btn-use" @click="handleAction">
<image :src="$baseUrl + 'homepage/Q3Res/orderDetailToUseBtn.png'" mode="aspectFill"></image>
</view>
<button v-else class="action-btn" :class="{
'btn-refund': orderData.productType === 'physical',
'btn-use': orderData.productType === 'virtual',
'corner-btn': orderData.productType === 'physical'
}" @click="handleAction">{{ actionButtonText }}</button>
</view>
......@@ -391,7 +395,7 @@ export default {
// 页面跳转
navigateToCoupon: () => {
const url = 'subPackages/xmhMainProcess/mine/index';
const url = 'subPackages/shopMainProcess/coupons/couponList';
const type = JumpType.MINI;
const extra = {
appId: 'wx4205ec55b793245e', //星妈优选小程序
......@@ -1108,8 +1112,13 @@ export default {
padding: 80rpx 30rpx;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
z-index: 100;
/* 实物商品按钮使用flex布局,将按钮推到右侧 */
/* 虚拟商品按钮居中显示,实物商品按钮推到右侧 */
display: flex;
justify-content: center;
}
/* 实物商品按钮容器特殊样式 */
.action-container:has(.btn-refund) {
justify-content: flex-end;
}
......@@ -1120,6 +1129,7 @@ export default {
border-radius: 44rpx;
font-size: 32rpx;
font-weight: bold;
text-align: center;
}
/* 实物商品申请退货按钮样式 - 右下角 */
......@@ -1139,20 +1149,38 @@ export default {
z-index: 101;
}
/* 去使用图片按钮样式 */
.action-btn.btn-use {
background-color: #d3a458;
color: #fff;
background-color: transparent;
/* 虚拟商品按钮保持在容器中 */
position: static;
box-shadow: none;
/* 确保图片充满按钮 */
overflow: hidden;
/* 调整按钮尺寸为484*90 */
width: 484rpx;
height: 90rpx;
border-radius: 45rpx;
}
/* 去使用按钮内的图片样式 */
.action-btn.btn-use image {
width: 100%;
height: 100%;
border-radius: 45rpx;
}
/* 券码和过期时间样式 - 现在是模块1的一部分 */
.coupon-section {
/* 已迁移到module-card-code */
margin-top: 30rpx;
padding-top: 30rpx;
border-top: 1rpx solid #f0f0f0;
}
.coupon-code-item {
margin-bottom: 20rpx;
}
.coupon-code-item,
.expire-time-item {
display: flex;
align-items: center;
......@@ -1160,6 +1188,11 @@ export default {
margin-bottom: 20rpx;
}
/* 卡号和卡密之间的间距 */
.pwd-section {
margin-top: 20rpx;
}
.coupon-label {
font-size: 28rpx;
color: #666;
......@@ -1219,12 +1252,7 @@ export default {
border-radius: 20rpx;
}
/* 券码和过期时间样式 */
.coupon-section {
margin-top: 30rpx;
padding-top: 30rpx;
border-top: 1rpx solid #f0f0f0;
}
/* 券码和过期时间样式 - 已在上方定义 */
/* 使用说明样式 - 现在是模块3 */
.usage-instructions {
......
......@@ -352,7 +352,7 @@ function clickRegisterShield() {
// 页面跳转
const navigateToCoupon = () => {
const url = 'subPackages/xmhMainProcess/mine/index';
const url = 'subPackages/shopMainProcess/coupons/couponList';
const type = JumpType.MINI;
const extra = {
appId: 'wx4205ec55b793245e', //星妈优选小程序
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment