Commit f32bb2b539a4767714a8a59090bfa593df745d72
Merge branch 'qa' into 'master'
Qa See merge request !902
Showing
77 changed files
with
5982 additions
and
2331 deletions
app.js
| ... | ... | @@ -275,8 +275,8 @@ App({ |
| 275 | 275 | getwuliu: function (t, o){ |
| 276 | 276 | this.globalData.wuliu=null; |
| 277 | 277 | var th = this, st = this.globalData.setting; |
| 278 | - this.globalData.wuliu && !o ? | |
| 279 | - "function" == typeof t && t(this.globalData.wuliu) : a.get("/api/weshop/storeshipping/list", { | |
| 278 | + //获取物流不缓存 | |
| 279 | + a.get("/api/weshop/storeshipping/list", { | |
| 280 | 280 | data: { store_id: st.stoid, status: 1, pageSize:600 }, |
| 281 | 281 | success: function (o) { |
| 282 | 282 | console.log('getwuliu'); |
| ... | ... | @@ -296,8 +296,8 @@ App({ |
| 296 | 296 | //----------------获取物流价格表-------------------- |
| 297 | 297 | getwuliuprice: function (t, o) { |
| 298 | 298 | var e = this,th=e, st = this.globalData.setting; |
| 299 | - this.globalData.wuliuprice && !o ? | |
| 300 | - "function" == typeof t && t(this.globalData.wuliuprice) : a.get("/api/weshop/shippingarea/list",{ | |
| 299 | + //获取物流不缓存 | |
| 300 | + a.get("/api/weshop/shippingarea/list",{ | |
| 301 | 301 | data: { store_id: st.stoid,pageSize: 600 }, |
| 302 | 302 | success: function (o) { |
| 303 | 303 | console.log('getwuliuprice'); | ... | ... |
app.json
| ... | ... | @@ -168,6 +168,7 @@ |
| 168 | 168 | "pages/goods/goodsList/goodsList", |
| 169 | 169 | "pages/payForAnother/payForAnother", |
| 170 | 170 | "pages/luckyGo/luckyGo_cart/luckyGo_cart", |
| 171 | + "pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct", | |
| 171 | 172 | "pages/luckyGo/luckyGo_list/luckyGo_list", |
| 172 | 173 | "pages/luckyGo/luckyGo_order/luckyGo_order", |
| 173 | 174 | "pages/luckyGo/luckyGo_details/luckyGo_details", | ... | ... |
components/diy_goodsGroup/diy_goodsGroup.wxml
| ... | ... | @@ -15,7 +15,8 @@ |
| 15 | 15 | <view class="zs_goods_wai" wx:if='{{object.column==1}}'> |
| 16 | 16 | <block wx:for="{{goods_array}}" > |
| 17 | 17 | <view class='zs_goods {{g_filter.get_border_type(object.big_order_type)}}'> |
| 18 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.prom_id}}&&prom_type={{item.prom_type}}" class="s1_gk_a1"> | |
| 18 | + <navigator url="{{g_filter.get_url_by_type(item)}}" class="s1_gk_a1"> | |
| 19 | + <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.prom_id}}&&prom_type={{item.prom_type}}" class="s1_gk_a1"> --> | |
| 19 | 20 | <view class='zs_top rel'> |
| 20 | 21 | |
| 21 | 22 | <block wx:if="{{object.big_order_type==3}}"> |
| ... | ... | @@ -169,7 +170,7 @@ |
| 169 | 170 | <!--2个一列--> |
| 170 | 171 | <block wx:if="{{object.column==2}}"> |
| 171 | 172 | <block wx:for="{{goods_array}}" > |
| 172 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.prom_id}}&&prom_type={{item.prom_type}}" class="s1_gk_a1"> | |
| 173 | + <navigator url="{{g_filter.get_url_by_type(item)}}" class="s1_gk_a1"> | |
| 173 | 174 | <view class="zs_goods_wai_ban {{g_filter.get_border_type(object.big_order_type)}}"> |
| 174 | 175 | <view class="zs_goods_ban"> |
| 175 | 176 | <view class='zs_goods_2l'> |
| ... | ... | @@ -208,7 +209,7 @@ |
| 208 | 209 | </view> |
| 209 | 210 | |
| 210 | 211 | <view class='zs_center_2l'> |
| 211 | - <view class='zs_wz1_2l' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> | |
| 212 | + <view class='zs_wz1_2l ellipsis-2' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> | |
| 212 | 213 | <view class='zs_wz2_2l' wx:if="{{object.goodsprice}}"> |
| 213 | 214 | |
| 214 | 215 | <block wx:if="{{item.prom_price || item.prom_integral}}"> |
| ... | ... | @@ -328,7 +329,7 @@ |
| 328 | 329 | <block wx:if='{{object.column==3}}'> |
| 329 | 330 | <view class="zwp_3"> |
| 330 | 331 | <block wx:for="{{goods_array}}" > |
| 331 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.prom_id}}&&prom_type={{item.prom_type}}" class="s1_gk_a1"> | |
| 332 | + <navigator url="{{g_filter.get_url_by_type(item)}}" class="s1_gk_a1"> | |
| 332 | 333 | <view class="zs_goods_wai_san" > |
| 333 | 334 | <view class="zs_goods_san"> |
| 334 | 335 | <view class='zs_goods_3l {{g_filter.get_border_type(object.big_order_type)}}'> |
| ... | ... | @@ -485,7 +486,7 @@ |
| 485 | 486 | <!-- 列表显示 --> |
| 486 | 487 | <view class="zs_goods_xiao_wai" wx:if='{{object.column==4}}'> |
| 487 | 488 | <block wx:for="{{goods_array}}" > |
| 488 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.prom_id}}&&prom_type={{item.prom_type}}" class="s1_gk_a1"> | |
| 489 | + <navigator url="{{g_filter.get_url_by_type(item)}}" class="s1_gk_a1"> | |
| 489 | 490 | <view class="{{object.noboder==0?'zs_goods_xiao_bottom':'zs_goods_xiao'}}" > |
| 490 | 491 | <view class='zs_top_x'> |
| 491 | 492 | <block wx:if="{{object.big_order_type==3}}"> |
| ... | ... | @@ -498,9 +499,15 @@ |
| 498 | 499 | </block> |
| 499 | 500 | |
| 500 | 501 | <block wx:else> |
| 501 | - <image class="zs_t_img_x {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}" | |
| 502 | + <!-- 原来的 --> | |
| 503 | + <!-- <image class="zs_t_img_x {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}" | |
| 504 | + src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | |
| 505 | + binderror="bind_bnerr3" mode="widthFix" style='max-height:290rpx'></image> --> | |
| 506 | + | |
| 507 | + <!-- 2021.11.27修改 --> | |
| 508 | + <image class="block zs_t_img_x {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}" | |
| 502 | 509 | src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" |
| 503 | - binderror="bind_bnerr3" mode="widthFix" style='max-height:290rpx'></image> | |
| 510 | + binderror="bind_bnerr3" mode="widthFix"></image> | |
| 504 | 511 | </block> |
| 505 | 512 | |
| 506 | 513 | <block wx:if="{{object.goodicon==3}}"> |
| ... | ... | @@ -523,7 +530,7 @@ |
| 523 | 530 | </view> |
| 524 | 531 | |
| 525 | 532 | <view class='zs_center_x'> |
| 526 | - <view class='zs_wz1_x' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> | |
| 533 | + <view class='zs_wz1_x ellipsis-2' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> | |
| 527 | 534 | <view class='zs_wz2_x' wx:if="{{object.goodsprice}}"> |
| 528 | 535 | |
| 529 | 536 | <block wx:if="{{item.prom_price || item.prom_integral}}"> |
| ... | ... | @@ -662,7 +669,7 @@ |
| 662 | 669 | <view class="sp"> |
| 663 | 670 | <swiper-item class="s_it" wx:for="{{goods_array}}"> |
| 664 | 671 | <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> |
| 665 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_id={{aitem.prom_id}}&&prom_type={{aitem.prom_type}}" style="width: 32%" > | |
| 672 | + <navigator url="{{g_filter.get_url_by_type(item)}}" style="width: 32%" > | |
| 666 | 673 | <view class="one {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}} " style="margin-left: 10rpx"> |
| 667 | 674 | <view class='sp_top'> |
| 668 | 675 | <view class='s_img' style="position: relative; width: 100%"> | ... | ... |
components/diy_goodsGroup/diy_goodsGroup.wxss
| ... | ... | @@ -123,12 +123,15 @@ |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | .zs_goods_xiao_bottom { |
| 126 | - width: 100%; | |
| 127 | - min-height: 300rpx; | |
| 126 | + /* width: 100%; */ | |
| 127 | + /* min-height: 300rpx; */ | |
| 128 | 128 | display: flex; |
| 129 | 129 | border-bottom: 2rpx #eee solid; |
| 130 | - padding: 10rpx; | |
| 130 | + /* padding: 10rpx; */ | |
| 131 | 131 | background-color: white; |
| 132 | + padding: 20rpx; | |
| 133 | + /* background-color: pink; */ | |
| 134 | + box-sizing: border-box; | |
| 132 | 135 | } |
| 133 | 136 | |
| 134 | 137 | .zs_goods_xiao { |
| ... | ... | @@ -141,17 +144,17 @@ |
| 141 | 144 | } |
| 142 | 145 | |
| 143 | 146 | .zs_top_x { |
| 144 | - width: 400rpx; | |
| 145 | - height: 318rpx; | |
| 146 | - margin-top: 20rpx; | |
| 147 | - display: flex; | |
| 147 | + /* width: 400rpx; | |
| 148 | + height: 318rpx; */ | |
| 149 | + /* margin-top: 20rpx; */ | |
| 150 | + /* display: flex; */ | |
| 148 | 151 | position: relative; |
| 149 | 152 | } |
| 150 | 153 | |
| 151 | 154 | .zs_t_img_x { |
| 152 | 155 | width: 290rpx; |
| 153 | 156 | height: 290rpx; |
| 154 | - margin-left: 20rpx; | |
| 157 | + /* margin-left: 20rpx; */ | |
| 155 | 158 | } |
| 156 | 159 | |
| 157 | 160 | .zs_t_img_x.zj{ border: 1rpx solid #eee;} |
| ... | ... | @@ -159,22 +162,25 @@ |
| 159 | 162 | |
| 160 | 163 | |
| 161 | 164 | .zs_center_x { |
| 162 | - width: 100%; | |
| 163 | - min-height: 200rpx; | |
| 165 | + /* width: 100%; | |
| 166 | + min-height: 200rpx; */ | |
| 164 | 167 | font-size: 28rpx; |
| 165 | 168 | color: #333; |
| 166 | - text-align: left; | |
| 167 | - margin-top: 30rpx; | |
| 168 | - padding: 0 10rpx; | |
| 169 | + padding-left: 20rpx; | |
| 170 | + /* text-align: left; */ | |
| 171 | + /* margin-top: 30rpx; | |
| 172 | + padding: 0 10rpx; */ | |
| 169 | 173 | } |
| 170 | 174 | |
| 171 | 175 | .zs_wz1_x { |
| 172 | - overflow: hidden; | |
| 173 | - text-overflow: ellipsis; | |
| 176 | + /* overflow: hidden; | |
| 177 | + text-overflow: ellipsis; */ | |
| 178 | + height: 90rpx; | |
| 174 | 179 | margin-bottom: 10rpx; |
| 175 | 180 | font-size: 28rpx; |
| 176 | - white-space: nowrap; | |
| 177 | - width: 80%; | |
| 181 | + /* word-break: break-all; */ | |
| 182 | + /* white-space: nowrap; | |
| 183 | + width: 80%; */ | |
| 178 | 184 | } |
| 179 | 185 | |
| 180 | 186 | .zs_wz2_x { |
| ... | ... | @@ -229,11 +235,12 @@ |
| 229 | 235 | } |
| 230 | 236 | |
| 231 | 237 | .zs_t1_x1 { |
| 238 | + position: absolute; | |
| 232 | 239 | width: 56rpx; |
| 233 | 240 | height: 56rpx; |
| 234 | - position: relative; | |
| 235 | - right: 285rpx; | |
| 236 | - top: 6rpx; | |
| 241 | + /* position: relative; */ | |
| 242 | + left: 10rpx; | |
| 243 | + top: 10rpx; | |
| 237 | 244 | } |
| 238 | 245 | |
| 239 | 246 | .zs_t1_x2 { |
| ... | ... | @@ -302,17 +309,18 @@ |
| 302 | 309 | font-size: 28rpx; |
| 303 | 310 | color: #333; |
| 304 | 311 | text-align: left; |
| 305 | - padding: 0 10rpx; | |
| 312 | + /* padding: 0 10rpx; */ | |
| 306 | 313 | } |
| 307 | 314 | |
| 308 | 315 | .zs_wz1_2l { |
| 309 | - overflow: hidden; | |
| 310 | - text-overflow: ellipsis; | |
| 316 | + /* overflow: hidden; | |
| 317 | + text-overflow: ellipsis; */ | |
| 311 | 318 | font-size: 28rpx; |
| 312 | - white-space: nowrap; | |
| 313 | - height: 40rpx; | |
| 314 | - line-height: 40rpx; | |
| 319 | + /* white-space: nowrap; */ | |
| 320 | + height: 90rpx; | |
| 321 | + /* line-height: 40rpx; */ | |
| 315 | 322 | margin-top: 10rpx; |
| 323 | + /* word-break: break-all; */ | |
| 316 | 324 | } |
| 317 | 325 | |
| 318 | 326 | .zs_wz2_2l { |
| ... | ... | @@ -825,4 +833,16 @@ top: 10rpx; |
| 825 | 833 | bottom: 10rpx; |
| 826 | 834 | } |
| 827 | 835 | |
| 828 | -.n_box{ position: absolute !important;z-index: 10} | |
| 829 | 836 | \ No newline at end of file |
| 837 | +.n_box{ position: absolute !important;z-index: 10} | |
| 838 | + | |
| 839 | +.block { | |
| 840 | + display: block; | |
| 841 | +} | |
| 842 | + | |
| 843 | +.ellipsis-2 { | |
| 844 | + overflow: hidden; | |
| 845 | + text-overflow: ellipsis; | |
| 846 | + display: -webkit-box; | |
| 847 | + -webkit-box-orient: vertical; | |
| 848 | + -webkit-line-clamp: 2; | |
| 849 | +} | |
| 830 | 850 | \ No newline at end of file | ... | ... |
components/diy_goodsGroup/g_filter.wxs
| ... | ... | @@ -88,6 +88,16 @@ var g_filters = { |
| 88 | 88 | return min_name; |
| 89 | 89 | }, |
| 90 | 90 | |
| 91 | + | |
| 92 | + get_url_by_type: function(item) { | |
| 93 | + var url = ''; | |
| 94 | + if(item.prom_type == 9) { | |
| 95 | + url = '/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + item.goods_id + '&group_id=' + item.prom_id; | |
| 96 | + } else { | |
| 97 | + url = '/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_id=' + item.prom_id + '&prom_type=' + item.prom_type; | |
| 98 | + }; | |
| 99 | + return url; | |
| 100 | + }, | |
| 91 | 101 | |
| 92 | 102 | } |
| 93 | 103 | |
| ... | ... | @@ -97,4 +107,5 @@ module.exports = { |
| 97 | 107 | is_has_rank:g_filters.is_has_rank, |
| 98 | 108 | get_card_price:g_filters.get_card_price, |
| 99 | 109 | get_border_type:g_filters.get_border_type, |
| 110 | + get_url_by_type: g_filters.get_url_by_type, | |
| 100 | 111 | } | ... | ... |
components/diy_luckyGo/diy_luckyGo.js
0 → 100644
| 1 | +// var e = function(e) { | |
| 2 | +// return e && e.__esModule ? e : { | |
| 3 | +// default: e | |
| 4 | +// }; | |
| 5 | +// }(require("../../utils/LoadMore3.js")), | |
| 6 | +// n = new e.default(), | |
| 7 | +var t = getApp(), | |
| 8 | + a = t.request, | |
| 9 | + o = t.globalData.setting, | |
| 10 | + os = o, | |
| 11 | + i = require("../../utils/util.js"), | |
| 12 | + ut = i, | |
| 13 | + s = require("../../utils/common.js"); | |
| 14 | +var regeneratorRuntime = require('../../utils/runtime.js'); | |
| 15 | +Component({ | |
| 16 | + properties: { | |
| 17 | + // 这里定义了innerText属性,属性值可以在组件使用时指定 | |
| 18 | + object: { | |
| 19 | + type: Object, | |
| 20 | + value: null, | |
| 21 | + }, | |
| 22 | + goods_array: { | |
| 23 | + type: Array, | |
| 24 | + value: [] | |
| 25 | + }, | |
| 26 | + newTime: { | |
| 27 | + type: Number, | |
| 28 | + value: 0 | |
| 29 | + }, | |
| 30 | + }, | |
| 31 | + data: { | |
| 32 | + // 这里是一些组件内部数据 | |
| 33 | + yc: false, | |
| 34 | + someData: null, | |
| 35 | + ylp_img: "https://mshopimg.yolipai.net/", | |
| 36 | + imghost: os.imghost, | |
| 37 | + timer: null, | |
| 38 | + }, | |
| 39 | + | |
| 40 | + pageLifetimes: { | |
| 41 | + //要处理一下,游客登录后的界面的变化,主要还该是改变会员 | |
| 42 | + show: function () { | |
| 43 | + //会员身份变化 | |
| 44 | + var th = this; | |
| 45 | + var g_id = this.data.object; | |
| 46 | + this.init(g_id); | |
| 47 | + setTimeout(function () { | |
| 48 | + if (th.data.goods_array && th.data.goods_array.length > 0) { | |
| 49 | + th.data.timer = setInterval(function () { | |
| 50 | + th.countDown2(th); | |
| 51 | + }, 1000); | |
| 52 | + } | |
| 53 | + },600) | |
| 54 | + } | |
| 55 | + }, | |
| 56 | + | |
| 57 | + ready: function () { | |
| 58 | + var g_id = this.data.object; | |
| 59 | + this.init(g_id); | |
| 60 | + }, | |
| 61 | + detached() { | |
| 62 | + // 页面被被销毁的时候,清除定时器 | |
| 63 | + clearInterval(this.data.timer); | |
| 64 | + }, | |
| 65 | + methods: { | |
| 66 | + // 这里是一个自定义方法 | |
| 67 | + customMethod: function () { }, | |
| 68 | + init: function (g_id) { | |
| 69 | + var th = this, app = getApp(), goodsidlist = ""; | |
| 70 | + if (g_id.data_type == 2) { | |
| 71 | + if (g_id.data && g_id.data.length > 0) { | |
| 72 | + //--先把商品ID串起来-- | |
| 73 | + g_id.data.forEach(function (val, ind) { | |
| 74 | + var item = {}; | |
| 75 | + goodsidlist += val.goodsid + ","; | |
| 76 | + }) | |
| 77 | + goodsidlist = ut.sub_last(goodsidlist); | |
| 78 | + | |
| 79 | + var user_id=getApp().globalData.user_id; | |
| 80 | + if(!user_id){ user_id=0;} | |
| 81 | + | |
| 82 | + //--调用接口,读取秒杀-- | |
| 83 | + app.request.promiseGet("/api/weshop/prom/luckyActivity/getGoodsList?store_id=" | |
| 84 | + + os.stoid + "&goodsidlist=" + goodsidlist + "&type=1&timetype=1&is_end=0", {}).then(res => { | |
| 85 | + console.log(res); | |
| 86 | + //如果秒杀的数组为空的时候 | |
| 87 | + var goodslist = res.data.data; | |
| 88 | + //就算是添加的活动已经过期,就要用最新的进行中活动 | |
| 89 | + if (goodslist && goodslist.length > 0) { | |
| 90 | + th.set_goods_list(g_id.data, goodslist); | |
| 91 | + } | |
| 92 | + }); | |
| 93 | + } | |
| 94 | + } else { | |
| 95 | + th.no_gid_set(); | |
| 96 | + } | |
| 97 | + }, | |
| 98 | + | |
| 99 | + //当是默认的情况 | |
| 100 | + no_gid_set() { | |
| 101 | + var user_id=getApp().globalData.user_id; | |
| 102 | + if(!user_id){ user_id=0;} | |
| 103 | + // var req={ store_id: os.stoid, is_end: 0, is_show: 1, timetype: 2,user_id:user_id}; 原来的 | |
| 104 | + var req={ store_id: os.stoid, is_end: 0, timetype: 1}; | |
| 105 | + getApp().request.promiseGet("/api/weshop/prom/luckyActivity/page", | |
| 106 | + { isShowLoading: 1, data:req } | |
| 107 | + ).then(res => { | |
| 108 | + if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) { | |
| 109 | + var goodsidlist = res.data.data.pageData; | |
| 110 | + this.set_goods_list(null, goodsidlist); | |
| 111 | + // console.log('goodsidlist', goodsidlist); | |
| 112 | + } | |
| 113 | + }); | |
| 114 | + }, | |
| 115 | + | |
| 116 | + //就算是添加的活动已经过期,就要用最新的活动 | |
| 117 | + set_goods_list(g_id, goodslist) { | |
| 118 | + // 判断火热,预热 | |
| 119 | + var newTime = ut.gettimestamp(), all_array = [], th = this; | |
| 120 | + th.setData({ newTime: newTime }); | |
| 121 | + if (g_id) { | |
| 122 | + /*--商品队列按照添加的顺序排列--*/ | |
| 123 | + g_id.forEach(function (val, ind) { | |
| 124 | + goodslist.forEach(function (vy, indy) { | |
| 125 | + if (val.goodsid == vy.goods_id) { | |
| 126 | + if(!vy.id) vy.id=vy.prom_id; | |
| 127 | + all_array.push(vy); | |
| 128 | + } | |
| 129 | + }) | |
| 130 | + }) | |
| 131 | + } else { | |
| 132 | + all_array = goodslist; | |
| 133 | + } | |
| 134 | + | |
| 135 | + | |
| 136 | + if (all_array.length == 0) { | |
| 137 | + all_array = goodslist; | |
| 138 | + } | |
| 139 | + | |
| 140 | + for(let i in all_array){ | |
| 141 | + let item=all_array[i]; | |
| 142 | + if(item.user_price) item.price=item.user_price; | |
| 143 | + } | |
| 144 | + | |
| 145 | + var arr = new Array(); | |
| 146 | + //--三个三个一组--- | |
| 147 | + for (var i = 0; i < all_array.length; i += 3) { | |
| 148 | + arr.push(all_array.slice(i, i + 3)); | |
| 149 | + } | |
| 150 | + /*--熏染到前台--*/ | |
| 151 | + | |
| 152 | + th.setData({ goods_array: arr }); | |
| 153 | + console.log('goods_array', arr); | |
| 154 | + | |
| 155 | + th.data.timer = setInterval(function () { | |
| 156 | + th.countDown2(th); | |
| 157 | + }, 1000); | |
| 158 | + }, | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + //---小于10的格式化函数---- | |
| 163 | + timeFormat: function (param) { | |
| 164 | + return param < 10 ? '0' + param : param; | |
| 165 | + }, | |
| 166 | + //----秒杀倒计时函数----- | |
| 167 | + countDown2: function (ob) { | |
| 168 | + if (ob == undefined) return false; | |
| 169 | + var ee = ob; | |
| 170 | + // 获取当前时间,同时得到活动结束时间数组 | |
| 171 | + var newTime = ut.gettimestamp(); | |
| 172 | + this.setData({ newTime: newTime }); | |
| 173 | + | |
| 174 | + var List = ee.data.goods_array; | |
| 175 | + if (List.length == 0) return false; | |
| 176 | + for (var j = 0; j < List.length; j++) { | |
| 177 | + // 对结束时间进行处理渲染到页面 | |
| 178 | + var endTimeList = List[j]; | |
| 179 | + for (var i = 0; i < endTimeList.length; i++) { | |
| 180 | + var o = endTimeList[i]; | |
| 181 | + var endTime = o.end_time; | |
| 182 | + if (newTime < o.start_time) endTime = o.start_time; | |
| 183 | + let obj = null; | |
| 184 | + // 如果活动未结束,对时间进行处理 | |
| 185 | + if (endTime - newTime > 0) { | |
| 186 | + let time = (endTime - newTime); | |
| 187 | + // 获取天、时、分、秒 | |
| 188 | + let day = parseInt(time / (60 * 60 * 24)); | |
| 189 | + let hou = parseInt(time % (60 * 60 * 24) / 3600); | |
| 190 | + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | |
| 191 | + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | |
| 192 | + obj = { | |
| 193 | + day: this.timeFormat(day), | |
| 194 | + hou: this.timeFormat(hou), | |
| 195 | + min: this.timeFormat(min), | |
| 196 | + sec: this.timeFormat(sec) | |
| 197 | + } | |
| 198 | + } else { | |
| 199 | + //活动已结束,全部设置为'00' | |
| 200 | + obj = { | |
| 201 | + day: '00', | |
| 202 | + hou: '00', | |
| 203 | + min: '00', | |
| 204 | + sec: '00' | |
| 205 | + } | |
| 206 | + } | |
| 207 | + var txt = "goods_array[" + j + "][" + i + "].djs"; | |
| 208 | + ee.setData({ | |
| 209 | + [txt]: obj | |
| 210 | + }); | |
| 211 | + } | |
| 212 | + } | |
| 213 | + }, | |
| 214 | + | |
| 215 | + | |
| 216 | + //图片失败,默认图片 | |
| 217 | + bind_bnerr3: function (e) { | |
| 218 | + var _errImg = e.target.dataset.errorimg; | |
| 219 | + var _errObj = {}; | |
| 220 | + _errObj[_errImg] = "/public/images/default_goods_image_240.gif"; | |
| 221 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 222 | + }, | |
| 223 | + | |
| 224 | + go: function (e) { | |
| 225 | + let url = e.currentTarget.dataset.url; | |
| 226 | + getApp().goto(url); | |
| 227 | + }, | |
| 228 | + | |
| 229 | + alert: function() { | |
| 230 | + wx.showToast({ | |
| 231 | + title: '本活动商品已抢光!', | |
| 232 | + icon: 'none', | |
| 233 | + }) | |
| 234 | + }, | |
| 235 | + }, | |
| 236 | + | |
| 237 | + | |
| 238 | +}) | |
| 0 | 239 | \ No newline at end of file | ... | ... |
components/diy_luckyGo/diy_luckyGo.json
0 → 100644
components/diy_luckyGo/diy_luckyGo.wxml
0 → 100644
| 1 | +<wxs module="filters" src="../../utils/filter.wxs"></wxs> | |
| 2 | +<block wx:if="{{goods_array.length>0}}"> | |
| 3 | + <!-- 幸运购 --> | |
| 4 | + <view class="pdh20 flex jc_sb ai-center bg-white" bindtap="go" data-url="/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList"> | |
| 5 | + <view><text class="iconfont icon-luck"></text>幸运购</view> | |
| 6 | + <view class="arrow-r"> | |
| 7 | + <image src="{{imghost}}/miniapp/images/icon-arrowdown.png" lazy-load="true" class="img-block"></image> | |
| 8 | + </view> | |
| 9 | + </view> | |
| 10 | + | |
| 11 | + <!-- 单行滑动显示 --> | |
| 12 | + <block wx:if="{{object.style==1}}"> | |
| 13 | + <!--商品展示--> | |
| 14 | + <swiper indicator-active-color="#ED6064" indicator-dots="false" wx:if="{{object.style==1}}"> | |
| 15 | + <view wx:if="{{object.style==1}}"> | |
| 16 | + <swiper-item class="s_it" wx:for="{{goods_array}}"> | |
| 17 | + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
| 18 | + <navigator url="{{aitem.actLen == 0 ? '':('/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + aitem.goods_id + '&prom_type=9&group_id=' + aitem.id)}}" | |
| 19 | + class="pd20 nav" hover-class="none" bindtap="{{aitem.actLen == 0 ? 'alert':''}}"> | |
| 20 | + <view class=""> | |
| 21 | + <view class="img-container row {{aitem.actLen == 0 ? 'active':''}}" data-content="{{aitem.group_num}}人团"> | |
| 22 | + <image class="img-block" src="{{imghost + aitem.original_img}}" data-val="{{aitem.original_img}}" | |
| 23 | + data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" lazy-load="true" | |
| 24 | + lazy-load="true"></image> | |
| 25 | + </view> | |
| 26 | + <view class="flex fdc jc_sb f1 pdt20"> | |
| 27 | + | |
| 28 | + <view class="ellipsis-2 name fs28 clearbadge">{{aitem.title}}</view> | |
| 29 | + <view> | |
| 30 | + <view class="flex ai-center"> | |
| 31 | + <text class="rmb c-red">{{filters.price(aitem.group_price)}}</text> | |
| 32 | + <view class="del fs22 c-a pdl10"><text class="rmb">{{aitem.market_price}}</text></view> | |
| 33 | + </view> | |
| 34 | + </view> | |
| 35 | + | |
| 36 | + </view> | |
| 37 | + </view> | |
| 38 | + | |
| 39 | + </navigator> | |
| 40 | + </block> | |
| 41 | + </swiper-item> | |
| 42 | + </view> | |
| 43 | + </swiper> | |
| 44 | + </block> | |
| 45 | + | |
| 46 | + <!-- 单列显示 --> | |
| 47 | + <block class="sp2" wx:if="{{object.style==2}}"> | |
| 48 | + <view class="list"> | |
| 49 | + <block wx:for="{{goods_array}}"> | |
| 50 | + <!-- goods_array的数据是这样子的: [Array(3), Array(3), Array(3), Array(1)] --> | |
| 51 | + <!-- 3个成一组,这里我们默认让它显示goods_array[0],控制显示数量在3个以内 --> | |
| 52 | + <block wx:if="{{index == 0}}"> | |
| 53 | + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
| 54 | + <view class="list-item" data-url="/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id={{aitem.goods_id}}&prom_type=9&group_id={{aitem.id}}" bindtap="{{aitem.actLen == 0 ? '':'go'}}"> | |
| 55 | + <view class="flex ai-center"> | |
| 56 | + <view class="img-container"> | |
| 57 | + <image class="img-block" src="{{imghost + aitem.original_img}}" data-val="{{aitem.original_img}}" | |
| 58 | + data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" lazy-load="true"></image> | |
| 59 | + </view> | |
| 60 | + <view class="pdl20 flex fdc jc_sb f1"> | |
| 61 | + | |
| 62 | + <view class="ellipsis-2 name fs28" data-content="{{aitem.group_num}}人团">{{aitem.title}}</view> | |
| 63 | + <view> | |
| 64 | + <view class="flex ai-center"> | |
| 65 | + <text class="rmb c-red">{{filters.price(aitem.group_price)}}</text> | |
| 66 | + <view class="del fs22 c-a pdl10">零售价:<text class="rmb">{{aitem.market_price}}</text></view> | |
| 67 | + </view> | |
| 68 | + <view class="flex jc_sb"> | |
| 69 | + <progress class="pdr20 f1 progress" percent="{{filters.percent(aitem.num, aitem.group_num)}}" activeColor="#FF6768" | |
| 70 | + backgroundColor="#d0d0d0" border-radius="12" stroke-width="12" data-content="{{aitem.num}}人已参团"></progress> | |
| 71 | + <view class="btn fs26 {{aitem.actLen == 0 ? 'gray':''}}" wx:if="{{aitem.actLen == 0}}">已抢光</view> | |
| 72 | + <view class="btn fs26" wx:else>去参团</view> | |
| 73 | + </view> | |
| 74 | + </view> | |
| 75 | + </view> | |
| 76 | + </view> | |
| 77 | + <view class="fs24 pdt10 c-7b">*<text class="c-red">{{aitem.group_num}}</text>人成团,<text class="c-red">{{aitem.group_win}}</text>人得商品,<text | |
| 78 | + class="c-red">{{aitem.group_num - aitem.group_win}}</text>人全额退款并得<text class="c-red">惊喜礼品</text>!</view> | |
| 79 | + </view> | |
| 80 | + </block> | |
| 81 | + </block> | |
| 82 | + </block> | |
| 83 | + </view> | |
| 84 | + </block> | |
| 85 | +</block> | ... | ... |
components/diy_luckyGo/diy_luckyGo.wxss
0 → 100644
| 1 | +@import '../../app.wxss'; | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | +.s_it { | |
| 6 | + width: 100%; | |
| 7 | + display: flex; | |
| 8 | + background-color: white; | |
| 9 | +} | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | +swiper { | |
| 17 | + height: 450rpx; | |
| 18 | +} | |
| 19 | + | |
| 20 | +.nav { | |
| 21 | + width: calc(100% / 3); | |
| 22 | + box-sizing: border-box; | |
| 23 | +} | |
| 24 | + | |
| 25 | +.arrow-r { | |
| 26 | + width: 30rpx; | |
| 27 | + height: 30rpx; | |
| 28 | +} | |
| 29 | + | |
| 30 | +.icon-luck { | |
| 31 | + color: #ED6064; | |
| 32 | + margin-right: 4rpx; | |
| 33 | +} | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | +.list-item { | |
| 39 | + background-color: white; | |
| 40 | + padding: 20rpx; | |
| 41 | +} | |
| 42 | + | |
| 43 | +.img-container { | |
| 44 | + width: 220rpx; | |
| 45 | + height: 220rpx; | |
| 46 | + border-radius: 14rpx; | |
| 47 | + overflow: hidden; | |
| 48 | + flex-shrink: 0; | |
| 49 | + position: relative; | |
| 50 | +} | |
| 51 | + | |
| 52 | +.img-container::before { | |
| 53 | + content: '幸运购'; | |
| 54 | + position: absolute; | |
| 55 | + left: 0; | |
| 56 | + top: 0; | |
| 57 | + padding: 4rpx; | |
| 58 | + background-color: rgba(255,103,103,.7); | |
| 59 | + color: white; | |
| 60 | + font-size: 22rpx; | |
| 61 | + border-radius: 0 0 14rpx 0; | |
| 62 | +} | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | +.img-container.row::before { | |
| 67 | + content: attr(data-content); | |
| 68 | + position: absolute; | |
| 69 | + left: 0; | |
| 70 | + top: 0; | |
| 71 | + padding: 4rpx; | |
| 72 | + background-color: rgba(255,103,103,.7); | |
| 73 | + color: white; | |
| 74 | + font-size: 22rpx; | |
| 75 | + border-radius: 0 0 14rpx 0; | |
| 76 | +} | |
| 77 | + | |
| 78 | +.name::before { | |
| 79 | + content: attr(data-content); | |
| 80 | + background-color: #FF6768; | |
| 81 | + color: white; | |
| 82 | + font-size: 24rpx; | |
| 83 | + padding-left: 10rpx; | |
| 84 | + padding-right: 10rpx; | |
| 85 | + border-radius: 20rpx; | |
| 86 | + margin-right: 10rpx; | |
| 87 | +} | |
| 88 | + | |
| 89 | +.name.clearbadge::before { | |
| 90 | + content: none; | |
| 91 | +} | |
| 92 | + | |
| 93 | +.rmb::before { | |
| 94 | + content: '¥'; | |
| 95 | + font-size: 24rpx; | |
| 96 | +} | |
| 97 | + | |
| 98 | +.del { | |
| 99 | + text-decoration: line-through; | |
| 100 | +} | |
| 101 | + | |
| 102 | +.btn { | |
| 103 | + background-color: #FF6768; | |
| 104 | + border-radius: 20rpx; | |
| 105 | + padding-left:20rpx; | |
| 106 | + padding-right: 20rpx; | |
| 107 | + color: white; | |
| 108 | +} | |
| 109 | + | |
| 110 | +.name { | |
| 111 | + height: 88rpx; | |
| 112 | +} | |
| 113 | + | |
| 114 | +.no-more { | |
| 115 | + font-size: 24rpx; | |
| 116 | + line-height: 2; | |
| 117 | + text-align: center; | |
| 118 | + padding-top: 20rpx; | |
| 119 | + padding-bottom: 20rpx; | |
| 120 | + color: #ccc; | |
| 121 | +} | |
| 122 | + | |
| 123 | +.progress { | |
| 124 | + position: relative; | |
| 125 | +} | |
| 126 | +.progress::before { | |
| 127 | + position: absolute; | |
| 128 | + width: 100%; | |
| 129 | + content: attr(data-content); | |
| 130 | + font-size: 20rpx; | |
| 131 | + color: white; | |
| 132 | + text-align: center; | |
| 133 | +} | |
| 134 | + | |
| 135 | +.btn.gray { | |
| 136 | + background-color: #ccc; | |
| 137 | +} | |
| 138 | + | |
| 139 | +.img-container.active::after { | |
| 140 | + content: '已抢光'; | |
| 141 | + position: absolute; | |
| 142 | + font-size: 24rpx; | |
| 143 | + color: white; | |
| 144 | + bottom: 0; | |
| 145 | + left: 0; | |
| 146 | + width: 100%; | |
| 147 | + text-align: center; | |
| 148 | + background-color: rgba(0,0,0,.4); | |
| 149 | +} | |
| 0 | 150 | \ No newline at end of file | ... | ... |
components/diy_seckill/diy_seckill.js
| ... | ... | @@ -81,7 +81,7 @@ Component({ |
| 81 | 81 | |
| 82 | 82 | //--调用接口,读取秒杀-- |
| 83 | 83 | app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" |
| 84 | - + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id="+user_id, {}).then(res => { | |
| 84 | + + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id="+user_id+"&type=1", {}).then(res => { | |
| 85 | 85 | console.log(res); |
| 86 | 86 | //如果秒杀的数组为空的时候 |
| 87 | 87 | var goodslist = res.data.data; |
| ... | ... | @@ -113,6 +113,11 @@ Component({ |
| 113 | 113 | |
| 114 | 114 | //就算是添加的活动已经过期,就要用最新的活动 |
| 115 | 115 | set_goods_list(g_id, goodslist) { |
| 116 | + | |
| 117 | + goodslist.forEach(function (vy, indy) { | |
| 118 | + if(!vy.id) vy.id=vy.prom_id; | |
| 119 | + }) | |
| 120 | + | |
| 116 | 121 | // 判断火热,预热 |
| 117 | 122 | var newTime = ut.gettimestamp(), all_array = [], th = this; |
| 118 | 123 | th.setData({ newTime: newTime }); |
| ... | ... | @@ -121,16 +126,14 @@ Component({ |
| 121 | 126 | g_id.forEach(function (val, ind) { |
| 122 | 127 | goodslist.forEach(function (vy, indy) { |
| 123 | 128 | if (val.goodsid == vy.goods_id) { |
| 124 | - if(!vy.id) vy.id=vy.prom_id; | |
| 125 | 129 | all_array.push(vy); |
| 126 | 130 | } |
| 127 | 131 | }) |
| 128 | 132 | }) |
| 129 | 133 | } else { |
| 130 | - all_array = goodslist; | |
| 134 | + all_array = goodslist; | |
| 131 | 135 | } |
| 132 | 136 | |
| 133 | - | |
| 134 | 137 | if (all_array.length == 0) { |
| 135 | 138 | all_array = goodslist; |
| 136 | 139 | } | ... | ... |
components/diy_seckill/diy_seckill.wxml
| ... | ... | @@ -62,7 +62,7 @@ |
| 62 | 62 | </view> |
| 63 | 63 | |
| 64 | 64 | <view class='sp_wz'> |
| 65 | - <view class='sp_wzi'>{{aitem.goods_name}}</view> | |
| 65 | + <view class='sp_wzi ellipsis-2'>{{aitem.goods_name}}</view> | |
| 66 | 66 | <view class='sp_jg'>¥{{aitem.price}}</view> |
| 67 | 67 | <view class='sp_jgx'>¥{{aitem.market_price}}</view> |
| 68 | 68 | </view> |
| ... | ... | @@ -85,7 +85,7 @@ |
| 85 | 85 | </view> |
| 86 | 86 | |
| 87 | 87 | <view class="o1_right"> |
| 88 | - <view class="sp_wzi">{{aitem.title}}</view> | |
| 88 | + <view class="sp_wzi ellipsis-2">{{aitem.title}}</view> | |
| 89 | 89 | <view class="o1_sj_kill"> |
| 90 | 90 | <text>{{aitem.djs.day}}</text> 天 |
| 91 | 91 | <text>{{aitem.djs.hou}}</text> : | ... | ... |
components/diy_seckill/diy_seckill.wxss
| ... | ... | @@ -112,13 +112,14 @@ swiper { |
| 112 | 112 | font-size: 30rpx; |
| 113 | 113 | border-bottom: 2rpx solid #dcdcdc; |
| 114 | 114 | width: 100%; |
| 115 | - text-align: left; | |
| 115 | + /* text-align: left; */ | |
| 116 | 116 | padding: 4rpx 0; |
| 117 | - overflow: hidden; | |
| 118 | - height: 48rpx; | |
| 119 | - text-overflow: ellipsis; | |
| 117 | + /* overflow: hidden; */ | |
| 118 | + height: 90rpx; | |
| 119 | + word-break: break-all; | |
| 120 | + /* text-overflow: ellipsis; | |
| 120 | 121 | white-space: nowrap; |
| 121 | - line-height: 48rpx; | |
| 122 | + line-height: 48rpx; */ | |
| 122 | 123 | } |
| 123 | 124 | |
| 124 | 125 | .sp_wz .sp_jg { |
| ... | ... | @@ -222,12 +223,12 @@ swiper { |
| 222 | 223 | .o1_right .sp_wzi { |
| 223 | 224 | font-size: 30rpx; |
| 224 | 225 | margin-bottom: 6rpx; |
| 225 | - text-align: left; | |
| 226 | + /* text-align: left; */ | |
| 226 | 227 | padding: 4rpx 0; |
| 227 | - height: 48rpx; | |
| 228 | - overflow: hidden; | |
| 228 | + height: 90rpx; | |
| 229 | + /* overflow: hidden; | |
| 229 | 230 | white-space: nowrap; |
| 230 | - text-overflow: ellipsis; | |
| 231 | + text-overflow: ellipsis; */ | |
| 231 | 232 | } |
| 232 | 233 | |
| 233 | 234 | .o1_right .o1_sj_kill { |
| ... | ... | @@ -287,4 +288,13 @@ swiper { |
| 287 | 288 | align-items: center; |
| 288 | 289 | } |
| 289 | 290 | |
| 290 | -.sp .sp_top .s_top_kill.gray{background-color:#bdbdc1;color: #fff;font-weight: normal} | |
| 291 | 291 | \ No newline at end of file |
| 292 | +.sp .sp_top .s_top_kill.gray{background-color:#bdbdc1;color: #fff;font-weight: normal} | |
| 293 | + | |
| 294 | + | |
| 295 | +.ellipsis-2 { | |
| 296 | + overflow: hidden; | |
| 297 | + text-overflow: ellipsis; | |
| 298 | + display: -webkit-box; | |
| 299 | + -webkit-box-orient: vertical; | |
| 300 | + -webkit-line-clamp: 2; | |
| 301 | +} | |
| 292 | 302 | \ No newline at end of file | ... | ... |
components/goods_list/goods_list.wxml
| ... | ... | @@ -4,15 +4,16 @@ |
| 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}}&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"> | |
| 7 | + <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="{{item.prom_type == 9 ? ('/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + item.goods_id + '&group_id=' + item.prom_id):('/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 | + <navigator url="{{item.prom_type == 9 ? ('/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + item.goods_id + '&group_id=' + item.prom_id):('/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 | 10 | <!-- 商品图⽚ --> |
| 10 | 11 | <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 | 12 | <view class="bottom"> |
| 12 | 13 | <!-- 商品名称 --> |
| 13 | 14 | <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view> |
| 14 | 15 | <!-- 判断是否有活动价 --> |
| 15 | - <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0}}"> | |
| 16 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7}}"> | |
| 16 | 17 | <view class="pdt10"> |
| 17 | 18 | <view class="money flex xc-wc" > |
| 18 | 19 | <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text> | ... | ... |
components/qr_code/qr_code.js
packageA/pages/goodsInfo/goodsInfo.js
packageA/pages/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -4,468 +4,502 @@ |
| 4 | 4 | <wxs module="tool" src="filter.wxs"></wxs> |
| 5 | 5 | |
| 6 | 6 | <!-- 商品内容区域,普通商品,秒杀,拼团 --> |
| 7 | -<!-- <block wx:if="{{isshow}}"> --> | |
| 8 | -<block> | |
| 9 | - <view class="container"> | |
| 10 | - <!-- <view class="type-navbar"> | |
| 11 | - <view class="type-box" wx:for="{{categories}}" wx:key="categories"> | |
| 12 | - <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}"> | |
| 13 | - {{item.name}} | |
| 14 | - </view> | |
| 15 | - </view> | |
| 16 | - </view> --> | |
| 17 | - <view class="goods-detail"> | |
| 18 | - <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}"> | |
| 19 | - <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove"> | |
| 20 | - <view class="xc-videos-picture rel"> | |
| 21 | - <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange"> | |
| 22 | - <swiper-item> | |
| 23 | - <image class="wh100" src="{{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}}" binderror="bind_bnerr" | |
| 24 | - mode="aspectFit" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image> | |
| 25 | - </swiper-item> | |
| 26 | - </swiper> | |
| 27 | - </view> | |
| 28 | - </view> | |
| 29 | - | |
| 30 | - <block> | |
| 31 | - | |
| 32 | - <view class="goods-price rel"> | |
| 33 | - <view class="co-red" style="overflow: hidden"> | |
| 34 | - <view class="market-price" style="overflow: hidden"></view> | |
| 35 | - </view> | |
| 36 | - | |
| 37 | - <view> | |
| 38 | - <view class="co-red"><text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}}</view> | |
| 39 | - <view class="goods-title"> <view class="goods-name elli">{{data.goods_name}}</view></view> | |
| 40 | - </view> | |
| 41 | - | |
| 42 | - <view class="goods-num"> | |
| 43 | - <view class="sales">销量:{{data.sales_sum}}</view> | |
| 44 | - <view class="sales">有效天数:{{data.validDays?data.validDays:'不限'}}</view> | |
| 7 | +<block> | |
| 8 | + <view class="container"> | |
| 9 | + <view class="type-navbar"> | |
| 10 | + <view class="type-box" wx:for="{{categories}}" wx:key="categories"> | |
| 11 | + <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}"> | |
| 12 | + {{item.name}} | |
| 13 | + </view> | |
| 45 | 14 | </view> |
| 46 | - | |
| 47 | - </view> | |
| 48 | - </block> | |
| 49 | - | |
| 50 | - <!-- 门店收货地址 --> | |
| 51 | - <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" > | |
| 52 | - <view class="address_frame" bindtap="choice_store" data-ind="0"> | |
| 53 | - <view class="flex-vertical-between "> | |
| 54 | - <view class="flex-vertical select_store_height"> | |
| 55 | - <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | |
| 56 | - <view class="fs30" style="color:black;">选择门店</view> | |
| 57 | - </view> | |
| 58 | - <view class="red_bb fs26">更多门店<text class="bg_jj"></text></view> | |
| 59 | - </view> | |
| 60 | - | |
| 61 | - <view wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
| 62 | - <view class="flex-space-between address ai_end "> | |
| 63 | - <view> | |
| 64 | - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | |
| 65 | - </view> | |
| 66 | - <view class="distance fs24"wx:if="{{def_pick_store.distance!=null}}"> | |
| 67 | - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | |
| 68 | - | |
| 69 | - </view> | |
| 70 | - </view> | |
| 71 | - | |
| 72 | - <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(未找到门店)</view> | |
| 73 | - <block wx:else> | |
| 74 | - <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(未找到门店)</view> | |
| 75 | - <block wx:else> | |
| 76 | - <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view> | |
| 77 | - </block> | |
| 78 | - </block> | |
| 79 | - | |
| 80 | - <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view> | |
| 81 | - </view> | |
| 82 | - </view> | |
| 83 | - | |
| 84 | - </view> | |
| 85 | - | |
| 86 | - <view class="bz_view flex bdt16" wx:if="{{store_config}}"> | |
| 87 | - <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> | |
| 88 | - <view class="flex f1 ai_c rel"> | |
| 89 | - <view class="bz-content {{flag ? '':'ellipsis-1'}} f1">{{store_config.service_bz}}</view> | |
| 90 | - <view bindtap="clickCollapse" class="cx-obtain-coupon wsize arrow"> | |
| 91 | - <text class="bg_jj {{flag?'down1':''}}"></text> | |
| 15 | + </view> | |
| 16 | + <view class="goods-detail"> | |
| 17 | + <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}"> | |
| 18 | + <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove"> | |
| 19 | + <view class="xc-videos-picture rel"> | |
| 20 | + <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" | |
| 21 | + indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange"> | |
| 22 | + <swiper-item> | |
| 23 | + <image class="wh100" src="{{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}}" | |
| 24 | + binderror="bind_bnerr" mode="aspectFit" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image> | |
| 25 | + </swiper-item> | |
| 26 | + </swiper> | |
| 27 | + </view> | |
| 28 | + </view> | |
| 29 | + | |
| 30 | + <block> | |
| 31 | + | |
| 32 | + <view class="goods-price rel"> | |
| 33 | + <view class="co-red" style="overflow: hidden"> | |
| 34 | + <view class="market-price" style="overflow: hidden"></view> | |
| 35 | + </view> | |
| 36 | + | |
| 37 | + <view> | |
| 38 | + <view class="co-red"><text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}}</view> | |
| 39 | + <view class="goods-title"> | |
| 40 | + <view class="goods-name elli">{{data.goods_name}}</view> | |
| 41 | + </view> | |
| 42 | + </view> | |
| 43 | + | |
| 44 | + <view class="goods-num"> | |
| 45 | + <view class="sales">销量:{{data.sales_sum}}</view> | |
| 46 | + <view class="sales">有效天数:{{data.validDays?data.validDays:'不限'}}</view> | |
| 47 | + </view> | |
| 48 | + | |
| 49 | + </view> | |
| 50 | + </block> | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + <!-- 门店收货地址 --> | |
| 55 | + <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}"> | |
| 56 | + <view class="address_frame" bindtap="choice_store" data-ind="0"> | |
| 57 | + <view class="flex-vertical-between "> | |
| 58 | + <view class="flex-vertical select_store_height"> | |
| 59 | + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | |
| 60 | + <view class="fs30" style="color:black;">选择门店</view> | |
| 61 | + </view> | |
| 62 | + <view class="red_bb fs26">更多门店<text class="bg_jj"></text></view> | |
| 63 | + </view> | |
| 64 | + | |
| 65 | + <view wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
| 66 | + <view class="flex-space-between address ai_end "> | |
| 67 | + <view> | |
| 68 | + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | |
| 69 | + </view> | |
| 70 | + <view class="distance fs24" wx:if="{{def_pick_store.distance!=null}}"> | |
| 71 | + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | |
| 72 | + | |
| 92 | 73 | </view> |
| 93 | - <!-- <text class="bg_jj" bindtap="clickCollapse"></text> --> | |
| 94 | - <!-- <text class="iconfont icon-shuangjiantouxia c-db"></text> --> | |
| 95 | 74 | </view> |
| 75 | + | |
| 76 | + <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(未找到门店)</view> | |
| 77 | + <block wx:else> | |
| 78 | + <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(未找到门店)</view> | |
| 79 | + <block wx:else> | |
| 80 | + <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view> | |
| 81 | + </block> | |
| 82 | + </block> | |
| 83 | + | |
| 84 | + <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view> | |
| 96 | 85 | </view> |
| 97 | - | |
| 98 | - | |
| 99 | - | |
| 100 | - | |
| 101 | - | |
| 102 | - | |
| 103 | - | |
| 104 | - <!-- 图文详情 --> | |
| 105 | - <view class="pd20"> | |
| 106 | - <!-- <view class="tuwen_title"> | |
| 107 | - <view class="g_line"></view> | |
| 108 | - <view class="center_s"> | |
| 109 | - <image src="{{iurl}}/miniapp/images/tuwen_c.png"></image><text>详情</text> | |
| 110 | - </view> | |
| 111 | - </view> --> | |
| 112 | - | |
| 113 | - <view wx:if="{{service_list}}"> | |
| 114 | - <view class="goods-num pdv20 t-c" style="font-size: 26rpx; background-color: #f6f5f4;"> | |
| 115 | - <view class="stock">项目名称</view> | |
| 116 | - <view class="stock">耗时(分)</view> | |
| 117 | - <!-- <view class="stock">手工费</view> --> | |
| 118 | - <view class="stock">次数</view> | |
| 119 | - </view> | |
| 120 | - <block wx:for="{{service_list}}"> | |
| 121 | - <view class="goods-num pdv20 t-c" style="margin-bottom: 10rpx;font-size: 22rpx;"> | |
| 122 | - <view class="stock">{{item.projectName}}</view> | |
| 123 | - <view class="stock">{{item.timeConsuming}}</view> | |
| 124 | - <!-- <view class="stock">{{item.money}}</view> --> | |
| 125 | - <view class="stock">{{item.frequency}}</view> | |
| 126 | - </view> | |
| 127 | - </block> | |
| 128 | - </view> | |
| 129 | - | |
| 130 | - <view class="wxParse"> | |
| 131 | - <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> | |
| 132 | - </view> | |
| 133 | - | |
| 134 | - </view> | |
| 86 | + </view> | |
| 87 | + | |
| 88 | + </view> | |
| 89 | + | |
| 90 | + <view class="bz_view flex bdt16" wx:if="{{store_config}}"> | |
| 91 | + <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> | |
| 92 | + <view class="flex f1 ai_c rel"> | |
| 93 | + <view class="bz-content {{flag ? '':'ellipsis-1'}} f1">{{store_config.service_bz}}</view> | |
| 94 | + <view bindtap="clickCollapse" class="cx-obtain-coupon wsize arrow"> | |
| 95 | + <text class="bg_jj {{flag?'down1':''}}"></text> | |
| 96 | + </view> | |
| 97 | + <!-- <text class="bg_jj" bindtap="clickCollapse"></text> --> | |
| 98 | + <!-- <text class="iconfont icon-shuangjiantouxia c-db"></text> --> | |
| 99 | + </view> | |
| 100 | + </view> | |
| 101 | + | |
| 102 | + | |
| 135 | 103 | |
| 136 | - <!-- 推荐商品 --> | |
| 137 | - <!-- <view class="flex-center rel xc-linellae-frame"> | |
| 138 | - <view class="xc-linellae"></view> | |
| 139 | - <view class="abs flex-center xc-recommend-frame "> | |
| 140 | - <image class=" xc-recommend" src="{{iurl}}/miniapp/images/diamond.png"> | |
| 141 | - </image> | |
| 142 | - <view class="xc-recommend-word">推荐</view> | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + <!-- 图文详情 --> | |
| 109 | + <view class="t_g_info bdt16"> | |
| 110 | + <view class="red_shu"></view> | |
| 111 | + <view class="fs30 bold">商品详情</view> | |
| 112 | + </view> | |
| 113 | + <view class="pd20"> | |
| 114 | + <view class="table_s" wx:if="{{service_list}}"> | |
| 115 | + <view class="tb_item tb-l"> | |
| 116 | + <view class="item_left f1"> | |
| 117 | + <text>项目名称</text> | |
| 118 | + </view> | |
| 119 | + <view class="item_left f1"> | |
| 120 | + <text>耗时(分)</text> | |
| 121 | + </view> | |
| 122 | + <view class="item_left f1"> | |
| 123 | + <text>次数</text> | |
| 124 | + </view> | |
| 143 | 125 | </view> |
| 144 | - </view> | |
| 145 | - <goods_recommend id="goods_list"></goods_recommend> --> | |
| 126 | + <view class="tb_item tb-l" wx:for="{{service_list}}"> | |
| 127 | + <view class="item_right f1"> | |
| 128 | + <text>{{item.projectName}}</text> | |
| 129 | + </view> | |
| 130 | + <view class="item_right f1"> | |
| 131 | + <text>{{item.timeConsuming}}</text> | |
| 132 | + </view> | |
| 133 | + <view class="item_right f1"> | |
| 134 | + <text>{{item.frequency}}</text> | |
| 135 | + </view> | |
| 136 | + </view> | |
| 137 | + </view> | |
| 146 | 138 | |
| 147 | - </view> | |
| 139 | + <view class="wxParse"> | |
| 140 | + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> | |
| 141 | + </view> | |
| 148 | 142 | |
| 149 | - </view> | |
| 150 | - </view> | |
| 151 | - <!---滚动到顶部----> | |
| 152 | - <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}"> | |
| 153 | - <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image> | |
| 154 | - </view> | |
| 155 | - | |
| 156 | - <!-- 底部按钮 --> | |
| 157 | - <view class="join-cart jc_sb"> | |
| 158 | - | |
| 159 | - <view class="flex"> | |
| 160 | - <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split f1" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}" style="text-align: center"> | |
| 161 | - <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
| 162 | - <view>客服</view> | |
| 163 | - </button> | |
| 164 | - | |
| 165 | - <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split f1" bindtap="con_weixin" style="text-align: center"> | |
| 166 | - <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
| 167 | - <view>客服</view> | |
| 168 | - </view> | |
| 169 | - | |
| 170 | - <view wx:else class="custom-service cart-ico new_split f1" bindtap="contactService" style="text-align: center"> | |
| 171 | - <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
| 172 | - <view>客服</view> | |
| 173 | 143 | </view> |
| 174 | - | |
| 175 | - <view class="shopping-cart cart-ico new_split f1"> | |
| 176 | - <navigator open-type="switchTab" url="/pages/cart/cart/cart" style="text-align: center"> | |
| 177 | - <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> | |
| 178 | - <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view> | |
| 179 | - <view>购物车</view> | |
| 180 | - </navigator> | |
| 181 | - </view> | |
| 182 | 144 | </view> |
| 183 | - | |
| 184 | - | |
| 185 | - <view class="flex f1 pdh20"> | |
| 186 | 145 | |
| 187 | - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view> | |
| 188 | - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即购买</view> | |
| 189 | - </view> | |
| 190 | - | |
| 191 | - </view> | |
| 192 | - | |
| 193 | - <!-- 制作一个圆球导航 --> | |
| 194 | - <nav_box></nav_box> | |
| 146 | + <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}"> | |
| 147 | + <view class="pd20"> | |
| 148 | + <view class="table_s" wx:if="{{service_list}}"> | |
| 149 | + <view class="tb_item tb-l"> | |
| 150 | + <view class="item_left f1"> | |
| 151 | + <text>项目名称</text> | |
| 152 | + </view> | |
| 153 | + <view class="item_left f1"> | |
| 154 | + <text>耗时(分)</text> | |
| 155 | + </view> | |
| 156 | + <view class="item_left f1"> | |
| 157 | + <text>次数</text> | |
| 158 | + </view> | |
| 159 | + </view> | |
| 160 | + <view class="tb_item tb-l" wx:for="{{service_list}}"> | |
| 161 | + <view class="item_right f1"> | |
| 162 | + <text>{{item.projectName}}</text> | |
| 163 | + </view> | |
| 164 | + <view class="item_right f1"> | |
| 165 | + <text>{{item.timeConsuming}}</text> | |
| 166 | + </view> | |
| 167 | + <view class="item_right f1"> | |
| 168 | + <text>{{item.frequency}}</text> | |
| 169 | + </view> | |
| 170 | + </view> | |
| 171 | + </view> | |
| 172 | + | |
| 173 | + <view class="wxParse"> | |
| 174 | + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> | |
| 175 | + </view> | |
| 176 | + | |
| 177 | + </view> | |
| 178 | + </view> | |
| 179 | + | |
| 180 | + </view> | |
| 181 | + </view> | |
| 182 | + <!---滚动到顶部----> | |
| 183 | + <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}"> | |
| 184 | + <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image> | |
| 185 | + </view> | |
| 186 | + | |
| 187 | + <!-- 底部按钮 --> | |
| 188 | + <view class="join-cart jc_sb"> | |
| 189 | + | |
| 190 | + <view class="flex"> | |
| 191 | + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split f1" open-type="contact" | |
| 192 | + session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}" style="text-align: center"> | |
| 193 | + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
| 194 | + <view>客服</view> | |
| 195 | + </button> | |
| 196 | + | |
| 197 | + <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split f1" bindtap="con_weixin" | |
| 198 | + style="text-align: center"> | |
| 199 | + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
| 200 | + <view>客服</view> | |
| 201 | + </view> | |
| 202 | + | |
| 203 | + <view wx:else class="custom-service cart-ico new_split f1" bindtap="contactService" style="text-align: center"> | |
| 204 | + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
| 205 | + <view>客服</view> | |
| 206 | + </view> | |
| 207 | + | |
| 208 | + <view class="shopping-cart cart-ico new_split f1"> | |
| 209 | + <navigator open-type="switchTab" url="/pages/cart/cart/cart" style="text-align: center"> | |
| 210 | + <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> | |
| 211 | + <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view> | |
| 212 | + <view>购物车</view> | |
| 213 | + </navigator> | |
| 214 | + </view> | |
| 215 | + </view> | |
| 216 | + | |
| 217 | + | |
| 218 | + <view class="flex f1 pdh20"> | |
| 219 | + | |
| 220 | + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view> | |
| 221 | + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即购买</view> | |
| 222 | + </view> | |
| 223 | + | |
| 224 | + </view> | |
| 225 | + | |
| 226 | + <!-- 制作一个圆球导航 --> | |
| 227 | + <nav_box></nav_box> | |
| 195 | 228 | </block> |
| 196 | 229 | |
| 197 | 230 | <!-- 弹起来,选择规格数量,普通商品购买和秒杀 --> |
| 198 | 231 | <view hidden="{{!openSpecModal}}"> |
| 199 | - <view bindtap="closeSpecModal" class="cover-layer"></view> | |
| 200 | - <view class="spec-model"> | |
| 201 | - <view class="pding"> | |
| 202 | - <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon> | |
| 203 | - <view class="spec-goods"> | |
| 204 | - <image class="wh100 spec-img" src="{{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}}" binderror="pop_err_img" data-errorimg="data.image_url"/> | |
| 205 | - <view class="spec-goods-info"> | |
| 206 | - <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view> | |
| 207 | - <view class="flex ai_end xc-val-money" > | |
| 208 | - <view class="spec-goods-price"><text class="fs20">¥</text><block wx>{{data.shop_price}}</block></view> | |
| 209 | - </view> | |
| 210 | - </view> | |
| 211 | - </view> | |
| 212 | - | |
| 213 | - <!-- 选择门店模块 --> | |
| 214 | - <view class="flex-space-between address ai_end xc-width" style="padding-top: 30rpx;"> | |
| 215 | - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
| 216 | - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | |
| 217 | - <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}"> | |
| 218 | - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | |
| 219 | - | |
| 220 | - </view> | |
| 221 | - </view> | |
| 222 | - | |
| 223 | - <!-- 没有门店的时候 --> | |
| 224 | - <view class="flex" bindtap="choice_store" wx:else> | |
| 225 | - <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | |
| 226 | - <view class="fs30" style="color:black;">选择门店</view> | |
| 227 | - </view> | |
| 228 | - | |
| 229 | - <view class="red-co fs28" bindtap="choice_store" >更多门店<text class="right-arrow"></text></view> | |
| 230 | - </view> | |
| 231 | - <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> | |
| 232 | - <block wx:else> | |
| 233 | - <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> | |
| 234 | - <block wx:else> | |
| 235 | - <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> | |
| 236 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view> | |
| 237 | - </block> | |
| 238 | - </block> | |
| 239 | - | |
| 240 | - <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> | |
| 241 | - </view> | |
| 242 | - | |
| 243 | - | |
| 244 | - | |
| 245 | - <view class="b_num"> | |
| 246 | - <view>购买数量</view> | |
| 247 | - <view class="count"> | |
| 248 | - <view bindtap="subCartNum" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view> | |
| 249 | - <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input> | |
| 250 | - <view bindtap="addCartNum" class="add">+</view> | |
| 251 | - </view> | |
| 252 | - </view> | |
| 253 | - | |
| 254 | - | |
| 255 | - | |
| 256 | - <view class="spec-cart-btns"> | |
| 257 | - <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" | |
| 258 | - style="background-color: #dcdcdc;color: #999;">配送不匹配</view> | |
| 259 | - <block wx:else> | |
| 260 | - | |
| 261 | - <!-- 根本就找不到门店 --> | |
| 262 | - <block wx:if="{{!only_pk && !def_pickpu_list}}"> | |
| 263 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view> | |
| 264 | - </block> | |
| 265 | - <block wx:else> | |
| 266 | - | |
| 267 | - | |
| 268 | - <block wx:if="{{only_pk.length && !only_pk.length}}"> | |
| 269 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view> | |
| 270 | - </block> | |
| 271 | - <block wx:else> | |
| 272 | - <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}"> | |
| 273 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | |
| 274 | - </block> | |
| 275 | - <block wx:else> | |
| 276 | - <block wx:if="{{!def_pick_store}}"> | |
| 277 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> | |
| 278 | - </block> | |
| 279 | - <block wx:else> | |
| 280 | - <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 --> | |
| 281 | - <block wx:if="{{sales_rules==2 && prom_type==0}}"> | |
| 282 | - <block wx:if="{{!def_pick_store.CanOutQty}}"> | |
| 283 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | |
| 284 | - </block> | |
| 285 | - <block wx:else> | |
| 286 | - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" | |
| 287 | - class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view> | |
| 288 | - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" | |
| 289 | - class="spec-cart-btn spec-buy" data-action="buy"> | |
| 290 | - {{sele_g.offline_price?"券后购买":"立即购买"}} | |
| 291 | - </view> | |
| 292 | - </block> | |
| 293 | - </block> | |
| 294 | - <!-- 线上销售 --> | |
| 295 | - <block wx:else> | |
| 296 | - <block wx:if="{{sele_g.store_count<=0}}"> | |
| 297 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | |
| 298 | - </block> | |
| 299 | - <block wx:else> | |
| 300 | - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" | |
| 301 | - class="spec-cart-btn yellow fs32 {{!sto_sele_name?'gray':''}}" data-action="add">加入购物车</view> | |
| 302 | - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" | |
| 303 | - class="spec-cart-btn spec-buy {{!sto_sele_name?'gray':''}}" data-action="buy"> | |
| 304 | - {{sele_g.offline_price?"券后购买":"立即购买"}} | |
| 305 | - </view> | |
| 306 | - </block> | |
| 307 | - </block> | |
| 308 | - </block> | |
| 309 | - </block> | |
| 310 | - </block> | |
| 311 | - </block> | |
| 312 | - | |
| 313 | - </block> | |
| 314 | - </view> | |
| 315 | - | |
| 316 | - | |
| 317 | - | |
| 318 | - <view class="clear"></view> | |
| 319 | - | |
| 320 | - </view> | |
| 232 | + <view bindtap="closeSpecModal" class="cover-layer"></view> | |
| 233 | + <view class="spec-model"> | |
| 234 | + <view class="pding"> | |
| 235 | + <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon> | |
| 236 | + <view class="spec-goods"> | |
| 237 | + <image class="wh100 spec-img" src="{{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}}" | |
| 238 | + binderror="pop_err_img" data-errorimg="data.image_url" /> | |
| 239 | + <view class="spec-goods-info"> | |
| 240 | + <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view> | |
| 241 | + <view class="flex ai_end xc-val-money"> | |
| 242 | + <view class="spec-goods-price"><text class="fs20">¥</text> | |
| 243 | + <block wx>{{data.shop_price}}</block> | |
| 244 | + </view> | |
| 245 | + </view> | |
| 246 | + </view> | |
| 247 | + </view> | |
| 248 | + | |
| 249 | + <!-- 选择门店模块 --> | |
| 250 | + <view class="flex-space-between address ai_end xc-width" style="padding-top: 30rpx;"> | |
| 251 | + <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
| 252 | + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | |
| 253 | + <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> | |
| 254 | + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | |
| 255 | + | |
| 256 | + </view> | |
| 257 | + </view> | |
| 258 | + | |
| 259 | + <!-- 没有门店的时候 --> | |
| 260 | + <view class="flex" bindtap="choice_store" wx:else> | |
| 261 | + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | |
| 262 | + <view class="fs30" style="color:black;">选择门店</view> | |
| 263 | + </view> | |
| 264 | + | |
| 265 | + <view class="red-co fs28" bindtap="choice_store">更多门店<text class="right-arrow"></text></view> | |
| 266 | + </view> | |
| 267 | + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> | |
| 268 | + <block wx:else> | |
| 269 | + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> | |
| 270 | + <block wx:else> | |
| 271 | + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> | |
| 272 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view> | |
| 273 | + </block> | |
| 274 | + </block> | |
| 275 | + | |
| 276 | + <view class="fs24 xc-ash-9f xc-distance-top " wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> | |
| 277 | + </view> | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + <view class="b_num"> | |
| 282 | + <view>购买数量</view> | |
| 283 | + <view class="count"> | |
| 284 | + <view bindtap="subCartNum" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view> | |
| 285 | + <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input> | |
| 286 | + <view bindtap="addCartNum" class="add">+</view> | |
| 287 | + </view> | |
| 288 | + </view> | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + <view class="spec-cart-btns"> | |
| 293 | + <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view> | |
| 294 | + <block wx:else> | |
| 295 | + | |
| 296 | + <!-- 根本就找不到门店 --> | |
| 297 | + <block wx:if="{{!only_pk && !def_pickpu_list}}"> | |
| 298 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view> | |
| 299 | + </block> | |
| 300 | + <block wx:else> | |
| 301 | + | |
| 302 | + | |
| 303 | + <block wx:if="{{only_pk.length && !only_pk.length}}"> | |
| 304 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view> | |
| 305 | + </block> | |
| 306 | + <block wx:else> | |
| 307 | + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}"> | |
| 308 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | |
| 309 | + </block> | |
| 310 | + <block wx:else> | |
| 311 | + <block wx:if="{{!def_pick_store}}"> | |
| 312 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> | |
| 313 | + </block> | |
| 314 | + <block wx:else> | |
| 315 | + <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 --> | |
| 316 | + <block wx:if="{{sales_rules==2 && prom_type==0}}"> | |
| 317 | + <block wx:if="{{!def_pick_store.CanOutQty}}"> | |
| 318 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | |
| 319 | + </block> | |
| 320 | + <block wx:else> | |
| 321 | + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" | |
| 322 | + data-action="add">加入购物车</view> | |
| 323 | + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" | |
| 324 | + data-action="buy"> | |
| 325 | + {{sele_g.offline_price?"券后购买":"立即购买"}} | |
| 326 | + </view> | |
| 327 | + </block> | |
| 328 | + </block> | |
| 329 | + <!-- 线上销售 --> | |
| 330 | + <block wx:else> | |
| 331 | + <block wx:if="{{sele_g.store_count<=0}}"> | |
| 332 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | |
| 333 | + </block> | |
| 334 | + <block wx:else> | |
| 335 | + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32 {{!sto_sele_name?'gray':''}}" | |
| 336 | + data-action="add">加入购物车</view> | |
| 337 | + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy {{!sto_sele_name?'gray':''}}" | |
| 338 | + data-action="buy"> | |
| 339 | + {{sele_g.offline_price?"券后购买":"立即购买"}} | |
| 340 | + </view> | |
| 341 | + </block> | |
| 342 | + </block> | |
| 343 | + </block> | |
| 344 | + </block> | |
| 345 | + </block> | |
| 346 | + </block> | |
| 347 | + | |
| 348 | + </block> | |
| 349 | + </view> | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + <view class="clear"></view> | |
| 354 | + | |
| 355 | + </view> | |
| 321 | 356 | </view> |
| 322 | 357 | |
| 323 | 358 | |
| 324 | 359 | |
| 325 | 360 | <!-- 选择门店的弹框,1.1版最新的 --> |
| 326 | 361 | <block wx:if="{{store==1}}"> |
| 327 | - <view class="mongolia-layer" bindtap="close_popup"></view> | |
| 328 | - <view class="popup-frame"> | |
| 329 | - <block wx:if="{{sort_store==0}}"> | |
| 330 | - <!-- 头部 标题 --> | |
| 331 | - <view class="popup-top flex-space-between"> | |
| 332 | - <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text> | |
| 333 | - <view> | |
| 334 | - <view> | |
| 335 | - <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
| 336 | - </view> | |
| 337 | - <view class="felx choose_more" bindtap="more_store" wx:if="{{is_show_sto_cat>0}}" > | |
| 338 | - <text class="fs26 red-co">{{choice_sort_store==0?'更多门店':'返回'}}</text> | |
| 339 | - <view class="bg_rights"></view> | |
| 340 | - </view> | |
| 341 | - </view> | |
| 342 | - </view> | |
| 343 | - <!-- 门店列表,最外层的门店列表,一开始 --> | |
| 344 | - <view class="store-list"> | |
| 345 | - <!--如果还没有点击更多门店的时候 --> | |
| 346 | - <block wx:if="{{choice_sort_store==0}}"> | |
| 347 | - <!-- 需要for循环 --> | |
| 348 | - <block wx:if="{{is_show_sto_cat==1}}"> | |
| 349 | - <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | |
| 350 | - <view class="store flex-vertical"> | |
| 351 | - <!-- 需要点击事件 --> | |
| 352 | - <block wx:if="{{index==fir_pick_index}}"> | |
| 353 | - <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 354 | - </block> | |
| 355 | - <block wx:else> | |
| 356 | - <view class="circle xc-hooks"></view> | |
| 357 | - </block> | |
| 358 | - <view class="address-frame xc-ash"> | |
| 359 | - <view class="flex-vertical-between butttem5"> | |
| 360 | - <view class="flex xc-ash"> | |
| 361 | - <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 362 | - </view> | |
| 363 | - <view> | |
| 364 | - <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}"> | |
| 365 | - 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}}</view> | |
| 366 | - </view> | |
| 367 | - </view> | |
| 368 | - <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 369 | - </view> | |
| 370 | - </view> | |
| 371 | - </view> | |
| 372 | - </block> | |
| 373 | - <block wx:else> | |
| 374 | - <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | |
| 375 | - <view class="store flex-vertical"> | |
| 376 | - <!-- 需要点击事件 --> | |
| 377 | - <block wx:if="{{index==fir_pick_index}}" > | |
| 378 | - <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 379 | - </block> | |
| 380 | - <block wx:else> | |
| 381 | - <view class="circle xc-hooks"></view> | |
| 382 | - </block> | |
| 383 | - | |
| 384 | - <view class="address-frame xc-ash"> | |
| 385 | - <view class="flex-vertical-between "> | |
| 386 | - <view class="flex xc-ash"> | |
| 387 | - <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 388 | - </view> | |
| 389 | - <view> | |
| 390 | - <view class="distance fs24 address-val" | |
| 391 | - wx:if="{{item.distance!=null}}">距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}} | |
| 392 | - </view> | |
| 393 | - </view> | |
| 394 | - </view> | |
| 395 | - <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 396 | - </view> | |
| 397 | - </view> | |
| 398 | - </view> | |
| 399 | - </block> | |
| 400 | - </block> | |
| 401 | - <block wx:else> <!-- 如果是点击选择门店分类后显示分类下的门店 --> | |
| 402 | - <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" bindtap="choose_for_store"> | |
| 403 | - <view class="store flex-vertical"> | |
| 404 | - <!-- 需要点击事件 --> | |
| 405 | - <block wx:if="{{index==sec_pick_index}}"> | |
| 406 | - <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 407 | - </block> | |
| 408 | - <block wx:else> | |
| 409 | - <view class="circle xc-hooks"></view> | |
| 410 | - </block> | |
| 411 | - | |
| 412 | - <view class="address-frame xc-ash"> | |
| 413 | - <view class="flex-vertical-between "> | |
| 414 | - <view class="flex xc-ash"> | |
| 415 | - <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 416 | - </view> | |
| 417 | - <view> | |
| 418 | - <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}"> | |
| 419 | - 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}</view> | |
| 420 | - </view> | |
| 421 | - </view> | |
| 422 | - <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 423 | - </view> | |
| 424 | - </view> | |
| 425 | - </view> | |
| 426 | - </block> | |
| 427 | - | |
| 428 | - </view> | |
| 429 | - | |
| 430 | - <!-- 门店列表底部 --> | |
| 431 | - <view class="store-bottom-frame"> | |
| 432 | - <view class="store-bottom flex-vertical-between"> | |
| 433 | - <view class="determine red-b fs28 white t-c" bindtap="sure_pick" | |
| 434 | - data-openindstore="{{open_ind_store}}">确定</view> | |
| 435 | - <view class="default t-c fs28" bindtap="set_def_pick"data-openindstore="{{open_ind_store}}">设为默认</view> | |
| 436 | - </view> | |
| 437 | - </view> | |
| 438 | - | |
| 439 | - </block> | |
| 440 | - | |
| 441 | - | |
| 442 | - <block wx:else> | |
| 443 | - <view class="popup-top flex-space-between"> | |
| 444 | - <text class="fs32 nearby_store">门店分类选择</text> | |
| 445 | - <view> | |
| 446 | - <view> | |
| 447 | - <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
| 448 | - </view> | |
| 449 | - <view class="felx choose_mores" bindtap="returns"> | |
| 450 | - <text class="fs26 red-co">返回</text> | |
| 451 | - </view> | |
| 452 | - </view> | |
| 453 | - </view> | |
| 454 | - <view class="sort_store_list"> | |
| 455 | - | |
| 456 | - <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}"> | |
| 457 | - <view class="sort-store flex-vertical-between" > | |
| 458 | - <view class="fs30" di>{{item.name}}</view> | |
| 459 | - <view class="black_rights-frame"> | |
| 460 | - <view class="black_rights"></view> | |
| 461 | - </view> | |
| 462 | - </view> | |
| 463 | - </view> | |
| 362 | + <view class="mongolia-layer" bindtap="close_popup"></view> | |
| 363 | + <view class="popup-frame"> | |
| 364 | + <block wx:if="{{sort_store==0}}"> | |
| 365 | + <!-- 头部 标题 --> | |
| 366 | + <view class="popup-top flex-space-between"> | |
| 367 | + <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text> | |
| 368 | + <view> | |
| 369 | + <view> | |
| 370 | + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
| 371 | + </view> | |
| 372 | + <view class="felx choose_more" bindtap="more_store" wx:if="{{is_show_sto_cat>0}}"> | |
| 373 | + <text class="fs26 red-co">{{choice_sort_store==0?'更多门店':'返回'}}</text> | |
| 374 | + <view class="bg_rights"></view> | |
| 375 | + </view> | |
| 376 | + </view> | |
| 377 | + </view> | |
| 378 | + <!-- 门店列表,最外层的门店列表,一开始 --> | |
| 379 | + <view class="store-list"> | |
| 380 | + <!--如果还没有点击更多门店的时候 --> | |
| 381 | + <block wx:if="{{choice_sort_store==0}}"> | |
| 382 | + <!-- 需要for循环 --> | |
| 383 | + <block wx:if="{{is_show_sto_cat==1}}"> | |
| 384 | + <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | |
| 385 | + <view class="store flex-vertical"> | |
| 386 | + <!-- 需要点击事件 --> | |
| 387 | + <block wx:if="{{index==fir_pick_index}}"> | |
| 388 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 389 | + </block> | |
| 390 | + <block wx:else> | |
| 391 | + <view class="circle xc-hooks"></view> | |
| 392 | + </block> | |
| 393 | + <view class="address-frame xc-ash"> | |
| 394 | + <view class="flex-vertical-between butttem5"> | |
| 395 | + <view class="flex xc-ash"> | |
| 396 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 397 | + </view> | |
| 398 | + <view> | |
| 399 | + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> | |
| 400 | + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}}</view> | |
| 401 | + </view> | |
| 402 | + </view> | |
| 403 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 404 | + </view> | |
| 405 | + </view> | |
| 406 | + </view> | |
| 407 | + </block> | |
| 408 | + <block wx:else> | |
| 409 | + <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | |
| 410 | + <view class="store flex-vertical"> | |
| 411 | + <!-- 需要点击事件 --> | |
| 412 | + <block wx:if="{{index==fir_pick_index}}"> | |
| 413 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 414 | + </block> | |
| 415 | + <block wx:else> | |
| 416 | + <view class="circle xc-hooks"></view> | |
| 417 | + </block> | |
| 418 | + | |
| 419 | + <view class="address-frame xc-ash"> | |
| 420 | + <view class="flex-vertical-between "> | |
| 421 | + <view class="flex xc-ash"> | |
| 422 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 423 | + </view> | |
| 424 | + <view> | |
| 425 | + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}} | |
| 426 | + </view> | |
| 427 | + </view> | |
| 428 | + </view> | |
| 429 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 430 | + </view> | |
| 431 | + </view> | |
| 432 | + </view> | |
| 433 | + </block> | |
| 434 | + </block> | |
| 435 | + <block wx:else> | |
| 436 | + <!-- 如果是点击选择门店分类后显示分类下的门店 --> | |
| 437 | + <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" bindtap="choose_for_store"> | |
| 438 | + <view class="store flex-vertical"> | |
| 439 | + <!-- 需要点击事件 --> | |
| 440 | + <block wx:if="{{index==sec_pick_index}}"> | |
| 441 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 442 | + </block> | |
| 443 | + <block wx:else> | |
| 444 | + <view class="circle xc-hooks"></view> | |
| 445 | + </block> | |
| 446 | + | |
| 447 | + <view class="address-frame xc-ash"> | |
| 448 | + <view class="flex-vertical-between "> | |
| 449 | + <view class="flex xc-ash"> | |
| 450 | + <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 451 | + </view> | |
| 452 | + <view> | |
| 453 | + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> | |
| 454 | + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}</view> | |
| 455 | + </view> | |
| 456 | + </view> | |
| 457 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 458 | + </view> | |
| 459 | + </view> | |
| 460 | + </view> | |
| 461 | + </block> | |
| 462 | + | |
| 463 | + </view> | |
| 464 | 464 | |
| 465 | - </view> | |
| 466 | - </block> | |
| 467 | - </view> | |
| 468 | -</block> | |
| 465 | + <!-- 门店列表底部 --> | |
| 466 | + <view class="store-bottom-frame"> | |
| 467 | + <view class="store-bottom flex-vertical-between"> | |
| 468 | + <view class="determine red-b fs28 white t-c" bindtap="sure_pick" data-openindstore="{{open_ind_store}}">确定</view> | |
| 469 | + <view class="default t-c fs28" bindtap="set_def_pick" data-openindstore="{{open_ind_store}}">设为默认</view> | |
| 470 | + </view> | |
| 471 | + </view> | |
| 472 | + | |
| 473 | + </block> | |
| 474 | + | |
| 475 | + | |
| 476 | + <block wx:else> | |
| 477 | + <view class="popup-top flex-space-between"> | |
| 478 | + <text class="fs32 nearby_store">门店分类选择</text> | |
| 479 | + <view> | |
| 480 | + <view> | |
| 481 | + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
| 482 | + </view> | |
| 483 | + <view class="felx choose_mores" bindtap="returns"> | |
| 484 | + <text class="fs26 red-co">返回</text> | |
| 485 | + </view> | |
| 486 | + </view> | |
| 487 | + </view> | |
| 488 | + <view class="sort_store_list"> | |
| 489 | + | |
| 490 | + <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}"> | |
| 491 | + <view class="sort-store flex-vertical-between"> | |
| 492 | + <view class="fs30" di>{{item.name}}</view> | |
| 493 | + <view class="black_rights-frame"> | |
| 494 | + <view class="black_rights"></view> | |
| 495 | + </view> | |
| 496 | + </view> | |
| 497 | + </view> | |
| 498 | + | |
| 499 | + </view> | |
| 500 | + </block> | |
| 501 | + </view> | |
| 502 | +</block> | |
| 469 | 503 | <!-- ---------------分享弹窗--------------- --> |
| 470 | 504 | <!--二维码显示页面--> |
| 471 | 505 | <canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas> |
| ... | ... | @@ -473,14 +507,13 @@ |
| 473 | 507 | |
| 474 | 508 | |
| 475 | 509 | <view wx:if="{{showPoster}}"> |
| 476 | - <view class="mask" catchtap="closePoster"></view> | |
| 477 | - <view class="poster-container"> | |
| 478 | - <view class="poster-wrapper"> | |
| 479 | - <view class="poster"> | |
| 480 | - <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image> | |
| 481 | - <view class="btn-close" catchtap="closePoster"><text class="iconfont icon-close"></text></view> | |
| 482 | - </view> | |
| 483 | - </view> | |
| 484 | - </view> | |
| 510 | + <view class="mask" catchtap="closePoster"></view> | |
| 511 | + <view class="poster-container"> | |
| 512 | + <view class="poster-wrapper"> | |
| 513 | + <view class="poster"> | |
| 514 | + <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image> | |
| 515 | + <view class="btn-close" catchtap="closePoster"><text class="iconfont icon-close"></text></view> | |
| 516 | + </view> | |
| 517 | + </view> | |
| 518 | + </view> | |
| 485 | 519 | </view> |
| 486 | - | ... | ... |
packageA/pages/goodsInfo/goodsInfo.wxss
| ... | ... | @@ -3,7 +3,10 @@ |
| 3 | 3 | image { |
| 4 | 4 | vertical-align: top; |
| 5 | 5 | } |
| 6 | -.goods-detail{overflow: hidden} | |
| 6 | +.goods-detail{ | |
| 7 | + /* overflow: hidden */ | |
| 8 | + padding-top: 78rpx; | |
| 9 | +} | |
| 7 | 10 | |
| 8 | 11 | .type-navbar { |
| 9 | 12 | display: flex; |
| ... | ... | @@ -56,6 +59,7 @@ image { |
| 56 | 59 | .swiper_box { |
| 57 | 60 | width: 100%; |
| 58 | 61 | height: 750rpx; |
| 62 | + background-color: #f2f2f2; | |
| 59 | 63 | } |
| 60 | 64 | .goods-title { |
| 61 | 65 | display: flex; |
| ... | ... | @@ -1006,10 +1010,10 @@ left:31rpx;} |
| 1006 | 1010 | .red_shu{ width: 10rpx; height: 36rpx; background-color:#da0035; margin-right: 8rpx; } |
| 1007 | 1011 | |
| 1008 | 1012 | .tb-l{ /* line-height: 96rpx; */} |
| 1009 | -.table_s{ border:#e4e4e4 1rpx solid; box-sizing: border-box;font-size: 26rpx;} | |
| 1013 | +.table_s{ border:#e4e4e4 1rpx solid; box-sizing: border-box;font-size: 26rpx;border-right: none;} | |
| 1010 | 1014 | .tb_item{display: flex; /* height: 96rpx; */ border-bottom: 1rpx solid #e4e4e4 } |
| 1011 | 1015 | .item_left{width: 210rpx; height: 100%; box-sizing:border-box; text-align: center;padding: 20rpx; background: #f9f9f9 ;border-right:2rpx solid #e4e4e4} .item_left text{ /* margin-left: 44rpx; */} |
| 1012 | -.item_right{flex:1; height: 100%; overflow : hidden;white-space:nowrap;text-overflow: ellipsis; padding: 20rpx;} | |
| 1016 | +.item_right{flex:1; height: 100%; overflow : hidden;white-space:nowrap;text-overflow: ellipsis; padding: 20rpx;border-right:2rpx solid #e4e4e4;text-align: center;} | |
| 1013 | 1017 | .item_right text{ /* margin-left: 66rpx; */} |
| 1014 | 1018 | |
| 1015 | 1019 | .table_s .tb-l:last-child {border-bottom: none;} | ... | ... |
packageA/pages/jfbuy/jfbuy.js
| ... | ... | @@ -187,64 +187,102 @@ Page({ |
| 187 | 187 | /** |
| 188 | 188 | * 用户点击右上角分享 |
| 189 | 189 | */ |
| 190 | - // onShareAppMessage: function () { | |
| 191 | - // var th = this; | |
| 192 | - // //礼包的转发 | |
| 193 | - // if(th.data.currentIndex==3){ | |
| 194 | - // var lbid=th.data.hui_active.lbId; | |
| 195 | - // var url="pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1"; | |
| 196 | - // if(getApp().globalData.user_id){ | |
| 197 | - // url+="&first_leader="+getApp().globalData.user_id; | |
| 198 | - // } | |
| 199 | - // var img=this.data.share_img; | |
| 200 | - // var title=th.data.hui_active.giftTitle; | |
| 190 | + onShareAppMessage: function () { | |
| 191 | + | |
| 192 | + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:''; | |
| 193 | + | |
| 194 | + var pagePath = this.route; //当前页面url | |
| 195 | + | |
| 196 | + if(!store_name) store_name = getApp().globalData.setting.appName; | |
| 197 | + | |
| 198 | + if(pagePath.indexOf('/') != 0) { | |
| 199 | + pagePath = '/' + pagePath; | |
| 200 | + } | |
| 201 | + | |
| 202 | + if(getApp().globalData.user_id){ | |
| 203 | + if(pagePath.indexOf('?')>0){ | |
| 204 | + pagePath += '&first_leader=' + getApp().globalData.user_id; | |
| 205 | + }else{ | |
| 206 | + pagePath += '?first_leader=' + getApp().globalData.user_id; | |
| 207 | + } | |
| 208 | + } | |
| 209 | + return { | |
| 210 | + title: store_name + '-积分购', | |
| 211 | + path: pagePath, | |
| 212 | + } | |
| 213 | + // var th = this; | |
| 214 | + // //礼包的转发 | |
| 215 | + // if(th.data.currentIndex==3){ | |
| 216 | + // var lbid=th.data.hui_active.lbId; | |
| 217 | + // var url="pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1"; | |
| 218 | + // if(getApp().globalData.user_id){ | |
| 219 | + // url+="&first_leader="+getApp().globalData.user_id; | |
| 220 | + // } | |
| 221 | + // var img=this.data.share_img; | |
| 222 | + // var title=th.data.hui_active.giftTitle; | |
| 201 | 223 | |
| 202 | - // var ob={ | |
| 203 | - // title:title, | |
| 204 | - // path:url, | |
| 205 | - // imageUrl: img, | |
| 206 | - // }; | |
| 207 | - // th.setData({share_hidden:1}); | |
| 208 | - // return ob; | |
| 224 | + // var ob={ | |
| 225 | + // title:title, | |
| 226 | + // path:url, | |
| 227 | + // imageUrl: img, | |
| 228 | + // }; | |
| 229 | + // th.setData({share_hidden:1}); | |
| 230 | + // return ob; | |
| 209 | 231 | |
| 210 | - // }else{ | |
| 211 | - // //---秒杀,拼团,促销--- | |
| 212 | - // var item=this.data.share_good; | |
| 213 | - // if(item){ | |
| 214 | - // var price = item.shop_price; | |
| 215 | - // var title= item.goods_name; | |
| 216 | - // var img=this.data.url+item.original_img; | |
| 217 | - // var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid; | |
| 218 | - // if(getApp().globalData.user_id){ | |
| 219 | - // url+="&first_leader="+getApp().globalData.user_id; | |
| 220 | - // } | |
| 221 | - // var ob={ | |
| 222 | - // title: price + "元 " +title, | |
| 223 | - // path:url, | |
| 224 | - // imageUrl: img, | |
| 225 | - // }; | |
| 226 | - // th.setData({share_hidden:1,share_good:null}); | |
| 227 | - // return ob; | |
| 228 | - // }else{ | |
| 229 | - // var url="/pages/index/index/index"; | |
| 230 | - // if(getApp().globalData.user_id){ | |
| 231 | - // url+="?first_leader="+getApp().globalData.user_id; | |
| 232 | - // } | |
| 233 | - // var hui_active=this.data.hui_active; | |
| 234 | - // var title=hui_active.name; | |
| 235 | - // if(!title) title=hui_active.main_goods_name; | |
| 236 | - // if(!title) title=hui_active.giftTitle; | |
| 232 | + // }else{ | |
| 233 | + // //---秒杀,拼团,促销--- | |
| 234 | + // var item=this.data.share_good; | |
| 235 | + // if(item){ | |
| 236 | + // var price = item.shop_price; | |
| 237 | + // var title= item.goods_name; | |
| 238 | + // var img=this.data.url+item.original_img; | |
| 239 | + // var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid; | |
| 240 | + // if(getApp().globalData.user_id){ | |
| 241 | + // url+="&first_leader="+getApp().globalData.user_id; | |
| 242 | + // } | |
| 243 | + // var ob={ | |
| 244 | + // title: price + "元 " +title, | |
| 245 | + // path:url, | |
| 246 | + // imageUrl: img, | |
| 247 | + // }; | |
| 248 | + // th.setData({share_hidden:1,share_good:null}); | |
| 249 | + // return ob; | |
| 250 | + // }else{ | |
| 251 | + // var url="/pages/index/index/index"; | |
| 252 | + // if(getApp().globalData.user_id){ | |
| 253 | + // url+="?first_leader="+getApp().globalData.user_id; | |
| 254 | + // } | |
| 255 | + // var hui_active=this.data.hui_active; | |
| 256 | + // var title=hui_active.name; | |
| 257 | + // if(!title) title=hui_active.main_goods_name; | |
| 258 | + // if(!title) title=hui_active.giftTitle; | |
| 237 | 259 | |
| 238 | - // var ob={ | |
| 239 | - // title: title, | |
| 240 | - // path:url, | |
| 241 | - // }; | |
| 242 | - // th.setData({share_hidden:1,share_good:null}); | |
| 243 | - // return ob; | |
| 244 | - // } | |
| 245 | - // } | |
| 260 | + // var ob={ | |
| 261 | + // title: title, | |
| 262 | + // path:url, | |
| 263 | + // }; | |
| 264 | + // th.setData({share_hidden:1,share_good:null}); | |
| 265 | + // return ob; | |
| 266 | + // } | |
| 267 | + // } | |
| 246 | 268 | |
| 247 | - // }, | |
| 269 | + }, | |
| 270 | + | |
| 271 | + | |
| 272 | + onShareTimeline() { | |
| 273 | + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:''; | |
| 274 | + | |
| 275 | + var pagePath = this.route; //当前页面url | |
| 276 | + | |
| 277 | + if(!store_name) store_name = getApp().globalData.setting.appName; | |
| 278 | + if(pagePath.indexOf('/') != 0) { | |
| 279 | + pagePath = '/' + pagePath; | |
| 280 | + } | |
| 281 | + return { | |
| 282 | + title: store_name + '-积分购', | |
| 283 | + path: pagePath, | |
| 284 | + } | |
| 285 | + }, | |
| 248 | 286 | |
| 249 | 287 | |
| 250 | 288 | //-- 点击tab -- | ... | ... |
packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js
| ... | ... | @@ -10,10 +10,23 @@ Page({ |
| 10 | 10 | isLoading: false, // 检测是否已经发送请求,防止重复发送请求 |
| 11 | 11 | noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 |
| 12 | 12 | pageNum: 1, // 当前页数 |
| 13 | + max_sw_height: 0, | |
| 13 | 14 | }, |
| 14 | 15 | |
| 15 | - onLoad: function () { | |
| 16 | + onLoad: function (options) { | |
| 16 | 17 | self = this; |
| 18 | + | |
| 19 | + var first_leader = options.first_leader; | |
| 20 | + if(first_leader) { | |
| 21 | + app.globalData.first_leader = first_leader; | |
| 22 | + //调用接口判断是不是会员 | |
| 23 | + // app.request.promiseGet("/api/weshop/shoppingGuide/get/" + app.globalData.setting.stoid + "/" + first_leader, {}).then(res => { | |
| 24 | + // if (res.data.code == 0) { | |
| 25 | + // getApp().globalData.guide_id = res.data.data.id; | |
| 26 | + // } | |
| 27 | + // }) | |
| 28 | + }; | |
| 29 | + | |
| 17 | 30 | app.isLogin().then(function(data) { |
| 18 | 31 | self.setData({ |
| 19 | 32 | userInfo: data, |
| ... | ... | @@ -173,5 +186,54 @@ Page({ |
| 173 | 186 | }; |
| 174 | 187 | }, |
| 175 | 188 | |
| 189 | + | |
| 190 | + /** | |
| 191 | + * 用户点击右上角分享 | |
| 192 | + */ | |
| 193 | + onShareAppMessage: function (e) { | |
| 194 | + var pagePath = this.route; //当前页面url | |
| 195 | + if (pagePath.indexOf('/') != 0) { | |
| 196 | + pagePath = '/' + pagePath; | |
| 197 | + } | |
| 198 | + if(getApp().globalData.user_id){ | |
| 199 | + | |
| 200 | + if(pagePath.indexOf("?")>0){ | |
| 201 | + pagePath+="&first_leader="+getApp().globalData.user_id; | |
| 202 | + }else{ | |
| 203 | + pagePath+="?first_leader="+getApp().globalData.user_id; | |
| 204 | + } | |
| 205 | + } | |
| 206 | + return { | |
| 207 | + title: "幸运购活动列表", | |
| 208 | + path: pagePath, | |
| 209 | + } | |
| 210 | + }, | |
| 211 | + | |
| 212 | + // onShareTimeline() { | |
| 213 | + // var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:''; | |
| 214 | + // var pagePath = this.route; //当前页面url | |
| 215 | + | |
| 216 | + // if(!store_name) store_name = getApp().globalData.setting.appName; | |
| 217 | + // if (pagePath.indexOf('/') != 0) { | |
| 218 | + // pagePath = '/' + pagePath; | |
| 219 | + // } | |
| 220 | + // return { | |
| 221 | + // title: store_name + '-幸运购活动列表', | |
| 222 | + // path: pagePath, | |
| 223 | + // } | |
| 224 | + // }, | |
| 225 | + | |
| 226 | + imageLoad: function (e) { | |
| 227 | + var imgwidth = e.detail.width; | |
| 228 | + var imgheight = e.detail.height; | |
| 229 | + //宽高比 | |
| 230 | + var ratio = imgwidth / imgheight; | |
| 231 | + //计算的高度值 | |
| 232 | + var viewHeight = 715 / ratio; | |
| 233 | + if (this.data.max_sw_height < viewHeight) this.setData({ | |
| 234 | + max_sw_height: viewHeight | |
| 235 | + }); | |
| 236 | + }, | |
| 237 | + | |
| 176 | 238 | }) |
| 177 | 239 | ... | ... |
packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.wxml
| 1 | 1 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
| 2 | 2 | <view> |
| 3 | 3 | <!-- 广告图 --> |
| 4 | - <swiper class="ad-container" circular="true" autoplay="true" indicator-dots="true" interval="2500" indicator-active-color="rgba(255,255,255,.5)" wx:if="{{adList && adList.length != 0}}"> | |
| 4 | + <swiper class="ad-container" circular="true" autoplay="true" indicator-dots="true" interval="2500" indicator-active-color="rgba(255,255,255,.5)" wx:if="{{adList && adList.length != 0}}" style="height:{{max_sw_height}}rpx"> | |
| 5 | 5 | <swiper-item wx:for="{{adList}}"> |
| 6 | 6 | <navigator url="{{item.ad_weapplink}}" style="height: 100%;" hover-class="none" open-type="reLaunch"> |
| 7 | - <image src="{{imghost + item.ad_code}}" class="img-block" bindload="imageLoad" data-index="{{index}}" mode="scaleToFill" lazy-load="true"/> | |
| 7 | + <image src="{{imghost + item.ad_code}}" class="img-block" bindload="imageLoad" data-index="{{index}}" lazy-load="true" mode="widthFix"/> | |
| 8 | 8 | </navigator> |
| 9 | 9 | </swiper-item> |
| 10 | 10 | </swiper> |
| 11 | 11 | |
| 12 | 12 | <view class="list"> |
| 13 | 13 | <block wx:for="{{list.pageData}}"> |
| 14 | - <view class="list-item" wx:if="{{item.status == 1}}" bindtap="go" data-url="/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id={{item.goods_id}}&prom_type=9&group_id={{item.id}}"> | |
| 14 | + <view class="list-item" wx:if="{{item.status == 1}}" bindtap="{{item.actLen == 0 ? '':'go'}}" data-url="/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id={{item.goods_id}}&prom_type=9&group_id={{item.id}}"> | |
| 15 | 15 | <view class="flex ai-center"> |
| 16 | 16 | <view class="img-container"> |
| 17 | 17 | <image class="img-block" src="{{imghost + item.original_img}}" data-val="{{item.original_img}}" |
| ... | ... | @@ -26,7 +26,8 @@ |
| 26 | 26 | </view> |
| 27 | 27 | <view class="flex jc_sb"> |
| 28 | 28 | <progress class="pdr20 f1 progress" percent="{{filters.percent(item.num, item.group_num)}}" activeColor="#FF6768" backgroundColor="#d0d0d0" border-radius="12" stroke-width="12" data-content="{{item.num}}人已参团"></progress> |
| 29 | - <view class="btn fs26">去参团</view> | |
| 29 | + <view class="btn fs26 {{item.actLen == 0 ? 'gray':''}}" wx:if="{{item.actLen == 0}}">已抢光</view> | |
| 30 | + <view class="btn fs26" wx:else>去参团</view> | |
| 30 | 31 | </view> |
| 31 | 32 | </view> |
| 32 | 33 | ... | ... |
packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.wxss
| ... | ... | @@ -4,7 +4,7 @@ page { |
| 4 | 4 | |
| 5 | 5 | .ad-container { |
| 6 | 6 | background-color: #f2f2f2; |
| 7 | - height: 400rpx; | |
| 7 | + /* height: 400rpx; */ | |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | .list { |
| ... | ... | @@ -20,8 +20,8 @@ page { |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | .img-container { |
| 23 | - width: 200rpx; | |
| 24 | - height: 200rpx; | |
| 23 | + width: 220rpx; | |
| 24 | + height: 220rpx; | |
| 25 | 25 | border-radius: 14rpx; |
| 26 | 26 | overflow: hidden; |
| 27 | 27 | flex-shrink: 0; |
| ... | ... | @@ -70,6 +70,7 @@ page { |
| 70 | 70 | |
| 71 | 71 | .name { |
| 72 | 72 | height: 88rpx; |
| 73 | + word-break: break-all; | |
| 73 | 74 | } |
| 74 | 75 | |
| 75 | 76 | .no-more { |
| ... | ... | @@ -92,3 +93,7 @@ page { |
| 92 | 93 | color: white; |
| 93 | 94 | text-align: center; |
| 94 | 95 | } |
| 96 | + | |
| 97 | +.btn.gray { | |
| 98 | + background-color: #ccc; | |
| 99 | +} | ... | ... |
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
| ... | ... | @@ -126,6 +126,7 @@ Page({ |
| 126 | 126 | user_note:{}, |
| 127 | 127 | zuhe_map_good:{}, |
| 128 | 128 | }, |
| 129 | + | |
| 129 | 130 | onLoad: function (t) { |
| 130 | 131 | wx.setNavigationBarTitle({title: "填写订单",}) |
| 131 | 132 | var th = this; |
| ... | ... | @@ -139,10 +140,7 @@ Page({ |
| 139 | 140 | success: function (s) { |
| 140 | 141 | } |
| 141 | 142 | }); |
| 142 | - | |
| 143 | - // console.log('t=======================>', t); | |
| 144 | - | |
| 145 | - | |
| 143 | + | |
| 146 | 144 | |
| 147 | 145 | }, |
| 148 | 146 | onUnload: function () { |
| ... | ... | @@ -808,13 +806,12 @@ Page({ |
| 808 | 806 | } |
| 809 | 807 | } |
| 810 | 808 | |
| 811 | - | |
| 809 | + | |
| 812 | 810 | gd.prom_type=gg.prom_type; |
| 813 | 811 | gd.prom_id=gg.prom_id; |
| 814 | - | |
| 812 | + | |
| 815 | 813 | switch (gd.prom_type) { |
| 816 | 814 | case 0: |
| 817 | - case 2: | |
| 818 | 815 | case 3: |
| 819 | 816 | case 4: |
| 820 | 817 | case 5: |
| ... | ... | @@ -987,6 +984,7 @@ Page({ |
| 987 | 984 | //t.data.data.shop_price = tt.data.data.prom_price; |
| 988 | 985 | t.data.data.shop_price = tt.data.data.prom_user_price; |
| 989 | 986 | th.data.ckeck_quan_price=0; |
| 987 | + gd.is_xz_yh=1; | |
| 990 | 988 | } else { |
| 991 | 989 | t.data.data.prom_id = 0; |
| 992 | 990 | t.data.data.prom_type = 0; |
| ... | ... | @@ -1013,6 +1011,45 @@ Page({ |
| 1013 | 1011 | }); |
| 1014 | 1012 | |
| 1015 | 1013 | break; |
| 1014 | + | |
| 1015 | + case 2: //--- 团购 --- | |
| 1016 | + var quanlist = null; | |
| 1017 | + getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" +os.stoid + "/" +gd.goods_id+"/"+ gd.prom_id, { | |
| 1018 | + success: async function (tt) { | |
| 1019 | + if (tt.data.code == 0) { | |
| 1020 | + //t.data.data.shop_price = tt.data.data.prom_price; | |
| 1021 | + t.data.data.shop_price = tt.data.data.price; | |
| 1022 | + } else { | |
| 1023 | + t.data.data.prom_id = 0; | |
| 1024 | + t.data.data.prom_type = 0; | |
| 1025 | + } | |
| 1026 | + | |
| 1027 | + if(tt.data.data.isQuan){ | |
| 1028 | + th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num; | |
| 1029 | + th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + ""; | |
| 1030 | + th.data.check_quan_ware_list = t.data.data.erpwareid + ""; | |
| 1031 | + }else{ | |
| 1032 | + gd.is_xz_yh=1; | |
| 1033 | + } | |
| 1034 | + | |
| 1035 | + th.setData({ | |
| 1036 | + bn_goods: gd, | |
| 1037 | + bn_pickname: gg.pick_name, | |
| 1038 | + bn_exp_type: et, | |
| 1039 | + index: m_wind, | |
| 1040 | + bn_pick: gg.pick_id, | |
| 1041 | + bn_t_exp_t: distr_t, | |
| 1042 | + bn_exp_type: et | |
| 1043 | + }); | |
| 1044 | + | |
| 1045 | + //-- 计算价格 -- | |
| 1046 | + th.calculatePrice2(); | |
| 1047 | + //获取优惠券,如果有券的钱,就调用 | |
| 1048 | + if(th.data.ckeck_quan_price>0) th.get_buy_now_quan(); | |
| 1049 | + } | |
| 1050 | + }); | |
| 1051 | + | |
| 1052 | + break; | |
| 1016 | 1053 | } |
| 1017 | 1054 | }, |
| 1018 | 1055 | }); |
| ... | ... | @@ -1389,7 +1426,7 @@ Page({ |
| 1389 | 1426 | } |
| 1390 | 1427 | |
| 1391 | 1428 | //--如果是物流,且选择了地址,就要开始显示包邮券,且包邮券也已经优惠了优惠活动的金额-- |
| 1392 | - if (cart_item.exp_type == 0 && th.data.user_addr != null) { | |
| 1429 | + if (cart_item.exp_type == 0 && th.data.user_addr != null && !cart_item.is_xz_yh) { | |
| 1393 | 1430 | //看是不是有调用过包邮券 |
| 1394 | 1431 | if (!th.data.isget_by_quan[pickid]) { |
| 1395 | 1432 | //--判断要不要显示包邮券,调用接口,因为有for循环--- |
| ... | ... | @@ -1397,7 +1434,8 @@ Page({ |
| 1397 | 1434 | data: { |
| 1398 | 1435 | store_id: os.stoid, |
| 1399 | 1436 | isuse: 0, |
| 1400 | - condition: q_conditin, | |
| 1437 | + //condition: q_conditin, | |
| 1438 | + condition:cart_item.ckeck_quan_price, | |
| 1401 | 1439 | user_id: getApp().globalData.user_id, |
| 1402 | 1440 | pageSize: 2000 |
| 1403 | 1441 | } |
| ... | ... | @@ -1422,10 +1460,10 @@ Page({ |
| 1422 | 1460 | } |
| 1423 | 1461 | if (arr) { |
| 1424 | 1462 | th.data.get_by_quan_list_cart[pickid] = arr; |
| 1425 | - //th.setData({get_by_quan_list_cart:th.data.get_by_quan_list_cart}); | |
| 1426 | - if (th.data.is_b_now) { | |
| 1427 | - th.setData({get_by_quan_list: arr}); | |
| 1428 | - } | |
| 1463 | + th.setData({get_by_quan_list_cart:th.data.get_by_quan_list_cart}); | |
| 1464 | + //if (th.data.is_b_now) { | |
| 1465 | + // th.setData({get_by_quan_list: arr}); | |
| 1466 | + //} | |
| 1429 | 1467 | } |
| 1430 | 1468 | th.data.isget_by_quan[pickid] = 1; |
| 1431 | 1469 | } |
| ... | ... | @@ -2030,29 +2068,9 @@ Page({ |
| 2030 | 2068 | }); |
| 2031 | 2069 | }); |
| 2032 | 2070 | }, |
| 2033 | - | |
| 2034 | - | |
| 2035 | - submitConfirm(e) { | |
| 2036 | - var th = this; | |
| 2037 | - wx.showModal({ | |
| 2038 | - title: '温馨提示', | |
| 2039 | - content: this.data.param.alert, | |
| 2040 | - success (res) { | |
| 2041 | - if (res.confirm) { | |
| 2042 | - console.log('用户点击确定'); | |
| 2043 | - th.submitForm(e); | |
| 2044 | - } else if (res.cancel) { | |
| 2045 | - console.log('用户点击取消') | |
| 2046 | - } | |
| 2047 | - } | |
| 2048 | - }) | |
| 2049 | - }, | |
| 2050 | 2071 | |
| 2051 | 2072 | //--------------------提交订单----------------------- |
| 2052 | - async submitForm(t) { | |
| 2053 | - | |
| 2054 | - | |
| 2055 | - | |
| 2073 | + async submitForm(t){ | |
| 2056 | 2074 | var sub_value = t; |
| 2057 | 2075 | |
| 2058 | 2076 | if (this.data.is_summit_ing == 1) return false; //--提交中退出-- |
| ... | ... | @@ -2178,10 +2196,8 @@ Page({ |
| 2178 | 2196 | 'goods_price': th.data.bn_goods.shop_price, |
| 2179 | 2197 | 'member_goods_price': th.data.bn_goods.shop_price, |
| 2180 | 2198 | 'store_id': oo.stoid, |
| 2181 | - //'prom_type': th.data.bn_goods.prom_type, //促销活动类型 | |
| 2182 | - 'prom_type': 9, //促销活动类型 | |
| 2183 | - 'prom_id': th.data.param.group_id, //促销活动id | |
| 2184 | - // 'prom_id': 118, | |
| 2199 | + 'prom_type': th.data.bn_goods.prom_type, //促销活动类型 | |
| 2200 | + 'prom_id': th.data.bn_goods.prom_id, //促销活动id | |
| 2185 | 2201 | }; |
| 2186 | 2202 | |
| 2187 | 2203 | //-- 把导购的信息填入-- |
| ... | ... | @@ -2445,6 +2461,7 @@ Page({ |
| 2445 | 2461 | //--判断活动的类型-- |
| 2446 | 2462 | switch (g_item.prom_type) { |
| 2447 | 2463 | case 1: |
| 2464 | + case 2: | |
| 2448 | 2465 | goods.prom_type = g_item.prom_type; |
| 2449 | 2466 | goods.prom_id = g_item.prom_id; |
| 2450 | 2467 | break; |
| ... | ... | @@ -2583,42 +2600,19 @@ Page({ |
| 2583 | 2600 | var dd = { |
| 2584 | 2601 | parent_sn: data.data, |
| 2585 | 2602 | store_id: oo.stoid, |
| 2586 | - type: 1, | |
| 2603 | + type: 2, | |
| 2587 | 2604 | }; |
| 2588 | - wx.showLoading({ | |
| 2589 | - title: '支付中', | |
| 2590 | - mask: true, | |
| 2591 | - }); | |
| 2592 | 2605 | a.post("/api/weshop/order/pay/createOrder", { |
| 2593 | 2606 | data: dd, |
| 2594 | - isShowLoading: false, | |
| 2595 | 2607 | success: function (t) { |
| 2596 | 2608 | //console.log(t); |
| 2597 | - wx.hideLoading(); | |
| 2598 | 2609 | if (t.data.code == 0) { |
| 2599 | 2610 | //app.my_warnning("支付成功",1,th); |
| 2600 | 2611 | //setTimeout(function () { |
| 2601 | 2612 | th.setData({isclose: 0}); |
| 2602 | - | |
| 2603 | - wx.showToast({ | |
| 2604 | - title: '支付成功', | |
| 2605 | - icon: 'success', | |
| 2606 | - duration: 2000, | |
| 2607 | - success: function() { | |
| 2608 | - // 幸运购 | |
| 2609 | - setTimeout(function() { | |
| 2610 | - wx.redirectTo({ | |
| 2611 | - url: "/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?type=1&ordersn=" + data.data + "&group_id=" + th.data.param.group_id + "&goods_id=" + th.data.param.goods_id + "&goods_name=" + th.data.bn_goods.goods_name, | |
| 2612 | - }); | |
| 2613 | - }, 0); | |
| 2614 | - | |
| 2615 | - }, | |
| 2616 | - }) | |
| 2617 | - | |
| 2618 | - // wx.redirectTo({ | |
| 2619 | - // url: "/pages/payment/pay_success/pay_success?type=1&order_sn=" + data.data, | |
| 2620 | - // }) | |
| 2621 | - | |
| 2613 | + wx.redirectTo({ | |
| 2614 | + url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, | |
| 2615 | + }) | |
| 2622 | 2616 | //}, 1000) |
| 2623 | 2617 | } |
| 2624 | 2618 | }, |
| ... | ... | @@ -3441,6 +3435,19 @@ Page({ |
| 3441 | 3435 | if (gd.prom_type == 1 || gd.is_gift || gd.prom_type == 7) { |
| 3442 | 3436 | continue; |
| 3443 | 3437 | } |
| 3438 | + | |
| 3439 | + //--如果是团购,要判断有没有限制使用优惠券 | |
| 3440 | + if(gd.prom_type == 2){ | |
| 3441 | + var prom1=null; | |
| 3442 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gd.goods_id + "/" + gd.prom_id, { | |
| 3443 | + }).then(res => { | |
| 3444 | + if (res.data.code == 0) prom1 = res.data.data; | |
| 3445 | + }) | |
| 3446 | + if(!prom1.isQuan){ | |
| 3447 | + continue; | |
| 3448 | + } | |
| 3449 | + } | |
| 3450 | + | |
| 3444 | 3451 | //如果有限制使用优惠券,就要返回 |
| 3445 | 3452 | if (gd.prom_type == 3) { |
| 3446 | 3453 | if (th.data.prom_goods_map[pickup_id][gd.prom_id].is_xz_yh) continue; |
| ... | ... | @@ -3479,6 +3486,7 @@ Page({ |
| 3479 | 3486 | arr[ind].ckeck_quan_price = ckeck_quan_price - cut_price; |
| 3480 | 3487 | arr[ind].check_quan_ware_list = check_quan_ware_list; |
| 3481 | 3488 | arr[ind].check_quan_price_list = check_quan_price_list; |
| 3489 | + arr[ind].is_xz_yh = is_xz_yh; | |
| 3482 | 3490 | |
| 3483 | 3491 | //是否关闭使用优惠券 |
| 3484 | 3492 | if (th.data.is_close_quan != 1 && !is_xz_yh) { |
| ... | ... | @@ -3488,7 +3496,7 @@ Page({ |
| 3488 | 3496 | data: { |
| 3489 | 3497 | storeId: oo.stoid, |
| 3490 | 3498 | userId: app.globalData.user_id, |
| 3491 | - BuySum: ckeck_quan_price, | |
| 3499 | + BuySum: arr[ind].ckeck_quan_price, | |
| 3492 | 3500 | WareIds: check_quan_ware_list, |
| 3493 | 3501 | pageSize: 100 |
| 3494 | 3502 | } |
| ... | ... | @@ -3843,7 +3851,6 @@ Page({ |
| 3843 | 3851 | } |
| 3844 | 3852 | }, |
| 3845 | 3853 | |
| 3846 | - | |
| 3847 | 3854 | //取消使用线下取价 |
| 3848 | 3855 | cancle_offline: function () { |
| 3849 | 3856 | //判断是不是立即购买 | ... | ... |
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.wxml
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | <wxs src="filter.wxs" module="util"></wxs> |
| 3 | 3 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
| 4 | 4 | |
| 5 | -<form bindsubmit="submitConfirm"> | |
| 5 | +<form bindsubmit="submitForm"> | |
| 6 | 6 | <view class="container"> |
| 7 | 7 | |
| 8 | 8 | <!-- 立即购买的时候 --> |
| ... | ... | @@ -268,6 +268,7 @@ |
| 268 | 268 | </view> |
| 269 | 269 | |
| 270 | 270 | <!-- ---商品名称规格---- --> |
| 271 | + <!-- 幸运购 --> | |
| 271 | 272 | <view class="order-num flex-space-between"> |
| 272 | 273 | <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view> |
| 273 | 274 | <view class="goods-num">x{{bn_goods.buynum}}</view> |
| ... | ... | @@ -426,6 +427,7 @@ |
| 426 | 427 | <view>优惠活动</view> |
| 427 | 428 | <view class="co-red">- ¥ {{filters.toFix(formData.cut_price,2)}}元</view> |
| 428 | 429 | </view> |
| 430 | + | |
| 429 | 431 | <!-- 组合购优惠金额 --> |
| 430 | 432 | <view class="item" wx:if="{{formData.zh_cut_price>0 || formData.zh_cut_price<0}}"> |
| 431 | 433 | <view>组合购优惠</view> | ... | ... |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
0 → 100644
| 1 | +var t = getApp(), | |
| 2 | + app = t, | |
| 3 | + a = t.request, | |
| 4 | + e = require("../../../../utils/common.js"), | |
| 5 | + s = require("../../../../utils/util.js"), | |
| 6 | + o = require("../../../../utils/md5.js"), | |
| 7 | + to = getApp(); | |
| 8 | +var oo = t.globalData.setting, | |
| 9 | + os = oo; | |
| 10 | +var regeneratorRuntime = require('../../../../utils/runtime.js'); | |
| 11 | +var util_pay = require("../../../../utils/pay.js"); | |
| 12 | +let self = null; | |
| 13 | + | |
| 14 | +Page({ | |
| 15 | + data: { | |
| 16 | + prom_type: 9, | |
| 17 | + | |
| 18 | + url: t.globalData.setting.url, | |
| 19 | + resourceUrl: t.globalData.setting.resourceUrl, | |
| 20 | + imgUrl: t.globalData.setting.imghost, | |
| 21 | + goods: null, | |
| 22 | + order: null, | |
| 23 | + orderPrices: null, | |
| 24 | + coupons: null, | |
| 25 | + coupon: null, | |
| 26 | + invoiceToggle: !0, | |
| 27 | + payWithUserMoney: !0, | |
| 28 | + payWithPoints: !0, | |
| 29 | + maxWord: 0, | |
| 30 | + enterAddressPage: !1, | |
| 31 | + firstEnter: !0, | |
| 32 | + //页面获取的参数 | |
| 33 | + param: null, | |
| 34 | + postdata: null, | |
| 35 | + //提交订单的格式 | |
| 36 | + formData: { | |
| 37 | + order_amount: 0, //支付金额 | |
| 38 | + total_amount: 0, //总价 | |
| 39 | + all_price: 0, //商品卖的总价 | |
| 40 | + pay_points: 0, //使用积分 | |
| 41 | + user_money: 0, //使用余额 | |
| 42 | + couponCode: "", //使用优惠券(多单就用逗号隔开) | |
| 43 | + shipping_price: 0, //物流费用 | |
| 44 | + }, | |
| 45 | + | |
| 46 | + /*----------------立即购买---------------------*/ | |
| 47 | + is_b_now: 0, //0是购物车结算 1立即购买 | |
| 48 | + bn_goods: null, //立即购买时候的调用商品 | |
| 49 | + bn_use_money: 0, //是否使用余额 | |
| 50 | + bn_exp_type: 1, //0是物流 1自提 | |
| 51 | + bn_pick: 0, //选择的门店 | |
| 52 | + bn_pickname: "", //选择的门店名称 | |
| 53 | + bn_t_exp_t: 0, //判断商品和门店一起决定的物流自提的方式0 都可以 1自提 2物流 | |
| 54 | + /*------------------------*/ | |
| 55 | + user_addr: null, //物流 | |
| 56 | + userinfo: null, //获取会员 | |
| 57 | + /*----------物流选择--------*/ | |
| 58 | + wu_arr: null, | |
| 59 | + index: 0, | |
| 60 | + | |
| 61 | + //判断页面是返回回来的还是 首次进入的 | |
| 62 | + isclose: 1, | |
| 63 | + kt_type: 0, //开团类型 | |
| 64 | + is_pt_tz: 0, //是否开团团长 | |
| 65 | + qh: '', //期号 | |
| 66 | + pt_listno: '', //期号 | |
| 67 | + is_normal: 0, | |
| 68 | + is_express: 0, //选择物流的控制器 | |
| 69 | + yuer: 0, | |
| 70 | + | |
| 71 | + rank_switch: 0, //是不是开同等级卡 | |
| 72 | + show_card: null, //显示的等级卡 | |
| 73 | + card_name: '', //显示的卡的名称 | |
| 74 | + card_cut_price: null, //减价多少钱 | |
| 75 | + }, | |
| 76 | + | |
| 77 | + onLoad: function(t) { | |
| 78 | + | |
| 79 | + // console.log('收到的传参', t); | |
| 80 | + wx.setNavigationBarTitle({ | |
| 81 | + title: '填写订单', | |
| 82 | + }); | |
| 83 | + self = this; | |
| 84 | + this.setData({ | |
| 85 | + is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, | |
| 86 | + param: t, | |
| 87 | + }); | |
| 88 | + | |
| 89 | + var appD = getApp().get_b_now(); | |
| 90 | + | |
| 91 | + this.data.postdata = appD; | |
| 92 | + | |
| 93 | + | |
| 94 | + // 获取幸运购活动团team_id | |
| 95 | + this.get_teamId({ | |
| 96 | + store_id: oo.stoid, | |
| 97 | + user_id: getApp().globalData.user_id, | |
| 98 | + aid: t.group_id, | |
| 99 | + }); | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + //如果期号有值01 | |
| 105 | + // if (appD.qh) { | |
| 106 | + // th.data.qh = appD.qh; | |
| 107 | + // th.data.pt_listno = appD.qh; | |
| 108 | + // } | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + this.setData({//01 | |
| 113 | + // kt_type: appD.kt_type | |
| 114 | + }); | |
| 115 | + | |
| 116 | + // 01 | |
| 117 | + // if (appD.is_pt_tz) th.data.is_pt_tz = appD.is_pt_tz; | |
| 118 | + | |
| 119 | + | |
| 120 | + //先获取物流,再获取用户信息,再展示页面 | |
| 121 | + // this.get_wuliu(th.get_info(th.show_page)); | |
| 122 | + }, | |
| 123 | + | |
| 124 | + onUnload: function() { | |
| 125 | + this.setData({ | |
| 126 | + isclose: 1 | |
| 127 | + }) | |
| 128 | + }, | |
| 129 | + | |
| 130 | + //------获取会员信息-----先获取用户信息,在进行下一步--- | |
| 131 | + get_info: function(func) { | |
| 132 | + var user_id = t.globalData.user_id; | |
| 133 | + to.auth.get_u(func); | |
| 134 | + }, | |
| 135 | + | |
| 136 | + //-------------------获取物流--------------- | |
| 137 | + get_wuliu(func) { | |
| 138 | + var th = this; | |
| 139 | + // console.log("getwuliu4545"); | |
| 140 | + to.getwuliu(function(e) { | |
| 141 | + if (th.data.is_default_logistics) { | |
| 142 | + //如果第一个不是开启默认,说明要让用户自己选 | |
| 143 | + if (!e[0].is_default) { | |
| 144 | + th.setData({ | |
| 145 | + is_default_logistics: 0 | |
| 146 | + }); | |
| 147 | + } | |
| 148 | + } | |
| 149 | + th.setData({ | |
| 150 | + wu_arr: e | |
| 151 | + }) | |
| 152 | + typeof func == "function" && func(); | |
| 153 | + }) | |
| 154 | + }, | |
| 155 | + | |
| 156 | + //------获取会员收货地址----- | |
| 157 | + getuser_addr: function(func) { | |
| 158 | + if (to.globalData.baddr != null) { | |
| 159 | + var user_addr = to.globalData.baddr; | |
| 160 | + to.globalData.baddr = null; | |
| 161 | + func(user_addr); | |
| 162 | + } else { | |
| 163 | + a.get("/api/weshop/useraddress/page", { | |
| 164 | + data: { | |
| 165 | + user_id: to.globalData.user_id, | |
| 166 | + store_id: oo.stoid, | |
| 167 | + pageSize: 600 | |
| 168 | + }, | |
| 169 | + success: function(su) { | |
| 170 | + | |
| 171 | + var user_addr = su.data.data.pageData; | |
| 172 | + var item = null; | |
| 173 | + var def_item = null; | |
| 174 | + for (var i = 0; i < user_addr.length; i++) { | |
| 175 | + if (user_addr[i]['is_default'] == 1) { | |
| 176 | + def_item = user_addr[i]; | |
| 177 | + } | |
| 178 | + if (user_addr[i]['is_pickup'] == 1) { | |
| 179 | + item = user_addr[i]; | |
| 180 | + } | |
| 181 | + } | |
| 182 | + if (item == null) item = def_item; | |
| 183 | + if (item == null) item = user_addr[0]; | |
| 184 | + if (item == undefined) item = null; | |
| 185 | + func(item); | |
| 186 | + } | |
| 187 | + }); | |
| 188 | + } | |
| 189 | + }, | |
| 190 | + //----------------展示页面,是再获取用户信息之后-------------- | |
| 191 | + show_page: function() { | |
| 192 | + var th = this; | |
| 193 | + //th.setData({ userinfo: to.globalData.userInfo}); 会员信息要时时获取 | |
| 194 | + var user = getApp().globalData.userInfo; | |
| 195 | + getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, { | |
| 196 | + data: { | |
| 197 | + r: Math.random() | |
| 198 | + }, | |
| 199 | + success: function(e) { | |
| 200 | + | |
| 201 | + getApp().globalData.userInfo = e.data.data; | |
| 202 | + th.setData({ | |
| 203 | + userinfo: e.data.data | |
| 204 | + }); | |
| 205 | + //获取立即购买的商品信息 | |
| 206 | + th.get_buy_goods(); | |
| 207 | + | |
| 208 | + //获取提现金额 | |
| 209 | + getApp().request.get("/api/weshop/withdrawals/summoney", { | |
| 210 | + data: { | |
| 211 | + user_id: to.globalData.user_id, | |
| 212 | + store_id: oo.stoid, | |
| 213 | + status: 0 | |
| 214 | + }, | |
| 215 | + success: function(su) { | |
| 216 | + if (su.data.code == 0) { | |
| 217 | + var yuer = parseFloat(th.data.userinfo.user_money - | |
| 218 | + (th.data.userinfo.frozen_money > 0 ? th.data.userinfo.frozen_money : 0) - su.data.data.summoney).toFixed( | |
| 219 | + 2); | |
| 220 | + if (yuer < 0) yuer = 0; | |
| 221 | + th.setData({ | |
| 222 | + txmon: su.data.data.summoney, | |
| 223 | + yuer: yuer | |
| 224 | + }); | |
| 225 | + } | |
| 226 | + } | |
| 227 | + }); | |
| 228 | + } | |
| 229 | + }); | |
| 230 | + }, | |
| 231 | + | |
| 232 | + //-----获取立即购买的商品信息---- | |
| 233 | + get_buy_goods: function() { | |
| 234 | + var th = this, | |
| 235 | + a = getApp().request; | |
| 236 | + var gg = th.data.postdata; | |
| 237 | + //调用商品 | |
| 238 | + a.get("/api/weshop/goods/get/" + oo.stoid + "/" + gg.goods_id, { | |
| 239 | + success: function(t) { | |
| 240 | + var gd = t.data.data; | |
| 241 | + if (!gd) return false; | |
| 242 | + | |
| 243 | + t.data.data.original_img = oo.imghost + t.data.data.original_img; | |
| 244 | + t.data.data['buynum'] = gg.goods_num; | |
| 245 | + // console.log(t.data.data); | |
| 246 | + var distr_t = 0, | |
| 247 | + et = 0 | |
| 248 | + if (t.data.data.distr_type == 0) { | |
| 249 | + distr_t = gg.pick_dis; | |
| 250 | + } else { | |
| 251 | + //distr_type配送方式 0=用户自选 1=自提 2=物流 | |
| 252 | + distr_t = t.data.data.distr_type; | |
| 253 | + } | |
| 254 | + switch (distr_t) { | |
| 255 | + case 0: | |
| 256 | + et = 1; | |
| 257 | + //-- 系统后台有设置要默认的 -- | |
| 258 | + if (th.data.json_d.pickupway && th.data.json_d.pickupway == 1) et = 0; | |
| 259 | + break; | |
| 260 | + case 1: | |
| 261 | + et = 1; | |
| 262 | + break; | |
| 263 | + case 2: | |
| 264 | + et = 0; | |
| 265 | + break; | |
| 266 | + } | |
| 267 | + | |
| 268 | + t.data.data.shop_price = gg.goods_price; | |
| 269 | + //--如果是普通购买的时候-- | |
| 270 | + if (gg.is_normal == 1) { | |
| 271 | + t.data.data.prom_id = 0; | |
| 272 | + t.data.data.prom_type = 0; | |
| 273 | + t.data.data.is_normal = 0; | |
| 274 | + | |
| 275 | + var gd = t.data.data; | |
| 276 | + //-- 用商品的手店价来显示 -- | |
| 277 | + gg.goods_price = gd.shop_price; | |
| 278 | + //---是不是购买等级卡成功的返回---等级卡显示的判断--- | |
| 279 | + var is_card_back = getApp().globalData.is_card_back; | |
| 280 | + if (is_card_back) { | |
| 281 | + gg.goods_price = gd[th.data.card_name]; | |
| 282 | + t.data.data.shop_price = gg.goods_price; | |
| 283 | + getApp().globalData.is_card_back = 0; | |
| 284 | + th.setData({ | |
| 285 | + card_cut_price: 0 | |
| 286 | + }); | |
| 287 | + } else { | |
| 288 | + //--- 商品不能是搭配购,商家等级卡开通的情况下, 会员不是等级会员的情况, 商品有设置等级卡价格,同时等级卡价格小于商品的价格 | |
| 289 | + if (th.data.card_name && gd[th.data.card_name] > 0 && gg.goods_price > gd[th.data.card_name] && !th.data.userinfo | |
| 290 | + .card_field) { | |
| 291 | + var cut_p = gg.goods_price - gd[th.data.card_name]; | |
| 292 | + th.setData({ | |
| 293 | + card_cut_price: cut_p | |
| 294 | + }); | |
| 295 | + } | |
| 296 | + } | |
| 297 | + | |
| 298 | + if (th.data.bn_goods) { | |
| 299 | + et = th.data.bn_exp_type; | |
| 300 | + } | |
| 301 | + | |
| 302 | + | |
| 303 | + th.setData({ | |
| 304 | + bn_goods: t.data.data, | |
| 305 | + bn_pickname: gg.pick_name, | |
| 306 | + bn_pick: gg.pick_id, | |
| 307 | + bn_t_exp_t: distr_t, | |
| 308 | + is_normal: 1, | |
| 309 | + bn_exp_type: et | |
| 310 | + }); | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + th.calculatePrice2(); | |
| 315 | + } | |
| 316 | + | |
| 317 | + else { //01 | |
| 318 | + | |
| 319 | + //--阶梯团很特殊,不能用总表来拿价格-- | |
| 320 | + getApp().request.get("/api/weshop/teamlist/get/" + oo.stoid + "/" + gd.prom_id, { | |
| 321 | + success: function(tt) { | |
| 322 | + | |
| 323 | + if (tt.data.code == 0) { | |
| 324 | + var pt_data = tt.data.data; | |
| 325 | + var now = s.gettimestamp(); | |
| 326 | + | |
| 327 | + if (pt_data.is_end == 1) { | |
| 328 | + t.data.data.prom_id = 0; | |
| 329 | + t.data.data.prom_type = 0; | |
| 330 | + // t.data.data.is_normal=1; | |
| 331 | + } else if (now > pt_data.end_time) { | |
| 332 | + t.data.data.prom_id = 0; | |
| 333 | + t.data.data.prom_type = 0; | |
| 334 | + // t.data.data.is_normal=1; | |
| 335 | + } else { | |
| 336 | + t.data.data.shop_price = tt.data.data.price; //活动价格 | |
| 337 | + t.data.data.is_normal = 0; | |
| 338 | + if (pt_data.kttype == 3) { | |
| 339 | + t.data.data.shop_price = tt.data.data.yf_price; //用定金来购买 | |
| 340 | + } | |
| 341 | + } | |
| 342 | + } else { | |
| 343 | + t.data.data.prom_id = 0; | |
| 344 | + t.data.data.prom_type = 0; | |
| 345 | + // t.data.data.is_normal=1; | |
| 346 | + } | |
| 347 | + | |
| 348 | + if (th.data.bn_goods) { | |
| 349 | + et = th.data.bn_exp_type; | |
| 350 | + } | |
| 351 | + | |
| 352 | + th.setData({ | |
| 353 | + bn_goods: t.data.data, | |
| 354 | + bn_pickname: gg.pick_name, | |
| 355 | + bn_pick: gg.pick_id, | |
| 356 | + bn_t_exp_t: distr_t, | |
| 357 | + bn_exp_type: et | |
| 358 | + }); | |
| 359 | + | |
| 360 | + | |
| 361 | + //计算价格 | |
| 362 | + th.calculatePrice2(); | |
| 363 | + } | |
| 364 | + }); | |
| 365 | + } | |
| 366 | + | |
| 367 | + } | |
| 368 | + }); | |
| 369 | + }, | |
| 370 | + | |
| 371 | + //----------子页返回父页触发---------- | |
| 372 | + onShow: function() { | |
| 373 | + var th = this; | |
| 374 | + | |
| 375 | + if (th.data.isclose == 0) { | |
| 376 | + wx.navigateTo({ | |
| 377 | + url: "/pages/index/index/index" | |
| 378 | + }) | |
| 379 | + } else { | |
| 380 | + this.getuser_addr(function(ie) { | |
| 381 | + //更换地址回来要重新调用计算价钱的接口 | |
| 382 | + th.setData({ | |
| 383 | + user_addr: ie | |
| 384 | + }); | |
| 385 | + if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { | |
| 386 | + th.setData({ | |
| 387 | + add_back: 1 | |
| 388 | + }); | |
| 389 | + if (this.data.bn_goods) th.calculatePrice2(); | |
| 390 | + } | |
| 391 | + }) | |
| 392 | + //--更新默认地址--,看一下是不是跳到地址页面 | |
| 393 | + if (!getApp().globalData.is_cart_old) { | |
| 394 | + this.update_code(); | |
| 395 | + } else { | |
| 396 | + getApp().globalData.is_cart_old = 0; | |
| 397 | + } | |
| 398 | + } | |
| 399 | + | |
| 400 | + | |
| 401 | + //先获取是否有关闭使用优惠券 | |
| 402 | + getApp().getConfig2(function(ee) { | |
| 403 | + var json_d = JSON.parse(ee.switch_list); | |
| 404 | + th.data.json_d = json_d; | |
| 405 | + th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 | |
| 406 | + var is_default_logistics = json_d.is_default_logistics; | |
| 407 | + | |
| 408 | + th.setData({ | |
| 409 | + is_close_quan: json_d.is_close_quan, | |
| 410 | + sales_rules: ee.sales_rules, | |
| 411 | + rank_switch: json_d.rank_switch, | |
| 412 | + is_default_logistics: is_default_logistics | |
| 413 | + }); | |
| 414 | + | |
| 415 | + var rank_switch = json_d.rank_switch; | |
| 416 | + var max_price = -1; | |
| 417 | + var show_card = null; | |
| 418 | + var name = ""; | |
| 419 | + //如果有开等级卡的时候, | |
| 420 | + //因为都是调接口,要返回在计算 | |
| 421 | + if (rank_switch == 2) { | |
| 422 | + //-- 获取所有的等级卡, -- | |
| 423 | + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid, {}).then(res => { | |
| 424 | + if (res.data.code == 0) { | |
| 425 | + var plusCard = res.data.data; | |
| 426 | + //-- 循环判断,拿到最贵的那张卡 -- | |
| 427 | + for (var ih in plusCard) { | |
| 428 | + if (plusCard[ih].IsStopBuy == true) { | |
| 429 | + continue; | |
| 430 | + } | |
| 431 | + if (max_price < 0) { | |
| 432 | + max_price = plusCard[ih].CardFee; | |
| 433 | + name = 'card' + plusCard[ih]['CorrPrice']; | |
| 434 | + show_card = plusCard[ih]; | |
| 435 | + } else { | |
| 436 | + if (max_price < plusCard[ih].CardFee) { | |
| 437 | + max_price = plusCard[ih].CardFee; | |
| 438 | + name = 'card' + plusCard[ih]['CorrPrice']; | |
| 439 | + show_card = plusCard[ih]; | |
| 440 | + } | |
| 441 | + } | |
| 442 | + } | |
| 443 | + | |
| 444 | + if (show_card) { | |
| 445 | + name = name.toLowerCase(); | |
| 446 | + th.setData({ | |
| 447 | + card_name: name, | |
| 448 | + show_card: show_card | |
| 449 | + }) | |
| 450 | + } | |
| 451 | + } | |
| 452 | + //-----先获取物流,再获取用户信息,再展示页面----- | |
| 453 | + th.get_wuliu(th.get_info(th.show_page)); | |
| 454 | + }) | |
| 455 | + } else { | |
| 456 | + //-----先获取物流,再获取用户信息,再展示页面----- | |
| 457 | + th.get_wuliu(th.get_info(th.show_page)); | |
| 458 | + } | |
| 459 | + }, 1) | |
| 460 | + | |
| 461 | + }, | |
| 462 | + //---------------检查是否有收货地址------------------- | |
| 463 | + checkAddressList: function() { | |
| 464 | + var t = this; | |
| 465 | + return !(!this.data.order || null == this.data.order.userAddress) || (wx.showModal({ | |
| 466 | + title: "请先填写或选择收货地址~", | |
| 467 | + success: function(a) { | |
| 468 | + a.confirm ? t.enterAddressPage() : wx.navigateBack(); | |
| 469 | + }, | |
| 470 | + fail: function() { | |
| 471 | + wx.navigateBack(); | |
| 472 | + } | |
| 473 | + }), !1); | |
| 474 | + }, | |
| 475 | + showInvoice: function() { | |
| 476 | + this.setData({ | |
| 477 | + invoiceToggle: !this.data.invoiceToggle | |
| 478 | + }); | |
| 479 | + }, | |
| 480 | + keyUpChangePay1: function(t) { | |
| 481 | + this.setData({ | |
| 482 | + payWithUserMoney: !(t.detail.value.length > 0) | |
| 483 | + }); | |
| 484 | + }, | |
| 485 | + keyUpChangePay2: function(t) { | |
| 486 | + this.setData({ | |
| 487 | + payWithPoints: !(t.detail.value.length > 0) | |
| 488 | + }); | |
| 489 | + }, | |
| 490 | + keyUpChangeNum: function(t) { | |
| 491 | + this.setData({ | |
| 492 | + maxWord: t.detail.value.length | |
| 493 | + }); | |
| 494 | + }, | |
| 495 | + //---------计算立即购买---------- | |
| 496 | + calculatePrice2: function() { | |
| 497 | + console.log('calculatePrice2'); | |
| 498 | + var th = this, | |
| 499 | + good = this.data.bn_goods; | |
| 500 | + //-----------计算商品总价-------------- | |
| 501 | + var allpice = good.shop_price * good.buynum; | |
| 502 | + allpice = parseFloat(allpice).toFixed(2); | |
| 503 | + var txt = "formData.all_price"; | |
| 504 | + th.setData({ | |
| 505 | + [txt]: allpice, | |
| 506 | + }); | |
| 507 | + console.log(th.data.formData); | |
| 508 | + | |
| 509 | + to.getConfig2(function(ee) { | |
| 510 | + to.getwuliuprice(function(rs) { | |
| 511 | + console.log('calculatePrice2222'); | |
| 512 | + console.log(rs); | |
| 513 | + var o_shipping_price = 0, | |
| 514 | + goods_weight = -1, | |
| 515 | + goods_piece = -1; | |
| 516 | + //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格---------- | |
| 517 | + if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && (th.data.kt_type != | |
| 518 | + 3 || th.data.bn_goods.is_normal == 1)) { | |
| 519 | + switch (good['exp_sum_type']) { | |
| 520 | + case 1: | |
| 521 | + //统一运费 | |
| 522 | + o_shipping_price += good['uniform_exp_sum']; | |
| 523 | + break; | |
| 524 | + case 2: | |
| 525 | + if (goods_weight < 0) goods_weight = 0; | |
| 526 | + //累积商品重量 每种商品的重量 * 数量 | |
| 527 | + goods_weight += good['weight'] * good['buynum']; | |
| 528 | + break; | |
| 529 | + case 3: | |
| 530 | + if (goods_piece < 0) goods_piece = 0; | |
| 531 | + //累积商品数量 | |
| 532 | + goods_piece += good['buynum']; | |
| 533 | + break; | |
| 534 | + } | |
| 535 | + | |
| 536 | + console.log(o_shipping_price + ":" + goods_weight + ":" + goods_piece); | |
| 537 | + console.log(th.data.wu_arr); | |
| 538 | + var code = th.data.wu_arr[th.data.index].code; | |
| 539 | + var freight_free = ee.freight_free; //全场满多少包邮 | |
| 540 | + var shipping_price = | |
| 541 | + th.calculatewuliu(code, o_shipping_price, goods_weight, | |
| 542 | + goods_piece, th.data.user_addr, freight_free, allpice, rs); | |
| 543 | + | |
| 544 | + shipping_price = parseFloat(shipping_price).toFixed(2); | |
| 545 | + var wl_txt = "formData.shipping_price"; | |
| 546 | + th.setData({ | |
| 547 | + [wl_txt]: shipping_price, | |
| 548 | + }) | |
| 549 | + | |
| 550 | + } else { | |
| 551 | + var wl_txt = "formData.shipping_price"; | |
| 552 | + th.setData({ | |
| 553 | + [wl_txt]: 0, | |
| 554 | + }) | |
| 555 | + } | |
| 556 | + //-----------------总价----------------- | |
| 557 | + // 幸运购 01 | |
| 558 | + // var total_m = parseFloat(allpice) + parseFloat( th.data.formData.shipping_price); | |
| 559 | + var total_m = parseFloat(th.data.param.goods_price) + parseFloat(th.data.formData.shipping_price); | |
| 560 | + total_m = parseFloat(total_m).toFixed(2); | |
| 561 | + | |
| 562 | + var atxt = "formData.total_amount"; | |
| 563 | + th.setData({ | |
| 564 | + [atxt]: total_m, | |
| 565 | + }) | |
| 566 | + var order_m = total_m; | |
| 567 | + | |
| 568 | + var txt = "formData.user_money"; | |
| 569 | + var txt2 = "formData.order_amount"; | |
| 570 | + //--------------如果使用余额--------------------- | |
| 571 | + if (th.data.bn_use_money == 1 && th.data.yuer > 0) { | |
| 572 | + if (parseFloat(th.data.yuer) > total_m) { | |
| 573 | + th.setData({ | |
| 574 | + [txt]: total_m, | |
| 575 | + [txt2]: 0 | |
| 576 | + }) | |
| 577 | + } else { | |
| 578 | + order_m = parseFloat(order_m) - parseFloat(th.data.yuer); | |
| 579 | + order_m = order_m.toFixed(2); | |
| 580 | + th.setData({ | |
| 581 | + [txt]: th.data.yuer, | |
| 582 | + [txt2]: order_m | |
| 583 | + }) | |
| 584 | + } | |
| 585 | + } else { | |
| 586 | + th.setData({ | |
| 587 | + [txt]: 0, | |
| 588 | + [txt2]: order_m | |
| 589 | + }) | |
| 590 | + } | |
| 591 | + | |
| 592 | + }); | |
| 593 | + }); | |
| 594 | + }, | |
| 595 | + | |
| 596 | + | |
| 597 | + // 提交订单前弹出确认对话框 | |
| 598 | + submitConfirm(e) { | |
| 599 | + // is_show为0不显示温馨提示,为1显示温馨提示 | |
| 600 | + if(this.data.param.is_show == 1) { | |
| 601 | + wx.showModal({ | |
| 602 | + title: '温馨提示', | |
| 603 | + content: this.data.param.alert, | |
| 604 | + success(res) { | |
| 605 | + if (res.confirm) { | |
| 606 | + console.log('用户点击确定'); | |
| 607 | + self.submitForm(e); | |
| 608 | + } else if (res.cancel) { | |
| 609 | + console.log('用户点击取消'); | |
| 610 | + } | |
| 611 | + } | |
| 612 | + }); | |
| 613 | + } else { | |
| 614 | + this.submitForm(e); | |
| 615 | + }; | |
| 616 | + | |
| 617 | + }, | |
| 618 | + | |
| 619 | + | |
| 620 | + //--------------------提交订单----------------------- | |
| 621 | + submitForm: async function(t) { | |
| 622 | + if (this.data.is_summit_ing == 1) return false; //--提交中退出-- | |
| 623 | + this.data.is_summit_ing = 1; | |
| 624 | + | |
| 625 | + var th = this, | |
| 626 | + pdata = new Array(); | |
| 627 | + var ff = true; | |
| 628 | + //------------立即购买------------- | |
| 629 | + // console.log("buy_new"); | |
| 630 | + | |
| 631 | + //如果不是阶梯团,或者是普通购买,商家选择了物流,以及地址为空的时候 | |
| 632 | + if (th.data.bn_exp_type == 0 && th.data.user_addr == null && (th.data.kt_type != 3 || th.data.bn_goods.is_normal == | |
| 633 | + 1)) { | |
| 634 | + ff = false; | |
| 635 | + getApp().my_warnning("请选择收货地址", 0, this); | |
| 636 | + this.data.is_summit_ing = 0; | |
| 637 | + } | |
| 638 | + if (!ff) return false; | |
| 639 | + var addr = th.data.user_addr; | |
| 640 | + if (th.data.bn_exp_type == 1) addr = null; | |
| 641 | + | |
| 642 | + console.log(th.data.formData); | |
| 643 | + console.log(th.data.wu_arr); | |
| 644 | + console.log(th.data.bn_exp_type); | |
| 645 | + | |
| 646 | + if (th.data.bn_exp_type == 0 && (th.data.kt_type != 3 || th.data.bn_goods.is_normal == 1)) { | |
| 647 | + if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { | |
| 648 | + getApp().my_warnning("读取物流失败", 0, this); | |
| 649 | + this.data.is_summit_ing = 0; | |
| 650 | + return false; | |
| 651 | + } | |
| 652 | + } | |
| 653 | + | |
| 654 | + //阶梯团强制带1,自提~~~01 | |
| 655 | + // if (th.data.kt_type == 3) { | |
| 656 | + // th.data.bn_exp_type = 1; | |
| 657 | + // } | |
| 658 | + | |
| 659 | + var item = { | |
| 660 | + 'user_id': to.globalData.user_id, | |
| 661 | + 'consignee': addr == null ? "" : addr.consignee, | |
| 662 | + 'province': addr == null ? 0 : addr.province, | |
| 663 | + 'city': addr == null ? 0 : addr.city, | |
| 664 | + 'district': addr == null ? 0 : addr.district, | |
| 665 | + 'twon': addr == null ? 0 : addr.twon, | |
| 666 | + 'address': addr == null ? "" : addr.address, | |
| 667 | + 'more_address': addr == null ? "" : addr.more_address, | |
| 668 | + 'mobile': addr == null ? th.data.userinfo.mobile : addr.mobile, | |
| 669 | + 'email': '', | |
| 670 | + 'invoice_title': '', | |
| 671 | + 'goods_price': th.data.param.goods_price, //商品总价 | |
| 672 | + //'goods_price': th.data.formData.all_price, //商品总价 | |
| 673 | + 'shipping_price': th.data.formData.shipping_price, //物流金额 | |
| 674 | + 'shipping_code': th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code, | |
| 675 | + 'shipping_name': th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name, | |
| 676 | + 'user_money': th.data.formData.user_money, //使用余额 | |
| 677 | + 'total_amount': th.data.formData.total_amount, //订单总价 | |
| 678 | + 'order_amount': th.data.formData.order_amount, //应付 | |
| 679 | + 'user_note': t.detail.value.user_note, //用户备注 | |
| 680 | + 'store_id': oo.stoid, //商家 | |
| 681 | + 'pickup_id': th.data.bn_pick, //门店 | |
| 682 | + 'exp_type': th.data.bn_exp_type, //配送方式 | |
| 683 | + 'is_normal': th.data.bn_goods.is_normal, //是否是普通购买 | |
| 684 | + //'pt_prom_id': th.data.bn_goods.prom_id, //拼单ID 01 | |
| 685 | + //'is_pt_tz': th.data.is_pt_tz, //开团类型 01 | |
| 686 | + 'order_goods': new Array(), | |
| 687 | + }; | |
| 688 | + | |
| 689 | + //如果不是阶梯团,或者是普通购买,01 | |
| 690 | + // if ((th.data.kt_type != 3 || th.data.bn_goods.is_normal == 1)) { | |
| 691 | + if (th.data.bn_goods.is_normal == 1) { | |
| 692 | + item['shipping_code'] = th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code; | |
| 693 | + item['shipping_name'] = th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name; | |
| 694 | + } | |
| 695 | + | |
| 696 | + // if (!th.data.bn_goods.is_normal) { | |
| 697 | + // item.is_zsorder = th.data.kt_type + 1; //开团类型 01 | |
| 698 | + // } | |
| 699 | + | |
| 700 | + | |
| 701 | + //老会员成为分销下线需要的参数 | |
| 702 | + if (getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader) { | |
| 703 | + //判断一下分享人是不是分享商 | |
| 704 | + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.first_leader, {}).then( | |
| 705 | + res => { | |
| 706 | + if (res.data.code == 0) { | |
| 707 | + var user = res.data.data; | |
| 708 | + if (user.is_distribut == 1) { | |
| 709 | + item.first_leader = parseInt(getApp().globalData.first_leader); | |
| 710 | + } | |
| 711 | + } | |
| 712 | + }) | |
| 713 | + } | |
| 714 | + | |
| 715 | + if (th.data.qh != '') { | |
| 716 | + item.team_qh = th.data.qh; | |
| 717 | + item.pt_listno = th.data.qh; | |
| 718 | + } | |
| 719 | + | |
| 720 | + | |
| 721 | + var gg = to.get_b_now(); | |
| 722 | + var goods = { | |
| 723 | + 'goods_id': gg.goods_id, | |
| 724 | + 'goods_name': gg.goods_name, | |
| 725 | + 'goods_sn': gg.goods_sn, | |
| 726 | + 'goods_num': gg.goods_num, | |
| 727 | + 'market_price': th.data.bn_goods.market_price, | |
| 728 | + 'goods_price': th.data.param.goods_price, | |
| 729 | + // 'goods_price': th.data.bn_goods.shop_price, | |
| 730 | + 'member_goods_price': th.data.bn_goods.shop_price, | |
| 731 | + 'store_id': oo.stoid, | |
| 732 | + // 'prom_type':th.data.bn_goods.prom_type, //促销活动类型 01 | |
| 733 | + // 'prom_id': th.data.bn_goods.prom_id, //促销活动id 01 | |
| 734 | + | |
| 735 | + 'prom_type': 9, //促销活动类型 | |
| 736 | + 'prom_id': th.data.param.group_id, //促销活动id | |
| 737 | + }; | |
| 738 | + | |
| 739 | + //--导购分享过来的id-- | |
| 740 | + if (gg.guide_id) { | |
| 741 | + goods.guide_id = gg.guide_id; | |
| 742 | + goods.guide_type = gg.guide_type; | |
| 743 | + //调用接口判断是不是会员 | |
| 744 | + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => { | |
| 745 | + if (res.data.code == 0) { | |
| 746 | + goods.guide_name = res.data.data.salesman; | |
| 747 | + goods.guide_sn = res.data.data.salesman_no; | |
| 748 | + } | |
| 749 | + }) | |
| 750 | + } | |
| 751 | + | |
| 752 | + //--商品的房间号-- | |
| 753 | + if (gg.room_id && gg.room_id > 0) { | |
| 754 | + item.room_ids = gg.room_id; | |
| 755 | + goods.room_id = gg.room_id; | |
| 756 | + } | |
| 757 | + | |
| 758 | + // if (th.data.bn_goods.is_normal) { | |
| 759 | + // goods.is_pd_normal = 0; | |
| 760 | + // } | |
| 761 | + | |
| 762 | + item.order_goods.push(goods); | |
| 763 | + pdata.push(item); | |
| 764 | + | |
| 765 | + if (pdata.length == 0) return; | |
| 766 | + var str = JSON.stringify(pdata); | |
| 767 | + console.log("支付数据"); | |
| 768 | + console.log(str); | |
| 769 | + //return false; | |
| 770 | + wx.showLoading({ | |
| 771 | + title: "加载中" | |
| 772 | + }); | |
| 773 | + wx.request({ | |
| 774 | + url: oo.url + '/api/weshop/order/createWxdOrder', | |
| 775 | + data: str, | |
| 776 | + method: 'POST', | |
| 777 | + header: { | |
| 778 | + 'content-type': 'application/json' | |
| 779 | + }, // 设置请求的 header | |
| 780 | + success: function(res) { | |
| 781 | + | |
| 782 | + wx.hideLoading(); | |
| 783 | + if (res.statusCode == 200) { | |
| 784 | + var data = res.data; | |
| 785 | + if (data.code == 0) { | |
| 786 | + console.log(th.data.is_b_now); | |
| 787 | + //如果是购物车结算,还要删除购物车 | |
| 788 | + if (th.data.is_b_now == 0) { | |
| 789 | + console.log(th.data.cartlist_y); | |
| 790 | + var list = th.data.cartlist_y; | |
| 791 | + for (var i = 0; i < list.length; i++) { | |
| 792 | + //删除购物车 | |
| 793 | + getApp().request.delete("/api/weshop/cart/del/" + oo.stoid + "/" + list[i].id, {}); | |
| 794 | + } | |
| 795 | + } | |
| 796 | + var order_amount = 0; | |
| 797 | + pdata.forEach(function(em, ind) { | |
| 798 | + order_amount += em.order_amount; | |
| 799 | + }) | |
| 800 | + //要进行判断,如果是用微信支付,就要跳转到支付界面 | |
| 801 | + if (order_amount > 0) { | |
| 802 | + th.setData({ | |
| 803 | + isclose: 0 | |
| 804 | + }); | |
| 805 | + //void e.jumpToCart4({ | |
| 806 | + // order_sn: data.data, | |
| 807 | + // type:1, | |
| 808 | + // }, 1); | |
| 809 | + util_pay.pay(data.data, function() { | |
| 810 | + setTimeout(function() { | |
| 811 | + // wx.reLaunch({ | |
| 812 | + // //url: "/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data, | |
| 813 | + // url: "/pages/team/team_success/team_success?ordersn=" + data.data, | |
| 814 | + // }) | |
| 815 | + | |
| 816 | + wx.redirectTo({ | |
| 817 | + url: "/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?type=1&ordersn=" + data.data + | |
| 818 | + "&group_id=" + th.data.param.group_id + "&goods_id=" + th.data.param.goods_id + | |
| 819 | + "&goods_name=" + th.data.bn_goods.goods_name, | |
| 820 | + }); | |
| 821 | + | |
| 822 | + }, 1000) | |
| 823 | + }, function() { | |
| 824 | + //支付失败 | |
| 825 | + setTimeout(function() { | |
| 826 | + //wx.navigateBack({ delta: 1 }) | |
| 827 | + wx.reLaunch({ | |
| 828 | + url: "/pages/user/order_list/order_list", | |
| 829 | + }) | |
| 830 | + }, 1000) | |
| 831 | + | |
| 832 | + }, oo.stoid, 1); | |
| 833 | + | |
| 834 | + } else { | |
| 835 | + var dd = { | |
| 836 | + parent_sn: data.data, | |
| 837 | + store_id: oo.stoid, | |
| 838 | + type: 1, | |
| 839 | + }; | |
| 840 | + wx.showLoading({ | |
| 841 | + title: '支付中', | |
| 842 | + mask: true, | |
| 843 | + }); | |
| 844 | + //return false; | |
| 845 | + getApp().request.post("/api/weshop/order/pay/createOrder", { | |
| 846 | + data: dd, | |
| 847 | + success: function(t) { | |
| 848 | + // console.log(t); | |
| 849 | + // app.my_warnning("支付成功",1,th); | |
| 850 | + wx.hideLoading(); | |
| 851 | + if (t.data.code == 0) { | |
| 852 | + | |
| 853 | + // setTimeout(function () { | |
| 854 | + th.setData({ | |
| 855 | + isclose: 0 | |
| 856 | + }); | |
| 857 | + | |
| 858 | + wx.showToast({ | |
| 859 | + title: '支付成功', | |
| 860 | + icon: 'success', | |
| 861 | + duration: 2000, | |
| 862 | + success: function() { | |
| 863 | + // 幸运购 | |
| 864 | + setTimeout(function() { | |
| 865 | + wx.redirectTo({ | |
| 866 | + url: "/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?type=1&ordersn=" + data.data + | |
| 867 | + "&group_id=" + th.data.param.group_id + "&goods_id=" + th.data.param.goods_id + | |
| 868 | + "&goods_name=" + th.data.bn_goods.goods_name, | |
| 869 | + }); | |
| 870 | + }, 0); | |
| 871 | + | |
| 872 | + }, | |
| 873 | + }) | |
| 874 | + | |
| 875 | + | |
| 876 | + // if(th.data.is_normal==1){ | |
| 877 | + // /*-- | |
| 878 | + // wx.navigateTo({ | |
| 879 | + // url: "/pages/user/order_list/order_list", | |
| 880 | + // })--*/ | |
| 881 | + | |
| 882 | + // // var url="/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data; | |
| 883 | + // // wx.reLaunch({ | |
| 884 | + // // url: url | |
| 885 | + // // }) | |
| 886 | + | |
| 887 | + // }else{ | |
| 888 | + // // wx.reLaunch({ | |
| 889 | + // // url: "/pages/team/team_success/team_success?ordersn=" + data.data, | |
| 890 | + // // }) | |
| 891 | + // } | |
| 892 | + | |
| 893 | + | |
| 894 | + // }, 1000) | |
| 895 | + | |
| 896 | + } else { | |
| 897 | + wx.showToast({ | |
| 898 | + title: t.data.msg, | |
| 899 | + icon: 'none', | |
| 900 | + duration: 2000, | |
| 901 | + success: function() { | |
| 902 | + | |
| 903 | + // wx.reLaunch({ | |
| 904 | + // url: "/pages/user/order_list/order_list", | |
| 905 | + // }) | |
| 906 | + | |
| 907 | + }, | |
| 908 | + }) | |
| 909 | + }; | |
| 910 | + | |
| 911 | + | |
| 912 | + } | |
| 913 | + }); | |
| 914 | + } | |
| 915 | + } else { | |
| 916 | + th.data.is_summit_ing = 0; //是否提交中 | |
| 917 | + getApp().confirmBox(data.msg); | |
| 918 | + } | |
| 919 | + } else { | |
| 920 | + th.data.is_summit_ing = 0; //是否提交中 | |
| 921 | + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode); | |
| 922 | + } | |
| 923 | + }, | |
| 924 | + fail: function() { | |
| 925 | + th.data.is_summit_ing = 0; //是否提交中 | |
| 926 | + wx.hideLoading(); | |
| 927 | + console.log("index.js wx.request CheckCallUser fail"); | |
| 928 | + }, | |
| 929 | + complete: function() {} | |
| 930 | + }) | |
| 931 | + }, | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + useCoupon: function() { | |
| 938 | + if (this.data.order.couponNum <= 0) { | |
| 939 | + //return t.showWarning("无可用优惠券"); | |
| 940 | + getApp().my_warnning("无可用优惠券", 0, this); | |
| 941 | + return; | |
| 942 | + } | |
| 943 | + var a = { | |
| 944 | + lid: this.data.coupon ? this.data.coupon.id : "0" | |
| 945 | + }; | |
| 946 | + wx.navigateTo({ | |
| 947 | + url: "/pages/user/checkcoupon/checkcoupon?" + s.Obj2Str(a) | |
| 948 | + }); | |
| 949 | + }, | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + enterAddressPage: function() { | |
| 955 | + getApp().globalData.is_cart_old = 1; | |
| 956 | + this.data.enterAddressPage = !0, wx.navigateTo({ | |
| 957 | + url: "/pages/user/address_list/address_list" | |
| 958 | + }); | |
| 959 | + }, | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + //--------立即购买时,选择自提和物流----------- | |
| 965 | + setexptype_w: function(t) { | |
| 966 | + var th = this; | |
| 967 | + var ty = t.currentTarget.dataset.t, | |
| 968 | + txt = t.currentTarget.dataset.txt; | |
| 969 | + th.setData({ | |
| 970 | + [txt]: ty | |
| 971 | + }); | |
| 972 | + var iszt = 1; | |
| 973 | + if (ty == 0) { | |
| 974 | + th.setData({ | |
| 975 | + is_all_zt: 0 | |
| 976 | + }); | |
| 977 | + } else { | |
| 978 | + for (var i = 0; i < th.data.cartlist.length; i++) { | |
| 979 | + var item = th.data.cartlist[i]; | |
| 980 | + if (item.exp_type == 0) { | |
| 981 | + iszt = 0; | |
| 982 | + break; | |
| 983 | + } | |
| 984 | + } | |
| 985 | + th.setData({ | |
| 986 | + is_all_zt: iszt | |
| 987 | + }); | |
| 988 | + } | |
| 989 | + //----计算此时购物车的价格---- | |
| 990 | + th.calculatePrice(); | |
| 991 | + }, | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + //--------立即购买时,选择自提和物流---------- | |
| 997 | + setexptype: function(t) { | |
| 998 | + var th = this; | |
| 999 | + var ty = t.currentTarget.dataset.t; | |
| 1000 | + th.setData({ | |
| 1001 | + bn_exp_type: ty | |
| 1002 | + }); | |
| 1003 | + //当物流为空的时候。 | |
| 1004 | + if (ty == 0 && th.data.wu_arr == null) { | |
| 1005 | + return th.get_wuliu(th.calculatePrice2()); | |
| 1006 | + } | |
| 1007 | + th.calculatePrice2() | |
| 1008 | + console.log('setexptype'); | |
| 1009 | + }, | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + //--------立即购买时,使用余额-------- | |
| 1015 | + set_bn_useyuer: function() { | |
| 1016 | + var th = this; | |
| 1017 | + th.setData({ | |
| 1018 | + bn_use_money: !th.data.bn_use_money | |
| 1019 | + }); | |
| 1020 | + th.calculatePrice2(); | |
| 1021 | + }, | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + set_js_useyuer: function() { | |
| 1028 | + var th = this; | |
| 1029 | + th.setData({ | |
| 1030 | + js_use_money: !th.data.js_use_money | |
| 1031 | + }); | |
| 1032 | + th.calculatePrice(); | |
| 1033 | + }, | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + //-------------------计算物流--------------- | |
| 1039 | + calculatewuliu: function(code, o_shipping_price, goods_weight, | |
| 1040 | + goods_piece, user_addr, freight_free, o_price, rs) { | |
| 1041 | + var price = 0, | |
| 1042 | + th = this; | |
| 1043 | + price += parseFloat(o_shipping_price); | |
| 1044 | + //如果是包邮 | |
| 1045 | + if (freight_free > 0 && o_price > freight_free) { | |
| 1046 | + return 0; | |
| 1047 | + } | |
| 1048 | + if (user_addr == null) { | |
| 1049 | + return 0; | |
| 1050 | + } | |
| 1051 | + //计算物流的config item; | |
| 1052 | + var item = null; | |
| 1053 | + //先根据 镇 县 区找计算的config | |
| 1054 | + item = th.get_wuliu_config(user_addr.district, code, rs); | |
| 1055 | + if (item == null) item = th.get_wuliu_config(user_addr.city, code, rs); | |
| 1056 | + if (item == null) item = th.get_wuliu_config(user_addr.province, code, rs); | |
| 1057 | + if (item == null) item = th.get_wuliu_default(code, rs); | |
| 1058 | + if (item == null) return o_shipping_price; | |
| 1059 | + var fw_price = 0, | |
| 1060 | + fp_price = 0; | |
| 1061 | + item = item.config; | |
| 1062 | + if (item == null) return o_shipping_price; | |
| 1063 | + //------按重量---------- | |
| 1064 | + if (goods_weight > 0) { | |
| 1065 | + fw_price = parseFloat(item['money']); | |
| 1066 | + if (goods_weight > item['first_weight']) { | |
| 1067 | + var fw = goods_weight - item['first_weight']; | |
| 1068 | + var n = Math.ceil(fw / item['second_weight']) | |
| 1069 | + fw_price = fw_price + n * parseFloat(item['add_money']); | |
| 1070 | + } | |
| 1071 | + } | |
| 1072 | + //------按件数---------- | |
| 1073 | + if (goods_piece > 0) { | |
| 1074 | + fp_price = parseFloat(item['piecemoney']); | |
| 1075 | + if (goods_piece > item['first_piece']) { | |
| 1076 | + var fp = goods_piece - item['first_piece']; | |
| 1077 | + var m = Math.ceil(fp / item['second_piece']) | |
| 1078 | + fp_price = fp_price + m * parseFloat(item['add_piecemoney']); | |
| 1079 | + } | |
| 1080 | + } | |
| 1081 | + var rspice = parseFloat(price + fw_price + fp_price); | |
| 1082 | + return rspice; | |
| 1083 | + }, | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + //------------循环获取config----------- | |
| 1088 | + get_wuliu_config: function(region_id, code, rs) { | |
| 1089 | + var item = null, | |
| 1090 | + rslist = rs.pageData; | |
| 1091 | + for (var i = 0; i < rslist.length; i++) { | |
| 1092 | + if (rslist[i].code == code && rslist[i].region_id == region_id) { | |
| 1093 | + item = rslist[i]; | |
| 1094 | + } | |
| 1095 | + } | |
| 1096 | + return item; | |
| 1097 | + }, | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + //-------循环获取config,code default------- | |
| 1103 | + get_wuliu_default: function(code, rs) { | |
| 1104 | + var item = null, | |
| 1105 | + rslist = rs.pageData; | |
| 1106 | + for (var i = 0; i < rslist.length; i++) { | |
| 1107 | + if (rslist[i].shipping_code == code && rslist[i].is_default == 1) { | |
| 1108 | + item = rslist[i]; | |
| 1109 | + } | |
| 1110 | + } | |
| 1111 | + return item; | |
| 1112 | + }, | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + //----------立即购买,选择物流------------- | |
| 1120 | + bindPickerChange: function(e) { | |
| 1121 | + var ind = e.detail.value | |
| 1122 | + this.setData({ | |
| 1123 | + index: ind | |
| 1124 | + }); | |
| 1125 | + this.calculatePrice2(); | |
| 1126 | + }, | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + //----------购物车结算,选择物流------------- 01 | |
| 1133 | + // bindPickerChange_w: function(e) { | |
| 1134 | + // var ind = e.detail.value, | |
| 1135 | + // txt = e.currentTarget.dataset.txt; | |
| 1136 | + // this.setData({ | |
| 1137 | + // [txt]: ind | |
| 1138 | + // }); | |
| 1139 | + // this.calculatePrice(); | |
| 1140 | + // }, | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + cart_set_err: function(e) { | |
| 1146 | + var txt = e.currentTarget.dataset.err; | |
| 1147 | + var ob = {}; | |
| 1148 | + ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; | |
| 1149 | + this.setData(ob); | |
| 1150 | + }, | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + // 开启物流的弹窗 | |
| 1156 | + show_wu_arr: function(e) { | |
| 1157 | + this.setData({ | |
| 1158 | + open_express: 1 | |
| 1159 | + }); | |
| 1160 | + }, | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + //更新下默认,在onshow里面 | |
| 1165 | + update_code() { | |
| 1166 | + var th = this, | |
| 1167 | + m_wind = 0, | |
| 1168 | + def_exp_code = getApp().globalData.userInfo.def_exp_code; | |
| 1169 | + | |
| 1170 | + var uii = setInterval(function() { | |
| 1171 | + if (th.data.wu_arr) { | |
| 1172 | + clearInterval(uii); | |
| 1173 | + for (var k = 0; k < th.data.wu_arr.length; k++) { | |
| 1174 | + var item = th.data.wu_arr[k]; | |
| 1175 | + if (def_exp_code == item.code) { | |
| 1176 | + m_wind = k; | |
| 1177 | + } | |
| 1178 | + } | |
| 1179 | + //--如果是立即购买-- | |
| 1180 | + th.setData({ | |
| 1181 | + index: m_wind, | |
| 1182 | + is_express: m_wind | |
| 1183 | + }); | |
| 1184 | + } | |
| 1185 | + }, 500) | |
| 1186 | + }, | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + // 关闭物流的弹窗 | |
| 1191 | + close_express: function() { | |
| 1192 | + this.setData({ | |
| 1193 | + open_express: 0 | |
| 1194 | + }); | |
| 1195 | + }, | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + // 选择物流 | |
| 1201 | + click_express_name: function(e) { | |
| 1202 | + var express_name = e.currentTarget.dataset.name, | |
| 1203 | + shippingcode = e.currentTarget.dataset.shippingcode; | |
| 1204 | + var index = e.currentTarget.dataset.idxe; | |
| 1205 | + var ob = { | |
| 1206 | + is_express: index, | |
| 1207 | + is_shipping_code: shippingcode, | |
| 1208 | + index: index | |
| 1209 | + }; | |
| 1210 | + this.setData(ob); | |
| 1211 | + }, | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + //点击确定物流 | |
| 1217 | + determine_expres: function(e) { | |
| 1218 | + this.setData({ | |
| 1219 | + open_express: 0 | |
| 1220 | + }); | |
| 1221 | + this.calculatePrice2(); | |
| 1222 | + }, | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + //设置默认物流 | |
| 1228 | + select_default_logistics: function() { | |
| 1229 | + var th = this; | |
| 1230 | + var is_shipping_code = this.data.is_shipping_code | |
| 1231 | + getApp().request.put("/api/weshop/users/update", { | |
| 1232 | + data: { | |
| 1233 | + user_id: getApp().globalData.user_id, | |
| 1234 | + store_id: oo.stoid, | |
| 1235 | + def_exp_code: is_shipping_code | |
| 1236 | + }, | |
| 1237 | + success: function(rse) { | |
| 1238 | + if (rse.data.code == 0) { | |
| 1239 | + getApp().globalData.userInfo.def_exp_code = is_shipping_code; | |
| 1240 | + th.setData({ | |
| 1241 | + open_express: 0 | |
| 1242 | + }); | |
| 1243 | + //----计算此时购物车的价格,这个页面没有calculatePrice(),2021.7.19---- | |
| 1244 | + //if(th.data.is_b_now==1) th.calculatePrice2(); | |
| 1245 | + //else th.calculatePrice(); | |
| 1246 | + th.calculatePrice2(); | |
| 1247 | + } | |
| 1248 | + } | |
| 1249 | + }) | |
| 1250 | + }, | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + //跳转到购买卡 | |
| 1256 | + buycard: function() { | |
| 1257 | + getApp().goto("/pages/user/plus/plus"); | |
| 1258 | + getApp().globalData.plus_buy_back = 1; | |
| 1259 | + }, | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + // 获取team_id | |
| 1263 | + get_teamId(options) { | |
| 1264 | + let aid = options.aid; | |
| 1265 | + let store_id = options.store_id; | |
| 1266 | + let user_id = options.user_id; | |
| 1267 | + let url = `/api/weshop/prom/luckyActivity/page?store_id=${store_id}&is_end=0&timetype=1&id=${aid}`; | |
| 1268 | + getApp().request.get(url, { | |
| 1269 | + success: function(res) { | |
| 1270 | + if(res.data.code == 0) { | |
| 1271 | + let team_id = res.data.data.pageData[0]['team_id']; | |
| 1272 | + wx.setStorage({ | |
| 1273 | + key: 'team_id', | |
| 1274 | + data: team_id, | |
| 1275 | + }); | |
| 1276 | + }; | |
| 1277 | + } | |
| 1278 | + }); | |
| 1279 | + }, | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | +}); | ... | ... |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.json
0 → 100644
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml
0 → 100644
| 1 | +<wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | |
| 2 | +<form bindsubmit="submitConfirm"> | |
| 3 | + <view class="container"> | |
| 4 | + | |
| 5 | + <view class="tab-container" wx:if="{{kt_type!=3 || is_normal==1}}"> | |
| 6 | + <view class="tab-wrapper"> | |
| 7 | + <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}" | |
| 8 | + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view> | |
| 9 | + | |
| 10 | + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}" | |
| 11 | + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view> | |
| 12 | + | |
| 13 | + </view> | |
| 14 | + </view> | |
| 15 | + | |
| 16 | + | |
| 17 | + <!--要进行判断地址是否显示----> | |
| 18 | + <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{bn_exp_type==1 || kt_type==3}}'> | |
| 19 | + <!---默认地址显示------> | |
| 20 | + <block wx:if="{{user_addr!=null}}"> | |
| 21 | + <view class="user-contact">收货人:{{user_addr.consignee}}{{' '}}{{user_addr.mobile}}</view> | |
| 22 | + <view class="location"> | |
| 23 | + <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view> | |
| 24 | + <view class="pos-icon"> | |
| 25 | + <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image> | |
| 26 | + </view> | |
| 27 | + </view> | |
| 28 | + <view class="update-logistics"> | |
| 29 | + <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/icon-arrowdown.png"></image> | |
| 30 | + </view> | |
| 31 | + </block> | |
| 32 | + <!---先增地址------> | |
| 33 | + <block wx:else> | |
| 34 | + <view class="add_new"> | |
| 35 | + <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址 | |
| 36 | + </view> | |
| 37 | + </block> | |
| 38 | + <!-- <view class="border-img"><image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/tt.png"></image></view> --> | |
| 39 | + </view> | |
| 40 | + | |
| 41 | + | |
| 42 | + <!------立即购买--------> | |
| 43 | + <block> | |
| 44 | + <!-- <view class="xc-border main-top"></view> --> | |
| 45 | + <view class="use-item bfff bdr_t-14 mgt20"> | |
| 46 | + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>{{bn_pickname}}</view></view> | |
| 47 | + <view class="order-detail"> | |
| 48 | + <view class="goods-img"> | |
| 49 | + <image class="wh100 bdr14" src="{{bn_goods.original_img}}" | |
| 50 | + binderror='cart_set_err' data-err="bn_goods.original_img"></image> | |
| 51 | + </view> | |
| 52 | + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> | |
| 53 | + <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view> | |
| 54 | + <!-- 商品属性 --> | |
| 55 | + <view class="flex-vertical fs28 color-gray n_guige"> | |
| 56 | + <view class="goods-color"><text>{{filters.show_gui_ge(bn_goods.goods_spec,bn_goods.goods_color)}}</text> | |
| 57 | + </view></view> | |
| 58 | + | |
| 59 | + <!-----商品名称规格------> | |
| 60 | + <view class="order-num flex-space-between"> | |
| 61 | + <view class="co-red">¥<text class="fs36">{{filters.toFix(param.goods_price,2)}}</text></view> | |
| 62 | + <view class="goods-num">x{{bn_goods.buynum}}</view> | |
| 63 | + </view> | |
| 64 | + </navigator> | |
| 65 | + <!-- <view class="order-num"> | |
| 66 | + <view class="co-red">¥{{bn_goods.shop_price}}</view> | |
| 67 | + <view class="goods-num">x{{bn_goods.buynum}}</view> | |
| 68 | + </view> --> | |
| 69 | + </view> | |
| 70 | + | |
| 71 | + <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 --> | |
| 72 | + <view class="plus_buy fs28" wx:if="{{card_cut_price>0}}"> | |
| 73 | + <view class="flex"> | |
| 74 | + <view class="card_bg ellipsis-1" style="margin-right: 10rpx;"> | |
| 75 | + <image src="{{imgUrl}}/miniapp/images/plus/dj_icon.png"></ image> | |
| 76 | + <text class="card_name">{{show_card.CardName}}</text> | |
| 77 | + </view> | |
| 78 | + <view>立减 <text style="color:#f23030;">{{filters.toFix(card_cut_price,2) }}</text> 元</view> | |
| 79 | + </view> | |
| 80 | + <view> | |
| 81 | + <text style="color: #999;margin-left: 4rpx;">vip超级会员仅需{{show_card.CardFee}}元</text> | |
| 82 | + </view> | |
| 83 | + <!-- 三角形 --> | |
| 84 | + <view class="car_tri_up"></view> | |
| 85 | + <!-- 立即开通跳转 --> | |
| 86 | + <view bindtap="buycard" class="card_op">立即开通</view> | |
| 87 | + </view> | |
| 88 | + | |
| 89 | + | |
| 90 | + <view class="set-mes bdr_b-14"> | |
| 91 | + <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} | |
| 92 | + </view> | |
| 93 | + | |
| 94 | + <!--阶梯团是不显示的--> | |
| 95 | + <block wx:if="{{bn_exp_type==0 && !is_default_logistics}}"> | |
| 96 | + <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}"> | |
| 97 | + <view>选择物流</view> | |
| 98 | + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 8rpx;"> | |
| 99 | + <view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view> | |
| 100 | + </view> | |
| 101 | + </view> | |
| 102 | + </block> | |
| 103 | + | |
| 104 | + <!--阶梯团是不显示的 | |
| 105 | + <block wx:if="{{kt_type!=3 || is_normal==1 }}"> | |
| 106 | + <view class="use-item" hidden='{{bn_exp_type==1}}'> | |
| 107 | + <view>使用物流:</view> | |
| 108 | + <picker bindchange="bindPickerChange" value="{{index}}" range="{{wu_arr}}" range-key="name"> | |
| 109 | + <view >{{wu_arr[index].name}}</view> | |
| 110 | + </picker> | |
| 111 | + </view> | |
| 112 | + </block>--> | |
| 113 | + | |
| 114 | + </view> | |
| 115 | + | |
| 116 | + | |
| 117 | + <view class="coupon-mes flex-vertical"> | |
| 118 | + <view>留言</view> | |
| 119 | + <view class="leave-word"> | |
| 120 | + <input placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note"></input> | |
| 121 | + | |
| 122 | + </view> | |
| 123 | + </view> | |
| 124 | + </block> | |
| 125 | + | |
| 126 | + <view class="information bdr14"> | |
| 127 | + <!-----使用余额------> | |
| 128 | + <view class="set-mes" wx:if="{{userinfo.user_money>0 && yuer>0}}"> | |
| 129 | + <view class="use-item" bindtap='set_bn_useyuer' style="padding-left:0;padding-right:0;"> | |
| 130 | + <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon> | |
| 131 | + <view class="yu_er">使用余额 :¥{{yuer}} </view> | |
| 132 | + </view> | |
| 133 | + </view> | |
| 134 | + <view class="item" wx:if="{{kt_type<3 || is_normal==1}}"> | |
| 135 | + <view>商品金额</view> | |
| 136 | + <!-- <view class="co-red">¥ {{formData.all_price}}元</view> --> | |
| 137 | + <view class="co-red">¥ {{param.goods_price}}元</view> | |
| 138 | + </view> | |
| 139 | + | |
| 140 | + <view class="item" wx:else> | |
| 141 | + <view>定金金额</view> | |
| 142 | + <view class="co-red">¥ {{formData.all_price}}元</view> | |
| 143 | + </view> | |
| 144 | + | |
| 145 | + <view class="item" wx:if="{{formData.shipping_price>0}}"> | |
| 146 | + <view>配送费用</view> | |
| 147 | + <view class="co-red">¥ {{formData.shipping_price}}元</view> | |
| 148 | + </view> | |
| 149 | + <view class="item" wx:if="{{formData.user_money>0}}"> | |
| 150 | + <view>使用余额</view> | |
| 151 | + <view class="co-red">- ¥ {{formData.user_money}}元</view> | |
| 152 | + </view> | |
| 153 | + | |
| 154 | + </view> | |
| 155 | + </view> | |
| 156 | + | |
| 157 | + <view class="btn-wrap"> | |
| 158 | + <view class="pay-amount"> | |
| 159 | + <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view> | |
| 160 | + <!-- <view class="co-red big"></view> --> | |
| 161 | + </view> | |
| 162 | + <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button> | |
| 163 | + </view> | |
| 164 | +</form> | |
| 165 | + | |
| 166 | +<!----弹起选择物流名的列表----> | |
| 167 | +<view wx:if='{{open_express==1}}' > | |
| 168 | + <view class="cover-layer flex-center " bindtap='close_express'> | |
| 169 | + </view> | |
| 170 | + | |
| 171 | + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}" > | |
| 172 | + <view class="tops flex"> | |
| 173 | + <view class="top-content fs32"> | |
| 174 | + <view> | |
| 175 | + 选择物流名字 | |
| 176 | + </view> | |
| 177 | + </view> | |
| 178 | + <view class="close-frame" bindtap='close_express' > | |
| 179 | + <view class="xc-close-express">×</view> | |
| 180 | + </view> | |
| 181 | + </view> | |
| 182 | + <view class="express_list"> | |
| 183 | + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx"> | |
| 184 | + <view class="express_list_frame" bindtap="click_express_name" | |
| 185 | + data-shippingcode="{{express_list.shipping_code}}" | |
| 186 | + data-name="{{express_list.name}}" data-idxe="{{idx}}"> | |
| 187 | + | |
| 188 | + <block wx:if="{{is_express==idx}}"> | |
| 189 | + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view> | |
| 190 | + </block> | |
| 191 | + <block wx:else> | |
| 192 | + <view class="circle xc-hooks"></view> | |
| 193 | + </block> | |
| 194 | + <view class="fs30">{{express_list.name}}</view> | |
| 195 | + | |
| 196 | + </view> | |
| 197 | + </view> | |
| 198 | + </view> | |
| 199 | + <view class="flex click-buttem" > | |
| 200 | + <view class="xc-determine flex-center" bindtap="determine_expres"> | |
| 201 | + <view class="flex-vertical t-c">确定</view> | |
| 202 | + </view> | |
| 203 | + <view class="xc-confirms flex-center" bindtap="select_default_logistics"> | |
| 204 | + <view class="flex-vertical t-c">设为默认</view> | |
| 205 | + </view> | |
| 206 | + </view> | |
| 207 | + | |
| 208 | + </view > | |
| 209 | +</view> | |
| 210 | + | |
| 211 | +<warn id="warn"></warn> | ... | ... |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxss
0 → 100644
| 1 | +.bdr_t-14 { | |
| 2 | + border-top-left-radius: 14rpx; | |
| 3 | + border-top-right-radius: 14rpx; | |
| 4 | +} | |
| 5 | +.bdr_b-14 { | |
| 6 | + border-bottom-left-radius: 14rpx; | |
| 7 | + border-bottom-right-radius: 14rpx; | |
| 8 | +} | |
| 9 | +.bdr14 { | |
| 10 | + border-radius: 14rpx; | |
| 11 | +} | |
| 12 | +.mgt20 { | |
| 13 | + margin-top: 20rpx; | |
| 14 | +} | |
| 15 | +.shadow { | |
| 16 | + box-shadow: 0 4rpx 12px #e7e9eb; | |
| 17 | +} | |
| 18 | +.shadow-1 { | |
| 19 | + box-shadow: 16rpx 0px 12px #e7e9eb; | |
| 20 | +} | |
| 21 | + | |
| 22 | + | |
| 23 | +page { | |
| 24 | + /* background-color: #FAFAFA; */ | |
| 25 | + background-color: #F0F0F0; | |
| 26 | + padding: 0 22rpx; | |
| 27 | + box-sizing: border-box; | |
| 28 | +} | |
| 29 | +.container { | |
| 30 | + background-color: #F0F0F0; | |
| 31 | + /* padding-top: 28rpx; */ | |
| 32 | + padding-bottom: 120rpx; | |
| 33 | +} | |
| 34 | +.user-mes { | |
| 35 | + position: relative; | |
| 36 | + background-color: #fff; | |
| 37 | + font-size: 32rpx; | |
| 38 | + color: #444; | |
| 39 | + /* margin-top: 28rpx; */ | |
| 40 | + border-radius: 14rpx; | |
| 41 | +} | |
| 42 | +.user-contact { | |
| 43 | + padding: 24rpx 26rpx; | |
| 44 | + font-weight: 600; | |
| 45 | +} | |
| 46 | + | |
| 47 | +.location { | |
| 48 | + position: relative; | |
| 49 | + padding: 0 70rpx 24rpx; | |
| 50 | +} | |
| 51 | + | |
| 52 | +.pos-icon { | |
| 53 | + position: absolute; | |
| 54 | + left: 28rpx; | |
| 55 | + top: 6rpx; | |
| 56 | + width: 30rpx; | |
| 57 | + height: 36rpx; | |
| 58 | +} | |
| 59 | + | |
| 60 | +.border-img { | |
| 61 | + width: 100%; | |
| 62 | + height: 12rpx; | |
| 63 | +} | |
| 64 | + | |
| 65 | +.update-logistics { | |
| 66 | + position: absolute; | |
| 67 | + right: 0; | |
| 68 | + top: 0; | |
| 69 | + width: 80rpx; | |
| 70 | + height: 100%; | |
| 71 | + display: flex; | |
| 72 | + align-items: center; | |
| 73 | + justify-content: center; | |
| 74 | +} | |
| 75 | + | |
| 76 | +.arrow-rigth { | |
| 77 | + width: 32rpx; | |
| 78 | + height: 32rpx; | |
| 79 | +} | |
| 80 | + | |
| 81 | +.order-meg { | |
| 82 | + margin-bottom: 20rpx; | |
| 83 | + font-size: 28rpx; | |
| 84 | + | |
| 85 | +} | |
| 86 | + | |
| 87 | +.order-detail { | |
| 88 | + padding: 30rpx 0; | |
| 89 | + border-bottom: 2rpx solid #eee; | |
| 90 | + color: #777; | |
| 91 | + min-height: 190rpx; | |
| 92 | + background-color: #fff; | |
| 93 | + | |
| 94 | +} | |
| 95 | + | |
| 96 | +.goods-img { | |
| 97 | + float: left; | |
| 98 | + width: 200rpx; | |
| 99 | + height: 200rpx; | |
| 100 | + margin: 0 20rpx; | |
| 101 | +} | |
| 102 | + | |
| 103 | +.order-cont { | |
| 104 | + float: left; | |
| 105 | + width: 438rpx; | |
| 106 | +} | |
| 107 | + | |
| 108 | +.goods-name { | |
| 109 | + height: 74rpx; | |
| 110 | + line-height: 40rpx; | |
| 111 | + overflow: hidden; | |
| 112 | + margin-bottom: 16rpx; | |
| 113 | + font-size: 28rpx; | |
| 114 | + color: #333; | |
| 115 | + | |
| 116 | +} | |
| 117 | + | |
| 118 | +.goods-color { | |
| 119 | + font-size: 24rpx; | |
| 120 | +} | |
| 121 | + | |
| 122 | +.order-num { | |
| 123 | + margin-top: 25rpx; | |
| 124 | + font-size: 24rpx; | |
| 125 | + line-height: 42rpx; | |
| 126 | +} | |
| 127 | + | |
| 128 | +.set-mes{ | |
| 129 | + background-color: #fff; | |
| 130 | + /* margin-top: 20rpx; */ | |
| 131 | +} | |
| 132 | +.use-item{ | |
| 133 | + display: flex; | |
| 134 | + align-items: center; | |
| 135 | + height: 80rpx; | |
| 136 | + /* border-bottom: 1px solid #ddd; */ | |
| 137 | + font-size: 30rpx; | |
| 138 | + /* width:95%; | |
| 139 | +margin:auto; */ | |
| 140 | + padding: 0 26rpx; | |
| 141 | +} | |
| 142 | +.use-item>view{ | |
| 143 | + display: flex; | |
| 144 | + /* margin-right: 12rpx; */ | |
| 145 | +} | |
| 146 | +.use-item.bfff{ | |
| 147 | + background-color: #fff; | |
| 148 | +} | |
| 149 | +.use-item .dp{ | |
| 150 | + display: block; | |
| 151 | + width: 50rpx; | |
| 152 | + height: 50rpx; | |
| 153 | + margin-left: -6rpx; | |
| 154 | +} | |
| 155 | + | |
| 156 | +.set-item { | |
| 157 | + justify-content: space-between; | |
| 158 | + background-color: #fff; | |
| 159 | +} | |
| 160 | + | |
| 161 | +.set-btn { | |
| 162 | + display: flex; | |
| 163 | + font-size: 24rpx; | |
| 164 | +} | |
| 165 | + | |
| 166 | +.set-mes input { | |
| 167 | + width: 380rpx; | |
| 168 | + height: 50rpx; | |
| 169 | + line-height: 50rpx; | |
| 170 | + border: 1px solid #ddd; | |
| 171 | +} | |
| 172 | + | |
| 173 | +.use-btn { | |
| 174 | + width: 100rpx; | |
| 175 | + height: 50rpx; | |
| 176 | + margin-left: 20rpx; | |
| 177 | + line-height: 50rpx; | |
| 178 | + text-align: center; | |
| 179 | + background-color: #f23030; | |
| 180 | + color: #fff; | |
| 181 | +} | |
| 182 | + | |
| 183 | +.coupon-mes { | |
| 184 | + /* box-sizing: border-box; */ | |
| 185 | + height:95rpx; | |
| 186 | + padding: 0 26rpx; | |
| 187 | + background-color: #fff; | |
| 188 | + font-size: 30rpx; | |
| 189 | + color: #444; | |
| 190 | + /* width: 100%; */ | |
| 191 | + border-radius: 14rpx; | |
| 192 | + margin-top: 20rpx; | |
| 193 | + margin-bottom: 20rpx; | |
| 194 | +} | |
| 195 | + | |
| 196 | +.coupon-title { | |
| 197 | + display: flex; | |
| 198 | + justify-content: space-between; | |
| 199 | + align-items: center; | |
| 200 | + height: 92rpx; | |
| 201 | +} | |
| 202 | + | |
| 203 | +.coupon-title>view { | |
| 204 | + display: flex; | |
| 205 | +} | |
| 206 | + | |
| 207 | +.coupon-num { | |
| 208 | + height: 36rpx; | |
| 209 | + margin-left: 20rpx; | |
| 210 | + padding: 0 16rpx; | |
| 211 | + line-height: 36rpx; | |
| 212 | + text-align: center; | |
| 213 | + background-color: #f23030; | |
| 214 | + color: #fff; | |
| 215 | + font-size: 24rpx; | |
| 216 | +} | |
| 217 | + | |
| 218 | +.leave-word { | |
| 219 | + position: relative; | |
| 220 | + font-size: 24rpx; | |
| 221 | + margin-left: 20rpx; | |
| 222 | + flex-grow: 1; | |
| 223 | +} | |
| 224 | + | |
| 225 | +.word-box { | |
| 226 | + font-size: 26rpx; | |
| 227 | + /* width: 600rpx; */ | |
| 228 | + padding: 10rpx; | |
| 229 | + height: 28rpx; | |
| 230 | + line-height: 40rpx; | |
| 231 | +} | |
| 232 | + | |
| 233 | +.max-word { | |
| 234 | + position: absolute; | |
| 235 | + right: 0; | |
| 236 | + bottom: 0; | |
| 237 | +} | |
| 238 | + | |
| 239 | +.information { | |
| 240 | + padding: 0 26rpx; | |
| 241 | + background-color: #fff; | |
| 242 | + /* margin-bottom: 120rpx; */ | |
| 243 | +} | |
| 244 | + | |
| 245 | +.information .item { | |
| 246 | + display: flex; | |
| 247 | + justify-content: space-between; | |
| 248 | + height: 60rpx; | |
| 249 | + line-height: 60rpx; | |
| 250 | + font-size: 26rpx; | |
| 251 | + color: #777; | |
| 252 | +} | |
| 253 | + | |
| 254 | +.btn-wrap { | |
| 255 | + height: 94rpx; | |
| 256 | + box-sizing: border-box; | |
| 257 | + display: flex; | |
| 258 | + justify-content: space-between; | |
| 259 | + background-color: white; | |
| 260 | + align-items: center; | |
| 261 | + position: fixed; | |
| 262 | + bottom: 0; | |
| 263 | + left: 0; | |
| 264 | + width: 100%; | |
| 265 | + padding: 0 30rpx; | |
| 266 | +} | |
| 267 | + | |
| 268 | +.tips-btn { | |
| 269 | + /* float: right; | |
| 270 | + width: 200rpx; | |
| 271 | + height: 100rpx; | |
| 272 | + line-height: 100rpx; | |
| 273 | + text-align: center; | |
| 274 | + font-size: 30rpx; | |
| 275 | + color: #fff; | |
| 276 | + background-color: #f23030; */ | |
| 277 | + color: white; | |
| 278 | + background-color: #FE4445; | |
| 279 | + height: 72rpx; | |
| 280 | + line-height: 72rpx; | |
| 281 | + padding: 0 42rpx; | |
| 282 | + border-radius: 36rpx; | |
| 283 | + margin-left: 0; | |
| 284 | + margin-right: 0; | |
| 285 | +} | |
| 286 | + | |
| 287 | +.pay-amount { | |
| 288 | + /* float: right; | |
| 289 | + display: flex; | |
| 290 | + align-items: center; | |
| 291 | + height: 100rpx; | |
| 292 | + font-size: 26rpx; | |
| 293 | + margin-right: 40rpx; */ | |
| 294 | +} | |
| 295 | + | |
| 296 | +.payable { | |
| 297 | + color: #444; | |
| 298 | + /* margin-right: 20rpx; */ | |
| 299 | +} | |
| 300 | + | |
| 301 | +.shipping-modal { | |
| 302 | + z-index: 20; | |
| 303 | + position: fixed; | |
| 304 | + bottom: 0; | |
| 305 | + left: 0; | |
| 306 | + right: 0; | |
| 307 | + overflow-y: hidden; | |
| 308 | + color: #666666; | |
| 309 | + background-color: white; | |
| 310 | +} | |
| 311 | + | |
| 312 | +.shipping-nav { | |
| 313 | + text-align: center; | |
| 314 | + font-size: 35rpx; | |
| 315 | + padding-top: 30rpx; | |
| 316 | +} | |
| 317 | + | |
| 318 | +.shipping-list { | |
| 319 | + padding: 20rpx 30rpx 40rpx; | |
| 320 | + font-size: 28rpx; | |
| 321 | +} | |
| 322 | + | |
| 323 | +.shipping-item { | |
| 324 | + display: block; | |
| 325 | + padding: 20rpx 0; | |
| 326 | +} | |
| 327 | + | |
| 328 | +.shipping-btn { | |
| 329 | + width: 100%; | |
| 330 | + color: white; | |
| 331 | + background-color: #f23030; | |
| 332 | + line-height: 90rpx; | |
| 333 | + text-align: center; | |
| 334 | + font-size: 40rpx; | |
| 335 | +} | |
| 336 | + | |
| 337 | +/*----------nyf新增,地址---------*/ | |
| 338 | +.add_new{ | |
| 339 | + height: 90rpx; | |
| 340 | + display: flex; | |
| 341 | + align-items: center; | |
| 342 | + padding: 0 26rpx; | |
| 343 | +} | |
| 344 | +.addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; | |
| 345 | + margin-right: 15rpx;vertical-align: middle;} | |
| 346 | +.yu_er{ | |
| 347 | + margin-left: 10rpx; | |
| 348 | + /* margin-right: 60rpx; */ | |
| 349 | +} | |
| 350 | +.wuliu{margin-left: 20rpx;} | |
| 351 | + | |
| 352 | + | |
| 353 | +/*---- 优惠券列表 -----*/ | |
| 354 | +.xc-coupon-frame{ | |
| 355 | + width: 100%; | |
| 356 | + height: 92rpx; | |
| 357 | + | |
| 358 | +} | |
| 359 | +.xc-coupon-frame .work-frame{ | |
| 360 | + width: 100%; | |
| 361 | + height: 100%; | |
| 362 | + border-bottom:3rpx solid #eee; | |
| 363 | + padding: 0 26rpx; | |
| 364 | + background-color: white; | |
| 365 | +} | |
| 366 | +.xc-right{ | |
| 367 | + width:20rpx; | |
| 368 | + height:20rpx; | |
| 369 | + border-top:2rpx solid #000; | |
| 370 | + border-right:2rpx solid #000; | |
| 371 | + transform:rotate(45deg); | |
| 372 | + display:inline-block; | |
| 373 | +} | |
| 374 | + | |
| 375 | +.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; } | |
| 376 | +.xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx } | |
| 377 | + | |
| 378 | +/* 自定义弹出窗口 */ | |
| 379 | +.cx-popup{ | |
| 380 | + width:100%; | |
| 381 | + height:880rpx; | |
| 382 | + background: #fff; | |
| 383 | + z-index: 35; | |
| 384 | + border-top-left-radius: 20rpx; | |
| 385 | + border-top-right-radius: 20rpx; | |
| 386 | + position:fixed; | |
| 387 | + bottom:0; | |
| 388 | + left: 0; | |
| 389 | + /* padding-bottom: 25rpx; */ | |
| 390 | +} | |
| 391 | + | |
| 392 | +.cx-popup .top{ | |
| 393 | + width:95%; | |
| 394 | + height:100rpx; | |
| 395 | + border-bottom:3rpx solid #ddd; | |
| 396 | + margin: auto; | |
| 397 | + margin-top: 30rpx; | |
| 398 | + | |
| 399 | +} | |
| 400 | +.xc-top-content{ | |
| 401 | + width: 93%; | |
| 402 | + height:85rpx; | |
| 403 | + padding-top: 30rpx; | |
| 404 | + font-size: 34rpx; | |
| 405 | + font-weight: 600; | |
| 406 | + | |
| 407 | +} | |
| 408 | + | |
| 409 | + | |
| 410 | +.xc-valid-coupon{ | |
| 411 | + width: 90%; | |
| 412 | + height:40rpx; | |
| 413 | + padding-top: 24rpx; | |
| 414 | + overflow: hidden; | |
| 415 | +} | |
| 416 | +.xc-frame{ | |
| 417 | + width: 100%; | |
| 418 | + height:60%; | |
| 419 | +} | |
| 420 | + | |
| 421 | +.xc-frame .list-frame{ | |
| 422 | + width: 95%; | |
| 423 | + height: 100%; | |
| 424 | + overflow-y:scroll; | |
| 425 | + | |
| 426 | +} | |
| 427 | +.xc-close-frame{ | |
| 428 | + margin-top:-10rpx; | |
| 429 | + | |
| 430 | +} | |
| 431 | + | |
| 432 | +.xc-close{ | |
| 433 | + width: 37rpx; | |
| 434 | +height: 37rpx; | |
| 435 | +border-radius: 50%; | |
| 436 | +border: 3rpx solid #333; | |
| 437 | +text-align: center; | |
| 438 | +line-height: 34rpx; | |
| 439 | +font-size: 29rpx; | |
| 440 | +color: #333; | |
| 441 | + | |
| 442 | +} | |
| 443 | +.xc-money{ | |
| 444 | + color: #af2346; | |
| 445 | + font-size: 35rpx; | |
| 446 | +} | |
| 447 | + | |
| 448 | +.xc-money-frame{ | |
| 449 | + margin-left:35rpx; | |
| 450 | + | |
| 451 | +} | |
| 452 | +.xc-coupon-effect{ | |
| 453 | + width: 99%; | |
| 454 | + min-height: 100rpx; | |
| 455 | + border-bottom:3rpx solid #ddd; | |
| 456 | + | |
| 457 | + | |
| 458 | +} | |
| 459 | +.xc-goods-coupon{ | |
| 460 | + width: 85%; | |
| 461 | + height:100%; | |
| 462 | + | |
| 463 | +} | |
| 464 | +.xc-title{ | |
| 465 | + width:50%; | |
| 466 | + margin-left:222rpx; | |
| 467 | + | |
| 468 | +} | |
| 469 | +.xc-coupon-money0{ | |
| 470 | + color: #c91e31; | |
| 471 | + font-size: 35rpx; | |
| 472 | + line-height: 40rpx; | |
| 473 | + | |
| 474 | +} | |
| 475 | +.xc-coupon-money{ | |
| 476 | + color: #c91e31; | |
| 477 | + font-size: 35rpx; | |
| 478 | + line-height: 40rpx; | |
| 479 | + padding-top: 10px; | |
| 480 | + | |
| 481 | +} | |
| 482 | +.xc-coupon-money1{ | |
| 483 | + color: #444; | |
| 484 | + font-size: 28rpx; | |
| 485 | + line-height: 60rpx; | |
| 486 | + | |
| 487 | + | |
| 488 | +} | |
| 489 | +.xc-coupon-time{ | |
| 490 | + height: 50rpx; | |
| 491 | + font-size: 27rpx; | |
| 492 | + color: #a4a4a4; | |
| 493 | +} | |
| 494 | +.xc-coupon-time .time{ | |
| 495 | + margin-left: 15rpx; | |
| 496 | + font-size: 27rpx; | |
| 497 | +} | |
| 498 | +.xc-coupon-selection{ | |
| 499 | + height:100%; | |
| 500 | +} | |
| 501 | + | |
| 502 | +.xc-confirm { | |
| 503 | + width: 50%; | |
| 504 | + border-radius: 50rpx; | |
| 505 | + height: 80rpx; | |
| 506 | + margin:0 auto; | |
| 507 | + background:#d60021; | |
| 508 | + color:#fff; | |
| 509 | + font-size:28rpx; | |
| 510 | + margin-top: 28rpx; | |
| 511 | +} | |
| 512 | + | |
| 513 | +.up{ animation: up .7s; } | |
| 514 | +.down{ animation: down 1s; } | |
| 515 | +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } } | |
| 516 | +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } } | |
| 517 | + | |
| 518 | +.xc-not-Selection{ | |
| 519 | + width: 40rpx; | |
| 520 | +height: 40rpx; | |
| 521 | + background: #eeeeee; | |
| 522 | +} | |
| 523 | + | |
| 524 | + | |
| 525 | +.xc-close-express{ | |
| 526 | + width: 40rpx; | |
| 527 | +height: 40rpx; | |
| 528 | +border-radius: 50%; | |
| 529 | +border: 3rpx solid #333; | |
| 530 | +text-align: center; | |
| 531 | +font-size:32rpx; | |
| 532 | +line-height: 38rpx; | |
| 533 | +color: #333; | |
| 534 | +margin-top: 5rpx; | |
| 535 | +} | |
| 536 | +.cx-popup .tops{ | |
| 537 | + width: 100%; | |
| 538 | +height: 145rpx; | |
| 539 | +border-bottom: 3rpx solid #eee; | |
| 540 | + | |
| 541 | +} | |
| 542 | +.top-content { | |
| 543 | + width: 82%; | |
| 544 | +padding-top: 33px; | |
| 545 | +height: 100%; | |
| 546 | +padding-left: 40rpx; | |
| 547 | +} | |
| 548 | +.close-frame{ | |
| 549 | + margin-top: 30rpx; | |
| 550 | + | |
| 551 | +} | |
| 552 | + | |
| 553 | +.xc-hook { | |
| 554 | +width: 33rpx; | |
| 555 | +height: 33rpx; | |
| 556 | +transform: rotate(-135deg); | |
| 557 | +line-height: 35rpx; | |
| 558 | +text-align: center; | |
| 559 | +margin-right: 20rpx | |
| 560 | + | |
| 561 | + | |
| 562 | +} | |
| 563 | +.xc-hooks { | |
| 564 | +width: 30rpx; | |
| 565 | +height: 30rpx; | |
| 566 | +border: 1rpx solid #999; | |
| 567 | +margin-right: 20rpx; | |
| 568 | +} | |
| 569 | +.express_list_frame{ | |
| 570 | + display: flex; | |
| 571 | +height: 80rpx; | |
| 572 | +align-items: center; | |
| 573 | +padding-left: 40rpx; | |
| 574 | +border-bottom: 1rpx solid #eee; | |
| 575 | + | |
| 576 | +} | |
| 577 | +.express_list{ | |
| 578 | + width: 100%; | |
| 579 | + height: 65%; | |
| 580 | + overflow-y: auto; | |
| 581 | + margin-bottom: 40rpx; | |
| 582 | + | |
| 583 | +} | |
| 584 | +.xc-confirms { | |
| 585 | + box-sizing: border-box; | |
| 586 | + width: 40%; | |
| 587 | + border-radius: 50rpx; | |
| 588 | + height: 80rpx; | |
| 589 | + margin:0 auto; | |
| 590 | + font-size:28rpx; | |
| 591 | + background: #fff; | |
| 592 | + color: #333; | |
| 593 | + border: 2rpx solid #333; | |
| 594 | +} | |
| 595 | + | |
| 596 | + | |
| 597 | +/* 优惠券的改版样式 */ | |
| 598 | +.xc-coupon-frame{ | |
| 599 | + /* width: 710rpx; */ | |
| 600 | + width: 100%; | |
| 601 | + height:auto; | |
| 602 | + margin: 0 auto; | |
| 603 | + | |
| 604 | +} | |
| 605 | +.xc-coupon-frame .coupon-frame{ | |
| 606 | + width: 100%; | |
| 607 | + height: 200rpx; | |
| 608 | + margin-top:10rpx; | |
| 609 | + border-bottom: 1rpx solid #eee; | |
| 610 | + | |
| 611 | +} | |
| 612 | +.xc-coupon-frame .coupon-frame .coupon-left{ | |
| 613 | + width: 215rpx; | |
| 614 | + height:100%; | |
| 615 | + overflow: hidden; | |
| 616 | +} | |
| 617 | +.xc-money-frames{ | |
| 618 | + width:96%; | |
| 619 | + margin-top: -10px; | |
| 620 | +} | |
| 621 | + | |
| 622 | +.xc-rmb-symbol{ | |
| 623 | + font-size:40rpx; | |
| 624 | + | |
| 625 | +} | |
| 626 | + | |
| 627 | +.xc-rmb-val{ | |
| 628 | + font-size:60rpx; | |
| 629 | + | |
| 630 | +} | |
| 631 | +.coupon-explain{ | |
| 632 | + font-size:25rpx; | |
| 633 | +width:100%; | |
| 634 | + | |
| 635 | + | |
| 636 | +} | |
| 637 | +.xc-valuer{ | |
| 638 | + margin-top:39rpx; | |
| 639 | + margin-left:28rpx; | |
| 640 | + font-size:25rpx; | |
| 641 | +} | |
| 642 | +.coupon-frame .oval{ | |
| 643 | + width:155rpx; | |
| 644 | + height:83rpx; | |
| 645 | + border-radius: 50%; | |
| 646 | + right:-78rpx; | |
| 647 | + top:-37rpx; | |
| 648 | +} | |
| 649 | +.coupon-right{ | |
| 650 | + /* width:490rpx; */ | |
| 651 | + height: 99%; | |
| 652 | + border-top: 1rpx solid #eaeaea; | |
| 653 | + /* //border-bottom: 1rpx solid #eaeaea; */ | |
| 654 | + border-right: 1rpx solid #eaeaea; | |
| 655 | + flex-grow: 1; | |
| 656 | +} | |
| 657 | +.coupon-annotation{ | |
| 658 | + width: 95%; | |
| 659 | + height: 100%; | |
| 660 | + | |
| 661 | +} | |
| 662 | +.xc-brand{ | |
| 663 | + width:100rpx; | |
| 664 | + height:35rpx; | |
| 665 | + line-height: 35rpx; | |
| 666 | + font-size:21rpx; | |
| 667 | + border-radius:10rpx; position: relative; top:-1px; | |
| 668 | + margin-right: 8rpx | |
| 669 | +} | |
| 670 | +.top-frame{ | |
| 671 | + width:82%; | |
| 672 | + height: 75rpx; | |
| 673 | + margin-top:10rpx; | |
| 674 | +} | |
| 675 | +.top-frame .coupon-wode{ | |
| 676 | + font-size: 25rpx; | |
| 677 | + margin-left:10rpx; | |
| 678 | + width:340rpx; | |
| 679 | + height:88rpx; | |
| 680 | +} | |
| 681 | +.coupon-code{ | |
| 682 | + width:60rpx; | |
| 683 | + height:60rpx; | |
| 684 | + margin-top:5rpx; | |
| 685 | + | |
| 686 | +} | |
| 687 | +.frame{ | |
| 688 | + width: 100% | |
| 689 | +} | |
| 690 | +.coupon-time{ | |
| 691 | + font-size: 23rpx; | |
| 692 | + line-height:33rpx; | |
| 693 | + color: #333; | |
| 694 | +} | |
| 695 | + | |
| 696 | +.clik-get{ | |
| 697 | + width:125rpx; | |
| 698 | + height:45rpx; | |
| 699 | + border-radius: 25rpx; | |
| 700 | + line-height: 45rpx; | |
| 701 | + font-size:25rpx; | |
| 702 | + bottom:67rpx; | |
| 703 | + right:6px; | |
| 704 | +} | |
| 705 | + | |
| 706 | +.code-img{ | |
| 707 | + margin-left:20rpx; | |
| 708 | +} | |
| 709 | +.bottmo-explain{ | |
| 710 | +top:145rpx; | |
| 711 | +width:94%; | |
| 712 | +border-top:1rpx dashed #eee; | |
| 713 | +padding-top:8rpx; | |
| 714 | +height:38rpx; | |
| 715 | +line-height: 51rpx; | |
| 716 | + | |
| 717 | +} | |
| 718 | +.font-word{ | |
| 719 | + font-size: 22rpx; | |
| 720 | +} | |
| 721 | +.circle-size{ | |
| 722 | + background: #a0a0a0; | |
| 723 | + width: 27rpx; | |
| 724 | + height: 27rpx; | |
| 725 | + margin-top:13rpx; | |
| 726 | +margin-left:8rpx; | |
| 727 | +display: flex; | |
| 728 | + | |
| 729 | +align-items: center; | |
| 730 | +} | |
| 731 | +.xc-jiantou{ | |
| 732 | + /* width: 9rpx; | |
| 733 | + height: 9rpx; */ | |
| 734 | + /* border-top: 2rpx solid #fff; | |
| 735 | + border-right: 2rpx solid #fff; */ | |
| 736 | + transform: rotate(-90deg); | |
| 737 | + color: #fff; | |
| 738 | + font-size: 15rpx; | |
| 739 | + /* display:inline-block; | |
| 740 | + margin-top: 6.5rpx; */ | |
| 741 | + text-align: center; | |
| 742 | +width: 24rpx; | |
| 743 | +} | |
| 744 | +.xc-buttom{ | |
| 745 | + box-sizing: border-box; | |
| 746 | + width:100%; | |
| 747 | + min-height:76rpx; | |
| 748 | + height:auto; | |
| 749 | + line-height:40rpx; | |
| 750 | + border-left:1rpx solid #eee; | |
| 751 | + border-right:1rpx solid #eee; | |
| 752 | + border-bottom:1rpx solid #eee; | |
| 753 | +/* margin-left: 6rpx; */ | |
| 754 | +} | |
| 755 | + | |
| 756 | +.goods-num{ | |
| 757 | + font-size: 28rpx; | |
| 758 | + color: #333; | |
| 759 | +} | |
| 760 | + | |
| 761 | +.explain-coupon{ | |
| 762 | + font-size:25rpx; | |
| 763 | + padding: 10rpx 10rpx | |
| 764 | +} | |
| 765 | +.circle-frame{ | |
| 766 | + width: 20rpx; | |
| 767 | + height: auto; | |
| 768 | + z-index:1; | |
| 769 | + left:210rpx; | |
| 770 | + | |
| 771 | +} | |
| 772 | +.circle-sawtooth{ | |
| 773 | + width: 11rpx; | |
| 774 | + height: 11rpx; | |
| 775 | + background: #fff; | |
| 776 | +} | |
| 777 | + | |
| 778 | +.red{background-color: #fe7496;} | |
| 779 | +.green{ background-color: #22c7c1;} | |
| 780 | +.blue{background-color:#5e82e3;} | |
| 781 | +.g_gray{background-color: #aaaaaa} | |
| 782 | + | |
| 783 | +.f_text{text-align: center; height:96rpx; } | |
| 784 | +.xc-hook.sn { | |
| 785 | + margin-top:12%; | |
| 786 | +width:45rpx; | |
| 787 | +height:45rpx; | |
| 788 | +font-size:28rpx; | |
| 789 | +line-height:44rpx; | |
| 790 | + | |
| 791 | + | |
| 792 | +} | |
| 793 | +.xc-hooks.on{ | |
| 794 | + margin-top:12%; | |
| 795 | +width:42rpx; | |
| 796 | +height:42rpx; | |
| 797 | +} | |
| 798 | +.may_use_coupon{ | |
| 799 | + /* width: 95%; */ | |
| 800 | + /* height: 68rpx; */ | |
| 801 | + line-height:78rpx; | |
| 802 | + padding: 0 26rpx; | |
| 803 | + justify-content: space-between; | |
| 804 | + align-items: center; | |
| 805 | +} | |
| 806 | +.determine-frame{ | |
| 807 | + width: 100%; | |
| 808 | + height: 130rpx; | |
| 809 | + | |
| 810 | +} | |
| 811 | +.xc-determine{ | |
| 812 | + height: 80rpx; | |
| 813 | + width: 40%; | |
| 814 | + border-radius: 50rpx; | |
| 815 | +background: #d60021; | |
| 816 | +color: #fff; | |
| 817 | +font-size: 28rpx; | |
| 818 | +margin: 0 auto; | |
| 819 | + | |
| 820 | +} | |
| 821 | +.click-buttem{ | |
| 822 | +width: 90%; | |
| 823 | +margin: auto; | |
| 824 | +} | |
| 825 | +.logistics-name{ | |
| 826 | + margin-right:20rpx; | |
| 827 | +} | |
| 828 | +.xc-border{ | |
| 829 | + border-top:8rpx solid #eee; | |
| 830 | +width: 100% | |
| 831 | +} | |
| 832 | +.main-top{ | |
| 833 | +margin-top: 20rpx; | |
| 834 | + | |
| 835 | +} | |
| 836 | +.xc-hookts{ | |
| 837 | +border: 1rpx solid #999; | |
| 838 | + | |
| 839 | +} | |
| 840 | +.xc-hookts.on{ | |
| 841 | + width:30rpx; | |
| 842 | +height:30rpx; | |
| 843 | + | |
| 844 | +} | |
| 845 | +.xc-hookt.sn{ | |
| 846 | + width: 32rpx; | |
| 847 | +height: 32rpx; | |
| 848 | +font-size: 28rpx; | |
| 849 | +line-height: 34rpx; | |
| 850 | +} | |
| 851 | +.xc-hookt{ | |
| 852 | + transform: rotate(-135deg); | |
| 853 | +text-align: center; | |
| 854 | + | |
| 855 | +} | |
| 856 | +.main-bottom{ | |
| 857 | + margin-bottom: 20rpx; | |
| 858 | + | |
| 859 | +} | |
| 860 | +.xc-hookst{ | |
| 861 | + border: 1rpx solid #999; | |
| 862 | + | |
| 863 | +} | |
| 864 | +.xc-hookst.ons{ | |
| 865 | + width: 42rpx; | |
| 866 | +height: 42rpx; | |
| 867 | +margin-left: 20rpx; | |
| 868 | + | |
| 869 | +} | |
| 870 | +.is_use_coupon{ | |
| 871 | + width: 65%; | |
| 872 | +justify-content: flex-end; | |
| 873 | +padding-top: 10rpx; | |
| 874 | + | |
| 875 | + | |
| 876 | +} | |
| 877 | +.xc-hooka{ | |
| 878 | + transform: rotate(-135deg); | |
| 879 | +text-align: center; | |
| 880 | + | |
| 881 | +} | |
| 882 | +.xc-hooka.sn{ | |
| 883 | + width: 45rpx; | |
| 884 | +height: 45rpx; | |
| 885 | +font-size: 28rpx; | |
| 886 | +line-height: 44rpx; | |
| 887 | +margin-left: 20rpx; | |
| 888 | + | |
| 889 | +} | |
| 890 | +.color-gray{ | |
| 891 | + color: #808080; | |
| 892 | +} | |
| 893 | +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx } | |
| 894 | +.gift_image{ width: 60rpx; height: 60rpx; position: absolute; top: 0; left: 0} | |
| 895 | + | |
| 896 | +.quan_num_show{ padding: 4rpx 6rpx; background-color:#ea5551; color:#fff; border-radius: 6rpx;margin-left:10rpx;font-size:24rpx;} | |
| 897 | + | |
| 898 | +.navigator-hover { | |
| 899 | + background: none; | |
| 900 | + opacity: 1; | |
| 901 | +} | |
| 902 | + | |
| 903 | +.plus_buy{ | |
| 904 | + background-color: #fff; | |
| 905 | + margin:15rpx 0; | |
| 906 | + padding: 20rpx 10rpx; | |
| 907 | + position: relative; | |
| 908 | +} | |
| 909 | + | |
| 910 | + | |
| 911 | +.card_bg { | |
| 912 | + box-sizing: border-box; | |
| 913 | + padding: 2rpx 10rpx; | |
| 914 | + height: 28rpx; | |
| 915 | + border-radius: 26rpx; | |
| 916 | + font-size: 18rpx; | |
| 917 | + line-height: 28rpx; | |
| 918 | + max-width: 210rpx; | |
| 919 | + background: #333; | |
| 920 | + color: #fff; | |
| 921 | + margin-left: 8rpx; | |
| 922 | + position:relative; | |
| 923 | + top:7rpx; | |
| 924 | +} | |
| 925 | + | |
| 926 | +.card_bg image { | |
| 927 | + width: 19rpx; | |
| 928 | + height: 19rpx; | |
| 929 | + margin-right: 8rpx; | |
| 930 | +} | |
| 931 | + | |
| 932 | +/* .card_bg .card_name { | |
| 933 | + max-width: 76rpx; | |
| 934 | + width: auto; | |
| 935 | + overflow: hidden; | |
| 936 | + white-space: nowrap; | |
| 937 | +} */ | |
| 938 | + | |
| 939 | +.card_name { | |
| 940 | + position: relative; | |
| 941 | + top: -4rpx; | |
| 942 | + margin-left: 6px; | |
| 943 | +} | |
| 944 | + | |
| 945 | +.car_tri_up { | |
| 946 | + width: 0;height: 0; | |
| 947 | + border-left: 20rpx solid transparent; | |
| 948 | + border-right: 20rpx solid transparent; | |
| 949 | + border-bottom: 20rpx solid #fff; | |
| 950 | + position: absolute; | |
| 951 | + right: 20rpx; | |
| 952 | + top:-10rpx | |
| 953 | +} | |
| 954 | +.card_op{ | |
| 955 | + position: absolute; | |
| 956 | + right: 20rpx; | |
| 957 | + top:36rpx | |
| 958 | +} | |
| 959 | + | |
| 960 | + | |
| 961 | +.tab-container { | |
| 962 | + font-size: 28rpx; | |
| 963 | + margin-top: 20rpx; | |
| 964 | + display: flex; | |
| 965 | +} | |
| 966 | + | |
| 967 | +.tab-wrapper { | |
| 968 | + background-color: #ccc; | |
| 969 | + display: flex; | |
| 970 | + border-radius: 40rpx; | |
| 971 | + overflow: hidden; | |
| 972 | +} | |
| 973 | + | |
| 974 | +.tab { | |
| 975 | + padding: 20rpx 30rpx; | |
| 976 | + | |
| 977 | +} | |
| 978 | + | |
| 979 | + | |
| 980 | +.tab.active { | |
| 981 | + background-color: white; | |
| 982 | + border-radius: 40rpx; | |
| 983 | +} | ... | ... |
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js
| ... | ... | @@ -9,6 +9,8 @@ var t = require("../../../../utils/util.js"), |
| 9 | 9 | o = s.globalData.setting, |
| 10 | 10 | os = o; |
| 11 | 11 | var regeneratorRuntime = require('../../../../utils/runtime.js'); |
| 12 | + | |
| 13 | +let self = null; | |
| 12 | 14 | |
| 13 | 15 | Page({ |
| 14 | 16 | data: { |
| ... | ... | @@ -48,8 +50,13 @@ Page({ |
| 48 | 50 | showRules: false, |
| 49 | 51 | isSuccess: false, |
| 50 | 52 | showPoster: false, |
| 53 | + | |
| 54 | + luckyGoMembers: [], | |
| 55 | + // team_id: 0, | |
| 51 | 56 | }, |
| 57 | + | |
| 52 | 58 | onLoad: function (t) { |
| 59 | + self = this; | |
| 53 | 60 | if(t.team_id != null && t.team_id !=undefined) { |
| 54 | 61 | this.setData({ |
| 55 | 62 | team_id: t.team_id, |
| ... | ... | @@ -71,7 +78,7 @@ Page({ |
| 71 | 78 | this.init(order_sn); |
| 72 | 79 | |
| 73 | 80 | //-- 自定义海报 -- |
| 74 | - getApp().request.promiseGet("/api/weshop/goods/poster/page",{ | |
| 81 | + getApp().request.promiseGet("/api/weshop/goods/poster/page", { | |
| 75 | 82 | data:{store_id:os.stoid, type:1, is_use:1 } |
| 76 | 83 | }).then(res=>{ |
| 77 | 84 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0] ){ |
| ... | ... | @@ -107,9 +114,16 @@ Page({ |
| 107 | 114 | |
| 108 | 115 | onUnload: function () { |
| 109 | 116 | // 开团成功后,清除storage里的team_id |
| 110 | - if(this.data.luckyGoInfo.num && this.data.luckyGoInfo.num == 0) { | |
| 111 | - wx.removeStorageSync('team_id'); | |
| 112 | - }; | |
| 117 | + // if(this.data.luckyGoInfo && this.data.luckyGoInfo.num == 0) { | |
| 118 | + // wx.removeStorageSync('team_id'); | |
| 119 | + // }; | |
| 120 | + // // 如果是从会员中心的幸运购列表点击进来的,退出时清除storage里的team_id | |
| 121 | + // if(this.data.param.from == 1) { | |
| 122 | + // let team_id = wx.getStorageSync('team_id'); | |
| 123 | + // if(team_id != null && team_id != undefined) wx.removeStorageSync('team_id'); | |
| 124 | + // }; | |
| 125 | + | |
| 126 | + wx.removeStorageSync('team_id'); | |
| 113 | 127 | }, |
| 114 | 128 | |
| 115 | 129 | //关闭展开列表 |
| ... | ... | @@ -169,7 +183,7 @@ Page({ |
| 169 | 183 | pt_listno = "",//团编号 |
| 170 | 184 | pt_prom_id = 0, //活动id |
| 171 | 185 | ee = this, |
| 172 | - team_id = 0,//活动id | |
| 186 | + //team_id = 0,//活动id | |
| 173 | 187 | ordertx=[],//头像图片 |
| 174 | 188 | share_img=null,//分享图片 |
| 175 | 189 | teamlist=null,//活动表 |
| ... | ... | @@ -306,16 +320,18 @@ Page({ |
| 306 | 320 | // if(ct_price==0) ct_price=min_price; |
| 307 | 321 | // } |
| 308 | 322 | |
| 323 | + | |
| 309 | 324 | //获取大家都在团信息 |
| 310 | - getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1?store_id="+ os.stoid +"&is_end=0&is_show=1" , { | |
| 311 | - data:{page:1,pageSize:2} | |
| 312 | - }).then(res => { | |
| 313 | - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ | |
| 314 | - pageteam = res.data.data.pageData; | |
| 315 | - ee.setData({pageteam: pageteam,}) | |
| 316 | - } | |
| 325 | + // getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1?store_id="+ os.stoid +"&is_end=0&is_show=1" , { | |
| 326 | + // data:{page:1,pageSize:2} | |
| 327 | + // }).then(res => { | |
| 328 | + // if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ | |
| 329 | + // pageteam = res.data.data.pageData; | |
| 330 | + // ee.setData({pageteam: pageteam,}) | |
| 331 | + // } | |
| 317 | 332 | |
| 318 | - }) | |
| 333 | + // }) | |
| 334 | + | |
| 319 | 335 | |
| 320 | 336 | //--当是成团的时候的操作-- |
| 321 | 337 | // if(order.pt_status==2 || order.pt_status==4 || order.pt_status==5){ |
| ... | ... | @@ -343,9 +359,9 @@ Page({ |
| 343 | 359 | |
| 344 | 360 | wx.hideLoading(); |
| 345 | 361 | |
| 346 | - wx.setNavigationBarTitle({ | |
| 347 | - title: "拼团详情", | |
| 348 | - }); | |
| 362 | + // wx.setNavigationBarTitle({ | |
| 363 | + // title: "拼团详情", | |
| 364 | + // }); | |
| 349 | 365 | |
| 350 | 366 | // ee.countDown2(); |
| 351 | 367 | |
| ... | ... | @@ -467,8 +483,10 @@ Page({ |
| 467 | 483 | scene += "_" + getApp().globalData.room_id; |
| 468 | 484 | }; |
| 469 | 485 | ///二微码 |
| 470 | - var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
| 471 | - os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; | |
| 486 | + // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
| 487 | + // os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo"; | |
| 488 | + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
| 489 | + os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo"; | |
| 472 | 490 | |
| 473 | 491 | |
| 474 | 492 | // 读取文件成功则OK-- |
| ... | ... | @@ -954,32 +972,41 @@ Page({ |
| 954 | 972 | |
| 955 | 973 | //------ 分享配置 -------- |
| 956 | 974 | onShareAppMessage: function (e) { |
| 957 | - var th=this; | |
| 958 | - var scene=this.data.teamgroup.id; | |
| 959 | - var url="/pages/team/team_show/team_show?tg_id="+scene; | |
| 960 | - //--分享图片-- | |
| 961 | - var img=th.data.iurl+th.data.teamlist.share_imgurl; | |
| 962 | - //--把会员分享出去-- | |
| 963 | - if(getApp().globalData.user_id){ | |
| 964 | - if(url.indexOf("?")>0) | |
| 965 | - url+="&first_leader="+getApp().globalData.user_id; | |
| 966 | - else | |
| 967 | - url+="?first_leader="+getApp().globalData.user_id; | |
| 968 | - } | |
| 969 | - // console.log('url+++++>>>>>', url, th.data.teamlist.title); | |
| 970 | - | |
| 971 | - var share_title=th.data.teamlist.title; | |
| 972 | - if(th.data.teamlist.share_title){ | |
| 973 | - share_title=th.data.teamlist.share_title; | |
| 975 | + var pagePath = `packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=${this.data.param.goods_id}&prom_type=9&group_id=${this.data.param.group_id}`; //当前页面url | |
| 976 | + // console.log('pagePath=====xxxxxx>', pagePath); | |
| 977 | + var imgPath = this.data.iurl + this.data.luckyGoInfo.original_img; | |
| 978 | + if (pagePath.indexOf('/') != 0) { | |
| 979 | + pagePath = '/' + pagePath; | |
| 974 | 980 | } |
| 975 | - | |
| 981 | + // if(getApp().globalData.user_id){ | |
| 982 | + | |
| 983 | + // if(pagePath.indexOf("?")>0){ | |
| 984 | + // pagePath+="&first_leader="+getApp().globalData.user_id; | |
| 985 | + // }else{ | |
| 986 | + // pagePath+="?first_leader="+getApp().globalData.user_id; | |
| 987 | + // } | |
| 988 | + // } | |
| 976 | 989 | return { |
| 977 | - path:url, | |
| 978 | - title: share_title, | |
| 979 | - imageUrl: img, | |
| 990 | + title: "邀您一起参加幸运购", | |
| 991 | + path: pagePath, | |
| 992 | + imageUrl: imgPath, | |
| 980 | 993 | } |
| 981 | 994 | }, |
| 982 | 995 | |
| 996 | + // onShareTimeline() { | |
| 997 | + // // var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:''; | |
| 998 | + // // var pagePath = this.route; //当前页面url | |
| 999 | + | |
| 1000 | + // // if(!store_name) store_name = getApp().globalData.setting.appName; | |
| 1001 | + // // if (pagePath.indexOf('/') != 0) { | |
| 1002 | + // // pagePath = '/' + pagePath; | |
| 1003 | + // // } | |
| 1004 | + // // return { | |
| 1005 | + // // title: store_name + '-幸运购活动列表', | |
| 1006 | + // // path: pagePath, | |
| 1007 | + // // } | |
| 1008 | + // }, | |
| 1009 | + | |
| 983 | 1010 | clickShare() { |
| 984 | 1011 | this.setData({ |
| 985 | 1012 | share_hidden: true, |
| ... | ... | @@ -1123,55 +1150,153 @@ Page({ |
| 1123 | 1150 | |
| 1124 | 1151 | // 获取幸运购参团情况 |
| 1125 | 1152 | async get_team_info () { |
| 1126 | - var th = this; | |
| 1127 | - // 幸运购成团信息 | |
| 1128 | - await getApp().request.promiseGet("/api/weshop/prom/luckyActivity/page", { | |
| 1129 | - data: { | |
| 1130 | - store_id: o.stoid, | |
| 1131 | - is_end: 0, | |
| 1132 | - timetype: 1, | |
| 1133 | - id: this.data.param.group_id, | |
| 1134 | - } | |
| 1135 | - }).then(res => { | |
| 1136 | - var luckyGoInfo = res.data.data.pageData[0]; | |
| 1137 | - var team_id = luckyGoInfo.team_id; | |
| 1153 | + var th = this; | |
| 1154 | + var team_id; | |
| 1155 | + var luckyGoInfo; | |
| 1156 | + var user_id = getApp().globalData.user_id; | |
| 1138 | 1157 | |
| 1139 | - th.setData({ | |
| 1140 | - luckyGoInfo, | |
| 1141 | - team_id, | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + // 邀请链接待完善 | |
| 1161 | + | |
| 1162 | + getApp().request.promiseGet("/api/weshop/prom/luckyActivity/page", { | |
| 1163 | + data: { | |
| 1164 | + store_id: o.stoid, | |
| 1165 | + is_end: 0, | |
| 1166 | + timetype: 1, | |
| 1167 | + id: th.data.param.group_id, | |
| 1168 | + } | |
| 1169 | + }).then(res => { | |
| 1170 | + if(res.data.code == 0) { | |
| 1171 | + | |
| 1172 | + luckyGoInfo = res.data.data.pageData[0]; | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + // else { | |
| 1177 | + // team_id = luckyGoInfo.team_id; | |
| 1178 | + | |
| 1179 | + // // 待完善 | |
| 1180 | + // if(luckyGoInfo.team_id == 0) { | |
| 1181 | + // team_id = wx.getStorageSync('team_id'); | |
| 1182 | + // }; | |
| 1183 | + | |
| 1184 | + // }; | |
| 1185 | + | |
| 1186 | + th.setData({ | |
| 1187 | + luckyGoInfo, | |
| 1188 | + }); | |
| 1189 | + | |
| 1190 | + //参团成功后,检查team_id | |
| 1191 | + //如果team_id为0, 表示当前已开启新的一期,文字提示应改为’参团成功,本期幸运购已开团,中奖结果可点击下方查看参团列表‘ | |
| 1192 | + //如果team_id为0,取出之前保存的team_id替换掉,请求上一期已成团的幸运购活动 | |
| 1193 | + //如果从会员中心的幸运购列表邀请好友点击进来,不执行storage操作 | |
| 1194 | + if(th.data.param.from == 1) return false; | |
| 1195 | + // if(team_id > 0) { | |
| 1196 | + // wx.setStorage({ | |
| 1197 | + // key: 'team_id', | |
| 1198 | + // data: team_id, | |
| 1199 | + // }); | |
| 1200 | + // console.log('存储team_id', team_id); | |
| 1201 | + // } else { | |
| 1202 | + // let team_id2 = wx.getStorageSync('team_id'); | |
| 1203 | + // console.log('获取team_id', team_id2); | |
| 1204 | + // th.setData({ | |
| 1205 | + // team_id: team_id2, | |
| 1206 | + // // isSuccess: true, | |
| 1207 | + // }); | |
| 1208 | + // }; | |
| 1209 | + | |
| 1210 | + // th.setData({ | |
| 1211 | + // luckyGoInfo, | |
| 1212 | + // team_id, | |
| 1213 | + // }); | |
| 1214 | + | |
| 1215 | + }; | |
| 1216 | + | |
| 1217 | + }); | |
| 1218 | + | |
| 1219 | + if(th.data.param.from == 1) { | |
| 1220 | + team_id = th.data.param.team_id; | |
| 1221 | + } else { | |
| 1222 | + | |
| 1223 | + // 单独获取最新的team_id; | |
| 1224 | + await getApp().request.promiseGet("/api/weshop/prom/luckyOrder/getUserOrderLastInfo/" + o.stoid + "/" + user_id + "/" + th.data.param.group_id, { | |
| 1225 | + data: { | |
| 1226 | + } | |
| 1227 | + }).then(res => { | |
| 1228 | + | |
| 1229 | + if(res.data.code == 0) { | |
| 1230 | + | |
| 1231 | + // if(th.data.param.from == 1) { | |
| 1232 | + // team_id = luckyGoInfo.team_id; | |
| 1233 | + // } else { | |
| 1234 | + // team_id = res.data.data.team_id; | |
| 1235 | + // }; | |
| 1236 | + | |
| 1237 | + team_id = res.data.data.team_id; | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + th.setData({ | |
| 1241 | + team_id, | |
| 1242 | + }); | |
| 1243 | + | |
| 1244 | + }; | |
| 1245 | + | |
| 1142 | 1246 | }); |
| 1143 | 1247 | |
| 1144 | - //参团成功后,检查team_id | |
| 1145 | - //如果team_id为0, 表示当前已开启新的一期,文字提示应改为’参团成功,本期幸运购已开团,中奖结果可点击下方查看参团列表‘ | |
| 1146 | - //如果team_id为0,取出之前保存的team_id替换掉,请求上一期已成团的幸运购活动 | |
| 1147 | - if(team_id != 0) { | |
| 1148 | - wx.setStorage({ | |
| 1149 | - key: 'team_id', | |
| 1150 | - data: team_id, | |
| 1151 | - }); | |
| 1152 | - } else { | |
| 1153 | - let team_id = wx.getStorageSync('team_id'); | |
| 1154 | - th.setData({ | |
| 1155 | - team_id: team_id, | |
| 1156 | - isSuccess: true, | |
| 1157 | - }); | |
| 1158 | - }; | |
| 1159 | - | |
| 1160 | - }); | |
| 1248 | + }; | |
| 1249 | + // wx.removeStorageSync('team_id'); | |
| 1250 | + | |
| 1251 | + | |
| 1161 | 1252 | |
| 1162 | 1253 | // 幸运购成团成员 |
| 1163 | 1254 | await getApp().request.promiseGet("/api/weshop/prom/luckyOrder/page", { |
| 1164 | 1255 | data: { |
| 1165 | 1256 | store_id: o.stoid, |
| 1166 | - team_id: this.data.team_id, | |
| 1257 | + team_id: team_id, | |
| 1167 | 1258 | } |
| 1168 | 1259 | }).then(res => { |
| 1169 | - th.setData({ | |
| 1170 | - luckyGoMembers: res.data.data.pageData, | |
| 1171 | - }); | |
| 1172 | - }); | |
| 1260 | + if(res.data.code == 0) { | |
| 1261 | + console.log('当前参团成员', res, team_id); | |
| 1262 | + let myId = getApp().globalData.userInfo.user_id; | |
| 1263 | + let luckyGoMembers = res.data.data.pageData; | |
| 1264 | + th.setData({ | |
| 1265 | + luckyGoMembers, | |
| 1266 | + }); | |
| 1267 | + | |
| 1268 | + self.isMe(myId, luckyGoMembers); | |
| 1269 | + }; | |
| 1270 | + | |
| 1271 | + }); | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1173 | 1275 | |
| 1174 | 1276 | }, |
| 1277 | + | |
| 1278 | + // 判断自己是否中奖 | |
| 1279 | + isMe(myId, list) { | |
| 1280 | + list.some((item, index) => { | |
| 1281 | + if(item.team_status == 2) { | |
| 1282 | + if(item.user_id == myId) { | |
| 1283 | + self.setData({ | |
| 1284 | + iWin: true | |
| 1285 | + }); | |
| 1286 | + return true; | |
| 1287 | + }; | |
| 1288 | + } | |
| 1289 | + }); | |
| 1290 | + }, | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + //-----图片失败,默认图片----- | |
| 1294 | + bind_bnerr: function (e) { | |
| 1295 | + var _errImg = e.target.dataset.errorimg; | |
| 1296 | + var _errObj = {}; | |
| 1297 | + _errObj[_errImg] = '/miniapp/images/default_g_img.gif'; | |
| 1298 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 1299 | + }, | |
| 1175 | 1300 | |
| 1176 | 1301 | |
| 1177 | 1302 | ... | ... |
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.json
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml
| ... | ... | @@ -4,9 +4,9 @@ |
| 4 | 4 | |
| 5 | 5 | |
| 6 | 6 | <view class="flex pd20 bg-white"> |
| 7 | - <view class="img-container shrink0" data-content="已团{{luckyGoInfo.group_joined}}件"> | |
| 8 | - <image class="img-block" src="{{iurl + luckyGoInfo.original_img}}" data-val="{{luckyGoInfo.original_img}}" | |
| 9 | - data-errorimg="luckyGoInfo.original_img" binderror="bind_bnerr" lazy-load="true"></image> | |
| 7 | + <!-- <view class="img-container shrink0" data-content="已团{{luckyGoInfo.group_joined}}件"> --> | |
| 8 | + <view class="img-container shrink0" data-content=""> | |
| 9 | + <image class="img-block" src="{{iurl + luckyGoInfo.original_img}}" data-errorimg="luckyGoInfo.original_img" binderror="bind_bnerr" lazy-load="true"></image> | |
| 10 | 10 | </view> |
| 11 | 11 | <view class="mgl20 flex fdc jc_sb f1 pdv10"> |
| 12 | 12 | <!----//图片区域----> |
| ... | ... | @@ -16,12 +16,17 @@ |
| 16 | 16 | <view class="flex-vertical-between"> |
| 17 | 17 | <view> |
| 18 | 18 | <view class="fs40 xc-wc rmb">{{filters.price(luckyGoInfo.group_price)}}</view> |
| 19 | - <view class="fs22 word-line c-7b">零售价<text class="rmb">{{luckyGoInfo.market_price}}</text></view> | |
| 19 | + <view class="fs22 word-line c-7b"> | |
| 20 | + <!-- 手店价<text class="rmb">{{luckyGoInfo.shop_price}}</text> --> | |
| 21 | + <!-- <block wx:if="{{card_field && sele_g[card_field]>0}}"><text class="rmb lh1">{{sele_g[card_field]}}</text></block> | |
| 22 | + <block wx:else><text class="rmb lh1">{{sele_g.shop_price}}</text></block> --> | |
| 23 | + </view> | |
| 20 | 24 | </view> |
| 21 | 25 | <view class="xc-wc fs24"> |
| 22 | 26 | <view> |
| 23 | - <!-- <view class="">已拼{{teamlist.buy_num}}DDD件</view> --> | |
| 24 | - <view class="t-c">待成团</view> | |
| 27 | + <!-- luckyGoMembers.create_time 为0,表示还没开团 --> | |
| 28 | + <view class="t-c" wx:if="{{luckyGoMembers[0].create_time > 0}}">已成团</view> | |
| 29 | + <view class="t-c" wx:else>待成团</view> | |
| 25 | 30 | <view class="flex xc-valframe t-c"> |
| 26 | 31 | <view class="xc-frame-img"> |
| 27 | 32 | <image class="picture" src="{{iurl}}/miniapp/images/bai-ren.png"></image> |
| ... | ... | @@ -39,7 +44,7 @@ |
| 39 | 44 | <view class="mgt20 bg-white pr"> |
| 40 | 45 | <view class="rules fs24" bindtap="showRules">规则 <text class="iconfont icon-arrow_right fs24"></text></view> |
| 41 | 46 | <!-- 阶梯团 --> |
| 42 | - <view class='bodytop' wx:if="{{teamlist.kttype==3&& p_status==1}}"> | |
| 47 | + <!-- <view class='bodytop' wx:if="{{teamlist.kttype==3&& p_status==1}}"> | |
| 43 | 48 | 当前价格 |
| 44 | 49 | <text class="xc-wc">¥{{ct_price}}</text>, |
| 45 | 50 | <block wx:if="{{max_num-ordertx.length>0}}"> |
| ... | ... | @@ -48,11 +53,11 @@ |
| 48 | 53 | <block wx:else> |
| 49 | 54 | 该团已经拼购到最低价了哦~ |
| 50 | 55 | </block> |
| 51 | - </view> | |
| 56 | + </view> --> | |
| 52 | 57 | |
| 53 | 58 | |
| 54 | 59 | <!-- 拼团成功 --> |
| 55 | - <view class="xc-ptcomplete-ladder flex-level fs28" wx:if="{{teamlist.kttype==3&&p_status==2}}"> | |
| 60 | + <!-- <view class="xc-ptcomplete-ladder flex-level fs28" wx:if="{{teamlist.kttype==3&&p_status==2}}"> | |
| 56 | 61 | <view class="xc-wc">拼团成功</view>,当前价格 |
| 57 | 62 | <text class="xc-wc">¥{{ct_price}}</text> |
| 58 | 63 | <view class="xc-img-frame oh"> |
| ... | ... | @@ -60,20 +65,26 @@ |
| 60 | 65 | </view> |
| 61 | 66 | </view> |
| 62 | 67 | |
| 63 | - <view style="height: 20rpx" wx:if="{{teamlist.kttype==3&&p_status==4}}"></view> | |
| 68 | + <view style="height: 20rpx" wx:if="{{teamlist.kttype==3&&p_status==4}}"></view> --> | |
| 64 | 69 | |
| 65 | 70 | |
| 66 | 71 | <!-- 阶梯团失败 --> |
| 67 | 72 | <!-- <view class="pdt50 pdb30 pdh20" wx:if="{{pay_f==1 || order.pt_status==3}}"> --> |
| 68 | 73 | <view class="pdt50 pdb30 pdh20"> |
| 69 | 74 | <block wx:if="{{team_id != 0}}"> |
| 70 | - <view class="fs28 t-c" wx:if="{{!isSuccess}}">参团成功,还差{{filters.show_default(luckyGoInfo.group_num, '0') - filters.show_default(luckyGoInfo.num, '0')}}人即可成团,请留意成员开奖通知!</view> | |
| 71 | - <view class="fs28 t-c" wx:else>参团成功,本期幸运购已开团!</view> | |
| 75 | + <view class="fs28 t-c" wx:if="{{luckyGoMembers[0].create_time > 0}}"> | |
| 76 | + <view>参团成功,本期幸运购已开团!</view> | |
| 77 | + <view class="fs26 t-c c-red">{{iWin ? '恭喜您团中该商品,请等待商家发货~':'很遗憾您未团中,可获得一份帮团奖励,再接再厉噢~'}}</view> | |
| 78 | + </view> | |
| 79 | + <view class="fs28 t-c" wx:else>您已参团成功,还差{{filters.show_default(luckyGoInfo.group_num, '0') - filters.show_default(luckyGoInfo.num, '0')}}人参与即可成团!</view> | |
| 72 | 80 | </block> |
| 81 | + | |
| 73 | 82 | <block wx:if="{{team_id == 0 && param.from}}"> |
| 74 | 83 | <view class="fs28 t-c">组团中,还差{{filters.show_default(luckyGoInfo.group_num, '0') - filters.show_default(luckyGoInfo.num, '0')}}人即可成团!</view> |
| 75 | 84 | </block> |
| 76 | - <view class="fs24 t-c c-red">未团中可获得帮团奖励</view> | |
| 85 | + | |
| 86 | + <!-- <view class="fs26 t-c c-red">快去邀请小伙伴一起参与吧~</view> --> | |
| 87 | + | |
| 77 | 88 | <!-- <view class="xc-img-frame oh" > |
| 78 | 89 | <image class="img" src="{{iurl}}/miniapp/images/xc-qtshibai.png"></image> |
| 79 | 90 | </view> --> |
| ... | ... | @@ -81,16 +92,16 @@ |
| 81 | 92 | |
| 82 | 93 | |
| 83 | 94 | <!-- 拼团成功 --> |
| 84 | - <view class="xc-ptcomplete flex-level fs28" wx:if="{{p_status==2 && (teamlist.kttype==2||teamlist.kttype==1)}}"> | |
| 95 | + <!-- <view class="xc-ptcomplete flex-level fs28" wx:if="{{p_status==2 && (teamlist.kttype==2||teamlist.kttype==1)}}"> | |
| 85 | 96 | <view class="xc-wc">拼团成功</view>,为您节省 |
| 86 | 97 | <text class="xc-wc">{{filters.toFix(goods.market_price-teamlist.price,2)}}</text>元 |
| 87 | 98 | <view class="xc-img-frame oh"> |
| 88 | 99 | <image class="img" src="{{iurl}}/miniapp/images/xc_qtcg.png"></image> |
| 89 | 100 | </view> |
| 90 | 101 | </view> |
| 91 | - <view></view> | |
| 102 | + <view></view> --> | |
| 92 | 103 | <!----//// //头像----> |
| 93 | - <view class="flex_tou pdv30"> | |
| 104 | + <view class="flex_tou pdv20"> | |
| 94 | 105 | <view class="flex jc-center"> |
| 95 | 106 | <view class="d" wx:if="{{team_id == 0 && param.from}}"> |
| 96 | 107 | <image class="img-block" src='{{iurl}}/miniapp/images/shafa.png'></image> |
| ... | ... | @@ -162,7 +173,7 @@ |
| 162 | 173 | <view class='fs30 xc-green' wx:if='{{teamlist.kttype==3&&p_status==2}}'> |
| 163 | 174 | 拼团成功, 规定时间内支付尾款即发货 |
| 164 | 175 | </view> |
| 165 | - <view class="xc-wc fs30 t-c xc-onclik" wx:if="{{p_status==1}}"> | |
| 176 | + <view class="xc-wc fs30 t-c xc-onclik" wx:if="{{!(luckyGoMembers[0].create_time > 0)}}"> | |
| 166 | 177 | 点击下方按钮分享给小伙伴,可快速成团! |
| 167 | 178 | </view> |
| 168 | 179 | |
| ... | ... | @@ -188,11 +199,11 @@ |
| 188 | 199 | <!-- </view> --> |
| 189 | 200 | <!-- </block> --> |
| 190 | 201 | <view class="flex jc-center ai-center fs26" hidden="{{hiddenName}}" bindtap="click"> |
| 191 | - 查看拼团列表<text class="down-arrow1"></text> | |
| 202 | + 查看参团成员<text class="down-arrow1"></text> | |
| 192 | 203 | </view> |
| 193 | 204 | |
| 194 | 205 | <view class='bodyfoot'> |
| 195 | - <view class="fs26" wx:if="{{zk}}" bindtap="czk">查看拼团列表<view class='down-arrow'></view></view> | |
| 206 | + <view class="fs26" wx:if="{{zk}}" bindtap="czk">查看参团成员<view class='down-arrow'></view></view> | |
| 196 | 207 | |
| 197 | 208 | <!-- {{ordertx}} --> |
| 198 | 209 | <view class="flex ai-center jc_sb pdh30 pdv20 fs26" hidden="{{hiddenName}}" wx:for="{{luckyGoMembers}}" wx:for-index="ky"> |
| ... | ... | @@ -202,7 +213,7 @@ |
| 202 | 213 | </view> |
| 203 | 214 | <view class="mgl20 t-l"> |
| 204 | 215 | <view>{{item.nickname}}</view> |
| 205 | - <view class="c-7b">参团编号:<text class="c-red">{{item.team_sn}}</text></view> | |
| 216 | + <!-- <view class="c-7b">参团编号:<text class="c-red">{{item.team_sn}}</text></view> --> | |
| 206 | 217 | </view> |
| 207 | 218 | </view> |
| 208 | 219 | |
| ... | ... | @@ -229,7 +240,7 @@ |
| 229 | 240 | <view class="pdh20 f1"> |
| 230 | 241 | <button class="btn-red pdh20 fs24" bindtap="gohome">返回首页</button> |
| 231 | 242 | </view> |
| 232 | - <view class="pdh20 f1"> | |
| 243 | + <view class="pdh20 f1" wx:if="{{!(luckyGoMembers[0].create_time > 0)}}"> | |
| 233 | 244 | <button class="btn-yellow pdh20 fs24" bindtap="clickShare">邀请好友参团</button> |
| 234 | 245 | </view> |
| 235 | 246 | <!-- <button class="btn-red pdh20 fs24" bindtap="gohome">返回首页</button> |
| ... | ... | @@ -320,7 +331,7 @@ |
| 320 | 331 | </block> |
| 321 | 332 | |
| 322 | 333 | <!-- 分享控件,底部弹出 --> |
| 323 | -<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share> | |
| 334 | +<share id="share_button" bind:send="onShareAppMessage" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share> | |
| 324 | 335 | |
| 325 | 336 | |
| 326 | 337 | <view wx:if="{{showPoster}}"> |
| ... | ... | @@ -346,7 +357,6 @@ |
| 346 | 357 | <!-- 遮罩层 --> |
| 347 | 358 | <view class="mask" bindtap="close_all" catchtouchmove="true" wx:if="{{showRules}}"></view> |
| 348 | 359 | <!-- 规则详情和提示信息弹窗 --> |
| 349 | - <!-- <view class="rule-pop-container" wx:if="{{showRule}}"> --> | |
| 350 | 360 | <view class="rule-pop-container" wx:if="{{showRules}}"> |
| 351 | 361 | <view class="pop-title">规则详情 |
| 352 | 362 | <text class="iconfont icon-guan" bindtap="closeRules"></text> |
| ... | ... | @@ -365,9 +375,13 @@ |
| 365 | 375 | |
| 366 | 376 | |
| 367 | 377 | <view class="pdv20"> |
| 368 | - <view class="btn" bindtap="closeRule">我知道了</view> | |
| 378 | + <view class="btn" bindtap="closeRules">我知道了</view> | |
| 369 | 379 | </view> |
| 370 | - </view> | |
| 380 | + </view>. | |
| 381 | + | |
| 382 | + | |
| 383 | + <!-- 制作一个圆球导航 --> | |
| 384 | + <nav_box></nav_box> | |
| 371 | 385 | |
| 372 | 386 | |
| 373 | 387 | ... | ... |
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxss
| ... | ... | @@ -145,7 +145,7 @@ margin-top: 30rpx; |
| 145 | 145 | height:100rpx; |
| 146 | 146 | border-radius: 50%; |
| 147 | 147 | overflow: hidden; |
| 148 | - background-color: white; | |
| 148 | + background-color: #f2f2f2; | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | .d ~ .d { |
| ... | ... | @@ -979,6 +979,7 @@ height:40rpx; |
| 979 | 979 | height: 60rpx; |
| 980 | 980 | border-radius: 50%; |
| 981 | 981 | overflow: hidden; |
| 982 | + background-color: #f2f2f2; | |
| 982 | 983 | } |
| 983 | 984 | |
| 984 | 985 | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
| ... | ... | @@ -18,7 +18,8 @@ |
| 18 | 18 | ¥ {{sele_g.shop_price}} |
| 19 | 19 | </block> |
| 20 | 20 | </view> |
| 21 | - <view class="spec-goods-price" wx:else>¥ {{prom_price || filters.div100(luckGoInfo.group_price)}}</view> | |
| 21 | + <view class="spec-goods-price" wx:else>¥ {{filters.div100(luckGoInfo.group_price)}}</view> | |
| 22 | + <!-- <view class="spec-goods-price" wx:else>¥ bbb{{prom_price || filters.div100(luckGoInfo.group_price)}}</view> --> | |
| 22 | 23 | </view> |
| 23 | 24 | |
| 24 | 25 | <block wx:if="{{is_normal==1}}"> |
| ... | ... | @@ -28,7 +29,7 @@ |
| 28 | 29 | <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view> |
| 29 | 30 | <view class="spec-goods-stock" wx:else>可售:0</view> |
| 30 | 31 | </block> |
| 31 | - <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block> | |
| 32 | + <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block> | |
| 32 | 33 | </view> |
| 33 | 34 | </block> |
| 34 | 35 | <!-- <block wx:if="{{is_normal==0}}"> |
| ... | ... | @@ -195,7 +196,7 @@ |
| 195 | 196 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> |
| 196 | 197 | </block> |
| 197 | 198 | <block wx:else> |
| 198 | - <view bindtap="addCart" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view> | |
| 199 | + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view> | |
| 199 | 200 | </block> |
| 200 | 201 | |
| 201 | 202 | </block> |
| ... | ... | @@ -212,7 +213,7 @@ |
| 212 | 213 | <view class="spec-cart-btn spec-buy w100" style="background-color: #dcdcdc;color: #999;">配送不匹配</view> |
| 213 | 214 | </block> |
| 214 | 215 | <block wx:else> |
| 215 | - <view bindtap="addCart" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view> | |
| 216 | + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view> | |
| 216 | 217 | </block> |
| 217 | 218 | </block> |
| 218 | 219 | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
| ... | ... | @@ -273,16 +273,24 @@ Page({ |
| 273 | 273 | }], |
| 274 | 274 | |
| 275 | 275 | |
| 276 | + luckGoInfo: {}, | |
| 277 | + showDetails: false, | |
| 278 | + num_success: 0, //成团已中商品数量 | |
| 279 | + isTimeUp: false, | |
| 280 | + | |
| 281 | + surplus: 0, | |
| 282 | + canBuy: false, | |
| 283 | + btnHidden: false, | |
| 276 | 284 | }, |
| 277 | 285 | |
| 278 | 286 | //------初始化加载---------- |
| 279 | 287 | onLoad: function (t) { |
| 280 | - | |
| 281 | - if(t.group_id) { | |
| 288 | + | |
| 289 | + | |
| 290 | + if(t && t.group_id) { | |
| 282 | 291 | this.data.group_id = t.group_id; |
| 283 | 292 | }; |
| 284 | - | |
| 285 | - | |
| 293 | + | |
| 286 | 294 | |
| 287 | 295 | |
| 288 | 296 | var ee = this, |
| ... | ... | @@ -303,35 +311,8 @@ Page({ |
| 303 | 311 | prom_id, |
| 304 | 312 | }); |
| 305 | 313 | } |
| 306 | - console.log('type********>>',this.data.prom_type); | |
| 307 | - //-- 自定义海报 -- | |
| 308 | - // getApp().request.promiseGet("/api/weshop/goods/poster/page", { | |
| 309 | - // data: { store_id: os.stoid, type: 1, is_use: 1 } | |
| 310 | - // }).then(res => { | |
| 311 | - // if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]) { | |
| 312 | - | |
| 313 | - // var poster_data = res.data.data.pageData[0]; | |
| 314 | - // var json_str = poster_data.jsonStr; | |
| 315 | - | |
| 316 | - // if (json_str) { | |
| 317 | - // var json_data = JSON.parse(json_str); | |
| 318 | - // if (json_data.bg_img) { | |
| 319 | - | |
| 320 | - // //-- 把图片那到本地 -- | |
| 321 | - // wx.getImageInfo({ | |
| 322 | - // src: json_data.bg_img, | |
| 323 | - // success: function (res) { | |
| 324 | - // var path = res.path; | |
| 325 | - // th.setData({ share_b_img: path }) | |
| 326 | - // }, | |
| 327 | - // fail: function (res) { } | |
| 328 | - // }); | |
| 329 | - // } | |
| 330 | - // th.setData({ poster: json_data }) | |
| 331 | - | |
| 332 | - // } | |
| 333 | - // } | |
| 334 | - // }) | |
| 314 | + | |
| 315 | + | |
| 335 | 316 | |
| 336 | 317 | |
| 337 | 318 | //---获取手机地址坐标-- |
| ... | ... | @@ -448,7 +429,6 @@ Page({ |
| 448 | 429 | var user = getApp().globalData.userInfo; |
| 449 | 430 | if (!user) return false; |
| 450 | 431 | clearInterval(ti); |
| 451 | - | |
| 452 | 432 | if (user.card_field && user['card_expiredate']) { |
| 453 | 433 | var str = user['card_expiredate'].replace(/-/g, '/'); |
| 454 | 434 | var end = new Date(str); |
| ... | ... | @@ -540,6 +520,16 @@ Page({ |
| 540 | 520 | getApp().request.put("/api/weshop/goods/updateClick", { |
| 541 | 521 | data: { store_id: os.stoid, goods_id: gid } |
| 542 | 522 | }); |
| 523 | + | |
| 524 | + | |
| 525 | + //--先判断会员登陆状态-- | |
| 526 | + var user_info = getApp().globalData.userInfo; | |
| 527 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 528 | + wx.navigateTo({ | |
| 529 | + url: '/pages/togoin/togoin', | |
| 530 | + }) | |
| 531 | + return false; | |
| 532 | + } | |
| 543 | 533 | |
| 544 | 534 | }, |
| 545 | 535 | |
| ... | ... | @@ -762,6 +752,63 @@ Page({ |
| 762 | 752 | return false; |
| 763 | 753 | } |
| 764 | 754 | |
| 755 | + // 判断活动是否暂停 | |
| 756 | + //获取单个活动成团信息 | |
| 757 | + await getApp().request.promiseGet('/api/weshop/prom/luckyActivity/page', { | |
| 758 | + data: { | |
| 759 | + store_id: o.stoid, | |
| 760 | + is_end: 0, | |
| 761 | + timetype: 1, | |
| 762 | + id: this.data.group_id, | |
| 763 | + } | |
| 764 | + }).then(res => { | |
| 765 | + if (res.data.code == 0) { | |
| 766 | + console.log('成团信息=======》', res.data.data); | |
| 767 | + if(res.data.data.pageData && res.data.data.pageData.length == 0) { | |
| 768 | + let obj = { | |
| 769 | + day: '00', | |
| 770 | + hou: '00', | |
| 771 | + min: '00', | |
| 772 | + sec: '00' | |
| 773 | + }; | |
| 774 | + | |
| 775 | + th.setData({ | |
| 776 | + djs: obj, | |
| 777 | + isTimeUp: true, | |
| 778 | + }); | |
| 779 | + } else { | |
| 780 | + th.setData({ | |
| 781 | + luckGoInfo: res.data.data.pageData[0], | |
| 782 | + team_id: res.data.data.pageData[0].team_id, | |
| 783 | + luckGoMembers: [], | |
| 784 | + }); | |
| 785 | + | |
| 786 | + th.countDown(th.data.luckGoInfo.end_time, 0); | |
| 787 | + }; | |
| 788 | + | |
| 789 | + } else { | |
| 790 | + this.data.isTimeUp = true; | |
| 791 | + th.setData({ | |
| 792 | + isTimeUp: true, | |
| 793 | + }); | |
| 794 | + | |
| 795 | + }; | |
| 796 | + | |
| 797 | + | |
| 798 | + }); | |
| 799 | + // 活动暂停显示空白 | |
| 800 | + if (this.data.isTimeUp) { | |
| 801 | + wx.showModal({ | |
| 802 | + title: '提示', | |
| 803 | + content: '活动已经暂停', | |
| 804 | + showCancel: false, | |
| 805 | + success: function(){ | |
| 806 | + wx.navigateBack(); | |
| 807 | + } | |
| 808 | + }) | |
| 809 | + return false; | |
| 810 | + } | |
| 811 | + | |
| 765 | 812 | //优惠券要实时更新 |
| 766 | 813 | getApp().getConfig2(function (e) { |
| 767 | 814 | var json_d = JSON.parse(e.switch_list); |
| ... | ... | @@ -830,26 +877,7 @@ Page({ |
| 830 | 877 | title: t.data.data.goods_name, |
| 831 | 878 | }); |
| 832 | 879 | |
| 833 | - //-- 判断是不是组合购活动,必须要登录后才能判断 -- | |
| 834 | - // if (getApp().globalData.userInfo && t.data.data.prom_type == 7) { | |
| 835 | - // //获取活动信息 | |
| 836 | - // var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + | |
| 837 | - // t.data.data.prom_id + "/" + getApp().globalData.user_id; | |
| 838 | - // getApp().request.get(url, { | |
| 839 | - // success: function (e) { | |
| 840 | - // if (e.data.code == 0 && e.data.data) { | |
| 841 | - // if (ut.gettimestamp() < e.data.data.start_time) { | |
| 842 | - // return false; | |
| 843 | - // } | |
| 844 | - // if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) { | |
| 845 | - // //-- 获取商品列表 -- | |
| 846 | - // th.setData({ zh_act: e.data.data }); | |
| 847 | - // } | |
| 848 | - | |
| 849 | - // } | |
| 850 | - // } | |
| 851 | - // }); | |
| 852 | - // } | |
| 880 | + | |
| 853 | 881 | |
| 854 | 882 | //-- 把商品的赋值 -- |
| 855 | 883 | ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data)); |
| ... | ... | @@ -982,8 +1010,8 @@ Page({ |
| 982 | 1010 | } |
| 983 | 1011 | }); |
| 984 | 1012 | this.data.enterAddressPage && (this.data.enterAddressPage = !1); |
| 985 | - | |
| 986 | - | |
| 1013 | + | |
| 1014 | + | |
| 987 | 1015 | //获取单个活动已成团数量 |
| 988 | 1016 | getApp().request.get(`/api/weshop/prom/luckyTeam/getCtNum/${o.stoid}/${this.data.group_id}`, { |
| 989 | 1017 | success: function (res) { |
| ... | ... | @@ -994,8 +1022,8 @@ Page({ |
| 994 | 1022 | } |
| 995 | 1023 | } |
| 996 | 1024 | }); |
| 997 | - | |
| 998 | - | |
| 1025 | + | |
| 1026 | + | |
| 999 | 1027 | //获取单个活动中奖记录 |
| 1000 | 1028 | getApp().request.promiseGet('/api/weshop/prom/luckyOrder/page', { |
| 1001 | 1029 | data: { |
| ... | ... | @@ -1013,26 +1041,42 @@ Page({ |
| 1013 | 1041 | }); |
| 1014 | 1042 | |
| 1015 | 1043 | |
| 1016 | - //获取单个活动成团信息 | |
| 1017 | - await getApp().request.promiseGet('/api/weshop/prom/luckyActivity/page', { | |
| 1018 | - data: { | |
| 1019 | - store_id: o.stoid, | |
| 1020 | - is_end: 0, | |
| 1021 | - timetype: 1, | |
| 1022 | - id: this.data.group_id, | |
| 1044 | + //获取单个活动成团已中商品数量 | |
| 1045 | + let url_num_success = `/api/weshop/prom/luckyOrder/countActNum/${os.stoid}/${this.data.group_id}`; | |
| 1046 | + getApp().request.get(url_num_success, { | |
| 1047 | + success: function (res) { | |
| 1048 | + if (res.data.code == 0) { | |
| 1049 | + console.log('成团已中商品数量汇总',res.data.data); | |
| 1050 | + th.setData({ | |
| 1051 | + num_success: res.data.data, | |
| 1052 | + }); | |
| 1053 | + } | |
| 1023 | 1054 | } |
| 1024 | - }).then(res => { | |
| 1025 | - if (res.data.code == 0) { | |
| 1026 | - // console.log('成团信息=======》', res.data.data); | |
| 1027 | - th.setData({ | |
| 1028 | - luckGoInfo: res.data.data.pageData[0], | |
| 1029 | - team_id: res.data.data.pageData[0].team_id, | |
| 1030 | - luckGoMembers: [], | |
| 1031 | - }); | |
| 1032 | - th.countDown(th.data.luckGoInfo.end_time, 0); | |
| 1033 | - }; | |
| 1034 | - | |
| 1035 | - | |
| 1055 | + }); | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + // 获取购买次数,判断是否已经超出限购 | |
| 1062 | + // {store_id}/{user_id}/{aid} | |
| 1063 | + let get_aid = this.data.prom_id || this.data.luckGoInfo.id; | |
| 1064 | + await getApp().request.get('/api/weshop/prom/luckyOrder/countActNum/' + os.stoid + '/' + oo.user_id + '/' + get_aid, { | |
| 1065 | + success: function (res) { | |
| 1066 | + if(res.data.code == 0) { | |
| 1067 | + console.log(oo.user_id, '判断是否超出限购,获取购买次数', res, ); | |
| 1068 | + // th.setData({ | |
| 1069 | + // num_joined: res.data.data, | |
| 1070 | + // }); | |
| 1071 | + let num_joined = res.data.data; | |
| 1072 | + let group_join_num = th.data.luckGoInfo.group_join_num; | |
| 1073 | + let canBuy = num_joined >= group_join_num ? false : true; | |
| 1074 | + th.setData({ | |
| 1075 | + canBuy, | |
| 1076 | + }); | |
| 1077 | + // console.log('canBuy', th.data.canBuy); | |
| 1078 | + }; | |
| 1079 | + }, | |
| 1036 | 1080 | }); |
| 1037 | 1081 | |
| 1038 | 1082 | |
| ... | ... | @@ -1051,23 +1095,54 @@ Page({ |
| 1051 | 1095 | } |
| 1052 | 1096 | }); |
| 1053 | 1097 | |
| 1098 | + var p1 = new Promise((resolve, reject) => { | |
| 1099 | + // 检查幸运购活动商品库存 | |
| 1100 | + getApp().request.get("/api/weshop/activitylist/getActLen/" + o.stoid + "/9/" + this.data.group_id, { | |
| 1101 | + success: function(res) { | |
| 1102 | + //console.log('当前幸运购活动的剩余库存', res.data.data); | |
| 1103 | + if(res.data.code == 0) { | |
| 1104 | + th.setData({ | |
| 1105 | + // 剩余库存量 | |
| 1106 | + surplus: res.data.data, | |
| 1107 | + }); | |
| 1108 | + }; | |
| 1109 | + resolve(); | |
| 1110 | + } | |
| 1111 | + }); | |
| 1112 | + | |
| 1113 | + }); | |
| 1114 | + | |
| 1115 | + var p2 = new Promise((resolve, reject) => { | |
| 1116 | + // 检查是否已经参团购买 | |
| 1117 | + getApp().request.get("/api/weshop/prom/luckyOrder/getUserOrderInfo/" + o.stoid + "/" + oo.user_id + "/" + this.data.group_id, { | |
| 1118 | + success: function(res) { | |
| 1119 | + console.log('当前幸运购活动是否已经参团', res.data.code); | |
| 1120 | + if(res.data.code == 0) { | |
| 1121 | + th.setData({ | |
| 1122 | + showDetails: true, | |
| 1123 | + buyInfo: res.data.data, | |
| 1124 | + }); | |
| 1125 | + } else { | |
| 1126 | + th.setData({ | |
| 1127 | + showDetails: false, | |
| 1128 | + }); | |
| 1129 | + }; | |
| 1130 | + resolve(); | |
| 1131 | + } | |
| 1132 | + }); | |
| 1133 | + | |
| 1134 | + }); | |
| 1135 | + | |
| 1136 | + Promise.all([p1, p2]).then(res => { | |
| 1137 | + th.setData({ | |
| 1138 | + btnHidden: true, | |
| 1139 | + }); | |
| 1140 | + }); | |
| 1054 | 1141 | |
| 1055 | - | |
| 1056 | - | |
| 1057 | - | |
| 1058 | - | |
| 1059 | - | |
| 1060 | - | |
| 1061 | - | |
| 1062 | 1142 | |
| 1063 | 1143 | }, |
| 1064 | 1144 | |
| 1065 | - // 暂时无用 | |
| 1066 | - // enterAddress: function () { | |
| 1067 | - // this.data.enterAddressPage = !0, wx.navigateTo({ | |
| 1068 | - // url: "/pages/user/address_list/address_list?operate=selectAddress" | |
| 1069 | - // }); | |
| 1070 | - // }, | |
| 1145 | + | |
| 1071 | 1146 | |
| 1072 | 1147 | |
| 1073 | 1148 | // 页面卸载 |
| ... | ... | @@ -1094,11 +1169,7 @@ Page({ |
| 1094 | 1169 | 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment(); |
| 1095 | 1170 | }, |
| 1096 | 1171 | |
| 1097 | - // tabClick2: function (t) { | |
| 1098 | - // this.setData({ | |
| 1099 | - // activeCategoryId2: t.currentTarget.id | |
| 1100 | - // }); | |
| 1101 | - // }, | |
| 1172 | + | |
| 1102 | 1173 | |
| 1103 | 1174 | |
| 1104 | 1175 | // 点击评价选项卡下的各评价按钮 |
| ... | ... | @@ -1197,19 +1268,9 @@ Page({ |
| 1197 | 1268 | th.setData({ |
| 1198 | 1269 | open_ind_store: ind |
| 1199 | 1270 | }); |
| 1200 | - //如果是秒杀的话,要看redis够不够 | |
| 1201 | - if (this.data.prom_type == 1) { | |
| 1202 | - this.getactLen(function (num) { | |
| 1203 | - if (num < th.data.goodsInputNum) { | |
| 1204 | - getApp().my_warnning("秒杀库存不足!", 0, th); | |
| 1205 | - return false; | |
| 1206 | - } else { | |
| 1207 | - th.add_cart_func(t); | |
| 1208 | - } | |
| 1209 | - }); | |
| 1210 | - } else { | |
| 1211 | - th.add_cart_func(t); | |
| 1212 | - } | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + th.add_cart_func(t); | |
| 1213 | 1274 | }, |
| 1214 | 1275 | |
| 1215 | 1276 | |
| ... | ... | @@ -1662,13 +1723,13 @@ Page({ |
| 1662 | 1723 | switch (condition_t) { |
| 1663 | 1724 | case 0: //按钱 |
| 1664 | 1725 | if (newd.goods_price >= condition_t) { |
| 1665 | - newd.prom_type = 3; | |
| 1726 | + newd.prom_type = 9; | |
| 1666 | 1727 | newd.prom_id = prom_d[i].prom_id; |
| 1667 | 1728 | } |
| 1668 | 1729 | break |
| 1669 | 1730 | case 1://按购买数量 |
| 1670 | 1731 | if (newd.goods_num >= condition_t) { |
| 1671 | - newd.prom_type = 3; | |
| 1732 | + newd.prom_type = 9; | |
| 1672 | 1733 | newd.prom_id = prom_d[i].prom_id; |
| 1673 | 1734 | } |
| 1674 | 1735 | break; |
| ... | ... | @@ -1707,6 +1768,7 @@ Page({ |
| 1707 | 1768 | // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, { |
| 1708 | 1769 | // action: "buy_now" |
| 1709 | 1770 | // }), |
| 1771 | + var th = this; | |
| 1710 | 1772 | this.setData({ |
| 1711 | 1773 | openSpecModal: 0, |
| 1712 | 1774 | openSpecModal_inte: 0, |
| ... | ... | @@ -1714,34 +1776,45 @@ Page({ |
| 1714 | 1776 | openSpecModal_pt: 0, |
| 1715 | 1777 | }) |
| 1716 | 1778 | |
| 1717 | - if (e.prom_type == 9) { | |
| 1718 | - s.set_b_now(e); | |
| 1719 | - var url = "/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&goods_id=" + e.goods_id; | |
| 1720 | - getApp().goto(url); | |
| 1721 | - } else { | |
| 1779 | + // if (e.prom_type == 9) { | |
| 1780 | + // s.set_b_now(e); | |
| 1781 | + // // var url = ''; | |
| 1782 | + // var url = "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id; | |
| 1783 | + // getApp().goto(url); | |
| 1784 | + // } else | |
| 1785 | + | |
| 1786 | + // if(e.prom_type == 9){ | |
| 1787 | + if(true){ | |
| 1722 | 1788 | //要判断积分购的普通购买有没有参加优惠活动 |
| 1723 | - if (e.is_integral_normal == 1) { | |
| 1789 | + if (e.is_normal == 1) { | |
| 1724 | 1790 | this.check_nor_promgood(e.goods_id, function (res) { |
| 1725 | 1791 | if (res && res.cat_id) { |
| 1726 | 1792 | e.prom_type = 3; |
| 1727 | - e.prom_id = res.cat_id | |
| 1728 | - } | |
| 1793 | + e.prom_id = res.cat_id; | |
| 1794 | + } else { | |
| 1795 | + e.prom_type = 0; | |
| 1796 | + // e.prom_id = 0; | |
| 1797 | + } | |
| 1729 | 1798 | s.set_b_now(e); |
| 1730 | 1799 | /*-- |
| 1731 | 1800 | wx.redirectTo({ |
| 1732 | 1801 | url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, |
| 1733 | 1802 | });--*/ |
| 1734 | - getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&goods_id=" + e.goods_id) | |
| 1803 | + | |
| 1804 | + // console.log('11111111111111111111111111======》'); | |
| 1805 | + // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&goods_id=" + e.goods_id); | |
| 1806 | + getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + th.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + th.data.luckGoInfo.lc_alert); | |
| 1735 | 1807 | |
| 1736 | 1808 | }) |
| 1737 | 1809 | } else { |
| 1738 | - // console.log('xxxxxxxxxxxxx======》', this.data.prom_id); | |
| 1739 | - s.set_b_now(e); | |
| 1810 | + //console.log('222222222222222222222222222222======》'); | |
| 1811 | + //s.set_b_now(e); | |
| 1740 | 1812 | /*-- |
| 1741 | 1813 | wx.redirectTo({ |
| 1742 | 1814 | url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, |
| 1743 | 1815 | });--*/ |
| 1744 | - getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + this.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert); | |
| 1816 | + //getApp().goto("/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&goods_id=" + e.goods_id) | |
| 1817 | + // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&group_id=" + this.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert); | |
| 1745 | 1818 | } |
| 1746 | 1819 | |
| 1747 | 1820 | } |
| ... | ... | @@ -2264,67 +2337,105 @@ Page({ |
| 2264 | 2337 | //--点击分享事件--- |
| 2265 | 2338 | onShareAppMessage: function (t) { |
| 2266 | 2339 | |
| 2267 | - var th = this; | |
| 2268 | - var price = th.data.sele_g.shop_price; | |
| 2269 | - if (th.data.prom_act) { | |
| 2270 | - price = th.data.prom_act.price; | |
| 2340 | + // var th = this; | |
| 2341 | + // var price = th.data.sele_g.shop_price; | |
| 2342 | + // if (th.data.prom_act) { | |
| 2343 | + // price = th.data.prom_act.price; | |
| 2271 | 2344 | |
| 2272 | - } | |
| 2273 | - var title = th.data.sele_g.goods_name; | |
| 2274 | - var img = th.data.sele_g.original_img; | |
| 2275 | - if (th.data.prom_type == 6 || th.data.prom_type == 1 || th.data.prom_type == 4) { | |
| 2276 | - title = th.data.prom_act.share_title; | |
| 2277 | - if (!title) title = th.data.prom_act.title; | |
| 2278 | - if (th.data.prom_type == 4) title = th.data.prom_act.name; | |
| 2279 | - | |
| 2280 | - if (th.data.prom_act.share_imgurl) | |
| 2281 | - img = th.data.iurl + th.data.prom_act.share_imgurl; | |
| 2282 | - } | |
| 2283 | 2345 | |
| 2346 | + // } | |
| 2347 | + // var title = th.data.sele_g.goods_name; | |
| 2348 | + // var img = th.data.sele_g.original_img; | |
| 2349 | + // if (th.data.prom_type == 6 || th.data.prom_type == 1 || th.data.prom_type == 4) { | |
| 2350 | + // title = th.data.prom_act.share_title; | |
| 2351 | + // if (!title) title = th.data.prom_act.title; | |
| 2352 | + // if (th.data.prom_type == 4) title = th.data.prom_act.name; | |
| 2353 | + | |
| 2354 | + // if (th.data.prom_act.share_imgurl) | |
| 2355 | + // img = th.data.iurl + th.data.prom_act.share_imgurl; | |
| 2356 | + // } | |
| 2284 | 2357 | |
| 2285 | - var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" | |
| 2286 | - + th.data.sele_g.goods_id+"&prom_type="+th.data.sele_g.prom_type+"&prom_id="+th.data.sele_g.prom_id; | |
| 2287 | - if (getApp().globalData.user_id) { | |
| 2288 | - url += "&first_leader=" + getApp().globalData.user_id; | |
| 2289 | - } | |
| 2290 | 2358 | |
| 2291 | - //-- 如果房间分享,且不是会员分享的 -- | |
| 2292 | - if (getApp().globalData.room_id && | |
| 2293 | - th.data.sele_g.goods_id == getApp().globalData.room_goods_id && | |
| 2294 | - !getApp().globalData.room_user_share | |
| 2295 | - ) { | |
| 2296 | - url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1"; | |
| 2297 | - } | |
| 2359 | + // var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" | |
| 2360 | + // + th.data.sele_g.goods_id+"&prom_type="+th.data.sele_g.prom_type+"&prom_id="+th.data.sele_g.prom_id; | |
| 2361 | + // if (getApp().globalData.user_id) { | |
| 2362 | + // url += "&first_leader=" + getApp().globalData.user_id; | |
| 2363 | + // } | |
| 2298 | 2364 | |
| 2299 | - var ob = { | |
| 2300 | - title: price + "元 " + title, | |
| 2301 | - path: url, | |
| 2302 | - imageUrl: img, | |
| 2303 | - }; | |
| 2304 | - if (th.data.prom_type == 6) { | |
| 2305 | - title += '\n' + th.data.prom_act.share_remark; | |
| 2306 | - ob.title = title; | |
| 2307 | - ob.desc = th.data.prom_act.share_remark; | |
| 2308 | - } | |
| 2365 | + // //-- 如果房间分享,且不是会员分享的 -- | |
| 2366 | + // if (getApp().globalData.room_id && | |
| 2367 | + // th.data.sele_g.goods_id == getApp().globalData.room_goods_id && | |
| 2368 | + // !getApp().globalData.room_user_share | |
| 2369 | + // ) { | |
| 2370 | + // url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1"; | |
| 2371 | + // } | |
| 2309 | 2372 | |
| 2310 | - //如果是积分购的时候 | |
| 2311 | - if (th.data.prom_type == 4) { | |
| 2312 | - var name = th.data.prom_act.name; | |
| 2313 | - //-- 积分购的 -- | |
| 2314 | - var pri0 = th.data.prom_act.addmoney; | |
| 2315 | - var integral = th.data.prom_act.integral; | |
| 2316 | - var text = ""; | |
| 2317 | - if (integral) { text = integral + "积分"; } | |
| 2318 | - if (pri0 && integral) { text += "+"; } | |
| 2319 | - if (pri0) { text += "¥" + pri0; } | |
| 2320 | - | |
| 2321 | - ob.title = text + " " + name; | |
| 2322 | - } | |
| 2373 | + // var ob = { | |
| 2374 | + // title: price + "元 " + title, | |
| 2375 | + // path: url, | |
| 2376 | + // imageUrl: img, | |
| 2377 | + // }; | |
| 2378 | + // if (th.data.prom_type == 6) { | |
| 2379 | + // title += '\n' + th.data.prom_act.share_remark; | |
| 2380 | + // ob.title = title; | |
| 2381 | + // ob.desc = th.data.prom_act.share_remark; | |
| 2382 | + // } | |
| 2323 | 2383 | |
| 2324 | - //-- 页面不能刷新 -- | |
| 2325 | - this.data.show_prew_img=1; | |
| 2326 | - return ob; | |
| 2384 | + // //如果是积分购的时候 | |
| 2385 | + // if (th.data.prom_type == 4) { | |
| 2386 | + // var name = th.data.prom_act.name; | |
| 2387 | + // //-- 积分购的 -- | |
| 2388 | + // var pri0 = th.data.prom_act.addmoney; | |
| 2389 | + // var integral = th.data.prom_act.integral; | |
| 2390 | + // var text = ""; | |
| 2391 | + // if (integral) { text = integral + "积分"; } | |
| 2392 | + // if (pri0 && integral) { text += "+"; } | |
| 2393 | + // if (pri0) { text += "¥" + pri0; } | |
| 2394 | + | |
| 2395 | + // ob.title = text + " " + name; | |
| 2396 | + // } | |
| 2397 | + | |
| 2398 | + // var title = th.data.sele_g.goods_name; | |
| 2399 | + // var img = th.data.sele_g.original_img; | |
| 2400 | + | |
| 2401 | + // var url = `packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=${th.data.sele_g.goods_id}&prom_type=9&group_id=${th.data.group_id}`; //当前页面url | |
| 2402 | + // if (getApp().globalData.user_id) { | |
| 2403 | + // url += "&first_leader=" + getApp().globalData.user_id; | |
| 2404 | + // } | |
| 2405 | + | |
| 2406 | + // console.log(url) | |
| 2407 | + | |
| 2408 | + // var ob = { | |
| 2409 | + // title: price + "元 " + title, | |
| 2410 | + // path: url, | |
| 2411 | + // imageUrl: img, | |
| 2412 | + // }; | |
| 2327 | 2413 | |
| 2414 | + // return ob; | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + var pagePath = `packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=${this.data.sele_g.goods_id}&prom_type=9&group_id=${this.data.group_id}`; //当前页面url | |
| 2418 | + // console.log('pagePath=====xxxxxx>', pagePath); | |
| 2419 | + var imgPath = this.data.iurl + this.data.luckGoInfo.original_img; | |
| 2420 | + if (pagePath.indexOf('/') != 0) { | |
| 2421 | + pagePath = '/' + pagePath; | |
| 2422 | + } | |
| 2423 | + // if(getApp().globalData.user_id){ | |
| 2424 | + | |
| 2425 | + // if(pagePath.indexOf("?")>0){ | |
| 2426 | + // pagePath+="&first_leader="+getApp().globalData.user_id; | |
| 2427 | + // }else{ | |
| 2428 | + // pagePath+="?first_leader="+getApp().globalData.user_id; | |
| 2429 | + // } | |
| 2430 | + // } | |
| 2431 | + return { | |
| 2432 | + title: "邀您一起参加幸运购", | |
| 2433 | + path: pagePath, | |
| 2434 | + imageUrl: imgPath, | |
| 2435 | + } | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2328 | 2439 | }, |
| 2329 | 2440 | |
| 2330 | 2441 | //-----图片失败,默认图片----- |
| ... | ... | @@ -3610,41 +3721,35 @@ Page({ |
| 3610 | 3721 | min: this.timeFormat(min), |
| 3611 | 3722 | sec: this.timeFormat(sec) |
| 3612 | 3723 | } |
| 3724 | + // console.log('cd'); | |
| 3613 | 3725 | } else { |
| 3614 | - if (th.data.prom_st == 0) { | |
| 3615 | - //var endTime2 = new Date(th.data.prom_end_time).getTime(); | |
| 3616 | - var endTime2 = th.data.prom_act.end_time; | |
| 3617 | - th.setData({ | |
| 3618 | - prom_time_text: '距结束还剩:', | |
| 3619 | - prom_st: 1 | |
| 3620 | - }) | |
| 3621 | - setTimeout(function () { | |
| 3622 | - th.countDown(endTime2) | |
| 3623 | - }, 1000); | |
| 3624 | - return false; | |
| 3625 | - | |
| 3626 | - } else { | |
| 3627 | - //活动已结束,全部设置为'00' | |
| 3628 | - obj = { | |
| 3629 | - day: '00', | |
| 3630 | - hou: '00', | |
| 3631 | - min: '00', | |
| 3632 | - sec: '00' | |
| 3633 | - } | |
| 3634 | - th.setData({ | |
| 3635 | - prom_time_text: '活动已经结束:', | |
| 3636 | - prom_st: 3 | |
| 3637 | - }) | |
| 3638 | - th.setData({ | |
| 3639 | - djs: obj | |
| 3640 | - }); | |
| 3641 | - return false; | |
| 3642 | - } | |
| 3726 | + | |
| 3727 | + | |
| 3728 | + | |
| 3729 | + obj = { | |
| 3730 | + day: '00', | |
| 3731 | + hou: '00', | |
| 3732 | + min: '00', | |
| 3733 | + sec: '00' | |
| 3734 | + } | |
| 3735 | + | |
| 3736 | + th.setData({ | |
| 3737 | + djs: obj, | |
| 3738 | + isTimeUp: true, | |
| 3739 | + }); | |
| 3740 | + console.log('i am here'); | |
| 3741 | + return false; | |
| 3643 | 3742 | } |
| 3644 | - | |
| 3645 | - th.setData({ | |
| 3646 | - djs: obj | |
| 3647 | - }); | |
| 3743 | + | |
| 3744 | + // ---- | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + th.setData({ | |
| 3750 | + djs: obj | |
| 3751 | + }); | |
| 3752 | + // ---- | |
| 3648 | 3753 | setTimeout(function () { |
| 3649 | 3754 | th.countDown(endTime) |
| 3650 | 3755 | }, 1000); |
| ... | ... | @@ -3741,122 +3846,164 @@ Page({ |
| 3741 | 3846 | }, |
| 3742 | 3847 | |
| 3743 | 3848 | //--点击弹起拼单-- |
| 3849 | + // ind == 1 为普通购买 | |
| 3744 | 3850 | openSpecModel_pt: function (e) { |
| 3745 | 3851 | |
| 3746 | 3852 | this.setData({ open_ind_store: 9, goodsInputNum: 1 }); |
| 3853 | + // 判断是否有待支付订单 | |
| 3854 | + var aid = this.data.group_id; | |
| 3855 | + var switOn = true; | |
| 3856 | + s.request.promiseGet('/api/weshop/prom/luckyOrder/page', { | |
| 3857 | + data: { | |
| 3858 | + store_id: os.stoid, | |
| 3859 | + user_id: oo.user_id, | |
| 3860 | + aid: aid, | |
| 3861 | + pay_status: 0, // 未支付 | |
| 3862 | + order_status: 0, // 待支付 | |
| 3863 | + pageSize: 1, | |
| 3864 | + page: 1 | |
| 3865 | + } | |
| 3866 | + }).then(res => { | |
| 3867 | + if(res.data.code == 0){ | |
| 3868 | + if (res.data.data.total > 0) { | |
| 3869 | + // 待支付订单页面 | |
| 3870 | + wx.showModal({ | |
| 3871 | + title: "您已经购买了该商品待支付中", | |
| 3872 | + success: function (a) { | |
| 3873 | + if (a.confirm) { | |
| 3874 | + switOn = false; | |
| 3875 | + wx.navigateTo({ | |
| 3876 | + url: "/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id=" + res.data.data.pageData[0]['order_id'] | |
| 3877 | + }); | |
| 3878 | + } | |
| 3879 | + } | |
| 3880 | + }); | |
| 3881 | + } else { | |
| 3882 | + //--先判断会员状态-- | |
| 3883 | + var user_info = getApp().globalData.userInfo; | |
| 3884 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) { | |
| 3885 | + wx.navigateTo({ | |
| 3886 | + url: '/pages/togoin/togoin', | |
| 3887 | + }) | |
| 3888 | + return false; | |
| 3889 | + }; | |
| 3890 | + | |
| 3891 | + var th = this; | |
| 3892 | + var ind = parseInt(e.currentTarget.dataset.ind); | |
| 3893 | + | |
| 3894 | + console.log('当前ind========>>>>', ind); | |
| 3895 | + | |
| 3896 | + //ind == 1是普通购买 | |
| 3897 | + if (ind == 1) { | |
| 3898 | + //如果拼单的sku data是空的,就要先获取一下 | |
| 3899 | + if (th.data.sku_g_pt) { | |
| 3900 | + th.get_sto(1); | |
| 3901 | + th.setData({ | |
| 3902 | + is_normal: ind, | |
| 3903 | + openSpecModal_pt: 1 | |
| 3904 | + }); | |
| 3905 | + } else { | |
| 3906 | + th.get_sto(1); | |
| 3907 | + th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () { | |
| 3908 | + th.setData({ | |
| 3909 | + is_normal: ind, | |
| 3910 | + openSpecModal_pt: 1 | |
| 3911 | + }); | |
| 3912 | + }); | |
| 3913 | + | |
| 3914 | + th.setData({ | |
| 3915 | + is_normal: ind, | |
| 3916 | + openSpecModal_pt: 1 | |
| 3917 | + }); | |
| 3918 | + }; | |
| 3919 | + th.check_is_youhui(th.data.gid, 1); | |
| 3920 | + } else { | |
| 3921 | + | |
| 3922 | + // //拼单商品从这里进,先判断有没有买过商品, | |
| 3923 | + // getApp().request.get("/api/weshop/order/page", { | |
| 3924 | + // data: { | |
| 3925 | + // // pt_prom_id: th.data.prom_act.id, | |
| 3926 | + // user_id: oo.user_id, | |
| 3927 | + // store_id: os.stoid, | |
| 3928 | + // pageSize: 1, | |
| 3929 | + // page: 1 | |
| 3930 | + // }, | |
| 3931 | + // success: function (e) { | |
| 3932 | + // //--跳转到已经购买的情况-- | |
| 3933 | + // if (e.data.data.pageData.length > 0) { | |
| 3934 | + // var odr = e.data.data.pageData[0]; | |
| 3935 | + // //还未支付 | |
| 3936 | + // if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) { | |
| 3937 | + // wx.showModal({ | |
| 3938 | + // title: "您已经购买了该商品待支付中", | |
| 3939 | + // success: function (a) { | |
| 3940 | + // if (a.confirm) { | |
| 3941 | + // wx.navigateTo({ | |
| 3942 | + // url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id, | |
| 3943 | + // }); | |
| 3944 | + // } | |
| 3945 | + // } | |
| 3946 | + // }); | |
| 3947 | + // } else if (odr.pt_status == 1 && odr.order_status == 1) { | |
| 3948 | + | |
| 3949 | + // if (this.data.is_go_to_team_show) return false; | |
| 3950 | + // this.data.is_go_to_team_show = 1; | |
| 3951 | + // wx.showLoading(); | |
| 3952 | + | |
| 3953 | + // /*--- | |
| 3954 | + // wx.redirectTo({ | |
| 3955 | + // url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, | |
| 3956 | + // });--*/ | |
| 3957 | + // getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn); | |
| 3958 | + | |
| 3959 | + // } else { | |
| 3960 | + // th.setData({ | |
| 3961 | + // is_normal: ind, | |
| 3962 | + // openSpecModal_pt: 1 | |
| 3963 | + // }); | |
| 3964 | + // } | |
| 3965 | + | |
| 3966 | + // } else { | |
| 3967 | + // th.setData({ | |
| 3968 | + // is_normal: ind, | |
| 3969 | + // openSpecModal_pt: 1 | |
| 3970 | + // }); | |
| 3971 | + // } | |
| 3972 | + // } | |
| 3973 | + // }); | |
| 3974 | + th.get_sto(1); | |
| 3975 | + th.setData({ | |
| 3976 | + is_normal: 0, | |
| 3977 | + openSpecModal_pt: 1 | |
| 3978 | + }); | |
| 3979 | + | |
| 3980 | + } | |
| 3981 | + } | |
| 3982 | + | |
| 3983 | + } | |
| 3984 | + }); | |
| 3985 | + | |
| 3747 | 3986 | |
| 3748 | - //--先判断会员状态-- | |
| 3749 | - var user_info = getApp().globalData.userInfo; | |
| 3750 | - if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) { | |
| 3751 | - wx.navigateTo({ | |
| 3752 | - url: '/pages/togoin/togoin', | |
| 3753 | - }) | |
| 3754 | - return false; | |
| 3755 | - }; | |
| 3756 | 3987 | |
| 3757 | - var th = this; | |
| 3758 | - var ind = parseInt(e.currentTarget.dataset.ind); | |
| 3759 | - //ind == 1是普通购买 | |
| 3760 | - if (ind == 1) { | |
| 3761 | - //如果拼单的sku data是空的,就要先获取一下 | |
| 3762 | - if (th.data.sku_g_pt) { | |
| 3763 | - th.get_sto(1); | |
| 3764 | - th.setData({ | |
| 3765 | - is_normal: ind, | |
| 3766 | - openSpecModal_pt: 1 | |
| 3767 | - }); | |
| 3768 | - } else { | |
| 3769 | - th.get_sto(1); | |
| 3770 | - th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () { | |
| 3771 | - th.setData({ | |
| 3772 | - is_normal: ind, | |
| 3773 | - openSpecModal_pt: 1 | |
| 3774 | - }); | |
| 3775 | - }); | |
| 3776 | - | |
| 3777 | - th.setData({ | |
| 3778 | - is_normal: ind, | |
| 3779 | - openSpecModal_pt: 1 | |
| 3780 | - }); | |
| 3781 | - }; | |
| 3782 | - th.check_is_youhui(th.data.gid, 1); | |
| 3783 | - } else { | |
| 3784 | 3988 | |
| 3785 | - // //拼单商品从这里进,先判断有没有买过商品, | |
| 3786 | - // getApp().request.get("/api/weshop/order/page", { | |
| 3787 | - // data: { | |
| 3788 | - // // pt_prom_id: th.data.prom_act.id, | |
| 3789 | - // user_id: oo.user_id, | |
| 3790 | - // store_id: os.stoid, | |
| 3791 | - // pageSize: 1, | |
| 3792 | - // page: 1 | |
| 3793 | - // }, | |
| 3794 | - // success: function (e) { | |
| 3795 | - // //--跳转到已经购买的情况-- | |
| 3796 | - // if (e.data.data.pageData.length > 0) { | |
| 3797 | - // var odr = e.data.data.pageData[0]; | |
| 3798 | - // //还未支付 | |
| 3799 | - // if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) { | |
| 3800 | - // wx.showModal({ | |
| 3801 | - // title: "您已经购买了该商品待支付中", | |
| 3802 | - // success: function (a) { | |
| 3803 | - // if (a.confirm) { | |
| 3804 | - // wx.navigateTo({ | |
| 3805 | - // url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id, | |
| 3806 | - // }); | |
| 3807 | - // } | |
| 3808 | - // } | |
| 3809 | - // }); | |
| 3810 | - // } else if (odr.pt_status == 1 && odr.order_status == 1) { | |
| 3811 | - | |
| 3812 | - // if (this.data.is_go_to_team_show) return false; | |
| 3813 | - // this.data.is_go_to_team_show = 1; | |
| 3814 | - // wx.showLoading(); | |
| 3815 | - | |
| 3816 | - // /*--- | |
| 3817 | - // wx.redirectTo({ | |
| 3818 | - // url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, | |
| 3819 | - // });--*/ | |
| 3820 | - // getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn); | |
| 3821 | - | |
| 3822 | - // } else { | |
| 3823 | - // th.setData({ | |
| 3824 | - // is_normal: ind, | |
| 3825 | - // openSpecModal_pt: 1 | |
| 3826 | - // }); | |
| 3827 | - // } | |
| 3828 | - | |
| 3829 | - // } else { | |
| 3830 | - // th.setData({ | |
| 3831 | - // is_normal: ind, | |
| 3832 | - // openSpecModal_pt: 1 | |
| 3833 | - // }); | |
| 3834 | - // } | |
| 3835 | - // } | |
| 3836 | - // }); | |
| 3837 | - th.get_sto(1); | |
| 3838 | - th.setData({ | |
| 3839 | - is_normal: 0, | |
| 3840 | - openSpecModal_pt: 1 | |
| 3841 | - }); | |
| 3842 | - | |
| 3843 | - } | |
| 3844 | 3989 | }, |
| 3845 | 3990 | |
| 3846 | 3991 | //-----------------拼单生成方法--------------------- |
| 3847 | 3992 | addCart_pt: function () { |
| 3848 | - var th = this; | |
| 3993 | + this.setData({ | |
| 3994 | + openSpecModal_pt: 0, | |
| 3995 | + }); | |
| 3849 | 3996 | if (this.data.is_normal == 0) { |
| 3850 | 3997 | //看一下有没有起购数,如果有起购数,要计算起购数 |
| 3851 | - var qnum = parseFloat(th.data.prom_act.minbuynum); | |
| 3852 | - if (qnum > 0 && th.data.goodsInputNum < qnum) { | |
| 3853 | - getApp().confirmBox("拼团商品至少要买" + qnum + "件!"); | |
| 3854 | - return false; | |
| 3855 | - } | |
| 3998 | + // var qnum = parseFloat(th.data.prom_act.minbuynum); | |
| 3999 | + // if (qnum > 0 && th.data.goodsInputNum < qnum) { | |
| 4000 | + // getApp().confirmBox("拼团商品至少要买" + qnum + "件!"); | |
| 4001 | + // return false; | |
| 4002 | + // } | |
| 3856 | 4003 | |
| 3857 | - th.addcart_pt_func(); | |
| 4004 | + this.addcart_pt_func(); | |
| 3858 | 4005 | } else { |
| 3859 | - th.addcart_pt_func(); | |
| 4006 | + this.addcart_pt_func(); | |
| 3860 | 4007 | } |
| 3861 | 4008 | }, |
| 3862 | 4009 | |
| ... | ... | @@ -3868,73 +4015,75 @@ Page({ |
| 3868 | 4015 | var e = this, |
| 3869 | 4016 | th = e, |
| 3870 | 4017 | o = this.data.sele_g; |
| 3871 | - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | |
| 4018 | + // if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | |
| 3872 | 4019 | |
| 3873 | 4020 | //----------添加到购物车时,要判断限购数量,-------- |
| 3874 | 4021 | e.get_buy_num(o, async function (ee) { |
| 3875 | 4022 | |
| 3876 | 4023 | //---判断商品是否超出限购--- |
| 3877 | - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | |
| 3878 | - if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | |
| 3879 | - wx.showModal({ | |
| 3880 | - title: '提示', | |
| 3881 | - content: '超出商品限购' | |
| 3882 | - }); | |
| 3883 | - | |
| 3884 | - var num = th.data.prom_buy_limit - th.data.prom_buy_num; | |
| 3885 | - if (num < 0) num = 0; | |
| 3886 | - th.setData({ goodsInputNum: num }) | |
| 3887 | - return false; | |
| 3888 | - } | |
| 3889 | - } | |
| 4024 | + // if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | |
| 4025 | + // if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | |
| 4026 | + // wx.showModal({ | |
| 4027 | + // title: '提示', | |
| 4028 | + // content: '超出商品限购' | |
| 4029 | + // }); | |
| 4030 | + | |
| 4031 | + // var num = th.data.prom_buy_limit - th.data.prom_buy_num; | |
| 4032 | + // if (num < 0) num = 0; | |
| 4033 | + // th.setData({ goodsInputNum: num }) | |
| 4034 | + // return false; | |
| 4035 | + // } | |
| 4036 | + // } | |
| 4037 | + | |
| 3890 | 4038 | //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购--- |
| 3891 | - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) { | |
| 3892 | - if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { | |
| 3893 | - wx.showModal({ | |
| 3894 | - title: '提示', | |
| 3895 | - content: '超出商品活动限购' | |
| 3896 | - }); | |
| 3897 | - | |
| 3898 | - var num = th.data.prom_buy_limit - th.data.prom_buy_num; | |
| 3899 | - if (num < 0) num = 0; | |
| 3900 | - th.setData({ goodsInputNum: num }) | |
| 3901 | - return false; | |
| 3902 | - } | |
| 3903 | - } | |
| 4039 | + // if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) { | |
| 4040 | + // if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { | |
| 4041 | + // wx.showModal({ | |
| 4042 | + // title: '提示', | |
| 4043 | + // content: '超出商品活动限购' | |
| 4044 | + // }); | |
| 4045 | + | |
| 4046 | + // var num = th.data.prom_buy_limit - th.data.prom_buy_num; | |
| 4047 | + // if (num < 0) num = 0; | |
| 4048 | + // th.setData({ goodsInputNum: num }) | |
| 4049 | + // return false; | |
| 4050 | + // } | |
| 4051 | + // } | |
| 3904 | 4052 | |
| 3905 | 4053 | var redis_num = 0 |
| 3906 | 4054 | //不是普通购买的时候 |
| 3907 | - if (th.data.is_normal != 1) { | |
| 3908 | - //-------判断活动是否抢光--------- | |
| 3909 | - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, { | |
| 3910 | - 1: 1 | |
| 3911 | - }).then(res => { | |
| 3912 | - redis_num = res.data.data; | |
| 3913 | - }) | |
| 3914 | - | |
| 3915 | - if (th.data.goodsInputNum > redis_num) { | |
| 3916 | - wx.showModal({ | |
| 3917 | - title: '提示', | |
| 3918 | - content: '超出商品活动库存' | |
| 3919 | - }); | |
| 3920 | - | |
| 3921 | - th.setData({ goodsInputNum: redis_num }) | |
| 4055 | + // if (th.data.is_normal != 1) { | |
| 4056 | + // //-------判断活动是否抢光--------- | |
| 4057 | + // await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, { | |
| 4058 | + // 1: 1 | |
| 4059 | + // }).then(res => { | |
| 4060 | + // redis_num = res.data.data; | |
| 4061 | + // }) | |
| 4062 | + | |
| 4063 | + // if (th.data.goodsInputNum > redis_num) { | |
| 4064 | + // wx.showModal({ | |
| 4065 | + // title: '提示', | |
| 4066 | + // content: '超出商品活动库存' | |
| 4067 | + // }); | |
| 4068 | + | |
| 4069 | + // th.setData({ goodsInputNum: redis_num }) | |
| 4070 | + | |
| 4071 | + // return false; | |
| 4072 | + // } | |
| 4073 | + // } | |
| 3922 | 4074 | |
| 3923 | - return false; | |
| 3924 | - } | |
| 3925 | - } | |
| 3926 | - | |
| 3927 | - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); | |
| 3928 | - if (th.data.goodsInputNum > o.store_count) { | |
| 3929 | - th.setData({ goodsInputNum: o.store_count }) | |
| 3930 | - return s.my_warnning("超出商品库存", 0, th); | |
| 3931 | - } | |
| 4075 | + // if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); | |
| 4076 | + // if (th.data.goodsInputNum > o.store_count) { | |
| 4077 | + // th.setData({ goodsInputNum: o.store_count }) | |
| 4078 | + // return s.my_warnning("超出商品库存", 0, th); | |
| 4079 | + // } | |
| 3932 | 4080 | |
| 3933 | 4081 | if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) |
| 3934 | 4082 | this.setData({ |
| 3935 | 4083 | sto_sele_name: "" |
| 3936 | 4084 | }); |
| 3937 | 4085 | if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); |
| 4086 | + | |
| 3938 | 4087 | //--------------此时操作的数据------------ |
| 3939 | 4088 | var newd = { |
| 3940 | 4089 | goods_id: o.goods_id, |
| ... | ... | @@ -4006,10 +4155,12 @@ Page({ |
| 4006 | 4155 | th.data.sto_sele_distr = 1; |
| 4007 | 4156 | } |
| 4008 | 4157 | |
| 4009 | - } else if (th.data.prom_type == 3) { | |
| 4010 | - newd.prom_type = 0; | |
| 4011 | - newd.prom_id = 0; | |
| 4012 | 4158 | } |
| 4159 | + | |
| 4160 | + // else if (th.data.prom_type == 3) { | |
| 4161 | + // newd.prom_type = 0; | |
| 4162 | + // newd.prom_id = 0; | |
| 4163 | + // } | |
| 4013 | 4164 | |
| 4014 | 4165 | newd['pick_name'] = th.data.sto_sele_name; |
| 4015 | 4166 | newd['pick_dis'] = th.data.sto_sele_distr; |
| ... | ... | @@ -4020,21 +4171,28 @@ Page({ |
| 4020 | 4171 | //判断一下有没有全局优惠活动 |
| 4021 | 4172 | th.check_nor_promgood(newd.goods_id, function (e) { |
| 4022 | 4173 | if (e && e.act_id) { |
| 4023 | - newd['prom_type'] = 3; | |
| 4174 | + newd['prom_type'] = 0; | |
| 4024 | 4175 | newd['prom_id'] = e.act_id; |
| 4025 | 4176 | } |
| 4026 | - th.buyNow(newd) | |
| 4027 | - }) | |
| 4177 | + console.log('aaaaa'); | |
| 4178 | + newd['prom_type'] = 0; | |
| 4179 | + th.buyNow(newd); | |
| 4180 | + }); | |
| 4028 | 4181 | } |
| 4029 | - else th.buyNow_pt(newd); | |
| 4182 | + else { | |
| 4183 | + // 点击立即参团 | |
| 4184 | + th.buyNow_pt(newd); | |
| 4185 | + }; | |
| 4030 | 4186 | }) |
| 4031 | 4187 | }, |
| 4032 | 4188 | //----------立即购买_pt----------- |
| 4033 | 4189 | buyNow_pt: function (e) { |
| 4034 | 4190 | s.set_b_now(e); |
| 4035 | 4191 | wx.navigateTo({ |
| 4036 | - url: "/packageC/pages/luckyGo_cart/luckyGo_cart/luckyGo_cart?is_bnow=1&goods_id=" + e.goods_id, | |
| 4192 | + url: "/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&group_id=" + this.data.group_id + "&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert + '&goods_price=' + this.data.luckGoInfo.group_price/100 + '&is_show=' + this.data.luckGoInfo.is_show, | |
| 4037 | 4193 | }); |
| 4194 | + | |
| 4195 | + // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + th.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + th.data.luckGoInfo.lc_alert); | |
| 4038 | 4196 | }, |
| 4039 | 4197 | |
| 4040 | 4198 | //-------跳转pt商品------- |
| ... | ... | @@ -4490,8 +4648,10 @@ Page({ |
| 4490 | 4648 | scene += "_" + getApp().globalData.room_id; |
| 4491 | 4649 | } |
| 4492 | 4650 | ///二微码 |
| 4493 | - var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
| 4494 | - os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; | |
| 4651 | + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
| 4652 | + os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo"; | |
| 4653 | + // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
| 4654 | + // os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo"; | |
| 4495 | 4655 | |
| 4496 | 4656 | console.log(path3); |
| 4497 | 4657 | |
| ... | ... | @@ -4608,9 +4768,10 @@ Page({ |
| 4608 | 4768 | context.setFillStyle("red") |
| 4609 | 4769 | |
| 4610 | 4770 | |
| 4611 | - var pri0 = th.data.data.shop_price; | |
| 4612 | - if (th.data.prom_act) | |
| 4613 | - pri0 = th.data.prom_act.price; | |
| 4771 | + var pri0 = th.data.luckGoInfo.group_price/100; | |
| 4772 | + // console.log('pri0========>>>>>', pri0); | |
| 4773 | + // if (th.data.prom_act) | |
| 4774 | + // pri0 = th.data.prom_act.price; | |
| 4614 | 4775 | pri0 = parseFloat(pri0).toFixed(2); |
| 4615 | 4776 | var wd1 = th.data.screenWidth - ut.measureText(pri0, 31 * unit) - 25; |
| 4616 | 4777 | context.fillText("¥", wd1 - 15, 185 * unit); |
| ... | ... | @@ -5180,7 +5341,7 @@ Page({ |
| 5180 | 5341 | tt(); |
| 5181 | 5342 | }, |
| 5182 | 5343 | fail: function (res) { |
| 5183 | - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 | |
| 5344 | + ee.data.share_goods_img = "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 | |
| 5184 | 5345 | tt(); |
| 5185 | 5346 | } |
| 5186 | 5347 | }); |
| ... | ... | @@ -6297,5 +6458,14 @@ Page({ |
| 6297 | 6458 | return newTypeArr; |
| 6298 | 6459 | }, |
| 6299 | 6460 | |
| 6461 | + | |
| 6462 | + //弹出活动已经结束 | |
| 6463 | + timeUp() { | |
| 6464 | + wx.showToast({ | |
| 6465 | + title: '本商品活动已经结束!', | |
| 6466 | + icon: 'none', | |
| 6467 | + }); | |
| 6468 | + }, | |
| 6469 | + | |
| 6300 | 6470 | |
| 6301 | 6471 | }); | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.json
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | |
| 6 | 6 | |
| 7 | 7 | <!-- 商品内容区域,普通商品,秒杀,拼团 --> |
| 8 | -<block> | |
| 8 | +<block wx:if="{{isshow}}"> | |
| 9 | 9 | <view class="container"> |
| 10 | 10 | <!-- 幸运购规则 --> |
| 11 | 11 | <view class="rules" bindtap="showRules">规则</view> |
| ... | ... | @@ -29,8 +29,8 @@ |
| 29 | 29 | <image src="{{item.head_pic}}" class="img-block"></image> |
| 30 | 30 | </view> |
| 31 | 31 | <view class="flex ai_c pd10"> |
| 32 | - <view class="nickname ellipsis-1x">恭喜{{item.nickname}}</view> | |
| 33 | - <view style="flex-shrink: 0;">获得了"{{item.goods_name}}"</view> | |
| 32 | + <view class="nickname ellipsis-1x">恭喜{{item.nickname}}获得了{{item.goods_name}}</view> | |
| 33 | + <!-- <view style="flex-shrink: 0;"></view> --> | |
| 34 | 34 | </view> |
| 35 | 35 | </view> |
| 36 | 36 | </swiper-item> |
| ... | ... | @@ -71,7 +71,35 @@ |
| 71 | 71 | </block> |
| 72 | 72 | </view> |
| 73 | 73 | </view> |
| 74 | - <!-- --显示秒杀价,团购,积分购-- --> | |
| 74 | + | |
| 75 | + <!-- --显示秒杀价 --> | |
| 76 | + <view class="prom_show rel" wx:if="{{prom_type==1}}"> | |
| 77 | + <image class="secondkill-img" src='{{prom_st==1? iurl+"/miniapp/images/red_jx.png":iurl+"/miniapp/images/blue_ks.png"}}'></image> | |
| 78 | + <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image> | |
| 79 | + <view class="stop fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view> | |
| 80 | + <view class="start fs26 abs" wx:if="{{prom_st==2}}">距活动开始还有</view> | |
| 81 | + <view class="secview flex abs fs24 xc-miaosha-time"> | |
| 82 | + <block wx:if="djs.day"> | |
| 83 | + <view class='day-val' style="color:{{prom_st==1?'#d40022':'#0097e0'}}"> | |
| 84 | + {{djs.day}} | |
| 85 | + </view> | |
| 86 | + <view class="day white" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">天</view> | |
| 87 | + </block> | |
| 88 | + <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}"> | |
| 89 | + {{djs.hou}} | |
| 90 | + </view> | |
| 91 | + <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">时</view> | |
| 92 | + <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}"> | |
| 93 | + {{djs.min}} | |
| 94 | + </view> | |
| 95 | + <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">分</view> | |
| 96 | + <view class='time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}"> | |
| 97 | + {{djs.sec}} | |
| 98 | + </view> | |
| 99 | + <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view> | |
| 100 | + </view> | |
| 101 | + </view> | |
| 102 | + | |
| 75 | 103 | |
| 76 | 104 | |
| 77 | 105 | <!-- --拼单-- --> |
| ... | ... | @@ -82,22 +110,18 @@ |
| 82 | 110 | <view class="abs xc-qt-price"> |
| 83 | 111 | <view class="flex" style='height:40rpx; margin-top:5rpx'> |
| 84 | 112 | <view class="flex fs35 xc-qtsign">¥</view> |
| 85 | - <view class="fs50 val">{{filters.toFix(data.shop_price,2)}}</view> | |
| 113 | + <!-- <view class="fs50 val">{{filters.toFix(data.shop_price,2)}}</view> --> | |
| 114 | + <view class="fs50 val">{{filters.toFix(luckGoInfo.group_price/100,2)}}</view> | |
| 86 | 115 | </view> |
| 87 | 116 | <view class="word-line fs20 xc-qtunit-price"> |
| 88 | - 零售价¥{{filters.toFix(data.market_price,2)}} | |
| 117 | + 手店价 | |
| 118 | + <!-- ¥{{filters.toFix(data.shop_price,2)}} --> | |
| 119 | + <block wx:if="{{card_field && sele_g[card_field]>0}}"><text class="rmb lh1">{{sele_g[card_field]}}</text></block> | |
| 120 | + <block wx:else><text class="rmb lh1">{{sele_g.shop_price}}</text></block> | |
| 89 | 121 | </view> |
| 90 | 122 | </view> |
| 91 | 123 | |
| 92 | - <!-- <view class="abs white xc-nanber"> | |
| 93 | - <text class="fs22">已拼{{prom_act.buy_num}}件</text> | |
| 94 | - <view class="flex" style='margin-top:-34rpx'> | |
| 95 | - <view class="xc-people-img"> | |
| 96 | - <image class="imgs" src="{{prom_st==1? iurl+'/miniapp/images/r_logo_red.png':iurl+'/miniapp/images/r_logo.png'}}"></image> | |
| 97 | - </view> | |
| 98 | - <view class="t-s fs20 xc-people-val">{{prom_act.ct_num}}人拼</view> | |
| 99 | - </view> | |
| 100 | - </view> --> | |
| 124 | + | |
| 101 | 125 | |
| 102 | 126 | <!-- 幸运购 --> |
| 103 | 127 | <view class="abs white xc-nanber"> |
| ... | ... | @@ -174,7 +198,7 @@ |
| 174 | 198 | |
| 175 | 199 | <!-- 这个是分享按钮 --> |
| 176 | 200 | <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> |
| 177 | - <view class="xc-share-frame t-c" bindtap="clickShare"> | |
| 201 | + <view class="xc-share-frame t-c" bindtap="{{isTimeUp ? 'timeUp':'clickShare'}}"> | |
| 178 | 202 | <view class="iconfont icon-share"></view> |
| 179 | 203 | <!-- <view class="fs22 c-7b">分享</view> --> |
| 180 | 204 | </view> |
| ... | ... | @@ -248,9 +272,10 @@ |
| 248 | 272 | |
| 249 | 273 | |
| 250 | 274 | |
| 251 | - <view class="goods-num"> | |
| 252 | - <view class="sales">销量:{{data.sales_sum}}件</view> | |
| 253 | - <view class="stock">折扣:{{data.disc}}折</view> | |
| 275 | + <view class="goods-num pdt20"> | |
| 276 | + <view class="sales">已售:{{num_success}}件</view> | |
| 277 | + <!-- <view class="sales">销量:{{data.sales_sum}}件</view> --> | |
| 278 | + <!-- <view class="stock">折扣:{{data.disc}}折</view> --> | |
| 254 | 279 | <view class="stock">{{categories3[0].num}}人评价</view> |
| 255 | 280 | </view> |
| 256 | 281 | <view wx:if="{{prom_type==1}}"> |
| ... | ... | @@ -310,7 +335,7 @@ |
| 310 | 335 | <view class="xc-partner-frame"> |
| 311 | 336 | <view class="zzk-1 flex jc_sb"> |
| 312 | 337 | <view class="pdl10">已参团{{filters.show_default(luckGoInfo.num, '0')}}人,还差<text class="c-red">{{filters.show_default(luckGoInfo.group_num, '0')- filters.show_default(luckGoInfo.num, '0')}}</text>人成团</view> |
| 313 | - <view class="ckgd flex ai_c" bindtap="showReward"> | |
| 338 | + <view class="ckgd flex ai_c" bindtap="{{isTimeUp ? 'timeUp':'showReward'}}"> | |
| 314 | 339 | 查看奖励 |
| 315 | 340 | <view class="bg_right arrow-one"></view> |
| 316 | 341 | </view> |
| ... | ... | @@ -367,7 +392,7 @@ |
| 367 | 392 | <!-- <view class="clear"></view> --> |
| 368 | 393 | </view> |
| 369 | 394 | |
| 370 | - <view class="fs24 pdh20 pdt20">*<text class="c-red">{{luckGoInfo.group_num}}</text>人成团,<text class="c-red">{{luckGoInfo.group_win}}</text>人得商品,<text class="c-red">{{luckGoInfo.group_num - luckGoInfo.group_win}}</text>人全额退款并获得<text class="c-red">惊喜礼品</text>!</view> | |
| 395 | + <view class="fs24 pdh20">*<text class="c-red">{{filters.show_default(luckGoInfo.group_num, '0')}}</text>人成团,<text class="c-red">{{filters.show_default(luckGoInfo.group_win, '0')}}</text>人得商品,<text class="c-red">{{filters.show_default(luckGoInfo.group_num - luckGoInfo.group_win, '0')}}</text>人全额退款并获得<text class="c-red">惊喜礼品</text>!</view> | |
| 371 | 396 | </view> |
| 372 | 397 | </view> |
| 373 | 398 | |
| ... | ... | @@ -883,13 +908,27 @@ |
| 883 | 908 | <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 --> |
| 884 | 909 | <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules==2 }}"> |
| 885 | 910 | <view class="btn-container f1"> |
| 886 | - <view bindtap="openSpecModel_pt" data-ind="1" class="btn-yellow flex f1 fdc jc-center"> | |
| 887 | - <view class="lh1"><text class="rmb lh1">{{filters.toFix(data.market_price,2)}}</text></view> | |
| 911 | + <view bindtap="openSpecModel_pt" data-ind="1" data-it="1" class="btn-yellow flex f1 fdc jc-center"> | |
| 912 | + <view class="lh1"> | |
| 913 | + <!-- <text class="rmb lh1">{{filters.toFix(data.shop_price,2)}}</text> --> | |
| 914 | + <block wx:if="{{card_field && sele_g[card_field]>0}}"><text class="rmb lh1">{{sele_g[card_field]}}</text></block> | |
| 915 | + <block wx:else><text class="rmb lh1">{{sele_g.shop_price}}</text></block> | |
| 916 | + </view> | |
| 917 | + <!-- 如果是等级会员,且有等级价 --> | |
| 918 | + | |
| 888 | 919 | <view class="lh1 fs pdt4">单独购买</view> |
| 889 | 920 | </view> |
| 890 | 921 | <!-- data-ind="2" --> |
| 891 | 922 | <!-- openSpecModel_pt --> |
| 892 | - <view class="btn-red f1 flex ai-center jc-center" bindtap="openSpecModel_pt" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy" data-ind="0">立即参团</view> | |
| 923 | + <view class="xc-ash-b f1 flex ai-center jc-center white fs26" wx:if="{{btnHidden && isTimeUp}}">活动已经结束</view> | |
| 924 | + <block wx:else> | |
| 925 | + <view class="btn-red f1 flex ai-center jc-center" bindtap="go" data-it="0" data-url="/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?group_id={{luckGoInfo.id}}&goods_id={{luckGoInfo.goods_id}}&goods_name={{data.goods_name}}&team_id={{buyInfo.team_id}}" wx:if="{{btnHidden && showDetails}}">查看详情</view> | |
| 926 | + <view class="f1 flex ai-center jc-center xc-ash-b fs26 white" wx:if="{{btnHidden && !showDetails && surplus == 0}}">已经抢光了</view> | |
| 927 | + <view class="f1 flex ai-center jc-center xc-ash-b fs26 white" wx:if="{{btnHidden && !showDetails && surplus != 0 && !canBuy}}">已超限购次数</view> | |
| 928 | + <view class="btn-red f1 flex ai-center jc-center" bindtap="openSpecModel_pt" data-it="0" wx:if="{{btnHidden && !showDetails && surplus != 0 && canBuy}}">立即参团</view> | |
| 929 | + </block> | |
| 930 | + | |
| 931 | + <!-- <view class="btn-red f1 flex ai-center jc-center" wx:else>已经抢光</view> --> | |
| 893 | 932 | <!-- <view class="btn-red f1 flex ai-center jc-center" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy">立即参团</view> --> |
| 894 | 933 | </view> |
| 895 | 934 | <!-- <view bindtap="openSpecModel" data-ind="1" class="btn-buy flex fdc jc-center"> |
| ... | ... | @@ -919,27 +958,26 @@ |
| 919 | 958 | </block> |
| 920 | 959 | </block> --> |
| 921 | 960 | <!-- -----拼单------ --> |
| 922 | - <block wx:if="{{prom_type == 6}}"> | |
| 961 | + <!-- <block wx:if="{{prom_type == 6}}"> | |
| 923 | 962 | <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h"> |
| 924 | 963 | <view class="fir-v"> |
| 925 | - <!-- ¥{{data.shop_price,2)}} --> | |
| 926 | 964 | <block wx:if="{{card_field && sele_g[card_field]>0}}"> |
| 927 | 965 | {{filters.toFix(sele_g[card_field],2)}} |
| 928 | 966 | </block> |
| 929 | 967 | <block wx:else>{{filters.toFix(sele_g.shop_price,2)}}</block> |
| 930 | 968 | </view> |
| 931 | 969 | <view>单独购买</view> |
| 932 | - </view> | |
| 933 | - <block wx:if="{{user_order_pt_state==0}}"> | |
| 970 | + </view> --> | |
| 971 | + <!-- <block wx:if="{{user_order_pt_state==0}}"> --> | |
| 934 | 972 | <!-- --商家团-- --> |
| 935 | - <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==1}}" class="buy-btn cart-btn line-h"> | |
| 973 | + <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==1}}" class="buy-btn cart-btn line-h"> | |
| 936 | 974 | <view class="fir-v">¥{{prom_act.price}}</view> |
| 937 | 975 | <view>去参团</view> |
| 938 | - </view> | |
| 976 | + </view> --> | |
| 939 | 977 | <!-- --会员团-- --> |
| 940 | - <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==2}}" class="buy-btn cart-btn line-h"> | |
| 978 | + <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==2}}" class="buy-btn cart-btn line-h"> --> | |
| 941 | 979 | <!-- <view class="fir-v">¥{{prom_act.price}}</view> --> |
| 942 | - <view class="pd_top1" wx:if="{{prom_act.tz_yhjgtype>1}}"> | |
| 980 | + <!-- <view class="pd_top1" wx:if="{{prom_act.tz_yhjgtype>1}}"> | |
| 943 | 981 | <view>一键开团</view> |
| 944 | 982 | <view wx:if="{{prom_act.tz_yhjgtype==3}}"> |
| 945 | 983 | 佣金 |
| ... | ... | @@ -952,17 +990,17 @@ |
| 952 | 990 | <view class="fir-v">¥{{ filters.toFix(prom_act.price,2)}}</view> |
| 953 | 991 | <view>一键开团</view> |
| 954 | 992 | </view> |
| 955 | - </view> | |
| 993 | + </view> --> | |
| 956 | 994 | <!-- -阶梯团-- --> |
| 957 | - <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==3 && user_order_pt_state!=3 }}" class="buy-btn cart-btn line-h"> | |
| 995 | + <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==3 && user_order_pt_state!=3 }}" class="buy-btn cart-btn line-h"> | |
| 958 | 996 | <view class="fir-v">¥{{filters.toFix(prom_act.yf_price,2)}}</view> |
| 959 | 997 | <view>支付定金</view> |
| 960 | 998 | </view> |
| 961 | 999 | <view wx:if="{{prom_st==0}}" class="buy-btn cart-btn lanse">即将开始</view> |
| 962 | 1000 | <view wx:if="{{prom_r_null}}" class="buy-btn cart-btn huise">已抢光</view> |
| 963 | - <view wx:if="{{prom_st==3 && !prom_r_null}}" class="buy-btn cart-btn lanse">活动已经结束</view> | |
| 964 | - </block> | |
| 965 | - <block wx:else> | |
| 1001 | + <view wx:if="{{prom_st==3 && !prom_r_null}}" class="buy-btn cart-btn lanse">活动已经结束</view> --> | |
| 1002 | + <!-- </block> --> | |
| 1003 | + <!-- <block wx:else> | |
| 966 | 1004 | <view bindtap="go_to_nopay" wx:if="{{user_order_pt_state==1}}" class="buy-btn cart-btn huise"> |
| 967 | 1005 | 您还未支付 |
| 968 | 1006 | </view> |
| ... | ... | @@ -972,10 +1010,10 @@ |
| 972 | 1010 | <view wx:if="{{user_order_pt_state==3}}" bindtap="go_pay_wk" class="buy-btn cart-btn"> |
| 973 | 1011 | 支付尾款 |
| 974 | 1012 | </view> |
| 975 | - </block> | |
| 976 | - </block> | |
| 1013 | + </block> --> | |
| 1014 | + <!-- </block> --> | |
| 977 | 1015 | <!-- -----积分购------ --> |
| 978 | - <block wx:if="{{prom_type == 4}}"> | |
| 1016 | + <!-- <block wx:if="{{prom_type == 4}}"> | |
| 979 | 1017 | <block wx:if="{{is_shopbuy}}"> |
| 980 | 1018 | <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h"> |
| 981 | 1019 | <view class="fir-v"> |
| ... | ... | @@ -999,7 +1037,7 @@ |
| 999 | 1037 | 积分不足 |
| 1000 | 1038 | </view> |
| 1001 | 1039 | </block> |
| 1002 | - </block> | |
| 1040 | + </block> --> | |
| 1003 | 1041 | <!-- -<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:else>立即兑换</view> --> |
| 1004 | 1042 | </view> |
| 1005 | 1043 | <!-- 制作一个圆球导航 --> |
| ... | ... | @@ -1221,9 +1259,10 @@ |
| 1221 | 1259 | </view> |
| 1222 | 1260 | </view> |
| 1223 | 1261 | <!-- 弹起来,购买积分购 --> |
| 1224 | -<view hidden="{{!openSpecModal_inte}}"> | |
| 1262 | +<!-- <view hidden="{{!openSpecModal_inte}}"> | |
| 1225 | 1263 | <include src="buy_integral.wxml" /> |
| 1226 | -</view> | |
| 1264 | +</view> --> | |
| 1265 | + | |
| 1227 | 1266 | <!-- 弹起来,购买积分购的普通购买 --> |
| 1228 | 1267 | <!-- <view hidden="{{!openSpecModal_inte_normal}}"> |
| 1229 | 1268 | <include src="buy_integral_normal.wxml" /> |
| ... | ... | @@ -1232,6 +1271,8 @@ |
| 1232 | 1271 | <view hidden="{{!openSpecModal_pt}}"> |
| 1233 | 1272 | <include src="buy_pt.wxml" /> |
| 1234 | 1273 | </view> |
| 1274 | + | |
| 1275 | + | |
| 1235 | 1276 | <!-- --弹起来优惠信息---- --> |
| 1236 | 1277 | <!-- <view hidden="{{!openPromModal}}"> |
| 1237 | 1278 | <view bindtap="closePromModal" class="cover-layer"></view> |
| ... | ... | @@ -1468,7 +1509,7 @@ |
| 1468 | 1509 | <canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas> |
| 1469 | 1510 | <warn id="warn"></warn> |
| 1470 | 1511 | <!-- 分享控件,底部弹出 --> |
| 1471 | -<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share> | |
| 1512 | +<share id="share_button" bind:send="onShareAppMessage" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share> | |
| 1472 | 1513 | <view wx:if="{{showPoster}}"> |
| 1473 | 1514 | <view class="mask" catchtap="closePoster"></view> |
| 1474 | 1515 | <view class="poster-container"> |
| ... | ... | @@ -1558,7 +1599,7 @@ |
| 1558 | 1599 | <view class="img-container"><image class="img-block" src="{{iurl + 'miniapp/images/luckDraw/yhq.png'}}"></image></view> |
| 1559 | 1600 | <view class="f1 pdl20"> |
| 1560 | 1601 | <view class="ellipsis-2 popup-title">优惠券-{{i.name}}</view> |
| 1561 | - <view class="fs24 t-r pdt16 c-7b">数量:<text class="c-red">{{i.num}}</text></view> | |
| 1602 | + <view class="fs26 t-r pdt16 c-7b">数量:<text class="c-red">{{i.num}}</text></view> | |
| 1562 | 1603 | </view> |
| 1563 | 1604 | </view> |
| 1564 | 1605 | </block> |
| ... | ... | @@ -1568,7 +1609,7 @@ |
| 1568 | 1609 | <view class="img-container"><image class="img-block" src="{{iurl + 'miniapp/images/luckDraw/fw.png'}}"></image></view> |
| 1569 | 1610 | <view class="f1 pdl20"> |
| 1570 | 1611 | <view class="ellipsis-2 popup-title">服务项目-{{i.name}}</view> |
| 1571 | - <view class="fs24 t-r pdt16 c-7b">数量:<text class="c-red">{{i.num}}</text></view> | |
| 1612 | + <view class="fs26 t-r pdt16 c-7b">数量:<text class="c-red">{{i.num}}</text></view> | |
| 1572 | 1613 | </view> |
| 1573 | 1614 | </view> |
| 1574 | 1615 | </block> |
| ... | ... | @@ -1578,7 +1619,7 @@ |
| 1578 | 1619 | <view class="img-container"><image class="img-block" src="{{iurl + 'miniapp/images/luckDraw/jf.png'}}"></image></view> |
| 1579 | 1620 | <view class="f1 pdl20"> |
| 1580 | 1621 | <view class="ellipsis-2 popup-title">{{luckGoInfo[item.name]}}</view> |
| 1581 | - <view class="fs24 t-r pdt16 c-7b">金额:<text class="c-red">{{filters.div100(luckGoInfo[item.num])}}</text></view> | |
| 1622 | + <view class="fs26 t-r pdt16 c-7b">金额:<text class="c-red">{{filters.div100(luckGoInfo[item.num])}}</text></view> | |
| 1582 | 1623 | </view> |
| 1583 | 1624 | </view> |
| 1584 | 1625 | </block> |
| ... | ... | @@ -1591,7 +1632,7 @@ |
| 1591 | 1632 | </view> |
| 1592 | 1633 | <view class="f1 pdl20"> |
| 1593 | 1634 | <view class="ellipsis-2 popup-title">{{item.name}}</view> |
| 1594 | - <view class="fs24 t-r pdt16 c-7b">数量:<text class="c-red">{{luckGoInfo[item.num]}}</text></view> | |
| 1635 | + <view class="fs26 t-r pdt16 c-7b">数量:<text class="c-red">{{luckGoInfo[item.num]}}</text></view> | |
| 1595 | 1636 | </view> |
| 1596 | 1637 | </view> |
| 1597 | 1638 | </block> |
| ... | ... | @@ -1603,3 +1644,6 @@ |
| 1603 | 1644 | </view> |
| 1604 | 1645 | </view> |
| 1605 | 1646 | |
| 1647 | + <!-- 制作一个圆球导航 --> | |
| 1648 | + <nav_box></nav_box> | |
| 1649 | + | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxss
packageC/pages/luckyGo/luckyGo_list/luckyGo_list.js
| ... | ... | @@ -253,7 +253,7 @@ Page({ |
| 253 | 253 | case 3: { //优惠券 |
| 254 | 254 | app.request.promiseGet('/api/weshop/prom/luckyCoupon/page', { |
| 255 | 255 | data: { |
| 256 | - store_id: os.stoid, | |
| 256 | + store_id: app.globalData.setting.stoid, | |
| 257 | 257 | aid: self.data.currentItemAid, |
| 258 | 258 | } |
| 259 | 259 | }).then(res => { |
| ... | ... | @@ -268,7 +268,7 @@ Page({ |
| 268 | 268 | case 4: { //服务项目 |
| 269 | 269 | app.request.promiseGet('/api/weshop/prom/luckyService/page', { |
| 270 | 270 | data: { |
| 271 | - store_id: os.stoid, | |
| 271 | + store_id: app.globalData.setting.stoid, | |
| 272 | 272 | aid: self.data.currentItemAid, |
| 273 | 273 | } |
| 274 | 274 | }).then(res => { | ... | ... |
packageC/pages/luckyGo/luckyGo_list/luckyGo_list.wxml
| ... | ... | @@ -8,7 +8,8 @@ |
| 8 | 8 | <view class="list"> |
| 9 | 9 | <view class="list-item" wx:for="{{list.pageData}}"> |
| 10 | 10 | <!-- <view class="list-item" wx:for="{{list.pageData}}"> --> |
| 11 | - <view class="pd20" bindtap="go" data-url="/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id={{item.order_id}}"> | |
| 11 | + <view class="pd20" bindtap="go" data-url="/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id={{item.order_id}}&team_status={{item.team_status}}&group_id={{item.aid}}"> | |
| 12 | + <!-- <view class="fs28">{{item.act_name}} (第{{item.team_sn}}期) </view> --> | |
| 12 | 13 | <view class="pdr40 arrow" wx:if="{{item.team_status == 0}}">参团中,还差<text class="c-red">{{filters.difference(item.num, item.group_num)}}</text>人</view> |
| 13 | 14 | <view class="pdr40 arrow" wx:elif="{{item.team_status == 2}}">已团中,{{item.shipping_status == 0 ? '待发货':'已发货'}}</view> |
| 14 | 15 | <view class="pdr40 arrow" wx:elif="{{item.team_status == 1}}">未团中,已退款</view> |
| ... | ... | @@ -28,10 +29,10 @@ |
| 28 | 29 | </view> |
| 29 | 30 | </view> |
| 30 | 31 | <view class="flex ai-center pd20 bdt fs24 jc_sb"> |
| 31 | - <view>共1件,实付金额:<text class="rmb">{{item.user_money}}</text></view> | |
| 32 | + <view>共1件,实付金额:<text class="rmb">{{filters.toFix(item.order_amount+item.user_money,2)}}</text></view> | |
| 32 | 33 | <view class="flex"> |
| 33 | - <view class="btn gray" bindtap="go" data-url="/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id={{item.order_id}}&team_status={{item.team_status}}">查看订单</view> | |
| 34 | - <view class="btn c-red mgl20" wx:if="{{item.team_status == 0}}" bindtap="go" data-url="/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?group_id={{item.aid}}&goods_id={{item.goods_id}}&goods_name={{item.goods_name}}&team_id={{item.team_id}}&&from=list">邀请好友</view> | |
| 34 | + <view class="btn gray" bindtap="go" data-url="/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id={{item.order_id}}&team_status={{item.team_status}}&group_id={{item.aid}}">查看订单</view> | |
| 35 | + <view class="btn c-red mgl20" wx:if="{{item.team_status == 0}}" bindtap="go" data-url="/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?group_id={{item.aid}}&goods_id={{item.goods_id}}&goods_name={{item.goods_name}}&team_id={{item.team_id}}&&from=1">邀请好友</view> | |
| 35 | 36 | <view class="btn c-red mgl20" wx:if="{{item.team_status == 1}}" bindtap="showReward" data-index="{{index}}" data-aid="{{item.aid}}">查看奖励</view> |
| 36 | 37 | </view> |
| 37 | 38 | </view> |
| ... | ... | @@ -74,7 +75,7 @@ |
| 74 | 75 | <view class="img-container"><image class="img-block" src="{{imghost + 'miniapp/images/luckDraw/jf.png'}}"></image></view> |
| 75 | 76 | <view class="f1"> |
| 76 | 77 | <view class="ellipsis-2 popup-title">{{list.pageData[currentItemIndex][item.name]}}</view> |
| 77 | - <view class="fs24 t-r pdt16 c-7b">金额:<text class="c-red">{{filters.div100(list.pageData[currentItemIndex][item.num])}}</text></view> | |
| 78 | + <view class="fs24 t-r pdt16 c-7b">金额:<text class="c-red">{{filters.div100((list.pageData[currentItemIndex][item.num]))}}</text></view> | |
| 78 | 79 | </view> |
| 79 | 80 | </view> |
| 80 | 81 | </block> | ... | ... |
packageC/pages/luckyGo/luckyGo_list/luckyGo_list.wxss
packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js
| ... | ... | @@ -47,6 +47,7 @@ Page({ |
| 47 | 47 | self.getData(true, '/api/weshop/prom/luckyOrder/page', { |
| 48 | 48 | store_id: app.globalData.setting.stoid, |
| 49 | 49 | team_id: self.data.team_id, |
| 50 | + pageSize: 20, | |
| 50 | 51 | }); |
| 51 | 52 | |
| 52 | 53 | |
| ... | ... | @@ -84,6 +85,7 @@ Page({ |
| 84 | 85 | this.scrollToLower('/api/weshop/prom/luckyOrder/page', { |
| 85 | 86 | store_id: app.globalData.setting.stoid, |
| 86 | 87 | team_id: self.data.team_id, |
| 88 | + pageSize: 20, | |
| 87 | 89 | }); |
| 88 | 90 | }, |
| 89 | 91 | ... | ... |
packageC/pages/luckyGo/luckyGo_members/luckyGo_members.json
packageC/pages/luckyGo/luckyGo_members/luckyGo_members.wxml
| ... | ... | @@ -4,12 +4,12 @@ |
| 4 | 4 | <view class="flex ai-center pdr20"> |
| 5 | 5 | <view class="img-container"><image class="img-block" src="{{item.head_pic}}"></image></view> |
| 6 | 6 | <view> |
| 7 | - <text class="ellipsis-1x wbba">{{item.nickname}}</text> | |
| 8 | - <view class="c-8f pdt10">参团编号:{{item.team_sn}}</view> | |
| 7 | + <text class="ellipsis-1x wbba fs30">{{item.nickname}}</text> | |
| 8 | + <!-- <view class="c-8f pdt10">参团编号:{{item.team_sn}}</view> --> | |
| 9 | 9 | </view> |
| 10 | 10 | </view> |
| 11 | 11 | <view class="pdt6 shrink0"> |
| 12 | - <view class="c-9">{{filters.format_time(item.create_time, 1)}}</view> | |
| 12 | + <view class="c-9">{{filters.format_time(item.add_time, 1)}}</view> | |
| 13 | 13 | <view class="t-r pdt10 c-red bold" wx:if="{{item.team_status == 0}}">待成团</view> |
| 14 | 14 | <view class="t-r pdt10 c-8f bold" wx:elif="{{item.team_status == 1}}">未团中</view> |
| 15 | 15 | <view class="t-r pdt10 c-red bold" wx:else="{{item.team_status == 2}}">已团中</view> | ... | ... |
packageC/pages/luckyGo/luckyGo_members/luckyGo_members.wxss
packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js
| ... | ... | @@ -17,7 +17,8 @@ Page({ |
| 17 | 17 | onLoad: function(e) { |
| 18 | 18 | var th=this; |
| 19 | 19 | var r = void 0 !== e.isGoup && e.isGoup; |
| 20 | - | |
| 20 | + // console.log('e*************>>>>>>', e); | |
| 21 | + this.data.group_id = e.group_id; | |
| 21 | 22 | getApp().getConfig2(function (e) { |
| 22 | 23 | |
| 23 | 24 | th.setData({conf: e,sales_rules:e.sales_rules, userInfo: getApp().globalData.userInfo}); |
| ... | ... | @@ -317,429 +318,40 @@ Page({ |
| 317 | 318 | |
| 318 | 319 | //--------立即支付---------- |
| 319 | 320 | async jumpToCart4(e) { |
| 320 | - var th=this; | |
| 321 | - if(this.data.optionIsGoup) | |
| 322 | - wx.navigateTo({ | |
| 323 | - url: "/pages/team/team_confirm/team_confirm?orderSn=" + this.data.order.order_sn + "&orderPay=true" | |
| 324 | - }) | |
| 325 | - var order=this.data.order; | |
| 326 | - var order_goods=order.order_goods; | |
| 327 | - var user_id=order.user_id; | |
| 328 | - | |
| 329 | - var wlist=""; | |
| 330 | - for(var i in order_goods){ | |
| 331 | - var good=order_goods[i]; | |
| 332 | - //线下取价功能已经关闭或者过期 | |
| 333 | - if(!th.data.is_open_offline && good.offline_cut>0){ | |
| 334 | - wx.showModal({ | |
| 335 | - title: '提示', | |
| 336 | - content: '线下取价功能已经关闭或者过期!' | |
| 337 | - }); | |
| 338 | - return false; | |
| 339 | - } | |
| 340 | - | |
| 341 | - //要每件每件的商品进行检查,看有么有超出库存,超出限购 | |
| 342 | - var good= order_goods[i],goodsbuynum=0,promgoodsbuynum=0,gg=null; | |
| 343 | - //获取单品的现在的活动状态 | |
| 344 | - await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + good.goods_id, { | |
| 345 | - }).then(res=>{ | |
| 346 | - gg=res.data.data; | |
| 347 | - }) | |
| 348 | - var limit = gg.viplimited; | |
| 349 | - var store_count = gg.store_count; | |
| 350 | - good.erpwareid=gg.erpwareid; | |
| 351 | - | |
| 352 | - //---要获得商品,该用户买了多少件,同步应用--- | |
| 353 | - await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { | |
| 354 | - data: { | |
| 355 | - store_id: os.stoid, | |
| 356 | - user_id: getApp().globalData.user_id, | |
| 357 | - goods_id: good.goods_id, | |
| 358 | - prom_type: good.prom_type, | |
| 359 | - prom_id: good.prom_id | |
| 360 | - }, | |
| 361 | - }).then(res => { | |
| 362 | - var buy_num_data = res.data.data; | |
| 363 | - if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum; | |
| 364 | - goodsbuynum = buy_num_data.goodsbuynum; | |
| 365 | - }) | |
| 366 | - | |
| 367 | - var buyed_mum2=goodsbuynum+good.goods_num; | |
| 368 | - if (buyed_mum2 > limit && limit > 0) { | |
| 369 | - | |
| 370 | - var content=gg.goods_name+'购买数量超出商品限购,请取消订单'; | |
| 371 | - th.toast(content); | |
| 372 | - return false; | |
| 373 | - } | |
| 374 | - | |
| 375 | - //当是组合优惠的时候 | |
| 376 | - if(good.prom_type==7){ | |
| 377 | - //如果有组合购 | |
| 378 | - var isok = 1; | |
| 379 | - var url="/api/weshop/prom/zhbuy/get/"+os.stoid+"/"+good.prom_id+"/"+getApp().globalData.userInfo.user_id; | |
| 380 | - await getApp().request.promiseGet(url, {}).then(res => { | |
| 381 | - if(res.data.code==0 && res.data.data){ | |
| 382 | - if(res.data.data.is_show!=1){ | |
| 383 | - isok=0; | |
| 384 | - } | |
| 385 | - //如果活动已经结束 | |
| 386 | - if(res.data.data.is_end==1){ | |
| 387 | - isok=0; | |
| 388 | - } | |
| 389 | - //已经结束 | |
| 390 | - if(ut.gettimestamp()>res.data.data.end_time){ | |
| 391 | - isok=0; | |
| 392 | - } | |
| 393 | - //还未开始 | |
| 394 | - if(ut.gettimestamp()<res.data.data.start_time){ | |
| 395 | - isok=0; | |
| 396 | - } | |
| 397 | - | |
| 398 | - }else{ | |
| 399 | - //未找到商品的活动 | |
| 400 | - isok = 0; | |
| 401 | - } | |
| 402 | - | |
| 403 | - }) | |
| 404 | - if (!isok){ | |
| 405 | - var content=gg.goods_name+'活动已经结束,请取消订单'; | |
| 406 | - th.toast(content); | |
| 407 | - return false; | |
| 408 | - } | |
| 409 | - | |
| 410 | - var url1 = "/api/weshop/prom/zhbuyGoods/page"; | |
| 411 | - var req_data = { | |
| 412 | - page: 1, | |
| 413 | - pageSize: 1, | |
| 414 | - store_id: os.stoid, | |
| 415 | - zh_id: good.prom_id, | |
| 416 | - goods_id:good.goods_id | |
| 417 | - } | |
| 418 | - await getApp().request.promiseGet(url1, { | |
| 419 | - data: req_data | |
| 420 | - }).then(res => { | |
| 421 | - if (ut.ajax_ok(res)) { | |
| 422 | - var gdlist = res.data.data.pageData[0]; | |
| 423 | - good.buyqty=gdlist.buyqty; | |
| 424 | - } | |
| 425 | - }) | |
| 426 | 321 | |
| 427 | - var num=good['buyqty']; | |
| 428 | - console.log(1111); | |
| 429 | - console.log(num); | |
| 430 | - //---- 要计算商品的限购 ----- | |
| 431 | - if(good['buyqty']>0){ | |
| 432 | - if(good.goods_num+promgoodsbuynum>good['buyqty']){ | |
| 322 | + // 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id} | |
| 323 | + if (parseInt(this.data.order.order_goods['0']['prom_type']) == 9) { | |
| 324 | + var aid = this.data.order.order_goods['0']['prom_id']; | |
| 325 | + var knum = 0; | |
| 326 | + await r.promiseGet('/api/weshop/activitylist/getActLen/' + os.stoid + '/9/' + aid, { | |
| 327 | + }).then(res => { | |
| 328 | + if (res.data.code == 0) { | |
| 329 | + knum = res.data.data; | |
| 330 | + } | |
| 331 | + | |
| 332 | + }); | |
| 433 | 333 | |
| 434 | - var content= good['goods_name']+"超出活动限购\n"; | |
| 435 | - th.toast(content); | |
| 436 | - return false; | |
| 437 | - } | |
| 438 | - } | |
| 439 | - } | |
| 334 | + if (knum <= 0) { | |
| 335 | + getApp().confirmBox("库存为0,支付失败"); | |
| 336 | + return false; | |
| 337 | + } | |
| 440 | 338 | |
| 441 | - //如果优惠促销和搭配购的时候 | |
| 442 | - if((good.prom_type==3 || good.prom_type==5) && good.is_collocation!=1 && good.is_gift!=1){ | |
| 443 | - var p_ok=1; | |
| 444 | - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => { | |
| 445 | - if(res.data.code==0){ | |
| 446 | - var r_data=res.data.data; | |
| 447 | - if(!r_data.collocationPromList && good.prom_type==5){ | |
| 448 | - | |
| 449 | - var content=good.goods_name+'未找到活动,请取消订单重新购买'; | |
| 450 | - th.toast(content); | |
| 451 | - p_ok=0; | |
| 452 | - } | |
| 453 | - if(!r_data.promGoodsLists && good.prom_type==3){ | |
| 454 | - | |
| 455 | - var content=good.goods_name+'未找到活动,请取消订单重新购买'; | |
| 456 | - th.toast(content); | |
| 457 | - p_ok=0; | |
| 458 | - } | |
| 459 | - }else{ | |
| 460 | - | |
| 461 | - var content=good.goods_name+'未找到活动,请取消订单重新购买'; | |
| 462 | - th.toast(content); | |
| 463 | - p_ok=0; | |
| 464 | - } | |
| 465 | - }) | |
| 466 | - if(!p_ok) return false; | |
| 467 | 339 | } |
| 468 | - | |
| 469 | - //商品的普通购买 ,不要进行判断 | |
| 470 | - if((good.prom_type==1 || good.prom_type==2 || good.prom_type==6 || good.prom_type==4) && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal){ | |
| 471 | - if(gg.prom_type!=good.prom_type && gg.prom_type>0) { | |
| 472 | - var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; | |
| 473 | - th.toast(content); | |
| 474 | - return false; | |
| 475 | - } | |
| 476 | - }else{ | |
| 477 | - if((gg.prom_type==1 || gg.prom_type==3 || gg.prom_type==5 || gg.prom_type==6 || gg.prom_type==4) | |
| 478 | - && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) { | |
| 479 | - var prom=null; | |
| 480 | - //---如果是活动的时候--- | |
| 481 | - var prom=null,th=this; | |
| 482 | - if(gg.prom_type==1){ | |
| 483 | - await getApp().request.promiseGet("/api/ms/flash_sale/getNew/"+os.stoid+"/"+user_id+"/"+gg.prom_id,{ | |
| 484 | - }).then(res=>{ | |
| 485 | - if(res.data.code==0){ | |
| 486 | - prom=res.data.data; | |
| 487 | - prom.price=prom.user_price; | |
| 488 | - } | |
| 489 | - }) | |
| 490 | - } | |
| 491 | - | |
| 492 | - if (gg.prom_type == 2) { | |
| 493 | - await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/"+ gg.goods_id + "/" + gg.prom_id, {}).then(res => { | |
| 494 | - if (res.data.code == 0) { | |
| 495 | - prom = res.data.data; | |
| 496 | - prom.price=prom.price; | |
| 497 | - } | |
| 498 | - }) | |
| 499 | - } | |
| 500 | - | |
| 501 | - | |
| 502 | - if(gg.prom_type==6){ | |
| 503 | - await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+gg.prom_id,{ | |
| 504 | - }).then(res=>{ | |
| 505 | - if(res.data.code==0){ | |
| 506 | - prom=res.data.data; | |
| 507 | - } | |
| 508 | - }) | |
| 509 | - } | |
| 510 | - | |
| 511 | - if(gg.prom_type==4){ | |
| 512 | - await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList?stype=1&stypeup=1",{ | |
| 513 | - data:{store_id:os.stoid,goods_id:gg.goods_id} | |
| 514 | - }).then(res=>{ | |
| 515 | - if(res.data.code==0 && res.data.data && res.data.data.pageData){ | |
| 516 | - prom=res.data.data.pageData[0]; | |
| 517 | - } | |
| 518 | - }) | |
| 519 | - } | |
| 520 | - | |
| 521 | - if(prom){ | |
| 522 | - var t_now=ut.gettimestamp(); | |
| 523 | - if(prom.is_end==0 && prom.start_time<t_now && prom.end_time>t_now){ | |
| 524 | - | |
| 525 | - var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; | |
| 526 | - th.toast(content); | |
| 527 | - return false; | |
| 528 | - } | |
| 529 | - } | |
| 530 | - } | |
| 531 | - else{ | |
| 532 | - //不是赠品的时候 | |
| 533 | - if(!good.is_gift && good.prom_type!=3){ | |
| 534 | - var t_ok=1; | |
| 535 | - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => { | |
| 536 | - if(res.data.code==0){ | |
| 537 | - var r_data=res.data.data; | |
| 538 | - //-- 参加了全局的优惠活动 -- | |
| 539 | - if(r_data.promGoodsLists){ | |
| 540 | - | |
| 541 | - var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; | |
| 542 | - th.toast(content); | |
| 543 | - t_ok=0; | |
| 544 | - } | |
| 545 | - } | |
| 546 | - }) | |
| 547 | - if(!t_ok) return false; | |
| 548 | - } | |
| 549 | - | |
| 550 | - //-- 如果有参加线下取价 -- | |
| 551 | - if(good.offline_cut>0) wlist+=encodeURIComponent(gg.erpwareid)+","; | |
| 552 | - } | |
| 553 | - //赠品和搭配购不判断商品金额 | |
| 554 | - var isok=1; | |
| 555 | - var card_field=th.data.card_field; | |
| 556 | - //如果会员是等级会员,商品有等级价,且不是活动商品 | |
| 557 | - if(!good.is_gift && !good.is_collocation) { | |
| 558 | - if (card_field && gg[card_field] > 0) { | |
| 559 | - if (good.goods_price != gg[card_field] && good.offline_cut<=0) isok = 0; | |
| 560 | - if (good.goods_price >gg[card_field] && good.offline_cut>0) isok = 0; //如果线下价格比较贵,则不通过 | |
| 561 | - | |
| 562 | - } else { | |
| 563 | - if (good.goods_price != gg.shop_price && good.offline_cut<=0) isok = 0; | |
| 564 | - if (good.goods_price> gg.shop_price && good.offline_cut>0) isok = 0; //如果线下价格比较贵,则不通过 | |
| 565 | - } | |
| 566 | - var is_h=0; | |
| 567 | - if (!isok) { | |
| 568 | - | |
| 569 | - var content=gg.goods_name + '商品的价格发生了变化,请取消订单重新购买'; | |
| 570 | - th.toast(content); | |
| 571 | - return false; | |
| 572 | - } | |
| 573 | - } | |
| 574 | - | |
| 575 | - //--如果是线下库存的时候-- | |
| 576 | - if(th.data.conf.sales_rules==2){ | |
| 577 | - var ob={}; | |
| 578 | - await th.check_down_line_next(gg,good.goods_num,order.pickup_id,function(obj){ | |
| 579 | - ob=obj; | |
| 580 | - }) | |
| 581 | - if(ob.code==-1){ | |
| 582 | - | |
| 583 | - var content=gg.goods_name+'门店库存不足,请取消订单'; | |
| 584 | - th.toast(content); | |
| 585 | - return false; | |
| 586 | - } | |
| 587 | - | |
| 588 | - }else{ | |
| 589 | - if(good.goods_num>store_count){ | |
| 590 | - | |
| 591 | - var content=gg.goods_name+'商品的库存不足,请取消订单'; | |
| 592 | - th.toast(content); | |
| 593 | - return false; | |
| 594 | - } | |
| 595 | - | |
| 596 | - } | |
| 597 | - } | |
| 598 | - | |
| 599 | - console.log("------------------------------------"); | |
| 600 | - //---如果是活动的时候--- | |
| 601 | - var prom=null,goodsinfo=good,th=this; | |
| 602 | - if(goodsinfo.prom_type==1){ | |
| 603 | - await getApp().request.promiseGet("/api/ms/flash_sale/getNew/"+os.stoid+"/"+user_id+"/"+goodsinfo.prom_id,{ | |
| 604 | - }).then(res=>{ | |
| 605 | - if(res.data.code==0){ | |
| 606 | - prom=res.data.data; | |
| 607 | - prom.price=prom.user_price; | |
| 608 | - } | |
| 609 | - }) | |
| 610 | - } | |
| 611 | - | |
| 612 | - if (goodsinfo.prom_type == 2) { | |
| 613 | - await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/"+ good.goods_id + "/" + goodsinfo.prom_id, {}).then(res => { | |
| 614 | - if (res.data.code == 0) { | |
| 615 | - prom = res.data.data; | |
| 616 | - prom.price=prom.price; | |
| 617 | - } | |
| 618 | - }) | |
| 619 | - } | |
| 620 | - | |
| 621 | - | |
| 622 | - if(goodsinfo.prom_type==6 && !good.is_pd_normal){ | |
| 623 | - await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{ | |
| 624 | - }).then(res=>{ | |
| 625 | - if(res.data.code==0){ | |
| 626 | - prom=res.data.data; | |
| 627 | - } | |
| 628 | - }) | |
| 629 | - } | |
| 630 | - | |
| 631 | - if(goodsinfo.prom_type==4 && !good.is_integral_normal){ | |
| 632 | - await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList?stype=1&stypeup=1",{ | |
| 633 | - data:{store_id:os.stoid,goods_id:goodsinfo.goods_id} | |
| 634 | - }).then(res=>{ | |
| 635 | - if(res.data.code==0 && res.data.data && res.data.data.pageData){ | |
| 636 | - prom=res.data.data.pageData[0]; | |
| 637 | - } | |
| 638 | - }) | |
| 639 | - } | |
| 640 | - | |
| 641 | - //----------如果有活动,并且在进行中,就不计算线下库存--------------- | |
| 642 | - if(prom){ | |
| 643 | - var now=ut.gettimestamp(); | |
| 644 | - if(prom.is_end==1 && prom.end_time<now){ | |
| 645 | - | |
| 646 | - var content=goodsinfo.goods_name+'商品的活动已经结束,请取消订单重新购买'; | |
| 647 | - th.toast(content); | |
| 648 | - return false; | |
| 649 | - } | |
| 650 | - | |
| 651 | - buyed_mum2=promgoodsbuynum+good.goods_num; | |
| 652 | - if (buyed_mum2 > prom.buy_limit && prom.buy_limit > 0) { | |
| 653 | - | |
| 654 | - var content=goodsinfo.goods_name+'购买数量超出商品活动限购,请取消订单重新购买'; | |
| 655 | - th.toast(content); | |
| 656 | - return false; | |
| 657 | - } | |
| 658 | - //看一下会员的秒杀价格是不是发生了变化 | |
| 659 | - if(goodsinfo.prom_type==1 && goodsinfo.goods_price!=prom.price){ | |
| 660 | - var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; | |
| 661 | - th.toast(content); | |
| 662 | - return false; | |
| 663 | - } | |
| 664 | - | |
| 665 | - //看一下会员的团购价格是不是发生了变化 | |
| 666 | - if(goodsinfo.prom_type==2 && goodsinfo.goods_price!=prom.price){ | |
| 667 | - var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; | |
| 668 | - th.toast(content); | |
| 669 | - return false; | |
| 670 | - } | |
| 671 | 340 | |
| 672 | - if(goodsinfo.prom_type==4){ | |
| 673 | - if (good.goods_num > prom.limitqty-prom.buy_num) { | |
| 674 | - | |
| 675 | - var content=goodsinfo.goods_name+'购买数量超出商品活动库存,请取消订单'; | |
| 676 | - th.toast(content); | |
| 677 | - return false; | |
| 678 | - } | |
| 679 | - }else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) { | |
| 680 | - if(order.add_time+5*60<ut.gettimestamp()) { | |
| 681 | - var content = gg.goods_name + '该订单已经超时无法支付,请取消订单'; | |
| 682 | - th.toast(content); | |
| 683 | - return false; | |
| 684 | - } | |
| 685 | - } | |
| 686 | - | |
| 687 | - } | |
| 688 | - | |
| 689 | - } | |
| 341 | + var order=this.data.order; | |
| 342 | + var order_goods=order.order_goods; | |
| 343 | + var user_id=order.user_id; | |
| 344 | + // 检测活动是否结束 | |
| 345 | + | |
| 690 | 346 | |
| 691 | - //-- 要判断一下线下取价价格是不是发生改变 -- | |
| 692 | - if(wlist!="" && th.data.is_open_offline && th.data.is_open_offline>0){ | |
| 693 | - wlist=ut.sub_last(wlist); | |
| 694 | - var keyid=order.pickup_id; | |
| 695 | - var user_info=getApp().globalData.userInfo; | |
| 696 | - if(!keyid) return false; | |
| 697 | - var offarr=null; | |
| 698 | - await getApp().request.promiseGet("/api/weshop/goods/listWarePrice", { | |
| 699 | - data:{ | |
| 700 | - VIPId:encodeURIComponent(user_info.erpvipid), | |
| 701 | - store_id:os.stoid, | |
| 702 | - PickupId:keyid, | |
| 703 | - WareIds:wlist}, | |
| 704 | - }, | |
| 705 | - ).then(res=>{ | |
| 706 | - if(res.data.code==0 && res.data.data && res.data.data.length>0){ | |
| 707 | - offarr=res.data.data; | |
| 708 | - } | |
| 709 | - }) | |
| 710 | - if(!offarr && offarr.length<=0 ){ | |
| 711 | - wx.showModal({ title: '获取线下取价失败',}); | |
| 712 | - } | |
| 713 | - var newarr=ut.convert_arr_key(offarr,'WareId'); | |
| 714 | - //-- 循环判断线下的价格 -- | |
| 715 | - for(var k in order_goods){ | |
| 716 | - var good=order_goods[k]; | |
| 717 | - //判断线下取价是不是一样 | |
| 718 | - if(newarr[good.erpwareid] && | |
| 719 | - parseFloat(newarr[good.erpwareid].WarePrice)!=parseFloat(good.goods_price)){ | |
| 720 | - | |
| 721 | - var content=good.goods_name + '商品的价格发生了变化,请取消订单重新购买'; | |
| 722 | - th.toast(content); | |
| 723 | - return false; | |
| 724 | - } | |
| 725 | - } | |
| 726 | - | |
| 727 | - } | |
| 728 | - | |
| 729 | - /*--- | |
| 730 | - o.jumpToCart4({ | |
| 731 | - order_sn: this.data.order.order_sn, | |
| 732 | - order_amount: this.data.order.order_amount, | |
| 733 | - type: 1 //正常单 | |
| 734 | - }, 1);--*/ | |
| 735 | - | |
| 736 | 347 | py.pay(this.data.order.order_sn, function() { |
| 737 | - wx.showToast({title: '支付成功'}) | |
| 738 | - wx.navigateBack(); | |
| 348 | + wx.showToast({title: '支付成功'}) | |
| 349 | + wx.navigateBack(); | |
| 739 | 350 | },null,os.stoid,1); |
| 740 | 351 | |
| 741 | 352 | |
| 742 | - }, | |
| 353 | + }, | |
| 354 | + | |
| 743 | 355 | checkTeam: function() { |
| 744 | 356 | wx.navigateTo({ |
| 745 | 357 | url: "/pages/team/team_detail/team_detail?foundId=" + this.data.order.orderTeamFound.found_id |
| ... | ... | @@ -1472,27 +1084,41 @@ Page({ |
| 1472 | 1084 | |
| 1473 | 1085 | //跳转到商品 |
| 1474 | 1086 | go_gd:function (e) { |
| 1087 | + // console.log(e); | |
| 1475 | 1088 | var gd= e.currentTarget.dataset.gd; |
| 1476 | - var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; | |
| 1477 | - var url="/api/weshop/activitylist/getGoodActInfo"; | |
| 1478 | - var req_data={ | |
| 1479 | - store_id:os.stoid,goodsidlist:gd,is_detail:1 | |
| 1480 | - }; | |
| 1089 | + var prom_type = this.data.order.order_goods[0].prom_type; | |
| 1090 | + // var good_url=''; | |
| 1091 | + // if(prom_type == 9) { | |
| 1092 | + // good_url = ''; | |
| 1093 | + // } else { | |
| 1094 | + // good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; | |
| 1095 | + // }; | |
| 1096 | + | |
| 1097 | + var good_url="/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=" + gd + '&group_id=' + this.data.group_id; | |
| 1098 | + getApp().goto(good_url); | |
| 1099 | + | |
| 1100 | + // var url="/api/weshop/activitylist/getGoodActInfo"; | |
| 1101 | + // var req_data={ | |
| 1102 | + // store_id:os.stoid,goodsidlist:gd,is_detail:1 | |
| 1103 | + // }; | |
| 1481 | 1104 | //获取秒杀的多规格 |
| 1482 | - getApp().request.promiseGet(url, {data:req_data}).then(res=>{ | |
| 1483 | - if(res.data.code==0 && res.data.data){ | |
| 1484 | - if(res.data.data.length==1){ | |
| 1485 | - good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; | |
| 1486 | - } | |
| 1487 | - getApp().goto(good_url); | |
| 1105 | + // getApp().request.promiseGet(url, {data:req_data}).then(res=>{ | |
| 1106 | + // if(res.data.code==0 && res.data.data){ | |
| 1107 | + // if(res.data.data.length==1){ | |
| 1108 | + // good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; | |
| 1109 | + // } | |
| 1110 | + // getApp().goto(good_url); | |
| 1488 | 1111 | |
| 1489 | - }else{ | |
| 1490 | - getApp().goto(good_url); | |
| 1491 | - } | |
| 1492 | - }) | |
| 1112 | + // }else{ | |
| 1113 | + // getApp().goto(good_url); | |
| 1114 | + // } | |
| 1115 | + // }) | |
| 1493 | 1116 | }, |
| 1494 | 1117 | |
| 1495 | 1118 | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1496 | 1122 | |
| 1497 | 1123 | |
| 1498 | 1124 | ... | ... |
packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml
| ... | ... | @@ -30,16 +30,16 @@ |
| 30 | 30 | data-errorimg="order.order_goods[{{index}}].original_img"></image> |
| 31 | 31 | </view> |
| 32 | 32 | <!-- 跳转到商品 --> |
| 33 | - <navigator class="order-cont pdh20" bindtap="go_gd" data-gd="{{item.goods_id}}"> | |
| 33 | + <view class="order-cont pdh20" bindtap="go_gd" data-gd="{{item.goods_id}}"> | |
| 34 | 34 | <view class="goods-name ellipsis-2">{{item.goods_name}}</view> |
| 35 | 35 | <!--<view class="goods-color">{{item.goods_spec}} {{item.goods_color}}</view>--> |
| 36 | 36 | <view class="goods-color">{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</view> |
| 37 | - </navigator> | |
| 37 | + </view> | |
| 38 | 38 | </view> |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | <view class="order-num"> |
| 42 | - <view class="goods-price">¥{{item.member_goods_price}}</view> | |
| 42 | + <view class="goods-price">¥{{item.goods_price}}</view> | |
| 43 | 43 | <view class="goods-num">×{{item.goods_num}}</view> |
| 44 | 44 | |
| 45 | 45 | <!-- 不是整单退的时候 --> |
| ... | ... | @@ -84,9 +84,10 @@ |
| 84 | 84 | <view>{{order.addTimeFormat}}</view> |
| 85 | 85 | </view> |
| 86 | 86 | |
| 87 | - <view class="item" wx:if="{{order.order_prom_type!=5}}"> | |
| 87 | + <view class="item"> | |
| 88 | 88 | <view>配送方式</view> |
| 89 | - <view>{{(order.shipping_name!=''&& order.shipping_name!=null) ?order.shipping_name:'无'}}</view> | |
| 89 | + <view wx:if="{{order.exp_type == 0}}">{{order.shipping_name}}</view> | |
| 90 | + <view wx:if="{{order.exp_type == 1}}">自提</view> | |
| 90 | 91 | </view> |
| 91 | 92 | <view class="item"> |
| 92 | 93 | <view>买家留言</view> |
| ... | ... | @@ -173,7 +174,7 @@ |
| 173 | 174 | |
| 174 | 175 | |
| 175 | 176 | |
| 176 | - <!-- <view class="btn-wrap"> | |
| 177 | + <view class="btn-wrap"> | |
| 177 | 178 | |
| 178 | 179 | <view bindtap="zfwk" class="tips-btn" wx:if="{{order.pt_tail_money>0 && order.pt_status==2 }}">支付尾款</view> |
| 179 | 180 | <view bindtap="jumpToCart4" class="tips-btn" hidden="{{!order.pay_btn}}">立即付款</view> |
| ... | ... | @@ -183,9 +184,8 @@ |
| 183 | 184 | </block> |
| 184 | 185 | |
| 185 | 186 | <view class="tips-btn" wx:if="{{order.order_status==3}}" bindtap="deleteOrderData" data-order_id="{{order.order_id}}" >删除订单</view> |
| 186 | - | |
| 187 | 187 | |
| 188 | - <navigator class="tips-btn" hidden="{{!order.shipping_btn}}" url="/pages/user/express/express?order_id={{order.order_id}}">查看物流</navigator> --> | |
| 188 | + <navigator class="tips-btn" hidden="{{!order.shipping_btn}}" url="/pages/user/express/express?order_id={{order.order_id}}">查看物流</navigator> | |
| 189 | 189 | |
| 190 | 190 | <!---has_rt部分退----> |
| 191 | 191 | <!-- <block wx:if="{{order.return_btn==undefined && order.is_all_return!=1 && order.has_rt!=1}}"> |
| ... | ... | @@ -197,7 +197,8 @@ |
| 197 | 197 | <navigator class="tips-btn" wx:if="{{order.is_all_return_status==3 && order.order_status<2}}" url="/pages/order/refund_order/refund_order?order_id={{order.order_id}}">重新退款</navigator> |
| 198 | 198 | <navigator class="tips-btn" wx:if="{{order.is_all_return_status==0 || order.is_all_return_status==1}}" |
| 199 | 199 | url="/pages/user/return_goods_info/return_goods_info?order_id={{order.order_id}}">退款详情</navigator> |
| 200 | - </block> | |
| 200 | + | |
| 201 | + </block>--> | |
| 201 | 202 | |
| 202 | 203 | |
| 203 | 204 | <block wx:if="{{order.order_status==2 && order.is_zsorder!=4}}"> |
| ... | ... | @@ -205,12 +206,9 @@ |
| 205 | 206 | url="/packageB/pages/user/comment/comment?status=0&order_id={{order.order_id}}">评价</navigator> |
| 206 | 207 | <navigator wx:else class="tips-btn" |
| 207 | 208 | url="/packageB/pages/user/add_comment/add_comment?goods_id={{order.order_goods[0].goods_id}}&order_id={{order.order_id}}}">去评价</navigator> |
| 208 | - </block> --> | |
| 209 | - <!-- 积分购 拼团 搭配购没有有再来一单 --> | |
| 210 | - <!-- <block wx:if="{{ (order.pay_status==1 || order.order_status==3) && order.pt_prom_id<=0 && order.integral<=0 && order.order_goods[0].prom_type!=5}}"> | |
| 211 | - <view style="background-color: #feca53;" class="tips-btn" bindtap="moreOrder" >再来一单</view> | |
| 212 | - </block> | |
| 213 | - </view> --> | |
| 209 | + </block> | |
| 210 | + | |
| 211 | + </view> | |
| 214 | 212 | </view> |
| 215 | 213 | |
| 216 | 214 | <warn id="warn"></warn> | ... | ... |
packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.js
| ... | ... | @@ -68,6 +68,7 @@ Page({ |
| 68 | 68 | store_id: app.globalData.setting.stoid, |
| 69 | 69 | team_status: 2, |
| 70 | 70 | goods_id: self.data.options.goods_id, |
| 71 | + pageSize: 20, | |
| 71 | 72 | }); |
| 72 | 73 | |
| 73 | 74 | |
| ... | ... | @@ -104,8 +105,9 @@ Page({ |
| 104 | 105 | onReachBottom: function () { |
| 105 | 106 | this.scrollToLower('/api/weshop/prom/luckyOrder/page', { |
| 106 | 107 | store_id: app.globalData.setting.stoid, |
| 107 | - team_status: 1, | |
| 108 | + team_status: 2, | |
| 108 | 109 | goods_id: this.data.options.goods_id, |
| 110 | + pageSize: 20, | |
| 109 | 111 | }); |
| 110 | 112 | }, |
| 111 | 113 | ... | ... |
packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.wxss
| ... | ... | @@ -8,11 +8,11 @@ page { |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | .img-container { |
| 11 | - width: 60rpx; | |
| 12 | - height: 60rpx; | |
| 11 | + width: 80rpx; | |
| 12 | + height: 80rpx; | |
| 13 | 13 | border-radius: 50%; |
| 14 | 14 | overflow: hidden; |
| 15 | - margin-right: 10rpx; | |
| 15 | + margin-right: 20rpx; | |
| 16 | 16 | flex-shrink: 0; |
| 17 | 17 | } |
| 18 | 18 | |
| ... | ... | @@ -32,7 +32,7 @@ page { |
| 32 | 32 | display: flex; |
| 33 | 33 | align-items: center; |
| 34 | 34 | text-align: center; |
| 35 | - font-size: 26rpx; | |
| 35 | + font-size: 28rpx; | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | .list-hd { | ... | ... |
packageC/pages/payForAnother/payForAnother.wxml
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | <view class="information bdr14 mgt20 fs26"> |
| 22 | 22 | <view class="pd20 bdb">代付订单信息</view> |
| 23 | 23 | <view> |
| 24 | - <view class="use-item bfff bdr_t-14 mgt20"> | |
| 24 | + <view class="use-item bfff bdr_t-14"> | |
| 25 | 25 | <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'></image> |
| 26 | 26 | <view>{{bn_pickname}}门店名称</view> |
| 27 | 27 | </view> | ... | ... |
pages/cart/cart2_pt/cart2_pt.js
| ... | ... | @@ -793,7 +793,7 @@ Page({ |
| 793 | 793 | item=item.config; |
| 794 | 794 | if (item == null) return o_shipping_price; |
| 795 | 795 | //------按重量---------- |
| 796 | - if (goods_weight>0) { | |
| 796 | + if (goods_weight>=0) { | |
| 797 | 797 | fw_price =parseFloat(item['money']); |
| 798 | 798 | if (goods_weight > item['first_weight']){ |
| 799 | 799 | var fw = goods_weight - item['first_weight']; | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.js
| ... | ... | @@ -25,39 +25,55 @@ Page({ |
| 25 | 25 | curpage: 1, //当前分页数 |
| 26 | 26 | pageSize: 10, //页大小 |
| 27 | 27 | total: 0, //总数量 |
| 28 | - ad_data:null, | |
| 28 | + ad_data: null, | |
| 29 | + first_leader: e.globalData.first_leader || 0, // 推荐人ID | |
| 29 | 30 | }, |
| 30 | - onLoad: function(options) { | |
| 31 | - | |
| 31 | + onLoad: function (options) { | |
| 32 | 32 | var th = this; |
| 33 | 33 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 34 | 34 | my_confirm.open_cancel(0); |
| 35 | 35 | th.setData({ |
| 36 | 36 | getStorageID: a.stoid, |
| 37 | 37 | getUserID: d.user_id |
| 38 | + }); | |
| 39 | + //-- 获取分享人的ID -- | |
| 40 | + var first_leader = options.first_leader || getApp().globalData.first_leader; | |
| 41 | + if (first_leader) { | |
| 42 | + this.setData({ | |
| 43 | + first_leader, | |
| 44 | + }) | |
| 45 | + //-- user_id代过来免登录 -- | |
| 46 | + getApp().globalData.first_leader = first_leader; | |
| 47 | + //调用接口判断是不是会员 | |
| 48 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { | |
| 49 | + if (res.data.code == 0) { | |
| 50 | + getApp().globalData.guide_id = res.data.data.id; | |
| 51 | + } | |
| 52 | + }) | |
| 53 | + } | |
| 54 | + | |
| 55 | + getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, { | |
| 56 | + data: { | |
| 57 | + enabled: 1 | |
| 58 | + } | |
| 59 | + }).then(res => { | |
| 60 | + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { | |
| 61 | + var a = res.data.data.pageData; | |
| 62 | + var tt = { | |
| 63 | + 'ad_code': os.imghost + a[0].ad_code, | |
| 64 | + 'media_link': '', | |
| 65 | + 'ad_weapplink': a[0].ad_weapplink, | |
| 66 | + 'bgcolor': a[0].bgcolor, | |
| 67 | + }; | |
| 68 | + th.setData({ | |
| 69 | + ad_data: tt | |
| 70 | + }); | |
| 71 | + } | |
| 38 | 72 | }) |
| 39 | - | |
| 40 | - | |
| 41 | - getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, { | |
| 42 | - data: { | |
| 43 | - enabled: 1 | |
| 44 | - } | |
| 45 | - }).then(res => { | |
| 46 | - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ | |
| 47 | - var a = res.data.data.pageData; | |
| 48 | - var tt = { | |
| 49 | - 'ad_code': os.imghost + a[0].ad_code, | |
| 50 | - 'media_link': '', | |
| 51 | - 'ad_weapplink':a[0].ad_weapplink, | |
| 52 | - 'bgcolor':a[0].bgcolor, | |
| 53 | - }; | |
| 54 | - th.setData({ad_data:tt}); | |
| 55 | - } | |
| 56 | - }) | |
| 57 | - | |
| 73 | + | |
| 58 | 74 | |
| 59 | 75 | }, |
| 60 | - onShow: function() { | |
| 76 | + onShow: function () { | |
| 61 | 77 | //--先判断会员状态-- |
| 62 | 78 | var user_info = getApp().globalData.userInfo; |
| 63 | 79 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| ... | ... | @@ -68,7 +84,8 @@ Page({ |
| 68 | 84 | |
| 69 | 85 | }, |
| 70 | 86 | |
| 71 | - GetBuyPrice: function(e) { | |
| 87 | + //购买礼包 | |
| 88 | + GetBuyPrice: function (e) { | |
| 72 | 89 | var that = this.data; |
| 73 | 90 | var th = this; |
| 74 | 91 | var id = e.currentTarget.dataset.id; //活动id |
| ... | ... | @@ -79,10 +96,10 @@ Page({ |
| 79 | 96 | "是否确定购买该礼包", |
| 80 | 97 | "取消", |
| 81 | 98 | "确定", |
| 82 | - function() { | |
| 99 | + function () { | |
| 83 | 100 | my_confirm.open_cancel(0); |
| 84 | 101 | }, |
| 85 | - function() { | |
| 102 | + function () { | |
| 86 | 103 | my_confirm.open_cancel(0); |
| 87 | 104 | var json = { |
| 88 | 105 | "actId": '', //活动Id |
| ... | ... | @@ -91,25 +108,23 @@ Page({ |
| 91 | 108 | "giftBagId": id, //礼包Id |
| 92 | 109 | "storeId": that.getStorageID, //商家Id |
| 93 | 110 | "userId": that.getUserID, //用户ID |
| 94 | - "buyFrom": 2 | |
| 111 | + "buyFrom": 2, | |
| 112 | + "first_leader": that.first_leader, | |
| 95 | 113 | }; |
| 96 | - | |
| 97 | - //-- 分享导购要记录 -- | |
| 98 | - if(getApp().globalData.guide_id){ | |
| 99 | - json.guide_id=getApp().globalData.guide_id; | |
| 100 | - } | |
| 101 | - | |
| 102 | - | |
| 114 | + | |
| 115 | + //-- 分享导购要记录 -- | |
| 116 | + if (getApp().globalData.guide_id) { | |
| 117 | + json.guide_id = getApp().globalData.guide_id; | |
| 118 | + } | |
| 119 | + | |
| 103 | 120 | var data = JSON.stringify(json); |
| 104 | 121 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
| 105 | 122 | getApp().request.json_post(url, json, |
| 106 | - function(res) { | |
| 123 | + function (res) { | |
| 107 | 124 | if (res.data.code == 0 && res.data.data) { |
| 108 | - | |
| 109 | - var order_sn = res.data.data.orderSn; | |
| 110 | - res = res.data.data.result; | |
| 111 | - if(!res) return false; | |
| 112 | - | |
| 125 | + var order_sn = res.data.data.orderSn; | |
| 126 | + res = res.data.data.result; | |
| 127 | + if (!res) return false; | |
| 113 | 128 | var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; |
| 114 | 129 | wx.requestPayment({ |
| 115 | 130 | timeStamp: String(res.timeStamp), |
| ... | ... | @@ -117,10 +132,10 @@ Page({ |
| 117 | 132 | package: res.packageValue, |
| 118 | 133 | signType: res.signType, |
| 119 | 134 | paySign: res.paySign, |
| 120 | - success: function(res) { | |
| 135 | + success: function (res) { | |
| 121 | 136 | getApp().goto(url); |
| 122 | 137 | }, |
| 123 | - fail: function(res) { | |
| 138 | + fail: function (res) { | |
| 124 | 139 | getApp().my_warnning("取消支付", 0, th); |
| 125 | 140 | } |
| 126 | 141 | }); |
| ... | ... | @@ -128,7 +143,7 @@ Page({ |
| 128 | 143 | getApp().my_warnning(res.data.msg, 0, th); |
| 129 | 144 | } |
| 130 | 145 | }, |
| 131 | - function(res) { | |
| 146 | + function (res) { | |
| 132 | 147 | |
| 133 | 148 | } |
| 134 | 149 | |
| ... | ... | @@ -141,19 +156,21 @@ Page({ |
| 141 | 156 | |
| 142 | 157 | |
| 143 | 158 | }, |
| 144 | - GetBuyIntegral: function(e) { | |
| 159 | + // 积分兑换 | |
| 160 | + GetBuyIntegral: function (e) { | |
| 145 | 161 | var that = this.data; |
| 146 | 162 | var th = this; |
| 147 | 163 | var id = e.currentTarget.dataset.id; //活动id |
| 148 | 164 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 165 | + | |
| 149 | 166 | my_confirm.open( |
| 150 | 167 | "是否确定兑换该礼包", |
| 151 | 168 | "取消", |
| 152 | 169 | "确定", |
| 153 | - function() { | |
| 170 | + function () { | |
| 154 | 171 | my_confirm.open_cancel(0); |
| 155 | 172 | }, |
| 156 | - function() { | |
| 173 | + function () { | |
| 157 | 174 | my_confirm.open_cancel(0); |
| 158 | 175 | var json = { |
| 159 | 176 | "actId": '', //活动Id |
| ... | ... | @@ -162,72 +179,74 @@ Page({ |
| 162 | 179 | "giftBagId": id, //礼包Id |
| 163 | 180 | "storeId": that.getStorageID, //商家Id |
| 164 | 181 | "userId": that.getUserID, //用户ID |
| 165 | - "buyFrom": 2 | |
| 182 | + "buyFrom": 2, | |
| 183 | + "first_leader": that.first_leader | |
| 166 | 184 | }; |
| 167 | - | |
| 168 | - //-- 分享导购要记录 -- | |
| 169 | - if(getApp().globalData.guide_id){ | |
| 170 | - json.guide_id=getApp().globalData.guide_id; | |
| 171 | - } | |
| 172 | 185 | |
| 186 | + //-- 分享导购要记录 -- | |
| 187 | + if (getApp().globalData.guide_id) { | |
| 188 | + json.guide_id = getApp().globalData.guide_id; | |
| 189 | + } | |
| 190 | + console.log(json,'json'); | |
| 173 | 191 | var data = JSON.stringify(json); |
| 174 | 192 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
| 175 | 193 | getApp().request.json_post(url, json, |
| 176 | - function(res) { | |
| 194 | + function (res) { | |
| 177 | 195 | if (res.data.code == 0) { |
| 178 | 196 | getApp().my_warnning("兑换成功!", 1, th); |
| 179 | 197 | } else { |
| 180 | 198 | getApp().my_warnning(res.data.msg, 0, th); |
| 181 | 199 | } |
| 182 | 200 | }, |
| 183 | - function(res) {}) | |
| 201 | + function (res) {}) | |
| 184 | 202 | |
| 185 | 203 | }) |
| 186 | 204 | |
| 187 | 205 | }, |
| 188 | 206 | //免费领取 |
| 189 | - GetFree:function (e){ | |
| 207 | + GetFree: function (e) { | |
| 190 | 208 | var that = this.data; |
| 191 | 209 | var th = this; |
| 192 | 210 | var id = e.currentTarget.dataset.id; //活动id |
| 193 | 211 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 194 | 212 | my_confirm.open( |
| 195 | - "是否确定领取该礼包", | |
| 196 | - "取消", | |
| 197 | - "确定", | |
| 198 | - function() { | |
| 199 | - my_confirm.open_cancel(0); | |
| 200 | - }, | |
| 201 | - function() { | |
| 202 | - my_confirm.open_cancel(0); | |
| 203 | - var json = { | |
| 204 | - "actId": '', //活动Id | |
| 205 | - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 206 | - "buyType": '3', //1=积分兑换 2=余额购买 3=免费领取 | |
| 207 | - "giftBagId": id, //礼包Id | |
| 208 | - "storeId": that.getStorageID, //商家Id | |
| 209 | - "userId": that.getUserID, //用户ID | |
| 210 | - "buyFrom": 2 | |
| 211 | - }; | |
| 212 | - //-- 分享导购要记录 -- | |
| 213 | - if(getApp().globalData.guide_id){ | |
| 214 | - json.guide_id=getApp().globalData.guide_id; | |
| 215 | - } | |
| 216 | - var data = JSON.stringify(json); | |
| 217 | - var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | |
| 218 | - getApp().request.json_post(url, json, | |
| 219 | - function(res) { | |
| 220 | - if (res.data.code == 0) { | |
| 221 | - getApp().my_warnning("领取成功!", 1, th); | |
| 222 | - } else { | |
| 223 | - getApp().my_warnning(res.data.msg, 0, th); | |
| 224 | - } | |
| 225 | - }, | |
| 226 | - function(res) {}) | |
| 227 | - }) | |
| 213 | + "是否确定领取该礼包", | |
| 214 | + "取消", | |
| 215 | + "确定", | |
| 216 | + function () { | |
| 217 | + my_confirm.open_cancel(0); | |
| 218 | + }, | |
| 219 | + function () { | |
| 220 | + my_confirm.open_cancel(0); | |
| 221 | + var json = { | |
| 222 | + "actId": '', //活动Id | |
| 223 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 224 | + "buyType": '3', //1=积分兑换 2=余额购买 3=免费领取 | |
| 225 | + "giftBagId": id, //礼包Id | |
| 226 | + "storeId": that.getStorageID, //商家Id | |
| 227 | + "userId": that.getUserID, //用户ID | |
| 228 | + "buyFrom": 2, | |
| 229 | + "first_leader": that.first_leader | |
| 230 | + }; | |
| 231 | + //-- 分享导购要记录 -- | |
| 232 | + if (getApp().globalData.guide_id) { | |
| 233 | + json.guide_id = getApp().globalData.guide_id; | |
| 234 | + } | |
| 235 | + var data = JSON.stringify(json); | |
| 236 | + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | |
| 237 | + getApp().request.json_post(url, json, | |
| 238 | + function (res) { | |
| 239 | + if (res.data.code == 0) { | |
| 240 | + getApp().my_warnning("领取成功!", 1, th); | |
| 241 | + } else { | |
| 242 | + getApp().my_warnning(res.data.msg, 0, th); | |
| 243 | + } | |
| 244 | + }, | |
| 245 | + function (res) {}) | |
| 246 | + }) | |
| 228 | 247 | }, |
| 229 | 248 | |
| 230 | - getList: function(e) { | |
| 249 | + getList: function (e) { | |
| 231 | 250 | var th = this; |
| 232 | 251 | getApp().request.get('/api/weshop/marketing/giftbag/page', { |
| 233 | 252 | isShowLoading: true, |
| ... | ... | @@ -237,7 +256,7 @@ Page({ |
| 237 | 256 | page: th.data.curpage, |
| 238 | 257 | pageSize: th.data.pageSize |
| 239 | 258 | }, |
| 240 | - success: function(res) { | |
| 259 | + success: function (res) { | |
| 241 | 260 | if (res.data.code == 0) { |
| 242 | 261 | th.data.curpage++; |
| 243 | 262 | var arr1 = th.data.wareCard; |
| ... | ... | @@ -254,7 +273,7 @@ Page({ |
| 254 | 273 | } else { |
| 255 | 274 | th.setData({ |
| 256 | 275 | is_read: 1, |
| 257 | - ismore:1 | |
| 276 | + ismore: 1 | |
| 258 | 277 | }) |
| 259 | 278 | } |
| 260 | 279 | } |
| ... | ... | @@ -262,7 +281,7 @@ Page({ |
| 262 | 281 | |
| 263 | 282 | }, |
| 264 | 283 | //销毁界面跳转 |
| 265 | - redirectTo: function(e) { | |
| 284 | + redirectTo: function (e) { | |
| 266 | 285 | var th = this; |
| 267 | 286 | var url = e.currentTarget.dataset.url; |
| 268 | 287 | //销毁跳转 |
| ... | ... | @@ -271,14 +290,14 @@ Page({ |
| 271 | 290 | }); |
| 272 | 291 | }, |
| 273 | 292 | //不销毁界面跳转 |
| 274 | - navigateTo: function(e) { | |
| 293 | + navigateTo: function (e) { | |
| 275 | 294 | var th = this; |
| 276 | 295 | var url = e.currentTarget.dataset.url; |
| 277 | 296 | getApp().goto(url); |
| 278 | 297 | |
| 279 | 298 | }, |
| 280 | 299 | //下拉事件 |
| 281 | - onReachBottom: function() { | |
| 300 | + onReachBottom: function () { | |
| 282 | 301 | var th = this; |
| 283 | 302 | if (th.data.total <= th.data.pageSize) return; |
| 284 | 303 | if (th.data.ismore) return; |
| ... | ... | @@ -286,41 +305,44 @@ Page({ |
| 286 | 305 | th.getList(); |
| 287 | 306 | }, |
| 288 | 307 | //图片失败,默认图片 |
| 289 | - bind_bnerr2: function(e) { | |
| 308 | + bind_bnerr2: function (e) { | |
| 290 | 309 | var _errImg = e.target.dataset.errorimg; |
| 291 | 310 | var _errObj = {}; |
| 292 | 311 | _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; |
| 293 | 312 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
| 294 | 313 | }, |
| 295 | - goto: function(e) { | |
| 314 | + goto: function (e) { | |
| 296 | 315 | var th = this; |
| 297 | 316 | var url = e.currentTarget.dataset.url; |
| 298 | 317 | getApp().goto(url); |
| 299 | 318 | }, |
| 300 | - | |
| 301 | - onShareAppMessage: function (e) { | |
| 302 | - var curPage=this; | |
| 303 | - var pagePath = curPage.route; //当前页面url | |
| 304 | - if (pagePath.indexOf('/') != 0) { | |
| 305 | - pagePath = '/' + pagePath; | |
| 306 | - } | |
| 307 | - return { | |
| 308 | - title: "专享礼包", | |
| 309 | - path:pagePath, | |
| 310 | - } | |
| 311 | - }, | |
| 312 | - | |
| 313 | - onShareTimeline() { | |
| 314 | - var curPage=this; | |
| 315 | - var pagePath = curPage.route; //当前页面url | |
| 316 | - if (pagePath.indexOf('/') != 0) { | |
| 317 | - pagePath = '/' + pagePath; | |
| 318 | - } | |
| 319 | - return { | |
| 320 | - title: '专享礼包', | |
| 321 | - imageUrl: this.data.ad_data.ad_code, | |
| 322 | - path: pagePath, | |
| 323 | - } | |
| 324 | - }, | |
| 325 | - | |
| 319 | + | |
| 320 | + onShareAppMessage: function (e) { | |
| 321 | + var curPage = this; | |
| 322 | + var pagePath = curPage.route; //当前页面url | |
| 323 | + if (pagePath.indexOf('/') != 0) { | |
| 324 | + pagePath = '/' + pagePath; | |
| 325 | + } | |
| 326 | + pagePath += "?first_leader="+this.data.getUserID; | |
| 327 | + return { | |
| 328 | + title: "专享礼包", | |
| 329 | + path: pagePath, | |
| 330 | + } | |
| 331 | + }, | |
| 332 | + | |
| 333 | + // 分享朋友圈 | |
| 334 | + onShareTimeline() { | |
| 335 | + var curPage = this; | |
| 336 | + var pagePath = curPage.route; //当前页面url | |
| 337 | + if (pagePath.indexOf('/') != 0) { | |
| 338 | + pagePath = '/' + pagePath; | |
| 339 | + } | |
| 340 | + pagePath += "?first_leader="+this.data.getUserID; | |
| 341 | + return { | |
| 342 | + title: '专享礼包', | |
| 343 | + imageUrl: this.data.ad_data.ad_code, | |
| 344 | + path: pagePath, | |
| 345 | + } | |
| 346 | + }, | |
| 347 | + | |
| 326 | 348 | }) |
| 327 | 349 | \ No newline at end of file | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.js
| ... | ... | @@ -28,33 +28,36 @@ Page({ |
| 28 | 28 | code: "", //核销码 |
| 29 | 29 | c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期 |
| 30 | 30 | is_lb: 0, //是否有礼包 |
| 31 | - default_color:null, | |
| 31 | + default_color: null, | |
| 32 | + first_leader: e.globalData.first_leader || 0, // 推荐人ID | |
| 32 | 33 | }, |
| 33 | - onLoad: function(options) { | |
| 34 | + onLoad: function (options) { | |
| 34 | 35 | var th = this; |
| 35 | 36 | th.setData({ |
| 36 | 37 | isBuy: options.isBuy, |
| 37 | 38 | getGiftID: options.lbId, |
| 38 | - orderSn: options.orderSn | |
| 39 | + orderSn: options.orderSn, | |
| 40 | + getUserID: d.user_id, | |
| 39 | 41 | }) |
| 40 | - | |
| 41 | - //-- 获取分享人的ID -- | |
| 42 | - var first_leader=options.first_leader; | |
| 43 | - if(first_leader){ | |
| 44 | - //-- user_id代过来免登录 -- | |
| 45 | - getApp().globalData.first_leader=first_leader; | |
| 46 | - //调用接口判断是不是会员 | |
| 47 | - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ | |
| 48 | - if(res.data.code==0){ | |
| 49 | - getApp().globalData.guide_id=res.data.data.id; | |
| 50 | - } | |
| 51 | - }) | |
| 52 | - } | |
| 53 | - | |
| 42 | + //-- 获取分享人的ID -- | |
| 43 | + var first_leader = options.first_leader || getApp().globalData.first_leader; | |
| 44 | + if (first_leader) { | |
| 45 | + this.setData({ | |
| 46 | + first_leader, | |
| 47 | + }) | |
| 48 | + //-- user_id代过来免登录 -- | |
| 49 | + getApp().globalData.first_leader = first_leader; | |
| 50 | + //调用接口判断是不是会员 | |
| 51 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { | |
| 52 | + if (res.data.code == 0) { | |
| 53 | + getApp().globalData.guide_id = res.data.data.id; | |
| 54 | + } | |
| 55 | + }) | |
| 56 | + } | |
| 54 | 57 | th.close(); |
| 55 | 58 | }, |
| 56 | - | |
| 57 | - onShow: function() { | |
| 59 | + | |
| 60 | + onShow: function () { | |
| 58 | 61 | //--先判断会员状态-- |
| 59 | 62 | var user_info = getApp().globalData.userInfo; |
| 60 | 63 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| ... | ... | @@ -68,14 +71,14 @@ Page({ |
| 68 | 71 | } |
| 69 | 72 | |
| 70 | 73 | }, |
| 71 | - GetBuyPrice: function(e) { | |
| 74 | + GetBuyPrice: function (e) { | |
| 72 | 75 | var that = this.data; |
| 73 | 76 | var th = this; |
| 74 | 77 | // var id = e.currentTarget.dataset.id;//活动id |
| 75 | 78 | //如果还没有开始的话 |
| 76 | - if(th.data.isStart!=1){ | |
| 77 | - getApp().my_warnning("活动还没有开始", 0, th); | |
| 78 | - return false; | |
| 79 | + if (th.data.isStart != 1) { | |
| 80 | + getApp().my_warnning("活动还没有开始", 0, th); | |
| 81 | + return false; | |
| 79 | 82 | } |
| 80 | 83 | |
| 81 | 84 | |
| ... | ... | @@ -85,10 +88,10 @@ Page({ |
| 85 | 88 | "是否确定购买该礼包", |
| 86 | 89 | "取消", |
| 87 | 90 | "确定", |
| 88 | - function() { | |
| 91 | + function () { | |
| 89 | 92 | my_confirm.open_cancel(0); |
| 90 | 93 | }, |
| 91 | - function() { | |
| 94 | + function () { | |
| 92 | 95 | my_confirm.open_cancel(0); |
| 93 | 96 | |
| 94 | 97 | var json = { |
| ... | ... | @@ -98,24 +101,25 @@ Page({ |
| 98 | 101 | "giftBagId": that.getGiftID, //礼包Id |
| 99 | 102 | "storeId": a.stoid, //商家Id |
| 100 | 103 | "userId": d.user_id, //用户ID |
| 101 | - "buyFrom": 2 | |
| 104 | + "buyFrom": 2, | |
| 105 | + "first_leader": that.first_leader, | |
| 102 | 106 | }; |
| 103 | - | |
| 104 | - //-- 分享导购要记录 -- | |
| 105 | - if(getApp().globalData.guide_id){ | |
| 106 | - json.guide_id=getApp().globalData.guide_id; | |
| 107 | - } | |
| 108 | - | |
| 107 | + | |
| 108 | + //-- 分享导购要记录 -- | |
| 109 | + if (getApp().globalData.guide_id) { | |
| 110 | + json.guide_id = getApp().globalData.guide_id; | |
| 111 | + } | |
| 112 | + | |
| 109 | 113 | var data = JSON.stringify(json); |
| 110 | 114 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
| 111 | 115 | |
| 112 | 116 | getApp().request.json_post(url, json, |
| 113 | - function(res) { | |
| 117 | + function (res) { | |
| 114 | 118 | if (res.data.code == 0) { |
| 115 | 119 | var res = res.data.data; |
| 116 | - if(!res) return false; | |
| 117 | - if(!res.result) return false; | |
| 118 | - | |
| 120 | + if (!res) return false; | |
| 121 | + if (!res.result) return false; | |
| 122 | + | |
| 119 | 123 | var order_sn = res.orderSn; |
| 120 | 124 | var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; |
| 121 | 125 | wx.requestPayment({ |
| ... | ... | @@ -124,10 +128,10 @@ Page({ |
| 124 | 128 | package: res.result.packageValue, |
| 125 | 129 | signType: res.result.signType, |
| 126 | 130 | paySign: res.result.paySign, |
| 127 | - success: function(n) { | |
| 131 | + success: function (n) { | |
| 128 | 132 | getApp().goto(url); |
| 129 | 133 | }, |
| 130 | - fail: function(n) { | |
| 134 | + fail: function (n) { | |
| 131 | 135 | getApp().my_warnning("取消支付", 0, th); |
| 132 | 136 | } |
| 133 | 137 | }); |
| ... | ... | @@ -135,7 +139,7 @@ Page({ |
| 135 | 139 | getApp().my_warnning(res.data.msg, 0, th); |
| 136 | 140 | } |
| 137 | 141 | }, |
| 138 | - function(res) { | |
| 142 | + function (res) { | |
| 139 | 143 | |
| 140 | 144 | } |
| 141 | 145 | |
| ... | ... | @@ -147,12 +151,12 @@ Page({ |
| 147 | 151 | ) |
| 148 | 152 | |
| 149 | 153 | }, |
| 150 | - GetBuyIntegral: function(e) { | |
| 154 | + GetBuyIntegral: function (e) { | |
| 151 | 155 | var that = this.data; |
| 152 | 156 | var th = this; |
| 153 | 157 | |
| 154 | 158 | //如果还没有开始的话 |
| 155 | - if(th.data.isStart!=1){ | |
| 159 | + if (th.data.isStart != 1) { | |
| 156 | 160 | getApp().my_warnning("活动还没有开始", 0, th); |
| 157 | 161 | return false; |
| 158 | 162 | } |
| ... | ... | @@ -162,10 +166,10 @@ Page({ |
| 162 | 166 | "是否确定兑换该礼包", |
| 163 | 167 | "取消", |
| 164 | 168 | "确定", |
| 165 | - function() { | |
| 169 | + function () { | |
| 166 | 170 | my_confirm.open_cancel(0); |
| 167 | 171 | }, |
| 168 | - function() { | |
| 172 | + function () { | |
| 169 | 173 | my_confirm.open_cancel(0); |
| 170 | 174 | var json = { |
| 171 | 175 | "actId": '', //活动Id |
| ... | ... | @@ -174,26 +178,25 @@ Page({ |
| 174 | 178 | "giftBagId": that.getGiftID, //礼包Id |
| 175 | 179 | "storeId": a.stoid, //商家ID |
| 176 | 180 | "userId": d.user_id, //用户ID |
| 177 | - "buyFrom":2 | |
| 181 | + "buyFrom": 2, | |
| 182 | + "first_leader": that.first_leader, | |
| 178 | 183 | }; |
| 179 | - | |
| 180 | - //-- 分享导购要记录 -- | |
| 181 | - if(getApp().globalData.guide_id){ | |
| 182 | - json.guide_id=getApp().globalData.guide_id; | |
| 183 | - } | |
| 184 | - | |
| 185 | - | |
| 184 | + //-- 分享导购要记录 -- | |
| 185 | + if (getApp().globalData.guide_id) { | |
| 186 | + json.guide_id = getApp().globalData.guide_id; | |
| 187 | + } | |
| 188 | + | |
| 186 | 189 | var data = JSON.stringify(json); |
| 187 | 190 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
| 188 | 191 | getApp().request.json_post(url, json, |
| 189 | - function(res) { | |
| 192 | + function (res) { | |
| 190 | 193 | if (res.data.code == 0) { |
| 191 | 194 | getApp().my_warnning("兑换成功!", 1, th); |
| 192 | 195 | } else { |
| 193 | 196 | getApp().my_warnning(res.data.msg, 0, th); |
| 194 | 197 | } |
| 195 | 198 | }, |
| 196 | - function(res) { | |
| 199 | + function (res) { | |
| 197 | 200 | |
| 198 | 201 | } |
| 199 | 202 | |
| ... | ... | @@ -203,7 +206,7 @@ Page({ |
| 203 | 206 | |
| 204 | 207 | }, |
| 205 | 208 | |
| 206 | - GetMyGiftList: function() { | |
| 209 | + GetMyGiftList: function () { | |
| 207 | 210 | var _this = this; |
| 208 | 211 | var th = this; |
| 209 | 212 | getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { |
| ... | ... | @@ -213,12 +216,12 @@ Page({ |
| 213 | 216 | "userId": d.user_id, //用户ID |
| 214 | 217 | "orderSn": th.data.orderSn |
| 215 | 218 | }, |
| 216 | - success: function(res) { | |
| 219 | + success: function (res) { | |
| 217 | 220 | if (res.data.code == 0) { |
| 218 | 221 | th.setData({ |
| 219 | 222 | giftImage: th.data.iurl + res.data.data.lbUrl, |
| 220 | 223 | giftTitle: res.data.data.giftTitle, |
| 221 | - default_color:res.data.data.bgcolor | |
| 224 | + default_color: res.data.data.bgcolor | |
| 222 | 225 | }) |
| 223 | 226 | if (res.data.data.giftRemark == '') { |
| 224 | 227 | th.setData({ |
| ... | ... | @@ -272,7 +275,7 @@ Page({ |
| 272 | 275 | }); |
| 273 | 276 | |
| 274 | 277 | }, |
| 275 | - GetBuyGiftList: function() { | |
| 278 | + GetBuyGiftList: function () { | |
| 276 | 279 | var _this2 = this; |
| 277 | 280 | var th = this.data; |
| 278 | 281 | getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { |
| ... | ... | @@ -287,7 +290,7 @@ Page({ |
| 287 | 290 | _this2.setData({ |
| 288 | 291 | giftImage: th.iurl + res.data.data.lbUrl, |
| 289 | 292 | giftTitle: res.data.data.giftTitle, |
| 290 | - default_color:res.data.data.bgcolor | |
| 293 | + default_color: res.data.data.bgcolor | |
| 291 | 294 | }) |
| 292 | 295 | if (res.data.data.giftRemark == '') { |
| 293 | 296 | _this2.setData({ |
| ... | ... | @@ -299,13 +302,13 @@ Page({ |
| 299 | 302 | }) |
| 300 | 303 | } |
| 301 | 304 | |
| 302 | - var isStart=0; | |
| 303 | - var now=ut.gettimestamp(); | |
| 305 | + var isStart = 0; | |
| 306 | + var now = ut.gettimestamp(); | |
| 304 | 307 | |
| 305 | - var str = res.data.data.starTime.replace(/-/g,'/'); | |
| 308 | + var str = res.data.data.starTime.replace(/-/g, '/'); | |
| 306 | 309 | var start = Date.parse(new Date(str)); |
| 307 | 310 | start = start / 1000; |
| 308 | - if(start<now) isStart=1; | |
| 311 | + if (start < now) isStart = 1; | |
| 309 | 312 | |
| 310 | 313 | _this2.setData({ |
| 311 | 314 | giftDate: res.data.data.endTime, |
| ... | ... | @@ -317,7 +320,7 @@ Page({ |
| 317 | 320 | giftType: res.data.data.actType, |
| 318 | 321 | actTitle: res.data.data.actTitle, |
| 319 | 322 | wareCard: res.data.data.wareCard, |
| 320 | - isStart:isStart, | |
| 323 | + isStart: isStart, | |
| 321 | 324 | }) |
| 322 | 325 | } else { |
| 323 | 326 | getApp().my_warnning(res.data.msg, 0, _this2); |
| ... | ... | @@ -328,7 +331,7 @@ Page({ |
| 328 | 331 | |
| 329 | 332 | }, |
| 330 | 333 | //显示核销码 |
| 331 | - code_show: function(e) { | |
| 334 | + code_show: function (e) { | |
| 332 | 335 | var th = this; |
| 333 | 336 | //--获取成功的时候-- |
| 334 | 337 | var no = th.data.code; |
| ... | ... | @@ -340,17 +343,21 @@ Page({ |
| 340 | 343 | qc_com.open(obj) |
| 341 | 344 | }, |
| 342 | 345 | //获取核销码 |
| 343 | - getcode: function() { | |
| 346 | + getcode: function (e) { | |
| 344 | 347 | var th = this; |
| 345 | 348 | var orderSn = th.data.orderSn; //订单号 |
| 349 | + let codeId = e.currentTarget.dataset.codeid; | |
| 346 | 350 | var json = { |
| 347 | 351 | "storeId": a.stoid, |
| 348 | - "orderSn": orderSn | |
| 349 | - }; | |
| 352 | + "orderSn": orderSn, | |
| 353 | + } | |
| 354 | + if (codeId && codeId !== "") { | |
| 355 | + json.id = codeId | |
| 356 | + } | |
| 350 | 357 | var data = JSON.stringify(json); |
| 351 | 358 | var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址 |
| 352 | 359 | getApp().request.json_post(url, json, |
| 353 | - function(res) { | |
| 360 | + function (res) { | |
| 354 | 361 | if (res.data.code == 0) { |
| 355 | 362 | th.setData({ |
| 356 | 363 | code: res.data.data |
| ... | ... | @@ -360,7 +367,7 @@ Page({ |
| 360 | 367 | getApp().my_warnning(res.data.msg, 0, th); |
| 361 | 368 | } |
| 362 | 369 | }, |
| 363 | - function(res) { | |
| 370 | + function (res) { | |
| 364 | 371 | |
| 365 | 372 | }, |
| 366 | 373 | "put" |
| ... | ... | @@ -368,13 +375,13 @@ Page({ |
| 368 | 375 | |
| 369 | 376 | }, |
| 370 | 377 | //界面跳转 |
| 371 | - goto: function(e) { | |
| 378 | + goto: function (e) { | |
| 372 | 379 | var th = this; |
| 373 | 380 | var url = e.currentTarget.dataset.url; |
| 374 | 381 | getApp().goto(url); |
| 375 | 382 | }, |
| 376 | 383 | //图片失败,默认图片 |
| 377 | - bind_bnerr2: function(e) { | |
| 384 | + bind_bnerr2: function (e) { | |
| 378 | 385 | var _errImg = e.target.dataset.errorimg; |
| 379 | 386 | var _errObj = {}; |
| 380 | 387 | _errObj[_errImg] = "/miniapp/images/giftbag/gift01.png"; |
| ... | ... | @@ -392,7 +399,7 @@ Page({ |
| 392 | 399 | }, |
| 393 | 400 | |
| 394 | 401 | //关闭导航 |
| 395 | - close: function() { | |
| 402 | + close: function () { | |
| 396 | 403 | var th = this; |
| 397 | 404 | var nav_b = th.selectComponent("#nav_b"); //组件的id |
| 398 | 405 | nav_b.close_box(); |
| ... | ... | @@ -401,76 +408,95 @@ Page({ |
| 401 | 408 | |
| 402 | 409 | //--- 分享设置 -- |
| 403 | 410 | onShareAppMessage: function (e) { |
| 404 | - var curPage=this; | |
| 411 | + var curPage = this; | |
| 405 | 412 | var pagePath = curPage.route; //当前页面url |
| 406 | 413 | if (pagePath.indexOf('/') != 0) { |
| 407 | 414 | pagePath = '/' + pagePath; |
| 408 | 415 | } |
| 409 | - | |
| 410 | - pagePath+="?isBuy="+this.data.isBuy; | |
| 411 | - if(this.data.isBuy==0){ | |
| 412 | - pagePath+="&orderSn="+this.data.orderSn; | |
| 413 | - }else{ | |
| 414 | - pagePath+="&lbId="+this.data.getGiftID; | |
| 416 | + pagePath += "?isBuy=1" + "&lbId=" + this.data.lbId + "&first_leader="+ this.data.getUserID; | |
| 417 | + // if (this.data.isBuy == 0) { | |
| 418 | + // pagePath += "&orderSn=" + this.data.orderSn; | |
| 419 | + // } else { | |
| 420 | + // pagePath += "&lbId=" + this.data.getGiftID; | |
| 421 | + // } | |
| 422 | + return { | |
| 423 | + title: "礼包详情", | |
| 424 | + path: pagePath, | |
| 415 | 425 | } |
| 426 | + }, | |
| 416 | 427 | |
| 428 | + /** | |
| 429 | + * 用户分享朋友圈 | |
| 430 | + */ | |
| 431 | + onShareTimeline() { | |
| 432 | + var curPage = this; | |
| 433 | + var pagePath = curPage.route; //当前页面url | |
| 434 | + if (pagePath.indexOf('/') != 0) { | |
| 435 | + pagePath = '/' + pagePath; | |
| 436 | + } | |
| 437 | + pagePath += "?isBuy=1" + "&lbId=" + this.data.lbId + "&first_leader="+ this.data.getUserID; | |
| 438 | + // if (this.data.isBuy == 0) { | |
| 439 | + // pagePath += "&orderSn=" + this.data.orderSn; | |
| 440 | + // } else { | |
| 441 | + // pagePath += "&lbId=" + this.data.getGiftID; | |
| 442 | + // } | |
| 417 | 443 | return { |
| 418 | 444 | title: "礼包详情", |
| 419 | - path:pagePath, | |
| 445 | + path: pagePath, | |
| 420 | 446 | } |
| 421 | 447 | }, |
| 422 | 448 | |
| 423 | 449 | //免费领取 |
| 424 | - GetFree: function(e) { | |
| 450 | + GetFree: function (e) { | |
| 425 | 451 | var that = this.data; |
| 426 | 452 | var th = this; |
| 427 | 453 | |
| 428 | 454 | //如果还没有开始的话 |
| 429 | - if(th.data.isStart!=1){ | |
| 455 | + if (th.data.isStart != 1) { | |
| 430 | 456 | getApp().my_warnning("活动还没有开始", 0, th); |
| 431 | 457 | return false; |
| 432 | 458 | } |
| 433 | 459 | // var id = e.currentTarget.dataset.id;//活动id |
| 434 | 460 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 435 | 461 | my_confirm.open( |
| 436 | - "是否确定领取该礼包", | |
| 437 | - "取消", | |
| 438 | - "确定", | |
| 439 | - function() { | |
| 440 | - my_confirm.open_cancel(0); | |
| 441 | - }, | |
| 442 | - function() { | |
| 443 | - my_confirm.open_cancel(0); | |
| 444 | - var json = { | |
| 445 | - "actId": '', //活动Id | |
| 446 | - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 447 | - "buyType": '3', //1=积分兑换 2=余额购买 | |
| 448 | - "giftBagId": that.getGiftID, //礼包Id | |
| 449 | - "storeId": a.stoid, //商家ID | |
| 450 | - "userId": d.user_id, //用户ID | |
| 451 | - "buyFrom":2 | |
| 452 | - }; | |
| 453 | - | |
| 454 | - //-- 分享导购要记录 -- | |
| 455 | - if(getApp().globalData.guide_id){ | |
| 456 | - json.guide_id=getApp().globalData.guide_id; | |
| 457 | - } | |
| 462 | + "是否确定领取该礼包", | |
| 463 | + "取消", | |
| 464 | + "确定", | |
| 465 | + function () { | |
| 466 | + my_confirm.open_cancel(0); | |
| 467 | + }, | |
| 468 | + function () { | |
| 469 | + my_confirm.open_cancel(0); | |
| 470 | + var json = { | |
| 471 | + "actId": '', //活动Id | |
| 472 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 473 | + "buyType": '3', //1=积分兑换 2=余额购买 | |
| 474 | + "giftBagId": that.getGiftID, //礼包Id | |
| 475 | + "storeId": a.stoid, //商家ID | |
| 476 | + "userId": d.user_id, //用户ID | |
| 477 | + "buyFrom": 2, | |
| 478 | + "first_leader": that.first_leader, | |
| 479 | + }; | |
| 458 | 480 | |
| 481 | + //-- 分享导购要记录 -- | |
| 482 | + if (getApp().globalData.guide_id) { | |
| 483 | + json.guide_id = getApp().globalData.guide_id; | |
| 484 | + } | |
| 459 | 485 | |
| 460 | - var data = JSON.stringify(json); | |
| 461 | - var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | |
| 462 | - getApp().request.json_post(url, json, | |
| 463 | - function(res) { | |
| 464 | - if (res.data.code == 0) { | |
| 465 | - getApp().my_warnning("领取成功!", 1, th); | |
| 466 | - } else { | |
| 467 | - getApp().my_warnning(res.data.msg, 0, th); | |
| 468 | - } | |
| 469 | - }, | |
| 470 | - function(res) {} | |
| 486 | + var data = JSON.stringify(json); | |
| 487 | + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | |
| 488 | + getApp().request.json_post(url, json, | |
| 489 | + function (res) { | |
| 490 | + if (res.data.code == 0) { | |
| 491 | + getApp().my_warnning("领取成功!", 1, th); | |
| 492 | + } else { | |
| 493 | + getApp().my_warnning(res.data.msg, 0, th); | |
| 494 | + } | |
| 495 | + }, | |
| 496 | + function (res) {} | |
| 471 | 497 | |
| 472 | - ) | |
| 473 | - }) | |
| 498 | + ) | |
| 499 | + }) | |
| 474 | 500 | |
| 475 | 501 | |
| 476 | 502 | }, | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.wxml
| ... | ... | @@ -47,7 +47,7 @@ |
| 47 | 47 | <view class="box_ware_title data-v-3a5b7e36"> |
| 48 | 48 | <text class="data-v-3a5b7e36">礼包内容</text> |
| 49 | 49 | </view> |
| 50 | - <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | |
| 50 | + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="Id"> | |
| 51 | 51 | <view wx:if="{{item.couponName!=undefined}}" class="box_ware_box data-v-3a5b7e36"> |
| 52 | 52 | <view class="box_ware_img data-v-3a5b7e36"> |
| 53 | 53 | <block wx:if="{{item.lbType==1}}"> |
| ... | ... | @@ -73,15 +73,23 @@ |
| 73 | 73 | <view class="box_ware_item_price data-v-3a5b7e36"> |
| 74 | 74 | <text class="data-v-3a5b7e36"></text> |
| 75 | 75 | </view> |
| 76 | - <view class="box_ware_item_qty data-v-3a5b7e36"> | |
| 76 | + <view class="box_ware_item_qty data-v-3a5b7e36 flex"> | |
| 77 | 77 | <text class="data-v-3a5b7e36 ellipsis-1"> |
| 78 | - {{"数量:"+item.num}} | |
| 79 | - </text> | |
| 78 | + {{"数量:"+item.num}} | |
| 79 | + </text> | |
| 80 | + <block wx:if="{{isBuy==0}}"> | |
| 81 | + <text style="margin-left:10rpx" wx:if="{{item.useState}}"> | |
| 82 | + 已核销 | |
| 83 | + </text> | |
| 84 | + <text style="margin-left:10rpx" wx:else> | |
| 85 | + 未核销 | |
| 86 | + </text> | |
| 87 | + </block> | |
| 80 | 88 | </view> |
| 81 | 89 | <view class="box_ware_code data-v-3a5b7e36"> |
| 82 | 90 | <!-- <block wx:if="{{c_state==0}}"> --> |
| 83 | 91 | <block wx:if="{{isBuy==0&item.lbType==1}}"> |
| 84 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" class="data-v-3a5b7e36"></image> | |
| 92 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" data-codeId="{{item.Id}}" class="data-v-3a5b7e36"></image> | |
| 85 | 93 | </block> |
| 86 | 94 | <!-- </block> --> |
| 87 | 95 | <!-- | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.js
| ... | ... | @@ -25,18 +25,34 @@ Page({ |
| 25 | 25 | curpage: 1, //当前分页数 |
| 26 | 26 | pageSize: 10, //页大小 |
| 27 | 27 | total: 0, //总数量 |
| 28 | - ad_data:null, | |
| 28 | + ad_data:null, | |
| 29 | + first_leader: e.globalData.first_leader || 0, // 推荐人ID | |
| 29 | 30 | }, |
| 30 | 31 | |
| 31 | 32 | onLoad: function(options) { |
| 32 | - | |
| 33 | 33 | var th = this; |
| 34 | 34 | th.setData({ |
| 35 | 35 | getStorageID: a.stoid, |
| 36 | 36 | getUserID: d.user_id, |
| 37 | 37 | loadingType: 0, |
| 38 | 38 | getDate: i.formatTime(new Date().getTime()) |
| 39 | - }) | |
| 39 | + }); | |
| 40 | + | |
| 41 | + //-- 获取分享人的ID -- | |
| 42 | + var first_leader = options.first_leader || getApp().globalData.first_leader; | |
| 43 | + if (first_leader) { | |
| 44 | + this.setData({ | |
| 45 | + first_leader, | |
| 46 | + }) | |
| 47 | + //-- user_id代过来免登录 -- | |
| 48 | + getApp().globalData.first_leader = first_leader; | |
| 49 | + //调用接口判断是不是会员 | |
| 50 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { | |
| 51 | + if (res.data.code == 0) { | |
| 52 | + getApp().globalData.guide_id = res.data.data.id; | |
| 53 | + } | |
| 54 | + }) | |
| 55 | + } | |
| 40 | 56 | |
| 41 | 57 | getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, { |
| 42 | 58 | data: { |
| ... | ... | @@ -125,13 +141,13 @@ Page({ |
| 125 | 141 | if (th.data.ismore) return; |
| 126 | 142 | th.getList(); |
| 127 | 143 | }, |
| 144 | + | |
| 128 | 145 | //图片失败,默认图片 |
| 129 | 146 | bind_bnerr2: function(e) { |
| 130 | 147 | var _errImg = e.target.dataset.errorimg; |
| 131 | 148 | var _errObj = {}; |
| 132 | 149 | _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; |
| 133 | 150 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
| 134 | - | |
| 135 | 151 | }, |
| 136 | 152 | |
| 137 | 153 | |
| ... | ... | @@ -142,6 +158,7 @@ onShareAppMessage: function (e) { |
| 142 | 158 | if (pagePath.indexOf('/') != 0) { |
| 143 | 159 | pagePath = '/' + pagePath; |
| 144 | 160 | } |
| 161 | + pagePath += "?first_leader="+ this.data.getUserID; | |
| 145 | 162 | return { |
| 146 | 163 | title: "专享礼包", |
| 147 | 164 | path:pagePath, |
| ... | ... | @@ -153,7 +170,8 @@ onShareAppMessage: function (e) { |
| 153 | 170 | var pagePath = curPage.route; //当前页面url |
| 154 | 171 | if (pagePath.indexOf('/') != 0) { |
| 155 | 172 | pagePath = '/' + pagePath; |
| 156 | - } | |
| 173 | + } | |
| 174 | + pagePath += "?first_leader="+ this.data.getUserID; | |
| 157 | 175 | return { |
| 158 | 176 | title: '专享礼包', |
| 159 | 177 | imageUrl: this.data.ad_data.ad_code, | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -702,7 +702,7 @@ Page({ |
| 702 | 702 | |
| 703 | 703 | //---展示--- |
| 704 | 704 | onShow: function () { |
| 705 | - console.log('djfijsaoifjoisadjfoij'); | |
| 705 | + // console.log('djfijsaoifjoisadjfoij'); | |
| 706 | 706 | var goods_list = null, th = this, that = this; |
| 707 | 707 | var show_prew_img = this.data.show_prew_img |
| 708 | 708 | if (show_prew_img) { |
| ... | ... | @@ -836,7 +836,6 @@ Page({ |
| 836 | 836 | t.data.data.prom_type=ee.data.prom_type; |
| 837 | 837 | t.data.data.prom_id=ee.data.prom_id; |
| 838 | 838 | } |
| 839 | - | |
| 840 | 839 | ee.setData({ |
| 841 | 840 | data: t.data.data, |
| 842 | 841 | sele_g: t.data.data, |
| ... | ... | @@ -845,7 +844,7 @@ Page({ |
| 845 | 844 | |
| 846 | 845 | |
| 847 | 846 | //获取统一条形码,普通商品和优惠促销的商品 |
| 848 | - if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5 || ee.data.data.prom_type == 7) { | |
| 847 | + if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5 || ee.data.data.prom_type == 7 || ee.data.data.prom_type == 9) { | |
| 849 | 848 | //默认门店要拿下门店库存 |
| 850 | 849 | if (that.data.sales_rules == 2 && that.data.is_newsales_rules) { |
| 851 | 850 | //获取门店 |
| ... | ... | @@ -1838,7 +1837,20 @@ Page({ |
| 1838 | 1837 | return false; |
| 1839 | 1838 | } |
| 1840 | 1839 | |
| 1841 | - if(th.data.more_flash && open_store==1){ | |
| 1840 | + var check_up=0; | |
| 1841 | + if(th.data.more_flash){ | |
| 1842 | + for(var i in th.data.more_flash){ | |
| 1843 | + var item=th.data.more_flash[i]; | |
| 1844 | + if(item.prom_type==1){ | |
| 1845 | + check_up=1; | |
| 1846 | + break | |
| 1847 | + } | |
| 1848 | + } | |
| 1849 | + } | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + if(check_up && open_store==1){ | |
| 1842 | 1854 | th.setData({is_pop_more:1}); |
| 1843 | 1855 | }else{ |
| 1844 | 1856 | var ind = t.currentTarget.dataset.ind; |
| ... | ... | @@ -2269,7 +2281,9 @@ Page({ |
| 2269 | 2281 | if (res.data.code == 0) prom = res.data.data; |
| 2270 | 2282 | }) |
| 2271 | 2283 | break |
| 2272 | - case 8: | |
| 2284 | + //预售和幸运购不参与 | |
| 2285 | + case 8: | |
| 2286 | + case 9: | |
| 2273 | 2287 | continue; |
| 2274 | 2288 | } |
| 2275 | 2289 | |
| ... | ... | @@ -2342,6 +2356,9 @@ Page({ |
| 2342 | 2356 | for (var i in sku_g) { |
| 2343 | 2357 | if (sku_g[i].goods_id == gid) { |
| 2344 | 2358 | item = sku_g[i]; |
| 2359 | + if(item.original_img.indexOf(that.data.iurl)==-1){ | |
| 2360 | + item.original_img=that.data.iurl+item.original_img; | |
| 2361 | + } | |
| 2345 | 2362 | break |
| 2346 | 2363 | } |
| 2347 | 2364 | } |
| ... | ... | @@ -3015,7 +3032,7 @@ Page({ |
| 3015 | 3032 | var user_id=getApp().globalData.user_id; |
| 3016 | 3033 | if(!user_id) user_id=0; |
| 3017 | 3034 | |
| 3018 | - if (prom_type == 3 || prom_type == 0 || prom_type == 5 || prom_type == 7) { | |
| 3035 | + if (prom_type == 3 || prom_type == 0 || prom_type == 5 || prom_type == 7 || prom_type == 9) { | |
| 3019 | 3036 | this.setData({ |
| 3020 | 3037 | prom_type: 0,isshow: 1, |
| 3021 | 3038 | }); |
| ... | ... | @@ -3096,9 +3113,8 @@ Page({ |
| 3096 | 3113 | }); |
| 3097 | 3114 | } |
| 3098 | 3115 | }) |
| 3099 | - | |
| 3100 | - | |
| 3101 | 3116 | } |
| 3117 | + | |
| 3102 | 3118 | if (prom_type == 1 && prom_id==0){ |
| 3103 | 3119 | this.setData({ |
| 3104 | 3120 | prom_type: 0,isshow: 1, |
| ... | ... | @@ -4355,6 +4371,12 @@ Page({ |
| 4355 | 4371 | context.fillText('强烈推荐', 64*unit, 672*unit); |
| 4356 | 4372 | // 7.商品价格 |
| 4357 | 4373 | let price = '¥' + this.data.data.shop_price; |
| 4374 | + | |
| 4375 | + if(this.data.card_field && this.data.data[this.data.card_field]){ | |
| 4376 | + price = '¥' + this.data.data[this.data.card_field]; | |
| 4377 | + } | |
| 4378 | + | |
| 4379 | + | |
| 4358 | 4380 | // if (th.data.prom_act) |
| 4359 | 4381 | // pri0 = th.data.prom_act.price; |
| 4360 | 4382 | context.setFontSize(32*unit); |
| ... | ... | @@ -4527,8 +4549,11 @@ Page({ |
| 4527 | 4549 | context.setFontSize(23 * unit) |
| 4528 | 4550 | context.setFillStyle("red") |
| 4529 | 4551 | |
| 4530 | - | |
| 4531 | 4552 | var pri0 = th.data.data.shop_price; |
| 4553 | + if(th.data.card_field && th.data.data[th.data.card_field]){ | |
| 4554 | + pri0=th.data.data[th.data.card_field]; | |
| 4555 | + } | |
| 4556 | + | |
| 4532 | 4557 | if (th.data.prom_act) |
| 4533 | 4558 | pri0 = th.data.prom_price; |
| 4534 | 4559 | pri0 = parseFloat(pri0).toFixed(2); | ... | ... |
pages/goods/goodsList/goodsList.wxml
| ... | ... | @@ -62,7 +62,7 @@ |
| 62 | 62 | <view class="item-cont"> |
| 63 | 63 | <view class="title ellipsis-2">{{item.goods_name}}</view> |
| 64 | 64 | <!-- 判断是否有活动价 --> |
| 65 | - <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 }}"> | |
| 65 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 }}"> | |
| 66 | 66 | <view class="flex on"> |
| 67 | 67 | <!-- 活动价 --> |
| 68 | 68 | <view class="price"> | ... | ... |
pages/goods/search/g_filter.wxs
| ... | ... | @@ -88,6 +88,11 @@ var g_filters = { |
| 88 | 88 | if(item.prom_type==8){ |
| 89 | 89 | url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id |
| 90 | 90 | } |
| 91 | + // 如果是幸运购活动商品 | |
| 92 | + if(item.prom_type == 9){ | |
| 93 | + url1 = "/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=" + item.goods_id + "&group_id=" + item.prom_id | |
| 94 | + } | |
| 95 | + | |
| 91 | 96 | if(item.prom_type==1 && item.prom_id>0){ |
| 92 | 97 | url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id+"&prom_type=1"; |
| 93 | 98 | } | ... | ... |
pages/goods/search/search.js
| ... | ... | @@ -146,7 +146,6 @@ Page({ |
| 146 | 146 | for(let i in res.data.data.pageData){ |
| 147 | 147 | let item=res.data.data.pageData[i]; |
| 148 | 148 | item.original_img = th.data.url + item.original_img; |
| 149 | - | |
| 150 | 149 | var url="/api/weshop/activitylist/getGoodActInfo"; |
| 151 | 150 | var req_data={ |
| 152 | 151 | store_id:oo.stoid,goodsidlist:item.goods_id,is_detail:1 |
| ... | ... | @@ -184,7 +183,7 @@ Page({ |
| 184 | 183 | var rd= { |
| 185 | 184 | store_id: oo.stoid, |
| 186 | 185 | presell_id: presell_id, |
| 187 | - goods_id: val.goods_id | |
| 186 | + goods_id: item.goods_id | |
| 188 | 187 | } |
| 189 | 188 | //------获取预售从表---------- |
| 190 | 189 | await getApp().request.promiseGet(url1, { |
| ... | ... | @@ -220,14 +219,13 @@ Page({ |
| 220 | 219 | } |
| 221 | 220 | th.data.requestData.push(item); |
| 222 | 221 | e.setData({requestData: e.data.requestData}); |
| 223 | - e.closeSearchModal(); | |
| 224 | 222 | } |
| 225 | 223 | } |
| 226 | - | |
| 224 | + e.closeSearchModal(); | |
| 227 | 225 | }) |
| 228 | - | |
| 229 | 226 | }, |
| 230 | 227 | onReachBottom: function() { |
| 228 | + this.data.currentPage++ | |
| 231 | 229 | this.data.openSearchModal || e.canloadMore() && this.requestSearch(this.data.requestUrl); |
| 232 | 230 | }, |
| 233 | 231 | openFilterModal: function() { |
| ... | ... | @@ -289,7 +287,7 @@ Page({ |
| 289 | 287 | search: function(t) { |
| 290 | 288 | if ("string" != typeof t || "" == t) return a.showWarning("请输入搜索关键词"); |
| 291 | 289 | this.data.key_str=t; |
| 292 | - this.historyRecord(); | |
| 290 | + this.historyRecord(); | |
| 293 | 291 | this.resetData(), this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t)); |
| 294 | 292 | }, |
| 295 | 293 | ... | ... |
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_id>0}}"> | |
| 38 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_id>0 && item.prom_type!=7}}"> | |
| 39 | 39 | <!-- 活动价 --> |
| 40 | 40 | <view class="price"> |
| 41 | 41 | <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text> | ... | ... |
pages/index/index/index.js
| ... | ... | @@ -87,7 +87,15 @@ Page({ |
| 87 | 87 | }, |
| 88 | 88 | |
| 89 | 89 | onLoad: async function (tt) { |
| 90 | - var th = this; | |
| 90 | + // onLoad生命周期内判断 | |
| 91 | + let obj = wx.getLaunchOptionsSync(); | |
| 92 | + console.log(obj.scene,'launch_scene'); | |
| 93 | + if (obj.scene === 1011 || obj.scene === 1012 || obj.scene === 1013 || obj.scene === 1017 || | |
| 94 | + obj.scene === 1047 ||obj.scene === 1089 || obj.scene === 1038) { | |
| 95 | + this.setData({is_ok_h5:1}) | |
| 96 | + } | |
| 97 | + | |
| 98 | + var th = this; | |
| 91 | 99 | var first_leader = tt.first_leader; |
| 92 | 100 | if (!first_leader && tt.scene) { |
| 93 | 101 | var first_leader_str = decodeURIComponent(tt.scene); |
| ... | ... | @@ -290,6 +298,9 @@ Page({ |
| 290 | 298 | }, |
| 291 | 299 | |
| 292 | 300 | async onShow() { |
| 301 | + this.getTabBar().setData({ | |
| 302 | + cartGoodsNum: getApp().globalData.cartGoodsNum | |
| 303 | + }) | |
| 293 | 304 | var th = this; |
| 294 | 305 | //-- 登录回来判断弹框 -- |
| 295 | 306 | var user_id=getApp().globalData.user_id; |
| ... | ... | @@ -383,6 +394,7 @@ Page({ |
| 383 | 394 | var json_d = JSON.parse(e.switch_list); |
| 384 | 395 | th.setData({ is_closecoupon: json_d.is_closecoupon }) |
| 385 | 396 | th.setData({ is_topstore: json_d.is_show_storeselect }) |
| 397 | + th.setData({is_gz_h5:json_d.is_gz_h5}) | |
| 386 | 398 | }, 1) |
| 387 | 399 | |
| 388 | 400 | if (typeof this.getTabBar === 'function' && this.getTabBar()) { |
| ... | ... | @@ -439,7 +451,6 @@ Page({ |
| 439 | 451 | }); |
| 440 | 452 | |
| 441 | 453 | |
| 442 | - | |
| 443 | 454 | }, |
| 444 | 455 | //当隐藏的时候就关闭计时器 |
| 445 | 456 | onHide: function () { |
| ... | ... | @@ -617,14 +628,7 @@ Page({ |
| 617 | 628 | }); |
| 618 | 629 | } |
| 619 | 630 | }) |
| 620 | - | |
| 621 | - | |
| 622 | - | |
| 623 | - | |
| 624 | - | |
| 625 | - | |
| 626 | - | |
| 627 | - | |
| 631 | + | |
| 628 | 632 | //---调用信息--- |
| 629 | 633 | // this.requestRecommend(); |
| 630 | 634 | this.setData({ |
| ... | ... | @@ -937,10 +941,13 @@ Page({ |
| 937 | 941 | getApp().goto("/pages/goods/categoryList/categoryList"); |
| 938 | 942 | }, |
| 939 | 943 | |
| 944 | + // 幸运购跳转 | |
| 940 | 945 | go_url: function (e) { |
| 946 | + | |
| 941 | 947 | var url = e.currentTarget.dataset.url; |
| 942 | 948 | getApp().goto(url); |
| 943 | - }, | |
| 949 | + | |
| 950 | + }, // | |
| 944 | 951 | |
| 945 | 952 | bind_bnerr_icon: function (e) { |
| 946 | 953 | var def = "/miniapp/images/no_cate_def.png"; | ... | ... |
pages/index/index/index.json
| ... | ... | @@ -19,7 +19,8 @@ |
| 19 | 19 | "service": "/components/diy_service/diy_service", |
| 20 | 20 | "scan": "/components/diy_scan/diy_scan", |
| 21 | 21 | "store_select": "/components/diy_store_select/diy_store_select", |
| 22 | - "presell": "/components/diy_pregoods/diy_pregoods" | |
| 22 | + "presell": "/components/diy_pregoods/diy_pregoods", | |
| 23 | + "luckyGo": "/components/diy_luckyGo/diy_luckyGo" | |
| 23 | 24 | }, |
| 24 | 25 | "enablePullDownRefresh": false |
| 25 | 26 | } |
| 26 | 27 | \ No newline at end of file | ... | ... |
pages/index/index/index.wxml
| ... | ... | @@ -11,14 +11,17 @@ |
| 11 | 11 | |
| 12 | 12 | <view class="container rel nor" wx:if="{{ishow}}"> |
| 13 | 13 | <block wx:if="{{banner}}"> |
| 14 | - <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image> | |
| 14 | + <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image><!-- 红色背景 --> | |
| 15 | 15 | </block> |
| 16 | - <view class="top-bar"> | |
| 16 | + | |
| 17 | + <view class="top-bar"> | |
| 18 | + <!-- 顶部关注公众号 --> | |
| 19 | + <view wx:if="{{is_gz_h5 && is_ok_h5}}"><official-account></official-account></view> | |
| 20 | + | |
| 17 | 21 | <!-- 控制要不要显示顶部门店选择 --> |
| 18 | 22 | <block wx:if="{{is_topstore}}"> |
| 19 | 23 | <store_select style="z-index: 999;"></store_select> |
| 20 | 24 | </block> |
| 21 | - | |
| 22 | 25 | <!--搜索框--> |
| 23 | 26 | <!-- <view class="search-box {{scrollTop>10?'search-fixed':''}} flex-center white " style="top:{{is_topstore?88:0}}rpx"> --> |
| 24 | 27 | <view class="search-box flex-center white"> |
| ... | ... | @@ -41,7 +44,11 @@ |
| 41 | 44 | </view> |
| 42 | 45 | </view> |
| 43 | 46 | </view> |
| 44 | - | |
| 47 | + <!-- 如果有关注,要 --> | |
| 48 | + <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px"></view> | |
| 49 | + <!-- 如果有顶部门店 --> | |
| 50 | + <view wx:if="{{is_topstore}}" style="height: 60rpx"></view> | |
| 51 | + | |
| 45 | 52 | <!--滚动广告--> |
| 46 | 53 | <view class="rel title-img" wx:if="{{banner}}"> |
| 47 | 54 | <swiper circular="true" indicator-dots indicator-active-color="#fff" autoplay="true" class="swiper_box" duration="1000" interval="3000" vertical="" bindchange="bannerSwiperChange" style="height:{{max_sw_height}}rpx"> |
| ... | ... | @@ -229,9 +236,8 @@ |
| 229 | 236 | |
| 230 | 237 | |
| 231 | 238 | <!--幸运购--> |
| 232 | - <!--幸运购--> | |
| 233 | 239 | <view class="seckill" wx:if="{{luckGo_list && luckGo_list.length != 0}}"> |
| 234 | - <navigator bindtap="go_url" data-url="/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList" hover-class="none"> | |
| 240 | + <navigator bindtap="go_url" data-remark="1" data-url="/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList" hover-class="none"> | |
| 235 | 241 | <view class="seckill-time"> |
| 236 | 242 | <view class="classname flex ai_c"> |
| 237 | 243 | <i class="iconfont icon-luck"></i> |
| ... | ... | @@ -243,8 +249,8 @@ |
| 243 | 249 | </view> |
| 244 | 250 | </view> |
| 245 | 251 | </navigator> |
| 246 | - <view class="seckill-list luck"> | |
| 247 | - <view class="list-item" wx:for="{{luckGo_list}}" bindtap="go_url" data-url="/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id={{item.goods_id}}&group_id={{item.id}}" wx:if="{{item.status == 1}}"> | |
| 252 | + <view class=" luck"> | |
| 253 | + <view class="list-item" wx:for="{{luckGo_list}}" bindtap="{{item.actLen == 0 ? '':'go_url'}}" data-aid="{{item.id}}" data-remark="2" data-url="/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id={{item.goods_id}}&group_id={{item.id}}" wx:if="{{item.status == 1}}"> | |
| 248 | 254 | <view class="flex ai-center"> |
| 249 | 255 | <view class="img-container"><image class="img-block" src="{{url + item.original_img}}" data-val="{{item.original_img}}" |
| 250 | 256 | data-errorimg="luckGo_list[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image></view> |
| ... | ... | @@ -258,7 +264,8 @@ |
| 258 | 264 | </view> |
| 259 | 265 | <view class="flex jc_sb"> |
| 260 | 266 | <progress class="pdr20 f1 progress" percent="{{filter.percent(item.num, item.group_num)}}" activeColor="#FF6768" backgroundColor="#d0d0d0" border-radius="12" stroke-width="12" data-content="{{item.num}}人已参团"></progress> |
| 261 | - <view class="btn fs26">去参团</view> | |
| 267 | + <view class="btn fs26 {{item.actLen == 0 ? 'gray':''}}" wx:if="{{item.actLen == 0}}">已抢光</view> | |
| 268 | + <view class="btn fs26" wx:else>去参团</view> | |
| 262 | 269 | <!-- &title=狐狸3号测速003&prom_type=7&prom_id=468 --> |
| 263 | 270 | </view> |
| 264 | 271 | </view> |
| ... | ... | @@ -406,6 +413,9 @@ |
| 406 | 413 | <view class="container" wx:if="{{isTemplate}}" style="background-color:{{bgcolor_t}}; padding-bottom: 10rpx"> |
| 407 | 414 | <!-- 置顶层 --> |
| 408 | 415 | <view class="dis_top"> |
| 416 | + <!-- 关注公众号的显示 --> | |
| 417 | + <view wx:if="{{is_gz_h5 && is_ok_h5}}"><official-account></official-account></view> | |
| 418 | + | |
| 409 | 419 | <block wx:for="{{template_arr}}" > |
| 410 | 420 | <block wx:if="{{item.content.is_top==1}}"> |
| 411 | 421 | <!--如果是搜索框的时候 --> |
| ... | ... | @@ -420,6 +430,8 @@ |
| 420 | 430 | </view> |
| 421 | 431 | <!-- 撑开层 --> |
| 422 | 432 | <view> |
| 433 | + <!-- 关注层的撑开 --> | |
| 434 | + <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px"></view> | |
| 423 | 435 | <block wx:for="{{template_arr}}" > |
| 424 | 436 | <block wx:if="{{item.content.is_top==1 && item.ename=='searchbox'}}"> |
| 425 | 437 | <view wx:if="{{item.content.style==1}}" style="height: 115rpx;"></view> |
| ... | ... | @@ -505,6 +517,11 @@ |
| 505 | 517 | <block wx:if="{{item.ename=='groupbuy'}}"> |
| 506 | 518 | <groupbuy object="{{item.content}}"></groupbuy> |
| 507 | 519 | </block> |
| 520 | + <!-- 幸运购 --> | |
| 521 | + <block wx:if="{{item.ename=='luckyactivity'}}"> | |
| 522 | + <luckyGo object="{{item.content}}"></luckyGo> | |
| 523 | + </block> | |
| 524 | + | |
| 508 | 525 | |
| 509 | 526 | </view> |
| 510 | 527 | ... | ... |
pages/index/index/index.wxss
| ... | ... | @@ -64,7 +64,7 @@ |
| 64 | 64 | width: 48rpx; |
| 65 | 65 | height: 48rpx; |
| 66 | 66 | margin: 0 18rpx; |
| 67 | - border-radius: 50%; | |
| 67 | + /* border-radius: 50%; */ | |
| 68 | 68 | overflow: hidden; |
| 69 | 69 | } |
| 70 | 70 | |
| ... | ... | @@ -110,6 +110,7 @@ |
| 110 | 110 | /* height: auto; */ |
| 111 | 111 | border-radius: 16rpx; |
| 112 | 112 | overflow: hidden; |
| 113 | + min-height: 300rpx; | |
| 113 | 114 | } |
| 114 | 115 | |
| 115 | 116 | .swiperItem { |
| ... | ... | @@ -663,6 +664,7 @@ |
| 663 | 664 | border-radius: 8rpx; |
| 664 | 665 | white-space: nowrap; |
| 665 | 666 | height: 28rpx; |
| 667 | + align-items: center; | |
| 666 | 668 | } |
| 667 | 669 | |
| 668 | 670 | .xc-people-val-frame .val-img { |
| ... | ... | @@ -1014,7 +1016,7 @@ page { |
| 1014 | 1016 | } |
| 1015 | 1017 | |
| 1016 | 1018 | .container.nor{ |
| 1017 | - padding-top: 140rpx; | |
| 1019 | + padding-top: 80rpx; | |
| 1018 | 1020 | } |
| 1019 | 1021 | |
| 1020 | 1022 | /* page, |
| ... | ... | @@ -1130,8 +1132,8 @@ page { |
| 1130 | 1132 | } |
| 1131 | 1133 | |
| 1132 | 1134 | .luck .img-container { |
| 1133 | - width: 200rpx; | |
| 1134 | - height: 200rpx; | |
| 1135 | + width: 220rpx; | |
| 1136 | + height: 220rpx; | |
| 1135 | 1137 | border-radius: 14rpx; |
| 1136 | 1138 | overflow: hidden; |
| 1137 | 1139 | flex-shrink: 0; |
| ... | ... | @@ -1180,6 +1182,7 @@ page { |
| 1180 | 1182 | |
| 1181 | 1183 | .luck .name { |
| 1182 | 1184 | height: 88rpx; |
| 1185 | + word-break: break-all; | |
| 1183 | 1186 | } |
| 1184 | 1187 | |
| 1185 | 1188 | |
| ... | ... | @@ -1195,3 +1198,7 @@ page { |
| 1195 | 1198 | text-align: center; |
| 1196 | 1199 | } |
| 1197 | 1200 | |
| 1201 | +.luck .btn.gray { | |
| 1202 | + background-color: #ccc; | |
| 1203 | +} | |
| 1204 | + | ... | ... |
pages/user/index/index.js
| ... | ... | @@ -58,6 +58,7 @@ Page({ |
| 58 | 58 | * 生命周期函数--监听页面加载 |
| 59 | 59 | */ |
| 60 | 60 | onLoad: function(options) { |
| 61 | + | |
| 61 | 62 | var th=this; |
| 62 | 63 | //-- 读取会员中心按钮列表 -- |
| 63 | 64 | getApp().request.get("/api/weshop/userTool/page?pageSize=100", { |
| ... | ... | @@ -98,6 +99,9 @@ Page({ |
| 98 | 99 | * 生命周期函数--监听页面显示 |
| 99 | 100 | */ |
| 100 | 101 | onShow: function() { |
| 102 | + this.getTabBar().setData({ | |
| 103 | + cartGoodsNum: getApp().globalData.cartGoodsNum, | |
| 104 | + }) | |
| 101 | 105 | //看一下小程序是不是过期了 |
| 102 | 106 | getApp().getConfig2(function(config2){ |
| 103 | 107 | if(config2 && config2.is_overdue==1){ |
| ... | ... | @@ -462,11 +466,11 @@ Page({ |
| 462 | 466 | }, |
| 463 | 467 | setappdata: function(t) { |
| 464 | 468 | var t=getApp().globalData.wxapp_buy_obj; |
| 465 | - if (t.isout == 1) | |
| 469 | + if (t && t.isout == 1) | |
| 466 | 470 | wx.navigateTo({ |
| 467 | 471 | url: "/pages/error/error?msg=小程序已经过期", |
| 468 | 472 | }); |
| 469 | - if (t.isbuy == 0) | |
| 473 | + if (t && t.isbuy == 0) | |
| 470 | 474 | wx.navigateTo({ |
| 471 | 475 | url: "/pages/error/error?msg=还未购买小程序", |
| 472 | 476 | }); |
| ... | ... | @@ -642,7 +646,9 @@ Page({ |
| 642 | 646 | } |
| 643 | 647 | |
| 644 | 648 | var url = e.currentTarget.dataset.img; |
| 645 | - | |
| 649 | + if(!url || url==""){ | |
| 650 | + url=`/public/upload/userqy/quanbg.jpg` | |
| 651 | + } | |
| 646 | 652 | switch (no) { |
| 647 | 653 | case "01": |
| 648 | 654 | getApp().goto("/packageB/pages/user/user_coupon/user_coupon?img=" + |
| ... | ... | @@ -652,7 +658,8 @@ Page({ |
| 652 | 658 | getApp().goto("/pages/user/user_fw/user_fw?gradeId=" + th.data.gradeId + "&FormId=" + item.Id); |
| 653 | 659 | break; |
| 654 | 660 | case "03": |
| 655 | - getApp().goto("/pages/user/user_spsy/user_spsy"); | |
| 661 | + getApp().goto("/pages/user/user_spsy/user_spsy?img=" + | |
| 662 | + url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id); | |
| 656 | 663 | break; |
| 657 | 664 | case "10": |
| 658 | 665 | getApp().request.get("/api/weshop/users/grade/vipprivilegelist/other/get", { | ... | ... |
pages/user/order_detail/order_detail.js
| ... | ... | @@ -316,6 +316,7 @@ Page({ |
| 316 | 316 | |
| 317 | 317 | //--------立即支付---------- |
| 318 | 318 | async jumpToCart4(e) { |
| 319 | + | |
| 319 | 320 | var th=this; |
| 320 | 321 | if(this.data.optionIsGoup) |
| 321 | 322 | wx.navigateTo({ |
| ... | ... | @@ -567,8 +568,7 @@ Page({ |
| 567 | 568 | return false; |
| 568 | 569 | } |
| 569 | 570 | } |
| 570 | - } | |
| 571 | - else{ | |
| 571 | + }else{ | |
| 572 | 572 | //不是赠品的时候 |
| 573 | 573 | if(!good.is_gift && good.prom_type!=3){ |
| 574 | 574 | var t_ok=1; |
| ... | ... | @@ -592,7 +592,7 @@ Page({ |
| 592 | 592 | } |
| 593 | 593 | //赠品和搭配购不判断商品金额 |
| 594 | 594 | var isok=1; |
| 595 | - var card_field=th.data.card_field; | |
| 595 | + var card_field=th.data.card_field; // 会员等级 | |
| 596 | 596 | //如果会员是等级会员,商品有等级价,且不是活动商品 |
| 597 | 597 | if(!good.is_gift && !good.is_collocation) { |
| 598 | 598 | if (card_field && gg[card_field] > 0) { |
| ... | ... | @@ -606,7 +606,7 @@ Page({ |
| 606 | 606 | var is_h=0; |
| 607 | 607 | if (!isok) { |
| 608 | 608 | |
| 609 | - var content=gg.goods_name + '商品的价格发生了变化,请取消订单重新购买'; | |
| 609 | + var content=gg.goods_name + '商品的价格发生了变化,请取消订单重新购买22'; | |
| 610 | 610 | th.toast(content); |
| 611 | 611 | return false; |
| 612 | 612 | } | ... | ... |
pages/user/order_detail/order_detail.wxml
| ... | ... | @@ -77,7 +77,7 @@ |
| 77 | 77 | |
| 78 | 78 | <view class="item" wx:if="{{order.order_prom_type!=5}}"> |
| 79 | 79 | <view>配送方式</view> |
| 80 | - <view>{{(order.shipping_name!=''&& order.shipping_name!=null) ?order.shipping_name:'无'}}</view> | |
| 80 | + <view>{{(order.shipping_name!=''&& order.shipping_name!=null) ?order.shipping_name:'自提'}}</view> | |
| 81 | 81 | </view> |
| 82 | 82 | <view class="item"> |
| 83 | 83 | <view>买家留言</view> | ... | ... |
pages/user/order_list/order_list.js
| ... | ... | @@ -195,6 +195,28 @@ Page({ |
| 195 | 195 | } |
| 196 | 196 | }) |
| 197 | 197 | } |
| 198 | + // 如果是幸运购活动 | |
| 199 | + if(glist[0].prom_type==9){ | |
| 200 | + await getApp().request.promiseGet('/api/weshop/prom/luckyOrder/list', { | |
| 201 | + data: { | |
| 202 | + store_id: os.stoid, | |
| 203 | + user_id: oo.user_id, | |
| 204 | + order_id: item.order_id, | |
| 205 | + } | |
| 206 | + }).then(res => { | |
| 207 | + if(res.data.code==0){ | |
| 208 | + // console.log('luckyGo+++++++++>>>', res.data.data); | |
| 209 | + // data[ind]['team_status'] = res.data.data[0]['team_status']; | |
| 210 | + if(res.data.data[0] && res.data.data[0]['team_status']) { | |
| 211 | + data[ind]['team_status'] = res.data.data[0]['team_status']; | |
| 212 | + } else { | |
| 213 | + data[ind]['team_status'] = 0; | |
| 214 | + }; | |
| 215 | + | |
| 216 | + // data[ind]['ord_url']='/packageC/pages/presell/cart/cart'; | |
| 217 | + } | |
| 218 | + }) | |
| 219 | + } | |
| 198 | 220 | //------------对比一下有没有退款记录------------ |
| 199 | 221 | await getApp().request.promiseGet("/api/weshop/order/returngoods/page", { |
| 200 | 222 | data: { |
| ... | ... | @@ -462,6 +484,7 @@ Page({ |
| 462 | 484 | }, |
| 463 | 485 | /*----------跳转支付-----------*/ |
| 464 | 486 | async jumpToCart4(t) { |
| 487 | + | |
| 465 | 488 | var o_index = t.currentTarget.dataset.idx; |
| 466 | 489 | var e = this.data.orderList[o_index]; |
| 467 | 490 | var th = this; |
| ... | ... | @@ -469,6 +492,25 @@ Page({ |
| 469 | 492 | var order_goods = e.order_goods; |
| 470 | 493 | var user_id=getApp().globalData.userInfo.user_id; |
| 471 | 494 | |
| 495 | + // 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id} | |
| 496 | + if (parseInt(order_goods['0']['prom_type']) == 9) { | |
| 497 | + var aid = order_goods['0']['prom_id']; | |
| 498 | + var knum = 0; | |
| 499 | + await r.promiseGet('/api/weshop/activitylist/getActLen/' + os.stoid + '/9/' + aid, { | |
| 500 | + }).then(res => { | |
| 501 | + if (res.data.code == 0) { | |
| 502 | + knum = res.data.data; | |
| 503 | + } | |
| 504 | + | |
| 505 | + }); | |
| 506 | + | |
| 507 | + if (knum <= 0) { | |
| 508 | + getApp().confirmBox("库存为0,支付失败"); | |
| 509 | + return false; | |
| 510 | + } | |
| 511 | + | |
| 512 | + } | |
| 513 | + | |
| 472 | 514 | var wlist = ""; |
| 473 | 515 | for (var i in order_goods) { |
| 474 | 516 | var good = order_goods[i]; |
| ... | ... | @@ -577,7 +619,7 @@ Page({ |
| 577 | 619 | } |
| 578 | 620 | |
| 579 | 621 | //如果是预售的时候, |
| 580 | - if(good.prom_type==8){ | |
| 622 | + if(good.prom_type==8) { | |
| 581 | 623 | await getApp().request.promiseGet("/api/weshop/order/orderPresell/countBuyGoodsSum",{ |
| 582 | 624 | data: {store_id: os.stoid, user_id: user_id, goods_id: good.goods_id, prom_id: good.prom_id}, |
| 583 | 625 | }).then(e=>{ |
| ... | ... | @@ -699,7 +741,7 @@ Page({ |
| 699 | 741 | return false; |
| 700 | 742 | } |
| 701 | 743 | |
| 702 | - } else { | |
| 744 | + } else { | |
| 703 | 745 | if ((gg.prom_type == 1 || good.prom_type == 2 || gg.prom_type == 3 || gg.prom_type == 5 || gg.prom_type == 6 || gg.prom_type == 4) |
| 704 | 746 | && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) { |
| 705 | 747 | var prom = null; |
| ... | ... | @@ -776,7 +818,7 @@ Page({ |
| 776 | 818 | var card_field = th.data.card_field; |
| 777 | 819 | |
| 778 | 820 | //-- 如果会员是等级会员,商品有等级价,且不是活动商品,同时线下取价的要放在最后来判断 -- |
| 779 | - if (!good.is_gift && !good.is_collocation) { | |
| 821 | + if (!good.is_gift && !good.is_collocation && gg.prom_type != 9) { | |
| 780 | 822 | if (card_field && gg[card_field] > 0) { |
| 781 | 823 | if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0; |
| 782 | 824 | if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 | ... | ... |
pages/user/order_list/order_list.wxml
| ... | ... | @@ -40,7 +40,7 @@ |
| 40 | 40 | <text selectable='true'>订单编号:{{item.order_sn}}</text> |
| 41 | 41 | <!-- 商品评价状态 --> |
| 42 | 42 | <view class="flex-center c-r"> |
| 43 | - | |
| 43 | + <!-- 这是预售的 --> | |
| 44 | 44 | <block wx:if="{{item.presell}}"> |
| 45 | 45 | <block wx:if="{{item.order_status==3}}"> |
| 46 | 46 | <text wx:if="{{item.presell.tail_pay_state==2}}">尾款支付失败</text> |
| ... | ... | @@ -64,6 +64,19 @@ |
| 64 | 64 | <block wx:else>退款中</block> |
| 65 | 65 | |
| 66 | 66 | </block> |
| 67 | + <!-- 幸运购 --> | |
| 68 | + <block wx:elif="{{item.order_goods[0].prom_type == 9}}"> | |
| 69 | + <view wx:if="{{item.is_back ==1 && item.pay_status ==1}}">已退款</view> | |
| 70 | + <view wx:elif="{{item.is_back == 0 && item.pay_status ==1 && item.team_status == 0}}">已支付,待成团</view> | |
| 71 | + <view wx:if="{{(item.order_status==0&&item.pay_status==0)}}">未支付</view> | |
| 72 | + <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0 && item.team_status == 2)}}">待发货</view> | |
| 73 | + <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1 && item.team_status == 2)}}">待收货</view> | |
| 74 | + <view wx:if="{{(item.order_status==2)}}">待评价</view> | |
| 75 | + <view wx:if="{{item.order_status==4}}">已评价</view> | |
| 76 | + <view wx:if="{{item.pay_status == 0 && item.order_status==3 && item.pt_status!=6}}" class="flex-center" >已取消<view class="lin"></view> | |
| 77 | + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image> | |
| 78 | + </view> | |
| 79 | + </block> | |
| 67 | 80 | <block wx:else> |
| 68 | 81 | <!-- 订单状态 --> |
| 69 | 82 | <view wx:if="{{item.pt_status==1 && item.pt_prom_id>0}}">组团中</view> |
| ... | ... | @@ -82,6 +95,8 @@ |
| 82 | 95 | </block> |
| 83 | 96 | <block wx:else>退款中</block> |
| 84 | 97 | </block> |
| 98 | + | |
| 99 | + | |
| 85 | 100 | |
| 86 | 101 | </view> |
| 87 | 102 | </view> |
| ... | ... | @@ -91,7 +106,9 @@ |
| 91 | 106 | <!-- 单个商品 --> |
| 92 | 107 | <!-- wx:if="{{goods.return_btn!=4}}" --> |
| 93 | 108 | <view> |
| 94 | - <navigator class="detail_commodity flex-vertical padding" wx:for="{{item.order_goods}}" wx:for-item="goods" wx:for-index="pinx" url="{{item.ord_url}}?order_id={{item.order_id}}"> | |
| 109 | + <!-- url="/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id={{item.order_id}}" wx:if="{{item.order_goods[0].prom_type==9}}" | |
| 110 | + {{item.ord_url}}?order_id={{item.order_id}} --> | |
| 111 | + <navigator class="detail_commodity flex-vertical padding" wx:for="{{item.order_goods}}" wx:for-item="goods" wx:for-index="pinx" url="{{item.order_goods[0].prom_type==9 ? ('/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id=' + item.order_id + '&group_id=' + item.order_goods[0].prom_id):(item.ord_url + '?order_id=' + item.order_id)}}"> | |
| 95 | 112 | <!-- 商品图片 --> |
| 96 | 113 | <navigator class="rel"> |
| 97 | 114 | <image src="{{resourceUrl+goods.original_img}}" binderror="bind_bnerr" lazy-load="{{true}}" data-errorimg="orderList[{{index}}].order_goods[{{pinx}}].original_img"></image> |
| ... | ... | @@ -128,7 +145,10 @@ |
| 128 | 145 | <!-- 商品价格 --> |
| 129 | 146 | <view class="flex-vertical c-tb baseline"> |
| 130 | 147 | <view class="fs24">¥</view> |
| 131 | - <view class="fs26">{{filters.toFix(goods.member_goods_price,2)}}</view> | |
| 148 | + <!-- 幸运购prom_type等于9 --> | |
| 149 | + <!-- 如果是幸运购就显示幸运购参团价格 --> | |
| 150 | + <view class="fs26" wx:if="{{goods.prom_type == 9}}">{{filters.toFix(goods.goods_price,2)}}</view> | |
| 151 | + <view class="fs26" wx:else>{{filters.toFix(goods.member_goods_price,2)}}</view> | |
| 132 | 152 | </view> |
| 133 | 153 | <view class="fs26 c-a9">x{{goods.goods_num}}</view> |
| 134 | 154 | </view> |
| ... | ... | @@ -162,7 +182,8 @@ |
| 162 | 182 | <view class="commodity_money flex baseline" wx:else> |
| 163 | 183 | <view>合计<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view> |
| 164 | 184 | <view class="fs24 c-r">¥</view> |
| 165 | - <view class="c-r">{{filters.toFix(item.order_amount+item.user_money,2)}} | |
| 185 | + <view class="c-r"> | |
| 186 | + {{filters.toFix(item.order_amount+item.user_money,2)}} | |
| 166 | 187 | <text wx:if="{{item.coupon_price}}">+{{item.coupon_price}}元优惠券</text> |
| 167 | 188 | <text wx:if="{{item.integral}}">+{{item.integral}}积分</text> |
| 168 | 189 | </view> |
| ... | ... | @@ -196,7 +217,7 @@ |
| 196 | 217 | <navigator class="commodity_To_evaluate flex-level View_evaluation" hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==1)}}" url="/pages/user/express/express?order_id={{item.order_id}}">查看物流</navigator> |
| 197 | 218 | <navigator class="commodity_To_evaluate flex-level View_evaluation" hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==2)}}" url="/pages/user/express/express?order_id={{item.order_id}}">查看物流</navigator> |
| 198 | 219 | |
| 199 | - <navigator class="commodity_To_evaluate flex-level View_evaluation" url="/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id={{item.order_id}}" wx:if="{{item.order_goods[0].prom_type==9}}">订单详情</navigator> | |
| 220 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" url="/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id={{item.order_id}}&&group_id={{item.order_goods[0].prom_id}}" wx:if="{{item.order_goods[0].prom_type==9}}">订单详情</navigator> | |
| 200 | 221 | <navigator class="commodity_To_evaluate flex-level View_evaluation" url="{{item.ord_url}}?order_id={{item.order_id}}" wx:else>订单详情</navigator> |
| 201 | 222 | |
| 202 | 223 | <block wx:if="{{!(item.has_rt || item.return_btn==2 || item.return_btn==4)}}"> | ... | ... |
pages/user/plus/plus.js
| 1 | 1 | var t = getApp(), |
| 2 | 2 | a = t.request, |
| 3 | - o = t.globalData.setting, | |
| 3 | + o = t.globalData.setting, | |
| 4 | 4 | os = o, |
| 5 | 5 | i = require("../../../utils/util.js"), |
| 6 | 6 | ut = i, |
| 7 | 7 | s = require("../../../utils/common.js"), |
| 8 | - w = require("../../../utils/wxParse/wxParse.js"),t_pay = require("../../../utils/pay2.js"); | |
| 9 | - var regeneratorRuntime = require('../../../utils/runtime.js'); | |
| 8 | + w = require("../../../utils/wxParse/wxParse.js"), | |
| 9 | + t_pay = require("../../../utils/pay2.js"); | |
| 10 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | |
| 11 | + | |
| 10 | 12 | |
| 11 | 13 | Page({ |
| 12 | 14 | /** |
| ... | ... | @@ -19,24 +21,27 @@ Page({ |
| 19 | 21 | screenheight: 0, |
| 20 | 22 | canvasHidden: true, |
| 21 | 23 | shareImgPath: null, |
| 22 | - is_plusCard: "",//卡的列表 | |
| 24 | + is_plusCard: "", //卡的列表 | |
| 23 | 25 | imagePath: "", |
| 24 | - is_pulscardname: "",//plus会员的名字 | |
| 25 | - is_card: 0,//用于判断是否是续费页和购买页面 0不是PLUS会员 | |
| 26 | - content: "",//等级卡规则 | |
| 27 | - is_card_rule: "",//等级卡规则判断用 | |
| 28 | - is_show: 0, //页面要加载完才能显示 | |
| 29 | - open_yq: 0, //显示打开邀请码的弹窗 | |
| 30 | - by_index:null, //购买卡的下班 | |
| 26 | + is_pulscardname: "", //plus会员的名字 | |
| 27 | + is_card: 0, //用于判断是否是续费页和购买页面 0不是PLUS会员 | |
| 28 | + content: "", //等级卡规则 | |
| 29 | + is_card_rule: "", //等级卡规则判断用 | |
| 30 | + is_show: 0, //页面要加载完才能显示 | |
| 31 | + open_yq: 0, //显示打开邀请码的弹窗 | |
| 32 | + by_index: null, //购买卡的下班 | |
| 31 | 33 | |
| 32 | - isyaoqingma:0, //是否邀请码 | |
| 33 | - is_salesman:0, //是否营业员 | |
| 34 | - inp_recommon: null, //输入的邀请码 | |
| 34 | + isyaoqingma: 0, //是否邀请码 | |
| 35 | + is_salesman: 0, //是否营业员 | |
| 36 | + inp_recommon: null, //输入的邀请码 | |
| 35 | 37 | inp_serviceman: null, //输入的营业员 |
| 36 | - is_fengxiang: 0, //是不是分享过来的 | |
| 37 | - def_recommon: null, //分享人的手机号 | |
| 38 | - def_serviceman: null, //分享人的营业员 | |
| 39 | - fir_leader:0, //分享人的ID | |
| 38 | + is_fengxiang: 0, //是不是分享过来的 | |
| 39 | + def_recommon: null, //分享人的手机号 | |
| 40 | + def_serviceman: null, //分享人的营业员 | |
| 41 | + fir_leader: 0, //分享人的ID | |
| 42 | + staffNo_arr: [], //多个营业员 | |
| 43 | + focus:false, | |
| 44 | + is_select: false, //是否选择营业员过 | |
| 40 | 45 | }, |
| 41 | 46 | swiperChange: function (e) { |
| 42 | 47 | var currentId = e.detail.current; |
| ... | ... | @@ -48,34 +53,41 @@ Page({ |
| 48 | 53 | * 生命周期函数--监听页面加载 |
| 49 | 54 | */ |
| 50 | 55 | onLoad: function (options) { |
| 51 | - var that = this,th=that; | |
| 52 | - var store_id=getApp().globalData.setting.stoid; | |
| 56 | + var that = this, | |
| 57 | + th = that; | |
| 58 | + var store_id = getApp().globalData.setting.stoid; | |
| 53 | 59 | //获取用户设备信息,屏幕宽度 |
| 54 | 60 | wx.getSystemInfo({ |
| 55 | 61 | success: res => { |
| 56 | - that.setData({screenWidth: res.screenWidth}) | |
| 62 | + that.setData({ | |
| 63 | + screenWidth: res.screenWidth | |
| 64 | + }) | |
| 57 | 65 | } |
| 58 | 66 | }) |
| 59 | 67 | var fir_leader = options.scene; |
| 60 | - if (fir_leader) that.setData({fir_leader:fir_leader}) | |
| 68 | + if (fir_leader) that.setData({ | |
| 69 | + fir_leader: fir_leader | |
| 70 | + }) | |
| 61 | 71 | //--先判断会员状态-- |
| 62 | 72 | var user_info = getApp().globalData.userInfo; |
| 63 | 73 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 64 | - wx.navigateTo({ url: '/pages/togoin/togoin?first_leader=' + fir_leader, }) | |
| 65 | - return false; | |
| 66 | - } | |
| 74 | + wx.navigateTo({ | |
| 75 | + url: '/pages/togoin/togoin?first_leader=' + fir_leader, | |
| 76 | + }) | |
| 77 | + return false; | |
| 78 | + } | |
| 67 | 79 | //-----------商家配置信息----- 等级卡规则,是否又开邀请码,营业员------------ |
| 68 | 80 | getApp().request.get("/api/weshop/storeconfig/get/" + store_id, { |
| 69 | 81 | success: function (res) { |
| 70 | 82 | var is_cardrule = res.data.data.cardrules; |
| 71 | - var switch_list= res.data.data.switch_list; | |
| 72 | - var swi_arr=JSON.parse(switch_list); | |
| 83 | + var switch_list = res.data.data.switch_list; | |
| 84 | + var swi_arr = JSON.parse(switch_list); | |
| 73 | 85 | |
| 74 | 86 | w.wxParse("content", "html", is_cardrule, that, 6); |
| 75 | 87 | that.setData({ |
| 76 | - is_card_rule: is_cardrule, | |
| 77 | - isyaoqingma:parseInt(swi_arr.isyaoqingma), | |
| 78 | - is_salesman:parseInt(swi_arr.is_staffno) | |
| 88 | + is_card_rule: is_cardrule, | |
| 89 | + isyaoqingma: parseInt(swi_arr.isyaoqingma), | |
| 90 | + is_salesman: parseInt(swi_arr.is_staffno) | |
| 79 | 91 | }); |
| 80 | 92 | } |
| 81 | 93 | }); |
| ... | ... | @@ -85,12 +97,14 @@ Page({ |
| 85 | 97 | * 生命周期函数--监听页面显示 |
| 86 | 98 | */ |
| 87 | 99 | onShow: function () { |
| 88 | - var user_info = getApp().globalData.userInfo; | |
| 89 | - if(!user_info) return false; | |
| 90 | - | |
| 91 | - var th=this,that=th,app_d=getApp().globalData; | |
| 92 | - var store_id=os.stoid; | |
| 93 | - var fir_leader=this.data.fir_leader; | |
| 100 | + var user_info = getApp().globalData.userInfo; | |
| 101 | + if (!user_info) return false; | |
| 102 | + | |
| 103 | + var th = this, | |
| 104 | + that = th, | |
| 105 | + app_d = getApp().globalData; | |
| 106 | + var store_id = os.stoid; | |
| 107 | + var fir_leader = this.data.fir_leader; | |
| 94 | 108 | |
| 95 | 109 | if (fir_leader != null && fir_leader != undefined && fir_leader != "") { |
| 96 | 110 | var r_url = "/api/weshop/plus/vip/mem/list?storeId=" + store_id + "&userId=" + fir_leader |
| ... | ... | @@ -126,8 +140,12 @@ Page({ |
| 126 | 140 | } |
| 127 | 141 | if (is_ok == 1) { |
| 128 | 142 | //--保存或者更新会员信息-- |
| 129 | - that.setData({ def_recommon: user_information.MobileTel, def_serviceman: user_information.StaffNo, is_fengxiang: 1 }) | |
| 130 | - th.save_th_plus_user(); | |
| 143 | + that.setData({ | |
| 144 | + def_recommon: user_information.MobileTel, | |
| 145 | + def_serviceman: user_information.StaffNo, | |
| 146 | + is_fengxiang: 1 | |
| 147 | + }) | |
| 148 | + th.save_th_plus_user(); | |
| 131 | 149 | } |
| 132 | 150 | } |
| 133 | 151 | }); |
| ... | ... | @@ -138,14 +156,16 @@ Page({ |
| 138 | 156 | getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + app_d.user_id, { |
| 139 | 157 | success: function (e) { |
| 140 | 158 | var userInfo = e.data.data; |
| 141 | - if(userInfo['card_field'] && !getApp().globalData.is_card_back){ | |
| 142 | - var u_url = "/pages/user/cardinfo/cardinfo"; | |
| 143 | - wx.reLaunch({url: u_url}) | |
| 159 | + if (userInfo['card_field'] && !getApp().globalData.is_card_back) { | |
| 160 | + var u_url = "/pages/user/cardinfo/cardinfo"; | |
| 161 | + wx.reLaunch({ | |
| 162 | + url: u_url | |
| 163 | + }) | |
| 144 | 164 | } |
| 145 | 165 | }, |
| 146 | 166 | }); |
| 147 | 167 | |
| 148 | - this.getPlusCardType(); | |
| 168 | + this.getPlusCardType(); | |
| 149 | 169 | }, |
| 150 | 170 | |
| 151 | 171 | /** |
| ... | ... | @@ -170,18 +190,23 @@ Page({ |
| 170 | 190 | var plusCard = res.data.data; |
| 171 | 191 | var arr = [1219, 2089, 3031]; |
| 172 | 192 | var new_arr = new Array(); |
| 173 | - var parr=[]; | |
| 193 | + var parr = []; | |
| 174 | 194 | for (var i = 0; i < plusCard.length; i++) { |
| 175 | - //plusCard[i].free=arr[i]; | |
| 176 | - if(plusCard[i].IsStopBuy) { continue; } | |
| 177 | - if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg"+(i + 1)+ ".jpg?v=1"; | |
| 178 | - var item = {"fee": plusCard[i].CardFee, 'index': i} | |
| 179 | - new_arr.push(item); | |
| 180 | - parr.push(plusCard[i]); | |
| 195 | + //plusCard[i].free=arr[i]; | |
| 196 | + if (plusCard[i].IsStopBuy) { | |
| 197 | + continue; | |
| 198 | + } | |
| 199 | + if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg" + (i + 1) + ".jpg?v=1"; | |
| 200 | + var item = { | |
| 201 | + "fee": plusCard[i].CardFee, | |
| 202 | + 'index': i | |
| 203 | + } | |
| 204 | + new_arr.push(item); | |
| 205 | + parr.push(plusCard[i]); | |
| 181 | 206 | } |
| 182 | 207 | |
| 183 | 208 | //看是不是还有卡项是可以购买的 |
| 184 | - if(new_arr && new_arr.length>0){ | |
| 209 | + if (new_arr && new_arr.length > 0) { | |
| 185 | 210 | //根據距離遠近排序,越近在前面,升序 |
| 186 | 211 | new_arr.sort(function (a, b) { |
| 187 | 212 | if (a.fee < b.fee) { |
| ... | ... | @@ -195,39 +220,48 @@ Page({ |
| 195 | 220 | |
| 196 | 221 | //里面和外面要显示统一 |
| 197 | 222 | switch (new_arr.length) { |
| 198 | - case 1:arr=[3031]; break; | |
| 199 | - case 2: arr = [2089, 3031]; break; | |
| 200 | - case 3: arr = [1219, 2089, 3031];break; | |
| 223 | + case 1: | |
| 224 | + arr = [3031]; | |
| 225 | + break; | |
| 226 | + case 2: | |
| 227 | + arr = [2089, 3031]; | |
| 228 | + break; | |
| 229 | + case 3: | |
| 230 | + arr = [1219, 2089, 3031]; | |
| 231 | + break; | |
| 201 | 232 | } |
| 202 | 233 | |
| 203 | 234 | //---给数组添加立省多少钱--- |
| 204 | 235 | for (i = 0; i < parr.length; i++) { |
| 205 | - //判断是否停用 | |
| 206 | - for (var j = 0; j < new_arr.length; j++) { | |
| 207 | - if (i == new_arr[j].index) { | |
| 208 | - parr[i].free = arr[j]; | |
| 209 | - break; | |
| 210 | - } | |
| 236 | + //判断是否停用 | |
| 237 | + for (var j = 0; j < new_arr.length; j++) { | |
| 238 | + if (i == new_arr[j].index) { | |
| 239 | + parr[i].free = arr[j]; | |
| 240 | + break; | |
| 241 | + } | |
| 211 | 242 | } |
| 212 | 243 | } |
| 213 | 244 | th.setData({ |
| 214 | - is_plusCard: parr, is_show: 1 | |
| 245 | + is_plusCard: parr, | |
| 246 | + is_show: 1 | |
| 215 | 247 | }) |
| 216 | 248 | |
| 217 | - }else{ | |
| 218 | - th.setData({is_show: 1}); | |
| 219 | - wx.showToast({ | |
| 220 | - title: "暂无可购买的等级卡项", | |
| 221 | - icon: 'none', | |
| 222 | - duration: 4000 | |
| 223 | - }) | |
| 249 | + } else { | |
| 250 | + th.setData({ | |
| 251 | + is_show: 1 | |
| 252 | + }); | |
| 253 | + wx.showToast({ | |
| 254 | + title: "暂无可购买的等级卡项", | |
| 255 | + icon: 'none', | |
| 256 | + duration: 4000 | |
| 257 | + }) | |
| 224 | 258 | |
| 225 | - } | |
| 226 | - setTimeout(function(){ | |
| 227 | - var goods_list = th.selectComponent("#goods_list"); //组件的id | |
| 228 | - goods_list.init(); | |
| 229 | - goods_list.get_list(); | |
| 230 | - },1000) | |
| 259 | + } | |
| 260 | + setTimeout(function () { | |
| 261 | + var goods_list = th.selectComponent("#goods_list"); //组件的id | |
| 262 | + goods_list.init(); | |
| 263 | + goods_list.get_list(); | |
| 264 | + }, 1000) | |
| 231 | 265 | |
| 232 | 266 | }) |
| 233 | 267 | }, |
| ... | ... | @@ -241,33 +275,73 @@ Page({ |
| 241 | 275 | th.buy_card(); |
| 242 | 276 | } else { |
| 243 | 277 | //--如果后台都没有勾邀请码,营业员,立即购买-- |
| 244 | - if (!th.data.isyaoqingma && !th.data.is_salesman) {th.buy_card(); return false;} | |
| 245 | - th.setData({open_yq: 1}) | |
| 278 | + if (!th.data.isyaoqingma && !th.data.is_salesman) { | |
| 279 | + th.buy_card(); | |
| 280 | + return false; | |
| 281 | + } | |
| 282 | + th.setData({ | |
| 283 | + open_yq: 1 | |
| 284 | + }) | |
| 246 | 285 | } |
| 247 | 286 | }, |
| 248 | 287 | |
| 288 | + //选择营业员 | |
| 289 | + select_serviceman(e) { | |
| 290 | + let StaffNo = e.currentTarget.dataset.staffno; | |
| 291 | + let {req_data,req} = this.data; | |
| 292 | + if (StaffNo && StaffNo !== "") { | |
| 293 | + req_data.staffNo = StaffNo; | |
| 294 | + req.serviceman = StaffNo; | |
| 295 | + }; | |
| 296 | + this.setData({ | |
| 297 | + is_select: 1, | |
| 298 | + staffNo_arr:[], | |
| 299 | + }) | |
| 300 | + this.check_serviceman(req_data,req) | |
| 301 | + }, | |
| 302 | + //--绑定邀请码的输入-- | |
| 303 | + b_input: function (e) { | |
| 304 | + var value = e.detail.value.trim(); | |
| 305 | + // let { isyaoqingma, is_salesman }=this.data; | |
| 306 | + var name = e.currentTarget.dataset.name; | |
| 307 | + // if((name=="isyaoqingma" && isyaoqingma) || (name=="is_salesman" && is_salesman) ){ | |
| 308 | + // if(!value){ | |
| 309 | + // wx.showToast({ | |
| 310 | + // title: '不能为空', | |
| 311 | + // }) | |
| 312 | + // return false; | |
| 313 | + // } | |
| 314 | + // } | |
| 315 | + var ob = {}; | |
| 316 | + ob[name] = value; | |
| 317 | + this.setData(ob); | |
| 318 | + }, | |
| 249 | 319 | //--立即购买卡-- |
| 250 | 320 | buy_card: async function () { |
| 321 | + console.log(11111); | |
| 251 | 322 | var th = this; |
| 252 | 323 | var is_card = 0; |
| 253 | 324 | //--商家是不是有等级卡功能,开通的人数是不是够用,开通是时间是不是到期-- |
| 254 | - await getApp().request.promiseGet("/api/weshop/plus/plus/card/register", | |
| 255 | - {data: {storeId: os.stoid}}).then(res => { | |
| 325 | + await getApp().request.promiseGet("/api/weshop/plus/plus/card/register", { | |
| 326 | + data: { | |
| 327 | + storeId: os.stoid | |
| 328 | + } | |
| 329 | + }).then(res => { | |
| 256 | 330 | if (res.data.code == 0) is_card = 1; |
| 257 | 331 | }) |
| 258 | 332 | if (is_card == 0) { |
| 259 | - getApp().my_warnning("请联系商家升级plus功能", 0, th); | |
| 260 | - return false; | |
| 261 | - } | |
| 262 | - | |
| 333 | + getApp().my_warnning("请联系商家升级plus功能", 0, th); | |
| 334 | + return false; | |
| 335 | + } | |
| 336 | + | |
| 263 | 337 | var item = th.data.is_plusCard[th.data.by_index]; |
| 264 | 338 | var req = {}; |
| 265 | 339 | req.cardId = item.CardId; |
| 266 | 340 | req.rechargeType = 3; |
| 267 | 341 | //如果不是你导购,也不是等级会员分享 |
| 268 | 342 | if (th.data.is_fengxiang == 1) { |
| 269 | - if (th.data.def_recommon) req.recommon = th.data.def_recommon | |
| 270 | - if (th.data.def_serviceman) req.serviceman = th.data.def_serviceman | |
| 343 | + if (th.data.def_recommon) req.recommon = th.data.def_recommon | |
| 344 | + if (th.data.def_serviceman) req.serviceman = th.data.def_serviceman | |
| 271 | 345 | } else { |
| 272 | 346 | //---后台要求要输入邀请码--- |
| 273 | 347 | if (th.data.isyaoqingma) { |
| ... | ... | @@ -275,19 +349,21 @@ Page({ |
| 275 | 349 | getApp().my_warnning("请输入邀请码", 0, th); |
| 276 | 350 | return false; |
| 277 | 351 | } |
| 278 | - | |
| 279 | - //--邀请人不能是自己的手机号-- | |
| 280 | - if(th.data.inp_recommon==getApp().globalData.userInfo.mobile){ | |
| 281 | - getApp().my_warnning("邀请人不能填自已", 0, th); | |
| 282 | - return false; | |
| 283 | - } | |
| 284 | - | |
| 352 | + | |
| 353 | + //--邀请人不能是自己的手机号-- | |
| 354 | + if (th.data.inp_recommon == getApp().globalData.userInfo.mobile) { | |
| 355 | + getApp().my_warnning("邀请人不能填自已", 0, th); | |
| 356 | + return false; | |
| 357 | + } | |
| 285 | 358 | req.recommon = th.data.inp_recommon |
| 286 | 359 | } |
| 287 | 360 | //--后台要求要输入营业员-- |
| 288 | 361 | if (th.data.is_salesman) { |
| 289 | 362 | if (!th.data.inp_serviceman) { |
| 290 | 363 | getApp().my_warnning("请输入营业员", 0, th); |
| 364 | + th.setData({ | |
| 365 | + focus:true | |
| 366 | + }) | |
| 291 | 367 | return false; |
| 292 | 368 | } |
| 293 | 369 | req.serviceman = th.data.inp_serviceman |
| ... | ... | @@ -296,137 +372,222 @@ Page({ |
| 296 | 372 | req.storeId = os.stoid; |
| 297 | 373 | req.userId = getApp().globalData.user_id; |
| 298 | 374 | //--如果有邀请码,和营业员的情况下-- |
| 299 | - if(req.recommon || req.serviceman ) { | |
| 300 | - var req_data = {storeId: os.stoid, userId: req.userId}; | |
| 301 | - if(req.recommon) req_data.inviteCode=req.recommon; | |
| 302 | - if(req.serviceman) req_data.staffNo=req.serviceman; | |
| 303 | - getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", { | |
| 304 | - data:req_data, | |
| 305 | - success:function(res){ | |
| 306 | - if(res.data.code==0) { | |
| 307 | - t_pay.pay(req, th.success, function () { | |
| 308 | - getApp().my_warnning("支付失败", 0, th); | |
| 309 | - }); | |
| 310 | - }else{ | |
| 311 | - getApp().my_warnning(res.data.msg, 0, th); | |
| 312 | - } | |
| 313 | - } | |
| 375 | + if (req.recommon || req.serviceman) { | |
| 376 | + | |
| 377 | + var req_data = { | |
| 378 | + storeId: os.stoid, | |
| 379 | + userId: req.userId | |
| 380 | + }; | |
| 381 | + if (req.recommon) req_data.inviteCode = req.recommon; | |
| 382 | + if (req.serviceman) req_data.staffNo = req.serviceman; | |
| 383 | + th.setData({ | |
| 384 | + req_data, | |
| 385 | + req, | |
| 314 | 386 | }) |
| 315 | - }else{ | |
| 387 | + th.check_serviceman(req_data,req) | |
| 388 | + // getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", { | |
| 389 | + // data: req_data, | |
| 390 | + // success: function (res) { | |
| 391 | + // if (res.data.code == 0) { | |
| 392 | + // if(res.data.data.length > 1 && !th.data.is_select){ | |
| 393 | + // th.setData({ | |
| 394 | + // staffNo_arr:res.data.data | |
| 395 | + // }) | |
| 396 | + // }else{ | |
| 397 | + // t_pay.pay(req, th.success, function () { | |
| 398 | + // getApp().my_warnning("支付失败", 0, th); | |
| 399 | + // th.setData({ | |
| 400 | + // is_select:0, | |
| 401 | + // }) | |
| 402 | + // }); | |
| 403 | + // } | |
| 404 | + // } else { | |
| 405 | + // getApp().my_warnning(res.data.msg, 0, th); | |
| 406 | + // th.setData({ | |
| 407 | + // is_select:0, | |
| 408 | + // }) | |
| 409 | + // } | |
| 410 | + // } | |
| 411 | + // }) | |
| 412 | + } else { | |
| 316 | 413 | t_pay.pay(req, th.success, function () { |
| 317 | 414 | getApp().my_warnning("支付失败", 0, th); |
| 415 | + th.setData({ | |
| 416 | + is_select:0, | |
| 417 | + focus:true, | |
| 418 | + }) | |
| 318 | 419 | }); |
| 319 | - } | |
| 420 | + } | |
| 320 | 421 | }, |
| 321 | 422 | //返回会员页面 |
| 322 | - OpeningClose: function() { | |
| 323 | - this.setData({open_yq:0}); | |
| 423 | + OpeningClose: function () { | |
| 424 | + this.setData({ | |
| 425 | + open_yq: 0, | |
| 426 | + inp_serviceman:"" | |
| 427 | + }); | |
| 428 | + }, | |
| 429 | + dialog_close() { | |
| 430 | + this.setData({ | |
| 431 | + staffNo_arr: [], | |
| 432 | + }); | |
| 433 | + }, | |
| 434 | + check_serviceman(data,req) { | |
| 435 | + let th = this; | |
| 436 | + getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", { | |
| 437 | + data, | |
| 438 | + isShowLoading:true, | |
| 439 | + success: function (res) { | |
| 440 | + if (res.data.code == 0) { | |
| 441 | + if (res.data.data.length > 1 && !th.data.is_select) { | |
| 442 | + th.setData({ | |
| 443 | + staffNo_arr: res.data.data | |
| 444 | + }) | |
| 445 | + }else{ | |
| 446 | + t_pay.pay(req, th.success, function () { | |
| 447 | + getApp().my_warnning("支付失败", 0, th); | |
| 448 | + th.setData({ | |
| 449 | + is_select:0, | |
| 450 | + focus:true, | |
| 451 | + }) | |
| 452 | + }); | |
| 453 | + } | |
| 454 | + } else { | |
| 455 | + getApp().my_warnning(res.data.msg, 0, th); | |
| 456 | + th.setData({ | |
| 457 | + is_select:0, | |
| 458 | + focus:true, | |
| 459 | + }) | |
| 460 | + } | |
| 461 | + } | |
| 462 | + }) | |
| 324 | 463 | }, |
| 325 | - | |
| 326 | 464 | //返回会员中心 |
| 327 | - back_user:function () { | |
| 465 | + back_user: function () { | |
| 328 | 466 | setTimeout(function () { |
| 329 | - wx.reLaunch({url:"/pages/user/index/index"}); | |
| 330 | - },1000) | |
| 467 | + wx.reLaunch({ | |
| 468 | + url: "/pages/user/index/index" | |
| 469 | + }); | |
| 470 | + }, 1000) | |
| 331 | 471 | }, |
| 332 | - | |
| 472 | + | |
| 333 | 473 | //--支付成功,跳转到等级卡续费页面-- |
| 334 | - success:function () { | |
| 335 | - //调一次就不再调用了 | |
| 336 | - if(getApp().globalData.is_card_back) return false; | |
| 337 | - if(getApp().globalData.plus_buy_back){ | |
| 338 | - //值在这里换 | |
| 339 | - getApp().globalData.is_card_back=1; | |
| 340 | - getApp().globalData.plus_buy_back=0; | |
| 341 | - //返回购物车购买 | |
| 342 | - wx.navigateBack({ delta: 1,}); | |
| 343 | - return false; | |
| 344 | - }else{ | |
| 345 | - var u_url = "/pages/user/cardinfo/cardinfo"; | |
| 346 | - wx.reLaunch({url: u_url}) | |
| 347 | - } | |
| 348 | - | |
| 474 | + success: function () { | |
| 475 | + //调一次就不再调用了 | |
| 476 | + if (getApp().globalData.is_card_back) return false; | |
| 477 | + if (getApp().globalData.plus_buy_back) { | |
| 478 | + //值在这里换 | |
| 479 | + getApp().globalData.is_card_back = 1; | |
| 480 | + getApp().globalData.plus_buy_back = 0; | |
| 481 | + //返回购物车购买 | |
| 482 | + wx.navigateBack({ | |
| 483 | + delta: 1, | |
| 484 | + }); | |
| 485 | + return false; | |
| 486 | + } else { | |
| 487 | + var u_url = "/pages/user/cardinfo/cardinfo"; | |
| 488 | + wx.reLaunch({ | |
| 489 | + url: u_url | |
| 490 | + }) | |
| 491 | + } | |
| 349 | 492 | }, |
| 350 | 493 | |
| 351 | - //--绑定邀请码的输入-- | |
| 352 | - b_input:function (e) { | |
| 353 | - var value=e.detail.value; | |
| 354 | - var name=e.currentTarget.dataset.name; | |
| 355 | - var ob={}; | |
| 356 | - ob[name]=value | |
| 357 | - this.setData(ob); | |
| 358 | - }, | |
| 359 | 494 | |
| 360 | - get_user_plus:async function(){ | |
| 361 | - var user_id=getApp().globalData.user_id; | |
| 362 | - var fuser=null; | |
| 363 | - var user_information =null; | |
| 364 | - var store_id = os.stoid; | |
| 365 | - var that=this; | |
| 366 | - //--获取登记卡邀请信息-- | |
| 367 | - await getApp().request.promiseGet("/api/weshop/usersPlus/get/" + os.stoid + "/" + user_id,{1:1}).then(res=>{ | |
| 368 | - if (res.data.code==0){ | |
| 369 | - fuser=res.data.data; | |
| 370 | - } | |
| 371 | - }) | |
| 372 | - if (!fuser) return false; | |
| 373 | - var r_url = "/api/weshop/plus/vip/mem/list?storeId=" + store_id + "&userId=" + fuser.plus_user_id; | |
| 374 | - //--获取等级卡信息-- | |
| 375 | - await getApp().request.promiseGet(r_url,{1:1}).then(res=>{ | |
| 376 | - if (res.data.code == 0) { | |
| 377 | - user_information = res.data.data[0]; | |
| 378 | - } | |
| 379 | - }) | |
| 380 | - if (user_information){ | |
| 381 | - var now = ut.gettimestamp(); | |
| 382 | - var is_ok = 1; | |
| 383 | - if (user_information['ExpiryDate']) { | |
| 384 | - var str = user_information['ExpiryDate'].replace(/-/g, '/'); | |
| 385 | - var end = new Date(str); | |
| 386 | - end = Date.parse(end) / 1000; | |
| 387 | - if (end < now) { is_ok = 0;} | |
| 388 | - } else { | |
| 495 | + | |
| 496 | + get_user_plus: async function () { | |
| 497 | + var user_id = getApp().globalData.user_id; | |
| 498 | + var fuser = null; | |
| 499 | + var user_information = null; | |
| 500 | + var store_id = os.stoid; | |
| 501 | + var that = this; | |
| 502 | + //--获取登记卡邀请信息-- | |
| 503 | + await getApp().request.promiseGet("/api/weshop/usersPlus/get/" + os.stoid + "/" + user_id, { | |
| 504 | + 1: 1 | |
| 505 | + }).then(res => { | |
| 506 | + if (res.data.code == 0) { | |
| 507 | + fuser = res.data.data; | |
| 508 | + } | |
| 509 | + }) | |
| 510 | + if (!fuser) return false; | |
| 511 | + var r_url = "/api/weshop/plus/vip/mem/list?storeId=" + store_id + "&userId=" + fuser.plus_user_id; | |
| 512 | + //--获取等级卡信息-- | |
| 513 | + await getApp().request.promiseGet(r_url, { | |
| 514 | + 1: 1 | |
| 515 | + }).then(res => { | |
| 516 | + if (res.data.code == 0) { | |
| 517 | + user_information = res.data.data[0]; | |
| 518 | + } | |
| 519 | + }) | |
| 520 | + if (user_information) { | |
| 521 | + var now = ut.gettimestamp(); | |
| 522 | + var is_ok = 1; | |
| 523 | + if (user_information['ExpiryDate']) { | |
| 524 | + var str = user_information['ExpiryDate'].replace(/-/g, '/'); | |
| 525 | + var end = new Date(str); | |
| 526 | + end = Date.parse(end) / 1000; | |
| 527 | + if (end < now) { | |
| 389 | 528 | is_ok = 0; |
| 390 | 529 | } |
| 530 | + } else { | |
| 531 | + is_ok = 0; | |
| 532 | + } | |
| 391 | 533 | |
| 392 | - if (is_ok == 1) { | |
| 393 | - var fir_leader=fuser.plus_user_id | |
| 394 | - that.setData({ def_recommon: user_information.MobileTel, def_serviceman: user_information.StaffNo, is_fengxiang: 1,fir_leader:fir_leader }) | |
| 395 | - //--先判断会员状态-- | |
| 396 | - var user_info = getApp().globalData.userInfo; | |
| 397 | - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 398 | - wx.navigateTo({ url: '/pages/togoin/togoin?first_leader=' + fir_leader, }) | |
| 399 | - return false; | |
| 400 | - } | |
| 534 | + if (is_ok == 1) { | |
| 535 | + var fir_leader = fuser.plus_user_id | |
| 536 | + that.setData({ | |
| 537 | + def_recommon: user_information.MobileTel, | |
| 538 | + def_serviceman: user_information.StaffNo, | |
| 539 | + is_fengxiang: 1, | |
| 540 | + fir_leader: fir_leader | |
| 541 | + }) | |
| 542 | + //--先判断会员状态-- | |
| 543 | + var user_info = getApp().globalData.userInfo; | |
| 544 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 545 | + wx.navigateTo({ | |
| 546 | + url: '/pages/togoin/togoin?first_leader=' + fir_leader, | |
| 547 | + }) | |
| 548 | + return false; | |
| 549 | + } | |
| 401 | 550 | } |
| 402 | - } | |
| 551 | + } | |
| 403 | 552 | }, |
| 404 | - | |
| 405 | - save_th_plus_user:async function(){ | |
| 406 | - var f_user_id=this.data.fir_leader; | |
| 407 | - if (f_user_id){ | |
| 553 | + | |
| 554 | + save_th_plus_user: async function () { | |
| 555 | + var f_user_id = this.data.fir_leader; | |
| 556 | + if (f_user_id) { | |
| 408 | 557 | var user_id = getApp().globalData.user_id; |
| 409 | 558 | var user_plus = null; |
| 410 | - var now=ut.gettimestamp(); | |
| 559 | + var now = ut.gettimestamp(); | |
| 411 | 560 | //--获取登记卡邀请信息-- |
| 412 | - await getApp().request.promiseGet("/api/weshop/usersPlus/get/" + os.stoid + "/" + user_id, { 1: 1 }).then(res => { | |
| 561 | + await getApp().request.promiseGet("/api/weshop/usersPlus/get/" + os.stoid + "/" + user_id, { | |
| 562 | + 1: 1 | |
| 563 | + }).then(res => { | |
| 413 | 564 | if (res.data.code == 0) { |
| 414 | 565 | user_plus = res.data.data; |
| 415 | 566 | } |
| 416 | - }) | |
| 417 | - | |
| 567 | + }) | |
| 568 | + | |
| 418 | 569 | //--如果有值,要更新-- |
| 419 | - if (!user_plus){ | |
| 420 | - getApp().request.post("/api/weshop/usersPlus/save", { | |
| 421 | - data: { store_id: os.stoid, user_id: user_id, plus_user_id: f_user_id, addtime: now }, | |
| 422 | - success: function (res) { } | |
| 423 | - }) | |
| 424 | - }else{ | |
| 425 | - getApp().request.put("/api/weshop/usersPlus/update",{ | |
| 426 | - data: { store_id: os.stoid, user_id: user_id, plus_user_id: f_user_id, edittime: now}, | |
| 427 | - success:function(res){ } | |
| 428 | - }) | |
| 570 | + if (!user_plus) { | |
| 571 | + getApp().request.post("/api/weshop/usersPlus/save", { | |
| 572 | + data: { | |
| 573 | + store_id: os.stoid, | |
| 574 | + user_id: user_id, | |
| 575 | + plus_user_id: f_user_id, | |
| 576 | + addtime: now | |
| 577 | + }, | |
| 578 | + success: function (res) {} | |
| 579 | + }) | |
| 580 | + } else { | |
| 581 | + getApp().request.put("/api/weshop/usersPlus/update", { | |
| 582 | + data: { | |
| 583 | + store_id: os.stoid, | |
| 584 | + user_id: user_id, | |
| 585 | + plus_user_id: f_user_id, | |
| 586 | + edittime: now | |
| 587 | + }, | |
| 588 | + success: function (res) {} | |
| 589 | + }) | |
| 429 | 590 | } |
| 430 | - } | |
| 591 | + } | |
| 431 | 592 | } |
| 432 | 593 | }) |
| 433 | 594 | \ No newline at end of file | ... | ... |
pages/user/plus/plus.wxml
| 1 | 1 | <block wx:if="{{is_show && (fir_leader?is_fengxiang:1)}}"> |
| 2 | -<!-- 我的会员背景图片 --> | |
| 3 | -<import src="../../../utils/wxParse/wxParse.wxml"></import> | |
| 4 | -<view> | |
| 5 | - <image class="Member_bk" src="{{url}}/miniapp/images/plus/page_bk.png"></image> | |
| 6 | -</view> | |
| 7 | -<view class="plus"> | |
| 8 | - <!-- 开通会员模块 --> | |
| 2 | + <!-- 我的会员背景图片 --> | |
| 3 | + <import src="../../../utils/wxParse/wxParse.wxml"></import> | |
| 4 | + <view> | |
| 5 | + <image class="Member_bk" src="{{url}}/miniapp/images/plus/page_bk.png"></image> | |
| 6 | + </view> | |
| 7 | + <view class="plus"> | |
| 8 | + <!-- 开通会员模块 --> | |
| 9 | 9 | |
| 10 | - <block wx:if="{{is_plusCard}}"> | |
| 11 | - <view class="Opening_plus"> | |
| 12 | - <view class="Opening_bk"> | |
| 13 | - <image src="{{url}}/miniapp/images/plus/card_bk.png"></image> | |
| 14 | - </view> | |
| 15 | - <view class="swiper"> | |
| 10 | + <block wx:if="{{is_plusCard}}"> | |
| 11 | + <view class="Opening_plus"> | |
| 12 | + <view class="Opening_bk"> | |
| 13 | + <image src="{{url}}/miniapp/images/plus/card_bk.png"></image> | |
| 14 | + </view> | |
| 15 | + <view class="swiper"> | |
| 16 | 16 | <!-- 未开通会员swiper-item --> |
| 17 | 17 | <swiper current="{{currentId}}" current-item-id="{{currentId}}" next-margin="60rpx" previous-margin="60rpx" bindchange="swiperChange"> |
| 18 | 18 | <swiper-item class="flex" item-id="{{index}}" data-item-id="{{index}}" wx:for="{{is_plusCard}}"> |
| 19 | 19 | |
| 20 | - <view class="Membership {{currentId==index?'enlarge':''}}" style=" background-image: url({{item.CardImg}});color:{{item.CardColor}}"> | |
| 20 | + <view class="Membership {{currentId==index?'enlarge':''}}" style=" background-image: url({{item.CardImg}});color:{{item.CardColor}}"> | |
| 21 | 21 | <view class="flex-space-between Membership_go"> |
| 22 | 22 | <view> |
| 23 | 23 | <view class="fs36">{{item.CardName}}</view> |
| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 | |
| 33 | 33 | <view class="flex-vertical fs24" style="overflow:hidden"> |
| 34 | 34 | |
| 35 | - <view class="Member"style="background-image:url('{{url}}/miniapp/images/plus/privilege_o.png');filter: drop-shadow( 40rpx 0rpx 0rpx {{item.CardColor}});"></view> | |
| 35 | + <view class="Member" style="background-image:url('{{url}}/miniapp/images/plus/privilege_o.png');filter: drop-shadow( 40rpx 0rpx 0rpx {{item.CardColor}});"></view> | |
| 36 | 36 | <view style="margin-left:5rpx;white-space: nowrap;">按去年用户消费计算,开卡后一年预计省¥{{item.free}}元 |
| 37 | 37 | </view> |
| 38 | 38 | </view> |
| ... | ... | @@ -41,76 +41,80 @@ |
| 41 | 41 | |
| 42 | 42 | </swiper-item> |
| 43 | 43 | </swiper> |
| 44 | + </view> | |
| 44 | 45 | </view> |
| 45 | - </view> | |
| 46 | - </block> | |
| 46 | + </block> | |
| 47 | 47 | |
| 48 | - <!-- 会员礼遇 --> | |
| 49 | - <view class="Courtesy"> | |
| 48 | + <!-- 会员礼遇 --> | |
| 49 | + <view class="Courtesy"> | |
| 50 | + | |
| 51 | + <!-- 标题 --> | |
| 52 | + <view class="flex-center" style="width:100%;height:200rpx;"> | |
| 53 | + <view> | |
| 54 | + <view class="Courtesy_title flex-center fs36">开通PLUS会员尊享礼遇 | |
| 55 | + </view> | |
| 50 | 56 | |
| 51 | - <!-- 标题 --> | |
| 52 | - <view class="flex-center" style="width:100%;height:200rpx;"> | |
| 53 | - <view> | |
| 54 | - <view class="Courtesy_title flex-center fs36">开通PLUS会员尊享礼遇 | |
| 55 | - </view> | |
| 56 | - | |
| 57 | 57 | |
| 58 | 58 | |
| 59 | - <view class="flex-center"> | |
| 60 | - <image class="Courtesy_image" src="{{url}}/miniapp/images/plus/Courtesy.png"></image> | |
| 59 | + <view class="flex-center"> | |
| 60 | + <image class="Courtesy_image" src="{{url}}/miniapp/images/plus/Courtesy.png"></image> | |
| 61 | 61 | |
| 62 | - | |
| 63 | - <view class="Courtesy_can fs24">PLUS会员可享受以下特权 | |
| 62 | + | |
| 63 | + <view class="Courtesy_can fs24">PLUS会员可享受以下特权 | |
| 64 | + </view> | |
| 65 | + | |
| 66 | + <image class="Courtesy_image" src="{{url}}/miniapp/images/plus/Courtesy.png"></image> | |
| 64 | 67 | </view> |
| 68 | + </view> | |
| 69 | + </view> | |
| 70 | + | |
| 65 | 71 | |
| 66 | - <image class="Courtesy_image" src="{{url}}/miniapp/images/plus/Courtesy.png"></image> | |
| 72 | + | |
| 73 | + <!-- 会员权益内容 --> | |
| 74 | + <view class="Courtesy_comment " style="padding:0 20rpx" wx:if="{{is_card_rule!=null&&is_card_rule!=''}}"> | |
| 75 | + <view class="wxParse"> | |
| 76 | + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> | |
| 67 | 77 | </view> |
| 68 | 78 | </view> |
| 69 | 79 | </view> |
| 70 | 80 | |
| 71 | - <!-- 会员权益内容 --> | |
| 72 | - <view class="Courtesy_comment " style="padding:0 20rpx" wx:if="{{is_card_rule!=null&&is_card_rule!=''}}"> | |
| 73 | - <view class="wxParse"> | |
| 74 | - <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> | |
| 75 | - </view> | |
| 76 | - </view> | |
| 77 | - </view> | |
| 81 | + <!-- 好物推荐 --> | |
| 82 | + <!-- 好物推荐 --> | |
| 83 | + <view class="title"> | |
| 84 | + <!-- 标题 --> | |
| 85 | + <view> | |
| 86 | + <!-- 中文名标题 --> | |
| 87 | + <view class="China flex-level"> | |
| 88 | + <view class="line flex-vertical"> | |
| 89 | + <view class="one"></view> | |
| 90 | + <view class="two"></view> | |
| 91 | + <view class="three"></view> | |
| 92 | + </view> | |
| 78 | 93 | |
| 79 | - <!-- 好物推荐 --> | |
| 80 | - <!-- 好物推荐 --> | |
| 81 | - <view class="title"> | |
| 82 | - <!-- 标题 --> | |
| 83 | - <view> | |
| 84 | - <!-- 中文名标题 --> | |
| 85 | - <view class="China flex-level"> | |
| 86 | - <view class="line flex-vertical"> | |
| 87 | - <view class="one"></view><view class="two"></view><view class="three"></view> | |
| 88 | - </view> | |
| 94 | + <view class="Recommend flex-level" bindtap="requestList">好物推荐</view> | |
| 89 | 95 | |
| 90 | - <view class="Recommend flex-level" bindtap="requestList">好物推荐</view> | |
| 96 | + <view class="line flex-vertical"> | |
| 97 | + <view class="three"></view> | |
| 98 | + <view class="two"></view> | |
| 99 | + <view class="one"></view> | |
| 100 | + </view> | |
| 101 | + </view> | |
| 91 | 102 | |
| 92 | - <view class="line flex-vertical"> | |
| 93 | - <view class="three"></view> | |
| 94 | - <view class="two"></view> | |
| 95 | - <view class="one"></view> | |
| 103 | + <!-- 英文标题 --> | |
| 104 | + <view class="english flex-center"> | |
| 105 | + <view class="silk"></view> | |
| 106 | + <view class="esh five-level-word">GOOD HOT THING</view> | |
| 107 | + <view class="silk"></view> | |
| 96 | 108 | </view> |
| 97 | - </view> | |
| 98 | 109 | |
| 99 | - <!-- 英文标题 --> | |
| 100 | - <view class="english flex-center"> | |
| 101 | - <view class="silk"></view> | |
| 102 | - <view class="esh five-level-word">GOOD HOT THING</view> | |
| 103 | - <view class="silk"></view> | |
| 104 | 110 | </view> |
| 111 | + <!-- 商品列表组件 --> | |
| 112 | + <goods_recommend id="goods_list"></goods_recommend> | |
| 113 | + <!-- 商品列表 --> | |
| 105 | 114 | |
| 106 | 115 | </view> |
| 107 | - <!-- 商品列表组件 --> | |
| 108 | - <goods_recommend id="goods_list"></goods_recommend> | |
| 109 | - <!-- 商品列表 --> | |
| 110 | 116 | |
| 111 | 117 | </view> |
| 112 | - | |
| 113 | -</view> | |
| 114 | 118 | </block> |
| 115 | 119 | |
| 116 | 120 | <!-- 开通会员弹窗 --> |
| ... | ... | @@ -127,32 +131,55 @@ |
| 127 | 131 | <view class="fs36 flex-level perfect">请完善下面信息</view> |
| 128 | 132 | <view class="fillin"> |
| 129 | 133 | <!-- 输入推荐人手机号 --> |
| 130 | - <view class="flex ai_and Enter_phone" wx:if="{{isyaoqingma}}" > | |
| 134 | + <view class="flex ai_and Enter_phone" wx:if="{{isyaoqingma}}"> | |
| 131 | 135 | <image class="phone_image" src="{{url}}/miniapp/images/plus/Invitation_code.png"></image> |
| 132 | 136 | <view class="phone"> |
| 133 | - <input bindinput="b_input" data-name="inp_recommon" class="fs30" placeholder="请输入邀请码(推荐人手机号)" type="number" maxlength="20" /> | |
| 137 | + <input bindinput="b_input" bindconfirm="buy_card" data-name="inp_recommon" class="fs30" placeholder="请输入邀请码(推荐人手机号)" type="number" maxlength="20" /> | |
| 134 | 138 | </view> |
| 135 | 139 | </view> |
| 136 | 140 | <!-- 输入营业员 --> |
| 137 | 141 | <view class="flex ai_and enter_SalesClerk" wx:if="{{is_salesman}}"> |
| 138 | 142 | <image class="SalesClerk_image" src="{{url}}/miniapp/images/plus/Sales_Clerk.png"></image> |
| 139 | 143 | <view class="SalesClerk"> |
| 140 | - <input bindinput="b_input" class="fs30" data-name="inp_serviceman" placeholder="请输入营业员" maxlength="30" /> | |
| 144 | + <input bindinput="b_input" bindconfirm="buy_card" class="fs30" focus="{{focus}}" data-name="inp_serviceman" value="{{inp_serviceman}}" placeholder="请输入营业员" maxlength="30" /> | |
| 141 | 145 | </view> |
| 142 | 146 | </view> |
| 143 | 147 | <!-- 确认购买 --> |
| 144 | 148 | <view class="flex-center" bindtap="buy_card"> |
| 145 | - <view class="flex-center purchase" | |
| 146 | - style="background-image:url({{url}}/miniapp/images/plus/purchase_Bk.png);"> | |
| 149 | + <view class="flex-center purchase" style="background-image:url({{url}}/miniapp/images/plus/purchase_Bk.png);"> | |
| 147 | 150 | 确认购买 |
| 148 | 151 | </view> |
| 149 | 152 | </view> |
| 150 | 153 | </view> |
| 151 | 154 | </view> |
| 155 | + | |
| 156 | + | |
| 152 | 157 | <view class="flex-level"> |
| 153 | 158 | <image class="purchaseClose" bindtap="OpeningClose" src="{{url}}/miniapp/images/plus/Close.png"></image> |
| 154 | 159 | </view> |
| 155 | 160 | </view> |
| 156 | 161 | |
| 157 | 162 | </view> |
| 163 | + | |
| 164 | +<view class="Disgraceful" wx:if="{{staffNo_arr.length>0}}"> | |
| 165 | + <view bindtap="OpeningClose"></view> | |
| 166 | + <view class="dialog_body"> | |
| 167 | + <view style="background-color: #fff;"> | |
| 168 | + <view class="dialog_choose"> | |
| 169 | + <text>请选择营业员</text> | |
| 170 | + <text class="dialog_close" bindtap="dialog_close">X</text> | |
| 171 | + </view> | |
| 172 | + <view class="dialog_name"> | |
| 173 | + <text class="w50">编号</text> | |
| 174 | + <text class="w50">姓名</text> | |
| 175 | + </view> | |
| 176 | + </view> | |
| 177 | + <view class="dialog_name" bindtap="select_serviceman" data-StaffNo="{{item.StaffNo}}" wx:for="{{staffNo_arr}}" wx:key="id" hover-class="weui-active" hover-start-time="200" style="background-color: #fff;"> | |
| 178 | + <view class="w50">{{item.StaffNo}}</view> | |
| 179 | + <view class="w50">{{item.StaffName}}</view> | |
| 180 | + </view> | |
| 181 | + </view> | |
| 182 | +</view> | |
| 183 | + | |
| 184 | + | |
| 158 | 185 | <warn id="warn"></warn> |
| 159 | 186 | \ No newline at end of file | ... | ... |
pages/user/plus/plus.wxss
| ... | ... | @@ -16,7 +16,48 @@ page { |
| 16 | 16 | width: 100%; |
| 17 | 17 | height: 100%; |
| 18 | 18 | } |
| 19 | - | |
| 19 | +.dialogful{ | |
| 20 | + position: fixed; | |
| 21 | + left: 0; | |
| 22 | + top: 15%; | |
| 23 | + right: 0; | |
| 24 | + bottom: 0; | |
| 25 | + z-index: 11; | |
| 26 | + background: rgba(0, 0, 0, 0.6); | |
| 27 | + width: 100%; | |
| 28 | + height: 100%; | |
| 29 | +} | |
| 30 | +.dialog_body { | |
| 31 | + margin:30% auto; | |
| 32 | + width: 660rpx; | |
| 33 | +} | |
| 34 | +.dialog_close{ | |
| 35 | + float: right; | |
| 36 | + width: 50rpx; | |
| 37 | + height: 50rpx; | |
| 38 | + text-align: right; | |
| 39 | +} | |
| 40 | +.dialog_choose{ | |
| 41 | + position: relative; | |
| 42 | + padding: 20rpx; | |
| 43 | + border-bottom: 1rpx solid #eee; | |
| 44 | +} | |
| 45 | +.dialog_name, | |
| 46 | +.dialog_content { | |
| 47 | + padding: 10rpx; | |
| 48 | + display: flex; | |
| 49 | + border-bottom: 1rpx solid #f7f7f7; | |
| 50 | + justify-content: space-around; | |
| 51 | + | |
| 52 | +} | |
| 53 | +.weui-active{ | |
| 54 | + opacity: 0.9; | |
| 55 | + background: #f7f7f7; | |
| 56 | +} | |
| 57 | +.w50 { | |
| 58 | + width: 50%; | |
| 59 | + text-align: center; | |
| 60 | +} | |
| 20 | 61 | .Opening_bk image { |
| 21 | 62 | position: absolute; |
| 22 | 63 | z-index: 2; | ... | ... |
pages/user/user_spsy/user_spsy.js
| 1 | 1 | // pages/user/usersy/usersy.js |
| 2 | -var e = getApp(),os = e.globalData.setting; | |
| 3 | -var utils = require('../../../utils/util.js'); | |
| 2 | +var e = getApp(), | |
| 3 | + os = e.globalData.setting; | |
| 4 | +var ut = require('../../../utils/util'); | |
| 4 | 5 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
| 5 | 6 | |
| 6 | 7 | Page({ |
| ... | ... | @@ -8,27 +9,102 @@ Page({ |
| 8 | 9 | * 页面的初始数据 |
| 9 | 10 | */ |
| 10 | 11 | data: { |
| 11 | - qr_code_object:{val:"12121",content:"请将二维码展示给核销员,取货更快捷!"}, | |
| 12 | - xp_list:null, | |
| 13 | - iurl:os.imghost, | |
| 12 | + qr_code_object: {}, | |
| 13 | + xp_list: null, | |
| 14 | + iurl: os.imghost, | |
| 15 | + page: 1, | |
| 16 | + isLoading: 0, | |
| 17 | + no_more: 0, | |
| 18 | + is_use: 0 //领取状态 | |
| 14 | 19 | }, |
| 15 | 20 | /** |
| 16 | 21 | * 生命周期函数--监听页面加载 |
| 17 | 22 | */ |
| 18 | - onLoad: function (options) { }, | |
| 23 | + onLoad: function (options) { | |
| 24 | + var h_pic = options.img; | |
| 25 | + if (h_pic.indexOf("http") == -1) { | |
| 26 | + h_pic = os.imghost + h_pic; | |
| 27 | + } | |
| 28 | + var FormId = options.FormId; | |
| 29 | + var GradeId = options.gradeId; | |
| 30 | + var now = ut.gettimestamp(); | |
| 31 | + this.setData({ | |
| 32 | + h_pic, | |
| 33 | + GradeId, | |
| 34 | + FormId, | |
| 35 | + now, | |
| 36 | + }); | |
| 37 | + this.requestData() | |
| 38 | + this.getQrCode(FormId,GradeId) | |
| 39 | + }, | |
| 19 | 40 | /** |
| 20 | 41 | * 生命周期函数--监听页面显示 |
| 21 | 42 | */ |
| 22 | - onShow:async function () { | |
| 23 | - var th = this; | |
| 24 | - var xp_list=null; | |
| 25 | - //--获取列表-- | |
| 26 | - await getApp().request.promiseGet("http://172.20.3.102:8080/api/user_qy/xp_list", { | |
| 27 | - 1: 1 | |
| 28 | - }).then(res => { | |
| 29 | - xp_list = res.data; | |
| 30 | - }) | |
| 31 | - th.setData({xp_list:xp_list}); | |
| 43 | + onShow: function () { | |
| 44 | + | |
| 45 | + | |
| 46 | + }, | |
| 47 | + async getQrCode(FormId,GradeId) { | |
| 48 | + const res = await getApp().request.promiseGet("/api/weshop/users/grade/wares/code/get", { | |
| 49 | + data: { | |
| 50 | + privilegeId: FormId, | |
| 51 | + storeId: os.stoid, | |
| 52 | + GradeId:GradeId, | |
| 53 | + userId: getApp().globalData.user_id, | |
| 54 | + }, | |
| 55 | + }); | |
| 56 | + if (res.data.code == 0 && res.data.data) { | |
| 57 | + if (res.data.data.VerifyDate || res.data.data.VerifyNo) { | |
| 58 | + this.setData({ | |
| 59 | + is_use: 1 | |
| 60 | + }) | |
| 61 | + } else { | |
| 62 | + this.setData({ | |
| 63 | + qr_code_object: res.data.data, | |
| 64 | + }) | |
| 65 | + } | |
| 66 | + } | |
| 67 | + }, | |
| 68 | + async requestData() { | |
| 69 | + if (this.data.no_more) return false; | |
| 70 | + if (this.data.isLoading) return false; | |
| 71 | + this.data.isLoading = 1; | |
| 72 | + let { | |
| 73 | + GradeId, | |
| 74 | + FormId, | |
| 75 | + page, | |
| 76 | + xp_list | |
| 77 | + } = this.data; | |
| 78 | + let req_data = { | |
| 79 | + page, | |
| 80 | + GradeId, | |
| 81 | + FormId, | |
| 82 | + storeId: os.stoid, | |
| 83 | + userId: getApp().globalData.user_id, | |
| 84 | + } | |
| 85 | + const res = await getApp().request.promiseGet("/api/weshop/users/grade/wechat/wares/page", { | |
| 86 | + data: req_data, | |
| 87 | + isShowLoading:true, | |
| 88 | + }); | |
| 89 | + | |
| 90 | + if (ut.ajax_ok(res)) { | |
| 91 | + if (res.data.data.page > 1) { | |
| 92 | + xp_list = xp_list.concat(res.data.data.pageData); | |
| 93 | + } else { | |
| 94 | + xp_list = res.data.data.pageData; | |
| 95 | + } | |
| 96 | + this.setData({ | |
| 97 | + xp_list, | |
| 98 | + isLoading: 0, | |
| 99 | + no_more: 0, | |
| 100 | + }) | |
| 101 | + } else { | |
| 102 | + this.setData({ | |
| 103 | + xp_list: [], | |
| 104 | + isLoading: 0, | |
| 105 | + no_more: 0, | |
| 106 | + }) | |
| 107 | + } | |
| 32 | 108 | }, |
| 33 | 109 | /** |
| 34 | 110 | * 页面上拉触底事件的处理函数 |
| ... | ... | @@ -46,26 +122,43 @@ Page({ |
| 46 | 122 | |
| 47 | 123 | |
| 48 | 124 | /*-- 打开服务项目 --*/ |
| 49 | - open_xp:function (e) { | |
| 50 | - var th=this; | |
| 125 | + open_xp: function (e) { | |
| 126 | + var th = this; | |
| 51 | 127 | var qc_com = this.selectComponent("#qc_com"); //组件的id |
| 52 | 128 | qc_com.open(th.data.qr_code_object) |
| 53 | 129 | }, |
| 54 | 130 | |
| 55 | 131 | //--领取商品-- |
| 56 | - get_xp:function (e) { | |
| 57 | - var th=this,index=e.currentTarget.dataset.ind; | |
| 58 | - getApp().request.post("http://172.20.3.102:8080/api/user_qy/get_gd",{ | |
| 59 | - data:{}, | |
| 60 | - success:function (e) { | |
| 61 | - if(e.data.code==0){ | |
| 62 | - var txt="xp_list["+index+"].is_get" | |
| 63 | - var obj={};obj[txt]=1; | |
| 64 | - th.setData(obj); | |
| 65 | - } | |
| 66 | - } | |
| 67 | - }) | |
| 68 | - } | |
| 69 | - | |
| 132 | + async show_hxm(e) { | |
| 133 | + setTimeout(() => { | |
| 134 | + let qr_code_object = this.data.qr_code_object; | |
| 135 | + if (qr_code_object !== {}) { | |
| 136 | + let { | |
| 137 | + WriteOffCode: val, | |
| 138 | + BeginDate, | |
| 139 | + EndDate | |
| 140 | + } = qr_code_object; | |
| 141 | + let qr_code = this.selectComponent("#qc_com"); | |
| 142 | + let obj = { | |
| 143 | + val, | |
| 144 | + content: "当前核销码仅限当面使用", | |
| 145 | + now: BeginDate, | |
| 146 | + validay: EndDate, | |
| 147 | + is_quan: 0, | |
| 148 | + is_fw:0, | |
| 149 | + }; | |
| 150 | + qr_code.open(obj) | |
| 151 | + } else { | |
| 152 | + wx.showToast({ | |
| 153 | + title: "获取失败", | |
| 154 | + icon: 'none', | |
| 155 | + duration: 1000 | |
| 156 | + }) | |
| 157 | + } | |
| 158 | + }, 500); | |
| 159 | + }, | |
| 70 | 160 | |
| 161 | + close: function () { | |
| 162 | + this.getQrCode(this.data.FormId) | |
| 163 | + } | |
| 71 | 164 | }) |
| 72 | 165 | \ No newline at end of file | ... | ... |
pages/user/user_spsy/user_spsy.json
pages/user/user_spsy/user_spsy.wxml
| 1 | -<view class="xc-page" > | |
| 2 | - <view class="items" wx:for="{{xp_list}}"> | |
| 3 | - <view class="rel"> | |
| 4 | - <image class="new-product" src="{{iurl+item.img}}"></image> | |
| 5 | - <image wx:if="{{item.is_get}}" class="abs zimg" src="{{iurl}}/miniapp//images/userqy/isgeted.png"></image> | |
| 6 | - </view> | |
| 7 | - | |
| 8 | - <view class="product-explain three-level-word">{{item.goods_name}}</view> | |
| 9 | - <view class="xc-bottom flex"> | |
| 10 | - <view class="xc-goods-money three-level-word ">¥ | |
| 11 | - </view> | |
| 12 | - <view class="xc-money"> | |
| 13 | - {{item.goods_price}} | |
| 14 | - </view> | |
| 15 | - <view class="xc-clike-get t-c white" data-ind="{{index}}" bindtap="open_xp" wx:if="{{item.is_get}}">立即使用</view> | |
| 16 | - <view class="xc-clike-get t-c white" data-ind="{{index}}" bindtap="get_xp" wx:else>免费领取</view> | |
| 17 | - </view> | |
| 18 | -</view> | |
| 1 | +<view> | |
| 2 | + <image class="xc-coupon-img" src="{{h_pic}}"></image> | |
| 3 | + <view class="flex pd20 jc_sb fs28"> | |
| 4 | + <view>单品名称</view> | |
| 5 | + <view>数量</view> | |
| 6 | + </view> | |
| 7 | + <view class="flex pd20 jc_sb fs26" wx:for="{{xp_list}}" wx:key="id"> | |
| 8 | + <view>{{item.PrivilegeName}}</view> | |
| 9 | + <view class="c-a4">x{{item.SecondNo}}</view> | |
| 10 | + </view> | |
| 11 | + <view class="btn-container"> | |
| 12 | + <!-- <view wx:if="{{details.isget}}" data-type="1" class="btn" style="background-color:#aaa;color: #fff"> | |
| 13 | + 已使用{{list[0].freebh}} | |
| 14 | + </view> --> | |
| 15 | + <view wx:if="{{is_use}}" class="btn1">已使用</view> | |
| 16 | + <view wx:else bindtap="show_hxm" data-type="1" class="btn">立即使用</view> | |
| 17 | + <!-- <view bindtap="right_use" class="btn">立即使用</view></view> --> | |
| 18 | + </view> | |
| 19 | 19 | </view> |
| 20 | 20 | |
| 21 | 21 | <!-- 弹出框扫描 --> |
| 22 | -<qr_code id="qc_com"></qr_code> | |
| 23 | - | |
| 24 | - | |
| 25 | - | |
| 26 | - | |
| 27 | - | |
| 28 | - | |
| 22 | +<qr_code id="qc_com" bindclose="close"></qr_code> | |
| 29 | 23 | \ No newline at end of file | ... | ... |
pages/user/user_spsy/user_spsy.wxss
| ... | ... | @@ -3,66 +3,34 @@ page{ |
| 3 | 3 | height: 100%; |
| 4 | 4 | background:#f4f5fa; |
| 5 | 5 | } |
| 6 | -.xc-page{ | |
| 7 | - width: 100%; | |
| 8 | - height: 100%; | |
| 9 | - background: #f4f5fa; | |
| 10 | -} | |
| 11 | -.xc-page .items{ | |
| 12 | - display: inline-block; | |
| 13 | - width: 345rpx; | |
| 14 | - height:450rpx; | |
| 15 | - margin-left:20rpx; | |
| 16 | - margin-top: 25rpx; | |
| 17 | - border-radius: 15rpx; | |
| 18 | - background:#fff; | |
| 19 | -} | |
| 20 | - | |
| 21 | -.xc-page .items .zimg{ | |
| 22 | - width: 120rpx; | |
| 23 | - height: 120rpx; | |
| 24 | - left:50%; top:50%; | |
| 25 | - margin-left: -60rpx; margin-top: -60rpx; | |
| 26 | -} | |
| 27 | - | |
| 28 | 6 | |
| 29 | -.new-product{ | |
| 30 | - width:345rpx; | |
| 31 | - height:325rpx; | |
| 32 | - border-radius:15rpx 15rpx 0 0; | |
| 33 | -} | |
| 34 | -.product-explain{ | |
| 35 | - width: 90%; | |
| 36 | - word-break:break-all; | |
| 37 | - height: 40rpx; | |
| 38 | - margin-left:15rpx; | |
| 39 | - | |
| 40 | -} | |
| 41 | -.xc-bottom{ | |
| 42 | - margin-top: 13rpx; | |
| 7 | +.xc-coupon-img{ | |
| 43 | 8 | width: 100%; |
| 44 | - margin-left: 15rpx; | |
| 9 | + height: 330rpx; | |
| 10 | +} | |
| 11 | +.btn-container { | |
| 12 | + position: fixed; | |
| 13 | + left: 0; | |
| 14 | + bottom: 0; | |
| 15 | + width: 100%; | |
| 16 | + /* padding: 20rpx 30rpx; */ | |
| 17 | + box-sizing: border-box; | |
| 18 | + background-color: white; | |
| 19 | + border-top: 2rpx solid #f2f2f2; | |
| 20 | + z-index: 1; | |
| 45 | 21 | } |
| 46 | 22 | |
| 47 | -.xc-bottom .xc-goods-money{ | |
| 48 | -color: #ca4e59; | |
| 49 | - padding-top: 12rpx; | |
| 50 | -} | |
| 51 | -.xc-bottom .xc-money{ | |
| 52 | - color: #ca4e59; | |
| 53 | - font-size: 40rpx; | |
| 54 | - height: 100%; | |
| 55 | - line-height:50rpx | |
| 23 | +.btn { | |
| 24 | + background-color: #FF6768; | |
| 25 | + color: white; | |
| 26 | + padding: 26rpx; | |
| 27 | + text-align: center; | |
| 28 | + /* border-radius: 8rpx; */ | |
| 29 | +} | |
| 30 | +.btn1 { | |
| 31 | + background-color: #ccc; | |
| 32 | + color: white; | |
| 33 | + padding: 26rpx; | |
| 34 | + text-align: center; | |
| 35 | + /* border-radius: 8rpx; */ | |
| 56 | 36 | } |
| 57 | - | |
| 58 | -.xc-clike-get{ | |
| 59 | - width: 120rpx; | |
| 60 | - height: 36rpx; | |
| 61 | - border-radius: 20rpx; | |
| 62 | - background: #ca4e59; | |
| 63 | - line-height:28rpx; | |
| 64 | - font-size:27rpx; | |
| 65 | - margin-left: 120rpx; | |
| 66 | -padding-top: 10rpx | |
| 67 | -} | |
| 68 | - | ... | ... |
pages/user/userqy/userqy.js
| ... | ... | @@ -187,7 +187,9 @@ Page({ |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | var url=e.currentTarget.dataset.img; |
| 190 | - | |
| 190 | + if(!url || url==""){ | |
| 191 | + url=`/public/upload/userqy/quanbg.jpg` | |
| 192 | + } | |
| 191 | 193 | switch (no) { |
| 192 | 194 | case "01": |
| 193 | 195 | getApp().goto("/packageB/pages/user/user_coupon/user_coupon?img=" |
| ... | ... | @@ -197,7 +199,7 @@ Page({ |
| 197 | 199 | getApp().goto("/pages/user/user_fw/user_fw?gradeId="+th.data.gradeId+"&FormId="+item.Id); |
| 198 | 200 | break; |
| 199 | 201 | case "03": |
| 200 | - getApp().goto("/pages/user/user_spsy/user_spsy"); | |
| 202 | + getApp().goto("/pages/user/user_spsy/user_spsy?img="+url+"&gradeId="+th.data.gradeId+"&FormId="+item.Id); | |
| 201 | 203 | break; |
| 202 | 204 | case "10": |
| 203 | 205 | getApp().request.get("/api/weshop/users/grade/vipprivilegelist/other/get",{ | ... | ... |
pages/user/userqy/userqy.wxml
| ... | ... | @@ -88,12 +88,13 @@ |
| 88 | 88 | </view> |
| 89 | 89 | </view> |
| 90 | 90 | |
| 91 | + | |
| 91 | 92 | <view class="project-frame"> |
| 92 | 93 | <view class="item t-c" wx:for="{{qy_list}}" data-no="{{item.PrivilegeType}}" |
| 93 | 94 | data-img="{{item.PrivilegeImageUrl}}" |
| 94 | 95 | bindtap="go_url" data-ind="{{index}}" data-name='{{item.PrivilegeName}}' > |
| 95 | 96 | <image class="xc-project-img {{item.ishas==1?'':'img_gray'}} " src="{{item.PrivilegeICOUrl}}"></image> |
| 96 | - <view class="three-level-word xc-project-word">{{item.PrivilegeName}}</view> | |
| 97 | + <view class="three-level-word xc-project-word ellipsis-1">{{item.PrivilegeName}}</view> | |
| 97 | 98 | </view> |
| 98 | 99 | </view> |
| 99 | 100 | </view> | ... | ... |
utils/filter.wxs
| ... | ... | @@ -143,6 +143,10 @@ var filters = { |
| 143 | 143 | return val / 100; |
| 144 | 144 | }, |
| 145 | 145 | |
| 146 | + div100: function(val) { | |
| 147 | + return val / 100; | |
| 148 | + }, | |
| 149 | + | |
| 146 | 150 | // 计算百分比, 不带百分号 |
| 147 | 151 | percent: function(num1, num2) { |
| 148 | 152 | // console.log('百分比',Math.round(num1/num2 * 10000) / 100); |
| ... | ... | @@ -188,5 +192,6 @@ module.exports = { |
| 188 | 192 | difference: filters.difference, |
| 189 | 193 | multiply: filters.multiply, |
| 190 | 194 | price: filters.price, |
| 195 | + div100: filters.div100, | |
| 191 | 196 | JSONStringify: filters.JSONStringify, |
| 192 | 197 | } |
| 193 | 198 | \ No newline at end of file | ... | ... |