Forráskód Böngészése

Merge branch 'bobo/feat/coupon-detail-statistics' into pre

bobo 3 éve
szülő
commit
6abdbddf68

+ 6 - 1
api/welfareMall.js

@@ -135,7 +135,7 @@ class WelfareMall extends request {
   }
 
   //获取支付参数
-  static getOrderParams(orderSn,openId) {
+  static getOrderParams(orderSn,openId,isOrderPayment=false) {
     let params = {
       orderSn:orderSn,
       source: "FREE_MINI_APP",
@@ -143,6 +143,11 @@ class WelfareMall extends request {
       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);
   }
 

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

@@ -1,6 +1,7 @@
 // pages/welfareMall/activityInfo/activityInfo.js
 import WelfareMall from '../../../api/welfareMall';
 import Activity from '../../../api/activity';
+import Statistics from '../../../components/statistics/index'
 const util = require('../../../utils/util.js');
 const app = getApp();
 Page({
@@ -33,6 +34,13 @@ Page({
     if(options.activityId){
     this.getActivityDetail(options.activityId)
     }
+
+    Statistics.done({
+      module: 'activity:detail',
+      action: 'visit',
+      businessId: options.activityId,
+    })
+    
   },
 
   /**
@@ -181,15 +189,16 @@ Page({
   async goPay() {
     // console.log(wx.getStorageSync('loginInfo').openId)
     var _self = this;
-      let result = await WelfareMall.getOrderParams(_self.data.orderInfo.orderSn,wx.getStorageSync('loginInfo').openId);
+      let result = await WelfareMall.getOrderParams(_self.data.orderInfo.orderSn,wx.getStorageSync('loginInfo').openId,true);
       // console.log(result);
       let res = result.data
-      wx.requestPayment({
+      wx.requestOrderPayment({
         timeStamp: res.wxPrePayVo.timeStamp,
         package: res.wxPrePayVo.pack,
         nonceStr: res.wxPrePayVo.nonceStr,
         signType: res.wxPrePayVo.signType,
         paySign: res.wxPrePayVo.paySign,
+        orderInfo:res.orderInfo,
         success: function (res) {
           //支付成功,跳转领取成功页面
           _self.setData({

+ 23 - 0
pages/welfareMall/index/index.js

@@ -13,6 +13,7 @@ Page({
       activityList:[],
       bannerList:[],
       navigationList:[],
+      adList:[],
       autoplay: true,
       interval: 5000,
       duration: 500,
@@ -134,6 +135,7 @@ Page({
       activityList:res.data.activityList,
       bannerList:res.data.bannerList,
       navigationList:res.data.navigationList,
+      adList:res.data.adList,
       grayTheme:res.data.config.grayTheme
     })
 
@@ -180,5 +182,26 @@ Page({
       })
     }
 
+  },
+
+  goToAd(e){
+    var appId = e.currentTarget.dataset.appid;
+    var path = e.currentTarget.dataset.path;
+ 
+    if(appId && path){
+      wx.navigateToMiniProgram({
+        appId: appId,
+        path: path,
+        success(res) {
+          // 打开成功
+        }
+      })
+    }
+    if(!appId && path){
+      wx.navigateTo({
+        url: path,
+      })
+    }
+
   }
 })

+ 12 - 0
pages/welfareMall/index/index.wxml

@@ -62,4 +62,16 @@
     </view>
   </view> -->
   </view>
+
+  <view class="jointly-info" wx:if="{{adList != null && adList.length > 0}}">
+    <view class="c_l_top flex-row">
+      <view class="c_l_top_l">沪上联名</view>
+    </view>
+    <view class="jointly-style">
+      <view class="jointly-list" wx:for="{{adList}}" data-appid="{{item.appId}}" data-path="{{item.path}}" wx:key="unique" bindtap="goToAd">
+        <image class="jointly-img" src="{{item.figure}}"></image>
+        <view class="jointly-text over-ellipsis-two">{{item.title}}</view>
+      </view>
+    </view>
+  </view>
 </page-wrap>

+ 49 - 6
pages/welfareMall/index/index.wxss

@@ -65,7 +65,7 @@ Page {
   margin-top: 26rpx;
   box-sizing: border-box;
   padding: 40rpx 36rpx;
-  margin-bottom: 40rpx;
+  margin-bottom: 20rpx;
 }
 .c_l_top{
   width: 100%;
@@ -142,7 +142,7 @@ color: #B01717;
 }
 
 /*用来包裹所有的小圆点  */
- 
+
 .dots {
   width: 210rpx;
   height: 20rpx;
@@ -154,7 +154,7 @@ color: #B01717;
   transform: translateX(-50%);
   bottom: 0rpx;
 }
- 
+
 
 .swiper_box {
   height: auto;
@@ -162,7 +162,7 @@ color: #B01717;
 }
 
 /*未选中时的小圆点样式 */
- 
+
 .dot {
   width: 40rpx;
   height: 10rpx;
@@ -171,9 +171,9 @@ color: #B01717;
   background-color: #ccc;
   opacity: 0.5;
 }
- 
+
 /*选中以后的小圆点样式  */
- 
+
 .active_dot {
   background-color: #333;
   opacity: 0.5;
@@ -182,3 +182,46 @@ color: #B01717;
   -webkit-filter: grayscale(100%);
   filter: grayscale(100%);
 }
+
+.jointly-info {
+  width: 676rpx;
+  background: #FFFFFF;
+  border-radius: 10rpx;
+  box-sizing: border-box;
+  padding: 40rpx 48rpx;
+  margin-bottom: 38rpx;
+}
+
+.jointly-style{
+  width: 100%;
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-between;
+}
+
+.jointly-list{
+  width: 260rpx;
+  height: 330rpx;
+  margin-top: 24rpx;
+  display: flex;
+  flex-flow: column nowrap;
+  align-items: center;
+  justify-content: left;
+}
+
+.jointly-img{
+  width: 260rpx;
+  height: 260rpx;
+}
+
+.jointly-text{
+  font-size: 26rpx;
+  width: 260rpx;
+  font-weight: 700;
+  margin-top: 26rpx;
+  text-align: center;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+}

+ 15 - 8
pages/welfareMall/order/orderCompletion.js

@@ -24,13 +24,16 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    var that = this;
-    that.orderSn = options.ordersn
+    // var that = this;
+    // that.orderSn = options.ordersn
+    if(!options.ordersn){
+      return;
+    }
     this.setData({
       orderSn: options.ordersn,
     })
-      this.getOrder(that.orderSn);
-      this.data.orderSn = options.ordersn;
+      this.getOrder(options.ordersn);
+      // this.data.orderSn = options.ordersn;
   },
 
   
@@ -58,10 +61,12 @@ Page({
    * 订单数据--查询
    */
   selectOrder: async function(orderSn) {
+   
     let res = await WelfareMall.getOrder({
       mobile: getMobileCache(),
       orderSn: orderSn,
     })
+    this.userOrderistView(res.data)
     await this.changeOrder(res.data.orderSn,res.data.status.value,res.data.status.showText);
   },
 
@@ -145,14 +150,15 @@ Page({
         return;
       }
       that.data.repeat = true;
-      let result = await WelfareMall.getOrderParams(that.data.orderSn,wx.getStorageSync('loginInfo').openId);
+      let result = await WelfareMall.getOrderParams(that.data.orderSn,wx.getStorageSync('loginInfo').openId,true);
       let res = result.data
-      wx.requestPayment({
+      wx.requestOrderPayment({
         timeStamp: res.wxPrePayVo.timeStamp,
         package: res.wxPrePayVo.pack,
         nonceStr: res.wxPrePayVo.nonceStr,
         signType: res.wxPrePayVo.signType,
         paySign: res.wxPrePayVo.paySign,
+        orderInfo:res.orderInfo,
         success: function (res) {
           //支付成功
           console.log(res);
@@ -240,9 +246,10 @@ Page({
       orderSn: that.data.orderSn,
       reason: reason,
     });
-    await that.cancel();
-    // await that.onLoad(that.options);
+     that.cancel();
+
     await that.selectOrder(that.data.orderSn);
+   
     // await wx.navigateTo({
     //   url:  "../refund/refund?orderSn=" + that.data.orderSn
     // })

+ 6 - 0
pages/welfareMall/personal/personal.wxml

@@ -46,7 +46,13 @@
         </view>
       </view>
     </view>
+
+
   </custom-page>
+
+  <view>
+  <button open-type="contact" class="call" type="warn" size="mini">联系我们</button>
+</view>
 </page-wrap>
 
 <!-- 使用wxs 手机号码中间四位显示为*号 -->

+ 19 - 0
pages/welfareMall/personal/personal.wxss

@@ -235,3 +235,22 @@ page{
   filter: grayscale(100%);
 }
 
+.call{
+  position: fixed;
+  width: 50px!important;
+  height: 50px!important;
+  border-radius: 25px!important;
+  right: 0px!important;
+  bottom: 30px!important;
+  font-size: 10px!important;
+  background-color: #B01717!important;
+  color: #fff!important;
+  display: flex;
+  flex-flow: row nowrap;
+  justify-content: center;
+  align-items: center;
+  padding: 0px!important;
+  line-height: 50px!important;
+  z-index: 9999;
+}
+

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

@@ -19,8 +19,8 @@ Page({
     storeList: [],
     index: 0,
     storeNo: '',
-    startDate: '',
-    endDate: '',
+    startDate: parseTime(new Date(), "{y}-{m}-{d}"),
+    endDate: parseTime(new Date(), "{y}-{m}-{d}"),
   },
 
   /**

+ 1 - 1
pages/welfareMall/writeOff/writeOff.wxml

@@ -19,7 +19,7 @@
             <view class="picker" wx:else>{{startDate}}</view>
           </view>
         </picker>
-        ~
+        
         <picker mode="date" value="{{endDate}}" bindchange="bindEndDateChange" start="2022-01-01">
           <view class="search-date flex-row">
             <view class="picker" wx:if="{{endDate == null || endDate == ''}}">分账时间止期</view>

+ 3 - 2
pages/welfareMall/writeOff/writeOff.wxss

@@ -72,12 +72,12 @@ page{
 }
 
 .search-text{
-  width: 480rpx;
+  width: 460rpx;
   margin-left: 28rpx;
   font-size: 28rpx;
   font-weight: 500;
   color: #A0A0A0;
-  justify-content: flex-start;
+  justify-content: space-between;
 }
 
 .search-text-close{
@@ -85,6 +85,7 @@ page{
   font-weight: 500;
   color: #A0A0A0;
   opacity: 0.5;
+  margin-left: 20rpx;
 }
 
 .writeOff-content{