guhongwei 2 lat temu
rodzic
commit
1e499b30ef
1 zmienionych plików z 22 dodań i 2 usunięć
  1. 22 2
      pages/index/index.vue

+ 22 - 2
pages/index/index.vue

@@ -2,6 +2,12 @@
 	<mobile-frame>
 		<view class="main">
 			系统首页
+
+			<uni-forms ref="form" :rules="rules" :model="form" label-width="auto">
+				<uni-forms-item label="test" name="num">
+					<uni-easyinput type="digit" v-model="form.num" @input="toInput" aceholder="请输入内容"></uni-easyinput>
+				</uni-forms-item>
+			</uni-forms>
 		</view>
 	</mobile-frame>
 </template>
@@ -10,7 +16,10 @@
 	export default {
 		components: {},
 		data() {
-			return {};
+			return {
+				form: {},
+				rules: {}
+			};
 		},
 		onLoad: function() {},
 		onShow: function() {
@@ -18,6 +27,17 @@
 			that.search();
 		},
 		methods: {
+			toInput(value) {
+				if (value > 10) {
+					uni.showToast({
+						title: '可以'
+					})
+				} else {
+					uni.showToast({
+						title: '不可以'
+					})
+				}
+			},
 			search() {
 				// 查询当前所在平台
 				uni.getSystemInfo({
@@ -27,7 +47,7 @@
 							data: res,
 							success: function() {
 								uni.redirectTo({
-									url: `/pages/home/index`
+									// url: `/pages/home/index`
 									// url: `/pagesMy/order/info`
 								})
 							}