zhashaonan 6 anni fa
parent
commit
de9f6ecb60

+ 5 - 1
app.js

@@ -126,12 +126,16 @@ App({
     userInfo: null,
     defaultAddress: null,
     fcodeErr: '',
-    backLogin:false
+    backLogin:false,
+    arrayTree: []
   },
   checkDefaultAddress(address) {
     this.globalData.defaultAddress = address
   },
   clearAddress() {
     this.globalData.defaultAddress = null
+  },
+  setArrayTree(tree) {
+    this.globalData.arrayTree = tree
   }
 })

+ 4 - 4
app.json

@@ -16,7 +16,8 @@
     "pages/addAddress/addAddress",
     "pages/orderPaySn/orderPaySn",
     "pages/fcode/fcode",
-    "pages/login/login"
+    "pages/login/login",
+    "pages/shareBonus/shareBonus"
   ],
   "window": {
     "backgroundTextStyle": "dark",
@@ -35,7 +36,7 @@
         "selectedIconPath": "./image/tabbar/selected_index.png",
         "pagePath": "pages/index/index",
         "text": "首页"
-      },   
+      },
       {
         "iconPath": "./image/tabbar/shopcart.png",
         "selectedIconPath": "./image/tabbar/selected_shopcart.png",
@@ -53,5 +54,4 @@
   "networkTimeout": {
     "request": 20000
   }
-}
-
+}

+ 3 - 1
app.wxss

@@ -62,7 +62,9 @@ page {
 .f24 {
   font-size: 24rpx;
 }
-
+.f26 {
+  font-size: 26rpx;
+}
 .f28 {
   font-size: 28rpx;
 }

+ 1 - 0
config.js

@@ -3,6 +3,7 @@
 let api = "http://a.lrlz.com/mobile/index.php";
 // let api = "http://121.43.114.153/mobile/index.php"
 // let api = "http://192.168.0.131/mobile/index.php";
+// let api = "http://192.168.0.200/mobile/index.php";
 
 
 function getReq(data, callback, fail) {

BIN
image/share_bonus.png


+ 23 - 10
pages/addAddress/addAddress.js

@@ -7,7 +7,7 @@ Page({
    * 页面的初始数据
    */
   data: {
-    checked: true,
+    checked: false,
     areas: [],
     tree: [],
     value: [0, 0, 0],
@@ -22,7 +22,10 @@ Page({
     area_id: '',
     isEdit: false,
     address_id: '',
-    city_id: ''
+    city_id: '',
+    bindName: '',
+    bindPhone: '',
+    bindAddress: ''
   },
 
   /**
@@ -32,8 +35,11 @@ Page({
     if (options.true_name) {
       this.setData({
         name: options.true_name,
+        bindName: options.true_name,
         mob_phone: options.mob_phone,
+        bindPhone: options.mob_phone,
         address: options.address,
+        bindAddress: options.address,
         area_info: options.area_info,
         area_id: options.area_id,
         isEdit: true,
@@ -74,15 +80,24 @@ Page({
       op: 'area',
       curpage: 1
     }, function (res) {
-      wx.hideLoading()
+      // wx.hideLoading()
       if (res.code == 200) {
-        let tree = self.arrayToTree(res.datas.areas)
+        let tree
+        if(appInstance.globalData.arrayTree.length) {
+          tree = appInstance.globalData.arrayTree
+        }
+        else {
+          tree = self.arrayToTree(res.datas.areas)
+          appInstance.setArrayTree(tree)
+        }
+        wx.hideLoading()
         self.setData({
           areas: res.datas.areas,
           tree,
           citys: tree[0].children,
           districts: tree[0].children[0].children
         })
+        
       }
       else {
         wx.showToast({
@@ -143,7 +158,7 @@ Page({
   },
   commmitAddress() {
     let self = this
-    let name = this.trim(this.data.name)   
+    let name = this.trim(this.data.name)
     if (!name) {
       wx.showToast({
         icon: 'none',
@@ -153,7 +168,7 @@ Page({
       return
     }
 
-    let phone = this.trim(this.data.mob_phone)   
+    let phone = this.trim(this.data.mob_phone)
     if (!(/^1(3|4|5|7|8)\d{9}$/.test(phone))) {
       wx.showToast({
         icon: 'none',
@@ -162,7 +177,7 @@ Page({
       })
       return
     }
-   
+
     let area_info = this.data.area_info
     if (!area_info) {
       wx.showToast({
@@ -193,7 +208,7 @@ Page({
       this.addArress(name, address, phone, area_info);
     }
   },
-  addArress(name, address, phone, area_info) {  
+  addArress(name, address, phone, area_info) {
     let self = this;
     getReq({
       act: 'member_address',
@@ -261,9 +276,7 @@ Page({
     getReq(params, function (response) {
       wx.hideLoading()
       console.log(response);
-
       if (response.code == 200) {
-
         wx.navigateBack()
       }
       else {

+ 9 - 9
pages/addAddress/addAddress.wxml

@@ -5,7 +5,7 @@
     <view class="info_cell vux-1px-b">
       <view class="info_cell_lable">收件人:</view>
       <view class="info_cell_content">
-        <input placeholder="请输入收件人" bindinput="bindKeyInput" data-value="name" value="{{name}}"/>
+        <input class="address_input" placeholder="请输入收件人" bindinput="bindKeyInput" data-value="name" value="{{bindName}}"/>
       </view>
     </view>
   </view>
@@ -14,7 +14,7 @@
     <view class="info_cell vux-1px-b">
       <view class="info_cell_lable">手机号码:</view>
       <view class="info_cell_content">
-         <input placeholder="请输入手机号码" type="number" bindinput="bindKeyInput" data-value="phone" value="{{mob_phone}}"/> 
+         <input class="address_input" placeholder="请输入手机号码" maxlength="11" type="number" bindinput="bindKeyInput" data-value="phone" value="{{bindPhone}}"/> 
       </view>
     </view>
   </view>
@@ -23,9 +23,6 @@
     <view class="info_cell vux-1px-b">
       <view class="info_cell_lable">地区:</view>
       <view class="info_cell_content common_cell_arrow">
-        <!-- <text>{{province.n}}</text>
-        <text class="ml8">{{city.n}}</text>
-        <text class="ml8">{{district.n}}</text> -->
         {{area_info}}
       </view>
     </view>
@@ -33,15 +30,17 @@
   </view>
 
   <view class="info_cell-wrap bacfff">
-    <view class="info_cell">
+    <!-- <view class="info_cell"> -->
+        <view class="align_center f28" style="min-height: 112rpx;">
       <view class="info_cell_lable">详细地址:</view>
-      <view class="info_cell_content">
-         <input  placeholder="请输入详细地址" bindinput="bindKeyInput" data-value="address" value="{{address}}"/> 
+      <view class="info_cell_content align_center">
+         <textarea  class="address_input" style="padding: 10rpx 0;" placeholder="请输入详细地址" auto-height bindinput="bindKeyInput" data-value="address" value="{{bindAddress}}"/> 
       </view>
     </view>
   </view>
 
-  <view class="checkbtn" bindtap='toggleChecked'>
+  <view class="checkbtn" >
+    <view class="align_center" bindtap='toggleChecked'>
     <view class="check_icon-box">
       <block wx:if="{{checked}}">
         <icon type="success" size="18" color="#2b2b2b"></icon>
@@ -52,6 +51,7 @@
     </view>
     <text class="">设为默认地址</text>
   </view>
+  </view>
 
 
 

+ 4 - 1
pages/addAddress/addAddress.wxss

@@ -34,7 +34,7 @@
   width: 36rpx;
   height: 36rpx;
   border-radius: 50%;
-  border: 2rpx solid #eaeaea;
+  border: 1rpx solid #666;
 }
 
 .check_icon-box {
@@ -151,4 +151,7 @@
   margin-top: 89rpx; 
   background-color: #eeeeee;
 }
+.address_input {
+  width: 440rpx;
+}
 

+ 9 - 0
pages/address/address.js

@@ -9,6 +9,7 @@ Page({
   data: {
     address_list: [],
     firstLoad: true,
+    fromPerson: false
   },
 
   /**
@@ -16,6 +17,13 @@ Page({
    */
   onLoad: function (options) {
     this.getDatas()
+    let len = getCurrentPages().length
+    let prev = getCurrentPages()[len - 2] 
+    if(prev['route'].indexOf('/person/person') != -1) {
+      this.setData({
+        fromPerson: true
+      })
+    }
   },
   getDatas() {
     wx.showLoading({
@@ -49,6 +57,7 @@ Page({
     })
   },
   check_address(e) {
+    if(this.data.fromPerson)return;
     let dataset = e.currentTarget.dataset
     let { address } = dataset
     let true_name = dataset.truename

+ 2 - 1
pages/address/address.wxml

@@ -8,7 +8,8 @@
     </view>
     <view class="address_line mt8">
       <text class="col333 mr16" wx:if="{{item.is_default == 1}}">[默认地址]</text>
-      <text >{{item.area_info}}{{item.address}}</text>
+      <text>{{item.area_info}}</text>
+      <view style="word-wrap:break-word;max-width: 100%;">{{item.address}}</view>
     </view>
     <view class="modify_address_wrap" catchtap="modify_address" data-truename="{{item.true_name}}" data-mobphone="{{item.mob_phone}}" data-areainfo="{{item.area_info}}" data-address="{{item.address}}" data-areaid="{{item.area_id}}" data-addressid="{{item.address_id}}" data-cityid="{{item.city_id}}">
       <image src="../../image/person/evaluated_icon.png" class="modify_address"></image>

+ 3 - 0
pages/address/address.wxss

@@ -11,7 +11,10 @@
 .address_line {
   display: flex;
   align-items: center;
+  flex-wrap: wrap;
   line-height: 38rpx;
+  padding-right: 50rpx;
+  box-sizing: border-box;
 }
 
 .add_address_btn {

+ 1 - 1
pages/components/blocks/commentsCarousel/commentsCarousel.wxss

@@ -6,7 +6,7 @@
   right: 0;
   top: 0;
   bottom: 0;
-  z-index: 99;
+  z-index: 999;
   background: #000;
 }
 

+ 17 - 9
pages/components/blocks/goods_item/goods_item.wxml

@@ -2,18 +2,26 @@
 <navigator url="/pages/details/details?goods_id={{goods.goods_id}}" hover-class="navigator-hover"> 
   <view class='goods_thumbnail'>
       <image class='img'  mode='scaleToFill' src="{{goods.goods_image_url}}"></image>
-      <view class='opgoods' wx:if="{{goods.is_opgoods}}">{{goods.opgoods_shortdesc}}</view>
+      <!-- <view class='opgoods' wx:if="{{goods.is_opgoods}}">{{goods.opgoods_shortdesc}}</view> -->
+      <view class='goods_desc one_line_hidden'>
+          <text>{{goods.goods_jingle}}</text>
+      </view>
   </view>
   <view class='goods_box'>
-    <view class="goods_msg">
-      <view class='goods_name'>
-          <text>{{goods.goods_mobile_name}}</text>
-      </view>
-      <view class='goods_desc'>
+    <!-- <view class="goods_msg"> </view> -->
+      <view class='goods_name one_line_hidden'>{{goods.goods_mobile_name}}</view>
+          
+      
+      <!-- <view class='goods_desc'>
           <text>{{goods.goods_jingle}}</text>
-      </view>
+      </view> -->
+   
+    <view class="goods_price col333">
+      <view class="align_center"><text class="f22">员工价</text><text class="f22 t_bold colD45">¥</text><text class="f30 ft_bold colD45">{{goods.goods_lowest_price}}</text></view>
+      <view class="col666 line-through ml20 tm_price">天猫价¥{{goods.goods_price}}</view>
     </view>
-    <view class="goods_price" wx:if="{{goods.act_type == 0}}">
+
+    <!-- <view class="goods_price" wx:if="{{goods.act_type == 0}}">
       <view>
         <text class="current_price">¥{{goods.bonus_price}}</text>
       </view>
@@ -39,7 +47,7 @@
         <text class="original_price">专柜价{{goods.goods_price}}</text>
         <text class="discount">红包抵{{goods.goods_price - goods.bonus_price}}元</text>
       </view>
-    </view>  
+    </view>   -->
   </view>
 </navigator>  
 </view>

+ 85 - 11
pages/components/blocks/goods_item/goods_item.wxss

@@ -1,10 +1,10 @@
 .goods_item {
   background: #fff;
   font-size: 22rpx;
-  width: 368rpx;
+  width: 360rpx;
   overflow: hidden;
-  margin-top: 6rpx;
-  margin-left: 6rpx;
+  margin-top: 10rpx;
+  margin-left: 10rpx;
 }
 
 .goods_item .img {
@@ -13,27 +13,52 @@
 }
 
 .goods_item .goods_name {
-  color: #4a4a4a;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  white-space: nowrap;
+  font-size: 24rpx;
+  font-weight: bold;
+  height: 33rpx;
+  line-height: 33rpx;
+  /* overflow:hidden; 
+  text-overflow:ellipsis;
+  display:-webkit-box; 
+  -webkit-box-orient:vertical;
+  -webkit-line-clamp:2; */
+  color: #333;
 }
-
-.goods_item .goods_desc {
+.goods_desc {
+  position: absolute;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  padding-left: 20rpx;
+  line-height: 42rpx;
+  background: #FFF5D8;
+  font-size: 24rpx;
+  color: #B89941;
+  box-sizing: border-box;
+}
+/* .goods_item .goods_desc {
   display: -webkit-box;
   -webkit-box-orient: vertical;
   -webkit-line-clamp: 2;
   overflow: hidden;
   color: #7e7e7e;
   min-height: 64rpx;
+} */
+
+.goods_price {
+  display: flex;
+  align-items: center;
+  height: 42rpx;
+  margin-top: 7rpx;
 }
 
+
 .goods_item .goods_box {
-  padding: 12rpx;
+  padding: 10rpx 13rpx 16rpx 20rpx;
 }
 
 .goods_item .goods_thumbnail {
-  border-bottom: 1rpx solid #f9f9f9;
+  /* border-bottom: 1rpx solid #f9f9f9; */
   position: relative;
 }
 
@@ -84,3 +109,52 @@
   border-bottom-right-radius: 20rpx;
   border-top-right-radius: 20rpx;
 }
+.tm_price {
+  font-size: 18rpx;
+  height: 42rpx;
+  line-height: 42rpx;
+}
+
+
+.one_line_hidden {
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+}
+.mt10 {
+  margin-top: 10rpx;
+}
+.ml20 {
+  margin-left: 20rpx;
+}
+.ft_bold {
+  font-weight: bold;
+}
+.f18 {
+  font-size: 18rpx;
+}
+.f22 {
+  font-size: 22rpx;
+}
+.f26 {
+  font-size: 26rpx;
+}
+.f30 {
+  font-size: 30rpx;
+}
+.col333 {
+  color: #333;
+}
+.col666 {
+  color: #666;
+}
+.colD45 {
+  color: #DD4545;
+}
+.line-through {
+  text-decoration: line-through;
+}
+.align_center {
+  display: flex;
+  align-items: center;
+}

+ 5 - 13
pages/confirmOrder/confirmOrder.js

@@ -167,7 +167,9 @@ Page({
     }, function (res) {
       wx.hideLoading()
       if (res.code == 200) {
-        let param = res.datas.param.data;
+        let param = res.datas.param.data
+        let pay_sn = res.datas.pay_sn
+        console.log(res);
         wx.requestPayment({
           timeStamp: param.timeStamp,         //时间戳,自1970年以来的秒数
           nonceStr: param.nonceStr, //随机串
@@ -175,24 +177,14 @@ Page({
           signType: param.signType,         //微信签名方式:
           paySign: param.paySign, //微信签名
           success: function (res) {
-            // wx.showToast({
-            //   icon: 'none',
-            //   title: res,
-            //   duration: 2000
-            // })
             wx.reLaunch({
               url: "/pages/index/index"
             })
-            console.log("成功:" + res);
-            console.log('支付成功')
           },
           fail: function (res) {
-            wx.showToast({
-              icon: 'none',
-              title: res,
-              duration: 2000
+            wx.redirectTo({
+              url: `/pages/orderPaySn/orderPaySn?pay_sn=${pay_sn}`
             })
-            console.log("失败:" + res);
           }
         });
       }

+ 2 - 2
pages/confirmOrder/confirmOrder.wxml

@@ -57,7 +57,7 @@
           <view class="order_letter_pro one_line_hidden">{{bl_item['goods_summary']['goods_spec']}}</view>
           <view>
             <text class="f30 col333 ft_bold mr10"><text class="f24 mr6">¥</text>{{bl_item['bl_goods_price']}}</text>
-            <text decode="{{true}}" class="col999 line-through f24">专柜价{{bl_item['goods_summary']['goods_price']}}</text>
+            <text decode="{{true}}" class="col999 line-through f24">天猫价{{bl_item['goods_summary']['goods_price']}}</text>
           </view>
         </view>
         <view class="order_content_nums">x{{item['goods_num']}}</view>
@@ -72,7 +72,7 @@
           <view>
             <text class="f30 col333 ft_bold mr10" wx:if="{{item['goods_summary']['act_type'] == 0}}"><text class="f24 mr6">¥</text>{{item['goods_summary']['bonus_price']}}</text>
             <text class="f30 col333 ft_bold mr10" wx:if="{{item['goods_summary']['act_type'] == 2}}"><text class="f24 mr6">¥</text>{{item['goods_summary']['goods_promotion_price']}}</text>
-            <text decode="{{true}}" class="col999 line-through f24">专柜价{{item['goods_summary']['goods_price']}}</text>
+            <text decode="{{true}}" class="col999 line-through f24">天猫价{{item['goods_summary']['goods_price']}}</text>
           </view>
         </view>
         <view class="order_content_nums">x{{item.goods_num}}</view>

+ 22 - 4
pages/details/details.js

@@ -46,9 +46,9 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    // let webViewUrl = `https://passport.lrlz.com/mobile/index.php?act=goods_common&op=detail&goods_id=${options.goods_id}&client_type=ios`
+    let webViewUrl = `https://passport.lrlz.com/mobile/index.php?act=goods_common&op=detail&goods_id=${options.goods_id}&client_type=ios`
     this.setData({
-      // webViewUrl,
+      webViewUrl,
       options_goods_id: options.goods_id
     })
     setInterval(() => {
@@ -89,7 +89,7 @@ Page({
           self.createComments(res.datas.comments)
         }
 
-        let goodsIdMap
+        let goodsIdMap = ''
         if (!self.data.goodsIdMap) {
           goodsIdMap = new Map()
           res.datas.summary.map(item => {
@@ -99,6 +99,7 @@ Page({
 
 
         let oneSummary = self.getOneSummary(res.datas.summary, goods_id)
+        console.log('oneSummary', oneSummary);
         let bundleList = ''
         if (oneSummary['have_bundle']) {
           let bundlingMap = new Map()
@@ -261,6 +262,18 @@ Page({
       })
     }
     else if (cartOrBuy == 'isBuy') {
+      if (this.data.getOneSummary.is_fcode) {
+        if (!this.data.getOneSummary.has_fcode) {
+          wx.showToast({
+            title: '您没有该商品F码,请领取F码后再购买.',
+            icon: 'none',
+            duration: 1500
+          })
+          return
+        }
+      }
+
+
       if (this.data.getOneSummary.goods_storage < 1) {
         wx.showToast({
           title: '客官!暂时没有库存!',
@@ -402,6 +415,12 @@ Page({
     })
   },
   addBundleCart(e) {
+    if (!app.globalData.userInfo) {
+      wx.navigateTo({
+        url: '/pages/login/login'
+      });
+      return;
+    }
     let bl_id =  e.currentTarget.dataset.blid
     getReq({
       act: 'cart',
@@ -465,7 +484,6 @@ Page({
       this.getDatas(this.data.getOneSummary.goods_id);
     }
   },
-
   /**
    * 生命周期函数--监听页面隐藏
    */

+ 6 - 4
pages/details/details.wxml

@@ -17,6 +17,7 @@
     </swiper>
   </view>
   <view class="place-bacd9"></view>
+  <!-- <view bindtap="toWebView">查看详情</view> -->
   <view class="promotion_header align_center" wx:if="{{getOneSummary['act_type'] == 2}}">
     <view class="promotion_single">限时特价</view>
     <view>还剩
@@ -27,7 +28,7 @@
     <view class="n_price_content align_center">
       <text class="f40 col2B2B2B ft_bold" wx:if="{{getOneSummary['act_type'] == 0}}">¥{{getOneSummary.bonus_price}}</text>
       <text class="f40 col2B2B2B ft_bold" wx:if="{{getOneSummary['act_type'] == 2}}">¥{{getOneSummary['goods_promotion_price']}}</text>
-      <text class="f24 col999 ml10 line-through">专柜价:¥{{getOneSummary.goods_price}}</text>
+      <text class="f24 col999 ml10 line-through">天猫价:¥{{getOneSummary.goods_price}}</text>
     </view>
     <view class="f24 col666 l_height34 mt4">库存:{{getOneSummary.goods_storage}}件</view>
     <view class="n_goods_title">
@@ -98,7 +99,7 @@
                 <view>
                   <text class="f30 col333 ft_bold mr10">
                     <text class="f24 mr6">¥</text>{{bundle['bl_goods_price']}}</text>
-                  <text decode="{{true}}" class="col999 line-through f24">专柜价{{bundle['goods_price']}}</text>
+                  <text decode="{{true}}" class="col999 line-through f24">天猫价{{bundle['goods_price']}}</text>
                 </view>
               </view>
               <image class="see_ensure_desc" style="right: 0;" src="../../image/back.png"></image>
@@ -204,13 +205,14 @@
       <view class="flexbox_item">
         <image class="goods_small_img" src="{{getOneSummary.goods_image_url}}"></image>
       </view>
-      <view class="flexbox_item">
+      <view class="flexbox_item" style="margin-left: -220rpx;">
         <view class="simple_goods_price">
           <text decode="{{true}}" wx:if="{{getOneSummary['act_type'] == 0}}">¥{{getOneSummary.bonus_price}}&nbsp;&nbsp;</text>
           <text decode="{{true}}" wx:if="{{getOneSummary['act_type'] == 2}}">¥{{getOneSummary['goods_promotion_price']}}&nbsp;&nbsp;</text>
-          <text class="goods_original_price line-through">专柜价{{getOneSummary.goods_price}}</text>
+          <text class="goods_original_price line-through">天猫价{{getOneSummary.goods_price}}</text>
         </view>
         <view class="f24">库存{{getOneSummary.goods_storage}}件</view>
+        <view class="f26 mt8">已选择:"{{datas.common_info.skus[sec_index]['spv_name']}}"</view>
         <block wx:if="{{getgift}}">
           <navigator url="/pages/details/details?goods_id={{item.gifts.gift_goods_id}}" wx:for="{{getgift}}" wx:index="giftindex" wx:key="giftindex">
             <view class="gifts_wrap one_line_hidden">

+ 18 - 4
pages/login/login.js

@@ -7,14 +7,17 @@ Page({
    * 页面的初始数据
    */
   data: {
-  
+    url: ''
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-  
+       let url = options.url || ''
+       this.setData({
+         url
+       })
   },
 
   /**
@@ -59,6 +62,7 @@ Page({
   
   },
   userInfoHandler(e){
+    let self = this
     if (e.detail.errMsg == "getUserInfo:ok") {
       app.globalData.userInfo = e.detail.userInfo;
       app.globalData.userInfo.nickname = e.detail.userInfo.nickName;
@@ -78,10 +82,20 @@ Page({
           wx.setStorageSync('session_id', res.data.datas.HPHPSESSID);
           if (res.statusCode == 200) {
             app.globalData.backLogin = true;
-            wx.navigateBack(-2);
+            if(self.data.url) {
+              wx.reLaunch({
+                url: `/pages/shareBonus/shareBonus?url=${self.data.url}`
+              })
+              return
+            }
+            wx.navigateBack();
           }
           else {
-
+            wx.showToast({
+              icon: 'none',
+              title: '登陆失败',
+              duration: 2000
+            })
           }
         }
       })

+ 11 - 6
pages/orderPaySn/orderPaySn.js

@@ -7,7 +7,8 @@ Page({
    */
   data: {
     order_info: {},
-    defaultAddress: null
+    defaultAddress: null,
+    firstLoad: true
   },
 
   /**
@@ -16,6 +17,7 @@ Page({
   onLoad: function (options) {
     let pay_sn = options.pay_sn;
     this.getDatas(pay_sn);
+    console.log(111);
   },
   getDatas(pay_sn) {
     let self = this;
@@ -29,7 +31,6 @@ Page({
     }, function (res) {
       wx.hideLoading();
       if (res.code == 200) {
-        console.log(res);
         self.setData({
           defaultAddress: {
             mob_phone: res.datas.order.reciver_info.mob_phone,
@@ -37,7 +38,8 @@ Page({
             area_info: res.datas.order.reciver_info.area,
             address: res.datas.order.reciver_info.street
           },
-          order_info: res.datas.order.order_info
+          order_info: res.datas.order.order_info,
+          firstLoad: false
         });
       }
       else {
@@ -117,9 +119,12 @@ Page({
   onShow: function () {
     if (!this.data.firstLoad) {
       let defaultAddress = appInstance.globalData.defaultAddress
-      this.setData({
-        defaultAddress
-      })
+      if (defaultAddress) {
+        this.setData({
+          defaultAddress
+        })
+      }
+
     }
   },
 

+ 26 - 6
pages/person/person.js

@@ -60,6 +60,7 @@ Page({
       });
       return;
     }
+  
 
     const userInfo = app.globalData.userInfo || null;
     const nickName = userInfo.nickName || '';
@@ -70,7 +71,6 @@ Page({
       op: 'rate_money'
     }, function (res) {
       if (res.code == 200) {
-        console.log(res);
         self.setData({
           userInfo: { nickName, avatarUrl },
           bonus_rate: res.datas.bonus_rate
@@ -83,7 +83,6 @@ Page({
       op: 'get'
     }, function (res) {
       if (res.code == 200) {
-        console.log('member_info:', res);
         self.setData({
           addr_num: res.datas.sub_titles.addr_num
         })
@@ -94,8 +93,13 @@ Page({
       op: 'orderCountState'
     }, function (res) {
       if (res.code == 200) {
-        console.log('member_order:', res);
-        let { order_count } = res.datas;
+        self.setData({
+          pre_pay_count: 0, // 待付款 10
+          pre_send_count: 0, // 待发货 20
+          pre_receive_count: 0, // 待收货 30
+          evaluate_count: 0
+        })
+        let { order_count } = res.datas
         if(order_count.length) {
           let length = order_count.length
           for(let i = 0; i < length; i++) {
@@ -126,15 +130,26 @@ Page({
       op: 'predepositex'
     }, function (res) {
       if (res.code == 200) {
-        console.log('member_bonus:', res);
         let { bonus_total } = res.datas
         self.setData({
           bonus_total
         })
       }
     })
+  },
+  shareBonus() {
+    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}`
+    })
+  },
+  shareWebview() {
+    let url = encodeURIComponent('https://passport.lrlz.com/hfive/test_mini_share/index.html')
 
-    
+    wx.navigateTo({
+      url: `/pages/webView/webView?url=${url}`
+    })
   },
 
   /**
@@ -175,6 +190,11 @@ Page({
       url: '/pages/webView/webView?url=https://passport.lrlz.com/hfive/feed_back/question_answer.html'
     })
   },
+  skip_bonus_rule() {
+    wx.navigateTo({
+      url: '/pages/webView/webView?url=https://passport.lrlz.com/hfive/panda_bonus_rule/index.html'
+    })
+  },
   skip_all_order() {
     wx.navigateTo({
       url: '/pages/order_tabs/orderTabs'

+ 36 - 21
pages/person/person.wxml

@@ -9,24 +9,24 @@
         <!-- <view class="mt15">
           <text class="bonus_balance_detail">></text>
         </view> -->
-        <view class="use_bonus_rules mt">红包使用规则></view>
+        <view class="use_bonus_rules" bindtap='skip_bonus_rule'>红包使用规则></view>
       </view>
     </div>
   </view>
 
 
   <view class="person_info">
-  <block wx:if="{{userInfo.avatarUrl != ''}}">
-     <image mode='widthFix' src="{{userInfo.avatarUrl}}" class='person_avatar_image'></image>
-     <text class='person_name'>{{userInfo.nickName}}</text>
-  </block>
-  <block wx:else>
-    <navigator url='/pages/login/login'>
+    <block wx:if="{{userInfo.avatarUrl != ''}}">
+      <image mode='widthFix' src="{{userInfo.avatarUrl}}" class='person_avatar_image'></image>
+      <text class='person_name'>{{userInfo.nickName}}</text>
+    </block>
+    <block wx:else>
+      <navigator url='/pages/login/login'>
         <image mode='widthFix' src="../../image/mine_logo_icon.png" class='person_avatar_image'></image>
         <text class='person_name'>请登录</text>
-    </navigator>
-  </block>
-</view>
+      </navigator>
+    </block>
+  </view>
 
   <view class="order_list">
     <view class='order_title flex_1px_d' bindtap='skip_all_order'>
@@ -37,8 +37,8 @@
     <view class='order_info'>
       <view>
         <navigator url="/pages/order_tabs/orderTabs?state_type=state_new" class="pos_rel">
-          <image style='width:35rpx;' mode='widthFix' src='../../image/person/payments_due_icon.png'></image>
-          <view>
+          <image style='width:35rpx;height: 35rpx;' src='../../image/person/payments_due_icon.png'></image>
+          <view class="mt8">
             <text>待付款</text>
           </view>
           <view class="sub_count" wx:if="{{pre_pay_count}}">{{pre_pay_count}}</view>
@@ -46,8 +46,8 @@
       </view>
       <view>
         <navigator url="/pages/order_tabs/orderTabs?state_type=state_pay" class="pos_rel">
-          <image style='width:35rpx;' mode='widthFix' src='../../image/person/shipping_term_icon.png'></image>
-          <view>
+          <image style='width:35rpx;height: 35rpx;' src='../../image/person/shipping_term_icon.png'></image>
+          <view class="mt8">
             <text>待发货</text>
           </view>
           <view class="sub_count" wx:if="{{pre_send_count}}">{{pre_send_count}}</view>
@@ -55,8 +55,8 @@
       </view>
       <view>
         <navigator url="/pages/order_tabs/orderTabs?state_type=state_send" class="pos_rel">
-          <image style='width:35rpx;' mode='widthFix' src='../../image/person/goods_receipt_icon.png'></image>
-          <view>
+          <image style='width:35rpx;height: 35rpx;' src='../../image/person/goods_receipt_icon.png'></image>
+          <view class="mt8">
             <text>待收货</text>
           </view>
           <view class="sub_count" wx:if="{{pre_receive_count}}">{{pre_receive_count}}</view>
@@ -64,16 +64,16 @@
       </view>
       <view>
         <navigator url="/pages/order_tabs/orderTabs?state_type=state_success" class="pos_rel">
-          <image style='width:32rpx;' mode='widthFix' src='../../image/person/evaluated_icon.png'></image>
-          <view>
+          <image style='width:35rpx;height: 35rpx;' src='../../image/person/evaluated_icon.png'></image>
+          <view class="mt8">
             <text>已收货</text>
           </view>
           <view class="sub_count" wx:if="{{evaluate_count}}">{{evaluate_count}}</view>
         </navigator>
       </view>
       <view bindtap='refund'>
-        <image style='width:35rpx;' mode='widthFix' src='../../image/person/refund_terms_icon.png'></image>
-        <view>
+        <image style='width:35rpx;height: 35rpx;' src='../../image/person/refund_terms_icon.png'></image>
+        <view class="mt8">
           <text>退款/售后</text>
         </view>
       </view>
@@ -87,10 +87,25 @@
         <text class='look_all_order arrow_right' decode="{{true}}">{{addr_num}}&nbsp;</text>
       </view>
     </navigator>
-    <view class='order_title' bindtap='skip_help'>
+    <navigator url="/pages/fcode/fcode">
+      <view class='order_title flex_1px_d'>
+        <text>我的F码</text>
+        <text class='look_all_order arrow_right'></text>
+      </view>
+    </navigator>
+    <view class='order_title flex_1px_d' bindtap='skip_help'>
       <text>帮助中心</text>
       <text class='look_all_order arrow_right' decode="{{true}}"></text>
     </view>
+
+    <view class='order_title' bindtap="shareBonus">
+      <text>测试红包</text>
+      <text class='look_all_order arrow_right' decode="{{true}}"></text>
+    </view>
+    <view class='order_title' bindtap="shareWebview">
+      <text>测试分享webview</text>
+      <text class='look_all_order arrow_right' decode="{{true}}"></text>
+    </view>
   </view>
 
   <!-- <view class='person_info_cell'>

+ 85 - 0
pages/shareBonus/shareBonus.js

@@ -0,0 +1,85 @@
+// pages/shareBonus/shareBonus.js
+const app = getApp();
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    webViewUrl:''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    console.log(options.url);
+    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 () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+  
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+  
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+  
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+    let imageUrl = '../../image/share_bonus.png';
+    let url = encodeURIComponent(this.data.webViewUrl);
+
+    return {
+      title: `点一下,你和TA都有红包!`,
+      path: `/pages/shareBonus/shareBonus?url=${url}`,
+      imageUrl: imageUrl
+    }
+  }
+})

+ 1 - 0
pages/shareBonus/shareBonus.json

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

+ 3 - 0
pages/shareBonus/shareBonus.wxml

@@ -0,0 +1,3 @@
+<!--pages/shareBonus/shareBonus.wxml-->
+<!-- <text>pages/shareBonus/shareBonus.wxml</text> -->
+<web-view src="{{webViewUrl}}"></web-view>

+ 1 - 0
pages/shareBonus/shareBonus.wxss

@@ -0,0 +1 @@
+/* pages/shareBonus/shareBonus.wxss */

+ 57 - 8
pages/shopCart/shopCart.js

@@ -10,7 +10,10 @@ Page({
     allPrice: 0,
     allGoodsPrice: 0,
     hasmore: false,
-    curpage: 0
+    curpage: 0,
+    special_datas: {},
+    prop_special: [],
+    summery: [],
   },
   onLoad: function () {
 
@@ -25,10 +28,55 @@ Page({
       allPrice: 0,
       allGoodsPrice: 0,
       hasmore: false,
-      curpage: 0
+      curpage: 0,
+      special_datas: {},
+      prop_special: [],
+      summery: []
     });
     this.req_datas();
     // this.getDatas()
+
+    this.getFavorite()
+
+  },
+  getFavorite() {
+    let self = this
+    let session_id = wx.getStorageSync('session_id')
+    wx.request({
+      url:  "https://passport.lrlz.com/mobile/index.php",
+      data: {
+        act: 'member_bonus',
+        op: 'match_goodsex',
+        curpage: 1,
+        client_type: 'ios'
+      },
+      header: {
+        'content-type': 'application/json', // 默认值
+        'Cookie': 'MPHPSESSID=' + session_id
+      },
+      success(res) {
+        console.log(res);
+      }})
+
+
+    // getReq({
+    //   act: 'member_bonus',
+    //   op: 'match_goodsex',
+    //   curpage: 1
+    // }, function (res) {
+    //   console.log(res);
+    //   if (res.code == 200) {
+    //     console.log(res)
+    //     let special_datas = res.datas
+    //     let prop_special = res.datas.special_list
+    //     let summery = res.datas.summary
+    //     self.setData({
+    //       special_datas,
+    //       prop_special,
+    //       summery
+    //     })
+    //   }
+    // })
   },
   getDatas() {
     let self = this;
@@ -78,7 +126,6 @@ Page({
       op: 'list',
       minest_cartid: self.data.curpage
     }, function (res) {
-
       if (res.code == 200) {
         let hasmore = res.datas.mobile_page.hasmore;
         let free_info = res.datas.free_info;
@@ -89,7 +136,7 @@ Page({
         // let { cart_list, summary, bundling } = res.datas
         // let n_cart_list = self.getCartList(cart_list, summary, bundling)
 
-        
+
         let summary = [];
         if (cart_list.length <= 0) {
           self.setData({
@@ -122,9 +169,6 @@ Page({
           })
         }
         cart_list = self.getCartList(cart_list, summary_datas, bundling);
-
-
-
         let localSummary = self.data.summary;
         let localCartList = self.data.cart_list;
         self.setData({
@@ -301,7 +345,6 @@ Page({
     let self = this;
     let hasmore = this.data.hasmore;
     if (hasmore) {
-
       let req_curpage = this.data.curpage;
       getReq({
         act: 'cart',
@@ -335,5 +378,11 @@ Page({
     wx.switchTab({
       url: "/pages/index/index"
     })
+  },
+  toDetails(e) {
+    let goods_id = e.currentTarget.dataset.goodsid
+    wx.navigateTo({
+      url: `/pages/details/details?goods_id=${goods_id}&title=商品详情`
+    })
   }
 })

+ 4 - 1
pages/shopCart/shopCart.json

@@ -1,3 +1,6 @@
 {
-  "navigationBarTitleText": "购物车"
+  "navigationBarTitleText": "购物车",
+  "usingComponents": {
+    "blockList" : "../components/blockList/blockList"
+  }
 }

+ 14 - 7
pages/shopCart/shopCart.wxml

@@ -34,15 +34,15 @@
 
       <view>
         <view class="align_center mb20" wx:for="{{item['goods']}}" wx:for-index="bl_index" wx:for-item="bl_item" wx:key="bl_index">
-          <view class='goods_image'>
+          <view class='goods_image' catchtap="toDetails" data-goodsid="{{bl_item['goods_id']}}">
             <image mode='scaleToFill' src="{{bl_item['goods_summary']['goods_image_url']}}"></image>
           </view>
-          <view class='goods_content'>
+          <view class='goods_content' catchtap="toDetails" data-goodsid="{{bl_item['goods_id']}}">
             <view class='goods_name one_line_hidden'>{{bl_item['goods_summary']['goods_mobile_name']}}</view>
             <view class='goods_spec one_line_hidden'>{{bl_item['goods_summary']['goods_spec']}}</view>
             <view class='goods_price'>
               <text class="bonus_price">¥{{bl_item['bl_goods_price']}}</text>
-              <text class="original_price">专柜价{{bl_item['goods_summary']['goods_price']}}</text>
+              <text class="original_price">天猫价{{bl_item['goods_summary']['goods_price']}}</text>
             </view>
           </view>
         </view>
@@ -55,7 +55,7 @@
         <text class='handle_btn' bindtap='goods_num_handle' data-goodsid="{{item['goods_id']}}" data-cartid="{{item['cart_id']}}" data-function='add' data-num="{{item['goods_num']}}">+</text>
       </view>
     </view>
-    <view class="bundle_price"><text>套装价:</text><text class="ft_bold col333">¥{{item['bl_price']}}</text> <text class="line-through col666 ml10">专柜价{{item['totalPrice']}}</text></view>
+    <view class="bundle_price"><text>套装价:</text><text class="ft_bold col333">¥{{item['bl_price']}}</text> <text class="line-through col666 ml10">天猫价{{item['totalPrice']}}</text></view>
   </view>
   </block>
 
@@ -71,15 +71,15 @@
             <view class="icon_empty"></view>
           </block>
       </view>
-      <view class='goods_image'>
+      <view class='goods_image' catchtap="toDetails" data-goodsid="{{item['goods_id']}}">
         <image mode='scaleToFill' src="{{item['goods_summary']['goods_image_url']}}"></image>
       </view>
-      <view class='goods_content'>
+      <view class='goods_content' catchtap="toDetails" data-goodsid="{{item['goods_id']}}">
         <view class='goods_name one_line_hidden'>{{item['goods_summary']['goods_mobile_name']}}</view>
         <view class='goods_spec one_line_hidden'>{{item['goods_summary']['goods_spec']}}</view>
         <view class='goods_price'>
           <text class="bonus_price" wx:if="{{item['goods_summary']['act_type'] == 0}}">¥{{item['goods_summary']['bonus_price']}}</text>
-          <text class="original_price" wx:if="{{item['goods_summary']['act_type'] == 2}}">专柜价{{item['goods_summary']['goods_promotion_price']}}</text>
+          <text class="original_price" wx:if="{{item['goods_summary']['act_type'] == 2}}">天猫价{{item['goods_summary']['goods_promotion_price']}}</text>
         </view>
       </view>
       <view class='num_handle'>
@@ -96,6 +96,13 @@
   <view class='clear_fixed'></view>
 </view>
 
+<!-- 猜你喜欢 -->
+<view v-if="{{prop_special.length}}">
+  <view class="text_center l_height42 f30 col333">-猜你喜欢-</view>
+  <blockList prop_special="{{prop_special}}" summery="{{summery}}" special_datas="{{special_datas}}"> </blockList>
+</view>
+
+
 <view class="handle_fixed">
   <view class="all_check_btn" bindtap='all_checked'>
     <block wx:if="{{all_checked}}">

+ 4 - 4
pages/shopCart/shopCart.wxss

@@ -60,16 +60,16 @@
   display: inline-block;
 }
 .all_check_btn {
-  margin-left: 23rpx;
+  margin-left: 26rpx;
 }
 .goods_content {
   max-width: 400rpx;
 }
 .icon_empty {
   display: inline-block;
-  width: 42rpx;
-  height: 42rpx;
-  border: 1rpx solid #eaeaea;
+  width: 38rpx;
+  height: 38rpx;
+  border: 1rpx solid #666;
   border-radius: 50rpx;
   vertical-align: middle;
   margin-right: 22rpx;

+ 1 - 11
pages/webView/webView.js

@@ -14,7 +14,6 @@ Page({
   onLoad: function (options) {
     let url = decodeURIComponent(options.url);
     let targetUrl = jsUrlHelper.delUrlParam(url,'title');
-    console.log(targetUrl)
     this.setData({
       webViewUrl: targetUrl
     })
@@ -60,15 +59,6 @@ Page({
    */
   onReachBottom: function () {
   
-  },
-  onShareAppMessage: function () {
-    let imageUrl = '../../image/address-icon.jpeg';
-    let url = encodeURIComponent('https://passport.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=62271535460005940763&relay_id=36487');
-
-    return {
-      title: `您推荐`,
-      path: `/pages/webView/webView?url=${url}`,
-      imageUrl: imageUrl
-    }
   }
+
 })