bobo 3 gadi atpakaļ
vecāks
revīzija
e7590fa631

+ 6 - 2
api/welfareMall.js

@@ -124,12 +124,16 @@ class WelfareMall extends request {
        /**
    * 创建订单
    */
-  static createOrder(mobile,activityId,num,shopId="") {
+  static createOrder(mobile,activityId,num,shopId="", refStatisticsPostParam) {
+    refStatisticsPostParam = refStatisticsPostParam || {}
     let params = {
       activityId:activityId,
       memberMobile:mobile,
       num:num,
-      shopId:shopId
+      shopId:shopId,
+      scene: refStatisticsPostParam.scene || "",
+      channel: refStatisticsPostParam.channel || "0",
+      department: refStatisticsPostParam.department || "0"
     };
     return this.postRequest(`${this.BASE_URL}open/activity/create-order`, params);
   }

+ 2 - 1
components/statistics/index.js

@@ -25,8 +25,9 @@ class Statistics extends request {
             mobile: getMobileCache(),
             businessId: params.businessId || '',
         }
-
         this.postRequest(`${this.BASE_URL}open/statistics/record-app-visit-log`, postParam, true).then(_=>{}).catch(_=>{})
+
+        return postParam;
     }
 }
 

+ 2 - 2
pages/welfareMall/activityInfo/activityInfo.js

@@ -40,7 +40,7 @@ Page({
     this.getActivityDetail(options.activityId)
     }
 
-    Statistics.done({
+    this.refStatisticsPostParam = Statistics.done({
       module: 'activity:detail',
       action: 'visit',
       businessId: options.activityId,
@@ -173,7 +173,7 @@ Page({
       preventDup:false
     })
     try {
-      let res = await WelfareMall.createOrder(_self.data.userMobile, _self.data.detail.activityId,1);
+      let res = await WelfareMall.createOrder(_self.data.userMobile, _self.data.detail.activityId,1, "", this.refStatisticsPostParam);
       _self.setData({
         orderInfo: res.data,
       })

+ 3 - 3
utils/request.js

@@ -2,11 +2,11 @@ import util, { isFunc } from './util.js'
 class request {
 
     //本地的
-  //  static BASE_URL = 'http://localhost:8014/'
+//    static BASE_URL = 'http://localhost:8014/'
 //   pre环境的
-//   static BASE_URL = 'https://oapi.shpr.top/'
+   static BASE_URL = 'https://oapi.shpr.top/'
 //   正式的
-   static BASE_URL = 'https://vapi.hsayi.com/'
+//   static BASE_URL = 'https://vapi.hsayi.com/'
 //   @todo需要修改正式的域名
 
   static HEAD = {