zhashaonan 6 роки тому
батько
коміт
2c990816f8

+ 2 - 2
config.js

@@ -1,6 +1,6 @@
 
-// let api = "https://passport.lrlz.com/mobile/index.php";
-let api = "http://a.lrlz.com/mobile/index.php";
+let api = "https://passport.lrlz.com/mobile/index.php";
+// 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";

+ 2 - 1
pages/components/blocks/goods_item/goods_item.js

@@ -25,7 +25,8 @@ Component({
         discounts: discounts_price,
         bonus_price: parseFloat(getSummeryGoods.bonus_price),
         goods_price: parseFloat(getSummeryGoods.goods_price),
-        goods_lowest_price: parseFloat(getSummeryGoods.goods_lowest_price)
+        goods_lowest_price: parseFloat(getSummeryGoods.goods_lowest_price),
+        goods_promotion_price: parseFloat(getSummeryGoods.goods_promotion_price)
       }
     )
     this.setData({

+ 7 - 1
pages/components/blocks/goods_item/goods_item.wxml

@@ -9,7 +9,13 @@
     <view class='goods_box'>
       <view class='goods_name one_line_hidden'>{{goods.goods_mobile_name}}</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="align_center" wx:if="{{goods['act_type'] == 0}}">
+          <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="align_center" wx:if="{{goods['act_type'] == 2}}">
+            <text class="f22 t_bold">¥</text><text class="f30 ft_bold">{{goods['goods_promotion_price']}}</text>
+          </view>
         <view class="col666 line-through ml20 tm_price">天猫价¥{{goods.goods_price}}</view>
       </view>
     </view>

+ 5 - 5
pages/confirmOrder/confirmOrder.js

@@ -72,14 +72,12 @@ Page({
     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).toFixed(2)
+        let totalPrice = parseFloat((goods_amount + freight - 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;
           app.checkDefaultAddress({
@@ -182,7 +180,9 @@ Page({
           duration: 2000
         })
         app.globalData.fcodeErr = res.message
-        wx.navigateBack()
+        setTimeout(() => {
+          wx.navigateBack()
+        }, 2000);
       }
     })
   },
@@ -230,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).toFixed(2)
+           let totalPrice = parseFloat((self.data.totalPrice - prev_freight + freight).toFixed(2))
            self.setData({
             totalPrice,
             freight,

+ 8 - 3
pages/confirmOrder/confirmOrder.wxml

@@ -24,7 +24,7 @@
     <view class="payment_method payment-1px-b">
       <image class="bonus_pay_icon mr20" src="../../image/bonus_pay.png"></image>
       <view class="mr20">红包支付</view>
-      <view class="f24 col666">可抵扣 ¥{{datas['payinfo']['available_pred']}}</view>
+      <view class="f24 col666">可抵扣 ¥{{datas['payinfo']['user_bonus']}}</view>
     </view>
     <view class="payment_method">
       <image class="wx_pay_icon mr16" src="../../image/wx_pay.png"></image>
@@ -96,12 +96,12 @@
     </view>
 
     <view class="expenses_info" wx:if="{{full_discount}}">
-      <view class="col666">{{order_info['full_desc']}}</view>
+      <view class="col666">{{datas.payinfo['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="col666">{{datas.payinfo['opgoods_desc']}}</view>
       <view class="">- ¥ {{opgoods_discount}}</view>
     </view>
 
@@ -120,6 +120,11 @@
       <view class="col666">运费</view>
       <view class="">+ ¥ {{freight}}</view>
     </view>
+
+    <view class="expenses_info" wx:if="{{datas.payinfo['discount_desc']}}">
+      <view class="col666">{{datas.payinfo['discount_desc']}}</view>
+    </view>
+
   </view>
 
   <view class="order_pay">

+ 0 - 19
pages/details/details.js

@@ -119,7 +119,6 @@ Page({
         })
       }
       else {
-        console.log('error:', res.message);
         wx.showToast({
           icon: 'none',
           title: res.message,
@@ -164,8 +163,6 @@ Page({
       getgift
     })
   },
-  // self.createBundles(oneSummary['bundles'],bundlingMap,goodsIdMap)
-
   createBundles(bundles, bundlingMap, goodsIdMap) {
     let bundlesList = []
     bundles.map(item => {
@@ -457,23 +454,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-    if (app.globalData.fcodeErr) {
-      wx.showToast({
-        icon: 'none',
-        title: app.globalData.fcodeErr,
-        duration: 1500
-      })
-      app.globalData.fcodeErr = ''
-      this.setData({
-        animation_flag: false
-      })
-      setTimeout(() => {
-        console.log('appError:', this.data.options_goods_id);
-        this.getDatas(this.data.options_goods_id)
-      }, 1500)
-    }
     if (app.globalData.backLogin && !this.data.firstLoad) {
-      console.log('backLogin:', this.data.getOneSummary.goods_id);
       app.setFromSource(this.data.fromSource)
       this.getDatas(this.data.getOneSummary.goods_id);
     }

+ 1 - 1
pages/details/details.wxml

@@ -170,7 +170,7 @@
   </block>
   <view class="place-bac247"></view>
 
-  <view class="comments_box">
+  <view class="comments_box view_img">
     <view class="comments_header mb20">-图文详情-</view>
     <template is="wxParse" data="{{wxParseData:article.nodes}}" />
   </view>

+ 6 - 0
pages/details/details.wxss

@@ -176,6 +176,12 @@
 .comments_box {
   padding: 30rpx 30rpx 0;
 }
+.comments_box.view_img image {
+  width: 100%!important;
+}
+.comments_box.view_img image.desc_anchor {
+  width: 1px!important;
+}
 .comments_header {
   position: relative;
   text-align: center;

+ 4 - 4
pages/index/index.js

@@ -20,7 +20,8 @@ Page({
       app.setFromSource(this.data.fromSource)
       if (app.globalData.backLogin) {
         app.globalData.backLogin = false;
-        this.getDatas(0)
+        // this.getDatas(0)
+        this.req_tabs(); // old
       }
     }
     // if (app.globalData.backLogin && !this.data.firstLoad) {
@@ -30,7 +31,8 @@ Page({
   },
 
   onLoad: function () {
-    this.getDatas(0)
+    this.req_tabs(); // old
+    // this.getDatas(0)
   },
   getDatas(special_id) {
     let fromSource = recordSource(app, 'act=special&op=index&special_id=0&page=10&curpage=1&client_type=mini')
@@ -71,8 +73,6 @@ Page({
     }, function (res) {
       if (res.code == 200) {
         self.getDatas(res.datas.tabs[0].special_id);
-        // console.log(res.datas.tabs[0].special_id);
-        // self.getDatas(1364);
         self.setData({
           tabs: res.datas.tabs
         });

+ 1 - 1
pages/index/index.wxml

@@ -1,7 +1,7 @@
 <!--index.wxml-->
 <view>
   <searchBox></searchBox>
-  <!-- <tabs tabs="{{tabs}}" bind:myevent="onMyEvent"></tabs> -->
+  <tabs tabs="{{tabs}}" bind:myevent="onMyEvent"></tabs>
   <view class='clear_fixed'></view> 
   <blockList prop_special="{{prop_special}}" summery="{{summery}}" special_datas="{{special_datas}}"> </blockList>
   <image bindtap='backTop' style="display:{{isScroll?'block':'none'}}" mode='widthFix' class='back_top_btn' src='../../image/back_top.png'></image> 

+ 1 - 2
pages/orderPaySn/orderPaySn.js

@@ -44,10 +44,9 @@ Page({
     }, 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).toFixed(2)
+        let totalPrice = parseFloat((goods_amount + shipping_fee - user_bonus - room_bonus - full_discount - opgoods_discount).toFixed(2))
         self.setData({
           defaultAddress: {
             mob_phone: res.datas.order.reciver_info.mob_phone,

+ 5 - 2
pages/order_tabs/orderTabs.wxml

@@ -25,13 +25,16 @@
           </view>
         </view>
         <view class='order_price'>
-          <view>¥{{goods_list.goods_pay_price}}</view>
+          <view>¥{{goods_list.goods_price}}</view>
           <view>x{{goods_list.goods_num}}</view>
         </view>
       </view>
       </block>
       <view class='order_total'>
-        <text>共{{item.order_goods.length}}件 合计:<text class='order_amount'>¥{{item.order_info.pay_cash}}</text> (含运费¥{{item.order_info.shipping_fee}})</text>
+        <text>共{{item.order_goods.length}}件 合计:<text class='order_amount mr6'>¥{{item.order_info.pay_cash}}</text> 
+        <block wx:if="{{item.order_info.shipping_fee}}">(含运费¥{{item.order_info.shipping_fee}})</block>
+        <block wx:else>(免运费)</block>
+      </text>
       </view>
       <view class='order_handle'>
         <block wx:key="{{index}}" wx:for="{{item.actions}}" wx:for-item="action">

+ 1 - 0
pages/order_tabs/orderTabs.wxss

@@ -60,6 +60,7 @@
 .order_total {
   padding-right: 15rpx;
   padding-top: 15rpx;
+  padding-bottom: 15rpx;
 }
 
 .order_handle text {

+ 0 - 4
pages/person/person.js

@@ -66,8 +66,6 @@ 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({
@@ -77,8 +75,6 @@ Page({
     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';

+ 2 - 2
pages/person/person.wxml

@@ -100,10 +100,10 @@
       <text class='look_all_order arrow_right' decode="{{true}}"></text>
     </view>
 
-    <view class='order_title' bindtap="shareBonus">
+    <!-- <view class='order_title' bindtap="shareBonus">
       <text>测试红包</text>
       <text class='look_all_order arrow_right' decode="{{true}}"></text>
-    </view>
+    </view> -->
   </view>
 
 </view>

+ 1 - 3
pages/shareBonus/shareBonus.js

@@ -34,8 +34,7 @@ Page({
       });
       return;
     }
-    console.log('options:', options);
-    let { type_sn, relay_id } = options
+    let { type_sn, relay_id = '' } = options
     let params = {
       act: 'bonusex',
       op: 'open',
@@ -354,7 +353,6 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-    console.log('onshow bonus');
   },
 
   /**

+ 2 - 2
pages/shopCart/shopCart.js

@@ -153,11 +153,11 @@ Page({
     })
   },
   goods_checked(e) {
-    let goods_id = e.currentTarget.dataset.goodsid;
+    let cartid = e.currentTarget.dataset.cartid;
     let cart_list = this.data.cart_list;
     let all_checked_state = 0;
     for (let item of cart_list) {
-      if (item.goods_id == goods_id) {
+        if (item.cart_id == cartid) {
         item.checked = !item.checked;
       }
     }

+ 5 - 5
pages/shopCart/shopCart.wxml

@@ -20,7 +20,7 @@
         <view class="bundl_title"><text class="bundle_tip">搭配套装</text> {{item['bl_name']}}</view>
         <view class='cart_item'>
           <icon class='cancal_btn' type="cancel" size="22" color="#333" bindtap='cancal_cart' data-goodsid="{{item['goods_id']}}" data-cartid="{{item['cart_id']}}"></icon>
-          <view class='check_btn' data-goodsid="{{item['goods_id']}}" bindtap='goods_checked'>
+          <view class='check_btn' data-goodsid="{{item['goods_id']}}" bindtap='goods_checked' data-cartid="{{item['cart_id']}}">
             <block wx:if="{{item['checked']}}">
               <icon type="success" size="21" color="#333"></icon>
             </block>
@@ -39,7 +39,7 @@
                 <view class='goods_spec one_line_hidden'>{{bl_item['goods_summary']['goods_spec']}}</view>
                 <view class='goods_price'>
                   <text class="bonus_price"><text class="f24">¥</text>{{bl_item['bl_goods_price']}}</text>
-                  <text class="original_price ml10">天猫价{{bl_item['goods_summary']['goods_price']}}</text>
+                  <text class="original_price line-through ml10">天猫价{{bl_item['goods_summary']['goods_price']}}</text>
                 </view>
               </view>
             </view>
@@ -62,7 +62,7 @@
     <block wx:if="{{item['bl_id'] == 0}}">
       <view class='cart_item mb20'>
         <icon class='cancal_btn' type="cancel" size="22" color="#333" bindtap='cancal_cart' data-goodsid="{{item['goods_id']}}" data-cartid="{{item['cart_id']}}"></icon>
-        <view class='check_btn' data-goodsid="{{item['goods_id']}}" bindtap='goods_checked'>
+        <view class='check_btn' data-goodsid="{{item['goods_id']}}" bindtap='goods_checked' data-cartid="{{item['cart_id']}}">
           <block wx:if="{{item['checked']}}">
             <icon type="success" size="21" color="#333"></icon>
           </block>
@@ -79,7 +79,7 @@
           <view class='goods_price'>
             <text class="bonus_price" wx:if="{{item['goods_summary']['act_type'] == 0}}"><text class="f24">¥</text>{{item['goods_summary']['bonus_price']}}</text>
             <text class="bonus_price" wx:if="{{item['goods_summary']['act_type'] == 2}}"><text class="f24">¥</text>{{item['goods_summary']['goods_promotion_price']}}</text>
-            <text class="original_price ml10">天猫价{{item['goods_summary']['goods_price']}}</text>
+            <text class="original_price line-through ml10">天猫价{{item['goods_summary']['goods_price']}}</text>
           </view>
         </view>
         <view class='num_handle'>
@@ -123,7 +123,7 @@
   <view style='float:right'>
     <view class='cope'>
       <text class='bonus_price'>应付:¥{{allPrice}}</text>
-      <text class="original_price ml10 mr10">¥{{allGoodsPrice}}</text>
+      <text class="original_price line-through ml10 mr10">¥{{allGoodsPrice}}</text>
     </view>
     <view class='settlement_btn' bindtap='settlement'>
       <text>结算</text>

+ 2 - 2
pages/shopCart/shopCart.wxss

@@ -88,7 +88,7 @@
   color: #999;
   position: relative;
 }
-.original_price::after {
+/* .original_price::after {
   content: "";
   position: absolute;
   top: 15rpx;
@@ -96,7 +96,7 @@
   left: 0;
   height: 3rpx;
   background: #929292;
-}
+} */
 .bonus_price {
   font-weight: bold;
   font-size: 30rpx;

+ 3 - 1
utils/Bundle.js

@@ -27,7 +27,8 @@ export default class Bundle {
         let totalPrice = 0;
         data['goods'].map(value => {
           value['goods_summary'] = this.sumary.get(value['goods_id'])
-          totalPrice += parseFloat(value['goods_summary']['goods_price'])
+          value['goods_summary']['goods_price'] = parseFloat(value['goods_summary']['goods_price'])
+          totalPrice += value['goods_summary']['goods_price']
         })
         data['totalPrice'] = totalPrice
         arr.push(data)
@@ -38,6 +39,7 @@ export default class Bundle {
         arr.push(item)
       }
     })
+    console.log('arr:', arr);
     return arr
   }
   createBuildings(item) {