DaMowang 3 роки тому
батько
коміт
e6241f056b
1 змінених файлів з 27 додано та 12 видалено
  1. 27 12
      src/pages/xghc-addrress/userAddress.vue

+ 27 - 12
src/pages/xghc-addrress/userAddress.vue

@@ -1,7 +1,10 @@
 <template>
 	<uni-popup ref="popup" type="bottom">
 		<view class="container">
-			<form @submit="formSubmit" v-if="false">
+			<div class="tit">
+				<text class="close">关闭</text>
+			</div>
+			<form @submit="formSubmit" v-if="isadd">
 				<view class='addAddress'>
 					<view class="pad30">
 						<view class='default acea-row row-middle borderRadius15'>
@@ -46,11 +49,11 @@
 				</view>
 			</form>
 
-			<view class="addbar">
-				<text class="iconfont sp">&#xe760;</text>
-				<text class="sp">添加地址</text>
-			</view>
-
+			<div class="editaddress" v-else>
+				<view class="addbar" @click="isadd = true">
+					<text class="iconfont sp">&#xe760;</text>
+					<text class="sp">添加地址</text>
+				</view>
 				<uni-swipe-action class="swipeAction">
 					<uni-swipe-action-item class="swipeAction_item" v-for="(i,s) in addressList" :key="s">
 						<view class="addressLi clearfix" @click="onSelect(i,s)">
@@ -74,6 +77,8 @@
 						</template>
 					</uni-swipe-action-item>
 				</uni-swipe-action>
+			</div>
+
 		</view>
 	</uni-popup>
 </template>
@@ -94,7 +99,8 @@ var appEv = app.$vm.$options;
 				addressValue:"",
 				is_default: 0, //是否设为默认地址
 				range: [{"value": 0,"text": "否"	},{"value": 1,"text": "是"}],
-
+				
+				isadd: false,
 				addressList: [],
 			}
 		},
@@ -164,8 +170,9 @@ var appEv = app.$vm.$options;
 				});
 			},
 
-			open() {
-				this.$refs.popup.open('top')
+			open(type) {
+				this.$refs.popup.open('bottom')
+				if(type == "add") this.isadd = true
 			},
 			close() {
 				this.$refs.popup.close()
@@ -176,8 +183,9 @@ var appEv = app.$vm.$options;
 <style lang="scss" scoped>
 	.container{
 		background-color: #f5f5f5;
-		height: 100vh;
-		padding:30rpx 0;
+		height: 70vh;
+		// padding:30rpx 0;
+		border-radius: 30rpx 30rpx 0 0;
 	}
 	
 	.pad30 {
@@ -296,7 +304,7 @@ var appEv = app.$vm.$options;
 		margin-top: 22rpx;
 	}
 	.bg-color {
-		background-color: #dd524d;
+		background-color: #2DB389;
 	}
 
 	.addbar{
@@ -381,4 +389,11 @@ var appEv = app.$vm.$options;
 	::v-deep .uni-swipe_box{
 		padding: 20rpx 30rpx;
 	}
+
+	.tit{
+		padding: 10rpx 0;
+		.close{
+			float: right;
+		}
+	}
 </style>