Commit bb7e270445716a31fbcdf0057d05813506e13e87

Authored by 后端开发-许程
1 parent 54568e2d

小程序加入购物车排版

pages/goods/goodsInfo/goodsInfo.js
@@ -210,6 +210,7 @@ Page({ @@ -210,6 +210,7 @@ Page({
210 more_store:0,//选择门店 210 more_store:0,//选择门店
211 sort_store:0,//门店分类 211 sort_store:0,//门店分类
212 choice_sort_store:0,//选择分类门店 212 choice_sort_store:0,//选择分类门店
  213 + new_user:0,//新用户
213 }, 214 },
214 215
215 //------初始化加载---------- 216 //------初始化加载----------
pages/goods/goodsInfo/goodsInfo.wxml
@@ -313,7 +313,8 @@ @@ -313,7 +313,8 @@
313 <text class="bg_jj"></text> 313 <text class="bg_jj"></text>
314 </view> 314 </view>
315 </view> 315 </view>
316 - <view class="flex-space-between address ai_end "> 316 + <view wx:if="{{new_user==1}}">
  317 + <view class="flex-space-between address ai_end ">
317 <view> 318 <view>
318 <text class="fs32 xc-black3 shop_name"> 泉州开源盛世</text> 319 <text class="fs32 xc-black3 shop_name"> 泉州开源盛世</text>
319 <text class="fs20">暂无库存</text> 320 <text class="fs20">暂无库存</text>
@@ -323,6 +324,7 @@ @@ -323,6 +324,7 @@
323 </view> 324 </view>
324 </view> 325 </view>
325 <view class="fs20">地址:福建省泉州市鲤城区软件园4栋4层</view> 326 <view class="fs20">地址:福建省泉州市鲤城区软件园4栋4层</view>
  327 + </view>
326 </view> 328 </view>
327 329
328 </view> 330 </view>
@@ -669,7 +671,7 @@ @@ -669,7 +671,7 @@
669 <view>购物车</view> 671 <view>购物车</view>
670 </navigator> 672 </navigator>
671 </view> 673 </view>
672 - <!---<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>--> 674 + <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>
673 <block wx:if="{{prom_type==0}}"> 675 <block wx:if="{{prom_type==0}}">
674 <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> 676 <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>
675 <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view> 677 <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view>
@@ -790,15 +792,16 @@ @@ -790,15 +792,16 @@
790 <view class="fs20 xc-ash xc-distance-top">地址:福建省泉州市鲤城区软件园4栋4层</view> 792 <view class="fs20 xc-ash xc-distance-top">地址:福建省泉州市鲤城区软件园4栋4层</view>
791 </view> 793 </view>
792 <!----商品的属性项目----> 794 <!----商品的属性项目---->
  795 + <view class="xc-goods-attribute">
793 <view hidden="{{ismend==1}}" class="spec-name">商品属性</view> 796 <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
794 <view hidden="{{ismend==1}}" class="flex"> 797 <view hidden="{{ismend==1}}" class="flex">
795 <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='item.goods_id' wx:for="{{sku_g}}" wx:key="sku_g"> 798 <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='item.goods_id' wx:for="{{sku_g}}" wx:key="sku_g">
796 {{item.gg}} 799 {{item.gg}}
797 </view> 800 </view>
798 </view> 801 </view>
799 - 802 +</view>
800 <!----点击选择门店的时候要隐藏----> 803 <!----点击选择门店的时候要隐藏---->
801 - <view hidden="{{ismend==1}}"> 804 + <!-- <view hidden="{{ismend==1}}">
802 <view bindtap="getmendian" class="quhuo logistics-item"> 805 <view bindtap="getmendian" class="quhuo logistics-item">
803 <view wx:if="{{sto_sele_name==''}}">取货门店 806 <view wx:if="{{sto_sele_name==''}}">取货门店
804 <text class='small'>(选择门店)</text> 807 <text class='small'>(选择门店)</text>
@@ -808,6 +811,8 @@ @@ -808,6 +811,8 @@
808 <image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image> 811 <image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>
809 </view> 812 </view>
810 </view> 813 </view>
  814 + </view> -->
  815 +
811 <view class="b_num"> 816 <view class="b_num">
812 <view>购买数量</view> 817 <view>购买数量</view>
813 <view class="count"> 818 <view class="count">
@@ -817,6 +822,14 @@ @@ -817,6 +822,14 @@
817 </view> 822 </view>
818 </view> 823 </view>
819 </view> 824 </view>
  825 + <view class="spec-cart-btns">
  826 +
  827 + <block>
  828 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>
  829 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view>
  830 + </block>
  831 + </view>
  832 +
820 <view class="clear"></view> 833 <view class="clear"></view>
821 <!---选择门店的列表---> 834 <!---选择门店的列表--->
822 <view hidden="{{ismend==0}}" class="sto_v"> 835 <view hidden="{{ismend==0}}" class="sto_v">
@@ -842,13 +855,7 @@ @@ -842,13 +855,7 @@
842 </view> 855 </view>
843 </view> 856 </view>
844 </view> 857 </view>
845 - <view class="spec-cart-btns">  
846 - <block>  
847 - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" class="spec-cart-btn spec-buy" data-action="add">加入购物车</view>  
848 - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view>  
849 - </block>  
850 - </view>  
851 - </view> 858 +
852 </view> 859 </view>
853 <!----弹起来,选择规格数量,拼单商品购买------> 860 <!----弹起来,选择规格数量,拼单商品购买------>
854 <view hidden="{{!openSpecModal_pt}}"> 861 <view hidden="{{!openSpecModal_pt}}">
@@ -876,8 +883,8 @@ @@ -876,8 +883,8 @@
876 </view> 883 </view>
877 </view> 884 </view>
878 <!----商品的属性项目----> 885 <!----商品的属性项目---->
  886 + <view>
879 <view hidden="{{ismend==1}}" class="spec-name">商品属性</view> 887 <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
880 -  
881 <block wx:if="{{is_normal==0}}"> 888 <block wx:if="{{is_normal==0}}">
882 <view hidden="{{ismend==1}}" class="flex"> 889 <view hidden="{{ismend==1}}" class="flex">
883 <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='item.goods_id' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}} 890 <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='item.goods_id' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
@@ -892,7 +899,7 @@ @@ -892,7 +899,7 @@
892 </view> 899 </view>
893 </block> 900 </block>
894 <view class="clear"></view> 901 <view class="clear"></view>
895 - 902 + </view>
896 <view> 903 <view>
897 <view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}"> 904 <view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">
898 <view wx:if="{{sto_sele_name==''}}">取货门店 905 <view wx:if="{{sto_sele_name==''}}">取货门店
@@ -907,7 +914,7 @@ @@ -907,7 +914,7 @@
907 <view>购买数量</view> 914 <view>购买数量</view>
908 <view class="count"> 915 <view class="count">
909 <view bindtap="subCartNum" class="sub">-</view> 916 <view bindtap="subCartNum" class="sub">-</view>
910 - <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input> 917 + <input bindblur="inputCartNum xc-val-fream" type="number" value="{{goodsInputNum}}"></input>
911 <view bindtap="addCartNum" class="add">+</view> 918 <view bindtap="addCartNum" class="add">+</view>
912 </view> 919 </view>
913 </view> 920 </view>
@@ -937,7 +944,7 @@ @@ -937,7 +944,7 @@
937 </view> 944 </view>
938 </view> 945 </view>
939 </view> 946 </view>
940 - </view> 947 + </view>
941 <view class="pt_qd"> 948 <view class="pt_qd">
942 <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view> 949 <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view>
943 </view> 950 </view>
pages/goods/goodsInfo/goodsInfo.wxss
@@ -518,7 +518,7 @@ border-radius: 0 56rpx 55rpx 0; @@ -518,7 +518,7 @@ border-radius: 0 56rpx 55rpx 0;
518 font-size: 32rpx; 518 font-size: 32rpx;
519 box-sizing: border-box; 519 box-sizing: border-box;
520 border-radius: 20rpx; 520 border-radius: 20rpx;
521 - 521 + height: 72%;
522 } 522 }
523 523
524 .spec-model .pding{padding: 0 30rpx;} 524 .spec-model .pding{padding: 0 30rpx;}
@@ -579,7 +579,7 @@ border-radius: 0 56rpx 55rpx 0; @@ -579,7 +579,7 @@ border-radius: 0 56rpx 55rpx 0;
579 position: fixed; 579 position: fixed;
580 display: flex; 580 display: flex;
581 height: 50rpx; 581 height: 50rpx;
582 - border: 1rpx solid #f8f8f8; 582 + border: 1rpx solid #000;
583 font-size: 28rpx; 583 font-size: 28rpx;
584 right: 30rpx; 584 right: 30rpx;
585 } 585 }
@@ -592,15 +592,15 @@ border-radius: 0 56rpx 55rpx 0; @@ -592,15 +592,15 @@ border-radius: 0 56rpx 55rpx 0;
592 text-align: center; 592 text-align: center;
593 } 593 }
594 .spec_bt{ 594 .spec_bt{
595 - background: fff;color: #333; margin-left: 10rpx;padding: 8rpx 12rpx; border-radius:20rpx;font-size: 24rpx;border: 1rpx solid #ccc; 595 + background: fff;color: #333; margin-left: 10rpx;padding: 4rpx 15rpx 4rpx; border-radius:30rpx;font-size: 24rpx;border: 1rpx solid #ccc;
596 } 596 }
597 .spec_bt.act{background: #d60021;color: #fff;border: 1rpx solid #d60021;} 597 .spec_bt.act{background: #d60021;color: #fff;border: 1rpx solid #d60021;}
598 .sub { 598 .sub {
599 - border-right: 1px solid #ddd; 599 + border-right: 1px solid #000;
600 } 600 }
601 601
602 .add { 602 .add {
603 - border-left: 1px solid #ddd; 603 + border-left: 1px solid #000;
604 } 604 }
605 605
606 .spec-btn { 606 .spec-btn {
@@ -622,22 +622,21 @@ border-radius: 0 56rpx 55rpx 0; @@ -622,22 +622,21 @@ border-radius: 0 56rpx 55rpx 0;
622 } 622 }
623 623
624 .spec-cart-btns { 624 .spec-cart-btns {
625 - /* background-color: #f8f8f8;  
626 - margin: 40rpx -30rpx 0;  
627 - padding: 20rpx 34rpx; */  
628 - float: left;  
629 - width: 100%;  
630 - line-height: 80rpx;  
631 - margin-top: 40rpx; 625 + width: 92%;
  626 + line-height: 70rpx;
  627 + margin: 0rpx auto;
  628 + margin-top: 80rpx;
  629 + border-radius: 20rpx;
  630 +
632 } 631 }
633 632
634 .spec-cart-btn { 633 .spec-cart-btn {
635 - float: left;  
636 - width: 100%; 634 +
  635 + width:100%;
637 font-size: 30rpx; 636 font-size: 30rpx;
638 text-align: center; 637 text-align: center;
639 color: white; 638 color: white;
640 - border-radius: 4rpx; 639 + border-radius: 40rpx;
641 } 640 }
642 641
643 .spec-add-cart { 642 .spec-add-cart {
@@ -2241,7 +2240,8 @@ right:17rpx; top:55rpx; @@ -2241,7 +2240,8 @@ right:17rpx; top:55rpx;
2241 .xc-address_frame{ 2240 .xc-address_frame{
2242 border-top:1rpx solid #eee; 2241 border-top:1rpx solid #eee;
2243 width: 100%; 2242 width: 100%;
2244 - height: 170rpx; 2243 + min-height: 90rpx;
  2244 + height: auto;
2245 } 2245 }
2246 .xc-address_frame .address_frame{ 2246 .xc-address_frame .address_frame{
2247 width: 92%; 2247 width: 92%;
@@ -2454,4 +2454,12 @@ margin-top: 10rpx; @@ -2454,4 +2454,12 @@ margin-top: 10rpx;
2454 border-right: 2rpx solid #d70026; 2454 border-right: 2rpx solid #d70026;
2455 transform: rotate(45deg);display:inline-block; 2455 transform: rotate(45deg);display:inline-block;
2456 margin-bottom:3rpx; 2456 margin-bottom:3rpx;
  2457 +}
  2458 +.xc-goods-attribute{
  2459 + border-bottom: 1px solid #eee;
  2460 +padding-bottom: 15px;
  2461 +margin-bottom:40rpx;
  2462 +}
  2463 +.xc-val-fream{
  2464 + width: 105rpx;
2457 } 2465 }
2458 \ No newline at end of file 2466 \ No newline at end of file
pages/user/index/index.wxml
@@ -105,7 +105,7 @@ @@ -105,7 +105,7 @@
105 <view class="xc-equity-title flex-level" bindtap="go_qy"> 105 <view class="xc-equity-title flex-level" bindtap="go_qy">
106 <view class="xc-title-frame flex-space-between"> 106 <view class="xc-title-frame flex-space-between">
107 <view class="flex-vertical xc-title-content"> 107 <view class="flex-vertical xc-title-content">
108 - <image class="xc-title-img" src="../../../images/medal.png"></image> 108 + <image class="xc-title-img" src="{{iurl}}/miniapp/images/medal.png"></image>
109 <view class="three-level-word" > 109 <view class="three-level-word" >
110 我的权益 110 我的权益
111 </view> 111 </view>
@@ -167,7 +167,7 @@ @@ -167,7 +167,7 @@
167 <view class="fs26">秒杀活动</view> 167 <view class="fs26">秒杀活动</view>
168 </view> 168 </view>
169 <view class="item t-c" bindtap="go_qy" wx:if="{{qy_list!=null && is_init && gradeId}}"> 169 <view class="item t-c" bindtap="go_qy" wx:if="{{qy_list!=null && is_init && gradeId}}">
170 - <image class="xc-center-img " src="/images/quanyi2.png"></image> 170 + <image class="xc-center-img " src="{{iurl}}/miniapp/images/quanyi2.png"></image>
171 <view class="fs26">我的权益</view> 171 <view class="fs26">我的权益</view>
172 </view> 172 </view>
173 173
@@ -188,7 +188,7 @@ @@ -188,7 +188,7 @@
188 </view> 188 </view>
189 189
190 <view class="item t-c" data-url="/pages/user/address_list/address_list" bindtap="goto" > 190 <view class="item t-c" data-url="/pages/user/address_list/address_list" bindtap="goto" >
191 - <image class="xc-center-img " src="/images/add2.png"></image> 191 + <image class="xc-center-img " src="{{iurl}}/miniapp/images/add2.png"></image>
192 <view class="four-level-word">我的地址</view> 192 <view class="four-level-word">我的地址</view>
193 </view> 193 </view>
194 194