kk.shi 3 éve
szülő
commit
5de3f6013d

+ 107 - 0
api/integralinfo.js

@@ -0,0 +1,107 @@
+import request from '../utils/request.js'
+
+class Integralinfo extends request {
+  
+  static INT_URL = 'http://118.31.106.139:8022/'
+    /**
+   * POST类型的网络请求
+   */
+  static postRequest(url, data, notUseLoading, catchErrorFunc) {
+    let  headerSign = this.getSignHead();
+    return this.requestAll(url, data, headerSign, 'POST', notUseLoading, catchErrorFunc)
+  }
+
+  static requestAll(url, data, header, method, notUseLoading, catchErrorFunc) {
+    if (!notUseLoading) {
+      getApp().showLoading()
+    }
+    return new Promise((resolve, reject) => {
+        wx.request({
+            url: url,
+            data: data,
+            header: header,
+            method: method,
+            success: (res => {
+                if (res?.data.code === "0000") {
+                    //200: 服务端业务处理正常结束
+                    resolve(res?.data)
+                } else {
+                  if (catchErrorFunc) {
+                      if (isFunc(catchErrorFunc)) {
+                          catchErrorFunc(res?.data)
+                      }
+                  } else {
+                      wx.showToast({
+                          title: res?.data?.msg,
+                          icon: "none"
+                      })
+                  }
+                  //其它错误,提示用户错误信息
+                  if (this._errorHandler != null) {
+                      //如果有统一的异常处理,就先调用统一异常处理函数对异常进行处理
+                      this._errorHandler(res)
+                  }
+                  reject(res)
+                }
+            }),
+            fail: (res => {
+                if (this._errorHandler != null) {
+                    this._errorHandler(res)
+                }
+                wx.showToast({
+                  title: '网络异常请稍后',
+                })
+                reject(res)
+            }),
+            complete: _ => {
+              getApp().hideLoading()
+            }
+        })
+    })
+}
+  /**
+   * 删除门店职员
+   */
+  static getBannerList(params) {
+    return this.postRequest(`${this.INT_URL}app/banner/list`, params);
+  }
+
+       /**
+   * 创建订单
+   */
+  static createOrder(mobile,activityId,num,shopId="", refStatisticsPostParam) {
+    refStatisticsPostParam = refStatisticsPostParam || {}
+    let params = {
+      activityId:activityId,
+      memberMobile:mobile,
+      num:num,
+      shopId:shopId,
+      scene: refStatisticsPostParam.scene || "",
+      channel: refStatisticsPostParam.channel || "0",
+      department: refStatisticsPostParam.department || "0"
+    };
+    return this.postRequest(`${this.BASE_URL}open/activity/create-order`, params);
+  }
+
+  //获取支付参数
+  static getOrderParams(orderSn,openId,isOrderPayment=false) {
+    let params = {
+      orderSn:orderSn,
+      source: "FREE_MINI_APP",
+      thirdPartyName: 'coupon-activity',
+      payCode: "HSAY-SHARE",
+      openId: openId
+    };
+    if(isOrderPayment){
+      params.isOrderPayment =true;
+      params.orderInfoPath = "pages/welfareMall/order/orderCompletion?ordersn="
+      params.productDetailPath = "pages/welfareMall/activityInfo/activityInfo?activityId="
+    }
+    return this.postRequest(`${this.BASE_URL}open/activity/get-order-params`, params);
+  }
+
+  
+}
+
+
+export default Integralinfo

+ 67 - 66
app.json

@@ -1,69 +1,70 @@
 {
-    "pages": [
-        "pages/welfareMall/index/index",
-        "pages/activityList/activityList",
-        "pages/activityInfo/activityInfo",
-        "pages/myCoupons/myCoupons",
-        "pages/index/index",
-        "pages/receiveCoupon/receiveCoupon",
-        "pages/logs/logs",
-        "pages/signIn/activity/activity",
-        "pages/signIn/record/record",
-        "pages/welfareMall/personal/personal",
-        "pages/welfareMall/historical/historical",
-        "pages/welfareMall/order/orderCompletion",
-        "pages/welfareMall/refund/refund",
-        "pages/welfareMall/feedback/feedback",
-        "pages/welfareMall/activityList/activityList",
-        "pages/welfareMall/activityInfo/activityInfo",
-        "pages/luckDraw/detail",
-        "pages/luckDraw/index",
-        "pages/luckDraw/profile",
-        "pages/luckDraw/recordPrize",
-        "pages/welfareMall/coupon/coupon",
-        "pages/welfareMall/writeOff/writeOff",
-        "pages/welfareMall/staff/isStaff",
-        "pages/welfareMall/staff/distinguish",
-        "pages/welfareMall/staff/noStaff",
-        "pages/welfareMall/staffManage/staffManage",
-        "pages/welfareMall/couponFitStore/index",
-        "pages/welfareMall/couponFitFood/index",
-        "pages/welfareMall/refundInfo/refundInfo",
-        "pages/welfareMall/buyInfo/buyInfo"
-    ],
-    "window": {
-        "backgroundTextStyle": "light",
-        "navigationBarBackgroundColor": "#fff",
-        "navigationBarTitleText": "Weixin",
-        "navigationBarTextStyle": "black"
-    },
-    "usingComponents": {
-        "page-wrap": "components/pageWrap/index"
-    },
-    "style": "v2",
-    "sitemapLocation": "sitemap.json",
-    "tabBar": {
-        "color": "#1b1b1b",
-        "selectedColor": "#1b1b1b",
-        "backgroundColor": "#ffffff",
-        "list": [
-            {
-                "text": "首页",
-                "pagePath": "pages/welfareMall/index/index",
-                "selectedIconPath": "images/welfareMall/home-active.png",
-                "iconPath": "images/welfareMall/home.png"
-            },
-            {
-                "text": "我的",
-                "pagePath": "pages/welfareMall/personal/personal",
-                "selectedIconPath": "images/welfareMall/user-active.png",
-                "iconPath": "images/welfareMall/user.png"
-            }
-        ]
-    },
-    "permission": {
-        "scope.userLocation": {
-            "desc": "本次获取位置,为了查看附加可用卡券的门店"
-        }
+  "pages": [
+    "pages/welfareMall/index/index",
+    "pages/activityList/activityList",
+    "pages/activityInfo/activityInfo",
+    "pages/myCoupons/myCoupons",
+    "pages/index/index",
+    "pages/receiveCoupon/receiveCoupon",
+    "pages/logs/logs",
+    "pages/signIn/activity/activity",
+    "pages/signIn/record/record",
+    "pages/welfareMall/personal/personal",
+    "pages/welfareMall/historical/historical",
+    "pages/welfareMall/order/orderCompletion",
+    "pages/welfareMall/refund/refund",
+    "pages/welfareMall/feedback/feedback",
+    "pages/welfareMall/activityList/activityList",
+    "pages/welfareMall/activityInfo/activityInfo",
+    "pages/luckDraw/detail",
+    "pages/luckDraw/index",
+    "pages/luckDraw/profile",
+    "pages/luckDraw/recordPrize",
+    "pages/welfareMall/coupon/coupon",
+    "pages/welfareMall/writeOff/writeOff",
+    "pages/welfareMall/staff/isStaff",
+    "pages/welfareMall/staff/distinguish",
+    "pages/welfareMall/staff/noStaff",
+    "pages/welfareMall/staffManage/staffManage",
+    "pages/welfareMall/couponFitStore/index",
+    "pages/welfareMall/couponFitFood/index",
+    "pages/welfareMall/refundInfo/refundInfo",
+    "pages/welfareMall/buyInfo/buyInfo",
+    "pages/integral/integral"
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#fff",
+    "navigationBarTitleText": "Weixin",
+    "navigationBarTextStyle": "black"
+  },
+  "usingComponents": {
+    "page-wrap": "components/pageWrap/index"
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json",
+  "tabBar": {
+    "color": "#1b1b1b",
+    "selectedColor": "#1b1b1b",
+    "backgroundColor": "#ffffff",
+    "list": [
+      {
+        "text": "首页",
+        "pagePath": "pages/welfareMall/index/index",
+        "selectedIconPath": "images/welfareMall/home-active.png",
+        "iconPath": "images/welfareMall/home.png"
+      },
+      {
+        "text": "我的",
+        "pagePath": "pages/welfareMall/personal/personal",
+        "selectedIconPath": "images/welfareMall/user-active.png",
+        "iconPath": "images/welfareMall/user.png"
+      }
+    ]
+  },
+  "permission": {
+    "scope.userLocation": {
+      "desc": "本次获取位置,为了查看附加可用卡券的门店"
     }
+  }
 }

+ 89 - 0
pages/integral/integral.js

@@ -0,0 +1,89 @@
+// pages/integral/integral.js
+import Integralinfo from '../../api/integralinfo'
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    lock: false,
+    noResult: false,
+    noMore: false,
+    bannerList: [],
+    channelid: '',
+    shopid: '',
+    storeid: ''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    this.getBannerList()
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  },
+
+  getBannerList: function() {
+    Integralinfo.getBannerList({
+      channelid: this.channelid,
+      shopid: this.shopid,
+      storeid: this.storeid
+    }).then(res => {
+        console.log(res.data)
+        this.setData({
+            bannerList: res.data
+        })
+    }).catch(err => {
+        console.log(err)
+    })
+},
+       
+})

+ 4 - 0
pages/integral/integral.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "积分",
+  "usingComponents": {}
+}

+ 10 - 0
pages/integral/integral.wxml

@@ -0,0 +1,10 @@
+<!--pages/integral/integral.wxml-->
+<view class="integral-top">
+  <swiper class="integral-banner" autoplay="true" indicator-dots="true">
+  <block wx:for="{{bannerList}}" wx:key="key" data-id="{{item.id}}">
+    <swiper-item>
+      <image class="head-follow" src="{{item.image}}"></image>
+    </swiper-item>
+  </block>
+  </swiper>
+</view>

+ 35 - 0
pages/integral/integral.wxss

@@ -0,0 +1,35 @@
+/* pages/integral/integral.wxss */
+page{
+  background: #f5f5f5;
+  display:flex;
+  flex-flow: column nowrap;
+  justify-content: left;
+  align-items: center;
+  box-sizing: border-box;
+}
+/* 垂直方向布局,水平居中 **/
+.flex-column{
+  display: flex;
+  flex-flow: column nowrap;
+  align-items: center;
+  justify-content: left;
+}
+
+/* 水平方向布局,垂直居中 **/
+.flex-row{
+  display: flex;
+  flex-flow: row nowrap;
+  align-items: center;
+  justify-content: center;
+}
+.integral-banner{
+  width: 750rpx;
+  height: 256rpx;
+  border-radius: 8px;
+  overflow: hidden;
+}
+
+.head-follow{
+  width: 100%;
+  height: 100%;
+}