diff --git a/app.js b/app.js
index fd71b47..405e923 100644
--- a/app.js
+++ b/app.js
@@ -83,7 +83,7 @@ App({
if(option) this.globalData.scene=option.scene;
console.log(option,'登陆场景');
- wx.hideTabBar();
+ // wx.hideTabBar();
this.initExt();
// this.overShare()
@@ -250,7 +250,9 @@ App({
//首页的第一次登录
getUserFir(t) {
var s = this;
- if (o.isAuth()) "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser); else {
+ if (o.isAuth()) {
+ "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser);
+ } else {
if (!o.isAuth()) return o.wxLogin_fir(t);
if (null == s.globalData.userInfo) {
return o.wxLogin_fir(t);
diff --git a/components/diy_advertising/diy_advertising.wxml b/components/diy_advertising/diy_advertising.wxml
index 89e5931..9ef022d 100644
--- a/components/diy_advertising/diy_advertising.wxml
+++ b/components/diy_advertising/diy_advertising.wxml
@@ -1,27 +1,35 @@
-
-
-
-
-
- 建议宽度640
-
-
-
+
+
+
+
+
+ 建议宽度640
+
+
+
+
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
@@ -34,16 +42,24 @@
建议宽度640
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
-
@@ -62,13 +78,30 @@
300*300
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -80,8 +113,7 @@
-
+
@@ -90,8 +122,29 @@
200*200
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -100,8 +153,29 @@
200*200
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -118,12 +192,21 @@
300*300
- >
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -133,13 +216,29 @@
300*150
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -149,12 +248,29 @@
300*150
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -171,13 +287,28 @@
200*200
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -186,13 +317,28 @@
400*200
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -204,13 +350,28 @@
400*200
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -219,13 +380,28 @@
200*200
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -241,13 +417,28 @@
300*150
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -257,12 +448,27 @@
300*300
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -275,13 +481,28 @@
300*300
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -290,13 +511,28 @@
300*150
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -314,13 +550,28 @@
200*200
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -329,13 +580,28 @@
200*200
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -347,13 +613,29 @@
200*200
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -363,13 +645,22 @@
200*200
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
@@ -382,13 +673,21 @@
200*420
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -401,34 +700,36 @@
-
-
-
+
+
-
-
-
- {{item.title}}
-
-
+
+
+
+
+ {{item.title}}
+
+
+
-
-
-
+
+
+
+
{{item.title}}
-
-
-
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+
-
-
-
-
-
+
\ No newline at end of file
diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js
index 5682cc2..9b8746d 100644
--- a/components/diy_goodsGroup/diy_goodsGroup.js
+++ b/components/diy_goodsGroup/diy_goodsGroup.js
@@ -14,7 +14,14 @@ Component({
type: Object,
value: null,
},
-
+ sticky: {
+ type: Number,
+ value: 0,
+ },
+ container: {
+ type: Function,
+ value: null,
+ },
},
data: {
// 这里是一些组件内部数据
@@ -47,14 +54,17 @@ Component({
swiper_hei: 0,
title_class: "",
is_no_plus: 1,
+ container: null,
},
- ready: function () { },
-
lifetimes: {
+ ready: function () {
+ this.setData({
+ container: () => wx.createSelectorQuery().select('#container')
+ })
+ },
+
attached: function () {
-
-
//要兼容性的写法,因为有些商家都还未更新商品分组的最新的效果~~3.0公众号的html页面所以不用兼容写法
var nav_item = this.data.object;
var nav_list = this.data.object.nav_list;
diff --git a/components/diy_goodsGroup/diy_goodsGroup.json b/components/diy_goodsGroup/diy_goodsGroup.json
index c886449..184585e 100644
--- a/components/diy_goodsGroup/diy_goodsGroup.json
+++ b/components/diy_goodsGroup/diy_goodsGroup.json
@@ -1,6 +1,7 @@
{
"component": true,
"usingComponents": {
- "mp-loading": "weui-miniprogram/loading/loading"
+ "mp-loading": "weui-miniprogram/loading/loading",
+ "mp-sticky": "../mp-sticky/mp-sticky"
}
}
\ No newline at end of file
diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxml b/components/diy_goodsGroup/diy_goodsGroup.wxml
index ddd463f..0f19b5d 100644
--- a/components/diy_goodsGroup/diy_goodsGroup.wxml
+++ b/components/diy_goodsGroup/diy_goodsGroup.wxml
@@ -4,13 +4,27 @@
+
+
+
+
+
{{item.title}}
+
+
+
+
+ {{item.title}}
+
+
+
+
@@ -885,4 +899,6 @@
+
+
\ No newline at end of file
diff --git a/components/diy_nav/diy_nav.wxml b/components/diy_nav/diy_nav.wxml
index 47c11d1..4ab5090 100644
--- a/components/diy_nav/diy_nav.wxml
+++ b/components/diy_nav/diy_nav.wxml
@@ -3,13 +3,21 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -18,14 +26,21 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
\ No newline at end of file
diff --git a/components/diy_picMax/diy_picMax.wxml b/components/diy_picMax/diy_picMax.wxml
index f19db22..77393e1 100644
--- a/components/diy_picMax/diy_picMax.wxml
+++ b/components/diy_picMax/diy_picMax.wxml
@@ -9,6 +9,11 @@
+
+
+
+
+
@@ -24,6 +29,11 @@
+
+
+
+
+
diff --git a/components/diy_serviceCard/diy_serviceCard.js b/components/diy_serviceCard/diy_serviceCard.js
index d30f396..6eca56d 100644
--- a/components/diy_serviceCard/diy_serviceCard.js
+++ b/components/diy_serviceCard/diy_serviceCard.js
@@ -17,7 +17,14 @@ Component({
type: Object,
value: null,
},
-
+ sticky: {
+ type: Number,
+ value: 0,
+ },
+ container: {
+ type: Function,
+ value: null,
+ },
},
data: {
// 这里是一些组件内部数据
@@ -49,12 +56,19 @@ Component({
title_index: 0,
swiper_hei: 0,
title_class: "",
+ container: null,
},
- ready: function() {},
+
lifetimes: {
+ ready: function() {
+ this.setData({
+ container: () => wx.createSelectorQuery().select('#container')
+ });
+ },
attached: function() {
+
let myStyle = '';
//要兼容性的写法,因为有些商家都还未更新商品分组的最新的效果~~3.0公众号的html页面所以不用兼容写法
var nav_item = this.data.object;
diff --git a/components/diy_serviceCard/diy_serviceCard.json b/components/diy_serviceCard/diy_serviceCard.json
index e8cfaaf..17f7f47 100644
--- a/components/diy_serviceCard/diy_serviceCard.json
+++ b/components/diy_serviceCard/diy_serviceCard.json
@@ -1,4 +1,6 @@
{
"component": true,
- "usingComponents": {}
+ "usingComponents": {
+ "mp-sticky": "../mp-sticky/mp-sticky"
+ }
}
\ No newline at end of file
diff --git a/components/diy_serviceCard/diy_serviceCard.wxml b/components/diy_serviceCard/diy_serviceCard.wxml
index 92b3ec9..4d6a906 100644
--- a/components/diy_serviceCard/diy_serviceCard.wxml
+++ b/components/diy_serviceCard/diy_serviceCard.wxml
@@ -10,361 +10,219 @@
-->
-
-
-
-
-
- {{item.title}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.goods_name}}
-
-
-
-
- {{item.prom_integral}}积分
- +
- ¥{{item.prom_price}}
-
- ¥{{item.market_price}}
-
-
-
-
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item[card_field],2)}}
-
-
- {{card_name}}
-
-
-
-
-
-
- ¥
- {{item.market_price}}
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item.shop_price,2)}}
-
-
-
-
-
- ¥
- {{item.market_price}}
-
-
-
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item.shop_price,2)}}
-
-
-
- ¥
- {{item.market_price}}
-
-
-
-
-
-
- ¥
- {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}
-
-
- {{g_filter.get_card_price(item,card_list,1)}}
-
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item.shop_price,2)}}
-
-
-
-
-
- ¥
- {{item.market_price}}
-
-
-
-
-
-
-
- ¥{{item.shop_price}}
- ¥{{item.market_price}}
-
-
-
-
-
- 销量:{{item.sales_sum}}件
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.goods_name}}
-
-
-
-
- {{item.prom_integral}}积分
- +
- ¥{{item.prom_price}}
-
- ¥{{item.market_price}}
-
-
-
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item[card_field],2)}}
-
-
- {{card_name}}
-
-
-
-
-
-
- ¥
- {{item.market_price}}
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item.shop_price,2)}}
-
-
-
-
-
- ¥
- {{item.market_price}}
-
-
-
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item.shop_price,2)}}
-
-
-
- ¥
- {{item.market_price}}
-
-
-
-
-
-
- ¥
- {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}
-
-
- {{g_filter.get_card_price(item,card_list,1)}}
+
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.goods_name}}
+
+
+
+
+ {{item.prom_integral}}积分
+ +
+ ¥{{item.prom_price}}
+
+ ¥{{item.market_price}}
+
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item[card_field],2)}}
+
+
+ {{card_name}}
+
+
+
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item.shop_price,2)}}
+
+
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item.shop_price,2)}}
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}
+
+
+ {{g_filter.get_card_price(item,card_list,1)}}
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item.shop_price,2)}}
-
-
-
-
-
- ¥
- {{item.market_price}}
-
-
-
-
-
-
- ¥{{item.shop_price}}
- ¥{{item.market_price}}
-
-
-
- 销量:{{item.sales_sum}}件
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item.shop_price,2)}}
+
+
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+
+ ¥{{item.shop_price}}
+ ¥{{item.market_price}}
+
+
+
+
+
+ 销量:{{item.sales_sum}}件
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
@@ -386,17 +244,17 @@
src='{{imghost}}/miniapp/images/Promotion.png'>
-
+
+ {{item.goods_name}}
+
- {{item.goods_name}}
-
- {{item.prom_integral}}积分
- +
- ¥{{item.prom_price}}
-
+ {{item.prom_integral}}积分
+ +
+ ¥{{item.prom_price}}
+
¥{{item.market_price}}
@@ -412,7 +270,7 @@
{{filter.toFix(item[card_field],2)}}
- {{card_name}}
+ {{card_name}}
@@ -488,364 +346,529 @@
- ¥{{item.shop_price}}
- ¥{{item.market_price}}
+ ¥{{item.shop_price}}
+ ¥{{item.market_price}}
- 销量:{{item.sales_sum}}件
-
+ 销量:{{item.sales_sum}}件
+
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.goods_name}}
-
-
-
-
- {{item.prom_integral}}积分
- +
- ¥{{item.prom_price}}
-
- ¥{{item.market_price}}
-
-
-
-
-
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item[card_field],2)}}
-
-
- {{card_name}}
-
-
-
-
-
-
- ¥
- {{item.market_price}}
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item.shop_price,2)}}
-
-
-
-
-
- ¥
- {{item.market_price}}
-
-
-
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item.shop_price,2)}}
-
-
-
- ¥
- {{item.market_price}}
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.goods_name}}
+
+
+
+ {{item.prom_integral}}积分
+ +
+ ¥{{item.prom_price}}
+
+ ¥{{item.market_price}}
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item[card_field],2)}}
+
+
+ {{card_name}}
+
+
+
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item.shop_price,2)}}
+
+
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item.shop_price,2)}}
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}
+
+
+ {{g_filter.get_card_price(item,card_list,1)}}
+
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item.shop_price,2)}}
+
+
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+ ¥{{item.shop_price}}
+ ¥{{item.market_price}}
+
+
+
+ 销量:{{item.sales_sum}}件
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.goods_name}}
+
-
-
-
-
- ¥
- {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}
-
- {{g_filter.get_card_price(item,card_list,1)}}
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(item.shop_price,2)}}
-
-
-
-
-
- ¥
- {{item.market_price}}
-
-
-
-
+
+
+ {{item.prom_integral}}积分
+ +
+ ¥{{item.prom_price}}
+
+ ¥{{item.market_price}}
-
+
- ¥{{item.shop_price}}
- ¥{{item.market_price}}
+
+
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item[card_field],2)}}
+
+
+ {{card_name}}
+
+
+
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item.shop_price,2)}}
+
+
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item.shop_price,2)}}
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}
+
+ {{g_filter.get_card_price(item,card_list,1)}}
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(item.shop_price,2)}}
+
+
+
+
+
+ ¥
+ {{item.market_price}}
+
+
+
+
+
+
+
+ ¥{{item.shop_price}}
+ ¥{{item.market_price}}
+
+
-
-
-
- 销量:{{item.sales_sum}}件
-
-
-
-
-
-
+
+ 销量:{{item.sales_sum}}件
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ —— 宝贝已经全部加载 ——
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{aitem.goods_name}}
+
+
+
+ {{aitem.prom_integral}}
+ +
+ ¥{{aitem.prom_price}}
+
+ ¥{{aitem.market_price}}
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(aitem[card_field],2)}}
+
+
+ {{card_name}}
+
+
+
+
+
+
+ ¥
+ {{aitem.market_price}}
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(aitem.shop_price,2)}}
+
+
+
+
+
+ ¥
+ {{aitem.market_price}}
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(aitem.shop_price,2)}}
+
+
+
+ ¥
+ {{aitem.market_price}}
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(g_filter.get_card_price(aitem,card_list,0),2)}}
+
+
+ {{g_filter.get_card_price(aitem,card_list,1)}}
+
+
+
+
+
+
+
+
+ ¥
+ {{filter.toFix(aitem.shop_price,2)}}
+
+
+
+
+
+ ¥
+ {{aitem.market_price}}
+
+
+
+
+
+
+ ¥{{aitem.shop_price}}
+ ¥{{aitem.market_price}}
+
+
+
+ 销量:{{aitem.sales_sum}}件
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
- —— 宝贝已经全部加载 ——
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{aitem.goods_name}}
-
-
-
- {{aitem.prom_integral}}
- +
- ¥{{aitem.prom_price}}
-
- ¥{{aitem.market_price}}
-
-
-
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(aitem[card_field],2)}}
-
-
- {{card_name}}
-
-
-
-
-
-
- ¥
- {{aitem.market_price}}
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(aitem.shop_price,2)}}
-
-
-
-
-
- ¥
- {{aitem.market_price}}
-
-
-
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(aitem.shop_price,2)}}
-
-
-
- ¥
- {{aitem.market_price}}
-
-
-
-
-
-
- ¥
- {{filter.toFix(g_filter.get_card_price(aitem,card_list,0),2)}}
-
-
- {{g_filter.get_card_price(aitem,card_list,1)}}
-
-
-
-
-
-
-
-
- ¥
- {{filter.toFix(aitem.shop_price,2)}}
-
-
-
-
-
- ¥
- {{aitem.market_price}}
-
-
-
-
-
-
- ¥{{aitem.shop_price}}
- ¥{{aitem.market_price}}
-
-
-
- 销量:{{aitem.sales_sum}}件
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
diff --git a/components/mp-sticky/mp-sticky.js b/components/mp-sticky/mp-sticky.js
new file mode 100644
index 0000000..0a70f23
--- /dev/null
+++ b/components/mp-sticky/mp-sticky.js
@@ -0,0 +1,155 @@
+const selectQuery = require('./selectQuery')
+const target = '.weui-sticky'
+
+Component({
+ options: {
+ addGlobalClass: true,
+ // 指定所有 _ 开头的数据字段为纯数据字段
+ pureDataPattern: /^_/,
+ multipleSlots: true // 在组件定义时的选项中启用多slot支持
+ },
+ behaviors: [selectQuery],
+ properties: {
+ offsetTop: {
+ type: Number,
+ value: 0
+ },
+ zIndex: {
+ type: Number,
+ value: 99
+ },
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
+ container: {
+ type: null
+ }
+ },
+ data: {
+ fixed: false,
+ height: 0,
+ _attached: false,
+ _containerHeight: 0,
+ },
+
+ observers: {
+ disabled: function(newVal) {
+ if (!this.data._attached) return
+ newVal ? this.disconnectObserver() : this.initObserver()
+ },
+
+ container: function(newVal) {
+ if (typeof newVal !== 'function' || !this.data.height) return
+ this.observerContainer()
+ },
+
+ offsetTop: function(newVal){
+ if(typeof newVal !== 'number' || !this.data._attached) return
+ this.initObserver()
+ }
+
+ },
+
+ lifetimes: {
+ attached() {
+ this.data._attached = true
+ if (!this.data.disabled) this.initObserver()
+ },
+
+ detached() {
+ this.data._attached = false
+ this.disconnectObserver()
+ }
+
+ },
+
+ methods: {
+ getContainerRect () {
+ const nodesRef = this.data.container()
+ return new Promise(resolve => nodesRef.boundingClientRect(resolve).exec())
+ },
+
+ initObserver() {
+ this.disconnectObserver()
+ this.getRect(target).then(rect => {
+ this.setData({
+ height: rect.height
+ })
+ this.observerContent()
+ this.observerContainer()
+ })
+ },
+
+ disconnectObserver(observerName) {
+ if (observerName) {
+ const observer = this[observerName]
+ observer && observer.disconnect()
+ } else {
+ this.contentObserver && this.contentObserver.disconnect()
+ this.containerObserver && this.containerObserver.disconnect()
+ }
+ },
+
+ observerContent() {
+ const {offsetTop} = this.data
+ this.disconnectObserver('contentObserver')
+
+ const contentObserver = this.createIntersectionObserver({
+ thresholds: [1],
+ initialRatio: 1
+ })
+ contentObserver.relativeToViewport({
+ top: -offsetTop
+ })
+ contentObserver.observe(target, res => {
+ if (this.data.disabled) return
+ this.setFixed(res.boundingClientRect.top)
+ })
+ this.contentObserver = contentObserver
+ },
+
+ observerContainer() {
+ const {container, height, offsetTop} = this.data
+ if (typeof container !== 'function') return
+
+ this.disconnectObserver('containerObserver')
+ this.getContainerRect().then(rect => {
+ this.getRect(target).then(contentRect => {
+ const _contentTop = contentRect.top
+ const _containerTop = rect.top
+ const _containerHeight = rect.height
+ const _relativeTop = _contentTop - _containerTop
+ const containerObserver = this.createIntersectionObserver({
+ thresholds: [1],
+ initialRatio: 1
+ })
+ containerObserver.relativeToViewport({
+ top: _containerHeight - height - offsetTop - _relativeTop
+ })
+ containerObserver.observe(target, (res) => {
+ if (this.data.disabled) return
+ this.setFixed(res.boundingClientRect.top);
+ })
+ this.data._relativeTop = _relativeTop
+ this.data._containerHeight = _containerHeight
+ this.containerObserver = containerObserver
+ })
+ })
+ },
+
+ setFixed(top) {
+ const {height, _containerHeight, _relativeTop, offsetTop} = this.data
+ const fixed = _containerHeight && height
+ ? (top >= height + offsetTop + _relativeTop - _containerHeight) && (top < offsetTop)
+ : top < offsetTop
+ this.triggerEvent('scroll', {
+ scrollTop: top,
+ isFixed: fixed
+ })
+
+ this.setData({fixed})
+ }
+ }
+})
+
diff --git a/components/mp-sticky/mp-sticky.json b/components/mp-sticky/mp-sticky.json
new file mode 100644
index 0000000..7e37c03
--- /dev/null
+++ b/components/mp-sticky/mp-sticky.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/components/mp-sticky/mp-sticky.wxml b/components/mp-sticky/mp-sticky.wxml
new file mode 100644
index 0000000..1114837
--- /dev/null
+++ b/components/mp-sticky/mp-sticky.wxml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/components/mp-sticky/mp-sticky.wxs b/components/mp-sticky/mp-sticky.wxs
new file mode 100644
index 0000000..266810f
--- /dev/null
+++ b/components/mp-sticky/mp-sticky.wxs
@@ -0,0 +1,20 @@
+
+/* eslint-disable */
+function wrapStyle(data) {
+ if (data.fixed) {
+ return 'top: ' + data.offsetTop + 'px;'
+ }
+ return ''
+}
+
+function containerStyle(data) {
+ if (data.fixed) {
+ return 'height: ' + data.height + 'px; z-index: ' + data.zIndex + ';'
+ }
+ return ''
+}
+
+module.exports = {
+ wrapStyle: wrapStyle,
+ containerStyle: containerStyle
+}
diff --git a/components/mp-sticky/mp-sticky.wxss b/components/mp-sticky/mp-sticky.wxss
new file mode 100644
index 0000000..6e440ba
--- /dev/null
+++ b/components/mp-sticky/mp-sticky.wxss
@@ -0,0 +1,11 @@
+.weui-sticky {
+ position: relative;
+}
+
+.weui-sticky__fixed {
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 100%;
+ background-color: white;
+}
\ No newline at end of file
diff --git a/components/mp-sticky/selectQuery.js b/components/mp-sticky/selectQuery.js
new file mode 100644
index 0000000..c64cefd
--- /dev/null
+++ b/components/mp-sticky/selectQuery.js
@@ -0,0 +1,31 @@
+module.exports = Behavior({
+ methods: {
+ getRect(selector) {
+ return new Promise((resolve, reject) => {
+ this.createSelectorQuery()
+ .select(selector)
+ .boundingClientRect(rect => {
+ if (rect) {
+ resolve(rect)
+ } else {
+ reject(new Error(`can not find selector: ${selector}`))
+ }
+ }).exec()
+ })
+ },
+
+ getAllRects(selector) {
+ return new Promise((resolve, reject) => {
+ this.createSelectorQuery()
+ .selectAll(selector)
+ .boundingClientRect(rects => {
+ if (rects && rects.lenght > 0) {
+ resolve(rects)
+ } else {
+ reject(new Error(`can not find selector: ${selector}`))
+ }
+ }).exec()
+ })
+ }
+ }
+})
diff --git a/packageA/pages/myGift/myGift.js b/packageA/pages/myGift/myGift.js
index ab53025..c1e8126 100644
--- a/packageA/pages/myGift/myGift.js
+++ b/packageA/pages/myGift/myGift.js
@@ -61,7 +61,8 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
- onReady: function () {},
+ onReady: function () {
+ },
/**
* 生命周期函数--监听页面显示
@@ -75,6 +76,7 @@ Page({
userInfo: app.globalData.userInfo,
imghost: app.globalData.setting.imghost,
isLogin: true,
+ now:Date.parse(new Date()) / 1000,
});
var index=this.data.currentIndex;
@@ -91,7 +93,7 @@ Page({
if(index == 0) {
url = '/api/weshop/libao/libaoForm/page';
- data.timetype=1;
+ data.timetype=2;
} else if(index == 1) {
url = '/api/weshop/libao/libaoFormvip/page';
};
diff --git a/packageA/pages/myGift/myGift.wxml b/packageA/pages/myGift/myGift.wxml
index 9fb2f5b..731944e 100644
--- a/packageA/pages/myGift/myGift.wxml
+++ b/packageA/pages/myGift/myGift.wxml
@@ -5,11 +5,11 @@
-
+
-
+
@@ -23,11 +23,11 @@
{{filter.toFix(item.lbprice,2)}}/{{item.lbintegral}}积分
-
- {{filter.toFix(item.lbprice,2) }}
+
+ {{filter.toFix(item.lbprice,2) }}
- {{item.lbintegral}}积分
+ {{item.lbintegral}}积分
@@ -36,20 +36,28 @@
已售{{item.salenum+item.virtualsales}}件
- 活动结束日期 {{filter.format_time(item.endtime)}}
+ 活动开始日期 {{filter.format_time(item.startime)}}
+ 活动结束日期 {{filter.format_time(item.endtime)}}
-
- 立即兑换
- 立即购买
-
+
+ 活动还未开始
+
+
+
+ 立即兑换
+ 立即购买
+
+
-
+
-
+
+
+
@@ -63,7 +71,7 @@
-
+
—— 已经到底了 ——
@@ -75,7 +83,7 @@
-
+
活动说明:
{{pop_remark_text}}
diff --git a/packageA/pages/myGift/myGift.wxss b/packageA/pages/myGift/myGift.wxss
index 1e961aa..05f5d37 100644
--- a/packageA/pages/myGift/myGift.wxss
+++ b/packageA/pages/myGift/myGift.wxss
@@ -52,6 +52,16 @@ page {
font-weight: bold;
}
+.btn1 {
+ padding: 20rpx;
+ flex: 1;
+ text-align: center;
+}
+
+.btn1.gray{
+ background-color: #cccccc;
+ color:#fff
+}
.tab-title-item::after {
position: absolute;
diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js
index 8db3a02..5e8acda 100644
--- a/packageC/pages/presell/goodsInfo/goodsInfo.js
+++ b/packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -1555,10 +1555,8 @@ Page({
if (!title) title = th.data.prom_act.title;
if (th.data.prom_type == 4) title = th.data.prom_act.name;
- if (th.data.presellForm.share_img)
- img = th.data.iurl + th.data.presellForm.share_img;
-
-
+ //if (th.data.presellForm.share_img)
+ // img = th.data.iurl + th.data.presellForm.share_img;
var url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + th.data.gid+"&pre_id="+th.data.pre_arr.id;
if (getApp().globalData.user_id) {
@@ -3133,13 +3131,9 @@ Page({
tt();
return false;
}
- // var img_url = ee.data.data.original_img;
- var img_url = ee.data.presellForm.share_img;
- img_url?img_url:ee.data.data.original_img;
-
- if (img_url) {
- img_url = this.data.iurl + img_url;
- }
+ var img_url = ee.data.data.original_img;
+ //var img_url = ee.data.presellForm.share_img;
+ //img_url?img_url:ee.data.data.original_img;
//获取商品是分享图信息
wx.getImageInfo({
diff --git a/packageC/pages/presell/list/list.js b/packageC/pages/presell/list/list.js
index c6323d9..562f4f1 100644
--- a/packageC/pages/presell/list/list.js
+++ b/packageC/pages/presell/list/list.js
@@ -58,6 +58,24 @@ Page({
}else{
getApp().goto("/pages/togoin/togoin");
}
+
+ var room_id = t.room_id;
+ var room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
+ //-- 如果有房间号 --
+ if (room_id) {
+ getApp().globalData.room_id = room_id;
+ //如果是会员分享过来的要记录
+ if (room_user_share) getApp().globalData.room_user_share = room_user_share;
+ }
+
+
+ if(this.data.act_id){
+ getApp().promiseGet("/api/weshop/marketing/marketingPresellForm/get/"+os.stoid+"/"+this.data.act_id,{}).then(res=>{
+ if(res.data.code==0)
+ th.data.pre_act=res.data.data
+ })
+ }
+
},
onShow: function (t) {
var userInfo=getApp().globalData.userInfo;
@@ -235,4 +253,54 @@ Page({
}
},
-});
+ onShareAppMessage: async function (t) {
+ getApp().globalData.no_clear=1;
+ var img="";
+ if(this.data.ad_data && this.data.ad_data.length ){
+ img= this.data.ad_data[0];
+ }else{
+ var url="/api/weshop/store/get/"+os.stoid;
+ await getApp().promiseGet(url,{}).then(res=>{
+ if(res.data.code==0){
+ img= os.imghost+res.data.data.store_logo
+ }
+ })
+ }
+
+ var url = "/packageC/pages/presell/list/list";
+
+ if(this.data.act_id){
+ url += "?act_id=" + this.data.act_id;
+ }
+ if (getApp().globalData.user_id) {
+
+ if(url.indexOf("?")==-1)
+ url += "?first_leader=" + getApp().globalData.user_id;
+ else
+ url += "&first_leader=" + getApp().globalData.user_id;
+ }
+ //-- 如果房间分享,且不是会员分享的 --
+ if (getApp().globalData.room_id &&
+ this.data.data.goods_id == getApp().globalData.room_goods_id &&
+ !getApp().globalData.room_user_share
+ ) {
+ url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1";
+ }
+
+ var ob={};
+ if(this.data.pre_act){
+ ob = { title: this.data.pre_act.share_title, path: url,imageUrl:os.imghost+this.data.pre_act.share_img };
+ }else{
+
+ ob = { title: "预售列表", path: url, };
+ if(img){
+ ob.imageUrl=img;
+ }
+ }
+
+
+ return ob;
+ }
+
+
+ });
diff --git a/packageD/pages/user/coupons/filter.wxs b/packageD/pages/user/coupons/filter.wxs
index 33c4a2c..9b4961a 100644
--- a/packageD/pages/user/coupons/filter.wxs
+++ b/packageD/pages/user/coupons/filter.wxs
@@ -39,11 +39,11 @@ var numFr = {
break;
};
case 1: {
- return '已过从我的专享礼包,期';
+ return '从我的专享礼包获取';
break;
};
case 2: {
- return '从我的幸运大转盘,';
+ return '从我的幸运大转盘获取,';
break;
};
default: {
diff --git a/packageD/pages/user/deposit/deposit.js b/packageD/pages/user/deposit/deposit.js
index 78c8c9b..c4f0bd2 100644
--- a/packageD/pages/user/deposit/deposit.js
+++ b/packageD/pages/user/deposit/deposit.js
@@ -1,3 +1,11 @@
+/*
+ * @Author: your name
+ * @Date: 2022-03-26 11:41:08
+ * @LastEditTime: 2022-04-13 14:28:30
+ * @LastEditors: your name
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @FilePath: \MShopWeApp\packageD\pages\user\deposit\deposit.js
+ */
var t = getApp(),
a = t.request,
o = t.globalData.setting,
@@ -24,7 +32,7 @@ Page({
return false;
}
wx.setNavigationBarTitle({
- title: "预存款",
+ title: "储值款",
})
var th = this;
diff --git a/packageD/pages/user/deposit/deposit.wxml b/packageD/pages/user/deposit/deposit.wxml
index 2fdc92f..4e81dd0 100644
--- a/packageD/pages/user/deposit/deposit.wxml
+++ b/packageD/pages/user/deposit/deposit.wxml
@@ -1,6 +1,6 @@
- 预存款
+ 储值款
¥{{yucun_money}}
@@ -9,20 +9,20 @@
- 预存款充值
+ 储值款充值
- 预存款余额
+ 储值款余额
- 暂无任何预存款
+ 暂无任何储值款
diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js
index 6cf052b..47c4498 100644
--- a/pages/cart/cart2/cart2.js
+++ b/pages/cart/cart2/cart2.js
@@ -130,8 +130,9 @@ Page({
ladder_map: {}, //阶梯促销的map表
is_no_past: 1,
state: 0, //阶梯促销的的立即购买也走购物车流程state=1
- show_duo_gift:0,
- send_gf:{}, //多赠品的计算
+ show_duo_gift: 0,
+ send_gf: {}, //多赠品的计算
+ send_lb: {},
},
onLoad: function (t) {
wx.setNavigationBarTitle({ title: "填写订单", })
@@ -171,7 +172,8 @@ Page({
isget_by_quan: {},
is_no_by: {},
is_by: {},
- send_gf:{}
+ send_gf: {},
+ send_lb: {},
})
},
@@ -188,7 +190,6 @@ Page({
} else {
this.getuser_addr(function (ie) {
-
console.log("getuser_addr")
console.log(ie)
//地址切换要把包邮券清空
@@ -381,7 +382,7 @@ Page({
to.get_allsto(function (e) {
th.setData({ allsto: e });
//-------获取购物车已经选择的商品--------
- console.log('购物车结算');
+ console.log('购物车结算');
th.get_cart();
})
@@ -408,7 +409,7 @@ Page({
//-----真的获取购物车,入口--------
get_cart: function () {
- var th = this, app = getApp();
+ var th = this, app = getApp();
var state = 0;
if (th.data.state) state = 1;
a.get("/api/weshop/cart/list", {
@@ -452,6 +453,7 @@ Page({
//要把优惠活动加入,prom_goods_map中,赠品不要运算
if (item1.prom_type == 3 && item1.is_gift != 1) {
+ // th.check_is_youhui(item1.goods_id, item1.pick_id);
await th.add_prom_goods_map(item1);
}
@@ -719,7 +721,7 @@ Page({
ie.wind = parseInt(th.data.cartlist[kj].wind);
//-- 是不是全部自提清空 --
- if(ie.exp_type==0) th.setData({ is_all_zt: 0 });
+ if (ie.exp_type == 0) th.setData({ is_all_zt: 0 });
break;
}
@@ -859,7 +861,6 @@ Page({
et = th.data.bn_exp_type;
m_wind = th.data.index;
}
-
//---是不是购买等级卡成功的返回---等级卡显示的判断---
var is_card_back = getApp().globalData.is_card_back;
if (is_card_back) {
@@ -915,12 +916,13 @@ Page({
t.data.data.prom_id = gg.prom_id;
t.data.data.prom_type = 3;
//如果是优惠活动,就要调用活动,计算价格
+ // th.check_is_youhui(gg.goods_id, gg.pick_id);
th.buy_now_prom_goods(gg.prom_id, t.data.data, function (data) {
//判断一下购买商品的数量是不是超过
- if (data.gift_goods_id && (!data.zp_mode || parseInt(data.zp_mode)==0) ) {
- var num =data.zp_num?data.zp_num:1;
+ if (data.gift_goods_id && (!data.zp_mode || parseInt(data.zp_mode) == 0)) {
+ var num = data.zp_num ? data.zp_num : 1;
if (data.is_bz == 1) {
- num = num*data.bs;
+ num = num * data.bs;
if (num > data.gift_limit_num) num = 0;
}
//如果赠品数量超出礼品库存,就取消
@@ -943,9 +945,9 @@ Page({
ob.exp_sum_type = data.gift_exp_sum_type; //商品的物流计算方式
ob.uniform_exp_sum = data.gift_uniform_exp_sum //统一运费的金额
- var arr_gf=[];
+ var arr_gf = [];
arr_gf.push(ob);
- th.setData({ buy_now_gift_goods: arr_gf});
+ th.setData({ buy_now_gift_goods: arr_gf });
}
}
@@ -1174,8 +1176,8 @@ Page({
},
calc_per: async function (c_arr) {
- var send_gf={};
- var duo_zp_num_arr={};
+ var send_gf = {};
+ var duo_zp_num_arr = {};
var th = this;
//-- 循环处理 --
for (var i in c_arr) {
@@ -1197,7 +1199,7 @@ Page({
//等待,获取一下优惠活动的信息
await getApp().request.promiseGet("/api/weshop/goods/getDiscount", {
data: {
- price:parseFloat(item_map.price).toFixed(2),prom_id:item_map.prom_id,
+ price: parseFloat(item_map.price).toFixed(2), prom_id: item_map.prom_id,
goods_num: item_map.goods_num, user_id: getApp().globalData.user_id,
is_bz: item_map.is_bz
}
@@ -1211,12 +1213,13 @@ Page({
item_map.s_intValue = get_data.intValue;
item_map.s_coupon_id = get_data.coupon_id;
item_map.s_coupon_num = get_data.coupon_num;
+ item_map.lbtitle = get_data.lbtitle;
+ item_map.zxlbtitle = get_data.zxlbtitle;
-
- if (get_data.gift_id && parseInt(get_data.zp_mode)!=1
- && get_data.zp_num* item_map.bs<=get_data.limit_num
- && get_data.zp_num* item_map.bs<=get_data.gift_storecount
- ){
+ if (get_data.gift_id && parseInt(get_data.zp_mode) != 1
+ && get_data.zp_num * item_map.bs <= get_data.limit_num
+ && get_data.zp_num * item_map.bs <= get_data.gift_storecount
+ ) {
item_map.gift_id = get_data.gift_id;
item_map.gift_goods_id = get_data.goods_id;
@@ -1238,21 +1241,21 @@ Page({
item_map.zx_libao = get_data.zxlibao;
item_map.zx_lb_num = get_data.zxlb_num;
- if(parseInt(get_data.zp_mode)==1){
- if(!send_gf[pickid]) send_gf[pickid]=[];
+ if (parseInt(get_data.zp_mode) == 1) {
+ if (!send_gf[pickid]) send_gf[pickid] = [];
- var can_zp_num=0;
- for(let iy in get_data.giftsinfo){
- let item=get_data.giftsinfo[iy];
- can_zp_num+= parseInt(item.gift_storecount)>parseInt(item.limit_num)?parseInt(item.limit_num):parseInt(item.gift_storecount);
+ var can_zp_num = 0;
+ for (let iy in get_data.giftsinfo) {
+ let item = get_data.giftsinfo[iy];
+ can_zp_num += parseInt(item.gift_storecount) > parseInt(item.limit_num) ? parseInt(item.limit_num) : parseInt(item.gift_storecount);
}
- var t_zp_num=parseInt(get_data.zp_num)*parseInt(get_data.bs);
- if(duo_zp_num_arr[item_map.prom_id]){
- t_zp_num+=duo_zp_num_arr[item_map.prom_id];
+ var t_zp_num = parseInt(get_data.zp_num) * parseInt(get_data.bs);
+ if (duo_zp_num_arr[item_map.prom_id]) {
+ t_zp_num += duo_zp_num_arr[item_map.prom_id];
}
- if(can_zp_num>=t_zp_num) {
+ if (can_zp_num >= t_zp_num) {
send_gf[pickid].push({
pickup_id: pickid,
giftsinfo: get_data.giftsinfo,
@@ -1261,7 +1264,7 @@ Page({
prom_id: item_map.prom_id
});
- duo_zp_num_arr[item_map.prom_id]=t_zp_num;
+ duo_zp_num_arr[item_map.prom_id] = t_zp_num;
}
}
}
@@ -1325,7 +1328,7 @@ Page({
for (var j = 0; j < ord_goods.length; j++) {
if (ord_goods[j].is_gift) continue;
if (ord_goods[j].prom_type == 3 && ord_goods[j].prom_id == item_map.prom_id) {
- ord_goods[j].is_xz_yh =ord_goods[j].is_xz_yh?ord_goods[j].is_xz_yh:item_map.is_xz_yh;
+ ord_goods[j].is_xz_yh = ord_goods[j].is_xz_yh ? ord_goods[j].is_xz_yh : item_map.is_xz_yh;
ord_goods[j].is_past = item_map.is_past;
ord_goods[j].account_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_fir;
ord_goods[j].account_yu_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_yu_fir;
@@ -1362,22 +1365,22 @@ Page({
if (item_map.s_libao) {
if (!cart_item.s_libao) {
cart_item.s_libao = item_map.s_libao + "";
- cart_item.g_lb_num = [{ 'l_id': item_map.s_libao, "num": item_map.s_lb_num }];
+ cart_item.g_lb_num = [{ 'l_id': item_map.s_libao, "num": item_map.s_lb_num, 'lbtitle': item_map.lbtitle }];
}
else {
cart_item.s_libao += "," + item_map.s_libao;
- cart_item.g_lb_num.push({ 'l_id': item_map.s_libao, "num": item_map.s_lb_num })
+ cart_item.g_lb_num.push({ 'l_id': item_map.s_libao, "num": item_map.s_lb_num, 'lbtitle': item_map.lbtitle })
}
}
if (item_map.zx_libao) {
if (!cart_item.zx_libao) {
cart_item.zx_libao = item_map.zx_libao + "";
- cart_item.g_zxlb_num = [{'l_id': item_map.zx_libao, "num": item_map.zx_lb_num}];
+ cart_item.g_zxlb_num = [{ 'l_id': item_map.zx_libao, "num": item_map.zx_lb_num, 'zxlbtitle': item_map.zxlbtitle }];
}
else {
cart_item.zx_libao += "," + item_map.zx_libao;
- cart_item.g_zxlb_num.push({'l_id': item_map.zx_libao, "num": item_map.zx_lb_num})
+ cart_item.g_zxlb_num.push({ 'l_id': item_map.zx_libao, "num": item_map.zx_lb_num, 'zxlbtitle': item_map.zxlbtitle })
}
}
}
@@ -1387,15 +1390,69 @@ Page({
var arr = Object.keys(send_gf);
var arr2 = Object.keys(th.data.send_gf);
- if(arr2.length>0) return false;
-
- if(arr.length>0){
- th.setData({send_gf:send_gf})
- }else{
- th.setData({send_gf:{}})
+ if (arr2.length > 0) return false;
+ th.calclate_lbNum(c_arr);
+ if (arr.length > 0) {
+ th.setData({ send_gf: send_gf })
+ } else {
+ th.setData({ send_gf: {} })
}
},
+ calclate_lbNum(r_data) {
+ let send_lb = this.data.send_lb;
+ //g_lb_num我的礼包 g_zxlb_num专享礼包
+ r_data.forEach(r_d => {
+ let arr = [];
+ if (r_d.g_zxlb_num) {
+ let g_lb = r_d.g_zxlb_num;
+ for (let i = 0; i < g_lb.length; i++) {
+ let item = g_lb[i];
+ let new_lb = g_lb.filter(lb => {
+ return item.l_id === lb.l_id;
+ });
+ if (new_lb.length == 1) {
+ arr.push(item);
+ } else {
+ item.num = new_lb.reduce((pre, next) => {
+ return pre + next.num;
+ }, 0);
+ arr.push(item);
+ g_lb = g_lb.filter(ii => {
+ return ii.l_id !== item.l_id;
+ });
+ }
+ send_lb[r_d.pickup_id] = arr;
+ }
+ }
+ if (r_d.g_lb_num) {
+ let zx_lb = r_d.g_lb_num;
+ for (let i = 0; i < zx_lb.length; i++) {
+ let item = zx_lb[i];
+ item.flag = 1;
+ let new_lb = zx_lb.filter(lb => {
+ return item.l_id === lb.l_id;
+ });
+ if (new_lb.length == 1) {
+ arr.push(item);
+ } else {
+ item.num = new_lb.reduce((pre, next) => {
+ return pre + next.num;
+ }, 0);
+ arr.push(item);
+ zx_lb = zx_lb.filter(ii => {
+ return ii.l_id !== item.l_id;
+ });
+ }
+ send_lb[r_d.pickup_id] = arr;
+ }
+ }
+ })
+ this.setData({
+ send_lb,
+ })
+
+ },
//-------------------计算订单价格-------------------
calculatePrice: function (t, s) {
@@ -1404,12 +1461,12 @@ Page({
to.getwuliuprice(async function (rs) {
wx.showLoading({ title: "处理中." })
//是不是区域包邮
- th.data.is_area_by=0;
+ th.data.is_area_by = 0;
//当不是区域不包邮的时候,没有不包邮商品的时候
- th.data.free1=0;
- th.data.cut_o_shipping_price=0;
- th.data.cut_goods_piece=0;
- th.data.cut_goods_weight=0;
+ th.data.free1 = 0;
+ th.data.cut_o_shipping_price = 0;
+ th.data.cut_goods_piece = 0;
+ th.data.cut_goods_weight = 0;
var all_price = 0; //所有的商品总价
var all_shipping_m = 0; //所有的物流总价
@@ -1424,7 +1481,7 @@ Page({
var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money ? th.data.userinfo.frozen_money : 0);
var freight_free = ee.freight_free; //全场满多少包邮
- var free1=freight_free;
+ var free1 = freight_free;
var weight_free = ee.weight_free; //多少kg内包邮
var no_ex_id = ee.no_ex_id;
@@ -1596,7 +1653,7 @@ Page({
if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) {
if (th.check_by_area(by_qc.region_list)) {
freight_free = 0;
- th.data.is_area_by=1;
+ th.data.is_area_by = 1;
//goods_weight = -1;
//out_of_weight = 0;
th.data.is_no_by[pickid] = 1;
@@ -1615,36 +1672,36 @@ Page({
- var is_in_no_ex_goods_arr=0;
- var by_g_weight=0;
+ var is_in_no_ex_goods_arr = 0;
+ var by_g_weight = 0;
//--------循环计算商品总物流-----------
for (var jo = 0; jo < item.length; jo++) {
//----------------如果是选择了物流---------------------
- if (cart_item.exp_type == 0 && item[jo].is_free_shipping == 0 && th.data.user_addr != null){
+ if (cart_item.exp_type == 0 && item[jo].is_free_shipping == 0 && th.data.user_addr != null) {
//判断是否有设置限制重量包邮,先看商品有没有包邮
- if(!no_ex_good_arr || no_ex_good_arr.indexOf(item[jo].goods_id + '')== -1){
- if(!th.data.is_area_by) th.data.free1=free1;
+ if (!no_ex_good_arr || no_ex_good_arr.indexOf(item[jo].goods_id + '') == -1) {
+ if (!th.data.is_area_by) th.data.free1 = free1;
//此时是 模板里面没有不包邮商品列表或者是 该商品没有再不包邮商品列表礼包
if (item[jo]['is_past'] !== 1 && item[jo]['exp_sum_type'] == 2) {
if (goods_weight < 0) goods_weight = 0;
//累积商品重量 每种商品的重量 * 数量
goods_weight += item[jo]['weight'] * item[jo]['goods_num'];
- by_g_weight+=item[jo]['weight'] * item[jo]['goods_num'];
+ by_g_weight += item[jo]['weight'] * item[jo]['goods_num'];
- if(free1>0){
+ if (free1 > 0) {
if (weight_free > 0) {
out_of_weight = (weight_free * 1000) - by_g_weight;
- }else{
- out_of_weight= -by_g_weight;
+ } else {
+ out_of_weight = -by_g_weight;
}
}
}
}
//这个是在不包邮列表礼包
- else if(no_ex_good_arr.indexOf(item[jo].goods_id + '') > -1){
- is_in_no_ex_goods_arr=1;
+ else if (no_ex_good_arr.indexOf(item[jo].goods_id + '') > -1) {
+ is_in_no_ex_goods_arr = 1;
if (item[jo]['is_past'] !== 1 && item[jo]['exp_sum_type'] == 2) {
if (goods_weight < 0) goods_weight = 0;
//累积商品重量 每种商品的重量 * 数量
@@ -1655,7 +1712,7 @@ Page({
}
}
- if(free1>0) {
+ if (free1 > 0) {
//当商品没有超出的时候
if (out_of_weight >= 0) {
out_of_weight = -by_g_weight;
@@ -1665,7 +1722,7 @@ Page({
}
//所有的商品都不在不包邮商品列表,freight_free为0的时候,以及不是区域包邮
- if(!is_in_no_ex_goods_arr && !freight_free && !th.data.is_area_by) freight_free=free1;
+ if (!is_in_no_ex_goods_arr && !freight_free && !th.data.is_area_by) freight_free = free1;
//--如果是物流,且选择了地址,就要开始显示包邮券,且包邮券也已经优惠了优惠活动的金额--
if (cart_item.exp_type == 0 && th.data.user_addr != null && !cart_item.is_xz_yh) {
@@ -1751,7 +1808,7 @@ Page({
if (no_ex_good) {
is_good_no_by = th.check_by_goods(no_ex_good, item[j].goods_id);
}
-
+
//--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算--
if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1 && !is_good_no_by) {
continue;
@@ -1777,7 +1834,7 @@ Page({
}
- if(!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id + '')== -1){
+ if (!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id + '') == -1) {
switch (item[j]['exp_sum_type']) {
case 1:
//统一运费
@@ -1791,7 +1848,7 @@ Page({
}
- }else{
+ } else {
/*--
if(item[j]['exp_sum_type']==2 && out_of_weight!==0){
goods_weight = -1;
@@ -1839,7 +1896,7 @@ Page({
var order_m = 0;
//---判断是不是有订单优惠---
await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
- data: { store_id: os.stoid, orderAmount: o_condition,user_id:getApp().globalData.user_id}
+ data: { store_id: os.stoid, orderAmount: o_condition, user_id: getApp().globalData.user_id }
}).then(res => {
if (res.data.code == 0) {
var ord_prom = res.data.data;
@@ -2284,9 +2341,9 @@ Page({
var l_txt = "formData.give_zxlb_id";
//这个是json格式的
var l_txt1 = "formData.g_zxlb_num";
- var ob = [{"num": good.zx_lb_num, "l_id": good.zx_libao}];
+ var ob = [{ "num": good.zx_lb_num, "l_id": good.zx_libao }];
ob = JSON.stringify(ob);
- th.setData({[l_txt]: good.zx_libao, [l_txt1]: ob});
+ th.setData({ [l_txt]: good.zx_libao, [l_txt1]: ob });
}
})
} else {
@@ -2343,7 +2400,7 @@ Page({
var l_txt1 = "formData.g_lb_num";
var ob = [{ "num": good.s_lb_num, "l_id": good.s_libao }];
ob = JSON.stringify(ob);
- th.setData({[l_txt]: good.s_libao, [l_txt1]: ob});
+ th.setData({ [l_txt]: good.s_libao, [l_txt1]: ob });
}
//专享礼包
@@ -2351,9 +2408,9 @@ Page({
var l_txt = "formData.give_zxlb_id";
//这个是json格式的
var l_txt1 = "formData.g_zxlb_num";
- var ob = [{"num": good.zx_lb_num, "l_id": good.zx_libao}];
+ var ob = [{ "num": good.zx_lb_num, "l_id": good.zx_libao }];
ob = JSON.stringify(ob);
- th.setData({[l_txt]: good.zx_libao, [l_txt1]: ob});
+ th.setData({ [l_txt]: good.zx_libao, [l_txt1]: ob });
}
}
@@ -2388,7 +2445,7 @@ Page({
}
})
this.setData({
- submit:1,
+ submit: 1,
})
},
@@ -2523,8 +2580,8 @@ Page({
'prom_id': th.data.bn_goods.prom_id, //促销活动id
};
- if(getApp().globalData.skinface_id){
- goods.skinface_id=getApp().globalData.skinface_id;
+ if (getApp().globalData.skinface_id) {
+ goods.skinface_id = getApp().globalData.skinface_id;
}
//-- 把导购的信息填入--
@@ -2613,8 +2670,8 @@ Page({
//--如果有赠品的时候,赠品也要提交---
if (th.data.buy_now_gift_goods) {
var gift_gg_arr = th.data.buy_now_gift_goods;
- for(let i in gift_gg_arr){
- let gift_gg=gift_gg_arr[i];
+ for (let i in gift_gg_arr) {
+ let gift_gg = gift_gg_arr[i];
var g_goods = {
'goods_id': gift_gg.goods_id,
'goods_name': gift_gg.goods_name,
@@ -2759,11 +2816,11 @@ Page({
order_prom_list.g_zxlb_num = JSON.stringify(t_item.g_zxlb_num);
}
- if (Object.keys(order_prom_list).length > 0){
- if(order_prom_list.discount_amount)
- order_prom_list.discount_amount= parseFloat(order_prom_list.discount_amount).toFixed(2);
- if(order_prom_list.order_prom_amount)
- order_prom_list.order_prom_amount= parseFloat(order_prom_list.order_prom_amount).toFixed(2);
+ if (Object.keys(order_prom_list).length > 0) {
+ if (order_prom_list.discount_amount)
+ order_prom_list.discount_amount = parseFloat(order_prom_list.discount_amount).toFixed(2);
+ if (order_prom_list.order_prom_amount)
+ order_prom_list.order_prom_amount = parseFloat(order_prom_list.order_prom_amount).toFixed(2);
item.order_prom_list = order_prom_list;
}
@@ -2809,8 +2866,8 @@ Page({
'store_id': oo.stoid,
};
- if(getApp().globalData.skinface_id){
- goods.skinface_id=getApp().globalData.skinface_id;
+ if (getApp().globalData.skinface_id) {
+ goods.skinface_id = getApp().globalData.skinface_id;
}
//-- 线下取价也要写入,组合购的商品不能去线下价格 --
@@ -2913,7 +2970,7 @@ Page({
if (pdata.length == 0) return;
var str = JSON.stringify(pdata);
-
+
wx.showLoading({ title: "加载中" });
wx.request({
url: oo.url + '/api/weshop/order/createWxdOrder',
@@ -3036,7 +3093,7 @@ Page({
},
complete: function () {
th.setData({
- submit:0,
+ submit: 0,
})
}
})
@@ -3232,8 +3289,8 @@ Page({
//------超出重量----------
if (out_of_weight < 0 && o_price >= freight_free && !th.data.is_no_by[pickid]) {
- goods_weight=goods_weight+ out_of_weight;
- if(goods_weight==0) goods_weight=-1;
+ goods_weight = goods_weight + out_of_weight;
+ if (goods_weight == 0) goods_weight = -1;
}
@@ -3247,12 +3304,12 @@ Page({
}
}
- if(th.data.free1 && freight_free<=0) freight_free=th.data.free1;
+ if (th.data.free1 && freight_free <= 0) freight_free = th.data.free1;
//当有包邮和不包邮混合在一起的时候,件数要重新计算
- if(freight_free>0 && o_price >= freight_free && goods_piece>0 && th.data.cut_goods_piece)
- goods_piece=goods_piece-th.data.cut_goods_piece;
+ if (freight_free > 0 && o_price >= freight_free && goods_piece > 0 && th.data.cut_goods_piece)
+ goods_piece = goods_piece - th.data.cut_goods_piece;
//------按件数----------
if (goods_piece > 0 && item['piecemoney']) {
fp_price = parseFloat(item['piecemoney']);
@@ -3263,7 +3320,7 @@ Page({
}
}
//当有包邮和不包邮混合在一起的时候,统一运费要重新计算
- if(freight_free>0 && o_price >= freight_free && th.data.cut_o_shipping_price && price>0) price=price-th.data.cut_o_shipping_price;
+ if (freight_free > 0 && o_price >= freight_free && th.data.cut_o_shipping_price && price > 0) price = price - th.data.cut_o_shipping_price;
var rspice = parseFloat(price + fw_price + fp_price);
return rspice;
@@ -3481,7 +3538,6 @@ Page({
},
-
/*----- 点击选择包邮券 -----*/
sele_quan_item_by: function (e) {
var no_use = e.currentTarget.dataset.no;
@@ -3936,7 +3992,7 @@ Page({
arr[ind].check_quan_ware_list = check_quan_ware_list;
arr[ind].check_quan_price_list = check_quan_price_list;
//是否关闭使用优惠券
- if (th.data.is_close_quan != 1 ) {
+ if (th.data.is_close_quan != 1) {
//--调用接口,获取优惠券的列表,3秒钟内控制接口请求--
var url = "/api/weshop/couponList/getUseCouponList";
await app.request.promiseGet(url, {
@@ -4045,7 +4101,7 @@ Page({
},
//立即购买获取优惠活动的内容
buy_now_prom_goods: function (prom_id, arr, func) {
- var th=this;
+ var th = this;
var price = arr.shop_price * arr.goods_num;
var prom = null;
var gg = to.get_b_now();
@@ -4068,7 +4124,7 @@ Page({
if (res.data.code == 0) {
var get_data = res.data.data;
arr.is_bz = prom.is_bz; //是不是倍增
- arr.is_xz_yh =arr.is_xz_yh?arr.is_xz_yh:prom.is_xz_yh; //是不是优惠
+ arr.is_xz_yh = arr.is_xz_yh ? arr.is_xz_yh : prom.is_xz_yh; //是不是优惠
arr.bs = get_data.bs; //是不是倍数
arr.is_past = get_data.is_past; //是不是包邮
arr.prom_price = get_data.price >= 0 ? get_data.price : price;
@@ -4076,13 +4132,13 @@ Page({
arr.s_coupon_id = get_data.coupon_id;
arr.s_coupon_num = get_data.coupon_num;
arr.zp_mode = get_data.zp_mode;
- arr.zp_num = get_data.zp_num?get_data.zp_num:1; //确保默认一个
+ arr.zp_num = get_data.zp_num ? get_data.zp_num : 1; //确保默认一个
//-- 看是不是有赠品 --
- if (get_data.gift_id && parseInt(get_data.zp_mode)!=1
- && get_data.zp_num* arr.bs<=get_data.limit_num
- && get_data.zp_num* arr.bs<=get_data.gift_storecount
- ){
+ if (get_data.gift_id && parseInt(get_data.zp_mode) != 1
+ && get_data.zp_num * arr.bs <= get_data.limit_num
+ && get_data.zp_num * arr.bs <= get_data.gift_storecount
+ ) {
arr.gift_id = get_data.gift_id;
arr.gift_goods_id = get_data.goods_id;
arr.gift_goods_name = get_data.goods_name;
@@ -4098,34 +4154,34 @@ Page({
}
arr.s_libao = get_data.libao;
arr.s_lb_num = get_data.lb_num;
-
+ arr.lbtitle = get_data.lbtitle;
+ arr.zxlbtitle = get_data.zxlbtitle;
arr.zx_libao = get_data.zxlibao;
arr.zx_lb_num = get_data.zxlb_num;
arr.prom_id = prom_id;
- var send_gf={};
- var pickid=gg.pick_id;
- if(parseInt(get_data.zp_mode)==1){
- if(!send_gf[pickid]) send_gf[pickid]=[];
-
- var a_stock_num=0;
- var a_limit_num=0;
- for(let iy in get_data.giftsinfo){
- let item=get_data.giftsinfo[iy];
- a_stock_num+= parseInt(item.gift_storecount);
- a_limit_num+=parseInt(item.limit_num);
+ var send_gf = {};
+ var pickid = gg.pick_id;
+ if (parseInt(get_data.zp_mode) == 1) {
+ if (!send_gf[pickid]) send_gf[pickid] = [];
+
+ var a_stock_num = 0;
+ var a_limit_num = 0;
+ for (let iy in get_data.giftsinfo) {
+ let item = get_data.giftsinfo[iy];
+ a_stock_num += parseInt(item.gift_storecount);
+ a_limit_num += parseInt(item.limit_num);
}
- var t_zp_num=parseInt(get_data.zp_num)*parseInt(get_data.bs);
- if(a_limit_num>= t_zp_num && a_stock_num>=t_zp_num ){
+ var t_zp_num = parseInt(get_data.zp_num) * parseInt(get_data.bs);
+ if (a_limit_num >= t_zp_num && a_stock_num >= t_zp_num) {
send_gf[pickid].push({
- pickup_id:pickid,giftsinfo:get_data.giftsinfo,zp_num:get_data.zp_num*get_data.bs,
- gf_pr_name:prom.name,prom_id:prom.prom_id});
-
+ pickup_id: pickid, giftsinfo: get_data.giftsinfo, zp_num: get_data.zp_num * get_data.bs,
+ gf_pr_name: prom.name, prom_id: prom.prom_id
+ });
}
-
- th.setData({send_gf:send_gf});
+ th.setData({ send_gf: send_gf });
}
}
func(arr);
@@ -4137,7 +4193,7 @@ Page({
if (this.data.is_b_now == 1) pick = this.data.bn_pick;
//---获取订单优惠---
getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
- data: { store_id: os.stoid, orderAmount: condition,user_id:getApp().globalData.user_id }
+ data: { store_id: os.stoid, orderAmount: condition, user_id: getApp().globalData.user_id }
}).then(res => {
if (res.data.code == 0) {
var data = res.data.data;
@@ -4195,13 +4251,86 @@ Page({
ob.is_xz_yh = prom.is_xz_yh;
ob.goods = new Array();
ob.goods.push({ goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num });
-
var obj = {};
obj[item.prom_id] = ob;
map[pickid] = obj;
}
},
+ //---检查有没有优惠活动---
+ check_is_youhui: function (r_data, pick_id) {
+ let send_lb = this.data.send_lb;
+ let lodash = null;
+ r_data.forEach(item => {
+ if (send_lb[pick_id]) {
+ for (let i = 0; i < send_lb[pick_id].length; i++) {
+ let sends = send_lb[pick_id][i];
+ if (item.lb_id) {
+ if (sends.id === item.lb_id) {
+ sends['num']++;
+ } else {
+ let send_arr1 = send_lb[pick_id].filter(ii => ii.id === item.lb_id);
+ if (send_arr1.length == 0) {
+ if (item.lb_id) {
+ let ob = {};
+ ob.num = 1;
+ ob.title = item.lbtitle;
+ ob.id = item.lb_id;
+ lodash.push(ob);
+ // break;
+ }
+ }
+
+ }
+ }
+ if (item.zxlb_id) {
+ if (sends.id === item.zxlb_id) {
+ sends['num']++;
+ } else {
+ let send_arr = send_lb[pick_id].filter(ii => ii.id === item.zxlb_id);
+ if (send_arr.length == 0) {
+ if (item.zxlb_id) {
+ let ob = {};
+ ob.num = 1;
+ ob.flag = 1;
+ ob.title = item.zxlbtitle;
+ ob.id = item.zxlb_id;
+ lodash.push(ob);
+ // break;
+ }
+ }
+ }
+ }
+ }
+
+ } else {
+ let arr = new Array();
+ if (item.lb_id) {
+ let ob = {};
+ ob.num = 1;
+ ob.title = item.lbtitle;
+ ob.id = item.lb_id;
+ arr.push(ob);
+ }
+ if (item.zxlb_id) {
+ let ob = {};
+ ob.num = 1;
+ ob.flag = 1;
+ ob.title = item.zxlbtitle;
+ ob.id = item.zxlb_id;
+ arr.push(ob);
+ }
+ send_lb[pick_id] = arr;
+ lodash = JSON.parse(JSON.stringify(send_lb[pick_id]));
+ }
+ })
+ send_lb[pick_id] = lodash;
+ th.setData({
+ send_lb,
+ })
+
+
+ },
//计算立即购买赠品的物流费用
get_now_gift_goods_wuliu: function (code, o_shipping_price, user_addr, gift_freight_free, out_of_weight, allpice, rs, shipping_price, no_by_data, goods_weight1, goods_piece1) {
@@ -4209,8 +4338,7 @@ Page({
var goods_weight = -1, goods_piece = -1;
var gift_shipping_price = 0;
- if (shipping_price)
- {
+ if (shipping_price) {
gift_shipping_price = shipping_price;
}
var th = this;
@@ -4226,8 +4354,8 @@ Page({
}
}
- for(var i in good_arr) {
- var good=good_arr[i];
+ for (var i in good_arr) {
+ var good = good_arr[i];
switch (good['exp_sum_type']) {
case 1:
//统一运费
@@ -4247,7 +4375,7 @@ Page({
case 3:
if (goods_piece < 0) goods_piece = 0;
//累积商品数量
- goods_piece += parseInt(good['buynum']) ;
+ goods_piece += parseInt(good['buynum']);
if (goods_piece1) {
goods_piece += goods_piece1;
}
@@ -4259,14 +4387,14 @@ Page({
if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) {
gift_freight_free = 0;
// out_of_weight = 0
- th.data.is_no_by[th.data.bn_pick]=1;
+ th.data.is_no_by[th.data.bn_pick] = 1;
}
}
}
var t_shipping_price =
this.calculatewuliu(code, gift_shipping_price, goods_weight, out_of_weight,
- goods_piece, user_addr, gift_freight_free, allpice, rs,th.data.bn_pick);
+ goods_piece, user_addr, gift_freight_free, allpice, rs, th.data.bn_pick);
return t_shipping_price;
},
@@ -4334,6 +4462,20 @@ Page({
this.setData({ is_offline_show: 1, show_off_price: off_price.toFixed(2), is_get_offline: is_get_offline });
},
+ // 促销 -> 送礼包 -> 查看详情
+ viewLbDetails(e) {
+ let id = e.currentTarget.dataset.id; // 获取礼包id
+ let flag = e.currentTarget.dataset.flag;
+ let url = '';
+ if (flag == 1) { // flag =1 控制跳转到专享礼包
+ url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`;
+ } else {
+ url = `/packageA/pages/myGiftDetails/myGiftDetails?btn=0&index=0&id=${id}`; // btn=0 控制跳转到的页面不显示按钮
+ };
+ // console.log('myurl', url);
+ getApp().goto(url);
+ },
+
//确定使用线下取价
sure_offline: function () {
var bn_goods = this.data.bn_goods;
@@ -4459,7 +4601,7 @@ Page({
},
//订阅消息提醒
sendsm: function (func) {
- let th =this;
+ let th = this;
var template_id = this.data.template_id;
// //授权订阅
wx.requestSubscribeMessage({
@@ -4467,417 +4609,417 @@ Page({
success(res) {
func();
th.setData({
- submit:0,
+ submit: 0,
})
},
fail(res) {
func();
th.setData({
- submit:0,
+ submit: 0,
})
}
})
},
- setexptype2: function(e) {
- this.debounce(this.setexptype.bind(this, e),400)();
- },
-
- setexptype_w2: function(e) {
- this.debounce(this.setexptype_w.bind(this, e),400)();
- },
-
- // 函数防抖
- debounce: function (func, wait) {
- return () => {
- clearTimeout(timer);
- timer = setTimeout(func, wait);
- };
- },
-
-
- //-- 判断是不是选中 --
- check_th_item:function (e) {
- var th=this;
- var idx=e.currentTarget.dataset.item;
- var check=e.currentTarget.dataset.check;
- var txt="giftsinfo["+idx+"].selected";
- var gift_item=this.data.giftsinfo[idx];
-
- if(check){
- th.setData({[txt]:0});
- }else{
-
- var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,gift_item.goods_num);
- if(!is_true){ return false; }
-
- th.setData({[txt]:1});
- }
- },
-
-
- //输入框输入数量的时候
- valueToNum:function (e){
- var th=this;
- var idx=e.currentTarget.dataset.item;
- var gift_item=this.data.giftsinfo[idx];
- var num=parseInt(e.detail.value);
- var txt="giftsinfo["+idx+"].goods_num";
- var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,num);
- if(!is_true){
- th.setData({[txt]:1});
- return false;
- }
- th.setData({[txt]:num});
+ setexptype2: function (e) {
+ this.debounce(this.setexptype.bind(this, e), 400)();
+ },
- },
+ setexptype_w2: function (e) {
+ this.debounce(this.setexptype_w.bind(this, e), 400)();
+ },
+ // 函数防抖
+ debounce: function (func, wait) {
+ return () => {
+ clearTimeout(timer);
+ timer = setTimeout(func, wait);
+ };
+ },
- addNum:function (e) {
- var th=this;
- var idx=e.currentTarget.dataset.item;
- var txt="giftsinfo["+idx+"].goods_num";
- var num=th.data.giftsinfo[idx].goods_num+1;
- var gift_item=this.data.giftsinfo[idx];
- var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,num);
- if(!is_true){ return false; }
- th.setData({[txt]:num});
- },
-
- subNum:function (e) {
- var th=this;
- var idx=e.currentTarget.dataset.item;
- var txt="giftsinfo["+idx+"].goods_num";
- var num=th.data.giftsinfo[idx].goods_num-1;
- var gift_item=this.data.giftsinfo[idx];
- var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,num);
- if(!is_true){
- return false;
- }
- if(num<1) return false;
- th.setData({[txt]:num});
- },
+ //-- 判断是不是选中 --
+ check_th_item: function (e) {
+ var th = this;
+ var idx = e.currentTarget.dataset.item;
+ var check = e.currentTarget.dataset.check;
+ var txt = "giftsinfo[" + idx + "].selected";
+ var gift_item = this.data.giftsinfo[idx];
+
+ if (check) {
+ th.setData({ [txt]: 0 });
+ } else {
+
+ var is_true = th.check_out_num_cart(gift_item, this.data.gift_pkid, gift_item.goods_num);
+ if (!is_true) { return false; }
+
+ th.setData({ [txt]: 1 });
+ }
+ },
+
+
+ //输入框输入数量的时候
+ valueToNum: function (e) {
+ var th = this;
+ var idx = e.currentTarget.dataset.item;
+ var gift_item = this.data.giftsinfo[idx];
+ var num = parseInt(e.detail.value);
+ var txt = "giftsinfo[" + idx + "].goods_num";
+ var is_true = th.check_out_num_cart(gift_item, this.data.gift_pkid, num);
+ if (!is_true) {
+ th.setData({ [txt]: 1 });
+ return false;
+ }
+ th.setData({ [txt]: num });
+
+ },
+
+
+
+ addNum: function (e) {
+ var th = this;
+ var idx = e.currentTarget.dataset.item;
+ var txt = "giftsinfo[" + idx + "].goods_num";
+ var num = th.data.giftsinfo[idx].goods_num + 1;
+ var gift_item = this.data.giftsinfo[idx];
+ var is_true = th.check_out_num_cart(gift_item, this.data.gift_pkid, num);
+ if (!is_true) { return false; }
+ th.setData({ [txt]: num });
+ },
+
+ subNum: function (e) {
+ var th = this;
+ var idx = e.currentTarget.dataset.item;
+ var txt = "giftsinfo[" + idx + "].goods_num";
+ var num = th.data.giftsinfo[idx].goods_num - 1;
+ var gift_item = this.data.giftsinfo[idx];
+ var is_true = th.check_out_num_cart(gift_item, this.data.gift_pkid, num);
+ if (!is_true) {
+ return false;
+ }
+ if (num < 1) return false;
+ th.setData({ [txt]: num });
+ },
//-- 点击选中赠品 --
- show_sele_gift:function (e) {
- var index=e.currentTarget.dataset.index;
- var pk=e.currentTarget.dataset.pk;
- var giftsinfo=this.data.send_gf[pk][index].giftsinfo;
-
- for(let i in giftsinfo){
- let item=giftsinfo[i];
- if(!item.goods_num) giftsinfo[i].goods_num=1;
+ show_sele_gift: function (e) {
+ var index = e.currentTarget.dataset.index;
+ var pk = e.currentTarget.dataset.pk;
+ var giftsinfo = this.data.send_gf[pk][index].giftsinfo;
+
+ for (let i in giftsinfo) {
+ let item = giftsinfo[i];
+ if (!item.goods_num) giftsinfo[i].goods_num = 1;
}
this.setData({
- show_duo_gift:1,
- giftsinfo:giftsinfo,
- gf_pr_name:this.data.send_gf[pk][index].gf_pr_name,
- zp_num:this.data.send_gf[pk][index].zp_num,
- gift_pkid:pk,
- gf_prom_id:this.data.send_gf[pk][index].prom_id,
- send_gf_index:index
+ show_duo_gift: 1,
+ giftsinfo: giftsinfo,
+ gf_pr_name: this.data.send_gf[pk][index].gf_pr_name,
+ zp_num: this.data.send_gf[pk][index].zp_num,
+ gift_pkid: pk,
+ gf_prom_id: this.data.send_gf[pk][index].prom_id,
+ send_gf_index: index
})
},
- close_sele_gift:function () {
- this.setData({show_duo_gift:0})
+ close_sele_gift: function () {
+ this.setData({ show_duo_gift: 0 })
},
//购物车赠品有咩有超出库存。有灭有超出限购
- check_out_num_cart:function(discount,pick_id,num) {
- var prom_id= discount.prom_id;
- var alllist=this.data.cartlist;
- var all_num=num;
- var all_limit_num=num;
- var gift_id=discount.gift_id;
- for (var i in alllist) {
- var list_item = alllist[i];
- //-- 门店相同,活动相同的时候 --
- if(pick_id==list_item.pickup_id && prom_id==list_item.prom_id) continue;
- for (var j in list_item.goods) {
- //如果赠品的ID一样,要进行统计数量
- if (list_item.goods[j].is_gift == 1 &&
- list_item.goods[j].gift_id == gift_id) {
- all_num += list_item.goods[j].goods_num;
- }
- if (list_item.goods[j].is_gift == 1 && list_item.goods[j].gift_id ==gift_id && list_item.goods[j].prom_id == prom_id) {
- all_limit_num += list_item.goods[j].limit_num;
- }
- }
- }
- //-- 赠品的数量超出库存数量和会员的限制,
- // 这里是保证所有的赠品部会超出 --
- if (discount.gift_storecount < all_num ) {
- wx.showToast({
- title: "赠品库存不足",
- icon: 'none',
- duration: 2000
- });
- return false;
- }
- if (discount.limit_num < all_limit_num) {
- wx.showToast({
- title:"超出赠品限购",
- icon: 'none',
- duration: 2000
- });
- return false;
- }
- return true;
- },
-
- //-- 确定赠品 --
- sure_this_gift:async function () {
- var th = this;
- var gf_pickup_id = this.data.gift_pkid;
-
- var zp_num = this.data.zp_num;
- var giftsinfo = this.data.giftsinfo;
- var all_num = 0;
- for (let i in giftsinfo) {
- let item = giftsinfo[i];
- if (!item.selected) continue;
- all_num += item.goods_num;
- }
- if (all_num > zp_num) {
- wx.showToast({
- title: "超出活动赠品赠送的数量" + zp_num + "件",
- icon: 'none',
- duration: 2000
- });
- return false;
- }
- if (all_num < zp_num) {
- wx.showToast({
- title: "您还可以加" + (zp_num - all_num) + "件",
- icon: 'none',
- duration: 2000
- });
- return false;
- }
-
- //-- 当是购物车购买的时候 --
- if(this.data.cartlist && this.data.cartlist.length>0){
- var alllist = this.data.cartlist;
- var index = alllist.findIndex(function (e) {
- return e.pickup_id == gf_pickup_id
- });
- var pk_list_goods = alllist[index].goods;
-
- var url = "/api/weshop/cart/delGift?store_id=" + os.stoid + "&user_id="
- + getApp().globalData.user_id + "&is_gift=1&pick_id=" + this.data.gift_pkid + "&prom_id=" + this.data.prom_id;
- await getApp().request.promiseDelete(url, {});
-
- var new_pk_list_goods = [];
- for (let i in pk_list_goods) {
- let item = pk_list_goods[i];
- if (item.is_gift && item.prom_id == this.data.gf_prom_id) {
- continue;
- }
- new_pk_list_goods.push(item)
- }
-
- //-- 循环把赠品添加进去 --
- for (var i = 0; i < giftsinfo.length; i++) {
- var gf_item = giftsinfo[i];
- if (!gf_item.selected) continue;
- var add_data = null;
- var newd = {
- goods_id: gf_item.goodsinfo.goods_id,
- goods_num: gf_item.goods_num,
- pick_id: gf_pickup_id,
- user_id: app.globalData.user_id,
- store_id: os.stoid,
- goods_price: 0,
- member_goods_price: 0,
- goods_name: gf_item.goodsinfo.goods_name,
- goods_sn: gf_item.goodsinfo.goods_sn,
- sku: gf_item.goodsinfo.sku,
- is_gift: 1,
- prom_id: th.data.gf_prom_id,
- prom_type: 3,
- selected: 1,
- gift_id: gf_item.gift_id,
- original_img: th.data.imgUrl + gf_item.goodsinfo.original_img,
- exp_sum_type: gf_item.goodsinfo.exp_sum_type,
- is_free_shipping: gf_item.goodsinfo.is_free_shipping,
- weight: gf_item.goodsinfo.weight,
- uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
- goods_spec: gf_item.goodsinfo.goods_spec,
- goods_color: gf_item.goodsinfo.goods_color,
- };
-
- await getApp().request.promisePost("/api/weshop/cart/save", {
- data: newd
- }).then(res => {
- if (res.data.code == 0) {
- add_data = res.data.data;
- }
- })
- if (add_data) {
- newd.id = add_data.id;
- new_pk_list_goods.push(newd);
- }
- }
-
- var set_data = this.data.send_gf[gf_pickup_id][this.data.send_gf_index];
- set_data.selected = 1;
- var txt9 = "cartlist[" + index + "].goods";
-
- th.setData({[txt9]: new_pk_list_goods, send_gf: this.data.send_gf});
- this.data.old_cartlist[index].goods = new_pk_list_goods;
-
-
- console.log(this.data.send_gf,"----");
-
- th.calculatePrice();
- }else{
- var new_pk_list_goods=[];
- //-- 当是立即购买的时候 --
- for (var i = 0; i < giftsinfo.length; i++) {
- var gf_item = giftsinfo[i];
- if (!gf_item.selected) continue;
- var newd = {
- goods_id: gf_item.goodsinfo.goods_id,
- buynum: gf_item.goods_num,
- pick_id: gf_pickup_id,
- user_id: app.globalData.user_id,
- store_id: os.stoid,
- goods_price: 0,
- member_goods_price: 0,
- goods_name: gf_item.goodsinfo.goods_name,
- goods_sn: gf_item.goodsinfo.goods_sn,
- sku: gf_item.goodsinfo.sku,
- is_gift: 1,
- prom_id: th.data.gf_prom_id,
- prom_type: 3,
- selected: 1,
- gift_id: gf_item.gift_id,
- original_img: th.data.imgUrl + gf_item.goodsinfo.original_img,
- exp_sum_type: gf_item.goodsinfo.exp_sum_type,
- is_free_shipping: gf_item.goodsinfo.is_free_shipping,
- weight: gf_item.goodsinfo.weight,
- uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
- uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
- goods_spec: gf_item.goodsinfo.goods_spec,
- goods_color: gf_item.goodsinfo.goods_color,
- };
- new_pk_list_goods.push(newd);
- }
- var set_data = this.data.send_gf[th.data.bn_pick][this.data.send_gf_index];
- set_data.selected = 1;
- var txt1 = "send_gf[" + gf_pickup_id + "][" + this.data.send_gf_index + "]";
-
- th.setData({buy_now_gift_goods:new_pk_list_goods,[txt1]:set_data});
- th.calculatePrice2();
-
- }
- th.close_sele_gift();
- },
-
- //获取输入
- getInput:function (e) {
- this.data.gift_sear=e.detail.value;
- },
- //-- 搜索赠品 --
- submitSearch:function () {
- var giftsinfo=this.data.giftsinfo;
- if(!this.data.gift_sear){
- for(let i in giftsinfo){
- let item=giftsinfo[i];
- item.hide_div=0;
- }
- }else{
- for(let i in giftsinfo){
- let item=giftsinfo[i];
- item.hide_div=0;
- if(item.goods_name.indexOf(this.data.gift_sear)==-1){
- item.hide_div=1;
- }
- }
- }
- this.setData({giftsinfo:giftsinfo})
-
- },
-
- //-- 赠品的验证 --
- sub_check_gift(func){
- var th=this;
- if(th.data.send_gf){
- var error_arr=[];
- for(let io in th.data.send_gf){
- let item_arr=th.data.send_gf[io];
- for(let ip in item_arr){
- var gf_pr_name=item_arr[ip].gf_pr_name;
- var zp_num=item_arr[ip].zp_num;
- var giftsinfo=item_arr[ip].giftsinfo;
- var limit_all=0;
- var stock_all=0;
- for(let iu in giftsinfo){
- let gf_item=giftsinfo[iu];
- limit_all+=gf_item.limit_num;
- stock_all+=gf_item.gift_storecount;
- }
- if(limit_all zp_num) {
+ wx.showToast({
+ title: "超出活动赠品赠送的数量" + zp_num + "件",
+ icon: 'none',
+ duration: 2000
+ });
+ return false;
+ }
+ if (all_num < zp_num) {
+ wx.showToast({
+ title: "您还可以加" + (zp_num - all_num) + "件",
+ icon: 'none',
+ duration: 2000
+ });
+ return false;
+ }
+
+ //-- 当是购物车购买的时候 --
+ if (this.data.cartlist && this.data.cartlist.length > 0) {
+ var alllist = this.data.cartlist;
+ var index = alllist.findIndex(function (e) {
+ return e.pickup_id == gf_pickup_id
+ });
+ var pk_list_goods = alllist[index].goods;
+
+ var url = "/api/weshop/cart/delGift?store_id=" + os.stoid + "&user_id="
+ + getApp().globalData.user_id + "&is_gift=1&pick_id=" + this.data.gift_pkid + "&prom_id=" + this.data.prom_id;
+ await getApp().request.promiseDelete(url, {});
+
+ var new_pk_list_goods = [];
+ for (let i in pk_list_goods) {
+ let item = pk_list_goods[i];
+ if (item.is_gift && item.prom_id == this.data.gf_prom_id) {
+ continue;
+ }
+ new_pk_list_goods.push(item)
+ }
+
+ //-- 循环把赠品添加进去 --
+ for (var i = 0; i < giftsinfo.length; i++) {
+ var gf_item = giftsinfo[i];
+ if (!gf_item.selected) continue;
+ var add_data = null;
+ var newd = {
+ goods_id: gf_item.goodsinfo.goods_id,
+ goods_num: gf_item.goods_num,
+ pick_id: gf_pickup_id,
+ user_id: app.globalData.user_id,
+ store_id: os.stoid,
+ goods_price: 0,
+ member_goods_price: 0,
+ goods_name: gf_item.goodsinfo.goods_name,
+ goods_sn: gf_item.goodsinfo.goods_sn,
+ sku: gf_item.goodsinfo.sku,
+ is_gift: 1,
+ prom_id: th.data.gf_prom_id,
+ prom_type: 3,
+ selected: 1,
+ gift_id: gf_item.gift_id,
+ original_img: th.data.imgUrl + gf_item.goodsinfo.original_img,
+ exp_sum_type: gf_item.goodsinfo.exp_sum_type,
+ is_free_shipping: gf_item.goodsinfo.is_free_shipping,
+ weight: gf_item.goodsinfo.weight,
+ uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
+ goods_spec: gf_item.goodsinfo.goods_spec,
+ goods_color: gf_item.goodsinfo.goods_color,
+ };
+
+ await getApp().request.promisePost("/api/weshop/cart/save", {
+ data: newd
+ }).then(res => {
+ if (res.data.code == 0) {
+ add_data = res.data.data;
+ }
+ })
+ if (add_data) {
+ newd.id = add_data.id;
+ new_pk_list_goods.push(newd);
+ }
+ }
+
+ var set_data = this.data.send_gf[gf_pickup_id][this.data.send_gf_index];
+ set_data.selected = 1;
+ var txt9 = "cartlist[" + index + "].goods";
+
+ th.setData({ [txt9]: new_pk_list_goods, send_gf: this.data.send_gf });
+ this.data.old_cartlist[index].goods = new_pk_list_goods;
+
+
+ console.log(this.data.send_gf, "----");
+
+ th.calculatePrice();
+ } else {
+ var new_pk_list_goods = [];
+ //-- 当是立即购买的时候 --
+ for (var i = 0; i < giftsinfo.length; i++) {
+ var gf_item = giftsinfo[i];
+ if (!gf_item.selected) continue;
+ var newd = {
+ goods_id: gf_item.goodsinfo.goods_id,
+ buynum: gf_item.goods_num,
+ pick_id: gf_pickup_id,
+ user_id: app.globalData.user_id,
+ store_id: os.stoid,
+ goods_price: 0,
+ member_goods_price: 0,
+ goods_name: gf_item.goodsinfo.goods_name,
+ goods_sn: gf_item.goodsinfo.goods_sn,
+ sku: gf_item.goodsinfo.sku,
+ is_gift: 1,
+ prom_id: th.data.gf_prom_id,
+ prom_type: 3,
+ selected: 1,
+ gift_id: gf_item.gift_id,
+ original_img: th.data.imgUrl + gf_item.goodsinfo.original_img,
+ exp_sum_type: gf_item.goodsinfo.exp_sum_type,
+ is_free_shipping: gf_item.goodsinfo.is_free_shipping,
+ weight: gf_item.goodsinfo.weight,
+ uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
+ uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
+ goods_spec: gf_item.goodsinfo.goods_spec,
+ goods_color: gf_item.goodsinfo.goods_color,
+ };
+ new_pk_list_goods.push(newd);
+ }
+ var set_data = this.data.send_gf[th.data.bn_pick][this.data.send_gf_index];
+ set_data.selected = 1;
+ var txt1 = "send_gf[" + gf_pickup_id + "][" + this.data.send_gf_index + "]";
+
+ th.setData({ buy_now_gift_goods: new_pk_list_goods, [txt1]: set_data });
+ th.calculatePrice2();
+
+ }
+ th.close_sele_gift();
+ },
+
+ //获取输入
+ getInput: function (e) {
+ this.data.gift_sear = e.detail.value;
+ },
+ //-- 搜索赠品 --
+ submitSearch: function () {
+ var giftsinfo = this.data.giftsinfo;
+ if (!this.data.gift_sear) {
+ for (let i in giftsinfo) {
+ let item = giftsinfo[i];
+ item.hide_div = 0;
+ }
+ } else {
+ for (let i in giftsinfo) {
+ let item = giftsinfo[i];
+ item.hide_div = 0;
+ if (item.goods_name.indexOf(this.data.gift_sear) == -1) {
+ item.hide_div = 1;
+ }
+ }
+ }
+ this.setData({ giftsinfo: giftsinfo })
+
+ },
+
+ //-- 赠品的验证 --
+ sub_check_gift(func) {
+ var th = this;
+ if (th.data.send_gf) {
+ var error_arr = [];
+ for (let io in th.data.send_gf) {
+ let item_arr = th.data.send_gf[io];
+ for (let ip in item_arr) {
+ var gf_pr_name = item_arr[ip].gf_pr_name;
+ var zp_num = item_arr[ip].zp_num;
+ var giftsinfo = item_arr[ip].giftsinfo;
+ var limit_all = 0;
+ var stock_all = 0;
+ for (let iu in giftsinfo) {
+ let gf_item = giftsinfo[iu];
+ limit_all += gf_item.limit_num;
+ stock_all += gf_item.gift_storecount;
+ }
+ if (limit_all < zp_num) {
+ error_arr.push(gf_pr_name + "限购不足");
+ }
+ if (stock_all < zp_num) {
+ error_arr.push(gf_pr_name + "赠品库存不足");
+ }
+ }
+ }
+
+ //-- 有赠品错误的时候,是不是继续下单 --
+ if (error_arr.length) {
+ var err = error_arr.join(",");
+ wx.showModal({
+ title: '提示',
+ content: err + ',无法赠送赠品,是否继续下单',
+ success(res) {
+ if (res.confirm) {
+ func();
+ } else if (res.cancel) {
+ console.log('用户点击取消');
+ th.setData({
+ submit: 0,
+ })
+ }
+ }
+ })
+ } else {
+
+ var is_ok = 1;
+ var error_arr = [];
+ for (let io in th.data.send_gf) {
+ let item_arr1 = th.data.send_gf[io];
+ for (let ip1 in item_arr1) {
+ var item_b = item_arr1[ip1];
+ if (!item_b.selected) {
+ is_ok = 0;
+ break;
+ }
+ }
+ if (!is_ok) break;
+ }
+
+ if (!is_ok) {
+ getApp().confirmBox("请选择赠品");
+ th.setData({
+ submit: 0,
+ })
+ return false;
+ }
+ func();
+ }
+
+
+ } else {
+ func();
+ }
+ }
diff --git a/pages/cart/cart2/cart2.wxml b/pages/cart/cart2/cart2.wxml
index 6588255..d80a6ae 100644
--- a/pages/cart/cart2/cart2.wxml
+++ b/pages/cart/cart2/cart2.wxml
@@ -8,24 +8,20 @@
- 门店自提
+ 门店自提
- 快递邮寄
+ 快递邮寄
-
+
- 门店自提
+ 门店自提
- 快递邮寄
+ 快递邮寄
@@ -82,7 +78,7 @@
-
+
{{items.goods_name}}
@@ -104,8 +100,9 @@
- image>
- {{show_card.CardName}}
+
+ image>
+ {{show_card.CardName}}
立减 {{filters.toFix(item.card_cut_price,2) }} 元
@@ -119,19 +116,7 @@
-
-
-
- 优惠券{{item.can_num}}张可用
-
- 不使用
- ¥{{using_quan[item.pickup_id].money}}元优惠券
- 包邮券
-
-
-
-
+
@@ -142,9 +127,8 @@
-
-
+
+
@@ -166,14 +150,13 @@
- 快递邮寄
+ 快递邮寄
-
+
{{wu_arr[item.wind].name}}
@@ -181,69 +164,92 @@
-
-
-
- 选择物流
-
- {{wu_arr[item.wind].name}}
-
+
+
+
+ 选择物流
+
+ {{wu_arr[item.wind].name}}
+
+
-
+
+
+
+
+
+ 赠{{send.zxlbtitle?send.zxlbtitle:send.lbtitle}}
+
+
+
+ x{{send.num}}
+
+
+
+
-
-
- 赠{{iter.name}} 可选赠品{{iter.zp_num}}个
-
+
+
+ 赠{{iter.name}} 可选赠品{{iter.zp_num}}个
+
-
- 已选择
-
+
+ 已选择
+
-
+
未选择
-
+
-
+
+
+
+
+ 优惠券{{item.can_num}}张可用
+
+ 不使用
+ ¥{{using_quan[item.pickup_id].money}}元优惠券
+ 包邮券
+
+
+
+
+
留言
-
+
-
-
- 店铺优惠
-
- 省{{filters.toFix(item.offline_price,2)}}元
-
-
- -¥{{filters.toFix(item.offline_price,2)}}
-
-
- 不使用优惠
-
-
-
-
+
+
+ 店铺优惠
+
+ 省{{filters.toFix(item.offline_price,2)}}元
+
+
+ -¥{{filters.toFix(item.offline_price,2)}}
+
+
+ 不使用优惠
+
+
+
+
@@ -286,27 +292,27 @@
-
-
-
+
+
+
-
-
-
- {{item.goods_name}}
-
-
-
- {{filters.show_gui_ge(item.goods_spec,item.goods_color)}}
-
+
-
-
- ¥0
- x{{item.buynum}}
-
-
-
+
+ {{item.goods_name}}
+
+
+
+ {{filters.show_gui_ge(item.goods_spec,item.goods_color)}}
+
+
+
+
+ ¥0
+ x{{item.buynum}}
+
+
+
@@ -333,12 +339,13 @@
-
+
- image>
- {{show_card.CardName}}
+
+ image>
+ {{show_card.CardName}}
立减 {{filters.toFix(card_cut_price,2) }} 元
@@ -351,6 +358,55 @@
立即开通
+
+
+
+
+ 赠{{bn_goods.lbtitle}}
+
+
+
+ x{{bn_goods.s_lb_num}}
+
+
+
+
+
+
+
+ 赠{{bn_goods.zxlbtitle}}
+
+
+
+ x{{bn_goods.zx_lb_num}}
+
+
+
+
+
+
+
+
+
+
+ 赠{{iter.name}} 可选赠品{{iter.zp_num}}个
+
+
+
+ 已选择
+
+
+
+ 未选择
+
+
+
+
+
+
+
+
+
@@ -377,41 +433,20 @@
选择物流
- {{wu_arr[index].name}}
-
+ {{wu_arr[index].name}}
+
-
-
-
-
-
- 赠{{iter.name}} 可选赠品{{iter.zp_num}}个
-
-
-
- 已选择
-
-
- 未选择
-
-
-
-
-
留言
-
+
@@ -422,10 +457,10 @@
省{{filters.toFix(bn_goods.shop_price-bn_goods.offline_price,2)}}元
- -¥{{filters.toFix(bn_goods.shop_price-bn_goods.offline_price,2)}}
+ -¥{{filters.toFix(bn_goods.shop_price-bn_goods.offline_price,2)}}
- 不使用优惠
+ 不使用优惠
@@ -487,7 +522,7 @@
应付金额:¥{{formData.order_amount}}
-
+
@@ -519,8 +554,7 @@
-
+
@@ -561,8 +595,7 @@
-
+
@@ -605,8 +638,7 @@
-
+
@@ -672,8 +704,7 @@
-
+
Γ
@@ -703,77 +734,77 @@
店铺优惠
- 优惠¥{{show_off_price}}
-
- 不用优惠
-
+ 优惠¥{{show_off_price}}
+
+
+ 不用优惠
+
+
-
+
-
+
-
+
-
+
{{gf_pr_name}},可任选{{zp_num}}件商品为赠品
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{items.goods_name}}
-
-
-
-
-
- {{items.goods_name}}
-
-
-
- {{items.goodsinfo.goods_color}}{{items.goodsinfo.goods_color?"/":''}}{{items.goodsinfo.goods_spec}}
- 规格1
+
+
+ {{items.goodsinfo.goods_color}}{{items.goodsinfo.goods_color?"/":''}}{{items.goodsinfo.goods_spec}}
+ 规格1
+
-
-
+
¥
{{items.goodsinfo.shop_price}}
一
-
- +
+
+ +
+
-
-
+
-
+
-
-
+
\ No newline at end of file
diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js
index 11fd6c8..cd914f8 100644
--- a/pages/giftpack/buygiftpack/giftpackbuy.js
+++ b/pages/giftpack/buygiftpack/giftpackbuy.js
@@ -70,6 +70,7 @@ Page({
onLoad: function (options) {
this.setData({
params: options,
+ now:Date.parse(new Date()) / 1000,
})
},
diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxml b/pages/giftpack/buygiftpack/giftpackbuy.wxml
index 338b8a4..57948bd 100644
--- a/pages/giftpack/buygiftpack/giftpackbuy.wxml
+++ b/pages/giftpack/buygiftpack/giftpackbuy.wxml
@@ -1,118 +1,126 @@
-
+
+
-
+
-
-
-
-
-
-
-
-
- 礼包列表
-
-
-
- 我的礼包
-
-
-
-
-
-
-
-
-
-
-
- {{items.giftTitle}}
-
-
-
- {{"¥"+items.payMoney}}
-
-
- /
-
-
-
- {{items.payIntegral}}
- 积分
-
-
-
-
- {{"零售价:¥"+items.giftPosPrice}}
-
-
- {{"活动结束时间:"+items.endTime}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
- 到底了
-
-
+
+
+
+ 礼包列表
+
+
+
+ 我的礼包
+
+
+
+
+
+
+
+
+
+
+
+ {{items.giftTitle}}
+
+
+
+ {{"¥"+items.payMoney}}
+
+
+ /
+
+
+
+ {{items.payIntegral}}
+ 积分
+
+
+
+
+ {{"零售价:¥"+items.giftPosPrice}}
+
+
+ {{"活动开始时间:"+items.starTime}}
+
+
+ {{"活动结束时间:"+items.endTime}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 到底了
+
+
diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js
index f176cb3..7123c06 100644
--- a/pages/giftpack/giftpacklist/giftpacklist.js
+++ b/pages/giftpack/giftpacklist/giftpacklist.js
@@ -333,6 +333,9 @@ Page({
var sele_g=res.data.data;
+ //需不需要门店,不需要门店返回
+ if(!sele_g.is_pickup) return false;
+
com.wait_for_store_config(_this2);
com.set_user_mo_store(_this2,os,function () {
if(sele_g.pickup_list && _this2.data.def_pick_store){
diff --git a/pages/giftpack/public/buy_com.js b/pages/giftpack/public/buy_com.js
index 95adf88..6013fb5 100644
--- a/pages/giftpack/public/buy_com.js
+++ b/pages/giftpack/public/buy_com.js
@@ -227,7 +227,7 @@ module.exports = {
json.guide_id=that.data.guide_id
}
- if(that.data.def_pick_store){
+ if(th.data.sele_g.is_pickup && that.data.def_pick_store){
json.pickup_id=that.data.def_pick_store.pickup_id;
}
diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js
index 71daaa0..96cdd72 100644
--- a/pages/goods/categoryList/categoryList.js
+++ b/pages/goods/categoryList/categoryList.js
@@ -99,8 +99,8 @@ Page({
//-- user_id代过来免登录 --
getApp().globalData.first_leader=first_leader;
}
-
-
+
+ if(tt.type) this.data.type= parseInt(tt.type);
that.get_brand();
clearInterval(that.data.timer);
@@ -267,18 +267,20 @@ Page({
else if (that.data.is_show_pp) {that.setData({ currentTab: 2 });that.get_brand(); }
else if (that.data.is_show_xm) {that.setData({ currentTab: 3 });that.getServiceCategory(); }
+
+ var t_type=that.data.type;
//----求传参过来的控制-----
- if (getApp().globalData.cat_type == 1 && that.data.is_show_gb ) {
- that.setData({ currentTab: 1 });
+ if (t_type == 1 && that.data.is_show_gb ) {
+ that.setData({ currentTab: 1,select_classify_on:223 });
that.get_nation();
- } else if (getApp().globalData.cat_type == 2 && that.data.is_show_pp ) {
- that.setData({ currentTab: 2 });
+ } else if (t_type == 2 && that.data.is_show_pp ) {
+ that.setData({ currentTab: 2,select_classify_on:220});
that.get_brand();
- } else if (getApp().globalData.cat_type == 3 && that.data.is_show_xm ) {
- that.setData({ currentTab: 3 });
+ } else if (t_type == 3 && that.data.is_show_xm ) {
+ that.setData({ currentTab: 3,select_classify_on:221 });
that.getServiceCategory();
} else if (that.data.is_show_pl) {
- that.setData({ currentTab: 0 });
+ that.setData({ currentTab: 0,select_classify_on:0 });
}
// 获取默认选中的第一个
if(that.data.is_show_gb && that.data.select_classify_on == 223){
@@ -370,6 +372,38 @@ Page({
}
//console.log(arr)
t.setData({one_level_classify:arr});
+ if(t.data.select_classify_on==0){
+ var item=arr[0];
+
+ var name = item.items.name;
+ var cid = item.items.cid;
+ var arr = item.array;
+
+
+ if (arr.length == 0) {
+ t.setData({
+ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid,
+ goodslist: null, is_level_three: 0
+ });
+ return false;
+ }
+ if (arr.length != 0) {
+ var is_lev_thr = 0
+ for (var i = 0; i < arr.length; i++) {
+ if (arr[i].arrays.length > 0) { is_lev_thr = 1; break; }
+ }
+ t.setData({ is_level_three: is_lev_thr });
+
+ if (this.data.is_level_three != 1) {
+ t.setData({ index: 0, classify_name: name, goodslist: arr });
+ } else {
+ t.setData({ index: 0, goodslist: arr });
+ }
+ }
+
+ t.style(t.data.stylePage, cid)
+
+ }
}
}
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index e054985..f492419 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -5054,6 +5054,7 @@ Page({
var type = this.data.prom_type;
if (type == 2) type = -1;
if (type == 6) type = 2; // 6拼团 2团购
+ if (type == 10) type = -1;
if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
@@ -5159,8 +5160,7 @@ Page({
context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 75 * unit);
}
- }
- ;
+ };
var share_title = th.data.data.goods_name;
diff --git a/pages/goods/search/search.js b/pages/goods/search/search.js
index 419fab8..bbf575e 100644
--- a/pages/goods/search/search.js
+++ b/pages/goods/search/search.js
@@ -1,9 +1,9 @@
-var t = function(t) {
+var t = function (t) {
return t && t.__esModule ? t : {
default: t
};
}(require("../../../utils/LoadMore.js")), ut = require("../../../utils/util.js"),
- a = getApp(), e = new t.default(), rq = a.request, oo = a.globalData.setting;
+ a = getApp(), e = new t.default(), rq = a.request, oo = a.globalData.setting;
Page({
data: {
@@ -18,31 +18,32 @@ Page({
requestUrl: "",
//hotWords: [ [ "手机", "小米", "iphone" ], [ "三星", "华为", "冰箱" ] ]
hotWords: null,
- is_no_plus:1,
+ is_no_plus: 1,
tabname: "sort", //排序的字段
adname: "asc", //升降的字段
- rq_data:null,
- searchRecord: [],
- keyword: '',
- is_his:0,
- hiddenClear: true,
+ rq_data: null,
+ searchRecord: [],
+ keyword: '',
+ is_his: 0,
+ hiddenClear: true,
+ fliter_flag: false,
},
-
- onLoad: function(t) {
- this.data.rq_data=t;
- if(t.o) {
- this.data.rq_data.o = JSON.parse(t.o);
- };
-
-
+
+ onLoad: function (t) {
+ this.data.rq_data = t;
+ if (t.o) {
+ this.data.rq_data.o = JSON.parse(t.o);
+ };
+
+
//接受有没有导购的参数
- var first_leader=t.first_leader;
- if(first_leader){
- getApp().globalData.first_leader=first_leader;
+ var first_leader = t.first_leader;
+ if (first_leader) {
+ getApp().globalData.first_leader = first_leader;
//调用接口判断是不是会员
- getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{
- if(res.data.code==0){
- getApp().globalData.guide_id=res.data.data.id;
+ getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + oo.stoid + "/" + first_leader, {}).then(res => {
+ if (res.data.code == 0) {
+ getApp().globalData.guide_id = res.data.data.id;
}
})
}
@@ -63,145 +64,145 @@ Page({
}
})
- var th=this;
- a.getConfig2(function(rs) {
- var arr=new Array(),arr2=new Array();
- if (rs.hot_keywords != null && ut.trim(rs.hot_keywords)!="" ){
- var arr1 = rs.hot_keywords.split('|');
- for (var i = 0; i < arr1.length;i++){
- if(i%5==0 && i!=0){
- arr.push(arr2);
- arr2=[];
- }else{
- arr2.push(arr1[i]);
+ var th = this;
+ a.getConfig2(function (rs) {
+ var arr = new Array(), arr2 = new Array();
+ if (rs.hot_keywords != null && ut.trim(rs.hot_keywords) != "") {
+ var arr1 = rs.hot_keywords.split('|');
+ for (var i = 0; i < arr1.length; i++) {
+ if (i % 5 == 0 && i != 0) {
+ arr.push(arr2);
+ arr2 = [];
+ } else {
+ arr2.push(arr1[i]);
+ }
}
+ if (arr2.length > 0) arr.push(arr2);
+ th.setData({ hotWords: arr });
}
- if (arr2.length > 0) arr.push(arr2);
- th.setData({ hotWords: arr});
- }
-
-
- //计算等级价相关
- var swithc_list=rs.switch_list;
- var sw_arr=JSON.parse(swithc_list);
- //---如果后台又开等级卡的开关---
- if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){
- th.setData({rank_switch:true});
- var user=getApp().globalData.userInfo;
- var ti=setInterval(function(){
- if(!user) return false;
- clearInterval(ti);
- //---回调卡的列表---
- th.getPlusCardType(function(ob){
- th.setData({card_list:ob.card_list});
- if(user.card_field ){
- var str = user['card_expiredate'].replace(/-/g, '/');
- var end = new Date(str);
- end = Date.parse(end) / 1000;
- var now = ut.gettimestamp();
-
- //--- 判断是等级会员,且在有效期范围内 ---
- if(user.card_field && now7) card_name=card_name.substring(0,8);
- th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list});
- }
- }
- })
- },500)
- }
-
-
-
- })
- //e.init(this, "", "requestData");
- var url = this.data.baseUrl;
-
- //扫一扫过来,显示搜索的内容
- var s_key = t.s_key;
- if (s_key){
- s_key=s_key.trim();
- this.search(s_key); this.openSearchModal();
- return;
- }
-
- if (0 != t.brand_id && t.brand_id!=undefined){ url += "&brand_id=" + t.brand_id;}
- if (0 != t.nation_id && t.nation_id!=undefined) { url += "&nation_id=" + t.nation_id;}
- if (0 != t.max_price && t.max_price!=undefined) { url += "&min_pirce=" + t.min_pirce + "&max_price=" + t.max_price;}
- if (0 != t.ladder_id && t.ladder_id != undefined) {
- url += "&ladder_id=" + t.ladder_id;
- this.setData({
- baseUrl:url,
+
+
+ //计算等级价相关
+ var swithc_list = rs.switch_list;
+ var sw_arr = JSON.parse(swithc_list);
+ //---如果后台又开等级卡的开关---
+ if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
+ th.setData({ rank_switch: true });
+ var user = getApp().globalData.userInfo;
+ var ti = setInterval(function () {
+ if (!user) return false;
+ clearInterval(ti);
+ //---回调卡的列表---
+ th.getPlusCardType(function (ob) {
+ th.setData({ card_list: ob.card_list });
+ if (user.card_field) {
+ var str = user['card_expiredate'].replace(/-/g, '/');
+ var end = new Date(str);
+ end = Date.parse(end) / 1000;
+ var now = ut.gettimestamp();
+
+ //--- 判断是等级会员,且在有效期范围内 ---
+ if (user.card_field && now < end) {
+ var card_name = ob.name_map.get(user.card_field);
+ if (card_name && card_name.length > 7) card_name = card_name.substring(0, 8);
+ th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list });
+ }
+ }
+ })
+ }, 500)
+ }
+
+
+
})
- }
- if (url != this.data.baseUrl) return this.requestSearch(url);
- this.openSearchModal();
+ //e.init(this, "", "requestData");
+ var url = this.data.baseUrl;
+
+ //扫一扫过来,显示搜索的内容
+ var s_key = t.s_key;
+ if (s_key) {
+ s_key = s_key.trim();
+ this.search(s_key); this.openSearchModal();
+ return;
+ }
+
+ if (0 != t.brand_id && t.brand_id != undefined) { url += "&brand_id=" + t.brand_id; }
+ if (0 != t.nation_id && t.nation_id != undefined) { url += "&nation_id=" + t.nation_id; }
+ if (0 != t.max_price && t.max_price != undefined) { url += "&min_pirce=" + t.min_pirce + "&max_price=" + t.max_price; }
+ if (0 != t.ladder_id && t.ladder_id != undefined) {
+ url += "&ladder_id=" + t.ladder_id;
+ this.setData({
+ baseUrl: url,
+ })
+ }
+ if (url != this.data.baseUrl) return this.requestSearch(url);
+ this.openSearchModal();
// 获取历史搜索记录
- this.getHistorySearch();
+ this.getHistorySearch();
},
- onShow:function () {
+ onShow: function () {
getApp().check_can_share();
},
- changeTab: function(t) {
- var ord = t.currentTarget.dataset.href;
- var ad = t.currentTarget.dataset.ad;
+ changeTab: function (t) {
+ var ord = t.currentTarget.dataset.href;
+ var ad = t.currentTarget.dataset.ad;
- var url = this.data.requestUrl;
+ var url = this.data.requestUrl;
- if (this.data.tabname != ord) {
- this.setData({ tabname: ord, adname: "desc" });
- } else {
- ad = ad == "desc" ? "asc" : "desc";
- this.setData({ adname: ad });
- }
- this.resetData(), this.requestSearch(url);
+ if (this.data.tabname != ord) {
+ this.setData({ tabname: ord, adname: "desc" });
+ } else {
+ ad = ad == "desc" ? "asc" : "desc";
+ this.setData({ adname: ad });
+ }
+ this.resetData(), this.requestSearch(url);
},
//-----------真的调用地址进行搜索------------
- requestSearch: function(t) {
- // console.log('t===>', t);
- if(this.data.loading) return false;
- this.data.loading=1;
- var e = this,th=e;
- if(getApp().globalData.userInfo) {
- t += "&user_id=" + getApp().globalData.userInfo.user_id;
- }
+ requestSearch: function (t) {
+ // console.log('t===>', t);
+ if (this.data.loading) return false;
+ this.data.loading = 1;
+ var e = this, th = e;
+ if (getApp().globalData.userInfo) {
+ t += "&user_id=" + getApp().globalData.userInfo.user_id;
+ }
this.data.requestUrl = t;
- var user_id=getApp().globalData.user_id;
- if(!user_id) user_id=0;
- let data = {
- is_mainshow: 1,
- isonsale: 1,
- store_id: oo.stoid,
- orderField: e.data.tabname,
- orderType: e.data.adname,
- page: e.data.currentPage,
- };
-
- let o = this.data.rq_data.o;
- if(o) {
- if(o.cat_id) data.cat_id = o.cat_id;
- if(o.pid && o.pid != 'three') data.parent_id = o.pid;
- if(o.nation_id) data.nation_id = o.nation_id;
- if(o.brand_id) data.brand_id = o.brand_id;
- };
-
-
- getApp().request.promiseGet(t, {data:data}).then(async res=>{
- th.data.loading=0;
- if(ut.ajax_ok(res)){
- if(!e.data.requestData) {
- // e.data.requestData=[];
- e.setData({
- requestData: [],
- });
- };
- for(let i in res.data.data.pageData){
- let item=res.data.data.pageData[i];
+ var user_id = getApp().globalData.user_id;
+ if (!user_id) user_id = 0;
+ let data = {
+ is_mainshow: 1,
+ isonsale: 1,
+ store_id: oo.stoid,
+ orderField: e.data.tabname,
+ orderType: e.data.adname,
+ page: e.data.currentPage,
+ };
+
+ let o = this.data.rq_data.o;
+ if (o) {
+ if (o.cat_id) data.cat_id = o.cat_id;
+ if (o.pid && o.pid != 'three') data.parent_id = o.pid;
+ if (o.nation_id) data.nation_id = o.nation_id;
+ if (o.brand_id) data.brand_id = o.brand_id;
+ };
+
+
+ getApp().request.promiseGet(t, { data: data }).then(async res => {
+ th.data.loading = 0;
+ if (ut.ajax_ok(res)) {
+ if (!e.data.requestData) {
+ // e.data.requestData=[];
+ e.setData({
+ requestData: [],
+ });
+ };
+ for (let i in res.data.data.pageData) {
+ let item = res.data.data.pageData[i];
item.original_img = th.data.url + item.original_img;
/*--
@@ -218,48 +219,48 @@ Page({
})--*/
var prom_type = item.prom_type; //0普通商品 1秒杀 6拼单 2团购 4积分购
- var prom_id=item.prom_id;
- var now=ut.gettimestamp();
+ var prom_id = item.prom_id;
+ var now = ut.gettimestamp();
var url = "";
- switch (prom_type){
+ switch (prom_type) {
case 1:
- url = "/api/ms/flash_sale/getNew/" +oo.stoid + "/" +user_id+"/"+ prom_id;
+ url = "/api/ms/flash_sale/getNew/" + oo.stoid + "/" + user_id + "/" + prom_id;
break;
case 2:
- url ="/api/weshop/goods/groupBuy/getActInfo/" +oo.stoid + "/" +item.goods_id+"/"+ prom_id
+ url = "/api/weshop/goods/groupBuy/getActInfo/" + oo.stoid + "/" + item.goods_id + "/" + prom_id
break;
case 4:
- url ="/api/weshop/integralbuy/get/"+oo.stoid +"/"+prom_id;
+ url = "/api/weshop/integralbuy/get/" + oo.stoid + "/" + prom_id;
break;
case 6:
url = "/api/weshop/teamlist/get/" + oo.stoid + "/" + prom_id;
- await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{
- data:{
- store_id: oo.stoid,
- is_end: 0,
- is_show: 1,
- user_id: getApp().globalData.user_id,
- pageSize:1000,
+ await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1", {
+ data: {
+ store_id: oo.stoid,
+ is_end: 0,
+ is_show: 1,
+ user_id: getApp().globalData.user_id,
+ pageSize: 1000,
}
- }).then(pd=>{
- let pd_list=pd.data.data.pageData;
- if(res.data.code==0 && pd_list.length>0){
- var flag = pd_list.some(pd=>{
- return pd.goods_id==item.goods_id
- })
-
- if(!flag){
- item.prom_type=0;
- item.prom_id=0;
- item.prom_price=null;
- }
+ }).then(pd => {
+ let pd_list = pd.data.data.pageData;
+ if (res.data.code == 0 && pd_list.length > 0) {
+ var flag = pd_list.some(pd => {
+ return pd.goods_id == item.goods_id
+ })
+
+ if (!flag) {
+ item.prom_type = 0;
+ item.prom_id = 0;
+ item.prom_price = null;
+ }
}
- })
+ })
break;
case 8:
var presell_id = prom_id;
var url1 = "/api/weshop/marketing/marketingPresellList/list";
- var rd= {
+ var rd = {
store_id: oo.stoid,
presell_id: presell_id,
goods_id: item.goods_id
@@ -271,287 +272,303 @@ Page({
if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
var arr = res.data.data[0];
item.prom_price = arr.luck_goods_price;
- item.sales_sum=arr.buy_goodnum+(arr.virtual_qty?arr.virtual_qty:0);
+ item.sales_sum = arr.buy_goodnum + (arr.virtual_qty ? arr.virtual_qty : 0);
}
})
break;
default:
break;
};
- if(url!=null && url!=''){
+ if (url != null && url != '') {
await getApp().request.promiseGet(url, {}).then(async res => {
- var prom =null;
- if(res.data.code==0 && res.data.data){
- prom=res.data.data;
+ var prom = null;
+ if (res.data.code == 0 && res.data.data) {
+ prom = res.data.data;
- if (prom != null && prom.is_end==0 && prom.end_time>now && (prom.start_time now && (prom.start_time < now || (prom.show_time && prom.show_time < now))) {
item.prom_price = res.data.data.price;
- if(res.data.data.user_price) item.prom_price=res.data.data.user_price;
- var vNum=prom.virtual_num?prom.virtual_num:0;
- var vNum1=prom.virtualNum?prom.virtualNum:0;
- var vNum2=prom.virtual?prom.virtual:0;
- item.sales_sum=prom.buy_num+(vNum+vNum1+vNum2);
- }else{
- item.prom_type=0;
- item.prom_id=0;
- item.prom_price=null;
+ if (res.data.data.user_price) item.prom_price = res.data.data.user_price;
+ var vNum = prom.virtual_num ? prom.virtual_num : 0;
+ var vNum1 = prom.virtualNum ? prom.virtualNum : 0;
+ var vNum2 = prom.virtual ? prom.virtual : 0;
+ item.sales_sum = prom.buy_num + (vNum + vNum1 + vNum2);
+ } else {
+ item.prom_type = 0;
+ item.prom_id = 0;
+ item.prom_price = null;
}
}
})
};
- if(!th.data.requestData) th.data.requestData=[];
+ if (!th.data.requestData) th.data.requestData = [];
th.data.requestData.push(item);
- e.setData({requestData: e.data.requestData});
+ e.setData({ requestData: e.data.requestData });
}
}
e.closeSearchModal();
})
},
- onReachBottom: function() {
- console.log('触发上滑加载事件');
+ onReachBottom: function () {
+ console.log('触发上滑加载事件');
this.data.currentPage++
- console.log('触发上滑加载事件currentPage',this.data.currentPage);
+ console.log('触发上滑加载事件currentPage', this.data.currentPage);
this.data.openSearchModal || e.canloadMore() && this.requestSearch(this.data.requestUrl);
},
-
-
- openFilterModal: function() {
+
+
+ openFilterModal: function () {
this.setData({
openFilterModal: !0
});
},
- closeFilterModal: function() {
+ closeFilterModal: function () {
this.setData({
openFilterModal: !1
});
},
- filterGoods: function(t) {
+ filterGoods: function (t) {
this.resetData(), this.requestSearch(t.currentTarget.dataset.href), this.closeFilterModal();
},
-
-
-
- resetData: function() {
- e.resetConfig(),
- // this.data.requestData = null,
- this.data.currentPage = 1;
- this.setData({
- requestData: null,
- });
+
+
+
+ resetData: function () {
+ e.resetConfig(),
+ // this.data.requestData = null,
+ this.data.currentPage = 1;
+ this.setData({
+ requestData: null,
+ });
},
//---回复最初的设置---显示全部分类--
- restoreData: function() {
+ restoreData: function () {
this.setData({
requestData: this.data.allData,
});
- this.data.currentPage=2;
+ this.data.currentPage = 2;
},
- openSearchModal: function() {
+ openSearchModal: function () {
this.setData({
openSearchModal: !0
});
},
- closeSearchModal: function() {
+ closeSearchModal: function () {
this.setData({
openSearchModal: !1
});
},
-
- submitSearch: function(t) {
- var val=t.detail.value.word;
- if(val==undefined) val=t.detail.value;
- val=val?val.trim():'';
- if(!val){
- a.showWarning("请输入关键词");
- }
- this.search(val);
+
+ submitSearch: function (t) {
+ var val = t.detail.value.word;
+ if (val == undefined) val = t.detail.value;
+ val = val ? val.trim() : '';
+ if (!val) {
+ a.showWarning("请输入关键词");
+ }
+ this.search(val);
},
//热搜关键字
- searchHotWord: function(t) {
- var word = t.currentTarget.dataset.word;
- if(word) {
- this.setData({
- keyword: word,
- hiddenClear: false,
- });
- };
- this.historyRecord(word);
- this.search(word);
+ searchHotWord: function (t) {
+ var word = t.currentTarget.dataset.word;
+ if (word) {
+ this.setData({
+ keyword: word,
+ hiddenClear: false,
+ });
+ };
+ this.historyRecord(word);
+ this.search(word);
},
//-----点击搜索按钮----
- search: function(t) {
+ search: function (t) {
if ("string" != typeof t || "" == t) return a.showWarning("请输入关键词");
- this.data.key_str=t;
+ this.data.key_str = t;
this.resetData();
- this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t));
- this.historyRecord();
+ this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t));
+ this.historyRecord();
},
//---------分享配置--------
onShareAppMessage: function (e) {
- getApp().globalData.no_clear=1;
- var curPage=this;
+ getApp().globalData.no_clear = 1;
+ var curPage = this;
var pagePath = curPage.route; //当前页面url
if (pagePath.indexOf('/') != 0) {
pagePath = '/' + pagePath;
}
- if(this.data.key_str) {
+ if (this.data.key_str) {
pagePath += "?s_key=" + this.data.key_str;
}
- if(getApp().globalData.user_id){
+ if (getApp().globalData.user_id) {
- if(pagePath.indexOf("?")>0){
- pagePath+="&first_leader="+getApp().globalData.user_id;
- }else{
- pagePath+="?first_leader="+getApp().globalData.user_id;
+ if (pagePath.indexOf("?") > 0) {
+ pagePath += "&first_leader=" + getApp().globalData.user_id;
+ } else {
+ pagePath += "?first_leader=" + getApp().globalData.user_id;
}
}
// console.log("11-11"+pagePath);
return {
title: "商品搜索",
- path:pagePath,
+ path: pagePath,
}
},
//---------图片失败,默认图片--------
bind_bnerr: function (e) {
- var _errImg = e.target.dataset.errorimg;
- var _errObj = {};
- _errObj[_errImg] = this.data.url+ "/miniapp/images/default_g_img.gif";
- this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+ var _errImg = e.target.dataset.errorimg;
+ var _errObj = {};
+ _errObj[_errImg] = this.data.url + "/miniapp/images/default_g_img.gif";
+ this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
},
-
- //--- 获取卡类列表 ---
- getPlusCardType: function (func) {
- var storid = oo.stoid;
- var th = this;
- getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
- var plusCard = res.data.data;
- var arr = [1219, 2089, 3031];
- var new_arr = new Array();
- var card_name_map=new Map();
- var user = getApp().globalData.userInfo;
-
- for (var i = 0; i < plusCard.length; i++) {
- if ((!user || user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) {
- continue;
- }
- var name="card"+plusCard[i].CorrPrice.toLowerCase();
- card_name_map.set(name,plusCard[i].CardName);
- new_arr.push(plusCard[i]);
-
- }
-
- var ob={"card_list":new_arr,"name_map":card_name_map};
- func(ob);
- })
- },
-
-
- getInput(e) {
- let val = e.detail.value;
- if(val) {
- this.setData({
- keyword: e.detail.value,
- hiddenClear: false,
- });
- } else {
- this.setData({
- hiddenClear: true,
- });
- }
-
- },
-
- historyRecord(w) {
- let keyword =w;
- let self = this;
- if(!keyword){
- keyword = this.data.key_str.trim();
- }
- let searchRecord = this.data.searchRecord;
- if(!searchRecord || searchRecord.length==0) searchRecord=wx.getStorageSync('searchRecord') || [];
-
- if(keyword) {
-
- var index=searchRecord.indexOf(keyword);
- if(index > -1) {
- // 已经存在该值
- searchRecord.splice(index,1);
- searchRecord.unshift(keyword);
-
- // 将历史记录添加到缓存中
- wx.setStorage({
- key: 'searchRecord',
- data: searchRecord,
- success: function(res) {
- self.setData({
- searchRecord,
- })
- }
- })
-
- return;
- } else {
- if(searchRecord.length >= 10) {
- searchRecord.pop(); // 删除最早的一条记录
- };
- searchRecord.unshift(keyword);
-
- // // 将历史记录添加到缓存中
- wx.setStorage({
- key: 'searchRecord',
- data: searchRecord,
- success: function(res) {
- self.setData({
- searchRecord,
- })
- }
- })
- };
- };
- },
-
-
-
- // 获取历史搜索记录
- getHistorySearch() {
- this.setData({
- searchRecord: wx.getStorageSync('searchRecord') || [] //若无存储则为空
- });
- },
-
- // 清除历史搜素记录
- clearSearchRecord() {
- wx.clearStorageSync('searchRecord');
- this.setData({
- searchRecord: []
- });
- },
-
- go_url:function (e) {
- var url=e.currentTarget.dataset.url;
+
+ //--- 获取卡类列表 ---
+ getPlusCardType: function (func) {
+ var storid = oo.stoid;
+ var th = this;
+ getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
+ var plusCard = res.data.data;
+ var arr = [1219, 2089, 3031];
+ var new_arr = new Array();
+ var card_name_map = new Map();
+ var user = getApp().globalData.userInfo;
+
+ for (var i = 0; i < plusCard.length; i++) {
+ if ((!user || user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) {
+ continue;
+ }
+ var name = "card" + plusCard[i].CorrPrice.toLowerCase();
+ card_name_map.set(name, plusCard[i].CardName);
+ new_arr.push(plusCard[i]);
+
+ }
+
+ var ob = { "card_list": new_arr, "name_map": card_name_map };
+ func(ob);
+ })
+ },
+
+
+ getInput(e) {
+ let val = e.detail.value;
+ if (val) {
+ this.setData({
+ keyword: e.detail.value,
+ hiddenClear: false,
+ });
+ } else {
+ this.setData({
+ hiddenClear: true,
+ });
+ }
+
+ },
+
+ historyRecord(w) {
+ let keyword = w;
+ let self = this;
+ if (!keyword) {
+ keyword = this.data.key_str.trim();
+ }
+ let searchRecord = this.data.searchRecord;
+ if (!searchRecord || searchRecord.length == 0) searchRecord = wx.getStorageSync('searchRecord') || [];
+
+ if (keyword) {
+
+ var index = searchRecord.indexOf(keyword);
+ if (index > -1) {
+ // 已经存在该值
+ searchRecord.splice(index, 1);
+ searchRecord.unshift(keyword);
+
+ // 将历史记录添加到缓存中
+ wx.setStorage({
+ key: 'searchRecord',
+ data: searchRecord,
+ success: function (res) {
+ self.setData({
+ searchRecord,
+ })
+ }
+ })
+
+ return;
+ } else {
+ if (searchRecord.length >= 10) {
+ searchRecord.pop(); // 删除最早的一条记录
+ };
+ searchRecord.unshift(keyword);
+
+ // // 将历史记录添加到缓存中
+ wx.setStorage({
+ key: 'searchRecord',
+ data: searchRecord,
+ success: function (res) {
+ self.setData({
+ searchRecord,
+ })
+ }
+ })
+ };
+ };
+ },
+
+ closePoster() {
+ this.setData({
+ fliter_flag: false,
+ });
+ },
+
+ show_fliter() {
+ this.setData({
+ fliter_flag: true
+ })
+ },
+ fliter_close() {
+ this.setData({
+ fliter_flag: false,
+ })
+ },
+
+
+ // 获取历史搜索记录
+ getHistorySearch() {
+ this.setData({
+ searchRecord: wx.getStorageSync('searchRecord') || [] //若无存储则为空
+ });
+ },
+
+ // 清除历史搜素记录
+ clearSearchRecord() {
+ wx.clearStorageSync('searchRecord');
+ this.setData({
+ searchRecord: []
+ });
+ },
+
+ go_url: function (e) {
+ var url = e.currentTarget.dataset.url;
getApp().goto(url);
},
-
- clearInput() {
- this.setData({
- keyword: '',
- hiddenClear: true,
- openSearchModal: true,
- });
- },
-
- inputFocus() {
- this.setData({
- openSearchModal: true,
- });
- },
+
+ clearInput() {
+ this.setData({
+ keyword: '',
+ hiddenClear: true,
+ openSearchModal: true,
+ });
+ },
+
+ inputFocus(e) {
+ this.setData({
+ openSearchModal: true,
+ });
+ },
});
\ No newline at end of file
diff --git a/pages/goods/search/search.json b/pages/goods/search/search.json
index 0aa7add..daca033 100644
--- a/pages/goods/search/search.json
+++ b/pages/goods/search/search.json
@@ -3,5 +3,8 @@
"enablePullDownRefresh": false,
"usingComponents": {
"share_box": "/components/share_box/share_box"
- }
+ },
+ "componentPlaceholder": {
+ "van-popup": "view"
+ }
}
\ No newline at end of file
diff --git a/pages/goods/search/search.wxml b/pages/goods/search/search.wxml
index c645425..34b8305 100644
--- a/pages/goods/search/search.wxml
+++ b/pages/goods/search/search.wxml
@@ -6,7 +6,7 @@
+
+
+
+
+
+
@@ -137,6 +143,8 @@
+
+
@@ -461,7 +469,7 @@
-
+
@@ -528,7 +536,7 @@
-
+
diff --git a/pages/index/index/index.wxss b/pages/index/index/index.wxss
index c249c08..6183737 100644
--- a/pages/index/index/index.wxss
+++ b/pages/index/index/index.wxss
@@ -1,3 +1,18 @@
+/* 基本样式 */
+page {
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ box-sizing: border-box;
+ position: relative;
+}
+/* 超出滚动 */
+.container {
+ width: 100%;
+ height: 100%;
+ overflow-y: auto;
+}
+
.pink-b {
background: #ff7295;
}
@@ -1010,14 +1025,10 @@ page {
/* background-color: #f7f8fa; */
}
-.container {
- /* overflow: hidden; */
- overflow: visible;
- /* padding-top: 140rpx; */
-}
+
.container.nor{
- padding-top: 80rpx;
+ padding-top: 140rpx;
}
/* page,
diff --git a/pages/template/index.js b/pages/template/index.js
index 13d8475..c45a195 100644
--- a/pages/template/index.js
+++ b/pages/template/index.js
@@ -19,7 +19,21 @@ Page({
this.data.temp_id=e.scene;
if(!this.data.temp_id)
this.data.temp_id=e.sence;
- if(!this.data.temp_id) wx.showModal({ title:"未读取到模板ID" ,})
+ if(!this.data.temp_id) wx.showModal({ title:"未读取到模板ID" ,})
+
+ var first_leader = e.first_leader;
+ if (first_leader) {
+ //-- user_id代过来免登录 --
+ getApp().globalData.first_leader = first_leader;
+ //调用接口判断是不是会员
+ getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
+ if (res.data.code == 0) {
+ getApp().globalData.guide_id = res.data.data.id;
+ }
+ })
+ }
+
+
},
@@ -94,26 +108,52 @@ Page({
},
- onShareAppMessage: function(e) {
+ onShareAppMessage:async function(e) {
getApp().globalData.no_clear=1;
+ getApp().getConfig(await function(e){
+ this.setData({
+ store_config:e
+ })
+ }.bind(this))
+
+ var url= `pages/template/index?sence=`+this.data.temp_id;
+ var userInfo = getApp().globalData.userInfo;
+ //是分销商才带
+ if (userInfo) {
+ url += "&first_leader=" + userInfo.user_id;
+ }
+
+ var ob = {
+ title: this.data.share_title,
+ path: url,
+ imageUrl:this.data.url+this.data.store_config.store_logo,
+ };
+ return ob;
},
/**
* 用户分享朋友圈
*/
async onShareTimeline(){
- getApp().globalData.no_clear=1;
+ getApp().globalData.no_clear=1;
getApp().getConfig(await function(e){
this.setData({
store_config:e
})
}.bind(this))
var {share_title,temp_id,store_config} = this.data;
- // var url= `pages/template/index?sence=${temp_id}`;
+ var url= `pages/template/index?sence=${temp_id}`;
+
+ var userInfo = getApp().globalData.userInfo;
+ //是分销商才带
+ if (userInfo) {
+ url += "&first_leader=" + userInfo.user_id;
+ }
+
var ob = {
title:share_title,
- // path: url,
- query:`sence=${temp_id}`,
+ path: url,
+ //query:`sence=${temp_id}`,
imageUrl:this.data.url+store_config.store_logo,
};
console.log(ob);
diff --git a/pages/user/express/express.wxml b/pages/user/express/express.wxml
index ec4e481..de1d85e 100644
--- a/pages/user/express/express.wxml
+++ b/pages/user/express/express.wxml
@@ -1,6 +1,6 @@
- 订单编号 :
+ 快递单号 :
{{delivery.invoice_no}}
diff --git a/pages/user/index/filter.wxs b/pages/user/index/filter.wxs
index de846ad..855ef50 100644
--- a/pages/user/index/filter.wxs
+++ b/pages/user/index/filter.wxs
@@ -19,6 +19,7 @@ var is_close = function (name,c_list) {
map['幸运大转盘']="17";
map['幸运购']="18";
map['AI测肤']="20";
+ map['附近门店']="21";
var index=map[name];
//我的权益要判断5,和11
diff --git a/pages/user/index/index.js b/pages/user/index/index.js
index 0f3460c..167e168 100644
--- a/pages/user/index/index.js
+++ b/pages/user/index/index.js
@@ -43,8 +43,8 @@ Page({
actImg: "",
is_assistance: 0, //助力活动
ad_img: "",
- add_card_data: '', //等级卡的内容
-
+ add_card_data: '', //等级卡的内容
+ getusercode_vailtime:10,//会员二维码时效
hiddenCS: true,
},
goto_nav: function (e) {
@@ -395,8 +395,13 @@ Page({
th.setData({ sys_switch: t_swi });
var user_tool = [];
if (t_swi.usertool) user_tool = JSON.parse(t_swi.usertool);
- th.setData({ c_list: user_tool })
- }
+ th.setData({ c_list: user_tool });
+ if (t_swi.usercode_vailtime!=null && parseInt(t_swi.usercode_vailtime)>0)
+ {
+ th.setData({ getusercode_vailtime: t_swi.usercode_vailtime });
+ }
+ }
+
if (parseInt(t_swi.rank_switch) == 2) {
var userInfo = th.data.userInfo;
if (userInfo.card_field != null && userInfo.card_field != undefined && userInfo.card_field != "") {
@@ -483,9 +488,10 @@ Page({
//------卡片的显示和关闭--------
show_tc: function () {
- if (!this.data.userInfo) return false;
+ if (!this.data.userInfo) return false;
+
//base64_encode($user.mobile.'|'.date('Y-m-d H:i:s')
- var val = this.data.userInfo.mobile + "|" + ut.formatTime();
+ var val = this.data.userInfo.mobile + "|" + ut.formatTime()+"|"+this.data.getusercode_vailtime;
val = "^" + ut.base64_encode(val);
qrcode('qrcode', val, 480, 480, this);
diff --git a/pages/user/index/index.wxml b/pages/user/index/index.wxml
index 37f2dde..1c6125d 100644
--- a/pages/user/index/index.wxml
+++ b/pages/user/index/index.wxml
@@ -38,9 +38,10 @@
-
+
+ 会员卡
成长值
@@ -58,7 +59,7 @@
余额
{{udata.Balance?udata.Balance:0}}
- 预存款
+ 储值款
{{udata.Integral?udata.Integral:0}}
积分
@@ -346,7 +347,7 @@
- 扫一扫上面的二维码图案,即可消费
+ 前台收银扫此二维码,即可享受优惠!
diff --git a/pages/user/index/index.wxss b/pages/user/index/index.wxss
index b4bd0fd..a04870c 100644
--- a/pages/user/index/index.wxss
+++ b/pages/user/index/index.wxss
@@ -145,16 +145,19 @@
}
.xc-qrcode-frame {
- border-radius: 10rpx;
+ /* border-radius: 10rpx;
border: 5rpx solid #fe9db5;
background: #fe9db5;
width: 70rpx;
- height: 70rpx;
+ height: 70rpx; */
top: 70rpx;
right: 64rpx;
}
.xc-qrcode {
+ border-radius: 10rpx;
+ border: 5rpx solid #fe9db5;
+ background: #fe9db5;
width: 70rpx;
height: 70rpx;
}
@@ -301,7 +304,7 @@
height: 50rpx;
}
-.xc-send{
+.xc-send {
width: 50rpx;
height: 50rpx;
}
@@ -455,9 +458,11 @@
display: block;
height: 1px;
width: 100%;
- background-color: #999; /*颜色需与主题大背景色一致*/
+ background-color: #999;
+ /*颜色需与主题大背景色一致*/
position: relative;
- top: 10px; /*调节线高*/
+ top: 10px;
+ /*调节线高*/
left: 0;
}
@@ -540,10 +545,10 @@
.modal-body {
position: fixed;
top: 0;
- bottom: 0;
+ bottom: 0;
left: 0;
- right: 0;
- margin: auto;
+ right: 0;
+ margin: auto;
z-index: 100;
background: #fff;
/* margin-left: 73rpx; */
@@ -666,7 +671,8 @@
color: #fff;
}
-.bg_right.bcolor, .bg_left.bcolor {
+.bg_right.bcolor,
+.bg_left.bcolor {
border-color: #333;
}
@@ -707,45 +713,47 @@
margin-top: 8rpx;
margin-right: 5rpx;
}
-.banner-img{
+
+.banner-img {
width: 95%;
height: 140rpx;
- border-radius: 10px 10px 0px 0px;
- margin-bottom: -5rpx;
+ border-radius: 10px 10px 0px 0px;
+ margin-bottom: -5rpx;
}
-.banner-frame{
+
+.banner-frame {
width: 100%;
background: #f2f2f2;
}
-button::after{ border: 0}
+button::after {
+ border: 0
+}
.logo-container {
- -webkit-filter: brightness(80%);
- filter: brightness(80%);
+ -webkit-filter: brightness(80%);
+ filter: brightness(80%);
}
.logo {
- width: 132rpx;
- height: 37rpx;
- margin-right: 10rpx;
+ width: 132rpx;
+ height: 37rpx;
+ margin-right: 10rpx;
}
.icon-dingwei {
- color: #EA4F2B;
- font-size: 28rpx;
+ color: #EA4F2B;
+ font-size: 28rpx;
}
.c-5 {
- color: #555;
+ color: #555;
}
.action .icon-guan {
- left: auto !important;
- right: 20rpx !important;
-}
-
-
+ left: auto !important;
+ right: 20rpx !important;
+}
\ No newline at end of file
diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js
index e2030cf..2606abf 100644
--- a/pages/user/userinfo/userinfo.js
+++ b/pages/user/userinfo/userinfo.js
@@ -73,6 +73,7 @@ Page({
userInfo: {},
hasUserInfo: false,
canIUseGetUserProfile: false,
+ getusercode_vailtime:10,//会员二维码时效
},
//通过路径跳转到其他页面
@@ -91,8 +92,12 @@ Page({
rank_switch:sms_conf.rank_switch,
is_lable_set: sms_conf.user_label_set, //是不是会员标签设置
guide_title:sms_conf.guide_consultant, //系统参数 导购标题
- guide_change_time:sms_conf.guide_change_time //每月能修改几次
+ guide_change_time:sms_conf.guide_change_time, //每月能修改几次
})
+ if (sms_conf.usercode_vailtime!=null && parseInt(sms_conf.usercode_vailtime)>0)
+ {
+ th.setData({ getusercode_vailtime: sms_conf.usercode_vailtime });
+ }
if (sms_conf.user_label_set) {
th.query_checklabels();
}
@@ -858,7 +863,7 @@ Page({
show_tc: function() {
if (!getApp().globalData.userInfo) return false;
//base64_encode($user.mobile.'|'.date('Y-m-d H:i:s')
- var val=getApp().globalData.userInfo.mobile+"|"+ut.formatTime();
+ var val=getApp().globalData.userInfo.mobile+"|"+ut.formatTime()+"|"+this.data.getusercode_vailtime;
val="^"+ut.base64_encode(val);
qrcode('qrcode', val, 480, 480, this);
diff --git a/utils/filter.wxs b/utils/filter.wxs
index c5d1959..83c952b 100644
--- a/utils/filter.wxs
+++ b/utils/filter.wxs
@@ -10,6 +10,13 @@ var filters = {
if (!val) return "不限";
return val.replace("00:00:00", "");
},
+ gettimestamp: function (date) {
+ console.log(date);
+ var timestamp = getDate(date).getTime();
+ console.log(timestamp);
+ timestamp = parseInt(timestamp / 1000)
+ return timestamp;
+ },
replace_time2: function (val) {
if (val == null || val == undefined || val == '') return "";
@@ -278,5 +285,6 @@ module.exports = {
JSONStringify: filters.JSONStringify,
count: filters.count,
isExpired: filters.isExpired,
+ gettimestamp: filters.gettimestamp,
showStartAndEndDate: filters.showStartAndEndDate,
}
\ No newline at end of file