修复已知问题
This commit is contained in:
@@ -41,6 +41,10 @@
|
||||
state: false,
|
||||
loading: true
|
||||
})
|
||||
/** 地址选项弹出窗 */
|
||||
const isPopup = ref(null)
|
||||
/** 地址列表 */
|
||||
const ressDataList = ref([])
|
||||
const tixian = ref(null)
|
||||
const originalPrice = ref(0)
|
||||
|
||||
@@ -55,11 +59,26 @@
|
||||
topRessData.id = data?.id || ''
|
||||
topRessData.phone = data?.phone || ''
|
||||
topRessData.loading = false
|
||||
ressDataList.value = res.rows
|
||||
}
|
||||
|
||||
/** 用户地址跳转 */
|
||||
/** 选中地址 */
|
||||
const onAddress = data => {
|
||||
topRessData.state = !data?.id
|
||||
topRessData.name = data?.name || ''
|
||||
topRessData.houseNum = data?.houseNum || ''
|
||||
topRessData.id = data?.id || ''
|
||||
topRessData.phone = data?.phone || ''
|
||||
isPopup.value.close()
|
||||
}
|
||||
|
||||
/** 点击顶部地址选项 */
|
||||
const onRess = () => {
|
||||
navigateTo('/pages/address/index')
|
||||
if (topRessData.name) {
|
||||
isPopup.value.open()
|
||||
} else {
|
||||
navigateTo('/pages/address/index')
|
||||
}
|
||||
}
|
||||
|
||||
const getData = async productId => {
|
||||
@@ -119,9 +138,6 @@
|
||||
quantity: formData.num,
|
||||
skuId: formData.spec
|
||||
}
|
||||
console.log(data, '===data===')
|
||||
return
|
||||
|
||||
tixian.value.close()
|
||||
const res = await addOrder(data)
|
||||
await refreshUserInfo()
|
||||
@@ -245,6 +261,49 @@
|
||||
<bottom-view>
|
||||
<cb-button @click="onConfirm">确认支付</cb-button>
|
||||
</bottom-view>
|
||||
|
||||
<!-- 地址选项弹出窗 -->
|
||||
<uni-popup
|
||||
ref="isPopup"
|
||||
type="bottom"
|
||||
borderRadius="16rpx 16rpx 0 0"
|
||||
backgroundColor="#ffffff"
|
||||
>
|
||||
<view class="popup-box">
|
||||
<view class="top-name">
|
||||
<text class="title">地址选项</text>
|
||||
<uni-icons
|
||||
type="closeempty"
|
||||
size="44rpx"
|
||||
@click="isPopup.close()"
|
||||
></uni-icons>
|
||||
</view>
|
||||
<!-- 选项卡片 -->
|
||||
<view class="card-list">
|
||||
<view
|
||||
v-for="(item, index) in ressDataList"
|
||||
:key="index"
|
||||
class="card-box"
|
||||
@click="onAddress(item)"
|
||||
>
|
||||
<view class="name-box">
|
||||
<text v-if="item.defaultAddress == 1" class="mode">
|
||||
默认
|
||||
</text>
|
||||
<text class="name">{{ item.houseNum }}</text>
|
||||
</view>
|
||||
<view class="right-box">
|
||||
<text class="p">{{ item.name }}</text>
|
||||
<uni-icons type="right" size="36rpx"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部添加按钮 -->
|
||||
<view class="btn" @click="navigateTo('/pages/address/index')">
|
||||
添加新地址
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -163,3 +163,78 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 地址弹出窗选项
|
||||
.popup-box {
|
||||
padding: 32rpx 24rpx;
|
||||
.top-name {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20rpx;
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.card-list {
|
||||
max-height: 46vh;
|
||||
overflow-y: auto;
|
||||
.card-box {
|
||||
border-bottom: 2rpx solid #d9d9d9;
|
||||
padding: 20rpx 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.name-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 80%;
|
||||
.mode {
|
||||
font-size: 28rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
padding: 0 16rpx;
|
||||
border-radius: 10rpx;
|
||||
color: #fff;
|
||||
background: #44943a;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.name {
|
||||
width: 50%;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
// 超过宽度显示省略号
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
.right-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.p {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
font-weight: 400;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: 20rpx;
|
||||
background: #ffffff;
|
||||
color: #44943a;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
border-radius: 40rpx;
|
||||
border: 2rpx solid #44943a;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user