Silent 6 年之前
父节点
当前提交
04845a0046
共有 4 个文件被更改,包括 16 次插入4 次删除
  1. 1 1
      routes/wechat.php
  2. 14 2
      wechat/pages/form/index.js
  3. 0 1
      wechat/pages/form/index.wxml
  4. 1 0
      wechat/utils/api.js

+ 1 - 1
routes/wechat.php

xqd
@@ -18,4 +18,4 @@ Route::get('getAnnounces', 'ApiController@getAnnounces');
 Route::post('updateUserInfo', 'ApiController@updateUserInfo');
 Route::get('bindPhone', 'ApiController@bindPhone');
 Route::post('getPhone', 'ApiController@getPhone');
-Route::get('getPhone', 'ApiController@getFormSet');
+Route::get('getFormSet', 'ApiController@getFormSet');

+ 14 - 2
wechat/pages/form/index.js

xqd
@@ -1,18 +1,30 @@
 // pages/form/index.js
+var api = require('../../utils/api.js')
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-  
+    data: {}
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    
+    var that = this;
+    wx.request({
+      url: api.getFormSetUrl,
+      method: 'GET',
+      success: res => {
+        if(res.data.status == 'success') {
+          that.setData({
+            data: res.data.data
+          })
+        }
+      }
+    })
   },
 
   /**

+ 0 - 1
wechat/pages/form/index.wxml

xqd
@@ -1,2 +1 @@
 <!--pages/form/index.wxml-->
-<text>pages/form/index.wxml</text>

+ 1 - 0
wechat/utils/api.js

xqd
@@ -18,4 +18,5 @@ module.exports = {
   updateUserInfoUrl: headUrl + 'updateUserInfo',
   bindPhoneUrl: headUrl + 'bindPhone',
   getPhoneUrl: headUrl + 'getPhone',
+  getFormSetUrl: headUrl + 'getFormSet',
 }