Browse Source

增加删除弹出框

leaf 5 months atrás
parent
commit
c76d7fe6d3

+ 12 - 3
pages/address/index.vue

@@ -22,7 +22,9 @@
 							</view>
 							<view class="row">
 								<view class="row"><text class="iconfont">&#xe6ae;</text>编辑</view>
-								<view class="row next-btn"><text class="iconfont">&#xe626;</text>删除</view>
+								<view class="row next-btn" @click.stop="delPopup.open('center')"><text
+										class="iconfont">&#xe626;</text>删除
+								</view>
 							</view>
 						</view>
 					</view>
@@ -30,9 +32,14 @@
 			</pub-list-scroll>
 		</view>
 		<view class="pub-button is-bg large">新增地址</view>
-		<!-- 弹窗 -->
+		<!-- 选择弹窗 -->
 		<uni-popup ref="confirmPopup" type="dialog">
-			<uni-popup-dialog type="info" cancelText="取消" confirmText="确定" content="确定使用快递配送" @confirm="onApply"
+			<uni-popup-dialog type="info" cancelText="取消" confirmText="确定" content="确定使用快递配送?" @confirm="onApply"
+				@close="onCancel"></uni-popup-dialog>
+		</uni-popup>
+		<!-- 删除弹窗 注意这里取消按钮的位置 -->
+		<uni-popup ref="delPopup" type="dialog">
+			<uni-popup-dialog type="info" cancelText="确定" confirmText="取消" content="确定删除该地址?" @confirm="onApply"
 				@close="onCancel"></uni-popup-dialog>
 		</uni-popup>
 	</view>
@@ -53,6 +60,7 @@
 		status: 2
 	})
 	const confirmPopup = ref() // 弹出层
+	const delPopup = ref() // 删除弹出层
 
 
 	const curAddressId = ref()
@@ -127,6 +135,7 @@
 	}
 	const onApply = () => {
 		console.log("onApply")
+		dlg.success('操作成功')
 	}
 
 	const getList = async () => {

+ 0 - 1
uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue

@@ -214,7 +214,6 @@
 			getDialogStyle() {
 				//离屏幕上方间距为128dp,左右边距为48dp
 				const systemInfo = uni.getSystemInfoSync();
-				console.log("systemInfo.screenWidth", systemInfo.screenWidth);
 				return {
 					width: `calc(${systemInfo.screenWidth}px - 194rpx)` //
 				}