Commit 776bc9e4e703c88a217ecbc31804dcbf52e39995

Authored by 后端开发-许程
1 parent d3022c2a

加入购物车,门店地址修改

app.wxss
... ... @@ -303,6 +303,17 @@ justify-content:space-around;
303 303 .xc-ash{
304 304 color: #b9b9b9;
305 305 }
  306 +.xc-ash-9f{
  307 + color: #9fa1a0;
  308 +
  309 +}
  310 +
  311 +.xc-ash_c999{
  312 +color: #999;
  313 +}
  314 +.xc-ash-b{
  315 +background: #b9b9b9;
  316 +}
306 317 .xc-black{
307 318 color: #000;
308 319 }
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -415,7 +415,7 @@ Page({
415 415 mapurl_f_img=res1.data.data.video_img;
416 416 }
417 417 })
418   -
  418 + console.log(fir_com,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
419 419 ee.setData({
420 420 gallery: gallery,
421 421 is_collect: is_collect,
... ... @@ -916,7 +916,7 @@ Page({
916 916 },
917 917 openSpecModel: function(t) {
918 918 var open_store = t.currentTarget.dataset.ind;
919   - console.log(t,"加入购物车头",open_store);
  919 +
920 920 this.setData({
921 921 store: 0, choice_sort_store: 0, sort_store: 0, open_ind_store: open_store,
922 922 })
... ... @@ -2744,10 +2744,12 @@ Page({
2744 2744 th.data.lon = res.longitude;
2745 2745 th.data.is_get_local_ok = 1;
2746 2746 th.setData({ is_gps: 1 });
2747   - th.onShow();
  2747 + //th.onShow();
  2748 + th.get_sto();
2748 2749 },
2749 2750 fail: function (res) {
2750   - th.onShow();
  2751 + //th.onShow();
  2752 + th.get_sto();
2751 2753 if (res.errCode == 2) {
2752 2754 th.setData({ is_gps: 0 });
2753 2755 if (th.data.is_gps == 0) {
... ... @@ -2791,17 +2793,14 @@ close_popup:function(e){
2791 2793 var index=e.currentTarget.dataset.index;
2792 2794 var region_name = e.currentTarget.dataset.region;
2793 2795 var item = this.data.all_sto[index];
2794   - this.setData({ region_name: region_name, sort_store: 0, choice_sort_store:1, sec_sto: item,sec_pick_index:0 });
  2796 + this.setData({ region_name: region_name, sort_store: 0, choice_sort_store:1, sec_sto: item,sec_pick_index:0 });
2795 2797 },
2796 2798  
2797   - //---点击二级之后的选择---
2798   - choose_for_store:function (e) {
2799   - var index_c=e.currentTarget.dataset.ind;
2800   - this.setData({sec_pick_index:index_c,fir_pick_index:0})
2801   - },
  2799 +
2802 2800  
2803 2801 choose_for_store_fir:function (e) {
2804 2802 var index_c=e.currentTarget.dataset.ind;
  2803 + console.log("选择门店的id+",index_c);
2805 2804 this.setData({fir_pick_index:index_c})
2806 2805 },
2807 2806  
... ... @@ -2836,45 +2835,37 @@ close_popup:function(e){
2836 2835 var index=th.data.sec_pick_index;
2837 2836 item=th.data.sec_sto.s_arr[index];
2838 2837 }
2839   - console.log("王朝马汉吱吱吱吱666666666666", item);
  2838 +
2840 2839 th.setData({def_pick_store:item,sto_sele_name:item.pickup_name,
2841 2840 sto_sele_id:item.pickup_id,sto_sele_distr:item.distr_type,store:0,choice_sort_store:0});
2842 2841 },
2843   -
  2842 + //---点击二级之后的选择---
  2843 + choose_for_store: function (e) {
  2844 + var index_c = e.currentTarget.dataset.ind;
  2845 + console.log("qqqqqqqqqqqqqqqqqqqqqqqqq", index_c),
  2846 + this.setData({ sec_pick_index: index_c, fir_pick_index: index_c })
  2847 + },
2844 2848 //把选择的门店设置成默认的门店def_pick
2845 2849 set_def_pick:function (e) {
2846   - var th = this; var item = null;
2847   - var openindstore = e.currentTarget.dataset.openindstore;
2848   - if (openindstore == 1) {
2849   -
2850   - th.setData({
2851   - openSpecModal: !0,
2852   - openSpecModal_ind: openindstore,
2853   - store: 0, choice_sort_store: 0, sort_store: 0,
2854   - });
2855   - } else if (openindstore == 2) {
2856   -
2857   - th.setData({
2858   - openSpecModal: !0,
2859   - openSpecModal_ind: openindstore,
2860   - store: 0, choice_sort_store: 0, sort_store: 0,
2861   - });
2862   - } else {
2863   - th.setData({
2864   - store: 0, choice_sort_store: 0, sort_store: 0,
2865   - })
2866   - }
2867   -
  2850 + var th = this; var item = null;
  2851 +
2868 2852 if(th.data.choice_sort_store==0 ){
  2853 +
2869 2854 var index=th.data.fir_pick_index;
  2855 + console.log("分类的门店地址0",index);
2870 2856 if(th.data.is_show_sto_cat==1){
  2857 +
2871 2858 item=th.data.def_pickpu_list[index];
  2859 + console.log(item,"分类的门店地址1", index);
2872 2860 }else{
  2861 + console.log("分类的门店地址22222", index);
2873 2862 item=th.data.only_pk[index]; //当没有门店分类的时候
  2863 + console.log(item,"分类的门店地址22222", index);
2874 2864 }
2875 2865 }else{
2876 2866 var index=th.data.sec_pick_index;
2877 2867 item=th.data.sec_sto.s_arr[index];
  2868 + console.log(item,"分类的门店地址333333333333", index);
2878 2869 }
2879 2870  
2880 2871 var store_id=o.stoid;
... ... @@ -2885,8 +2876,8 @@ close_popup:function(e){
2885 2876 data: { user_id,def_pickup_id},
2886 2877 success:function(res){
2887 2878 console.log("是什么",res.data.code);
2888   - if (res.data.code!=-1){
2889   - th.setData({fir_pick_index:0});
  2879 + if (res.data.code==0){
  2880 + if (th.data.choice_sort_store == 0) th.setData({fir_pick_index:0});
2890 2881 s.showWarning("设置门店地址成功", null, 500, !1);
2891 2882 }else{
2892 2883 console.log("门店地址失败");
... ... @@ -2900,6 +2891,26 @@ close_popup:function(e){
2900 2891 def_pick_store: item, sto_sele_name: item.pickup_name,
2901 2892 sto_sele_id: item.pickup_id, sto_sele_distr: item.distr_type, store: 0, choice_sort_store: 0
2902 2893 });
  2894 +
  2895 +
  2896 + var openindstore = e.currentTarget.dataset.openindstore;
  2897 + if (openindstore == 1) {
  2898 + th.setData({
  2899 + openSpecModal: !0,
  2900 + openSpecModal_ind: openindstore,
  2901 + store: 0, choice_sort_store: 0, sort_store: 0,
  2902 + });
  2903 + } else if (openindstore == 2) {
  2904 + th.setData({
  2905 + openSpecModal: !0,
  2906 + openSpecModal_ind: openindstore,
  2907 + store: 0, choice_sort_store: 0, sort_store: 0,
  2908 + });
  2909 + } else {
  2910 + th.setData({
  2911 + store: 0, choice_sort_store: 0, sort_store: 0,
  2912 + })
  2913 + }
2903 2914  
2904 2915 },
2905 2916  
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -302,13 +302,13 @@
302 302  
303 303 <!-- 门店收货地址 -->
304 304 <view class="xc-address_frame flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" >
305   - <view class="address_frame">
  305 + <view class="address_frame" bindtap="choice_store" data-ind="0">
306 306 <view class="flex-vertical-between ">
307   - <view class="flex">
  307 + <view class="flex-vertical select_store_height">
308 308 <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
309   - <view class="fs28">选择门店</view>
  309 + <view class="fs30 xc-ash-9f">选择门店</view>
310 310 </view>
311   - <view class="red_bb fs32" bindtap="choice_store"data-ind="0">
  311 + <view class="red_bb fs32">
312 312 更多门店
313 313 <text class="bg_jj"></text>
314 314 </view>
... ... @@ -317,14 +317,13 @@
317 317 <view wx:if="{{def_pick_store}}">
318 318 <view class="flex-space-between address ai_end ">
319 319 <view>
320   - <text class="fs32 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
321   -
  320 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
322 321 </view>
323   - <view class="distance fs20"wx:if="{{def_pick_store.distance!=null}}">
324   - 距离:{{filters.toFix(def_pick_store.distance,0)}}m
  322 + <view class="distance fs24"wx:if="{{def_pick_store.distance!=null}}">
  323 + 距离:{{filters.toFix(def_pick_store.distance,0)}}m
325 324 </view>
326 325 </view>
327   - <view class="fs20">地址:{{def_pick_store.fulladdress}}</view>
  326 + <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view>
328 327 </view>
329 328 </view>
330 329  
... ... @@ -370,11 +369,11 @@
370 369 <view class="xc_comment-left">
371 370 <view class="xc_comment-user">
372 371 <view class="xc_user-img">
373   - <image class="xc_imgs" src='{{item.head_pic}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image>
  372 + <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image>
374 373 </view>
375 374  
376 375 <view class="xc_user">
377   - <view class="xc_user-name five-level-word">{{item.username}}</view>
  376 + <view class="xc_user-name five-level-word">{{item.is_anonymous!=1?item.username:'匿名'}}</view>
378 377 <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
379 378 </view>
380 379 </view>
... ... @@ -603,9 +602,9 @@
603 602 <view style='border-bottom:4rpx solid #eee;'>
604 603 <view class="middle">
605 604 <view class="middle-img-frame">
606   - <image class="middle-img" src="{{item.head_pic}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image>
  605 + <image class="middle-img" src="{{item.is_anonymous!=1?item.head_pic:iurl+'/miniapp/images/hui_hear_pic.png'}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image>
607 606 <view class="middle-user-frame">
608   - <view class="middle-user">{{item.username==''?'匿名用户':item.username}}</view>
  607 + <view class="middle-user">{{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}}</view>
609 608 <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
610 609 </view>
611 610 </view>
... ... @@ -673,11 +672,20 @@
673 672 </navigator>
674 673 </view>
675 674 <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>
  675 +
676 676 <block wx:if="{{prom_type==0}}">
  677 + <block wx:if="{{sele_g.store_count>0}}">
677 678 <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>
678 679 <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view>
  680 + </block>
  681 + <block wx:else>
  682 + <view class="is_stock cart-btn is_stock xc-ash-b " style="width:55.5%">
  683 + 库存不足
  684 + </view>
  685 + </block>
679 686 </block>
680 687  
  688 +
681 689 <!-------秒杀-------->
682 690 <block wx:if="{{prom_type==1}}">
683 691 <block wx:if="{{prom_st==1 && !prom_r_null}}">
... ... @@ -781,8 +789,8 @@
781 789 <view class="flex-space-between address ai_end xc-width ">
782 790  
783 791 <view class="flex ai_end" wx:if="{{def_pick_store}}">
784   - <text class="fs28 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
785   - <view class="distance fs20 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  792 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  793 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
786 794 距离:{{filters.toFix(def_pick_store.distance,0)}}m
787 795 </view>
788 796 </view>
... ... @@ -790,7 +798,7 @@
790 798 <!-- 没有门店的时候 -->
791 799 <view class="flex" bindtap="choice_store"wx:else>
792 800 <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
793   - <view class="fs28">选择门店</view>
  801 + <view class="fs28 xc-ash-9f">选择门店</view>
794 802 </view>
795 803  
796 804 <view class="red-co fs28" bindtap="choice_store" >
... ... @@ -798,7 +806,7 @@
798 806 <text class="right-arrow"></text>
799 807 </view>
800 808 </view>
801   - <view class="fs20 xc-ash xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
  809 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
802 810 </view>
803 811 <!----商品的属性项目---->
804 812 <view class="xc-goods-attribute">
... ... @@ -1055,7 +1063,7 @@
1055 1063 <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>
1056 1064 </view>
1057 1065 <view class="felx choose_more" bindtap="more_store">
1058   - <text class="fs22 red-co" wx:if="{{is_show_sto_cat}}">{{choice_sort_store==0?'选择更多门店':'返回'}}</text>
  1066 + <text class="fs26 red-co" wx:if="{{is_show_sto_cat}}">{{choice_sort_store==0?'更多门店':'返回'}}</text>
1059 1067 <view class="bg_rights"></view>
1060 1068 </view>
1061 1069 </view>
... ... @@ -1078,13 +1086,14 @@
1078 1086 <view class="address-frame xc-ash">
1079 1087 <view class="flex-vertical-between ">
1080 1088 <view class="flex xc-ash">
1081   - <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view>
  1089 + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>
1082 1090 </view>
1083 1091 <view>
1084   - <view class="distance fs20 address-val"wx:if="{{item.distance!=null}}">距离:{{filters.toFix(item.distance,0)}}m</view>
  1092 + <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}">
  1093 + 距离:{{filters.toFix(item.distance/1000,2)}}km</view>
1085 1094 </view>
1086 1095 </view>
1087   - <view class="fs20">地址:{{item.fulladdress}}</view>
  1096 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
1088 1097 </view>
1089 1098 </view>
1090 1099 </view>
... ... @@ -1103,13 +1112,13 @@
1103 1112 <view class="address-frame xc-ash">
1104 1113 <view class="flex-vertical-between ">
1105 1114 <view class="flex xc-ash">
1106   - <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view>
  1115 + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>
1107 1116 </view>
1108 1117 <view>
1109   - <view class="distance fs20 address-val"wx:if="{{item.distance!=null}}">距离:{{filters.toFix(item.distance,0)}}m</view>
  1118 + <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}">距离:{{filters.toFix(item.distance/1000,2)}}km</view>
1110 1119 </view>
1111 1120 </view>
1112   - <view class="fs20">地址:{{item.fulladdress}}</view>
  1121 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
1113 1122 </view>
1114 1123 </view>
1115 1124 </view>
... ... @@ -1132,10 +1141,10 @@
1132 1141 <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view>
1133 1142 </view>
1134 1143 <view>
1135   - <view class="distance fs20 address-val"wx:if="{{item.distance!=null}}">距离:{{filters.toFix(item.distance,0)}}m</view>
  1144 + <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}"> 距离:{{filters.toFix(item.distance/1000,2)}}km</view>
1136 1145 </view>
1137 1146 </view>
1138   - <view class="fs20">地址:{{item.fulladdress}}</view>
  1147 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
1139 1148 </view>
1140 1149 </view>
1141 1150 </view>
... ... @@ -1163,7 +1172,7 @@
1163 1172 <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>
1164 1173 </view>
1165 1174 <view class="felx choose_mores" bindtap="returns">
1166   - <text class="fs22 red-co">返回</text>
  1175 + <text class="fs26 red-co">返回</text>
1167 1176 </view>
1168 1177 </view>
1169 1178 </view>
... ... @@ -1171,7 +1180,7 @@
1171 1180  
1172 1181 <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}">
1173 1182 <view class="sort-store flex-vertical-between" >
1174   - <view class="fs28" di>{{item.name}}</view>
  1183 + <view class="fs30" di>{{item.name}}</view>
1175 1184 <view class="black_rights-frame">
1176 1185 <view class="black_rights"></view>
1177 1186 </view>
... ...
pages/goods/goodsInfo/goodsInfo.wxss
... ... @@ -2281,6 +2281,7 @@ width: 40rpx;
2281 2281 background: #eee;
2282 2282 border-radius: 20rpx;
2283 2283 margin-right: 5rpx;
  2284 + color: #999;
2284 2285 }
2285 2286 /* 选择门店的弹窗 */
2286 2287 .mongolia-layer{
... ... @@ -2306,10 +2307,10 @@ height: 70%;
2306 2307 }
2307 2308 .popup-top{
2308 2309 border-bottom: 1rpx solid #eee;
2309   - height: 140rpx;
  2310 + height: 155rpx;
2310 2311 width: 95%;
2311 2312 margin: auto;
2312   - line-height: 140rpx;
  2313 + line-height: 155rpx;
2313 2314  
2314 2315 }
2315 2316 .bg_rights{
... ... @@ -2323,12 +2324,12 @@ height: 70%;
2323 2324 .modal-closes {
2324 2325 position: absolute;
2325 2326 right: 30rpx;
2326   - top: -10rpx;
  2327 + top: -15rpx;
2327 2328 height: 25rpx;
2328 2329  
2329 2330 }
2330 2331 .choose_more{
2331   - margin-top: 30rpx;
  2332 + margin-top: 40rpx;
2332 2333 margin-right: 20rpx;
2333 2334  
2334 2335 }
... ... @@ -2384,8 +2385,8 @@ margin-left: 17rpx;
2384 2385  
2385 2386 }
2386 2387 .address-val{
2387   - height: 30rpx;
2388   -line-height: 30rpx;
  2388 + height: 38rpx;
  2389 +line-height: 38rpx;
2389 2390  
2390 2391 }
2391 2392 .store-bottom{
... ... @@ -2397,16 +2398,16 @@ line-height: 30rpx;
2397 2398 }
2398 2399 .determine{
2399 2400 width: 260rpx;
2400   - height: 44rpx;
  2401 + height: 55rpx;
2401 2402 border-radius: 50rpx;
2402   - line-height: 44rpx;
  2403 + line-height: 55rpx;
2403 2404 }
2404 2405 .default{
2405 2406 width: 260rpx;
2406   - height: 44rpx;
  2407 + height: 55rpx;
2407 2408 border:3rpx solid #c8c8c8;
2408 2409 border-radius: 50rpx;
2409   - line-height: 44rpx;
  2410 + line-height: 55rpx;
2410 2411 }
2411 2412 .store-bottom-frame{
2412 2413 width: 95%;
... ... @@ -2473,4 +2474,8 @@ margin-bottom:40rpx;
2473 2474 .is_stock{
2474 2475 width: 58%;
2475 2476 height: 70rpx;
  2477 +border-radius: 55rpx;
  2478 +}
  2479 +.select_store_height{
  2480 + height: 50rpx;
2476 2481 }
2477 2482 \ No newline at end of file
... ...