diff --git a/1514080901105/pages/form/form.js b/1514080901105/pages/form/form.js new file mode 100644 index 00000000..82b7d511 --- /dev/null +++ b/1514080901105/pages/form/form.js @@ -0,0 +1,52 @@ +//dd +Page({ + data: { + height: 20, + focus: false + }, + bindButtonTap: function () { + this.setData({ + focus: true + }) + }, + + bindFormSubmit: function (e) { + console.log(e.detail.value.textarea) + }, + formSubmit: function (event) { + var ggc = {}; + var that = this + console.log(event) + ggc.radiogroup = event.detail.value.radiogroup; + ggc.radiogroup2 = event.detail.value.radiogroup2; + ggc.input = event.detail.value.input; + //console.log('form发生了submit事件,携带数据为:', e.detail.value) + if (!ggc.radiogroup || !ggc.radiogroup2 || !ggc.input) { + console.log(ggc) + that.setData({ + hasError: true, + errorText: '选项不能为空' + }) + } else { + that.setData({ + hasError: false + }) + wx.setStorage({ + + key: "ggc", + data: event.detail.value, + success: function (res) { + wx.showToast({ + title: '成功', + icon: 'success', + duration: 2000 + }) + } + }) + } + + }, + formReset: function () { + console.log('form发生了reset事件') + } +}) \ No newline at end of file diff --git a/1514080901105/pages/form/form.json b/1514080901105/pages/form/form.json new file mode 100644 index 00000000..54b37f45 --- /dev/null +++ b/1514080901105/pages/form/form.json @@ -0,0 +1,2 @@ + +{} \ No newline at end of file diff --git a/1514080901105/pages/form/form.wxml b/1514080901105/pages/form/form.wxml new file mode 100644 index 00000000..a73f4cbf --- /dev/null +++ b/1514080901105/pages/form/form.wxml @@ -0,0 +1,37 @@ +
+ {{errorText}} + 选择景点类别: + + + + + + + + + + + 选择出行季节: + + + + + + + + + + 我的头衔: + + + + +介绍一下我自己: + +