Prechádzať zdrojové kódy

地址 、搜索栏修改

zhashaonan 6 rokov pred
rodič
commit
c6070fb401

+ 18 - 15
app.js

@@ -11,19 +11,19 @@ App({
       success: res => {
         wx.request({
           url: self.host,
-          // data:{
-          //   act:"login",
-          //   op:"iosstart",
-          //   code: res.code,
-          //   client_type:"ios"
-          // },
-          url: `https://api.weixin.qq.com/sns/jscode2session?appid=wxfdaeb25e38c4c47e&secret=e5b5055cbc608d10c6de0d877c221270&js_code=${res.code}&grant_type=authorization_code`,
+          data:{
+            act:"login",
+            op:"ministart",
+            code: res.code,
+            client_type:"ios"
+          },
+          // url: `https://api.weixin.qq.com/sns/jscode2session?appid=wxfdaeb25e38c4c47e&secret=e5b5055cbc608d10c6de0d877c221270&js_code=${res.code}&grant_type=authorization_code`,
           success:function(res){
-            // self.globalData.userId.openid = res.data.datas.openid;
-            // self.globalData.userId.unionid = res.data.datas.unionid;
+            self.globalData.userId.openid = res.data.datas.openid;
+            self.globalData.userId.unionid = res.data.datas.unionid;
 
-            self.globalData.userId.openid = res.data.openid;
-            self.globalData.userId.unionid = res.data.unionid;
+            // self.globalData.userId.openid = res.data.openid;
+            // self.globalData.userId.unionid = res.data.unionid;
             // 获取用户信息
             wx.getSetting({
               success: res => {
@@ -39,8 +39,8 @@ App({
                           data: {
                             user_info: userInfo,
                             act: "login",
-                            // op: "wxauthen",
-                            op: "wxauthor",
+                            op: "wxauthen",
+                            // op: "wxauthor",
                             client_type: "ios"
                           },
                           success: function (res) {
@@ -82,8 +82,8 @@ App({
                             data: {
                               user_info: userInfo,
                               act: "login",
-                              // op: "wxauthen",
-                              op: "wxauthor",
+                              op: "wxauthen",
+                              // op: "wxauthor",
                               client_type: "ios"
                             },
                             success: function (res) {
@@ -130,5 +130,8 @@ App({
   },
   checkDefaultAddress(address) {
     this.globalData.defaultAddress = address
+  },
+  clearAddress() {
+    this.globalData.defaultAddress = null
   }
 })

+ 9 - 0
app.wxss

@@ -64,6 +64,9 @@ page {
 .f34 {
   font-size: 34rpx;
 }
+.f40 {
+  font-size: 40rpx;
+}
 .ml8 {
   margin-left: 8rpx;
 }
@@ -85,6 +88,9 @@ page {
 .mr16 {
   margin-right: 16rpx;
 }
+.mr20 {
+  margin-right: 20rpx;
+}
 .mt4 {
   margin-top: 4rpx;
 }
@@ -133,6 +139,9 @@ page {
 .l_height34 {
   line-height: 34rpx;
 }
+.l_height42 {
+  line-height: 42rpx;
+}
 
 
 

BIN
image/address-icon.jpeg


BIN
image/address-icon.png


BIN
image/bonus_pay.png


BIN
image/wx_pay.png


+ 1 - 1
pages/addAddress/addAddress.wxml

@@ -44,7 +44,7 @@
   <view class="checkbtn" bindtap='toggleChecked'>
     <view class="check_icon-box">
       <block wx:if="{{checked}}">
-        <icon type="success" size="18" color="#ff4e4e"></icon>
+        <icon type="success" size="18" color="#2b2b2b"></icon>
       </block>
       <block wx:else>
         <view class="no_checked_icon"></view>

+ 1 - 1
pages/addAddress/addAddress.wxss

@@ -109,7 +109,7 @@
   padding: 0 30rpx;
   line-height: 88rpx;
   font-size: 32rpx;
-  color: #EB4E4F;
+  color: #333;
   background: #fbf9fe;
 }
 .picker_header .picker_cancel {

+ 4 - 0
pages/address/address.js

@@ -29,6 +29,10 @@ Page({
       wx.hideLoading()
       if (res.code == 200) {
         let address_list = res.datas.address_list
+        console.log('address', res);
+        if(!address_list.length) {
+          appInstance.clearAddress()
+        }
         self.setData({
           address_list,
           firstLoad: false

+ 1 - 1
pages/address/address.wxml

@@ -7,7 +7,7 @@
       <text class="ml8">{{item.mob_phone}}</text>
     </view>
     <view class="address_line mt8">
-      <text class="coleb4e4f mr16" wx:if="{{item.is_default == 1}}">[默认地址]</text>
+      <text class="col333 mr16" wx:if="{{item.is_default == 1}}">[默认地址]</text>
       <text >{{item.area_info}}{{item.address}}</text>
     </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}}">

+ 1 - 1
pages/address/address.wxss

@@ -20,7 +20,7 @@
   left: 0;
   right: 0;
   color: #fff;
-  background: #eb4e4f;
+  background: #2b2b2b;
   line-height: 92rpx;
   text-align: center;
   font-size: 30rpx;

+ 2 - 1
pages/components/blocks/search/search.wxss

@@ -6,7 +6,8 @@
   font-size: 24rpx;
   padding-top: 10rpx;
   z-index: 10;
-  background: #ffffff;
+  background: #2b2b2b;
+  height: 90rpx;
 }
 .search_box view {
   width:720rpx;

+ 7 - 6
pages/components/blocks/tabs/tabs.wxss

@@ -2,11 +2,11 @@
 .scroll-view_H{
   white-space: nowrap;
   position: fixed;
-  top: 78rpx;
+  top: 80rpx;
   left: 0;
   z-index: 10;
-  background: #fff;
-  box-shadow: 0 0 3rpx #fff;
+  /* background: #fff; */
+  /* box-shadow: 0 0 3rpx #fff; */
 }
 .scroll-view-item{
   height: 300rpx;
@@ -17,7 +17,8 @@
   padding: 10rpx 28rpx;
   height: 40rpx;
   font-size: 28rpx;
-  color: #333;
+  color: #666;
+  background: #2b2b2b;
 }
 .scroll-view-item_H:after {
   content: '';
@@ -29,8 +30,8 @@
   background: transparent;
 }
 .scroll-view-item_H.active {
-  color: #eb4e4f
+  color: #fff
 }
 .scroll-view-item_H.active:after {
-  background: #eb4e4f;
+  background: #fff;
 }

+ 8 - 2
pages/confirmOrder/confirmOrder.js

@@ -31,7 +31,9 @@ Page({
       num,
       cart_id
     })
-    this.getDatas(goods_id, iscart, num, cart_id)
+    // console.log(goods_id, iscart, num, cart_id);
+    // this.getDatas(goods_id, iscart, num, cart_id)
+    this.getDatas(4807, 0, 1, '')
   },
   getDatas(goods_id, ifcart, num, cart_id) {
     wx.showLoading({
@@ -54,8 +56,10 @@ Page({
     }, function (res) {
       wx.hideLoading()
       if (res.code == 200) {
+        console.log(res);
         let datas = res.datas
         let goods_list = self.getGoodsList(datas.summary, datas.goods_list)
+        console.log('goods_list', goods_list);
         if (datas.address) {
           let { true_name, mob_phone, area_info, address, address_id } = datas.address;
           appInstance.checkDefaultAddress({
@@ -85,9 +89,11 @@ Page({
     })
   },
   getGoodsList(summary, goods_list) {
+    console.log('summary', summary);
+    console.log('goods_list', goods_list);
     let newGoodsList = []
     goods_list.map((item, index) => {
-      summary.filter((list, key) => {
+      summary.find((list, key) => {
         if (item.goods_id == list.goods_id) {
           let goods_item = list
           goods_item.goods_num = item.goods_num

+ 21 - 20
pages/confirmOrder/confirmOrder.wxml

@@ -2,7 +2,7 @@
 <view class="check_order">
   <navigator url="/pages/address/address">
     <view class="address_wrap" wx:if="{{defaultAddress}}">
-      <image class="adress-icon" src="../../image/address-icon.jpeg"></image>
+      <image class="adress-icon" src="../../image/address-icon.png"></image>
       <view>
         <view>
           <text>{{defaultAddress.true_name}}</text>
@@ -10,6 +10,7 @@
         </view>
         <view class="mt10"><text>{{defaultAddress.area_info}}</text><text class="ml8">{{defaultAddress.address}}</text></view>
       </view>
+      <image class="see_ensure_desc" src="../../image/back.png"></image>
     </view>
     <view wx:else class="address_none">
       <icon type="warn" size="23" />
@@ -18,56 +19,56 @@
   </navigator>
 
 
-  <view class="mt20">
+  <view class="mt20 mb20">
     <view class="payment_method payment-1px-b">
-      <view>红包支付</view>
-      <icon type="success" size="20" color="red" />
+      <image class="bonus_pay_icon mr20" src="../../image/bonus_pay.png"></image>
+      <view class="mr20">红包支付</view>
+      <view class="f24 col666">可抵扣 ¥20.00</view>
     </view>
     <view class="payment_method">
+      <image class="wx_pay_icon mr16" src="../../image/wx_pay.png"></image>
       <view>微信支付</view>
-      <icon type="success" size="20" color="red" />
     </view>
   </view>
 
-  <view class="mt20 bacfff" wx:for="{{goods_list}}" wx:for-index="idx" wx:key="idx">
+  <view class="bacfff" wx:for="{{goods_list}}" wx:for-index="idx" wx:key="idx">
     <view class="order_goods_content vux-1px-b">
       <image class="order_content_img" mode="widthFix" src="{{item.goods_image_url}}"></image>
       <view class="order_content_middle">
-        <view>{{item.goods_mobile_name}}</view>
-        <view class="order_letter_pro">{{item.goods_spec}}</view>
+        <view class="l_height42 ft_bold one_line_hidden">{{item.goods_mobile_name}}</view>
+        <view class="order_letter_pro one_line_hidden">{{item.goods_spec}}</view>
         <view>
-          <text class="f30 coleb4e4f">¥{{item.act_type == 0?item.bonus_price:item.goods_promotion_price}}</text>
-          <text decode="{{true}}" class="cola7">&nbsp;&nbsp;天猫价{{item.goods_price}}</text>
+          <text class="f30 col333 ft_bold mr10"><text class="f24 mr6">¥</text>{{item.act_type == 0?item.bonus_price:item.goods_promotion_price}}</text>
+          <text decode="{{true}}" class="col999 line-through f24">专柜价{{item.goods_price}}</text>
         </view>
       </view>
       <view class="order_content_nums">x{{item.goods_num}}</view>
     </view>
   </view>
-  <view class="packet_price-tips bacfff" wx:if="{{datas.payinfo.gap_desc}}">{{datas.payinfo.gap_desc}}~</view>
+  <!-- <view class="packet_price-tips bacfff" wx:if="{{datas.payinfo.gap_desc}}">{{datas.payinfo.gap_desc}}~</view> -->
   <view class="order_entry mt20">
     <view class="expenses_info">
-      <view>商品总价</view>
-      <view class="coleb4e4f">¥ {{datas.payinfo['goods_amount']}}</view>
+      <view class="col666">商品总价</view>
+      <view class="">¥ {{datas.payinfo['goods_amount']}}</view>
     </view>
     <view class="expenses_info" wx:for="{{datas.payinfo['bonus_rates']}}" wx:for-index="idx" wx:key="idx">
       <view>
-        <text class="bonus_bg"><text class="bonus_rate">{{item.rate}}%</text></text>
-        <text>红包抵扣</text>
+        <text class="col666">红包抵扣</text>
       </view>
-      <view class="col09BB07">- ¥ {{item.total}}</view>
+      <view class="">- ¥ {{item.total}}</view>
     </view>
     <view class="expenses_info">
-      <view>运费</view>
-      <view class="coleb4e4f">+ ¥ {{datas.payinfo['freight']}}</view>
+      <view class="col666">运费</view>
+      <view class="">+ ¥ {{datas.payinfo['freight']}}</view>
     </view>
   </view>
 
   <view class="order_pay">
-    <view class="default_address" wx:if="{{datas.address}}">配送至:{{datas.address.area_info}}{{datas.address.address}}</view>
+    <!-- <view class="default_address" wx:if="{{datas.address}}">配送至:{{datas.address.area_info}}{{datas.address.address}}</view> -->
     <view class="just_buy">
       <view class="just_buy_left">
         <text>应付: </text>
-        <text class="coleb4e4f">¥ {{datas.payinfo['pay_cash_pred']}}</text>
+        <text class="col2B2B2B ft_bold">¥ {{datas.payinfo['pay_cash_pred']}}</text>
       </view>
       <view class="just_buy_right" bindtap='toPay'>去付款</view>
     </view>

+ 41 - 23
pages/confirmOrder/confirmOrder.wxss

@@ -24,20 +24,32 @@
 .adress-icon {
   display: block;
   width: 34rpx;
-  height: 47rpx;
-  margin: 0 56rpx 0 40rpx;
+  height: 42rpx;
+  margin: 0 20rpx 0 30rpx;
+}
+.see_ensure_desc {
+  width: 16rpx;
+  height: 30rpx;
+  position: absolute;
+  right: 30rpx;
 }
-
 .payment_method {
   display: -webkit-flex;
   display: flex;
   align-items: center;
-  justify-content: space-between;
-  font-size: 28rpx;
-  padding: 25rpx 40rpx;
+  /* justify-content: space-between; */
+  font-size: 30rpx;
+  padding: 25rpx 30rpx;
   background: #fff;
 }
-
+.bonus_pay_icon {
+  width: 34rpx;
+  height: 42rpx;
+}
+.wx_pay_icon {
+  width: 40rpx;
+  height: 40rpx;
+}
 .payment-1px-b {
   position: relative;
 }
@@ -45,7 +57,7 @@
 .payment-1px-b::after {
   content: " ";
   position: absolute;
-  left: 40rpx;
+  left: 0;
   bottom: 0;
   right: 0;
   height: 1px;
@@ -58,6 +70,7 @@
 }
 
 .order_goods_content {
+  position: relative;
   display: -webkit-flex;
   display: flex;
   align-items: center;
@@ -66,29 +79,34 @@
 
 .order_content_img {
   display: block;
-  -webkit-flex: 0 0 33.3333%;
-  flex: 0 0 33.3333%;
-  width: 175rpx;
+  /* -webkit-flex: 0 0 33.3333%; */
+  /* flex: 0 0 33.3333%; */
+  width: 160rpx;
+  height: 160rpx;
+  border: 1px solid #D9D9D9;
 }
 
 .order_content_middle {
-  -webkit-flex: 0 0 50%;
-  flex: 0 0 50%;
-  padding-left: 25rpx;
-  font-size: 24rpx;
+  -webkit-flex: 0 0 60%;
+  flex: 0 0 60%;
+  padding-left: 20rpx;
+  font-size: 30rpx;
+  color: #333;
 }
 
 .order_letter_pro {
-  margin: 20rpx 0 40rpx;
-  color: #a7a7a7;
+  margin: 6rpx 0 30rpx;
+  font-size: 24rpx;
+  color: #666;
 }
 
 .order_content_nums {
-  -webkit-flex: 1;
-  flex: 1;
-  color: #a7a7a7;
+  position: absolute;
+  right: 30rpx;
+  bottom: 36rpx;
+  font-weight: bold;
   font-size: 24rpx;
-  text-align: right;
+  color: #333333;
 }
 
 .packet_price-tips {
@@ -158,7 +176,7 @@
 .just_buy_right {
   -webkit-flex: 0 0 33%;
   flex: 0 0 33%;
-  font-size: 32rpx;
+  font-size: 30rpx;
   color: #fff;
-  background: rgb(235, 78, 79);
+  background: #2b2b2b;
 }

+ 28 - 6
pages/details/details.js

@@ -33,6 +33,8 @@ Page({
     comments: [],
     current: 0,
     carouselImgs: [],
+    currentPrice: '', // 商品当前价格,
+    promotionDays: ''
   },
 
   /**
@@ -52,16 +54,19 @@ Page({
     
 
     // console.log(options.goods_id);
-    // this.getDatas(options.goods_id)
+    this.getDatas(options.goods_id)
     // this.getDatas(7636)
-    this.getDatas(4807) // a.lrlz.com 有多条评论
+    // this.getDatas(2) // 特殊商品
+    // this.getDatas(260) // 特殊商品
+    // this.getDatas(4807) // a.lrlz.com 有多条评论
     var that = this;
     getReq({
       act: 'goods_common',
       op: 'detail',
-      // goods_id: options.goods_id
+      goods_id: options.goods_id
       // goods_id: 7636
-      goods_id: 4807
+      // goods_id: 4807
+      // goods_id: 2
     }, function(res) {
       var str = res.split(/<[\/]?body>/gi)[1];
        WxParse.wxParse('article', 'html', str, that);
@@ -82,16 +87,25 @@ Page({
       if (res.code == 200) {
         console.log(res);
         self.createStars(res.datas.common_info.comments_rate)
-        self.createComments(res.datas.comments)
+        if(res.datas.comments) {
+          self.createComments(res.datas.comments)
+        }
+        
         let oneSummary = self.getOneSummary(res.datas.summary, goods_id)
+        console.log('oneSummary:', oneSummary);
         let getgift = self.getgift(res.datas.summary, goods_id)
         let differencePrice = (oneSummary.goods_price - oneSummary.bonus_price).toFixed(2)
         oneSummary = Object.assign({}, { differencePrice }, oneSummary)
+        let promotionDays = ''
+        if(oneSummary['act_type'] == 2) {
+          promotionDays = self.getPromotionDays(oneSummary['act_id'], res.datas.limitime)
+        }
         self.setData({
           datas: res.datas,
           getOneSummary: oneSummary,
           imgUrls: res.datas.common_info.images,
-          getgift
+          getgift,
+          promotionDays
         })
       }
       else {
@@ -266,6 +280,14 @@ Page({
     })
     return arr
   },
+  getPromotionDays(actId, limitime) {
+    // console.log(this.data.datas);
+    let limit = limitime.filter(item => {
+      return item['xianshi_id'] == actId
+    })
+    let days = Math.floor((limit[0]['end_time'] * 1000 - new Date().getTime()) / (60 * 60 * 24 * 1000));
+    return days;
+  },
   createStars(rate) {
     let starSrcs = []
     for(let i = 0; i < 5; i++) {

+ 11 - 5
pages/details/details.wxml

@@ -12,10 +12,14 @@
     </swiper>
   </view>
   <view class="place-bacd9"></view>
+  <view class="promotion_header align_center" wx:if="{{getOneSummary['act_type'] == 2}}">
+      <view class="promotion_single">限时特价</view> 
+      <view>还剩<text class="col333 ft_bold">{{promotionDays}}天</text>恢复<text class="col333 ft_bold">¥{{getOneSummary.goods_price}}</text>,不可同享其他优惠</view>
+    </view>
   <view class="n_goods_content">
     <view class="n_price_content align_center">
-      <!-- <text class="f24 col333" wx:if="{{getOneSummary['act_type'] == 0}}">红包价:</text> -->
-      <text class="f34 col2B2B2B ft_bold">¥{{getOneSummary['act_type'] == 0?getOneSummary.bonus_price:getOneSummary['goods_promotion_price']}}</text>
+      <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>
     </view>
     <view class="f24 col666 l_height34 mt4">库存:{{getOneSummary.goods_storage}}件</view>
@@ -47,9 +51,9 @@
       <image class="see_ensure_desc" src="../../image/back.png"></image>
     </view>
   </view>
-  <view class="place-bac247"></view>
 
   <block wx:if="{{datas.comment}}">
+    <view class="place-bac247"></view>
     <view class="comments_box">
       <view class="comments_header">
         -商品评价-
@@ -134,8 +138,10 @@
       </view>
       <view class="flexbox_item">
         <view class="simple_goods_price">
-          <text decode="{{true}}">¥{{getOneSummary['act_type'] !== 1?getOneSummary.bonus_price:datas['groupbuy'][0]['promotion_price']}}&nbsp;&nbsp;</text>
-          <text class="goods_original_price line-through">{{getOneSummary.goods_price}}</text>
+          <!-- <text decode="{{true}}">¥{{getOneSummary['act_type'] !== 1?getOneSummary.bonus_price:datas['groupbuy'][0]['promotion_price']}}&nbsp;&nbsp;</text> -->
+          <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>
         </view>
         <view class="f24">库存{{getOneSummary.goods_storage}}件</view>
         <block wx:if="{{getgift}}">

+ 17 - 2
pages/details/details.wxss

@@ -502,7 +502,7 @@
 .simple_goods_price {
   line-height: 50rpx;
   font-size: 36rpx;
-  color: rgb(235, 78, 79);
+  color: #333;
 }
 
 .goods_original_price {
@@ -540,7 +540,7 @@
 }
 
 .simple_goods_compute {
-  color: #eb4e4f;
+  color: #333;
   font-size: 40rpx;
   display: inline-block;
   width: 80rpx;
@@ -642,6 +642,21 @@
   font-weight: bold;
   color: #333333;
 }
+.promotion_header {
+  padding-left: 30rpx;
+  background: #FFEEBD;
+  font-size: 24rpx;
+  color: #7E7E7E;
+  height: 48rpx;
+}
+.promotion_single {
+  padding: 2rpx 8rpx;
+  margin-right: 10rpx;
+  font-size: 20rpx;
+  border-radius: 40rpx;
+  color: #fff;
+  background: #2b2b2b;
+}
 .brand_auth {
   position: relative;
   float: left;

+ 2 - 2
pages/login/login.js

@@ -69,8 +69,8 @@ Page({
         data: {
           user_info: userInfo,
           act: "login",
-          // op: "wxauthen",
-          op: "wxauthor",
+          op: "wxauthen",
+          // op: "wxauthor",
           client_type: "ios"
         },
         success: function (res) {

+ 2 - 2
pages/person/person.wxml

@@ -87,9 +87,9 @@
         <text class='look_all_order arrow_right' decode="{{true}}">{{addr_num}}&nbsp;</text>
       </view>
     </navigator>
-    <view class='order_title'>
+    <view class='order_title' bindtap='skip_help'>
       <text>帮助中心</text>
-      <text class='look_all_order arrow_right' decode="{{true}}">在线客服&nbsp;</text>
+      <text class='look_all_order arrow_right' decode="{{true}}"></text>
     </view>
   </view>
 

+ 2 - 1
wxParse/wxParse.wxss

@@ -20,7 +20,8 @@
     line-height: 1.8;
 }
 view{
-    word-break:break-all; overflow:auto;
+    word-break:break-all; 
+    /* overflow:auto; */
 }
 .wxParse-inline{
     display: inline;