zhashaonan 6 rokov pred
rodič
commit
c21ff8267d

+ 1 - 1
app.js

@@ -44,7 +44,7 @@ App({
                             client_type: "mini"
                           },
                           success: function (res) {
-                            console.log(res.data.datas.HPHPSESSID);
+                            // console.log(res.data.datas.HPHPSESSID);
                             wx.setStorageSync('session_id', res.data.datas.HPHPSESSID);
                             if (res.statusCode == 200) {
                               let current_url = "/" + getCurrentPages()[0].route;

+ 5 - 6
pages/brand/brand.js

@@ -1,5 +1,5 @@
 const getReq = require('./../../config.js').getReq;
-import recordSource from '../../utils/recordSource'
+import recordSource from '../../utils/recordSource';
 let app = getApp();
 Page({
 
@@ -33,16 +33,15 @@ Page({
     const hot_id = options.hot_id ? options.hot_id : '';
     const keyword = options.keyword ? options.keyword : '';
     const curpage = this.data.curpage;
+    let fromSource = recordSource(app, `act=search&op=index&brand_id=${brand_id}&hot_id=${hot_id}&keyword=${keyword}&curpage=${curpage}&client_type=mini`);
     this.setData({
       hot_id,
       brand_id,
-      keyword
-    })
-    let self = this;
-    let fromSource = recordSource(app, `act=search&op=index&brand_id=${brand_id}&hot_id=${hot_id}&keyword=${keyword}&curpage=${curpage}&client_type=mini`)
-    this.setData({
+      keyword,
       fromSource: app.globalData.fromSource
     })
+    let self = this;
+
     
     getReq({
       act: 'search',

+ 15 - 4
pages/comments/comments.js

@@ -1,5 +1,7 @@
 // pages/comments/comments.js
 const getReq = require('./../../config.js').getReq
+import recordSource from '../../utils/recordSource'
+let app = getApp()
 Page({
 
   /**
@@ -17,6 +19,8 @@ Page({
     basicStar: './../image/basic_star.png',
     activeStar: '../../image/star.png',
     halfStar: '../../image/half_star.png',
+    fromSource: '',
+    firstLoad: true
   },
 
   /**
@@ -27,9 +31,12 @@ Page({
       common_id: options.common_id
     })
     this.getDatas(options.common_id, this.data.curpage)
-    // this.getDatas(2684, this.data.curpage)
   },
   getDatas(common_id, curpage) {
+    let fromSource = recordSource(app, `act=goods_common&op=comments&goods_commonid=${common_id}&curpage=${curpage}&page=10&client_type=mini`)
+    this.setData({
+      fromSource: app.globalData.fromSource
+    })
     wx.showLoading({
       title: '加载中'
     })
@@ -39,14 +46,16 @@ Page({
       op: 'comments',
       goods_commonid: common_id,
       curpage,
-      page: 10
+      page: 10,
+      from: fromSource
     }, function (res) {
       if (res.code == 200) {
         wx.hideLoading()
         let comments = self.createComments(res.datas.comments)
         self.setData({
           comments: self.data.comments.concat(comments),
-          hasmore: res.datas.mobile_page.hasmore
+          hasmore: res.datas.mobile_page.hasmore,
+          firstLoad: false
         })
       }
       else {
@@ -134,7 +143,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    if(!this.data.firstLoad) {
+      app.setFromSource(this.data.fromSource)
+    }
   },
 
   /**

+ 1 - 1
pages/components/template/loadAnimation/loadAnimation.wxss

@@ -25,7 +25,7 @@
   
 }
 .big-img {
-  height: 500rpx;
+  height: 750rpx;
 }
 .content-wrap {
   padding: 0 30rpx;

+ 28 - 18
pages/confirmOrder/confirmOrder.js

@@ -1,7 +1,8 @@
 // pages/confirmOrder/confirmOrder.js
 const getReq = require('./../../config.js').getReq
+import recordSource from '../../utils/recordSource';
 import Bundle from '../../utils/Bundle'
-let appInstance = getApp()
+let app = getApp()
 Page({
 
   /**
@@ -18,7 +19,12 @@ Page({
     cart_id: '',
     n_goods_list: [],
     freight: 0,
-    freight_hash: ''
+    freight_hash: '',
+    fromSource: '',
+    available_pred: 0,
+    room_bonus: 0,
+    full_discount: 0,
+    opgoods_discount: 0
   },
 
   /**
@@ -36,14 +42,6 @@ Page({
       cart_id
     })
     this.getDatas(goods_id, iscart, num, cart_id)
-
-    // 测试套装数据
-    //  this.getDatas(goods_id, 1, num, '16403,16406')
-    //  act:member_buy
-    // cart_id:16403,16406
-    // op:step_first
-    // from:YWN0PWNhcnQmb3A9ZXhnb29kcyZjdXJwYWdlPTE%3D
-    // ifcart:1
   },
   getDatas(goods_id, ifcart, num, cart_id) {
     wx.showLoading({
@@ -57,28 +55,34 @@ Page({
     else {
       goods_datas = cart_id;
     }
+    let fromSource = recordSource(app, `act=member_buy&op=step_first&curpage=1&cart_id=${goods_datas}&ifcart=${ifcart}&client_type=mini`)
     let params = {
       act: 'member_buy',
       op: 'step_first',
       curpage: 1,
       cart_id: goods_datas,
       ifcart,
+      from: fromSource
     }
-
+    
+    this.setData({
+      fromSource: app.globalData.fromSource
+    })
 
     getReq(params, function (res) {
       wx.hideLoading()
       if (res.code == 200) {
+        console.log('confirmOrder:', res);
         let datas = res.datas
         let { goods_list, summary, bundling, payinfo } = res.datas
         let { freight_hash, goods_amount, freight, available_pred = 0, user_bonus = 0, room_bonus = 0, full_discount = 0, opgoods_discount = 0 } = payinfo
-        let totalPrice = goods_amount + freight - available_pred - user_bonus - room_bonus - full_discount - opgoods_discount
+        let totalPrice = (goods_amount + freight - available_pred - user_bonus - room_bonus - full_discount - opgoods_discount).toFixed(2)
 
         let n_goods_list = self.getNewGoodsList(goods_list, summary, bundling)
 
         if (datas.address) {
           let { true_name, mob_phone, area_info, address, address_id, area_id, city_id } = datas.address;
-          appInstance.checkDefaultAddress({
+          app.checkDefaultAddress({
             true_name,
             mob_phone,
             area_info,
@@ -95,7 +99,12 @@ Page({
           freight,
           totalPrice,
           firstLoad: false,
-          defaultAddress: datas.address
+          defaultAddress: datas.address,
+
+          available_pred,
+          room_bonus,
+          full_discount,
+          opgoods_discount
         })
       }
       else {
@@ -104,7 +113,7 @@ Page({
           title: res.message,
           duration: 2000
         })
-        appInstance.globalData.fcodeErr = res.message
+        app.globalData.fcodeErr = res.message
         wx.navigateBack()
       }
     })
@@ -172,7 +181,7 @@ Page({
           title: res.message,
           duration: 2000
         })
-        appInstance.globalData.fcodeErr = res.message
+        app.globalData.fcodeErr = res.message
         wx.navigateBack()
       }
     })
@@ -204,8 +213,9 @@ Page({
    */
   onShow: function () {
     if (!this.data.firstLoad) {
+      app.setFromSource(this.data.fromSource)
       let self = this
-      let defaultAddress = appInstance.globalData.defaultAddress
+      let defaultAddress = app.globalData.defaultAddress
       
       let { city_id, area_id } = defaultAddress
       let { freight_hash } = self.data
@@ -220,7 +230,7 @@ Page({
         if (res.code == 200) {
            let { freight } = res.datas
            let prev_freight = self.data.freight
-           let totalPrice = self.data.totalPrice - prev_freight + freight
+           let totalPrice = (self.data.totalPrice - prev_freight + freight).toFixed(2)
            self.setData({
             totalPrice,
             freight,

+ 16 - 0
pages/confirmOrder/confirmOrder.wxml

@@ -94,12 +94,28 @@
       <view class="col666">商品总价</view>
       <view class="">¥ {{datas.payinfo['goods_amount']}}</view>
     </view>
+
+    <view class="expenses_info" wx:if="{{full_discount}}">
+      <view class="col666">{{order_info['full_desc']}}</view>
+      <view class="">- ¥ {{full_discount}}</view>
+    </view>
+
+    <view class="expenses_info" wx:if="{{opgoods_discount}}">
+      <view class="col666">{{order_info['opgoods_desc']}}</view>
+      <view class="">- ¥ {{opgoods_discount}}</view>
+    </view>
+
     <view class="expenses_info" wx:for="{{datas.payinfo['bonus_rates']}}" wx:for-index="idx" wx:key="idx">
       <view>
         <text class="col666">红包抵扣</text>
       </view>
       <view class="">- ¥ {{item.total}}</view>
     </view>
+
+    <view class="expenses_info" wx:if="{{room_bonus}}">
+      <view class="col666">共享基金抵扣</view>
+      <view class="">- ¥ {{room_bonus}}</view>
+    </view>
     <view class="expenses_info">
       <view class="col666">运费</view>
       <view class="">+ ¥ {{freight}}</view>

+ 4 - 7
pages/details/details.wxml

@@ -9,7 +9,7 @@
   <view class="pos_rel" >
     <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-color="#E8E8E8"
       circular="true" indicator-active-color="##2B2B2B" style="height:750rpx">
-      <block wx:for="{{imgUrls}}" wx:key="*this">
+      <block wx:for="{{imgUrls}}" wx:for-index="idx" wx:key="idx" >
         <swiper-item>
           <image src="{{item}}" class="slide-image" mode="widthFix" style="width: 100%;" />
         </swiper-item>
@@ -61,7 +61,7 @@
   </view>
 
   <block wx:if="{{bundleList}}">
-    <block wx:for="{{bundleList}}" wx:key="*this" wx:for-index="index">
+    <block wx:for="{{bundleList}}" wx:key="index" wx:for-index="index">
       <view class="place-bac247"></view>
       <view class="comments_box">
         <view class="comments_header">-套装推荐-</view>
@@ -75,7 +75,7 @@
         <view class="{{bundleIndex == index ? 'bundle_list_hide' : ''}}">
           <view class="align_center mb20 mt20 ">
             <scroll-view class="scroll-view_H" scroll-x="true" style="width: 100%">
-              <block wx:for="{{item['bundlesSumary']}}" wx:key="*this" wx:for-item="bundle" wx:for-index="bundleIndex">
+              <block wx:for="{{item['bundlesSumary']}}" wx:key="bundleIndex" wx:for-item="bundle" wx:for-index="bundleIndex">
                 <view class="scroll-view-item_H bundle_scroll_view" catchtap="bundleDetail" data-id="{{bundle['goods_id']}}">
                   <image class="bundle_img" src="{{bundle['goods_image_url']}}"></image>
                   <view class="bundle_desc">{{bundle['goods_mobile_name']}}</view>
@@ -91,7 +91,7 @@
 
         <!-- 展开后的样式  -->
         <view class="{{bundleIndex == index ? '' : 'bundle_list_hide'}}">
-          <block wx:for="{{item['bundlesSumary']}}" wx:key="*this" wx:for-item="bundle" wx:for-index="bundleIndex">
+          <block wx:for="{{item['bundlesSumary']}}" wx:key="bundleIndex" wx:for-item="bundle" wx:for-index="bundleIndex">
             <view class="order_goods_content vux-1px-b" style="padding-left: 0;" catchtap="bundleDetail" data-id="{{bundle['goods_id']}}">
               <image class="bundle_img" src="{{bundle['goods_image_url']}}"></image>
               <view class="order_content_middle default_place_flex over_hidden">
@@ -161,9 +161,6 @@
                 <image mode="widthFix" class="content_src_img" src="{{imgItem}}"></image>
               </view>
             </view>
-
-            <!-- <image bindtap='showCarousel' mode="widthFix" data-images="{{item.images}}" data-current="{{imgIndex}}" class="content_img"
-              src="{{imgItem}}" wx:for-item="imgItem" wx:for="{{item.images}}" wx:for-index="imgIndex" wx:key="imgIndex"></image> -->
           </view>
           <view class="content" wx:if="{{item.explain}}">掌柜回复:{{item.explain}}</view>
         </view>

+ 1 - 0
pages/details/details.wxss

@@ -242,6 +242,7 @@
 
 .comment {
   position: relative;
+  background: #fff;
   color: #a7a7a7;
   padding: 0 30rpx;
   /* padding-top: 28rpx;

+ 17 - 5
pages/fcode/fcode.js

@@ -1,5 +1,7 @@
 // pages/fcode/fcode.js
-const getReq = require('./../../config.js').getReq;
+const getReq = require('./../../config.js').getReq
+import recordSource from '../../utils/recordSource'
+let app = getApp()
 Page({
 
   /**
@@ -7,7 +9,9 @@ Page({
    */
   data: {
     special_datas: {},
-    summery: []
+    summery: [],
+    fromSource: '',
+    firstLoad: true
   },
 
   /**
@@ -18,14 +22,20 @@ Page({
       title: '加载中'
     });
     let self = this
+    let fromSource = recordSource(app, `act=member_fcode&op=list&client_type=mini`)
+    this.setData({
+      fromSource: app.globalData.fromSource
+    })
     getReq({
       act: 'member_fcode',
-      op: 'list'
+      op: 'list',
+      from: fromSource
     }, function (res) {
       if (res.code == 200) {
           self.setData({
             special_datas: res.datas,
-            summery: res.datas.summary
+            summery: res.datas.summary,
+            firstLoad: false
           });
           wx.hideLoading();
       }
@@ -43,7 +53,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-  
+    if(!this.data.firstLoad) {
+      app.setFromSource(this.data.fromSource)
+    }
   },
 
   /**

+ 5 - 1
pages/login/login.js

@@ -85,7 +85,11 @@ Page({
             let prev = getCurrentPages()[len - 2]
             if (prev['route'].indexOf('/shareBonus/shareBonus') != -1) {
               let { type_sn, relay_id } = prev.options
-              wx.redirectTo({
+              // wx.redirectTo({
+              //   url: `/pages/shareBonus/shareBonus?type_sn=${type_sn}&relay_id=${relay_id}`
+              // })
+
+              wx.reLaunch({
                 url: `/pages/shareBonus/shareBonus?type_sn=${type_sn}&relay_id=${relay_id}`
               })
               return

+ 27 - 6
pages/orderPaySn/orderPaySn.js

@@ -1,5 +1,6 @@
 const getReq = require('./../../config.js').getReq
-let appInstance = getApp()
+import recordSource from '../../utils/recordSource'
+let app = getApp()
 Page({
 
   /**
@@ -9,7 +10,14 @@ Page({
     order_info: {},
     defaultAddress: null,
     firstLoad: true,
-    user_bonus: 0
+    user_bonus: 0,
+    fromSource: '',
+    totalPrice: '',
+    
+    available_pred: 0,
+    room_bonus: 0,
+    full_discount: 0,
+    opgoods_discount: 0
   },
 
   /**
@@ -21,19 +29,25 @@ Page({
   },
   getDatas(pay_sn) {
     let self = this;
+    let fromSource = recordSource(app, `act=member_order&op=pay_info&pay_sn=${pay_sn}&client_type=mini`)
+    this.setData({
+      fromSource: app.globalData.fromSource
+    })
     wx.showLoading({
       title: '加载中',
     })
     getReq({
       act: 'member_order',
       op: 'pay_info',
-      pay_sn: pay_sn
+      pay_sn: pay_sn,
+      from: fromSource
     }, function (res) {
       wx.hideLoading();
       if (res.code == 200) {
+        console.log(res);
         let { order_info } = res.datas.order     
         let { goods_amount, shipping_fee, available_pred = 0, user_bonus = 0, room_bonus = 0, full_discount = 0, opgoods_discount = 0 } = order_info   
-        let totalPrice = goods_amount + shipping_fee - available_pred - user_bonus - room_bonus - full_discount - opgoods_discount
+        let totalPrice = (goods_amount + shipping_fee - available_pred - user_bonus - room_bonus - full_discount - opgoods_discount).toFixed(2)
         self.setData({
           defaultAddress: {
             mob_phone: res.datas.order.reciver_info.mob_phone,
@@ -44,7 +58,13 @@ Page({
           order_info: res.datas.order.order_info,
           firstLoad: false,
           totalPrice,
-          user_bonus
+          user_bonus,
+
+          available_pred,
+          room_bonus,
+          full_discount,
+          opgoods_discount
+
         });
       }
       else {
@@ -121,7 +141,8 @@ Page({
    */
   onShow: function () {
     if (!this.data.firstLoad) {
-      let defaultAddress = appInstance.globalData.defaultAddress
+      let defaultAddress = app.globalData.defaultAddress
+      app.setFromSource(this.data.fromSource)
       if (defaultAddress) {
         this.setData({
           defaultAddress

+ 16 - 1
pages/orderPaySn/orderPaySn.wxml

@@ -34,11 +34,26 @@
       <view class="">¥ {{order_info['goods_amount']}}</view>
     </view>
 
-    <view class="expenses_info">
+    <view class="expenses_info" wx:if="{{full_discount}}">
+      <view class="col666">{{order_info['full_desc']}}</view>
+      <view class="">- ¥ {{full_discount}}</view>
+    </view>
+
+    <view class="expenses_info" wx:if="{{opgoods_discount}}">
+      <view class="col666">{{order_info['opgoods_desc']}}</view>
+      <view class="">- ¥ {{opgoods_discount}}</view>
+    </view>
+
+    <view class="expenses_info" wx:if="{{user_bonus}}">
       <view class="col666">红包抵扣</view>
       <view class="">- ¥ {{user_bonus}}</view>
     </view>
 
+    <view class="expenses_info" wx:if="{{room_bonus}}">
+      <view class="col666">共享基金抵扣</view>
+      <view class="">- ¥ {{room_bonus}}</view>
+    </view>
+
     <view class="expenses_info">
       <view class="col666">运费</view>
       <view class="">+ ¥ {{order_info['shipping_fee']}}</view>

+ 16 - 7
pages/order_tabs/orderTabs.js

@@ -1,5 +1,7 @@
 // pages/order_tabs/orderTabs.js
-const getReq = require('./../../config.js').getReq;
+const getReq = require('./../../config.js').getReq
+import recordSource from '../../utils/recordSource'
+let app = getApp()
 Page({
 
   /**
@@ -35,7 +37,9 @@ Page({
     selectedIndex: 0,
     state_type: '',
     tabs_title: '',
-    loading: false
+    loading: false,
+    fromSource: '',
+    firstLoad: true
   },
 
   /**
@@ -89,8 +93,10 @@ Page({
   },
 
   req_datas(type) {
+    let fromSource = recordSource(app, `act=member_order&op=list&page=15&curpage=${this.data.curpage}&state_type=${type}&client_type=mini`)
     this.setData({
-      loading: true
+      loading: true,
+      fromSource: app.globalData.fromSource
     });
     wx.showLoading({
       title: '加载中',
@@ -110,9 +116,9 @@ Page({
       op: 'list',
       page: 15,
       curpage: this.data.curpage,
-      state_type: type
+      state_type: type,
+      from: fromSource
     }, function (res) {
-      // console.log(res);
       let orders = res.datas.orders;
       let addTimes = [];
       let hasmore = false;
@@ -132,7 +138,8 @@ Page({
         curpage,
         orders: self.data.orders.concat(orders),
         addTimes: self.data.addTimes.concat(addTimes),
-        loading: false
+        loading: false,
+        firstLoad: false
       });
 
       wx.hideLoading();
@@ -150,7 +157,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    if(!this.data.firstLoad) {
+      app.setFromSource(this.data.fromSource)
+    }
   },
 
   /**

+ 33 - 9
pages/person/person.js

@@ -1,5 +1,6 @@
 // pages/person/person.js
 const app = getApp();
+import recordSource from '../../utils/recordSource'
 const getReq = require('./../../config.js').getReq;
 Page({
 
@@ -19,15 +20,16 @@ Page({
     pre_send_count: 0, // 待发货 20
     pre_receive_count: 0, // 待收货 30
     evaluate_count: 0, // 已收货 40
-    bonus_total: 0
-    
+    bonus_total: 0,
+    fromSource: '',
+    firstLoad: true
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    
   },
 
   /**
@@ -41,6 +43,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
+  
+
+    
     const count = this.data.login_count;
     if (!app.globalData.userInfo && count <= 2) {
       this.setData({
@@ -60,11 +65,25 @@ Page({
       });
       return;
     }
-  
+    let fromSource = this.data.fromSource
+    console.log('appglobaldata:', app.globalData.fromSource);
+
+    if(this.data.firstLoad) {
+      fromSource = recordSource(app, `act=member_order&op=orderCountState&client_type=mini`)
+      this.setData({
+        fromSource: app.globalData.fromSource
+      })
+    }
+    else {
+      app.setFromSource(this.data.fromSource)
+    }
+    console.log('fromSource:', fromSource);
 
     const userInfo = app.globalData.userInfo || null;
     const nickName = userInfo.nickName || '';
     const avatarUrl = userInfo.avatarUrl || '../../image/mine_logo_icon.png';
+
+
     let self = this
     getReq({
       act: 'cart',
@@ -73,7 +92,8 @@ Page({
       if (res.code == 200) {
         self.setData({
           userInfo: { nickName, avatarUrl },
-          bonus_rate: res.datas.bonus_rate
+          bonus_rate: res.datas.bonus_rate,
+          firstLoad: false
         })
       }
     })
@@ -84,20 +104,23 @@ Page({
     }, function (res) {
       if (res.code == 200) {
         self.setData({
-          addr_num: res.datas.sub_titles.addr_num
+          addr_num: res.datas.sub_titles.addr_num,
+          firstLoad: false
         })
       }
     })
     getReq({
       act: 'member_order',
-      op: 'orderCountState'
+      op: 'orderCountState',
+      from: fromSource
     }, function (res) {
       if (res.code == 200) {
         self.setData({
           pre_pay_count: 0, // 待付款 10
           pre_send_count: 0, // 待发货 20
           pre_receive_count: 0, // 待收货 30
-          evaluate_count: 0
+          evaluate_count: 0,
+          firstLoad: false
         })
         let { order_count } = res.datas
         if(order_count.length) {
@@ -132,7 +155,8 @@ Page({
       if (res.code == 200) {
         let { bonus_total } = res.datas
         self.setData({
-          bonus_total
+          bonus_total,
+          firstLoad: false
         })
       }
     })

+ 4 - 4
pages/person/person.wxml

@@ -38,7 +38,7 @@
 
     <view class='order_info'>
       <view>
-        <navigator url="/pages/order_tabs/orderTabs?state_type=state_new" class="pos_rel">
+        <navigator url="/pages/order_tabs/orderTabs?state_type=state_new" hover-class="none" class="pos_rel">
           <image style='width:35rpx;height: 35rpx;' src='../../image/person/payments_due_icon.png'></image>
           <view class="mt8">
             <text>待付款</text>
@@ -47,7 +47,7 @@
         </navigator>
       </view>
       <view>
-        <navigator url="/pages/order_tabs/orderTabs?state_type=state_pay" class="pos_rel">
+        <navigator url="/pages/order_tabs/orderTabs?state_type=state_pay" hover-class="none" class="pos_rel">
           <image style='width:35rpx;height: 35rpx;' src='../../image/person/shipping_term_icon.png'></image>
           <view class="mt8">
             <text>待发货</text>
@@ -56,7 +56,7 @@
         </navigator>
       </view>
       <view>
-        <navigator url="/pages/order_tabs/orderTabs?state_type=state_send" class="pos_rel">
+        <navigator url="/pages/order_tabs/orderTabs?state_type=state_send" hover-class="none" class="pos_rel">
           <image style='width:35rpx;height: 35rpx;' src='../../image/person/goods_receipt_icon.png'></image>
           <view class="mt8">
             <text>待收货</text>
@@ -65,7 +65,7 @@
         </navigator>
       </view>
       <view>
-        <navigator url="/pages/order_tabs/orderTabs?state_type=state_success" class="pos_rel">
+        <navigator url="/pages/order_tabs/orderTabs?state_type=state_success" hover-class="none" class="pos_rel">
           <image style='width:35rpx;height: 35rpx;' src='../../image/person/evaluated_icon.png'></image>
           <view class="mt8">
             <text>已收货</text>

+ 1 - 1
pages/person/person.wxss

@@ -211,7 +211,7 @@
   line-height: 40rpx;
   left: 50%;
   top: -18rpx;
-  background: #2b2b2b;
+  background: #FF4E4E;
   color: #fff;
   font-size: 20rpx;
   border-radius: 50%;

+ 17 - 5
pages/search/search.js

@@ -1,5 +1,7 @@
 // pages/search/search.js
-const getReq = require('./../../config.js').getReq;
+const getReq = require('./../../config.js').getReq
+import recordSource from '../../utils/recordSource'
+let app = getApp()
 Page({
 
   /**
@@ -7,7 +9,9 @@ Page({
    */
   data: {
     special_datas: {},
-    summery: []
+    summery: [],
+    fromSource: '',
+    firstLoad: true
   },
 
   /**
@@ -21,15 +25,21 @@ Page({
       title: '加载中'
     });
     let self = this;
+    let fromSource = recordSource(app, `act=search&op=history&curpage=1&client_type=mini`)
+    this.setData({
+      fromSource: app.globalData.fromSource
+    })
     getReq({
       act: 'search',
       op: 'history',
-      curpage: 1
+      curpage: 1,
+      from: fromSource
     }, function (res) {
       if (res.code == 200) {
         self.setData({
           special_datas: res.datas,
-          summery: res.datas.summary
+          summery: res.datas.summary,
+          firstLoad: false
         });
       }
       setTimeout(function () {
@@ -49,7 +59,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-  
+    if(!this.data.firstLoad) {
+      app.setFromSource(this.data.fromSource)
+    }
   },
 
   /**

+ 4 - 3
pages/shareBonus/shareBonus.js

@@ -27,14 +27,15 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    console.log('options:', options);
-    let { type_sn, relay_id } = options
+    
     if (!app.globalData.userInfo) {
       wx.navigateTo({
         url: `/pages/login/login`
       });
       return;
     }
+    console.log('options:', options);
+    let { type_sn, relay_id } = options
     let params = {
       act: 'bonusex',
       op: 'open',
@@ -353,7 +354,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    console.log('onshow bonus');
   },
 
   /**

+ 23 - 8
pages/shopCart/shopCart.js

@@ -1,5 +1,7 @@
-const getReq = require('./../../config.js').getReq;
+const getReq = require('./../../config.js').getReq
 import Bundle from '../../utils/Bundle'
+import recordSource from '../../utils/recordSource'
+let app = getApp()
 Page({
   data: {
     loadAnimation: true,
@@ -15,7 +17,9 @@ Page({
     special_datas: {},
     prop_special: [],
     summery: [],
-    canShow: false
+    canShow: false,
+    fromSource: '',
+    firstLoad: true
   },
   onLoad: function () {
 
@@ -76,10 +80,24 @@ Page({
 
   req_datas() {
     let self = this;
+    let fromSource = this.data.fromSource
+
+    if (this.data.firstLoad) {
+      fromSource = recordSource(app, `act=cart&op=list&minest_cartid=${self.data.curpage}&client_type=mini`);
+      this.setData({
+        fromSource: app.globalData.fromSource
+      })
+    }
+    else {
+      app.setFromSource(this.data.fromSource)
+    }
+
+
     getReq({
       act: 'cart',
       op: 'list',
-      minest_cartid: self.data.curpage
+      minest_cartid: self.data.curpage,
+      from: fromSource
     }, function (res) {
       if (res.code == 200) {
         let hasmore = res.datas.mobile_page.hasmore;
@@ -127,7 +145,8 @@ Page({
           free_info: free_info || self.data.free_info,
           summary: localSummary.concat(summary),
           cart_list: localCartList.concat(cart_list),
-          loadAnimation: false
+          loadAnimation: false,
+          firstLoad: false
         });
 
       }
@@ -284,10 +303,6 @@ Page({
       cart_id: carts
     }, function (res) {
       if (res.code == 200) {
-        // let datas = res.datas.payinfo;
-        // let allPrice = parseFloat((datas.goods_amount + datas.freight - datas.available_pred - datas.full_discount - datas.opgoods_discount).toFixed(2));
-        // let allGoodsPrice = parseFloat((datas.goods_amount).toFixed(2));
-
         let { payinfo } = res.datas
         let allPrice = parseFloat(payinfo['pay_car_pred'])
         let allGoodsPrice = parseFloat(payinfo['pay_car_nopred'])

+ 15 - 5
pages/special/special.js

@@ -1,5 +1,7 @@
 // pages/special/special.js
 const getReq = require('./../../config.js').getReq;
+import recordSource from '../../utils/recordSource';
+let app = getApp();
 Page({
 
   /**
@@ -8,7 +10,9 @@ Page({
   data: {
     special_datas: {},
     summery: [],
-    special_id:0
+    special_id:0,
+    fromSource: '',
+    firstLoad: true
   },
 
   /**
@@ -20,9 +24,11 @@ Page({
     wx.setNavigationBarTitle({
       title: title
     })
+    let fromSource = recordSource(app, `act=special&op=index&special_id=${special_id}&curpage=1&page=10&client_type=mini`)
     this.setData({
       special_id,
-      title
+      title,
+      fromSource: app.globalData.fromSource
     });
     var self = this;
     getReq({
@@ -30,12 +36,14 @@ Page({
       op: 'index',
       special_id,
       page: 10,
-      curpage: 1
+      curpage: 1,
+      from: fromSource
     }, function (res) {
       if (res.code == 200) {
         self.setData({
           special_datas: res.datas,
-          summery: res.datas.summary
+          summery: res.datas.summary,
+          firstLoad: false
         });
       }
     })
@@ -52,7 +60,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-  
+    if(!this.data.firstLoad) {
+      app.setFromSource(this.data.fromSource)
+    }
   },
 
   /**