Commit a54e369fc260abbf26ee88233a3da17f6535c158
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
20 changed files
with
225 additions
and
69 deletions
components/diy_goodsGroup/diy_goodsGroup.js
| ... | ... | @@ -151,6 +151,9 @@ Component({ |
| 151 | 151 | index = 0, |
| 152 | 152 | gdata = []; |
| 153 | 153 | |
| 154 | + var user_id=getApp().globalData.user_id; | |
| 155 | + if(!user_id) user_id=0; | |
| 156 | + | |
| 154 | 157 | //--初始化卡类-- |
| 155 | 158 | th.card_init(); |
| 156 | 159 | var os=getApp().globalData.setting; |
| ... | ... | @@ -162,8 +165,10 @@ Component({ |
| 162 | 165 | for (var i = 0; i < g_id.length; i++) { |
| 163 | 166 | str += g_id[i].goodsid + ","; |
| 164 | 167 | } |
| 165 | - str=str.substring(0, str.length - 1); | |
| 168 | + str=str.substring(0, str.length - 1); | |
| 169 | + | |
| 166 | 170 | await app.request.get("/api/weshop/goods/getgoodslistOrdby?store_id=" + os.stoid + "&goodsidlist=" + str, { |
| 171 | + data:{user_id:user_id}, | |
| 167 | 172 | isShowLoading:false, |
| 168 | 173 | success: function(res) { |
| 169 | 174 | th.data.loading=0; |
| ... | ... | @@ -218,6 +223,10 @@ Component({ |
| 218 | 223 | if(th.data.is_hot) r_data.is_hot=th.data.is_hot; |
| 219 | 224 | if(th.data.is_new) r_data.is_new=th.data.is_new; |
| 220 | 225 | |
| 226 | + var user_id=getApp().globalData.user_id; | |
| 227 | + if(!user_id) user_id=0; | |
| 228 | + r_data.user_id=user_id; | |
| 229 | + | |
| 221 | 230 | await app.request.promiseGet("/api/weshop/goods/page", { |
| 222 | 231 | data:r_data |
| 223 | 232 | }).then(res => { |
| ... | ... | @@ -245,6 +254,7 @@ Component({ |
| 245 | 254 | isonsale: 1, |
| 246 | 255 | orderField: "sort", |
| 247 | 256 | orderType: 'asc', |
| 257 | + user_id:user_id | |
| 248 | 258 | } |
| 249 | 259 | }).then(res => { |
| 250 | 260 | th.data.loading=0; | ... | ... |
components/diy_goodsGroup/diy_goodsGroup.wxml
| ... | ... | @@ -17,10 +17,18 @@ |
| 17 | 17 | <view class='zs_goods {{g_filter.get_border_type(object.big_order_type)}}'> |
| 18 | 18 | <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" class="s1_gk_a1"> |
| 19 | 19 | <view class='zs_top rel'> |
| 20 | - <image class='zs_t_img' src="{{item.goods_img}}" | |
| 21 | - data-errorimg="goods_array[{{index}}].goods_img" | |
| 22 | - binderror="bind_bnerr3" lazy-load="true" | |
| 23 | - ></image> | |
| 20 | + | |
| 21 | + <block wx:if="{{object.big_order_type==3}}"> | |
| 22 | + <view style="position: relative; width: 100%; height: 100%"> | |
| 23 | + <image class='zs_t_img' src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true" | |
| 24 | + binderror="bind_bnerr3"></image> | |
| 25 | + <image class="n_box" style="top: {{object.top}}%;left:{{object.left}}%;width: {{object.width}}%;height: {{object.width}}%" src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" binderror="bind_bnerr3"></image> | |
| 26 | + </view> | |
| 27 | + </block> | |
| 28 | + <block wx:else> | |
| 29 | + <image class='zs_t_img' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" | |
| 30 | + binderror="bind_bnerr3" lazy-load="true" ></image> | |
| 31 | + </block> | |
| 24 | 32 | |
| 25 | 33 | <block wx:if="{{object.goodicon==3}}"> |
| 26 | 34 | <image class='{{g_filter.get_class(object.column,object.position)}}' src='{{object.customicon}}'></image> |
| ... | ... | @@ -166,8 +174,20 @@ |
| 166 | 174 | <view class="zs_goods_ban"> |
| 167 | 175 | <view class='zs_goods_2l'> |
| 168 | 176 | <view class='zs_top_2l rel'> |
| 169 | - <image class='zs_t_img_2l' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | |
| 177 | + | |
| 178 | + <block wx:if="{{object.big_order_type==3}}"> | |
| 179 | + <view style="position: relative; width: 100%; height: 100%"> | |
| 180 | + <image class='zs_t_img_2l' src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true" | |
| 181 | + binderror="bind_bnerr3"></image> | |
| 182 | + <image class="n_box" style="top: {{object.top}}%;left:{{object.left}}%;width: {{object.width}}%;height: {{object.width}}%" src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | |
| 183 | + binderror="bind_bnerr3"></image> | |
| 184 | + </view> | |
| 185 | + </block> | |
| 186 | + <block wx:else> | |
| 187 | + <image class='zs_t_img_2l' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | |
| 170 | 188 | binderror="bind_bnerr3"></image> |
| 189 | + </block> | |
| 190 | + | |
| 171 | 191 | <block wx:if="{{object.goodicon==3}}"> |
| 172 | 192 | <image class='{{g_filter.get_class(object.column,object.position)}}' |
| 173 | 193 | src='{{object.customicon}}'></image> |
| ... | ... | @@ -312,9 +332,20 @@ |
| 312 | 332 | <view class="zs_goods_wai_san" > |
| 313 | 333 | <view class="zs_goods_san"> |
| 314 | 334 | <view class='zs_goods_3l {{g_filter.get_border_type(object.big_order_type)}}'> |
| 315 | - <view class='zs_top_3l rel'> | |
| 316 | - <image class='zs_t_img_3l' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | |
| 335 | + <view class='zs_top_3l rel'> | |
| 336 | + <block wx:if="{{object.big_order_type==3}}"> | |
| 337 | + <view style="position: relative; width: 100%; height: 100%"> | |
| 338 | + <image class='zs_t_img_3l' src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true" | |
| 339 | + binderror="bind_bnerr3"></image> | |
| 340 | + <image class="n_box" style="top: {{object.top}}%;left:{{object.left}}%;width: {{object.width}}%;height: {{object.width}}%" src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | |
| 341 | + binderror="bind_bnerr3"></image> | |
| 342 | + </view> | |
| 343 | + </block> | |
| 344 | + <block wx:else> | |
| 345 | + <image class='zs_t_img_3l' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | |
| 317 | 346 | binderror="bind_bnerr3"></image> |
| 347 | + </block> | |
| 348 | + | |
| 318 | 349 | <block wx:if="{{object.goodicon==3}}"> |
| 319 | 350 | <image class='{{g_filter.get_class(object.column,object.position)}}' |
| 320 | 351 | src='{{object.customicon}}'></image> |
| ... | ... | @@ -457,9 +488,18 @@ |
| 457 | 488 | <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" class="s1_gk_a1"> |
| 458 | 489 | <view class="{{object.noboder==0?'zs_goods_xiao_bottom':'zs_goods_xiao'}}" > |
| 459 | 490 | <view class='zs_top_x'> |
| 460 | - <!--<image class='zs_t_img_x'></image>--> | |
| 461 | - <block> | |
| 462 | - <image class='zs_t_img_x' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | |
| 491 | + <block wx:if="{{object.big_order_type==3}}"> | |
| 492 | + <view style="position: relative; width: 100%; height: 100%"> | |
| 493 | + <image class='zs_t_img_x' src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true" | |
| 494 | + binderror="bind_bnerr3"></image> | |
| 495 | + <image class="n_box" style="top: {{object.top}}%;left:{{object.left}}%;width: {{object.width}}%;height: {{object.width}}%" src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | |
| 496 | + binderror="bind_bnerr3"></image> | |
| 497 | + </view> | |
| 498 | + </block> | |
| 499 | + | |
| 500 | + <block wx:else> | |
| 501 | + <image class="zs_t_img_x {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}" | |
| 502 | + src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | |
| 463 | 503 | binderror="bind_bnerr3" mode="widthFix" style='max-height:290rpx'></image> |
| 464 | 504 | </block> |
| 465 | 505 | |
| ... | ... | @@ -587,12 +627,8 @@ |
| 587 | 627 | <view class='wz_red'>¥{{item.shop_price}}</view> |
| 588 | 628 | <view class='del'>¥{{item.market_price}}</view> |
| 589 | 629 | </block> |
| 590 | - | |
| 591 | - | |
| 630 | + | |
| 592 | 631 | </block> |
| 593 | - | |
| 594 | - | |
| 595 | - | |
| 596 | 632 | </view> |
| 597 | 633 | <view class='zs_wz5_x' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view> |
| 598 | 634 | </view> |
| ... | ... | @@ -622,17 +658,30 @@ |
| 622 | 658 | |
| 623 | 659 | |
| 624 | 660 | <!--商品展示--> |
| 625 | - <swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.column==5}}" style="height: {{swiper_hei}}rpx;"> | |
| 661 | +<swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.column==5}}" style="height: {{swiper_hei}}rpx;"> | |
| 626 | 662 | <view class="sp"> |
| 627 | 663 | <swiper-item class="s_it" wx:for="{{goods_array}}"> |
| 628 | 664 | <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> |
| 629 | 665 | <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" style="width: 32%" > |
| 630 | - <view class='one' style="margin-left: 10rpx"> | |
| 666 | + <view class="one {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}} " style="margin-left: 10rpx"> | |
| 631 | 667 | <view class='sp_top'> |
| 632 | 668 | <view class='s_img' style="position: relative; width: 100%"> |
| 633 | - <image src="{{aitem.goods_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].goods_img" | |
| 669 | + | |
| 670 | + <block wx:if="{{object.big_order_type==3}}"> | |
| 671 | + <view style="position: relative; width: 100%; height: 100%"> | |
| 672 | + <image src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true" | |
| 673 | + binderror="bind_bnerr3"></image> | |
| 674 | + | |
| 675 | + <image class="n_box" style="top: {{object.top}}%;left:{{object.left}}%;width: {{object.width}}%;height: {{object.width}}%" src="{{aitem.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" binderror="bind_bnerr3"></image> | |
| 676 | + </view> | |
| 677 | + </block> | |
| 678 | + | |
| 679 | + <block wx:else> | |
| 680 | + <image src="{{aitem.goods_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].goods_img" | |
| 634 | 681 | binderror="bind_bnerr3" lazy-load="true" style="width: 100%"></image> |
| 635 | - | |
| 682 | + </block> | |
| 683 | + | |
| 684 | + | |
| 636 | 685 | <block wx:if="{{object.goodicon==3}}"> |
| 637 | 686 | <image class='{{g_filter.get_class(object.column,object.position)}}' |
| 638 | 687 | src='{{object.customicon}}'></image> | ... | ... |
components/diy_goodsGroup/diy_goodsGroup.wxss
| ... | ... | @@ -154,6 +154,10 @@ |
| 154 | 154 | margin-left: 20rpx; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | +.zs_t_img_x.zj{ border: 1rpx solid #eee;} | |
| 158 | +.zs_t_img_x.yj{ border: 1rpx solid #eee;border-radius: 18rpx;} | |
| 159 | + | |
| 160 | + | |
| 157 | 161 | .zs_center_x { |
| 158 | 162 | width: 100%; |
| 159 | 163 | min-height: 200rpx; |
| ... | ... | @@ -727,8 +731,13 @@ swiper { |
| 727 | 731 | |
| 728 | 732 | .one { |
| 729 | 733 | margin-left: 14rpx; |
| 734 | + overflow: hidden; | |
| 730 | 735 | } |
| 731 | 736 | |
| 737 | +.one.zj{ border: 1rpx solid #eee;} | |
| 738 | +.one.yj{ border: 1rpx solid #eee; border-radius: 18rpx;} | |
| 739 | + | |
| 740 | + | |
| 732 | 741 | .sp .sp_top .s_top1_kill { |
| 733 | 742 | position: absolute; |
| 734 | 743 | background-color: #c4182e; |
| ... | ... | @@ -814,5 +823,6 @@ top: 10rpx; |
| 814 | 823 | position: absolute; |
| 815 | 824 | right: 0rpx; |
| 816 | 825 | bottom: 10rpx; |
| 826 | +} | |
| 817 | 827 | |
| 818 | -} | |
| 819 | 828 | \ No newline at end of file |
| 829 | +.n_box{ position: absolute !important;z-index: 10} | |
| 820 | 830 | \ No newline at end of file | ... | ... |
components/goods_list/goods_list.wxml
| ... | ... | @@ -4,15 +4,15 @@ |
| 4 | 4 | <view class="collects"> |
| 5 | 5 | <view class="hang "> |
| 6 | 6 | <!-- 商品详情 --> |
| 7 | - <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}"> | |
| 8 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}" hover-class="none"> | |
| 7 | + <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}"> | |
| 8 | + <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}" hover-class="none"> | |
| 9 | 9 | <!-- 商品图⽚ --> |
| 10 | 10 | <image class="sp" src="{{url+item.original_img}}" mode="aspectFill" binderror="bind_bnerr_xc" data-url="{{url+item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image> |
| 11 | 11 | <view class="bottom"> |
| 12 | 12 | <!-- 商品名称 --> |
| 13 | 13 | <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view> |
| 14 | 14 | <!-- 判断是否有活动价 --> |
| 15 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | |
| 15 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> | |
| 16 | 16 | <view class="pdt10"> |
| 17 | 17 | <view class="money flex xc-wc" > |
| 18 | 18 | <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text> | ... | ... |
packageA/pages/activity_share/activity_share.js
| ... | ... | @@ -167,10 +167,22 @@ Page({ |
| 167 | 167 | if(item){ |
| 168 | 168 | var price = item.price; |
| 169 | 169 | if(!price) price=item.shop_price; |
| 170 | - | |
| 170 | + switch(th.data.currentIndex){ | |
| 171 | + case 0: item.prom_type=1;break; | |
| 172 | + case 1: item.prom_type=6;break; | |
| 173 | + case 2: | |
| 174 | + if(th.data.currentIndex2==1) item.prom_type = 5; | |
| 175 | + if(th.data.currentIndex2==2) { | |
| 176 | + item.prom_type = 3; | |
| 177 | + item.id=item.prom_id; | |
| 178 | + } | |
| 179 | + break; | |
| 180 | + } | |
| 181 | + item.prom_id=item.id; | |
| 182 | + | |
| 171 | 183 | var title= item.goods_name; |
| 172 | 184 | var img=this.data.url+item.original_img; |
| 173 | - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | |
| 185 | + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id+"&prom_type="+item.prom_type+"&prom_id="+item.prom_id; | |
| 174 | 186 | if(getApp().globalData.user_id){ |
| 175 | 187 | url+="&first_leader="+getApp().globalData.user_id; |
| 176 | 188 | } |
| ... | ... | @@ -547,7 +559,26 @@ Page({ |
| 547 | 559 | |
| 548 | 560 | var app = getApp(); |
| 549 | 561 | var unit = that.data.screenWidth / 750 * 1.35; //基础单位, |
| 562 | + | |
| 563 | + var prom_type=0; | |
| 564 | + var prom_id=th.data.share_good.id; | |
| 565 | + switch(th.data.currentIndex){ | |
| 566 | + case 0: prom_type=1;break; | |
| 567 | + case 1: prom_type=6;break; | |
| 568 | + case 2: | |
| 569 | + if(th.data.currentIndex2==1) prom_type = 5; | |
| 570 | + if(th.data.currentIndex2==2){ | |
| 571 | + prom_type = 3; | |
| 572 | + prom_id=th.data.share_good.prom_id; | |
| 573 | + } | |
| 574 | + break; | |
| 575 | + } | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 550 | 579 | var scene = th.data.share_good.goods_id+""; |
| 580 | + scene+="."+prom_type+"."+prom_id; | |
| 581 | + | |
| 551 | 582 | var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; |
| 552 | 583 | if(user_id>0){ |
| 553 | 584 | scene+="_"+user_id; |
| ... | ... | @@ -1129,14 +1160,27 @@ Page({ |
| 1129 | 1160 | this.data.currentPage=1; |
| 1130 | 1161 | this.requestGoodsList(); |
| 1131 | 1162 | }, |
| 1132 | - | |
| 1133 | - | |
| 1134 | - go_goods:function(e){ | |
| 1135 | - var index=e.currentTarget.dataset.index; | |
| 1136 | - var item=this.data.list[index]; | |
| 1137 | - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | |
| 1138 | - getApp().goto(url); | |
| 1139 | - }, | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + go_goods: function (e) { | |
| 1166 | + var index = e.currentTarget.dataset.index; | |
| 1167 | + var item = this.data.list[index]; | |
| 1168 | + var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | |
| 1169 | + | |
| 1170 | + switch(this.data.currentIndex){ | |
| 1171 | + case 0: item.prom_type = 1;break; | |
| 1172 | + case 1: item.prom_type = 6;break; | |
| 1173 | + case 2: | |
| 1174 | + if(th.data.currentIndex2==1) item.prom_type = 5; | |
| 1175 | + if(th.data.currentIndex2==2) item.prom_type = 3; | |
| 1176 | + break; | |
| 1177 | + } | |
| 1178 | + | |
| 1179 | + item.prom_id = item.id; | |
| 1180 | + url+="&prom_type="+item.prom_type+"&prom_id="+item.prom_id | |
| 1181 | + | |
| 1182 | + getApp().goto(url); | |
| 1183 | + }, | |
| 1140 | 1184 | |
| 1141 | 1185 | go_coll_good:function(e){ |
| 1142 | 1186 | var gid=e.currentTarget.dataset.gid; | ... | ... |
packageA/pages/distribution/goods/goods.wxml
| ... | ... | @@ -75,13 +75,13 @@ |
| 75 | 75 | |
| 76 | 76 | </label> --> |
| 77 | 77 | <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/> |
| 78 | - <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 78 | + <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}"> | |
| 79 | 79 | <view class="pdr20"><image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load/></view> |
| 80 | 80 | <view class="flex fdc jc_sb"> |
| 81 | 81 | <view class="ellipsis-2">{{item.goods_name}}</view> |
| 82 | 82 | <view> |
| 83 | 83 | <!-- 判断是否有活动价 --> |
| 84 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | |
| 84 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> | |
| 85 | 85 | <view class="flex xc-wc ai-center" > |
| 86 | 86 | <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> |
| 87 | 87 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
| ... | ... | @@ -214,7 +214,7 @@ |
| 214 | 214 | </checkbox-group> |
| 215 | 215 | |
| 216 | 216 | <checkbox-group class="fs26 flex pd16 wrap" catchchange="checkboxChange" wx:else> |
| 217 | - <view class="item2 bg-white" wx:for="{{list.pageData}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 217 | + <view class="item2 bg-white" wx:for="{{list.pageData}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}"> | |
| 218 | 218 | <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" mode="aspectFit" lazy-load/> |
| 219 | 219 | <view class="pd20 fs26 flex jc_sb fdc f1"> |
| 220 | 220 | <view class="ellipsis-2">{{item.goods_name}}</view> |
| ... | ... | @@ -222,7 +222,7 @@ |
| 222 | 222 | <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" data-name="checkbox" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/> |
| 223 | 223 | <view> |
| 224 | 224 | <!-- 判断是否有活动价 --> |
| 225 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | |
| 225 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0 }}"> | |
| 226 | 226 | <view class="flex xc-wc ai-center" > |
| 227 | 227 | <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> |
| 228 | 228 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | ... | ... |
packageA/pages/distribution/shop/shop.wxml
| ... | ... | @@ -69,14 +69,14 @@ |
| 69 | 69 | <view class="content"> |
| 70 | 70 | <view class="fs26" wx:if="{{isShowRow}}"> |
| 71 | 71 | <view class="item bg-white flex ai-center pd20" wx:for="{{list}}"> |
| 72 | - <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 72 | + <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}"> | |
| 73 | 73 | <view class="img-container pdr20" data-txt="已售:{{item.sales_sum}}"> |
| 74 | 74 | <image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load mode="aspectFit" /> |
| 75 | 75 | </view> |
| 76 | 76 | <view class="flex fdc jc_sb"> |
| 77 | 77 | <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> |
| 78 | 78 | <!-- 判断是否有活动价 --> |
| 79 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | |
| 79 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> | |
| 80 | 80 | <view class="flex xc-wc pdt20"> |
| 81 | 81 | <text wx:if="{{item.prom_integral}}"> |
| 82 | 82 | <text class="fs30">{{item.prom_integral}}</text> |
| ... | ... | @@ -213,14 +213,14 @@ |
| 213 | 213 | </view> |
| 214 | 214 | </view> |
| 215 | 215 | <view class="fs26 flex pd20 wrap" wx:else> |
| 216 | - <view class="item2 bg-white" wx:for="{{list}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 216 | + <view class="item2 bg-white" wx:for="{{list}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}"> | |
| 217 | 217 | <view class="img-container" data-txt="已售:{{item.sales_sum}}"> |
| 218 | 218 | <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load="true" /> |
| 219 | 219 | </view> |
| 220 | 220 | <view class="pd20 fs26"> |
| 221 | 221 | <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> |
| 222 | 222 | <!-- 判断是否有活动价 --> |
| 223 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | |
| 223 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> | |
| 224 | 224 | <view class="flex xc-wc"> |
| 225 | 225 | <text wx:if="{{item.prom_integral}}"> |
| 226 | 226 | <text class="fs30" style="font-weight: bold;">{{item.prom_integral}}</text> | ... | ... |
packageB/pages/user/collect_list/collect_list.wxml
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | <!-- 商品集合 --> |
| 23 | 23 | <view class="{{editEd?'collects_max colls_max':'collects_max'}}"> |
| 24 | 24 | <navigator class="collect flex-vertical" bindtap="iconClick" data-index="{{index}}" wx:for="{{collects}}" wx:key="{{index}}" |
| 25 | - data-url="{{editEd==0?'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id:''}}"> | |
| 25 | + data-url="{{editEd==0?'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id+'&prom_type='+item.prom_type+'&prom_id='+item.prom_id:''}}"> | |
| 26 | 26 | |
| 27 | 27 | <view class="radioCheck iconClick" wx:if="{{editEd}}"> |
| 28 | 28 | <radio color="rgb(214,1,33)" class="scale" checked="{{item.checked==true?true:false}}"></radio> |
| ... | ... | @@ -46,7 +46,7 @@ |
| 46 | 46 | <!-- 优惠价 --> |
| 47 | 47 | <view class="price flex xc-wc"> |
| 48 | 48 | <view class="fs24">¥</view> |
| 49 | - <view class="fs40">{{item.shop_price}}</view> | |
| 49 | + <view class="fs40">{{item.prom_price?item.prom_price:item.final_price}}</view> | |
| 50 | 50 | </view> |
| 51 | 51 | <!-- 原价 --> |
| 52 | 52 | <view class="flex fs24 line through xc-ash"> | ... | ... |
packageC/pages/presell/cart/cart.js
| ... | ... | @@ -656,7 +656,7 @@ Page({ |
| 656 | 656 | }) |
| 657 | 657 | }else{ |
| 658 | 658 | th.setData({quan_price:0}); |
| 659 | - if(th.data.using_quan[bn_pick].isby==1){ | |
| 659 | + if(th.data.using_quan && th.data.using_quan[bn_pick] && th.data.using_quan[bn_pick].isby==1){ | |
| 660 | 660 | var txt="using_quan["+bn_pick+"]"; |
| 661 | 661 | th.setData({[txt]:{}}); |
| 662 | 662 | } | ... | ... |
pages/activity/seckill_list/seckill_list.js
pages/cart/cart/cart.js
| ... | ... | @@ -2395,6 +2395,28 @@ Page({ |
| 2395 | 2395 | go_url(e){ |
| 2396 | 2396 | var url=e.currentTarget.dataset.url; |
| 2397 | 2397 | getApp().goto(url); |
| 2398 | + }, | |
| 2399 | + | |
| 2400 | + //跳转到商品 | |
| 2401 | + go_gd:function (e) { | |
| 2402 | + var gd= e.currentTarget.dataset.gd; | |
| 2403 | + var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; | |
| 2404 | + var url="/api/weshop/activitylist/getGoodActInfo"; | |
| 2405 | + var req_data={ | |
| 2406 | + store_id:os.stoid,goodsidlist:gd,is_detail:1 | |
| 2407 | + }; | |
| 2408 | + //获取秒杀的多规格 | |
| 2409 | + getApp().request.promiseGet(url, {data:req_data}).then(res=>{ | |
| 2410 | + if(res.data.code==0 && res.data.data){ | |
| 2411 | + if(res.data.data.length==1){ | |
| 2412 | + good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; | |
| 2413 | + } | |
| 2414 | + getApp().goto(good_url); | |
| 2415 | + | |
| 2416 | + }else{ | |
| 2417 | + getApp().goto(good_url); | |
| 2418 | + } | |
| 2419 | + }) | |
| 2398 | 2420 | } |
| 2399 | 2421 | |
| 2400 | 2422 | }); |
| 2401 | 2423 | \ No newline at end of file | ... | ... |
pages/cart/cart/cart.wxml
| ... | ... | @@ -56,7 +56,6 @@ |
| 56 | 56 | <view class="shmd_m"> |
| 57 | 57 | <!-- 门店 --> |
| 58 | 58 | <!--<radio color="red" bindtap="check_th_all_item" class="order-raido flex-center" checked="{{checkAllToggle||item.selected}}" data-pitems="{{pidx}}"></radio>--> |
| 59 | - | |
| 60 | 59 | <icon wx:if="{{checkAllToggle||item.selected}}" class="order-raido flex-center" bindtap="check_th_all_item" data-pitems="{{pidx}}" |
| 61 | 60 | color="red" size="20" type="success"></icon> |
| 62 | 61 | <view wx:else class="icon_no_sele2" bindtap="check_th_all_item" data-pitems="{{pidx}}"></view> |
| ... | ... | @@ -77,7 +76,7 @@ |
| 77 | 76 | </block> |
| 78 | 77 | <block wx:else><view class="order-raido flex-vertical " style="width: 45rpx"></view></block> |
| 79 | 78 | |
| 80 | - <navigator class="goods-img rel" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> | |
| 79 | + <navigator class="goods-img rel" bindtap="go_gd" data-gd="{{items.goods_id}}"> | |
| 81 | 80 | <image class="wh100" src="{{items.original_img}}" binderror="bind_bnerr2" data-errorimg="requestData[{{pidx}}].goods[{{idx}}].original_img" data-url="{{items.original_img}}"></image> |
| 82 | 81 | <block wx:if="{{items.is_gift}}"> |
| 83 | 82 | <view style="background-color:red" class="abs flex-center fs26" wx:if="{{items.is_gift==1}}">赠品</view> |
| ... | ... | @@ -102,7 +101,7 @@ |
| 102 | 101 | </navigator> |
| 103 | 102 | <view class="goods-cont"> |
| 104 | 103 | <view class="goods-name"> |
| 105 | - <navigator class="ellipsis-2 fs30" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}">{{items.goods_name}}</navigator> | |
| 104 | + <navigator bindtap="go_gd" class="ellipsis-2 fs30" data-gd="{{items.goods_id}}">{{items.goods_name}}</navigator> | |
| 106 | 105 | |
| 107 | 106 | <view class="specifications ellipsis-1"> |
| 108 | 107 | <view wx:if="{{items.goods_color || items.goods_spec}}"> | ... | ... |
pages/cart/cart2/cart2.js
| ... | ... | @@ -289,7 +289,6 @@ Page({ |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | }, 1); |
| 292 | - | |
| 293 | 292 | //值在这里换 |
| 294 | 293 | getApp().globalData.plus_buy_back = 0; |
| 295 | 294 | }, |
| ... | ... | @@ -3815,6 +3814,11 @@ Page({ |
| 3815 | 3814 | var index = e.currentTarget.dataset.index; |
| 3816 | 3815 | var txt = "cartlist[" + index + "].focus"; |
| 3817 | 3816 | this.setData({[txt]:0}) |
| 3817 | + }, | |
| 3818 | + | |
| 3819 | + go_url:function (e) { | |
| 3820 | + var url = e.currentTarget.dataset.url; | |
| 3821 | + getApp().goto(url); | |
| 3818 | 3822 | } |
| 3819 | 3823 | |
| 3820 | 3824 | ... | ... |
pages/cart/cart2/cart2.wxml
| ... | ... | @@ -78,15 +78,13 @@ |
| 78 | 78 | </view> |
| 79 | 79 | <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> |
| 80 | 80 | <!----商品图片-----> |
| 81 | - <view class="goods-img" style="position: relative; overflow: hidden"> | |
| 81 | + <view class="goods-img" style="position: relative; overflow: hidden" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}"> | |
| 82 | 82 | <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> |
| 83 | 83 | <text class="zuhe" wx:if="{{items.prom_type==7}}">组合购</text> |
| 84 | - | |
| 85 | - | |
| 86 | 84 | <image class="wh100 bdr14" src="{{items.original_img}}" binderror='cart_set_err' data-err='cartlist[{{pidx}}].goods[{{idx}}].original_img'></image> |
| 87 | 85 | </view> |
| 88 | 86 | <!----商品名称规格----> |
| 89 | - <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> | |
| 87 | + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}" > | |
| 90 | 88 | <view class="goods-name ellipsis-2">{{items.goods_name}}</view> |
| 91 | 89 | <!-- 商品属性 --> |
| 92 | 90 | <view class="flex-vertical fs28 color-gray n_guige"> |
| ... | ... | @@ -252,10 +250,10 @@ |
| 252 | 250 | <!-- <view>门店:{{bn_pickname}}</view> --> |
| 253 | 251 | </view> |
| 254 | 252 | <view class="order-detail"> |
| 255 | - <view class="goods-img"> | |
| 253 | + <view class="goods-img" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}&prom_type={{bn_goods.prom_type}}&prom_id={{bn_goods.prom_id}}"> | |
| 256 | 254 | <image class="wh100 bdr14" src="{{bn_goods.original_img}}" binderror='cart_set_err' data-err="bn_goods.original_img"></image> |
| 257 | 255 | </view> |
| 258 | - <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> | |
| 256 | + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}"> | |
| 259 | 257 | <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view> |
| 260 | 258 | <!-- 商品属性 --> |
| 261 | 259 | <view class="flex-vertical fs28 xc-ash color-gray n_guige"> | ... | ... |
pages/goods/categoryList/categoryList.js
| ... | ... | @@ -52,7 +52,7 @@ Page({ |
| 52 | 52 | currentPage: 1, |
| 53 | 53 | allData: null, |
| 54 | 54 | openFilterModal: !1, |
| 55 | - baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=goods_id&orderType=desc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", | |
| 55 | + baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=sort&orderType=asc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", | |
| 56 | 56 | requestUrl: "", |
| 57 | 57 | tabname: "goods_id", //排序的字段 |
| 58 | 58 | adname: "desc", //升降的字段 |
| ... | ... | @@ -791,7 +791,7 @@ Page({ |
| 791 | 791 | var that = this; |
| 792 | 792 | that.data.requestUrl = t; |
| 793 | 793 | e.get("/api/weshop/goods/page?1=1", { |
| 794 | - data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, | |
| 794 | + data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, | |
| 795 | 795 | success: function (data) { |
| 796 | 796 | console.log(data.data.data.pageData) |
| 797 | 797 | that.setData({ |
| ... | ... | @@ -853,7 +853,7 @@ Page({ |
| 853 | 853 | console.log("page:=" + page) |
| 854 | 854 | var s = this |
| 855 | 855 | e.get("/api/weshop/goods/page?1=1", { |
| 856 | - data: { page: page, cat_id: cid, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, | |
| 856 | + data: { page: page, cat_id: cid, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, | |
| 857 | 857 | success: function (e) { |
| 858 | 858 | console.log(e.data.data.pageData) |
| 859 | 859 | s.setData({ | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -605,7 +605,7 @@ Page({ |
| 605 | 605 | }).then(res => { |
| 606 | 606 | var t = res; |
| 607 | 607 | var data = t.data.data.pageData; |
| 608 | - if (data.length > 0) { | |
| 608 | + if (data && data.length > 0) { | |
| 609 | 609 | //ee.setData({ is_collect: 1, collect_id: data[0].collect_id, }); |
| 610 | 610 | is_collect = 1; |
| 611 | 611 | collect_id = data[0].collect_id; |
| ... | ... | @@ -2135,7 +2135,7 @@ Page({ |
| 2135 | 2135 | |
| 2136 | 2136 | |
| 2137 | 2137 | var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" |
| 2138 | - + th.data.sele_g.gid+"&prom_type="+th.data.sele_g.prom_type+"&prom_id="+th.data.sele_g.prom_id; | |
| 2138 | + + th.data.sele_g.goods_id+"&prom_type="+th.data.sele_g.prom_type+"&prom_id="+th.data.sele_g.prom_id; | |
| 2139 | 2139 | if (getApp().globalData.user_id) { |
| 2140 | 2140 | url += "&first_leader=" + getApp().globalData.user_id; |
| 2141 | 2141 | } |
| ... | ... | @@ -4308,10 +4308,8 @@ Page({ |
| 4308 | 4308 | var unit = that.data.screenWidth / 750 * 1.35; //基础单位, |
| 4309 | 4309 | var path2 = that.data.data.original_img; |
| 4310 | 4310 | var scene = th.data.gid + ""; |
| 4311 | + scene+="."+th.data.sele_g.prom_type+"."+th.data.sele_g.prom_id; | |
| 4311 | 4312 | |
| 4312 | - if(th.data.sele_g.prom_type==1){ | |
| 4313 | - scene+="."+th.data.sele_g.prom_type+"."+th.data.sele_g.prom_id; | |
| 4314 | - } | |
| 4315 | 4313 | var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; |
| 4316 | 4314 | if (user_id > 0) { |
| 4317 | 4315 | scene += "_" + user_id; | ... | ... |
pages/goods/goodsList/goodsList.wxml
| ... | ... | @@ -177,7 +177,7 @@ |
| 177 | 177 | <view class="item-cont"> |
| 178 | 178 | <view class="title ellipsis-2">{{item.goods_name}}</view> |
| 179 | 179 | <!-- 判断是否有活动价 --> |
| 180 | - <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2}}"> | |
| 180 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> | |
| 181 | 181 | <view class="flex on"> |
| 182 | 182 | <!-- 活动价 --> |
| 183 | 183 | <view class="price"> | ... | ... |
pages/goods/search/search.wxml
| ... | ... | @@ -35,7 +35,7 @@ |
| 35 | 35 | <view class="item-cont"> |
| 36 | 36 | <view class="title ellipsis-2">{{item.goods_name}}</view> |
| 37 | 37 | <!-- 判断是否有活动价,小程序没有有团购和拼单 --> |
| 38 | - <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_type!=2}}"> | |
| 38 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_type!=2 && item.prom_id>0}}"> | |
| 39 | 39 | <!-- 活动价 --> |
| 40 | 40 | <view class="price"> |
| 41 | 41 | <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text> | ... | ... |
pages/user/order_detail/order_detail.js
| ... | ... | @@ -1441,6 +1441,28 @@ Page({ |
| 1441 | 1441 | corpId: id, |
| 1442 | 1442 | success(res) {} |
| 1443 | 1443 | }) |
| 1444 | + }, | |
| 1445 | + | |
| 1446 | + //跳转到商品 | |
| 1447 | + go_gd:function (e) { | |
| 1448 | + var gd= e.currentTarget.dataset.gd; | |
| 1449 | + var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; | |
| 1450 | + var url="/api/weshop/activitylist/getGoodActInfo"; | |
| 1451 | + var req_data={ | |
| 1452 | + store_id:os.stoid,goodsidlist:gd,is_detail:1 | |
| 1453 | + }; | |
| 1454 | + //获取秒杀的多规格 | |
| 1455 | + getApp().request.promiseGet(url, {data:req_data}).then(res=>{ | |
| 1456 | + if(res.data.code==0 && res.data.data){ | |
| 1457 | + if(res.data.data.length==1){ | |
| 1458 | + good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; | |
| 1459 | + } | |
| 1460 | + getApp().goto(good_url); | |
| 1461 | + | |
| 1462 | + }else{ | |
| 1463 | + getApp().goto(good_url); | |
| 1464 | + } | |
| 1465 | + }) | |
| 1444 | 1466 | } |
| 1445 | 1467 | |
| 1446 | 1468 | ... | ... |
pages/user/order_detail/order_detail.wxml
| ... | ... | @@ -20,12 +20,12 @@ |
| 20 | 20 | </view> |
| 21 | 21 | <!--wx:if="{{item.return_btn!=4}}" --> |
| 22 | 22 | <view class="order-detail" wx:for="{{order.order_goods}}" wx:key="{{index}}" > |
| 23 | - <view class="goods-img"> | |
| 23 | + <view class="goods-img" bindtap="go_gd" data-gd="{{item.goods_id}}"> | |
| 24 | 24 | <image class="wh100" src="{{resourceUrl+item.original_img}}" binderror="bind_bnerr" lazy-load="true" |
| 25 | 25 | data-errorimg="order.order_goods[{{index}}].original_img"></image> |
| 26 | 26 | </view> |
| 27 | - | |
| 28 | - <navigator class="order-cont" openType="navigate" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 27 | + <!-- 跳转到商品 --> | |
| 28 | + <navigator class="order-cont" bindtap="go_gd" data-gd="{{item.goods_id}}"> | |
| 29 | 29 | <view class="goods-name">{{item.goods_name}}</view> |
| 30 | 30 | <!--<view class="goods-color">{{item.goods_spec}} {{item.goods_color}}</view>--> |
| 31 | 31 | <view class="goods-color">{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</view> | ... | ... |