guhongwei 2 سال پیش
والد
کامیت
ee598a020d
1فایلهای تغییر یافته به همراه26 افزوده شده و 4 حذف شده
  1. 26 4
      pages/index/index.vue

+ 26 - 4
pages/index/index.vue

@@ -4,6 +4,20 @@
 			<view class="one">
 				<image class="logo" :src="logoUrl" mode=""></image>
 			</view>
+			<view class="two">
+				<button @tap="toPopup('1')">打开弹框1</button>
+				<button @tap="toPopup('2')">打开弹框2</button>
+				<uni-popup ref="popup" background-color="#fff" type="bottom">
+					<view class="popup">
+						<view class="popup_1" v-if="popup.type=='1'">
+							弹框一
+						</view>
+						<view class="popup_1" v-else-if="popup.type=='2'">
+							弹框二
+						</view>
+					</view>
+				</uni-popup>
+			</view>
 		</view>
 	</mobile-frame>
 </template>
@@ -13,7 +27,10 @@
 		components: {},
 		data() {
 			return {
-				logoUrl: ''
+				logoUrl: '',
+				popup: {
+					type: '1'
+				}
 			};
 		},
 		onLoad: function() {},
@@ -22,6 +39,11 @@
 			that.search();
 		},
 		methods: {
+			toPopup(e) {
+				const that = this;
+				that.$set(that.popup, `type`, e);
+				that.$refs.popup.open();
+			},
 			search() {
 				const that = this;
 				that.$set(that, `logoUrl`, that.$config.logoUrl);
@@ -32,9 +54,9 @@
 							key: 'system',
 							data: res,
 							success: function() {
-								uni.redirectTo({
-									url: `/pages/home/index`
-								})
+								// uni.redirectTo({
+								// 	url: `/pages/home/index`
+								// })
 							}
 						});
 					}