bobo 3 år sedan
förälder
incheckning
8ca51f1587
5 ändrade filer med 120 tillägg och 0 borttagningar
  1. 26 0
      api/signIn.js
  2. 85 0
      pages/signIn/index.js
  3. 3 0
      pages/signIn/index.json
  4. 5 0
      pages/signIn/index.wxml
  5. 1 0
      pages/signIn/index.wxss

+ 26 - 0
api/signIn.js

@@ -0,0 +1,26 @@
+import request from '../utils/request.js'
+
+class SignIn extends request {
+
+  static getActivityData(mobile) {
+    let params = {
+      mobile
+    };
+    return this.postRequest(`${this.BASE_URL}open/sign-in/activity/detail`, params)
+  }
+
+  static triggerSignIn(activityId, mobile) {
+    const params = {
+      activityId,
+      mobile,
+    }
+    return this.postRequest(`${this.BASE_URL}open/sign-in/click`, params)
+  }
+
+  static getUserAwardCouponList(params) {
+    return this.postRequest(`${this.BASE_URL}open/sign-in/user-award-coupon-list`, params);
+  }
+
+}
+
+export default SignIn

+ 85 - 0
pages/signIn/index.js

@@ -0,0 +1,85 @@
+// pages/signIn/index.js
+import SignIn from '../../api/signIn'
+
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        SignIn.getActivityData("").then(res => {
+            console.log(res)
+        }).catch(_ => {})
+
+        SignIn.getUserAwardCouponList({
+            page: 1,
+            pageSize: 10,
+            mobile: "16602120168"
+        }).then(res => {
+            console.log(res);
+        }).catch(_ => {})
+
+    },
+
+    tapSignIn: function() {
+        SignIn.triggerSignIn(5, "16602120168").then(res => {
+            console.log(res)
+        }).catch(_ => {})
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 3 - 0
pages/signIn/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 5 - 0
pages/signIn/index.wxml

@@ -0,0 +1,5 @@
+<!--pages/signIn/index.wxml-->
+<view>
+
+<view catchtap="tapSignIn">签到</view>
+</view>

+ 1 - 0
pages/signIn/index.wxss

@@ -0,0 +1 @@
+/* pages/signIn/index.wxss */