瀏覽代碼

红包更新

zhashaonan 6 年之前
父節點
當前提交
19625e5522

+ 3 - 3
app.js

@@ -15,7 +15,7 @@ App({
             act:"login",
             op:"ministart",
             code: res.code,
-            client_type:"ios"
+            client_type:"mini"
           },
           // url: `https://api.weixin.qq.com/sns/jscode2session?appid=wxfdaeb25e38c4c47e&secret=e5b5055cbc608d10c6de0d877c221270&js_code=${res.code}&grant_type=authorization_code`,
           success:function(res){
@@ -41,7 +41,7 @@ App({
                             act: "login",
                             op: "wxauthen",
                             // op: "wxauthor",
-                            client_type: "ios"
+                            client_type: "mini"
                           },
                           success: function (res) {
                             console.log(res.data.datas.HPHPSESSID);
@@ -84,7 +84,7 @@ App({
                               act: "login",
                               op: "wxauthen",
                               // op: "wxauthor",
-                              client_type: "ios"
+                              client_type: "mini"
                             },
                             success: function (res) {
                               // console.log(res.data.datas.HPHPSESSID)

+ 2 - 1
app.json

@@ -17,7 +17,8 @@
     "pages/orderPaySn/orderPaySn",
     "pages/fcode/fcode",
     "pages/login/login",
-    "pages/shareBonus/shareBonus"
+    "pages/shareBonus/shareBonus",
+    "pages/pandaBonus/pandaBonus"
   ],
   "window": {
     "backgroundTextStyle": "dark",

+ 27 - 12
app.wxss

@@ -33,6 +33,12 @@ page {
 .pos_rel {
   position: relative;
 }
+.pos_abs {
+  position: absolute;
+}
+.text_right {
+  text-align: right;
+}
 .text_center {
   text-align: center;
 }
@@ -59,6 +65,9 @@ page {
 .f20 {
   font-size: 20rpx;
 }
+.f22 {
+  font-size: 22rpx;
+}
 .f24 {
   font-size: 24rpx;
 }
@@ -116,6 +125,12 @@ page {
 .mt20 {
   margin-top: 20rpx;
 }
+.mt30 {
+  margin-top: 30rpx;
+}
+.mt60 {
+  margin-top: 60rpx;
+}
 .mb10 {
   margin-bottom: 10rpx;
 }
@@ -214,18 +229,18 @@ page {
   position: relative;
 }
 .arrow_right::after {
-    position: absolute;
-    content: " ";
-    height: 14rpx;
-    width: 14rpx;
-    border-width: 2rpx 2rpx 0 0;
-    border-color: #999999;
-    border-style: solid;
-    -webkit-transform: rotate(45deg);
-    transform: rotate(45deg);
-    top: 50%;
-    right: -15rpx;
-    margin-top: -7rpx;
+  position: absolute;
+  content: " ";
+  height: 14rpx;
+  width: 14rpx;
+  border-width: 2rpx 2rpx 0 0;
+  border-color: #999999;
+  border-style: solid;
+  -webkit-transform: rotate(45deg);
+  transform: rotate(45deg);
+  top: 50%;
+  right: -15rpx;
+  margin-top: -7rpx;
 }
 .back_top_btn {
   position: fixed;

+ 1 - 0
config.js

@@ -9,6 +9,7 @@ let api = "http://a.lrlz.com/mobile/index.php";
 function getReq(data, callback, fail) {
   let options = {
     client_type: 'ios'
+    // client_type: 'mini'
   }
   data = Object.assign({}, options, data);
   let session_id = wx.getStorageSync('session_id');

二進制
image/bonus/advert.png


二進制
image/bonus/cloud.png


二進制
image/bonus/coin.png


二進制
image/bonus/female.png


二進制
image/bonus/icon_king.png


二進制
image/bonus/icon_logo.png


二進制
image/bonus/icon_open.png


二進制
image/bonus/icon_pin.png


二進制
image/bonus/time_bg.png


二進制
image/bonus/top_bg.png


+ 18 - 15
pages/login/login.js

@@ -14,54 +14,54 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-       let url = options.url || ''
-       this.setData({
-         url
-       })
+    let url = options.url || ''
+    this.setData({
+      url
+    })
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady: function () {
-  
+
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-  
+
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
   onHide: function () {
-  
+
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-  
+
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
-  
+
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-  
+
   },
-  userInfoHandler(e){
+  userInfoHandler(e) {
     let self = this
     if (e.detail.errMsg == "getUserInfo:ok") {
       app.globalData.userInfo = e.detail.userInfo;
@@ -75,16 +75,19 @@ Page({
           act: "login",
           op: "wxauthen",
           // op: "wxauthor",
-          client_type: "ios"
+          client_type: "mini"
         },
         success: function (res) {
           console.log('res:', res)
+          console.log(getCurrentPages());
           wx.setStorageSync('session_id', res.data.datas.HPHPSESSID);
           if (res.statusCode == 200) {
             app.globalData.backLogin = true;
-            if(self.data.url) {
-              wx.reLaunch({
-                url: `/pages/shareBonus/shareBonus?url=${self.data.url}`
+            let len = getCurrentPages().length
+            let prev = getCurrentPages()[len - 2]
+            if (prev['route'].indexOf('/pandaBonus/pandaBonus') != -1) {
+              wx.redirectTo({
+                url: "/pages/pandaBonus/pandaBonus"
               })
               return
             }

+ 2 - 2
pages/login/login.wxml

@@ -1,7 +1,7 @@
 <view class='flex_center' style='margin-top:200rpx;'>
-  <image style='width:150rpx;' mode='widthFix' src="../../image/mine_logo_icon.png"></image>
+  <image style='width:150rpx;height: 150rpx;' src="../../image/mine_logo_icon.png"></image>
 </view>
 <view style='font-size:30rpx;'>
   <view class='flex_center' style='margin-top:20rpx;'>需要你的授权才可以使用哦!</view>
 </view>
-<button  style='margin-top:80rpx;width:60%;' type="primary" open-type="getUserInfo" bindgetuserinfo="userInfoHandler">立即授权</button>
+<button  style='margin-top:80rpx;width:60%;height: 92rpx;' type="primary" open-type="getUserInfo" bindgetuserinfo="userInfoHandler">立即授权</button>

+ 1 - 1
pages/order_tabs/orderTabs.wxml

@@ -14,7 +14,7 @@
       <block wx:key="{{index}}" wx:for-item="goods_list"  wx:for="{{item.order_goods}}">
         <view class='order_content align_center'>
         <view class='order_image'>
-          <image style='width:140rpx;' mode='widthFix' src='{{goods_list.goods_image}}'></image>
+          <image style='width:140rpx;height: 140rpx;' src='{{goods_list.goods_image}}'></image>
         </view>
         <view class='order_info'>
           <view>

+ 341 - 0
pages/pandaBonus/pandaBonus.js

@@ -0,0 +1,341 @@
+// pages/pandaBonus/pandaBonus.js
+const app = getApp();
+const getReq = require('./../../config.js').getReq;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    openAnimation: true, // 点击开红包
+    activityType: '',  // 1 活动未开始
+    renderCount: [],
+    bonus_state: '',
+    mine_bonus: '',
+    reveive_info: '',
+    binded_info: [], // 领取列表
+    msg: '',
+    testsn: '59801536315351351916'
+  },
+//bonus_state: 'unstart'// 未开始 
+
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // type_sn=80571536215385881479
+    // 65611536217344159139 已过期红包
+    // 41291536220812950106 未开始
+    // act=bonusex&op=grab
+    // 80571536215385881479 已领取
+    // 18731536237157331856 已开始未领取 随机红包 // 测试领取之后
+
+    // 55511536307147470142 手气王 一个 随机
+
+    // 74561536308128119414 他人领取 点击查看详情
+    if (!app.globalData.userInfo) {
+      wx.navigateTo({
+        url: `/pages/login/login`
+      });
+      return;
+    }
+
+    console.log('onload');
+    let params = {
+      act: 'bonusex',
+      op: 'open',
+      type_sn: this.data.testsn
+    }
+    this.getDatas(params)
+  },
+  detail() {
+    console.log('---detail----');
+    let params = {
+      act: 'bonusex',
+      op: 'detail',
+      type_sn: this.data.testsn
+    }
+    this.getDatas(params)
+  },
+  grab() {
+    console.log('---grab----');
+    let params = {
+      act: 'bonusex',
+      op: 'grab',
+      type_sn: this.data.testsn
+    }
+    this.getDatas(params)
+  },
+  getDatas(params) {
+    let self = this
+    
+    getReq(params, function(res) {
+      if(res.code == 200) {
+        console.log('params:', params);
+        console.log(res);
+        let { type_info, bonus_state } = res.datas
+        if(bonus_state == 'unstart')  {
+        // bonus_state: unstart 活动未开始
+          let { send_start_date } = type_info
+          self.countTime(params, send_start_date)
+          self.setData({
+            bonus_state
+          })
+          return
+        }
+        else if(bonus_state == 'open') {
+          // open 活动开始, 可以点击, 红包金额有 固定, 随机
+          self.setData({
+            type_info,
+            bonus_state
+          })
+          return
+        }
+        else if(bonus_state == 'detail') {
+          // 已点开状态, 详情
+          let { avatars, mine_bonus } = res.datas
+          let { sender_id,  relayer_id} = type_info
+
+          let sender_head_src = self.senderHead(relayer_id, sender_id, avatars)
+          let reveive_info = self.receiveInfo(type_info) // 展示领取信息
+
+          //领取列表
+          let binded_info = []
+          if (res.datas['binded_info']) {
+            binded_info = self.getBindedInfo(res.datas['binded_info'], avatars, type_info)
+          }
+          if (mine_bonus) {
+            mine_bonus['bonus_value'] = parseInt(mine_bonus['bonus_value'] * 100 + 0.5) / 100
+          }
+          self.setData({
+            sender_head_src,
+            type_info,
+            bonus_state,
+            mine_bonus,
+            reveive_info,
+            binded_info
+          })
+          return 
+        }
+        else if(bonus_state == 'over') {
+          console.log('over');
+          let { msg } = res.datas
+          self.setData({
+            msg,
+            bonus_state
+          })
+          return
+        }
+        else if(bonus_state == 'end') {
+          console.log('end');
+          self.setData({
+            type_info,
+            bonus_state
+          })
+          return
+        }
+      }
+    });
+  },
+  getBindedInfo(binded_info, avatars, type_info) {
+    let self = this
+    return binded_info.map(item => {
+      if (avatars[item['user_id']]) {
+        let avatarItem = avatars[item['user_id']]
+        item['avatar'] = avatarItem['avatar']
+        let discount = parseInt(avatarItem['discount'] * 100 + 0.5)
+        if (discount != 0) {
+          discount = discount / 100
+        }
+        item['discount'] = discount
+      }
+      else {
+        item['avatar'] = '../../image/bonus/female.png'
+        item['discount'] = 0
+      }
+      item['is_king'] = self.isKing(type_info, item['bonus_value'])
+      item['format_time'] = self.formatTime(item['get_time'])
+      item['bonus_value'] = parseInt(item['bonus_value'] * 100 + 0.5) / 100
+      return item
+    })
+  },
+  // 判断手气最佳
+  isKing(type_info, bonus_value) {
+    let { total_num, binded_num, send_type, max_amount} = type_info
+    if (send_type != 1)return false;
+    if (parseInt(total_num) != parseInt(binded_num))return false;
+    if (parseInt(max_amount * 100) != parseInt(bonus_value * 100))return false;
+    return true
+  },
+
+
+  formatTime(time) {
+    let d = new Date(time * 1000)
+    let month = this.zero(d.getMonth() + 1)
+    let date = this.zero(d.getDate())
+    let h = this.zero(d.getHours())
+    let m = this.zero(d.getMinutes())
+    return `${month}-${date}  ${h}:${m}`
+  },
+
+  senderHead(relayer_id, sender_id, avatars) {
+    let sender_head_src = '../../image/bonus/female.png'
+    if(relayer_id > 0) {
+      sender_head_src = avatars[relayer_id]['avatar']
+    }
+    else if(sender_id > 0) {
+      sender_head_src = avatars[sender_id]['avatar']
+    }
+    
+    return sender_head_src
+  },
+  receiveInfo(type_info) {
+    let { total_num, binded_num} = type_info
+    if(total_num == binded_num) {
+      // 红包领完了
+      let timestr = `${total_num}个红包,${this.bindedTime(type_info['binded_period'])}` 
+      return timestr
+    }
+    else {
+      let timestr = `领取 ${binded_num}/${total_num}`
+      let isEndTime = this.isEnd(type_info['send_end_date'])
+      if (isEndTime == false) {
+        timestr += ',点击右上角继续分享此红包'
+      }
+      return timestr
+    }
+  },
+  isEnd(send_end_date) {
+    let sendDate = parseInt(send_end_date)
+    if (sendDate === 0){
+      return false
+    }
+    else {
+      return new Date().getTime >= sendDate * 1000
+    }
+  },
+  bindedTime(period) {
+    let min = 60
+    let hour = 3600
+    let day = 24 * 3600
+
+    let days = parseInt(period / day)
+    period = period % day
+
+    let hours = parseInt(period / hour)
+    period = period % hour
+
+    let mins = parseInt(period / min)
+    period = period % min
+
+    if(period > 0) {
+      mins += 1
+    }
+
+    let timestr = ''
+    if (days > 0) {
+      timestr += `${days}天`
+    }
+    if (hours > 0) {
+      timestr += `${hours}小时`
+    }
+    if (mins > 0) {
+      timestr += `${mins}分钟`
+    }
+    timestr += '领完'
+    return timestr
+
+  },
+
+
+  countTime(params, send_start_date) {
+    let times = parseInt(send_start_date - new Date().getTime() / 1000)
+    if(times <= 0) {
+      console.log(times);
+      // wx.redirectTo({
+      //   url: '/pages/pandaBonus/pandaBonus'
+      // })
+      this.getDatas(params) // 活动时间到了,重新请求
+      return
+    }
+    let h = Math.floor(times / 3600)
+        h = this.zero(h)
+    let m = Math.floor((times / 60) % 60)
+        m = this.zero(m)
+    let s = times % 60
+        s = this.zero(s)
+    let renderCount = [h.split(''), m.split(''), s.split('')]
+    this.setData({
+      renderCount
+    })
+    setTimeout(() => {
+      this.countTime(send_start_date)
+    }, 1000);
+
+  },
+  zero(n) {
+    n =  n >= 10 ? n.toString() : '0' + n
+    return n
+  },
+  open() {
+    this.setData({
+      openAnimation: false
+    })
+    this.grab()
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+  
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+  
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+  
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+    let imageUrl = '../../image/share_bonus.png'
+    return {
+      title: `点一下,你和TA都有红包!`,
+      path: `/pages/pandaBonus/pandaBonus`,
+      imageUrl: imageUrl
+    }
+  }
+})

+ 1 - 0
pages/pandaBonus/pandaBonus.json

@@ -0,0 +1 @@
+{}

+ 248 - 0
pages/pandaBonus/pandaBonus.wxml

@@ -0,0 +1,248 @@
+<!--pages/pandaBonus/pandaBonus.wxml-->
+<view>
+  <!-- 活动未开始 -->
+  <view class="default_container" wx:if="{{bonus_state == 'unstart'}}">
+    <view class="dot_left"></view>
+    <view class="dot_right"></view>
+    <image class="cloud_left" src="../../image/bonus/cloud.png"></image>
+    <image class="cloud_right" src="../../image/bonus/cloud.png"></image>
+    <view class="bg_content">
+      <image class="top_bg" src="../../image/bonus/top_bg.png"></image>
+      <view class="msg_box pos_rel">
+        <view class="name line_h68">让红包飞一会儿</view>
+        <view class="name line_h68">距离开抢时间还有</view>
+      </view>
+      <view class="time_box">
+        <image class="top_bg" src="../../image/bonus/time_bg.png"></image>
+        <view class="count_box">
+          <view class="count_text" wx:for="{{renderCount}}" wx:for-index="idx" wx:key="idx">
+            <view class="count_single" wx:for="{{item}}" wx:for-index="n" wx:key="n" wx:for-item="num">{{num}}</view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="bottom_pro">
+      <view class="line_h30">独家运营70多个知名化妆品品牌的天猫官方旗舰店</view>
+      <view class="flex_center ht30">
+        <image src="../../image/bonus/icon_logo.png" class="icon_logo"></image>
+        <view style="position: relative;top: 6rpx;">上海丽人丽妆化妆品股份有限公司</view>
+      </view>
+    </view>
+  </view>
+  <!-- 活动未开始 -->
+
+  <!-- 活动开始 -->
+
+  <view class="default_container" wx:if="{{bonus_state == 'open'}}">
+    <view class="dot_left"></view>
+    <view class="dot_right"></view>
+    <image class="cloud_left" src="../../image/bonus/cloud.png"></image>
+    <image class="cloud_right" src="../../image/bonus/cloud.png"></image>
+    <view class="bg_content">
+      <image class="top_bg" src="../../image/bonus/top_bg.png"></image>
+      <view class="msg_box pos_rel">
+        <view class="name line_h68">{{type_info['sender_name']}}</view>
+        <view class="msg line_h68" wx:if="{{type_info['send_type'] == 1}}">发了一个红包,金额随机</view>
+        <view class="msg line_h68" wx:else>发了一个红包,金额固定</view>
+      </view>
+      <view class="mgs_bottom pos_rel">
+        <view class="f56" catchtap="open">{{type_info['type_bless']}}</view>
+      </view>
+      <image wx:if="{{openAnimation}}" src="../../image/bonus/icon_open.png" class="open" catchtap="open"></image>
+      <image wx:else src="../../image/bonus/coin.png" class="open current_open"></image>
+    </view>
+    <view class="bottom_pro">
+      <view class="line_h30">独家运营70多个知名化妆品品牌的天猫官方旗舰店</view>
+      <view class="flex_center ht30">
+        <image src="../../image/bonus/icon_logo.png" class="icon_logo"></image>
+        <view style="position: relative;top: 6rpx;">上海丽人丽妆化妆品股份有限公司</view>
+      </view>
+    </view>
+  </view>
+  <!-- 活动开始 -->
+
+
+
+  <view class="default_container" wx:if="{{bonus_state == 'over'}}">
+    <view class="dot_left"></view>
+    <view class="dot_right"></view>
+    <image class="cloud_left" src="../../image/bonus/cloud.png"></image>
+    <image class="cloud_right" src="../../image/bonus/cloud.png"></image>
+    <view class="bg_content">
+      <image class="top_bg" src="../../image/bonus/top_bg.png"></image>
+      <view class="mgs_bottom pos_rel over">
+          <view class="f56">{{msg}}</view>
+        </view>
+        <view class="look" catchtap="detail">查看领取详情></view>  
+    </view>
+    
+    <view class="bottom_pro">
+      <view class="line_h30">独家运营70多个知名化妆品品牌的天猫官方旗舰店</view>
+      <view class="flex_center ht30">
+        <image src="../../image/bonus/icon_logo.png" class="icon_logo"></image>
+        <view style="position: relative;top: 6rpx;">上海丽人丽妆化妆品股份有限公司</view>
+      </view>
+    </view>
+  </view>
+
+   <view class="default_container" wx:if="{{bonus_state == 'end'}}">
+    <view class="dot_left"></view>
+    <view class="dot_right"></view>
+    <image class="cloud_left" src="../../image/bonus/cloud.png"></image>
+    <image class="cloud_right" src="../../image/bonus/cloud.png"></image>
+    <view class="bg_content">
+      <image class="top_bg" src="../../image/bonus/top_bg.png"></image>
+        <view class="msg_box pos_rel">
+          <view class="name">{{type_info['sender_name']}}</view>
+          <view class="msg mt20">该红包已过期。如已领取,</view>
+          <view class="msg">请在熊猫美妆APP中“我的红包”中查看~</view>
+        </view>
+    </view>
+    <view class="bottom_pro">
+      <view class="line_h30">独家运营70多个知名化妆品品牌的天猫官方旗舰店</view>
+      <view class="flex_center ht30">
+        <image src="../../image/bonus/icon_logo.png" class="icon_logo"></image>
+        <view style="position: relative;top: 6rpx;">上海丽人丽妆化妆品股份有限公司</view>
+      </view>
+    </view>
+  </view>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  <!-- 红包未开封(活动未开始 未开启,已过期) -->
+  <!-- <view class="default_container" wx:if="{{bonus_state == 'unstart' || bonus_state == 'open' || bonus_state == 'over'}}">
+    <view class="dot_left"></view>
+    <view class="dot_right"></view>
+    <image class="cloud_left" src="../../image/bonus/cloud.png"></image>
+    <image class="cloud_right" src="../../image/bonus/cloud.png"></image>
+    <view class="bg_content">
+      <image class="top_bg" src="../../image/bonus/top_bg.png"></image>
+
+      <block wx:if="{{bonus_state == 'unstart'}}">
+        <view class="msg_box pos_rel">
+          <view class="name line_h68">让红包飞一会儿</view>
+          <view class="name line_h68">距离开抢时间还有</view>
+        </view>
+        <view class="time_box">
+          <image class="top_bg" src="../../image/bonus/time_bg.png"></image>
+          <view class="count_box">
+            <view class="count_text" wx:for="{{renderCount}}" wx:for-index="idx" wx:key="idx">
+              <view class="count_single" wx:for="{{item}}" wx:for-index="n" wx:key="n" wx:for-item="num">{{num}}</view>
+            </view>
+          </view>
+        </view>
+        <view style="font-size: 50rpx;position: relative;z-index: 100" catchtap="test">测试领取</view>
+
+      </block>
+
+
+      <block wx:if="{{bonus_state == 'open'}}">
+        <view class="msg_box pos_rel">
+          <view class="name line_h68">{{type_info['sender_name']}}</view>
+          <view class="msg line_h68" wx:if="{{type_info['send_type'] == 1}}">发了一个红包,金额随机</view>
+          <view class="msg line_h68" wx:else>发了一个红包,金额固定</view>
+        </view>
+        <view class="mgs_bottom pos_rel">
+          <view class="f56" catchtap="open">{{type_info['type_bless']}}</view>
+        </view>
+
+        <image wx:if="{{openAnimation}}" src="../../image/bonus/icon_open.png" class="open" catchtap="open"></image>
+        <image wx:else src="../../image/bonus/coin.png" class="open current_open"></image>
+      </block>
+
+      <block wx:if="{{bonus_state == 'over'}}">
+        <view class="mgs_bottom pos_rel">
+          <view class="f56" catchtap="open">{{msg}}</view>
+        </view>
+      </block>
+
+
+    </view>
+    <view class="bottom_pro">
+      <view class="line_h30">独家运营70多个知名化妆品品牌的天猫官方旗舰店</view>
+      <view class="flex_center ht30">
+        <image src="../../image/bonus/icon_logo.png" class="icon_logo"></image>
+        <view style="position: relative;top: 6rpx;">上海丽人丽妆化妆品股份有限公司</view>
+      </view>
+    </view>
+  </view> -->
+
+
+
+
+
+
+
+  <!-- 开了后的样式 , 即为 details -->
+  <view class="grab_container" wx:if="{{bonus_state == 'detail'}}">
+    <view class="pos_rel">
+      <image class="common_bg" src="https://passport.lrlz.com/data/resource/mobile/bonus/imgaes/content_bg.png"></image>
+      <view class="top_title">熊猫美妆</view>
+      <image class="sender_head" src="{{sender_head_src}}"></image>
+    </view>
+    <view class="grab_header">
+      <view class="grab_bonus_name">{{type_info['type_name']}}
+        <image class="icon_pin" src="../../image/bonus/icon_pin.png"></image>
+      </view>
+      <view class="grab_prompt">{{type_info['type_bless']}}</view>
+    </view>
+
+    <view class="mt30" wx:if="{{mine_bonus}}">
+      <view class="f28"><text class="grab_bonus_price">{{mine_bonus['bonus_value']}}</text>元</view>
+    </view>
+
+    <view class="receive_info tb_line">{{reveive_info}}</view>
+
+    <block wx:if="{{binded_info.length}}">
+      <view class="receive_list">
+        <view class="receive_item" wx:for="{{binded_info}}" wx:for-index="idx" wx:key="idx">
+          <image class="personal_image" src="{{item['avatar']}}"></image>
+          <view class="personal_content">
+            <view class="item_paragraph f26 col333"><text>{{item['user_name']}}</text></view>
+            <view class="item_paragraph f22 col333 mt10" wx:if="{{item['discount'] != 0}}">
+              <text>已累计节省{{item['discount']}}元</text>
+            </view>
+            <view class="item_paragraph f22 col333 mt10" wx:if="{{item['user_comment']}}">
+              <text>{{item['user_comment']}}</text>
+            </view>
+          </view>
+
+          <view class="text_right">
+            <view class="f26 col333">{{item['bonus_value']}}元</view>
+            <view class="f22 mt10 col666">{{item['format_time']}}</view>
+            <view wx:if="{{item['is_king']}}" style="color: #ffad4a;" class="align_center f22">
+              <image class="icon_king" src="../../image/bonus/icon_king.png"></image>手气最佳
+            </view>
+          </view>
+        </view>
+      </view>
+    </block>
+
+
+
+    <image class="briefing_address" src="../../image/bonus/advert.png"></image>
+  </view>
+
+
+</view>

+ 297 - 0
pages/pandaBonus/pandaBonus.wxss

@@ -0,0 +1,297 @@
+/* pages/pandaBonus/pandaBonus.wxss */
+.default_container {
+  position: fixed;
+  left: 0;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  z-index: 999;
+  background: #e14f48;
+  color: #ffe7b8;
+  text-align: center;
+}
+.bg_content {
+  position: relative;
+  height: 71%;
+}
+.top_bg {
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+}
+.msg_box {
+  padding-top: 148rpx;
+}
+
+.time_box {
+  margin: 80rpx 60rpx 0;
+  height: 100rpx;
+  position: relative;
+}
+.count_box {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 2;
+  font-size: 86rpx;
+  font-weight: bold;
+  color: #fff;
+}
+.count_text {
+  width: 172rpx;
+  padding: 0 4rpx;
+  display: flex;
+  justify-content: space-between;
+  box-sizing: border-box;
+  font-family: aAlternate;
+}
+.count_single {
+  width: 70rpx;
+}
+.f56 {
+  font-size: 56rpx;
+}
+.ht30 {
+  height: 30rpx;
+}
+.line_h30 {
+  line-height: 30rpx;
+}
+.line_h68 {
+  line-height: 68rpx;
+}
+.name {
+  font-size: 50rpx;
+}
+.msg {
+  font-size: 32rpx;
+  color: #ffd39b;
+}
+.mgs_bottom {
+  margin-top: 150rpx;
+}
+.mgs_bottom.over {
+  margin-top: 300rpx;
+}
+.open {
+  position: absolute;
+  z-index: 999;
+  width: 200rpx;
+  height: 200rpx;
+  left: 0;
+  right: 0;
+  margin: 0 auto -100rpx;
+  bottom: 0;
+}
+.open.opa0 {
+  opacity: 0;
+}
+.open.current_open {
+  opacity: 1;
+  z-index: 1000;
+  animation: iconRotate .8s linear infinite
+}
+
+@keyframes iconRotate{
+  0% {transform: rotateY(0deg);}
+  50% {transform: rotateY(180deg);}
+  100% {transform: rotateY(360deg);}
+}
+
+
+
+
+.bottom_pro {
+  position: absolute;
+  left: 0;
+  bottom: 8%;
+  width: 100%;
+  font-size: 20rpx;
+  color: #fff;
+}
+.icon_logo {
+  width: 20rpx;
+  height: 20rpx;
+  margin-right: 10rpx;
+}
+.cloud_left, .cloud_right {
+  position: absolute;
+  z-index: 1;
+  bottom: 3%;
+  width: 88rpx;
+  height: 34rpx;
+}
+.cloud_left {
+  left: 4%;
+}
+.cloud_right {
+  right: 4%;
+}
+.dot_left, .dot_right {
+  position: absolute;
+  top: 2%;
+  z-index: 1;
+  width: 10rpx;
+  height: 10rpx;
+  border-radius: 50%;
+  background: #ff8a6b;
+}
+.dot_left {
+  left: 3%;
+}
+.dot_right {
+  right: 3%;
+}
+
+/* 开红包后的样式 */
+.grab_container {
+  min-height: 100vh;
+  -webkit-overflow-scrolling: touch;
+  /* height: 100%; */
+  text-align: center;
+  background: #FFFAF5;
+  position: relative;
+  /* color: #ffe7b8; */
+}
+.common_bg {
+  width: 100%;
+  height: 190rpx;
+}
+.top_title {
+  position: absolute;
+  z-index: 1;
+  left: 0;
+  top: 16rpx;
+  width: 100%;
+  font-size: 34rpx;
+  font-weight: bold;
+  color: #FDD9AA;
+}
+.sender_head {
+  position: absolute;
+  z-index: 1;
+  left: 50%;
+  bottom: 0;
+  margin-left: -60rpx;
+  margin-bottom: -60rpx;
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 50%;
+}
+
+.grab_header {
+  margin-top: 80rpx;
+  padding: 0 30rpx;
+}
+.grab_bonus_name {
+  color: #454545;
+  font-size: 32rpx;
+  font-weight: bold;
+}
+.icon_pin {
+  position: relative;
+  top: 2rpx;
+  margin-left: 4rpx;
+  width: 30rpx;
+  height: 30rpx;
+}
+.grab_prompt {
+  margin-top: 20rpx;
+  font-size: 28rpx;
+  color: #7E7E7E;
+}
+
+.grab_bonus_price {
+  font-size: 114rpx;
+  vertical-align: sub;
+  color: #444444;
+}
+.receive_info {
+  margin-top: 20rpx;
+  padding: 0 30rpx;
+  height: 80rpx;
+  line-height: 100rpx;
+  background: #FAF6F1;
+  font-size: 28rpx;
+  text-align: left;
+}
+.tb_line {
+  position: relative;
+}
+.tb_line::after {
+  content: '';
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 200%;
+  height: 200%;
+  transform: scale(.5);
+  transform-origin: 0 0;
+  pointer-events: none;
+  box-sizing: border-box;
+  border: 0 solid #d9d9d9;
+  border-width: 1px 0;
+}
+.receive_item {
+  position: relative;
+  display: flex;
+  padding: 30rpx;
+}
+.receive_item::after {
+  position: absolute;
+  z-index: 1;
+  content: '';
+  left: 30rpx;
+  right: 0;
+  bottom: 0;
+  height: 1px;
+  background: #d9d9d9;
+  transform: scaleY(.5);
+}
+.receive_item:last-child:after {
+  width: 0;
+  height: 0;
+}
+.personal_image {
+  width: 80rpx;
+  height: 80rpx;
+  border-radius: 50%;
+  margin-right: 28rpx;
+}
+.personal_content {
+  flex: 1;
+  padding-right: 30rpx;
+  box-sizing: border-box;
+  text-align: left;
+}
+.item_paragraph {
+  display: flex;
+  align-items: center;
+  /* justify-content: space-between; */
+}
+.briefing_address {
+  width: 670rpx;
+  height: 60rpx;
+  margin: 48rpx auto 30rpx;
+}
+.icon_king {
+  width: 30rpx;
+  height: 30rpx;
+  margin-right: 10rpx;
+}
+.look {
+  position: absolute;
+  left: 50rpx;
+  right: 50rpx;
+  bottom: 40%;
+  text-align: center;
+  font-size: 28rpx;
+  color: #ffe7b8;
+}

+ 6 - 2
pages/person/person.js

@@ -138,10 +138,14 @@ Page({
     })
   },
   shareBonus() {
-    let url = encodeURIComponent('https://passport.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=36061535965140897218')
+    // let url = encodeURIComponent('https://passport.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=36061535965140897218')
   
+    // wx.navigateTo({
+    //   url: `/pages/shareBonus/shareBonus?url=${url}`
+    // })
+
     wx.navigateTo({
-      url: `/pages/shareBonus/shareBonus?url=${url}`
+      url: `/pages/pandaBonus/pandaBonus`
     })
   },
   shareWebview() {

+ 22 - 12
pages/shareBonus/shareBonus.js

@@ -6,7 +6,8 @@ Page({
    * 页面的初始数据
    */
   data: {
-    webViewUrl:''
+    webViewUrl: '',
+    tempUrl: ''
   },
 
   /**
@@ -14,59 +15,68 @@ Page({
    */
   onLoad: function (options) {
     console.log(options.url);
+    let tempUrl = decodeURIComponent(options.url)
+    this.setData({
+      tempUrl
+    })
     if (!app.globalData.userInfo) {
       wx.navigateTo({
         url: `/pages/login/login?url=${options.url}`
       });
       return;
     }
-    let session_id = wx.getStorageSync('session_id')
-    let url = decodeURIComponent(options.url) + '&HPHPSESSID=' + session_id
-    this.setData({
-      webViewUrl: url
-    })
+
+
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady: function () {
-  
+
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-  
+    if (app.globalData.userInfo) {
+      let session_id = wx.getStorageSync('session_id')
+      let url = this.data.tempUrl + '&HPHPSESSID=' + session_id
+      console.log(url);
+      this.setData({
+        webViewUrl: url
+      })
+    }
+
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
   onHide: function () {
-  
+
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-  
+
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
-  
+
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-  
+
   },
 
   /**

+ 1 - 1
pages/shopCart/shopCart.js

@@ -36,7 +36,7 @@ Page({
     this.req_datas();
     // this.getDatas()
 
-    this.getFavorite()
+    // this.getFavorite()
 
   },
   getFavorite() {