diff --git a/app.js b/app.js
index 9d5f501..7ee7ddc 100644
--- a/app.js
+++ b/app.js
@@ -251,7 +251,7 @@ App({
title: t,
mask: e,
duration: a,
- image:"/packageA/images/gt.png",
+ image:"/images/gt.png",
complete: function() {
"function" == typeof o && setTimeout(o, a);
}
diff --git a/app.json b/app.json
index 8287332..7e20235 100644
--- a/app.json
+++ b/app.json
@@ -1,6 +1,5 @@
{
"pages": [
-
"pages/index/index/index",
"pages/justTest/justTest",
"pages/goods/categoryList/categoryList",
@@ -97,7 +96,12 @@
"pages/quan_list/quan_list",
"pages/quan_pro/quan_pro",
"pages/liveStream/liveStream",
- "pages/liveStreamDetails/liveStreamDetails"
+ "pages/liveStreamDetails/liveStreamDetails",
+
+ "pages/goods_share/goods_share",
+ "pages/activity_share/activity_share",
+ "pages/live_share/live_share",
+ "pages/quan/quan"
]
}],
diff --git a/app.wxss b/app.wxss
index cfd7bca..3847731 100644
--- a/app.wxss
+++ b/app.wxss
@@ -1,4 +1,9 @@
-
+.pdt20 {
+ padding-top: 20rpx;
+}
+.pdt40 {
+ padding-top: 40rpx;
+}
.flex {
display: flex;
}
@@ -409,8 +414,107 @@ background: #ffe3e2;
flex-wrap:wrap;
}
+.line-through {
+ text-decoration:line-through;
+}
+
+
.lh1 {
line-height: 1;
}
+
+
+
+
+
+
+/* 图标字体(ty) */
+@font-face {
+ font-family: 'iconfont'; /* project id 2054717 */
+ src: url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.eot');
+ src: url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.eot?#iefix') format('embedded-opentype'),
+ url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.woff2') format('woff2'),
+ url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.woff') format('woff'),
+ url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.ttf') format('truetype'),
+ url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.svg#iconfont') format('svg');
+}
+
+.iconfont {
+ font-family: "iconfont" !important;
+ font-size: 16px;
+ font-style: normal;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.icon-save:before {
+ content: "\e6bb";
+}
+
+.icon-close:before {
+ content: "\e62e";
+}
+
+.icon-info:before {
+ content: "\e603";
+}
+
+.icon-people:before {
+ content: "\e66a";
+}
+
+.icon-fire:before {
+ content: "\e694";
+}
+
+.icon-live:before {
+ content: "\e664";
+}
+
+.icon-clock:before {
+ content: "\e608";
+}
+
+.icon-hot:before {
+ content: "\e680";
+}
+
+.icon-img:before {
+ content: "\e8c1";
+}
+
+.icon-shang:before {
+ content: "\e604";
+}
+
+.icon-xia:before {
+ content: "\e650";
+}
+
+.icon-daohang:before {
+ content: "\e748";
+}
+
+.icon-phone:before {
+ content: "\e602";
+}
+
+.icon-up:before {
+ content: "\e601";
+}
+
+.icon-arrow_right:before {
+ content: "\e61f";
+}
+
+.icon-arrow_down:before {
+ content: "\e600";
+}
+
+.icon-weizhi:before {
+ content: "\e615";
+}
+
+
diff --git a/components/nodata/nodata.js b/components/nodata/nodata.js
new file mode 100644
index 0000000..9752283
--- /dev/null
+++ b/components/nodata/nodata.js
@@ -0,0 +1,11 @@
+Component({
+ externalClasses: ['nodata-container'],
+ /*** 页面的初始数据***/
+ data: {
+
+ },
+
+ methods: {
+
+ }
+})
\ No newline at end of file
diff --git a/components/nodata/nodata.json b/components/nodata/nodata.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/components/nodata/nodata.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/components/nodata/nodata.wxml b/components/nodata/nodata.wxml
new file mode 100644
index 0000000..536a987
--- /dev/null
+++ b/components/nodata/nodata.wxml
@@ -0,0 +1,4 @@
+
+
+ 暂无数据
+
diff --git a/components/nodata/nodata.wxss b/components/nodata/nodata.wxss
new file mode 100644
index 0000000..731dd83
--- /dev/null
+++ b/components/nodata/nodata.wxss
@@ -0,0 +1,32 @@
+@font-face {
+ font-family: 'iconfont'; /* project id 1949577 */
+ src: url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.eot');
+ src: url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.eot?#iefix') format('embedded-opentype'),
+ url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.woff2') format('woff2'),
+ url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.woff') format('woff'),
+ url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.ttf') format('truetype'),
+ url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.svg#iconfont') format('svg');
+}
+.iconfont {
+ font-family: "iconfont" !important;
+ font-size: 32rpx;
+ font-style: normal;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+.icon-nodata:before {
+ content: "\e636";
+}
+.nodata-container {
+ text-align: center;
+}
+.nodata-icon {
+ font-size: 220rpx;
+ color: #ddd;
+ padding-top: 50rpx;
+}
+.nodata-title {
+ padding-top: 40rpx;
+ padding-bottom: 40rpx;
+ color: #bbb;
+}
\ No newline at end of file
diff --git a/components/share/share.js b/components/share/share.js
new file mode 100644
index 0000000..4058661
--- /dev/null
+++ b/components/share/share.js
@@ -0,0 +1,18 @@
+Component({
+ /*** 页面的初始数据***/
+ data: {
+ type:0,// 0默认情况发送好友和海报 1只有发送好友
+ },
+ methods: {
+ cancel() {
+ this.triggerEvent('cancel',{},{bubbles: true});
+ },
+ share_img(){
+ this.triggerEvent('share_img',{},{bubbles: true});
+ },
+ set_type(type){
+ this.setData({type:type})
+ }
+
+ }
+})
\ No newline at end of file
diff --git a/components/share/share.json b/components/share/share.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/components/share/share.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/components/share/share.wxml b/components/share/share.wxml
new file mode 100644
index 0000000..7e71849
--- /dev/null
+++ b/components/share/share.wxml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+ 生成海报分享
+
+
+
+
+
+
+ 取消
+
+
\ No newline at end of file
diff --git a/components/share/share.wxss b/components/share/share.wxss
new file mode 100644
index 0000000..bbec228
--- /dev/null
+++ b/components/share/share.wxss
@@ -0,0 +1,151 @@
+@charset "UTF-8";
+@font-face {
+ font-family: 'iconfont';
+ /* project id 2125414 */
+ src: url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.eot');
+ src: url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.eot?#iefix') format('embedded-opentype'),
+ url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.woff2') format('woff2'),
+ url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.woff') format('woff'),
+ url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.ttf') format('truetype'),
+ url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.svg#iconfont') format('svg');
+}
+
+.iconfont {
+ font-family: "iconfont" !important;
+ font-size: 32rpx;
+ font-style: normal;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.icon-weixin:before {
+ content: "\e677";
+}
+
+.icon-pic:before {
+ content: "\e620";
+}
+
+.container {
+ background-color: white;
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ left: 0;
+ top: 0;
+ background-color: rgba(0,0,0,.5);
+ z-index: 100;
+}
+.container-wrap {
+ background-color: white;
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+}
+.flex {
+ display: flex;
+}
+
+.btn {
+ box-sizing: border-box;
+ width: 50%;
+ padding: 30rpx;
+ text-align: center;
+}
+
+.icon-container {
+ width: 80rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ color: white;
+ border-radius: 50%;
+ text-align: center;
+ margin: 0 auto;
+}
+
+.iconfont {
+ font-size: 40rpx;
+}
+
+.bg-green {
+ background-color: #2ECB38;
+}
+
+.bg-red {
+ background-color: #F86C6C;
+}
+
+.title {
+ font-size: 28rpx;
+ color: #7b7b7b;
+ padding-top: 10rpx;
+}
+
+.btn-cancel {
+ padding: 20rpx;
+ text-align: center;
+ color: #7b7b7b;
+ background-color: #f9f9f9;
+ font-size: 28rpx;
+ line-height: 2;
+}
+
+.animated {
+ -webkit-animation-duration: .5s;
+ animation-duration: .5s;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both
+}
+
+.animated.infinite {
+ -webkit-animation-iteration-count: infinite;
+ animation-iteration-count: infinite
+}
+
+.animated.hinge {
+ -webkit-animation-duration: 2s;
+ animation-duration: 2s
+}
+
+@-webkit-keyframes slideInUp {
+ 0% {
+ opacity: 0;
+ -webkit-transform: translateY(2000px);
+ transform: translateY(2000px)
+ }
+
+ 100% {
+ opacity: 1;
+ -webkit-transform: translateY(0);
+ transform: translateY(0)
+ }
+}
+
+@keyframes slideInUp {
+ 0% {
+ opacity: 0;
+ -webkit-transform: translateY(100px);
+ -ms-transform: translateY(100px);
+ transform: translateY(100px)
+ }
+
+ 100% {
+ opacity: 1;
+ -webkit-transform: translateY(0);
+ -ms-transform: translateY(0);
+ transform: translateY(0)
+ }
+}
+
+.slideInUp {
+ -webkit-animation-name: slideInUp;
+ animation-name: slideInUp
+}
+
+button{
+ border: none;
+}
+
+button::after {
+ border: none;
+}
\ No newline at end of file
diff --git a/packageA/images/gt.png b/images/gt.png
index 354851e..354851e 100644
--- a/packageA/images/gt.png
+++ b/images/gt.png
diff --git a/packageA/pages/activity_share/activity_share.js b/packageA/pages/activity_share/activity_share.js
new file mode 100644
index 0000000..b3859ea
--- /dev/null
+++ b/packageA/pages/activity_share/activity_share.js
@@ -0,0 +1,1088 @@
+// packageA//pages/goods_share/goods_share.js
+var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js");
+var regeneratorRuntime = require('../../../utils/runtime.js');
+Page({
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ // tab
+ tab: ['秒杀','拼单','促销','专享礼包'],
+ currentIndex: 0,
+ //促销页tab
+ tab2: ['订单促销','搭配促销','优惠促销'],
+ currentIndex2: 0,
+ //秒杀和拼单底部tab
+ currentIndex3: 0,
+ // 控制价格
+ active1: false,
+ // 控制佣金
+ active2: false,
+ url:oo.imghost,
+ //popup
+ hiddenPopup: true,
+
+ list:[],
+ is_load:0, //是否正在加载
+ is_no_data:0, //没有数据
+ is_no_more:0, //没有更多数据
+ key_str:'',
+ pattern:0, //分成的方式
+ currentPage:1, //当前的页码
+
+ canvasHidden: 1, //-- 隐藏画布 --
+ dis_switch:0, //-- 分销开关 --
+ pattern:0, //-- 分成的方式 --
+ share_hidden:1, //-- 分享的按钮隐藏 --
+ share_good:null, //--- 要分享的商品 ---
+
+ timer:0,
+ hui_active:null, //优惠活动分享
+
+ //点击活动详情的时候的响应
+ list2:[],
+ is_load2:0,
+ is_no_data2:0, //没有数据
+ is_no_more2:0, //没有更多数据
+ currentPage2:1, //页码
+ prom_goods:null, //优惠活动的条件
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var th=this;
+ //接受有没有导购的参数
+ var first_leader=options.first_leader;
+ if(first_leader){
+ //-- user_id代过来免登陆 --
+ getApp().globalData.user_id=first_leader;
+ getApp().getUserFir();
+ }
+
+ this.requestGoodsList();
+ //-- 自定义海报 --
+ getApp().request.promiseGet("/api/weshop/goods/poster/page",{
+ data:{store_id:os.stoid, type:1, is_use:1 }
+ }).then(res=>{
+ if(res.data.code==0){
+
+ var poster_data=res.data.data.pageData[0];
+ var json_str=poster_data.jsonStr;
+
+ if(json_str){
+ var json_data=JSON.parse(json_str);
+ if(json_data.bg_img){
+
+ //-- 把图片那到本地 --
+ wx.getImageInfo({
+ src:json_data.bg_img,
+ success: function(res) {
+ var path= res.path;
+ th.setData({share_b_img:path})
+ },
+ fail: function(res) {}
+ });
+ }
+
+ th.setData({poster:json_data})
+
+ }
+ }
+ })
+
+ //获取分销的配置
+ getApp().request.promiseGet("/api/weshop/storeDistribut/get/"+oo.stoid,{}).then(res=>{
+ if(res.data.code==0){
+ th.setData({dis_switch:res.data.data.switch,pattern:res.data.data.pattern});
+ }
+ })
+
+ //获取用户设备信息,屏幕宽度
+ wx.getSystemInfo({
+ success: res => {
+ th.setData({
+ screenWidth: res.screenWidth
+ })
+ }
+ });
+
+ //-- ---秒杀和拼团都要有定时器---
+ if(!options.currentIndex || options.currentIndex<=1){
+ //设置全局定时器
+ th.data.timer=setInterval(function () {
+ th.countDown();
+ },1000);
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {},
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+ //--清理定时器--
+ clearInterval(this.timer);
+ },
+ /**e
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {},
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ var th = this;
+ //礼包的转发
+ if(th.data.currentIndex==3){
+ var lbid=th.data.hui_active.lbId;
+ var url="/pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1";
+ if(getApp().globalData.user_id){
+ url+="&first_leader="+getApp().globalData.user_id;
+ }
+ var img=this.data.share_img;
+ var title=th.data.hui_active.giftTitle;
+
+ var ob={
+ title:title,
+ path:url,
+ imageUrl: img,
+ };
+ th.setData({share_hidden:1});
+ return ob;
+
+ }else{
+ //---秒杀,拼团,促销---
+ var item=this.data.share_good;
+ if(item){
+ var price = item.price;
+ if(!price) price=item.shop_price;
+
+
+ var title= item.goods_name;
+ var img=this.data.url+item.original_img;
+ var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id;
+ if(getApp().globalData.user_id){
+ url+="&first_leader="+getApp().globalData.user_id;
+ }
+ var ob={
+ title: price + "元 " +title,
+ path:url,
+ imageUrl: img,
+ };
+ th.setData({share_hidden:1,share_good:null});
+ return ob;
+ }else{
+ var url="/pages/index/index/index";
+ if(getApp().globalData.user_id){
+ url+="?first_leader="+getApp().globalData.user_id;
+ }
+ var hui_active=this.data.hui_active;
+ var title=hui_active.name;
+ if(!title) title=hui_active.main_goods_name;
+ if(!title) title=hui_active.giftTitle;
+
+ var ob={
+ title: title,
+ path:url,
+ };
+ th.setData({share_hidden:1,share_good:null});
+ return ob;
+ }
+ }
+
+ },
+
+
+ //-- 点击tab --
+ clickTab(e) {
+ var th=this;
+ if(this.data.currentIndex!=e.target.dataset.index){
+ this.setData({
+ currentIndex: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[],
+ });
+ this.data.is_load=0;
+ this.data.currentPage=1;
+ this.requestGoodsList();
+ if(e.target.dataset.index<=1){
+ //设置全局定时器
+ this.data.timer=setInterval(function () {
+ th.countDown();
+ },1000);
+ }else{
+ clearInterval(this.timer);
+ }
+ }
+ },
+
+ //-- 点击促销页tab --
+ clickTab2(e) {
+ if(this.data.currentIndex2!=e.target.dataset.index){
+ this.setData({
+ currentIndex2: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[],
+ });
+ this.data.is_load=0;
+ this.data.currentPage=1;
+ this.requestGoodsList();
+ }
+
+ },
+ //-- 点击秒杀和拼单底部tab,火热进行和即将开始 --
+ clickTab3(e) {
+ if(this.data.currentIndex3!=e.target.dataset.index){
+ this.setData({
+ currentIndex3: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[],
+ });
+ this.data.is_load=0;
+ this.data.currentPage=1;
+ this.requestGoodsList();
+ }
+ },
+ // 关闭弹出层
+ closePopup() {
+ this.setData({
+ hiddenPopup: true
+ });
+ },
+
+ //--- 显示弹出层 ---
+ showPopup(e) {
+ var th=this;
+ var index=e.currentTarget.dataset.index;
+ var hui_active=this.data.list[index];
+
+ //---搭配促销--
+ this.setData({hui_active: hui_active});
+ ////---搭配促销--
+ if(this.data.currentIndex2==2){
+ this.get_prom_goods();
+ }else{
+ //-- 获取搭配购的从商品的信息 --
+ getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + hui_active.main_goods_id,{}).then(res=>{
+ if(res.data.code==0){
+ var info=res.data.data
+ th.setData({['hui_active.ginfo']:info});
+ }
+ })
+ this.get_colloction();
+ }
+ this.setData({hiddenPopup:false});
+
+ },
+
+ get_colloction: async function(){
+ var list=null;
+ //-- 获取搭配购的从商品的信息 --
+ await app.request.promiseGet("/api/weshop/goods/getGoodsPromList/"+oo.stoid+"/"+this.data.hui_active.main_goods_id+"/2",{}).then(res=>{
+ if(res.data.code==0){
+ list=res.data.data.collocationList;
+ }
+ })
+ if(list){
+ for(var i in list){
+ await app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + list[i].goods_id,{}).then(res=>{
+ if(res.data.code==0){
+ var info=res.data.data
+ list[i].shop_price=info.shop_price;
+ }
+ })
+ }
+ }
+ this.setData({list2:list});//把数据弄到前台
+
+ },
+ //-- 获取优惠商品的活动 --
+ get_prom_goods:function(){
+ var list=null;
+ var th=this;
+ var prom_goods=null;
+ var hui_active=this.data.hui_active;
+
+ //-- 获取优惠活动的详情信息 --
+ app.request.promiseGet("/api/weshop/promgoodslist/getPromGoodsInfo/"+hui_active.id,{}).then(res=>{
+ if(res.data.code==0){
+ prom_goods=res.data.data;
+ th.setData({prom_goods:prom_goods});
+ }
+ })
+ //-- 指定商品参与,才有商品列表分 --
+ if(hui_active.good_object==1){
+ this.request_prom_goods();
+ }
+
+ },
+
+ //-- -------获取商品列表--------
+ requestGoodsList:function(){
+ var th=this;
+ if(th.data.is_load) return false; //-- 正在加载
+ if(th.data.is_no_data) return false; //-- 没有数据
+ if(th.data.is_no_more) return false; //-- 没有更多
+ th.data.is_load=1;
+ var url="";
+ var req_data={
+ page:this.data.currentPage,
+ store_id:oo.stoid,
+ }
+
+ switch(th.data.currentIndex){
+ case 0: //--秒杀--
+ url="/api/ms/flash_sale/spikepage";
+ if(th.data.currentIndex3==0){
+ url+="?timetype=1"; //火热进行中
+ }else{
+ url+="?timetype=0"; //即将开始
+ }
+ req_data.is_show=1;
+ req_data.is_end=0;
+
+ if(th.data.key_str && th.data.key_str.trim()){
+ req_data.key_str=th.data.key_str.trim();
+ }
+ break;
+ case 1: //--拼团--
+ url="/api/weshop/teamlist/pageteam";
+ if(th.data.currentIndex3==0){
+ url+="/1"; //火热进行中
+ }else{
+ url+="/0"; //即将开始
+ }
+ req_data.is_show=1;
+ req_data.is_end=0;
+
+ if(th.data.key_str && th.data.key_str.trim()){
+ req_data.key_str=th.data.key_str.trim();
+ }
+ break;
+ case 2: //--促销--
+ if(th.data.currentIndex2==0){
+ url="//api/weshop/promorder/page";
+ if(th.data.key_str && th.data.key_str.trim()){
+ req_data.name=th.data.key_str.trim();
+ }
+ }else if(th.data.currentIndex2==1){
+ url="/api/weshop/prom/collocation/pageCollocationGoods";
+ if(th.data.key_str && th.data.key_str.trim()){
+ req_data.name=th.data.key_str.trim();
+ }
+ }else{
+ url="/api/weshop/promgoods/page";
+ if(th.data.key_str && th.data.key_str.trim()){
+ req_data.name=th.data.key_str.trim();
+ }
+ }
+ break;
+ case 3: //专享礼包
+ url='/api/weshop/marketing/giftbag/pageMd';
+ if(th.data.key_str && th.data.key_str.trim()){
+ req_data.key_str=th.data.key_str.trim();
+ }
+ break;
+ }
+
+ if(this.data.key_str && this.data.key_str.trim()){
+ var str=this.data.key_str.trim();
+ req_data.key_str=str;
+ }
+ //-- ---调用接口----
+ app.request.promiseGet(url,{data:req_data,isShowLoading:1}).then(res=>{
+ th.data.is_load=0;
+ if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
+ th.data.currentPage++;
+ var data=res.data.data.pageData;
+ if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});}
+ var list=th.data.list;
+ list=list.concat(data);
+ th.setData({list:list});
+ }else{
+ if(th.data.currentPage==1){
+ th.setData({is_no_data:1});
+ }
+ }
+ })
+ },
+
+ //-- -------获取活动详情的商品的列表--------
+ request_prom_goods:function(){
+ var th=this;
+ if(th.data.is_load2) return false; //-- 正在加载
+ if(th.data.is_no_data2) return false; //-- 没有数据
+ if(th.data.is_no_more2) return false; //-- 没有更多
+ th.data.is_load2=1;
+
+ var req_data={
+ page:th.data.currentPage2
+ }
+ app.request.promiseGet("/api/weshop/goods/page?store_id="+oo.stoid+"&prom_type=3&prom_id="+th.data.hui_active.id,{
+ data:req_data,isShowLoading:1
+ }).then(res=>{
+ th.data.is_load2=0;
+ if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
+ th.data.currentPage2++;
+ var data=res.data.data.pageData;
+ if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more2:1});}
+ var list=th.data.list2;
+ list=list.concat(data);
+ th.setData({list2:list});
+ }else{
+ if(th.data.currentPage==1){
+ th.setData({is_no_data2:1});
+ }
+ }
+ })
+ },
+
+ //--- 获取卡类列表 ---
+ 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.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);
+ })
+ },
+
+
+ //---图片失败,默认图片---
+ bind_bnerr2: function (e) {
+ var _errImg = e.target.dataset.errorimg;
+ var _errObj = {};
+ _errObj[_errImg] ="/miniapp/images/default_g_img.gif";
+ this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+ },
+ //-- ---更多加载----
+ refresh:function(){
+ this.requestGoodsList();
+ },
+
+ //--定义的保存图片方法,分享团---
+ saveImageToPhotosAlbum: function() {
+ //--先判断会员状态--
+ var user_info = getApp().globalData.userInfo;
+ if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ //getApp().my_warnning("请先登录",0,this);
+ wx.navigateTo({ url: '/pages/togoin/togoin', })
+ return false;
+ }
+ //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
+ var type = 0;
+ wx.showLoading({
+ title: '生成中...',
+ })
+ var that = this, th = that;
+ //设置画板显示,才能开始绘图,并关闭底部按钮
+ that.setData({
+ canvasHidden: false,share_hidden:1
+ })
+
+ var app = getApp();
+ var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
+ var scene = th.data.share_good.goods_id+"";
+ var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0;
+ if(user_id>0){
+ scene+="_"+user_id;
+ }
+
+ ///二微码
+ var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
+ os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
+
+ //读取文件成功则OK--
+ wx.getImageInfo({
+ src: path3,
+ success: function(res) {
+ //回调写法
+ th.get_head_temp(th.get_goods_temp, function() {
+ var vpath = res.path;
+ var context = wx.createCanvasContext('share');
+ //先画背景
+ var pg_path = "../../../images/share/share_bg.png";
+
+ //-- 如果有自定义海报的时候,判断背景的图片 --
+ if(th.data.share_b_img){
+ pg_path=th.data.share_b_img;
+ }
+ context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
+
+ //-- 是自定义海报的情况下 --
+ if(th.data.poster && parseInt(th.data.poster.style)==2){
+ //在线上分享人的情况下
+ if(parseInt(th.data.poster.show_headpic)){
+ //获取坐标
+ var x=parseFloat(th.data.poster.head_x)*2;
+ var y=parseFloat(th.data.poster.head_y)*2;
+ var x1=(x+90) *unit;
+ var y1=(y+50) *unit;
+ //--昵称---
+ context.setFontSize(24 * unit)
+ context.setFillStyle("black")
+ context.fillText(app.globalData.userInfo.nickname, x1, y1);
+ var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
+ //强烈推荐 改许程
+ var tj_path = "../../../images/share/q_tj.png";
+ context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
+ context.setFontSize(16 * unit)
+ context.setLineJoin('round'); //交点设置成圆角
+ context.setFillStyle("white")
+ context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit);
+ }
+ }else{
+ //--昵称---
+ context.setFontSize(24 * unit)
+ context.setFillStyle("black")
+ context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
+ var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
+ //强烈推荐 改许程
+ var tj_path = "../../../images/share/q_tj.png";
+ context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
+ context.setFontSize(16 * unit)
+ context.setLineJoin('round'); //交点设置成圆角
+ context.setFillStyle("white")
+ context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit);
+ }
+
+
+ //---产品名称---
+ //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
+ context.setFillStyle("black");
+ context.setFontSize(21.3 * unit)
+ th.draw_Text(context, th.data.share_good.goods_name,
+ 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
+ //------产品的价格-------
+ context.setFontSize(23 * unit)
+ context.setFillStyle("red")
+ context.fillText("¥", 416 * unit, 185 * unit);
+ context.setFontSize(31 * unit)
+ var pri0 = th.data.share_good.shop_price;
+ if (th.data.prom_act)
+ pri0 = th.data.prom_act.price;
+
+ pri0 = parseFloat(pri0).toFixed(2);
+ context.fillText(pri0, 438 * unit, 185 * unit);
+ //---市场价划掉---
+ context.setFillStyle("gray")
+ context.setFontSize(22 * unit)
+ context.fillText("¥" + th.data.share_good.market_price, 426 * unit, 213 * unit);
+ context.setStrokeStyle('gray')
+ context.setLineWidth(1 * unit)
+ context.moveTo(426 * unit, 206 * unit)
+ context.lineTo(510 * unit, 206 * unit)
+ context.stroke();
+ //---中间大图---
+ context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit);
+ //-------大图后面就不一样了-----------
+ switch (type) {
+ case 0: //普通商品的展示
+ //中间的几个字
+ if(th.data.poster && parseInt(th.data.poster.style)==2 ){
+ if(parseInt(th.data.poster.show_quality)){
+ var g_path = "../../../images/share/s_gou.png";
+ context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("正品保证", 84 * unit, 690 * unit);
+
+ context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("纯实体店", 246 * unit, 690 * unit);
+
+ context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("官方验证", 420 * unit, 690 * unit);
+ }
+
+ }else{
+ var g_path = "../../../images/share/s_gou.png";
+ context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("正品保证", 84 * unit, 690 * unit);
+
+ context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("纯实体店", 246 * unit, 690 * unit);
+
+ context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("官方验证", 420 * unit, 690 * unit);
+ }
+
+ //---画线---
+ context.setLineWidth(1 * unit)
+ context.moveTo(32 * unit, 710 * unit)
+ context.lineTo(520 * unit, 710 * unit)
+ context.stroke();
+ //---文字---
+ context.setFillStyle("black")
+ context.setFontSize(22 * unit)
+ // 原来start --->
+ context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit);
+ context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit);
+
+ //---二维吗图---
+ //-- 自定义海报 --
+ if(th.data.poster){
+ var erm_x= parseFloat(th.data.poster.ewm_x)*2;
+ var erm_y= parseFloat(th.data.poster.ewm_y)*2;
+ context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
+ }else{
+ //---二维吗图---
+ context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
+ }
+
+ break;
+ case 1: //秒杀商品的展示
+ //---画线---
+ context.setLineWidth(1 * unit)
+ context.moveTo(32 * unit, 670 * unit)
+ context.lineTo(520 * unit, 670 * unit)
+ context.stroke();
+
+ //画秒杀的图片
+ var miaos_path = '../../../images/share/miao_share.png';
+ context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit);
+
+ //---文字---
+ context.setFontSize(22 * unit)
+ context.setFillStyle("black")
+ context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit);
+ context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit);
+ //---二维吗图---
+ //-- 自定义海报 --
+ if(th.data.poster){
+ var erm_x= parseFloat(th.data.poster.ewm_x)*2;
+ var erm_y= parseFloat(th.data.poster.ewm_y)*2;
+ context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
+ }else{
+ //---二维吗图---
+ context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
+ }
+ break;
+
+ case 2: //会员团和商家团的展示
+ //---画线---
+ context.setLineWidth(1 * unit)
+ context.moveTo(32 * unit, 670 * unit)
+ context.lineTo(520 * unit, 670 * unit)
+ context.stroke();
+ //---文字---
+ context.setFontSize(22 * unit)
+ context.font = 'normal bold';
+ context.setFillStyle("black")
+ context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
+
+ //绘制成团图片
+ var ct_img = "../../../images/share/ct_num.png";
+ context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit);
+ var ct_num = th.data.prom_act.ct_num;
+ context.setFontSize(14 * unit)
+ context.font = 'normal';
+ context.setFillStyle("red")
+ if (ct_num < 10) {
+ context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit);
+ } else {
+ context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit);
+ }
+ context.setFontSize(22 * unit)
+ context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit);
+ context.setFillStyle("gray")
+ context.fillText("快来和我一起拼团吧!", 40 * unit, 826 * unit);
+ context.setFillStyle("black")
+ context.font = 'normal bold 18px sans-serif';
+ context.setFontSize(21.3 * unit)
+ context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit);
+ //---二维吗图---
+ //-- 自定义海报 --
+ if(th.data.poster){
+ var erm_x= parseFloat(th.data.poster.ewm_x)*2;
+ var erm_y= parseFloat(th.data.poster.ewm_y)*2;
+ context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
+ }else{
+ //---二维吗图---
+ context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
+ }
+ break
+ case 3: //阶梯团的展示
+ //---画线---
+ context.setLineWidth(1 * unit)
+ context.moveTo(32 * unit, 670 * unit)
+ context.lineTo(520 * unit, 670 * unit)
+ context.stroke();
+ //---文字---
+ context.setFontSize(22 * unit)
+ context.font = 'normal bold';
+ context.setFillStyle("black")
+ context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
+ //---绘制中间阶梯的价格---
+ var list = th.data.prom_act.ct_rylist;
+ for (var i = 0; i < list.length; i++) {
+ var item = list[i];
+ var wi = i * 90 * unit;
+ context.font = 'normal';
+ context.setFontSize(16 * unit)
+ context.setFillStyle("red")
+ context.fillText("¥", 40 * unit + wi, 756 * unit);
+ context.setFontSize(22 * unit)
+ var pri = parseFloat(item.price).toFixed(2);
+ context.fillText(pri, 56 * unit + wi, 756 * unit);
+ context.setFillStyle("gray")
+ context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit);
+ }
+ //----------------下面部分----------------
+ context.setFillStyle("gray")
+ context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit);
+ context.setFillStyle("black")
+ context.font = 'normal bold 18px sans-serif';
+ context.setFontSize(22 * unit)
+ context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit);
+
+ //-- 自定义海报 --
+ if(th.data.poster){
+ var erm_x= parseFloat(th.data.poster.ewm_x)*2;
+ var erm_y= parseFloat(th.data.poster.ewm_y)*2;
+ context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
+ }else{
+ //---二维吗图---
+ context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
+ }
+ break
+ }
+
+
+ //--- 如果是自定义海报的时候 ---
+ if(th.data.poster && parseInt(th.data.poster.style)==2){
+ //如果显示会员信息的话
+ if(parseInt(th.data.poster.show_headpic)){
+ //获取坐标
+ var x= parseFloat(th.data.poster.head_x)*2;
+ var y=parseFloat(th.data.poster.head_y)*2;
+ //---绘制圆形要放在最后----
+ context.save();
+ context.beginPath();
+ var h_x = x* unit;
+ var h_y = y * unit;
+ var h_r = 40 * unit;
+ var cx = h_x + h_r;
+ var cy = h_y + h_r;
+ context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
+ context.closePath();
+ context.fill();
+ context.clip();
+ context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
+ context.restore();
+ }
+
+ }else{
+ //---绘制圆形要放在最后----
+ context.save();
+ context.beginPath();
+ var h_x = 60 * unit;
+ var h_y = 24 * unit;
+ var h_r = 40 * unit;
+ var cx = h_x + h_r;
+ var cy = h_y + h_r;
+ context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
+ context.closePath();
+ context.fill();
+ context.clip();
+ context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
+ context.restore();
+ }
+
+
+ //把画板内容绘制成图片,并回调 画板图片路径
+ context.draw(false, function() {
+ setTimeout(function() {
+ wx.canvasToTempFilePath({
+ x: 0,
+ y: 0,
+ width: 750,
+ height: 1217,
+ destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
+ destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
+ canvasId: 'share',
+ success: function(res) {
+ that.setData({
+ shareImgPath: res.tempFilePath,
+ canvasHidden: true
+ })
+ if (!res.tempFilePath) {
+ wx.showModal({
+ title: '提示',
+ content: '图片绘制中,请稍后重试',
+ showCancel: false
+ })
+ return false;
+ }
+ wx.previewImage({
+ //将图片预览出来
+ urls: [that.data.shareImgPath]
+ });
+ //-- 将商品清空 --
+ th.setData({share_good:null});
+
+ wx.hideLoading();
+ }
+ })
+ }, 500)
+
+ });
+ });
+ }
+ });
+
+ },
+ //---点击分享优惠活动---
+ share_index:function(e){
+
+ //--先判断会员状态--
+ var user_info = getApp().globalData.userInfo;
+ if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ //getApp().my_warnning("请先登录",0,this);
+ wx.navigateTo({ url: '/pages/togoin/togoin', })
+ return false;
+ }
+
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ this.setData({share_hidden:0,hui_active:item});
+
+ var com = this.selectComponent("#share_button"); //组件的id
+ com.set_type(1);
+ },
+ //---点击分享商品---
+ share_good:function(e){
+
+ //--先判断会员状态--
+ var user_info = getApp().globalData.userInfo;
+ if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ //getApp().my_warnning("请先登录",0,this);
+ wx.navigateTo({ url: '/pages/togoin/togoin', })
+ return false;
+ }
+
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ this.setData({share_hidden:0,share_good:item});
+
+ var com = this.selectComponent("#share_button"); //组件的id
+ com.set_type(0);
+ },
+
+ //----活动详情里面的分享---
+ share_good2:function(e){
+ //--先判断会员状态--
+ var user_info = getApp().globalData.userInfo;
+ if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ //getApp().my_warnning("请先登录",0,this);
+ wx.navigateTo({ url: '/pages/togoin/togoin', })
+ return false;
+ }
+
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list2[index];
+ this.setData({share_hidden:0,share_good:item});
+ var com = this.selectComponent("#share_button"); //组件的id
+ com.set_type(0);
+ },
+
+ //-----详情里面的分享-------
+ share_detail:function(e){
+
+ //--先判断会员状态--
+ var user_info = getApp().globalData.userInfo;
+ if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ //getApp().my_warnning("请先登录",0,this);
+ wx.navigateTo({ url: '/pages/togoin/togoin', })
+ return false;
+ }
+
+ var com = this.selectComponent("#share_button"); //组件的id
+ com.set_type(0);
+
+ var idx=e.currentTarget.dataset.index;
+ var item=this.data.list2[index];
+ this.setData({share_hidden:0,share_good:item});
+ },
+
+ cancel:function(){
+ this.setData({share_hidden:1});
+ },
+
+ //--获取头像的本地缓存,回调写法--
+ get_head_temp: function(tt, func) {
+ var ee = this;
+ if (ee.data.share_head) {
+ tt(func);
+ return false;
+ }
+ //---获取分享图片的本地地址,头像和商品图片----
+ var path2 = getApp().globalData.userInfo.head_pic;
+ if (path2 == "") {
+ ee.data.share_head = "../../../images/share/hui_hear_pic.png";
+ tt(func);
+ } else {
+ path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
+ path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
+ wx.getImageInfo({
+ src: path2,
+ success: function(res) {
+ //res.path是网络图片的本地地址
+ ee.data.share_head = res.path;
+ tt(func);
+ },
+ fail: function(res) {
+ ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
+ tt(func);
+ }
+ });
+ }
+ },
+ //--获取商品图片的本地缓存,回调写法--
+ get_goods_temp: function(tt) {
+ var ee = this;
+ //获取商品是分享图信息
+ wx.getImageInfo({
+ src: ee.data.url+ee.data.share_good.original_img,
+ success: function(res) {
+ //res.path是网络图片的本地地址
+ ee.data.share_goods_img = res.path;
+ tt();
+ },
+ fail: function(res) {
+ ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
+ tt();
+ }
+ });
+ },
+
+ //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
+ draw_Text: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
+ var lineWidth = 0;
+ var lastSubStrIndex = 0; //每次开始截取的字符串的索引
+ var han = 0;
+ for (let i = 0; i < str.length; i++) {
+ if (han == 2) return;
+ //lineWidth += ctx.measureText(str[i]).width;
+ lineWidth += ut.measureText(str[i], 21.3 * unit);
+ if (lineWidth > canvasWidth) {
+ han++;
+
+ if (han == 2)
+ ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分
+ else
+ ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight);
+
+ initHeight += 22; //22为字体的高度
+ lineWidth = 0;
+ lastSubStrIndex = i;
+ titleHeight += 20;
+ }
+ if (i == str.length - 1) { //绘制剩余部分
+ ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight);
+ }
+ }
+ },
+
+ //---小于10的格式化函数----
+ timeFormat(param) {
+ return param < 10 ? '0' + param : param;
+ },
+
+ //----倒计时函数-----
+ countDown() {
+ if(!this.data.timer) return false;
+ var th=this;
+ // 获取当前时间,同时得到活动结束时间数组
+ let newTime =ut.gettimestamp();
+ var endTimeList = this.data.list;
+ if(endTimeList==null) return null
+ // 对结束时间进行处理渲染到页面
+ for (var i = 0; i < endTimeList.length;i++){
+ var o = endTimeList[i];
+ var endTime = o.end_time;
+ let obj = null;
+ // 如果活动未结束,对时间进行处理
+ if (endTime - newTime > 0){
+ let time = (endTime - newTime);
+ // 获取天、时、分、秒
+ let day = parseInt(time / (60 * 60 * 24));
+ let hou = parseInt(time % (60 * 60 * 24) / 3600);
+ let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
+ let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
+ obj = {
+ day: this.timeFormat(day), hou: this.timeFormat(hou), min: this.timeFormat(min), sec: this.timeFormat(sec), hide: 1
+ }
+ }else{
+ //活动已结束,全部设置为'00'
+ obj = { day: '00', hou: '00', min: '00', sec: '00' }
+ }
+ var txt ="list["+i+"].djs";
+ th.setData({ [txt]: obj});
+ }
+ },
+
+ //-------搜索的相关功能------
+ set_search_value:function(e){
+ var key_str=e.detail.value;
+ if(key_str) key_str=key_str.trim();
+ this.setData({key_str:key_str});
+
+ },
+ search_data:function(){
+ this.setData({
+ is_no_data:0,is_no_more:0,list:[],
+ });
+ this.data.is_load=0;
+ this.data.currentPage=1;
+ this.requestGoodsList();
+ },
+
+
+ go_goods:function(e){
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id;
+ getApp().goto(url);
+ },
+
+ go_coll_good:function(e){
+ var gid=e.currentTarget.dataset.gid;
+ var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid;
+ getApp().goto(url);
+ },
+
+ go_libao:function(e){
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ var lbid=item.lbId;
+ var url="/pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1";
+ getApp().goto(url);
+ }
+
+
+})
\ No newline at end of file
diff --git a/packageA/pages/activity_share/activity_share.json b/packageA/pages/activity_share/activity_share.json
new file mode 100644
index 0000000..1c34554
--- /dev/null
+++ b/packageA/pages/activity_share/activity_share.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "活动分享",
+ "usingComponents": {
+ "nodata": "/components/nodata/nodata",
+ "share_button": "/components/share/share"
+ },
+ "enablePullDownRefresh": false
+}
\ No newline at end of file
diff --git a/packageA/pages/activity_share/activity_share.wxml b/packageA/pages/activity_share/activity_share.wxml
new file mode 100644
index 0000000..3d3183c
--- /dev/null
+++ b/packageA/pages/activity_share/activity_share.wxml
@@ -0,0 +1,261 @@
+
+
+
+
+
+ 搜索
+
+
+
+
+
+
+
+ {{item}}
+
+
+
+
+
+ {{item}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+ 剩余{{g_filter.toFix(100*(item.goods_num-item.buy_num)/item.goods_num,2) }}%
+
+ 已抢{{item.buy_num}}件
+
+
+
+ 已拼{{item.buy_num}}份
+ 1人团
+
+
+ 剩余:
+ {{item.djs.day}}天
+ {{item.djs.hou}}时
+ {{item.djs.min}}分
+ {{item.djs.sec}}秒
+
+
+
+ ¥{{item.price}}
+ 零售价:¥{{item.market_price}}
+
+ 分享
+
+
+
+
+
+
+
+
+
+
+
+ 折
+ 减
+ 配
+ 惠
+ {{item.main_goods_name}}
+ {{item.name}}
+
+ 促销时间:{{g_filter.format_time(item.start_time,1)}} 到 {{g_filter.format_time(item.end_time,1)}}
+
+
+
+ 需购买金额:¥{{g_filter.toFix(item.money,2)}}
+ 折扣:{{item.expression}}(%)
+ 优惠金额:{{g_filter.toFix(item.expression,2)}}
+
+ 分享
+
+
+ 活动详情
+ 分享
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.giftTitle}}
+
+ ¥{{g_filter.toFix(item.payMoney,2)}}
+ /
+ {{item.payIntegral}}积分
+
+ 零售价:¥{{item.giftPosPrice}}
+
+ 分享
+
+
+
+
+
+
+ 暂无数据
+ - 已全部加载 -
+
+
+
+
+
+
+ 火热进行
+
+
+ 即将开始
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packageA/pages/activity_share/activity_share.wxss b/packageA/pages/activity_share/activity_share.wxss
new file mode 100644
index 0000000..25bedb9
--- /dev/null
+++ b/packageA/pages/activity_share/activity_share.wxss
@@ -0,0 +1,394 @@
+/* packageA//pages/goods_share/goods_share.wxss */
+.red {
+ color: #FE6867;
+}
+.gray {
+ color: #7b7b7b;
+}
+.w25 {
+ width: 25%;
+}
+.w50 {
+ width: 50%;
+}
+.w164 {
+ width: 164rpx;
+}
+.bold {
+ font-weight: bold;
+}
+page {
+ background-color: #f2f2f2;
+ height: 100%;
+}
+.container {
+ background-color: white;
+ height: 100%;
+}
+.search-container {
+ display: flex;
+ padding: 26rpx 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.input-container {
+ flex: 1;
+ border-radius: 6rpx 0 0 6rpx;
+ overflow: hidden;
+}
+.search {
+ background-color: #f0f0f0;
+ padding: 10rpx 20rpx;
+ font-size: 28rpx;
+}
+.btn-search {
+ background-color: #FE6867;
+ color: white;
+ padding: 0 30rpx;
+ display: flex;
+ align-items: center;
+ border-radius: 0 6rpx 6rpx 0;
+}
+.title {
+ display: flex;
+ font-size: 30rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.title .iconfont {
+ color: #ccc;
+ font-size: 16rpx;
+ margin-left: 8rpx;
+}
+.title-item {
+ width: 25%;
+ box-sizing: border-box;
+ text-align: center;
+ padding: 20rpx;
+ position: relative;
+}
+.title-item.active {
+ color: #FE6867;
+ font-weight: bold;
+}
+.title-item.active:after {
+ content:'';
+ position: absolute;
+ width: 50%;
+ height: 4rpx;
+ background-color: #FE6867;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ margin: 0 auto;
+}
+.list-container {
+ height: calc(100% - 118rpx);
+}
+.list {
+ box-sizing: border-box;
+ height: calc(100% - 82rpx);
+ background-color: #f2f2f2;
+ padding-bottom: 102rpx;
+}
+.list.active1 {
+ height: calc(100% - 82rpx - 78rpx);
+ padding-bottom: 0;
+}
+.list.active2 {
+ padding-bottom: 0;
+}
+.list-item {
+ display: flex;
+ padding: 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+}
+.img-container {
+ background-color: #f0f0f0;
+ width: 280rpx;
+ height: 248rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.img-container:after {
+
+}
+.details {
+ flex: 1;
+ padding-left: 20rpx;
+}
+.btn-share {
+ box-sizing: border-box;
+ display: inline-block;
+ background-color: #FE6867;
+ color: white;
+ padding: 8rpx 30rpx;
+ border-radius: 6rpx;
+ text-align: center;
+}
+.pdt14 {
+ padding-top: 14rpx;
+}
+.pdtb6 {
+ padding-top: 6rpx;
+ padding-bottom: 6rpx;
+}
+.pdtb8 {
+ padding-top: 8rpx;
+ padding-bottom: 8rpx;
+}
+.pdl20 {
+ padding-left: 104rpx;
+}
+
+
+.no-more {
+ line-height: 3;
+ color: #ccc;
+ /* background-color: #f2f2f2; */
+}
+.nodata {
+ text-align: center;
+ background-color: #f2f2f2;
+}
+.progress-container {
+ width: 55%;
+ padding-right: 10rpx;
+ position: relative;
+ text-align: center;
+}
+.retail {
+ color: #7b7b7b;
+ text-decoration: line-through;
+ font-size: 22rpx;
+ padding-left: 20rpx;
+}
+.name {
+ height: 76rpx;
+ overflow: hidden;
+}
+
+.percent {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ color: white;
+}
+.tabbar {
+ position: fixed;
+ width: 100%;
+ bottom: 0;
+ background-color: white;
+}
+.tabbar:after {
+ position: absolute;
+ content: '';
+ width: 2rpx;
+ height: 50%;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ background-color: #f0f0f0;
+}
+.tabbar-item {
+ width: 50%;
+ text-align: center;
+ padding-top: 30rpx;
+ padding-bottom: 30rpx;
+}
+.tabbar-item .iconfont {
+ margin-right: 10rpx;
+}
+.tabbar-item.active {
+ color: #FE6867;
+}
+
+
+.group-type,
+.group-num {
+ position: relative;
+ font-size: 22rpx;
+}
+.group-type:before,
+.group-num:before {
+ font-family: iconfont;
+}
+.group-type:before {
+ content: '\e66a';
+ color: white;
+ background-color: #FE6867;
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ padding-left: 6rpx;
+ padding-right: 10rpx;
+ line-height: 30rpx;
+}
+.group-num:before {
+ padding-right: 6rpx;
+}
+.group-num:before {
+ content: '\e694';
+ position: relative;
+}
+.group-num {
+ color: white;
+ background-color: #FE6867;
+ border-radius: 34rpx;
+ padding-left: 10rpx;
+ padding-right: 10rpx;
+ margin-right: 14rpx;
+}
+.group-type {
+ color: #FE6867;
+ border: 2rpx solid #FE6867;
+ padding-left: 42rpx;
+ padding-right: 4rpx;
+ border-radius: 6rpx;
+}
+
+.badge {
+ color: white;
+ padding: 0 20rpx;
+ border-radius: 6rpx;
+ background-color: #FE6867;
+ margin-right: 10rpx;
+}
+
+.subTab-title {
+ text-align: center;
+ justify-content: center;
+ align-items: center;
+ font-size: 28rpx;
+}
+.subTab-list {
+ padding: 20rpx;
+}
+.subTab-titleItem {
+ box-sizing: border-box;
+ width: calc(100% / 3);
+ padding: 20rpx 40rpx;
+ background-color: white;
+ border-right: 2rpx solid #f8f8f8;
+}
+.subTab-titleItem:last-child {
+ border-right: none;
+}
+.subTab-titleItem.active {
+ background-color: #FE6867;
+ color: white;
+}
+.subTab-item {
+ padding: 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+ border-radius: 8rpx;
+ box-shadow: 0 8px 12px #e7e9eb;
+}
+.subTab-item ~ .subTab-item {
+ margin-top: 20rpx;
+}
+.pdv10 {
+ padding-top: 10rpx;
+ padding-bottom: 10rpx;
+}
+.pdv20 {
+ padding-top: 20rpx;
+ padding-bottom: 20rpx;
+}
+.pdb10 {
+ padding-bottom: 10rpx;
+}
+.pdb20 {
+ padding-bottom: 20rpx;
+}
+.bdr-b {
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.dash-b {
+ border-bottom: 2rpx dashed #ddd;
+}
+.btn-container {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+}
+
+
+.popup-container {
+ content:'';
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ z-index: 3;
+ background-color: rgba(0,0,0,.6);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.popup {
+ width: 90%;
+}
+.popup-content {
+ box-sizing: border-box;
+ width: 100%;
+ background-color: white;
+ padding: 0 20rpx;
+ border-radius: 10rpx;
+ max-height: 1038rpx;
+}
+.icon-close {
+ font-size: 60rpx;
+ color: white;
+}
+.popup-btn {
+ padding-top: 30rpx;
+}
+
+.popup-title {
+ /* font-size: 28rpx; */
+ font-weight: bold;
+ padding: 20rpx 0;
+}
+.popup-title2 {
+ /* padding: 10rpx 0; */
+ padding-bottom: 8rpx;
+}
+.popup-title3 {
+ padding-left: 34rpx;
+ font-size: 30rpx;
+}
+.popup-list {
+ max-height: 602rpx;
+ overflow-y: auto;
+}
+
+
+radio .wx-radio-input {
+ width: 28rpx;
+ height: 28rpx;
+}
+
+
+radio .wx-radio-input.wx-radio-input-checked {
+ background-color: #FE6867;
+ border-color: #FE6867;
+}
+radio .wx-radio-input.wx-radio-input-checked::before{
+ color: white;
+}
+
+.popup-content.active {
+ max-height: 982rpx;
+ overflow: auto;
+}
+
+
diff --git a/packageA/pages/activity_share/g_filter.wxs b/packageA/pages/activity_share/g_filter.wxs
new file mode 100644
index 0000000..1b39749
--- /dev/null
+++ b/packageA/pages/activity_share/g_filter.wxs
@@ -0,0 +1,114 @@
+var g_filters = {
+ //-- 判断是不是有等级价 --
+ is_has_rank:function(rank_switch,item){
+ if(!rank_switch) return false;
+ if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true}
+ return false;
+ },
+
+ //-- 判断,不是等级会员时候,要显示的最低等级价和名称 --
+ get_card_price:function(goods,all_card,type){
+ var price1=parseFloat(goods['cardprice1']);
+ var price2=parseFloat(goods['cardprice2']);
+ var price3=parseFloat(goods['cardprice3']);
+ if(!all_card){
+ if(type==0) return 0;
+ return "";
+ }
+
+ var arr=[];
+ var min_price= 0;
+ var min_name="";
+
+ var min_price=null;
+ var min_name=null;
+ //---设置对应的价格名字----
+ for(var i=0;i<3;i++) {
+ var vl=all_card[i];
+ if(!vl) continue;
+ if(vl['CorrPrice']=="Price1" && price1>0)
+ {
+ if(min_price==null) {
+ min_price=price1;min_name=vl['CardName'];
+ }
+ else if(price10)
+ {
+ if(min_price==null) {
+ min_price=price2;min_name=vl['CardName'];
+ }
+ else if(price20)
+ {
+ if(min_price==null) {
+ min_price=price3;min_name=vl['CardName'];
+ }
+ else if(price34) min_name=min_name.substring(0, 8);
+ return min_name;
+ },
+
+ toFix: function (val, count) {
+ val = parseFloat(val);
+ return val.toFixed(count)
+ },
+ format_time: function (ts, isFull) {
+ // 如果数值位数为1,则补0
+ function appendZero(obj) {
+ if (obj < 10) {
+ return "0" + "" + obj;
+ } else {
+ return obj;
+ }
+ };
+
+ if (ts == null || ts == undefined || ts == '') return "";
+ var d = getDate(ts * 1000)
+ var fm = [d.getFullYear(), d.getMonth() + 1, d.getDate()].join('-');
+ var md = (d.getMonth() + 1) + '月' + d.getDate() + '日';
+ if (isFull == 1)
+ fm = fm + ' ' + [d.getHours(), d.getMinutes(), d.getSeconds()].join(':');
+ if (isFull == 2) {
+ fm = md + ' ' + [appendZero(d.getHours()), appendZero(d.getMinutes())].join(':');
+ }
+ return fm;
+ },
+
+}
+module.exports = {
+ is_has_rank:g_filters.is_has_rank,
+ get_card_price:g_filters.get_card_price,
+ toFix:g_filters.toFix,
+ format_time:g_filters.format_time,
+}
\ No newline at end of file
diff --git a/packageA/pages/addCustomer/addCustomer.js b/packageA/pages/addCustomer/addCustomer.js
new file mode 100644
index 0000000..9a4786c
--- /dev/null
+++ b/packageA/pages/addCustomer/addCustomer.js
@@ -0,0 +1,66 @@
+// packageA//pages/quan/quan.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/packageA/pages/addCustomer/addCustomer.json b/packageA/pages/addCustomer/addCustomer.json
new file mode 100644
index 0000000..ce68506
--- /dev/null
+++ b/packageA/pages/addCustomer/addCustomer.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "enablePullDownRefresh": false
+}
\ No newline at end of file
diff --git a/packageA/pages/addCustomer/addCustomer.wxml b/packageA/pages/addCustomer/addCustomer.wxml
new file mode 100644
index 0000000..814c3e8
--- /dev/null
+++ b/packageA/pages/addCustomer/addCustomer.wxml
@@ -0,0 +1,21 @@
+
+
+
+ 微信昵称
+ hello,我是您的专属顾问
+ 扫描下方二维码,加我微信吧~
+
+
+
+
+
+
+
+ 发给客户
+
+
+
+ 保存图片
+
+
+
\ No newline at end of file
diff --git a/packageA/pages/addCustomer/addCustomer.wxss b/packageA/pages/addCustomer/addCustomer.wxss
new file mode 100644
index 0000000..23dbb20
--- /dev/null
+++ b/packageA/pages/addCustomer/addCustomer.wxss
@@ -0,0 +1,491 @@
+
+.red {
+ color: #FE6867;
+}
+.gray {
+ color: #7b7b7b;
+}
+.w25 {
+ width: 25%;
+}
+.w50 {
+ width: 50%;
+}
+.w164 {
+ width: 164rpx;
+}
+.bold {
+ font-weight: bold;
+}
+.mgt12 {
+ margin-top: 12rpx;
+}
+view, text {
+ line-height: normal;
+}
+page,
+.container {
+ /* background-color: #f2f2f2; */
+ height: 100%;
+ /* background-color: pink; */
+}
+.container {
+ /* background-color: white; */
+ /* position: fixed;
+ width: 100%;
+ bottom: 0; */
+ box-sizing: border-box;
+ padding: 160rpx 40rpx 0;
+ background-image: linear-gradient(to top, #4481eb 0%, #04befe 100%);
+ /* padding-bottom: 128rpx; */
+}
+.search-container {
+ display: flex;
+ padding: 26rpx 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.input-container {
+ flex: 1;
+ border-radius: 6rpx 0 0 6rpx;
+ overflow: hidden;
+}
+.search {
+ background-color: #f0f0f0;
+ padding: 10rpx 20rpx;
+ font-size: 28rpx;
+}
+.btn-search {
+ background-color: #FE6867;
+ color: white;
+ padding: 0 30rpx;
+ display: flex;
+ align-items: center;
+ border-radius: 0 6rpx 6rpx 0;
+}
+.title {
+ display: flex;
+ font-size: 30rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.title .iconfont {
+ color: #ccc;
+ font-size: 16rpx;
+ margin-left: 8rpx;
+}
+.title-item {
+ width: 25%;
+ box-sizing: border-box;
+ text-align: center;
+ padding: 20rpx;
+ position: relative;
+}
+.title-item.active {
+ color: #FE6867;
+ font-weight: bold;
+}
+.title-item.active:after {
+ content:'';
+ position: absolute;
+ width: 50%;
+ height: 4rpx;
+ background-color: #FE6867;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ margin: 0 auto;
+}
+.list-container {
+ height: calc(100% - 118rpx);
+}
+.list {
+ box-sizing: border-box;
+ height: calc(100% - 82rpx);
+ background-color: #f2f2f2;
+ /* padding-bottom: 102rpx; */
+}
+.list.active1 {
+ height: calc(100% - 82rpx - 78rpx);
+ padding-bottom: 0;
+}
+.list.active2 {
+ padding-bottom: 0;
+}
+.list-item {
+ display: flex;
+ padding: 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+}
+.img-container {
+ background-color: #f0f0f0;
+ width: 280rpx;
+ height: 248rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+}
+.img-container:after {
+ font-family: iconfont;
+ content: '\e8c1';
+ color: #bbb;
+ font-size: 80rpx;
+}
+
+
+.img-container.live:before {
+ content: '\e664';
+}
+.img-container.coming:before {
+ content: '\e608';
+}
+.img-container.playback:before {
+ content: '\e603';
+}
+.img-container.live:before,
+.img-container.coming:before,
+.img-container.playback:before {
+ font-family: iconfont;
+ background-color: #FE6867;
+ color: white;
+ width: 50rpx;
+ height: 50rpx;
+ line-height: 50rpx;
+ text-align: center;
+ border-radius: 50%;
+ position: absolute;
+ left: 10rpx;
+ top: 10rpx;
+}
+.details {
+ flex: 1;
+ padding-left: 20rpx;
+}
+.btn-share {
+ box-sizing: border-box;
+ display: inline-block;
+ background-color: #FE6867;
+ color: white;
+ padding: 8rpx 30rpx;
+ border-radius: 6rpx;
+ text-align: center;
+}
+.pdt10 {
+ padding-top: 10rpx;
+}
+.pdt14 {
+ padding-top: 14rpx;
+}
+.pdtb6 {
+ padding-top: 6rpx;
+ padding-bottom: 6rpx;
+}
+.pdtb8 {
+ padding-top: 8rpx;
+ padding-bottom: 8rpx;
+}
+.pdl20 {
+ padding-left: 104rpx;
+}
+
+
+.no-more {
+ line-height: 3;
+ color: #ccc;
+ /* background-color: #f2f2f2; */
+}
+.nodata {
+ text-align: center;
+ background-color: #f2f2f2;
+}
+.progress-container {
+ width: 55%;
+ padding-right: 10rpx;
+ position: relative;
+ text-align: center;
+}
+.retail {
+ color: #7b7b7b;
+ text-decoration: line-through;
+ font-size: 22rpx;
+ padding-left: 20rpx;
+}
+.name {
+ height: 76rpx;
+ overflow: hidden;
+}
+
+.percent {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ color: white;
+}
+.tabbar {
+ position: fixed;
+ width: 100%;
+ bottom: 0;
+ background-color: white;
+}
+.tabbar:after {
+ position: absolute;
+ content: '';
+ width: 2rpx;
+ height: 50%;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ background-color: #f0f0f0;
+}
+.tabbar-item {
+ width: 50%;
+ text-align: center;
+ padding-top: 30rpx;
+ padding-bottom: 30rpx;
+}
+.tabbar-item .iconfont {
+ margin-right: 10rpx;
+}
+.tabbar-item.active {
+ color: #FE6867;
+}
+
+
+.group-type,
+.group-num {
+ position: relative;
+ font-size: 22rpx;
+}
+.group-type:before,
+.group-num:before {
+ font-family: iconfont;
+}
+.group-type:before {
+ content: '\e66a';
+ color: white;
+ background-color: #FE6867;
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ padding-left: 6rpx;
+ padding-right: 10rpx;
+ line-height: 30rpx;
+}
+.group-num:before {
+ padding-right: 6rpx;
+}
+.group-num:before {
+ content: '\e694';
+ position: relative;
+}
+.group-num {
+ color: white;
+ background-color: #FE6867;
+ border-radius: 34rpx;
+ padding-left: 10rpx;
+ padding-right: 10rpx;
+ margin-right: 14rpx;
+}
+.group-type {
+ color: #FE6867;
+ border: 2rpx solid #FE6867;
+ padding-left: 42rpx;
+ padding-right: 4rpx;
+ border-radius: 6rpx;
+}
+
+.badge {
+ color: white;
+ padding: 0 20rpx;
+ border-radius: 6rpx;
+ background-color: #FE6867;
+ margin-right: 10rpx;
+}
+
+.subTab-title {
+ text-align: center;
+ justify-content: center;
+ align-items: center;
+ font-size: 28rpx;
+}
+.subTab-list {
+ padding: 20rpx;
+}
+.subTab-titleItem {
+ box-sizing: border-box;
+ width: calc(100% / 3);
+ padding: 20rpx 40rpx;
+ background-color: white;
+ border-right: 2rpx solid #f8f8f8;
+}
+.subTab-titleItem:last-child {
+ border-right: none;
+}
+.subTab-titleItem.active {
+ background-color: #FE6867;
+ color: white;
+}
+.subTab-item {
+ padding: 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+ border-radius: 8rpx;
+ box-shadow: 0 8px 12px #e7e9eb;
+}
+.subTab-item ~ .subTab-item {
+ margin-top: 20rpx;
+}
+.pdv10 {
+ padding-top: 10rpx;
+ padding-bottom: 10rpx;
+}
+.pdv20 {
+ padding-top: 20rpx;
+ padding-bottom: 20rpx;
+}
+.pdb10 {
+ padding-bottom: 10rpx;
+}
+.pdb20 {
+ padding-bottom: 20rpx;
+}
+.bdr-b {
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.dash-b {
+ border-bottom: 2rpx dashed #ddd;
+}
+.btn-container {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+}
+
+
+/* .popup-container {
+ content:'';
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ z-index: 3;
+ background-color: rgba(0,0,0,.6);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.popup {
+ width: 90%;
+}
+.popup-content {
+ box-sizing: border-box;
+ width: 100%;
+ background-color: white;
+ padding: 0 20rpx;
+ border-radius: 10rpx;
+ max-height: 1038rpx;
+}
+.icon-close {
+ font-size: 60rpx;
+ color: white;
+}
+.popup-btn {
+ padding-top: 30rpx;
+}
+
+.popup-title {
+ /* font-size: 28rpx; */
+ /* font-weight: bold;
+ padding: 20rpx 0;
+}
+.popup-title2 { */
+ /* padding: 10rpx 0; */
+ /* padding-bottom: 8rpx;
+}
+.popup-title3 {
+ padding-left: 34rpx;
+ font-size: 30rpx;
+}
+.popup-list {
+ max-height: 602rpx;
+ overflow-y: auto;
+}
+
+
+radio .wx-radio-input {
+ width: 28rpx;
+ height: 28rpx;
+}
+
+
+radio .wx-radio-input.wx-radio-input-checked {
+ background-color: #FE6867;
+ border-color: #FE6867;
+}
+radio .wx-radio-input.wx-radio-input-checked::before{
+ color: white;
+}
+
+.popup-content.active {
+ max-height: 982rpx;
+ overflow: auto;
+} */
+
+.panel {
+ box-sizing: border-box;
+ background-color: white;
+ height: 100%;
+ border-radius: 16rpx;
+ position: relative;
+ padding-top: 140rpx;
+ box-shadow: 0 8px 12px #ccc;
+}
+.avatar {
+ width: 220rpx;
+ height: 220rpx;
+ border-radius: 50%;
+ background-color: skyblue;
+ position: absolute;
+ top: -100rpx;
+ left: 0;
+ right: 0;
+ margin: 0 auto;
+}
+.nickname {
+ padding-bottom: 60rpx;
+}
+.bottom {
+ background-color: white;
+ border-top: 2rpx solid #f0f0f0;
+ /* box-shadow: 0 -6px 8px #e7e9eb; */
+ width: 100%;
+ position: fixed;
+ left: 0;
+ bottom: 0;
+}
+.wx {
+ width: 60rpx;
+ height: 60rpx;
+}
+.save {
+ box-sizing: border-box;
+ padding-top: 6rpx;
+}
+.icon-save {
+ font-size: 50rpx;
+}
+.qrcode {
+ width: 480rpx;
+ height: 480rpx;
+ background-color: red;
+ margin: 60rpx auto 0;
+}
+
+
diff --git a/packageA/pages/goods_share/g_filter.wxs b/packageA/pages/goods_share/g_filter.wxs
new file mode 100644
index 0000000..9b68b2e
--- /dev/null
+++ b/packageA/pages/goods_share/g_filter.wxs
@@ -0,0 +1,85 @@
+var g_filters = {
+ //-- 判断是不是有等级价 --
+ is_has_rank:function(rank_switch,item){
+ if(!rank_switch) return false;
+ if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true}
+ return false;
+ },
+
+ //-- 判断,不是等级会员时候,要显示的最低等级价和名称 --
+ get_card_price:function(goods,all_card,type){
+ var price1=parseFloat(goods['cardprice1']);
+ var price2=parseFloat(goods['cardprice2']);
+ var price3=parseFloat(goods['cardprice3']);
+ if(!all_card){
+ if(type==0) return 0;
+ return "";
+ }
+
+ var arr=[];
+ var min_price= 0;
+ var min_name="";
+
+ var min_price=null;
+ var min_name=null;
+ //---设置对应的价格名字----
+ for(var i=0;i<3;i++) {
+ var vl=all_card[i];
+ if(!vl) continue;
+ if(vl['CorrPrice']=="Price1" && price1>0)
+ {
+ if(min_price==null) {
+ min_price=price1;min_name=vl['CardName'];
+ }
+ else if(price10)
+ {
+ if(min_price==null) {
+ min_price=price2;min_name=vl['CardName'];
+ }
+ else if(price20)
+ {
+ if(min_price==null) {
+ min_price=price3;min_name=vl['CardName'];
+ }
+ else if(price34) min_name=min_name.substring(0, 8);
+ return min_name;
+ },
+}
+module.exports = {
+ is_has_rank:g_filters.is_has_rank,
+ get_card_price:g_filters.get_card_price,
+}
\ No newline at end of file
diff --git a/packageA/pages/goods_share/goods_share.js b/packageA/pages/goods_share/goods_share.js
new file mode 100644
index 0000000..35948dc
--- /dev/null
+++ b/packageA/pages/goods_share/goods_share.js
@@ -0,0 +1,805 @@
+// packageA//pages/goods_share/goods_share.js
+var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js");
+Page({
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ // 控制价格
+ active1: false,
+ // 控制佣金
+ active2: false,
+ url:oo.imghost,
+ orderField:'sales_sum',
+ orderType:'desc',
+ list:[],
+ is_load:0, //是否正在加载
+ is_no_data:0, //没有数据
+ is_no_more:0, //没有更多数据
+ key_str:'',
+ pattern:0, //分成的方式
+ currentPage:1, //当前的页码
+
+ canvasHidden: 1, //-- 隐藏画布 --
+ dis_switch:0, //-- 分销开关 --
+ pattern:0, //-- 分成的方式 --
+ share_hidden:1, //-- 分享的按钮隐藏 --
+ share_good:null //--- 要分享的商品 ---
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var th=this;
+ //接受有没有导购的参数
+ var first_leader=options.first_leader;
+ if(first_leader){
+ //-- user_id代过来免登陆 --
+ getApp().globalData.user_id=first_leader;
+ getApp().getUserFir();
+ }
+ this.requestGoodsList();
+
+ //-- 自定义海报 --
+ getApp().request.promiseGet("/api/weshop/goods/poster/page",{
+ data:{store_id:os.stoid, type:1, is_use:1 }
+ }).then(res=>{
+ if(res.data.code==0){
+
+ var poster_data=res.data.data.pageData[0];
+ var json_str=poster_data.jsonStr;
+
+ if(json_str){
+ var json_data=JSON.parse(json_str);
+ if(json_data.bg_img){
+
+ //-- 把图片那到本地 --
+ wx.getImageInfo({
+ src:json_data.bg_img,
+ success: function(res) {
+ var path= res.path;
+ th.setData({share_b_img:path})
+ },
+ fail: function(res) {}
+ });
+ }
+
+ th.setData({poster:json_data})
+
+ }
+ }
+ })
+
+ //获取分销的配置
+ getApp().request.promiseGet("/api/weshop/storeDistribut/get/"+oo.stoid,{}).then(res=>{
+ if(res.data.code==0){
+ th.setData({dis_switch:res.data.data.switch,pattern:res.data.data.pattern});
+ }
+ })
+ //获取用户设备信息,屏幕宽度
+ wx.getSystemInfo({
+ success: res => {
+ th.setData({
+ screenWidth: res.screenWidth
+ })
+ }
+ });
+
+ },
+
+ /*** 生命周期函数--监听页面显示***/
+ onShow: function () {
+ var th=this;
+ getApp().getConfig2(function(rs){
+ //计算等级价相关
+ 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 && now4) card_name=card_name.substring(0,4);
+ th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list});
+ }
+ }
+ })
+ },500)
+ }
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {},
+ /**e
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ var th = this;
+ var item=this.data.share_good;
+ var price = item.shop_price;
+ var title= item.goods_name;
+ var img=this.data.url+item.original_img;
+
+ var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id;
+ if(getApp().globalData.user_id){
+ url+="&first_leader="+getApp().globalData.user_id;
+ }
+ var ob={
+ title: price + "元 " +title,
+ path:url,
+ imageUrl: img,
+ };
+ th.setData({share_hidden:1});
+ return ob;
+
+ },
+
+ // 点击价格排序
+ sort1() {
+ if(this.data.active2) {
+ this.setData({
+ active2: !this.data.active2
+ });
+ };
+ if(this.data.orderField!="shop_price"){
+ this.setData({
+ active1: 1,orderField:'shop_price',orderType:'asc',is_no_data:0,is_no_more:0,list:[],
+ });
+ }else{
+
+ var ty=this.data.orderType=='asc'?'desc':'asc';
+ this.setData({
+ orderType:ty,is_no_data:0,is_no_more:0,list:[],
+ });
+ }
+ this.data.is_load=0;
+ this.data.currentPage=1;
+ this.requestGoodsList();
+
+ },
+ // 点击佣金排序
+ sort2() {
+ if(this.data.active1) {
+ this.setData({
+ active1: !this.data.active1
+ });
+ };
+ if(this.data.orderField!="commission"){
+
+ if(this.data.pattern==0){
+ this.setData({
+ active2: 1,orderField:'commission',orderType:'asc',is_no_data:0,is_no_more:0,list:[],
+ });
+ }else{
+ this.setData({
+ active2: 1,orderField:'(fir_rate+sec_rate+thi_rate)',orderType:'asc',is_no_data:0,is_no_more:0,list:[],
+ });
+ }
+
+
+ }else{
+ this.setData({
+ orderType: (this.data.orderType=='asc'?'desc':'asc'),is_no_data:0,is_no_more:0,list:[],
+ });
+ }
+ this.data.is_load=0;
+ this.data.currentPage=1;
+ this.requestGoodsList();
+ },
+
+ //-- ----销量----
+ sale_sort(){
+ if(this.data.orderField!="sales_sum"){
+ this.setData({
+ active1: 0,active2:0,orderType:'desc',is_no_data:0,is_no_more:0,orderField:'sales_sum',list:[],
+ });
+ this.data.is_load=0;
+ this.data.currentPage=1;
+ this.requestGoodsList();
+ }
+ },
+
+ //-- ---最新---
+ new_sort:function(){
+ if(this.data.orderField!="is_new"){
+ this.setData({
+ active1: 0,active2:0,orderType:'desc',is_no_data:0,is_no_more:0,orderField:'is_new',list:[],
+ });
+ this.data.is_load=0;
+ this.data.currentPage=1;
+ this.requestGoodsList();
+ }
+ },
+
+ requestGoodsList:function(){
+ var th=this;
+ if(th.data.is_load) return false; //-- 正在加载
+ if(th.data.is_no_data) return false; //-- 没有数据
+ if(th.data.is_no_more) return false; //-- 没有更多
+ th.data.is_load=1;
+
+ var url="/api/weshop/goods/page";
+ var req_data={
+ page:this.data.currentPage,
+ is_mainshow:1,
+ isonsale:1,
+ store_id:oo.stoid,
+ orderField:this.data.orderField,
+ orderType:this.data.orderType,
+ }
+ if(this.data.key_str && this.data.key_str.trim()){
+ var str=this.data.key_str.trim();
+ req_data.key_str=str;
+ }
+ //-- ---调用接口----
+ app.request.promiseGet(url,{data:req_data,isShowLoading:1}).then(res=>{
+ th.data.is_load=0;
+ if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
+ th.data.currentPage++;
+ var data=res.data.data.pageData;
+ if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});}
+ var list=th.data.list;
+ list=list.concat(data);
+ th.setData({list:list});
+ }else{
+ if(th.data.currentPage==1){
+ th.setData({is_no_data:1});
+ }
+ }
+ })
+ },
+
+
+ //--- 获取卡类列表 ---
+ 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.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);
+ })
+ },
+
+
+ //---图片失败,默认图片---
+ bind_bnerr2: function (e) {
+ var _errImg = e.target.dataset.errorimg;
+ var _errObj = {};
+ _errObj[_errImg] ="/miniapp/images/default_g_img.gif";
+ this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+ },
+ //-- ---更多加载----
+ refresh:function(){
+ this.requestGoodsList();
+ },
+
+ //--定义的保存图片方法,分享团---
+ saveImageToPhotosAlbum: function() {
+ //--先判断会员状态--
+ var user_info = getApp().globalData.userInfo;
+ if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ //getApp().my_warnning("请先登录",0,this);
+ wx.navigateTo({ url: '/pages/togoin/togoin', })
+ return false;
+ }
+ //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
+ var type = 0;
+ wx.showLoading({
+ title: '生成中...',
+ })
+ var that = this, th = that;
+ //设置画板显示,才能开始绘图
+ that.setData({
+ canvasHidden: false,share_hidden:1
+ })
+
+ var app = getApp();
+ var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
+ var scene = th.data.share_good.goods_id+"";
+ var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0;
+ if(user_id>0){
+ scene+="_"+user_id;
+ }
+
+ ///二微码
+ var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
+ os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
+
+ //读取文件成功则OK--
+ wx.getImageInfo({
+ src: path3,
+ success: function(res) {
+ //回调写法
+ th.get_head_temp(th.get_goods_temp, function() {
+ var vpath = res.path;
+ var context = wx.createCanvasContext('share');
+ //先画背景
+ var pg_path = "../../../images/share/share_bg.png";
+
+ //-- 如果有自定义海报的时候,判断背景的图片 --
+ if(th.data.share_b_img){
+ pg_path=th.data.share_b_img;
+ }
+ context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
+
+ //-- 是自定义海报的情况下 --
+ if(th.data.poster && parseInt(th.data.poster.style)==2){
+ //在线上分享人的情况下
+ if(parseInt(th.data.poster.show_headpic)){
+ //获取坐标
+ var x=parseFloat(th.data.poster.head_x)*2;
+ var y=parseFloat(th.data.poster.head_y)*2;
+ var x1=(x+90) *unit;
+ var y1=(y+50) *unit;
+ //--昵称---
+ context.setFontSize(24 * unit)
+ context.setFillStyle("black")
+ context.fillText(app.globalData.userInfo.nickname, x1, y1);
+ var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
+ //强烈推荐 改许程
+ var tj_path = "../../../images/share/q_tj.png";
+ context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
+ context.setFontSize(16 * unit)
+ context.setLineJoin('round'); //交点设置成圆角
+ context.setFillStyle("white")
+ context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit);
+ }
+ }else{
+ //--昵称---
+ context.setFontSize(24 * unit)
+ context.setFillStyle("black")
+ context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
+ var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
+ //强烈推荐 改许程
+ var tj_path = "../../../images/share/q_tj.png";
+ context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
+ context.setFontSize(16 * unit)
+ context.setLineJoin('round'); //交点设置成圆角
+ context.setFillStyle("white")
+ context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit);
+ }
+
+
+ //---产品名称---
+ //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
+ context.setFillStyle("black");
+ context.setFontSize(21.3 * unit)
+ th.draw_Text(context, th.data.share_good.goods_name,
+ 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
+ //------产品的价格-------
+ context.setFontSize(23 * unit)
+ context.setFillStyle("red")
+ context.fillText("¥", 416 * unit, 185 * unit);
+ context.setFontSize(31 * unit)
+ var pri0 = th.data.share_good.shop_price;
+ if (th.data.prom_act)
+ pri0 = th.data.prom_act.price;
+
+ pri0 = parseFloat(pri0).toFixed(2);
+ context.fillText(pri0, 438 * unit, 185 * unit);
+ //---市场价划掉---
+ context.setFillStyle("gray")
+ context.setFontSize(22 * unit)
+ context.fillText("¥" + th.data.share_good.market_price, 426 * unit, 213 * unit);
+ context.setStrokeStyle('gray')
+ context.setLineWidth(1 * unit)
+ context.moveTo(426 * unit, 206 * unit)
+ context.lineTo(510 * unit, 206 * unit)
+ context.stroke();
+ //---中间大图---
+ context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit);
+ //-------大图后面就不一样了-----------
+ switch (type) {
+ case 0: //普通商品的展示
+ //中间的几个字
+ if(th.data.poster && parseInt(th.data.poster.style)==2 ){
+ if(parseInt(th.data.poster.show_quality)){
+ var g_path = "../../../images/share/s_gou.png";
+ context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("正品保证", 84 * unit, 690 * unit);
+
+ context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("纯实体店", 246 * unit, 690 * unit);
+
+ context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("官方验证", 420 * unit, 690 * unit);
+ }
+
+ }else{
+ var g_path = "../../../images/share/s_gou.png";
+ context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("正品保证", 84 * unit, 690 * unit);
+
+ context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("纯实体店", 246 * unit, 690 * unit);
+
+ context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
+ context.setFillStyle("red")
+ context.setFontSize(18 * unit)
+ context.fillText("官方验证", 420 * unit, 690 * unit);
+ }
+
+ //---画线---
+ context.setLineWidth(1 * unit)
+ context.moveTo(32 * unit, 710 * unit)
+ context.lineTo(520 * unit, 710 * unit)
+ context.stroke();
+ //---文字---
+ context.setFillStyle("black")
+ context.setFontSize(22 * unit)
+ // 原来start --->
+ context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit);
+ context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit);
+
+ //---二维吗图---
+ //-- 自定义海报 --
+ if(th.data.poster){
+ var erm_x= parseFloat(th.data.poster.ewm_x)*2;
+ var erm_y= parseFloat(th.data.poster.ewm_y)*2;
+ context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
+ }else{
+ //---二维吗图---
+ context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
+ }
+
+ break;
+ case 1: //秒杀商品的展示
+ //---画线---
+ context.setLineWidth(1 * unit)
+ context.moveTo(32 * unit, 670 * unit)
+ context.lineTo(520 * unit, 670 * unit)
+ context.stroke();
+
+ //画秒杀的图片
+ var miaos_path = '../../../images/share/miao_share.png';
+ context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit);
+
+ //---文字---
+ context.setFontSize(22 * unit)
+ context.setFillStyle("black")
+ context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit);
+ context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit);
+ //---二维吗图---
+ //-- 自定义海报 --
+ if(th.data.poster){
+ var erm_x= parseFloat(th.data.poster.ewm_x)*2;
+ var erm_y= parseFloat(th.data.poster.ewm_y)*2;
+ context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
+ }else{
+ //---二维吗图---
+ context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
+ }
+
+
+ break;
+
+ case 2: //会员团和商家团的展示
+ //---画线---
+ context.setLineWidth(1 * unit)
+ context.moveTo(32 * unit, 670 * unit)
+ context.lineTo(520 * unit, 670 * unit)
+ context.stroke();
+ //---文字---
+ context.setFontSize(22 * unit)
+ context.font = 'normal bold';
+ context.setFillStyle("black")
+ context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
+
+ //绘制成团图片
+ var ct_img = "../../../images/share/ct_num.png";
+ context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit);
+ var ct_num = th.data.prom_act.ct_num;
+ context.setFontSize(14 * unit)
+ context.font = 'normal';
+ context.setFillStyle("red")
+ if (ct_num < 10) {
+ context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit);
+ } else {
+ context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit);
+ }
+ context.setFontSize(22 * unit)
+ context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit);
+ context.setFillStyle("gray")
+ context.fillText("快来和我一起拼团吧!", 40 * unit, 826 * unit);
+ context.setFillStyle("black")
+ context.font = 'normal bold 18px sans-serif';
+ context.setFontSize(21.3 * unit)
+ context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit);
+ //---二维吗图---
+ //-- 自定义海报 --
+ if(th.data.poster){
+ var erm_x= parseFloat(th.data.poster.ewm_x)*2;
+ var erm_y= parseFloat(th.data.poster.ewm_y)*2;
+ context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
+ }else{
+ //---二维吗图---
+ context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
+ }
+ break
+ case 3: //阶梯团的展示
+ //---画线---
+ context.setLineWidth(1 * unit)
+ context.moveTo(32 * unit, 670 * unit)
+ context.lineTo(520 * unit, 670 * unit)
+ context.stroke();
+ //---文字---
+ context.setFontSize(22 * unit)
+ context.font = 'normal bold';
+ context.setFillStyle("black")
+ context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
+ //---绘制中间阶梯的价格---
+ var list = th.data.prom_act.ct_rylist;
+ for (var i = 0; i < list.length; i++) {
+ var item = list[i];
+ var wi = i * 90 * unit;
+ context.font = 'normal';
+ context.setFontSize(16 * unit)
+ context.setFillStyle("red")
+ context.fillText("¥", 40 * unit + wi, 756 * unit);
+ context.setFontSize(22 * unit)
+ var pri = parseFloat(item.price).toFixed(2);
+ context.fillText(pri, 56 * unit + wi, 756 * unit);
+ context.setFillStyle("gray")
+ context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit);
+ }
+ //----------------下面部分----------------
+ context.setFillStyle("gray")
+ context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit);
+ context.setFillStyle("black")
+ context.font = 'normal bold 18px sans-serif';
+ context.setFontSize(22 * unit)
+ context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit);
+
+ //-- 自定义海报 --
+ if(th.data.poster){
+ var erm_x= parseFloat(th.data.poster.ewm_x)*2;
+ var erm_y= parseFloat(th.data.poster.ewm_y)*2;
+ context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
+ }else{
+ //---二维吗图---
+ context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
+ }
+ break
+ }
+
+
+ //--- 如果是自定义海报的时候 ---
+ if(th.data.poster && parseInt(th.data.poster.style)==2){
+ //如果显示会员信息的话
+ if(parseInt(th.data.poster.show_headpic)){
+ //获取坐标
+ var x= parseFloat(th.data.poster.head_x)*2;
+ var y=parseFloat(th.data.poster.head_y)*2;
+ //---绘制圆形要放在最后----
+ context.save();
+ context.beginPath();
+ var h_x = x* unit;
+ var h_y = y * unit;
+ var h_r = 40 * unit;
+ var cx = h_x + h_r;
+ var cy = h_y + h_r;
+ context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
+ context.closePath();
+ context.fill();
+ context.clip();
+ context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
+ context.restore();
+ }
+
+ }else{
+ //---绘制圆形要放在最后----
+ context.save();
+ context.beginPath();
+ var h_x = 60 * unit;
+ var h_y = 24 * unit;
+ var h_r = 40 * unit;
+ var cx = h_x + h_r;
+ var cy = h_y + h_r;
+ context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
+ context.closePath();
+ context.fill();
+ context.clip();
+ context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
+ context.restore();
+ }
+
+
+ //把画板内容绘制成图片,并回调 画板图片路径
+ context.draw(false, function() {
+ setTimeout(function() {
+ wx.canvasToTempFilePath({
+ x: 0,
+ y: 0,
+ width: 750,
+ height: 1217,
+ destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
+ destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
+ canvasId: 'share',
+ success: function(res) {
+ that.setData({
+ shareImgPath: res.tempFilePath,
+ canvasHidden: true
+ })
+ if (!res.tempFilePath) {
+ wx.showModal({
+ title: '提示',
+ content: '图片绘制中,请稍后重试',
+ showCancel: false
+ })
+ return false;
+ }
+ wx.previewImage({
+ //将图片预览出来
+ urls: [that.data.shareImgPath]
+ });
+ wx.hideLoading();
+ }
+ })
+ }, 500)
+
+ });
+ });
+ }
+ });
+
+ },
+
+ //点击分享商品
+ share_good:function(e){
+ //--先判断会员状态--
+ var user_info = getApp().globalData.userInfo;
+ if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ //getApp().my_warnning("请先登录",0,this);
+ wx.navigateTo({ url: '/pages/togoin/togoin', })
+ return false;
+ }
+
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ this.setData({share_hidden:0,share_good:item});
+ },
+
+ cancel:function(){
+ this.setData({share_hidden:1});
+ },
+
+ //--获取头像的本地缓存,回调写法--
+ get_head_temp: function(tt, func) {
+ var ee = this;
+ if (ee.data.share_head) {
+ tt(func);
+ return false;
+ }
+ //---获取分享图片的本地地址,头像和商品图片----
+ var path2 = getApp().globalData.userInfo.head_pic;
+ if (path2 == "") {
+ ee.data.share_head = "../../../images/share/hui_hear_pic.png";
+ tt(func);
+ } else {
+ path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
+ path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
+ wx.getImageInfo({
+ src: path2,
+ success: function(res) {
+ //res.path是网络图片的本地地址
+ ee.data.share_head = res.path;
+ tt(func);
+ },
+ fail: function(res) {
+ ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
+ tt(func);
+ }
+ });
+ }
+ },
+ //--获取商品图片的本地缓存,回调写法--
+ get_goods_temp: function(tt) {
+ var ee = this;
+ //获取商品是分享图信息
+ wx.getImageInfo({
+ src: ee.data.url+ee.data.share_good.original_img,
+ success: function(res) {
+ //res.path是网络图片的本地地址
+ ee.data.share_goods_img = res.path;
+ tt();
+ },
+ fail: function(res) {
+ ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
+ tt();
+ }
+ });
+ },
+
+ //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
+ draw_Text: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
+ var lineWidth = 0;
+ var lastSubStrIndex = 0; //每次开始截取的字符串的索引
+ var han = 0;
+ for (let i = 0; i < str.length; i++) {
+ if (han == 2) return;
+ //lineWidth += ctx.measureText(str[i]).width;
+ lineWidth += ut.measureText(str[i], 21.3 * unit);
+ if (lineWidth > canvasWidth) {
+ han++;
+
+ if (han == 2)
+ ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分
+ else
+ ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight);
+
+ initHeight += 22; //22为字体的高度
+ lineWidth = 0;
+ lastSubStrIndex = i;
+ titleHeight += 20;
+ }
+ if (i == str.length - 1) { //绘制剩余部分
+ ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight);
+ }
+ }
+ },
+
+ //-------搜索的相关功能------
+ set_search_value:function(e){
+ var key_str=e.detail.value;
+ if(key_str) key_str=key_str.trim();
+ this.setData({key_str:key_str});
+
+ },
+ search_data:function(){
+ this.setData({
+ is_no_data:0,is_no_more:0,list:[],
+ });
+ this.data.is_load=0;
+ this.data.currentPage=1;
+ this.requestGoodsList();
+ },
+
+ go_goods:function(e){
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id;
+ getApp().goto(url);
+ }
+
+
+})
\ No newline at end of file
diff --git a/packageA/pages/goods_share/goods_share.json b/packageA/pages/goods_share/goods_share.json
new file mode 100644
index 0000000..e1c41f0
--- /dev/null
+++ b/packageA/pages/goods_share/goods_share.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "商品分享",
+ "usingComponents": {
+ "nodata": "/components/nodata/nodata",
+ "share_button": "/components/share/share"
+ },
+ "enablePullDownRefresh": false
+}
\ No newline at end of file
diff --git a/packageA/pages/goods_share/goods_share.wxml b/packageA/pages/goods_share/goods_share.wxml
new file mode 100644
index 0000000..ec817b0
--- /dev/null
+++ b/packageA/pages/goods_share/goods_share.wxml
@@ -0,0 +1,82 @@
+
+
+
+
+
+ 搜索
+
+
+
+
+
+ 销量
+
+
+ 价格
+
+
+ 价格
+
+
+
+ 佣金
+
+
+ 佣金
+
+
+ 最新
+
+
+
+
+
+
+
+
+
+ {{item.goods_name}}
+ ¥{{item.shop_price}}
+
+
+
+
+ PLUS¥{{item[card_field]}}
+
+
+
+ PLUS¥{{g_filter.get_card_price(item,card_list,0)}}
+
+
+
+
+
+ 已售:{{item.sales_sum}}
+ 分成金额:
+ ¥{{item.commission}}
+ ¥{{item.fir_rate+item.sec_rate+item.thi_rate}}
+
+
+
+ 分享
+
+
+
+
+ 暂无数据
+ - 已全部加载 -
+
+
+
+
+
+
+
+
diff --git a/packageA/pages/goods_share/goods_share.wxss b/packageA/pages/goods_share/goods_share.wxss
new file mode 100644
index 0000000..d88b837
--- /dev/null
+++ b/packageA/pages/goods_share/goods_share.wxss
@@ -0,0 +1,118 @@
+/* packageA//pages/goods_share/goods_share.wxss */
+.red {
+ color: #FE6867;
+}
+.gray {
+ color: #7b7b7b;
+}
+page {
+ background-color: #f2f2f2;
+ height: 100%;
+}
+.container {
+ background-color: white;
+ height: 100%;
+}
+.search-container {
+ display: flex;
+ padding: 26rpx 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.input-container {
+ flex: 1;
+ border-radius: 6rpx 0 0 6rpx;
+ overflow: hidden;
+}
+.search {
+ background-color: #f0f0f0;
+ padding: 10rpx 20rpx;
+ font-size: 28rpx;
+}
+.btn-search {
+ background-color: #FE6867;
+ color: white;
+ padding: 0 30rpx;
+ display: flex;
+ align-items: center;
+ border-radius: 0 6rpx 6rpx 0;
+}
+.title {
+ display: flex;
+ font-size: 30rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.title .iconfont {
+ color: #ccc;
+ font-size: 16rpx;
+ margin-left: 8rpx;
+}
+.title-item {
+ width: 25%;
+ box-sizing: border-box;
+ text-align: center;
+ padding: 20rpx;
+}
+.list-container {
+ height: calc(100% - 118rpx);
+}
+.list {
+ height: calc(100% - 82rpx);
+ background-color: #f2f2f2;
+}
+.list-item {
+ display: flex;
+ padding: 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+}
+.img-container {
+ background-color: #f0f0f0;
+ width: 280rpx;
+ height: 248rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.img-container:after {
+ /* font-family: iconfont;
+ content: '\e8c1';
+ color: #bbb;
+ font-size: 80rpx; */
+}
+.details {
+ flex: 1;
+ padding-left: 20rpx;
+}
+.btn-share {
+ display: inline-block;
+ background-color: #FE6867;
+ color: white;
+ padding: 8rpx 30rpx;
+ border-radius: 6rpx;
+}
+.pdt14 {
+ padding-top: 14rpx;
+}
+
+.no-more {
+ line-height: 3;
+ color: #ccc;
+ background-color: #f2f2f2;
+}
+.nodata {
+ text-align: center;
+ background-color: #f2f2f2;
+}
+
+.name {
+ height: 76rpx;
+}
+
+.plus_show{
+ background-color: #FE6867;
+ color: #fff;
+ padding: 3rpx 5rpx;
+ border-radius:8rpx ;
+ margin-left: 10rpx;
+ margin-right: 5rpx;
+}
diff --git a/packageA/pages/jfbuy/jfbuy.js b/packageA/pages/jfbuy/jfbuy.js
new file mode 100644
index 0000000..9cd3b51
--- /dev/null
+++ b/packageA/pages/jfbuy/jfbuy.js
@@ -0,0 +1,359 @@
+// packageA//pages/goods_share/goods_share.js
+var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js");
+var regeneratorRuntime = require('../../../utils/runtime.js');
+Page({
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ // tab
+ tab: ['全部','价格','销量','积分值'],
+ currentIndex: 1,
+ //促销页tab
+ // tab2: ['订单促销','搭配促销','优惠促销'],
+ // currentIndex2: 0,
+ //秒杀和拼单底部tab
+ // currentIndex3: 0,
+ // 控制价格
+ active1: false,
+ // 控制佣金
+ active2: false,
+ url: oo.imghost,
+ //popup
+ hiddenPopup: true,
+ // 排序
+ isUp: false,
+ //控制滚动条至顶部时开启下拉刷新
+ // open: false,
+ requestData: null,
+
+ list:[],
+ is_load:0, //是否正在加载
+ is_no_data:0, //没有数据
+ is_no_more:0, //没有更多数据
+ key_str:'',
+ pattern:0, //分成的方式
+ currentPage:1, //当前的页码
+
+ // canvasHidden: 1, //-- 隐藏画布 --
+ // dis_switch:0, //-- 分销开关 --
+ // pattern:0, //-- 分成的方式 --
+ // share_hidden:1, //-- 分享的按钮隐藏 --
+ // share_good:null, //--- 要分享的商品 ---
+
+ // timer:0,
+ // hui_active:null, //优惠活动分享
+
+ //点击活动详情的时候的响应
+ list2:[],
+ is_load2:0,
+ is_no_data2:0, //没有数据
+ is_no_more2:0, //没有更多数据
+ currentPage2:1, //页码
+ prom_goods:null, //优惠活动的条件
+
+
+ triggered: false,
+ isPullDownRefresh: false,
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.request_list({
+ store_id:oo.stoid,
+ stype:1,
+ stypeup:1
+ });
+ // var th=this;
+ // //接受有没有导购的参数
+ // var first_leader=options.first_leader;
+ // if(first_leader){
+ // //-- user_id代过来免登陆 --
+ // getApp().globalData.user_id=first_leader;
+ // getApp().getUserFir();
+ // }
+
+ // this.requestGoodsList();
+ //-- 自定义海报 --
+ // getApp().request.promiseGet("/api/weshop/goods/poster/page",{
+ // data:{store_id:os.stoid, type:1, is_use:1 }
+ // }).then(res=>{
+ // if(res.data.code==0){
+
+ // var poster_data=res.data.data.pageData[0];
+ // var json_str=poster_data.jsonStr;
+
+ // if(json_str){
+ // var json_data=JSON.parse(json_str);
+ // if(json_data.bg_img){
+
+ // //-- 把图片那到本地 --
+ // wx.getImageInfo({
+ // src:json_data.bg_img,
+ // success: function(res) {
+ // var path= res.path;
+ // th.setData({share_b_img:path})
+ // },
+ // fail: function(res) {}
+ // });
+ // }
+
+ // th.setData({poster:json_data})
+
+ // }
+ // }
+ // })
+
+ //获取分销的配置
+ // getApp().request.promiseGet("/api/weshop/storeDistribut/get/"+oo.stoid,{}).then(res=>{
+ // if(res.data.code==0){
+ // th.setData({dis_switch:res.data.data.switch,pattern:res.data.data.pattern});
+ // }
+ // })
+
+ //获取用户设备信息,屏幕宽度
+ // wx.getSystemInfo({
+ // success: res => {
+ // th.setData({
+ // screenWidth: res.screenWidth
+ // })
+ // }
+ // });
+
+ //-- ---秒杀和拼团都要有定时器---
+ // if(!options.currentIndex || options.currentIndex<=1){
+ // //设置全局定时器
+ // th.data.timer=setInterval(function () {
+ // th.countDown();
+ // },1000);
+ // }
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {},
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+ //--清理定时器--
+ // clearInterval(this.timer);
+ },
+ /**e
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ // onShareAppMessage: function () {
+ // var th = this;
+ // //礼包的转发
+ // if(th.data.currentIndex==3){
+ // var lbid=th.data.hui_active.lbId;
+ // var url="pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1";
+ // if(getApp().globalData.user_id){
+ // url+="&first_leader="+getApp().globalData.user_id;
+ // }
+ // var img=this.data.share_img;
+ // var title=th.data.hui_active.giftTitle;
+
+ // var ob={
+ // title:title,
+ // path:url,
+ // imageUrl: img,
+ // };
+ // th.setData({share_hidden:1});
+ // return ob;
+
+ // }else{
+ // //---秒杀,拼团,促销---
+ // var item=this.data.share_good;
+ // if(item){
+ // var price = item.shop_price;
+ // var title= item.goods_name;
+ // var img=this.data.url+item.original_img;
+ // var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
+ // if(getApp().globalData.user_id){
+ // url+="&first_leader="+getApp().globalData.user_id;
+ // }
+ // var ob={
+ // title: price + "元 " +title,
+ // path:url,
+ // imageUrl: img,
+ // };
+ // th.setData({share_hidden:1,share_good:null});
+ // return ob;
+ // }else{
+ // var url="/pages/index/index/index";
+ // if(getApp().globalData.user_id){
+ // url+="?first_leader="+getApp().globalData.user_id;
+ // }
+ // var hui_active=this.data.hui_active;
+ // var title=hui_active.name;
+ // if(!title) title=hui_active.main_goods_name;
+ // if(!title) title=hui_active.giftTitle;
+
+ // var ob={
+ // title: title,
+ // path:url,
+ // };
+ // th.setData({share_hidden:1,share_good:null});
+ // return ob;
+ // }
+ // }
+
+ // },
+
+
+ //-- 点击tab --
+ clickTab(e) {
+ var th=this;
+ var data = {
+ store_id:oo.stoid,
+ stype:e.target.dataset.index,
+ stypeup:1,
+ };
+ this.setData({
+ is_no_data2:0,
+ is_no_more2:0,
+ list2:[],
+ is_load2: 0,
+ currentPage2:1,
+ });
+ if(this.data.currentIndex!=e.target.dataset.index){
+ this.setData({
+ currentIndex: e.target.dataset.index,
+ isUp: false,
+ });
+
+ } else {
+ console.log('第2次点击');
+ this.setData({
+ isUp: !this.data.isUp
+ });
+ };
+
+ if(this.data.isUp) {
+ data.stypeup = 0;
+ } else {
+ data.stypeup = 1;
+ };
+
+ // this.data.requestData = data;
+ this.setData({
+ requestData: data
+ })
+
+ this.request_list(data);
+ },
+
+
+
+
+ request_list: function(data, callback){
+ // console.log('触发上拉刷新');
+
+ var th = this;
+ if(this.data.is_load2) return false; //-- 正在加载
+ if(this.data.is_no_data2) return false; //-- 没有数据
+ if(this.data.is_no_more2) return false; //-- 没有更多
+
+ // 开启加载状态
+ this.data.is_load2=1;
+
+ // var req_data = {
+ // page:th.data.currentPage2
+ // }
+
+ app.request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList", {
+ data: data
+ }).then(res=>{
+ // 关闭加载状态
+ th.data.is_load2=0;
+ // 请求成功
+ if(res.data.code==0) {
+ if(res.data.data.pageData.length>0) {
+ th.data.currentPage2++;
+ var data = res.data.data.pageData;
+ // 判断有无更多数据可以加载,如果大于则没有更多数据,反之则有
+ if(res.data.data.page*res.data.data.pageSize > res.data.data.total){th.setData({is_no_more2:1});}
+ var list=th.data.list2;
+ list=list.concat(data);
+ th.setData({list2:list});
+ } else {
+ if(th.data.currentPage==1){
+ th.setData({is_no_data2:1});
+ } else {
+ th.setData({is_no_more2:1});
+ }
+ }
+ if(callback) callback();
+ } else {
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ console.log('xx',res);
+ })
+ },
+
+
+
+
+ //---图片失败,默认图片---
+ bind_bnerr2: function (e) {
+ var _errImg = e.target.dataset.errorimg;
+ var _errObj = {};
+ _errObj[_errImg] ="/miniapp/images/default_g_img.gif";
+ this.setData(_errObj); //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+ // this.setData({['list2[0].original_img']:/miniapp/images/default_g_img.gif});
+ },
+ //-- ---更多加载----
+ refresh:function(){
+ this.request_list(this.data.requestData);
+ },
+
+
+
+ // 页面滚动
+ onPageScroll (e) {
+ console.log(e);
+ if(e.scrollTop == 0) {
+ this.setData({open: true });
+ } else {
+ this.setData({open: false});
+ }
+ },
+
+ // 下拉刷新
+ onPullDownRefresh() {
+ var th = this;
+ var data = this.data.requestData;
+
+ if(this.isPullDownRefresh) return;
+ // 触发下拉刷新开启
+ this.isPullDownRefresh = true;
+
+ this.setData({
+ list2: [],
+ currentPage2: 1,
+ is_no_more2: 0
+ });
+
+ this.request_list(data, function() {
+ th.setData({
+ triggered: false,
+ });
+ th.isPullDownRefresh = false;
+ });
+ },
+})
\ No newline at end of file
diff --git a/packageA/pages/jfbuy/jfbuy.json b/packageA/pages/jfbuy/jfbuy.json
new file mode 100644
index 0000000..0d8dbf3
--- /dev/null
+++ b/packageA/pages/jfbuy/jfbuy.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "积分购",
+ "usingComponents": {
+ "nodata": "/components/nodata/nodata",
+ "share_button": "/components/share/share"
+ },
+ "enablePullDownRefresh": false
+}
\ No newline at end of file
diff --git a/packageA/pages/jfbuy/jfbuy.wxml b/packageA/pages/jfbuy/jfbuy.wxml
new file mode 100644
index 0000000..ee9e04f
--- /dev/null
+++ b/packageA/pages/jfbuy/jfbuy.wxml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item}}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.goods_name}}
+
+
+ {{item.integral}}积分 + ¥{{item.addmoney}}
+
+
+ 零售价:¥{{item.shop_price}}
+ 销量:{{item.sales_sum}}
+
+
+
+
+
+
+
+
+ 暂无数据
+ - 已全部加载 -
+
+
+
+
+
+
diff --git a/packageA/pages/jfbuy/jfbuy.wxss b/packageA/pages/jfbuy/jfbuy.wxss
new file mode 100644
index 0000000..3bb8aae
--- /dev/null
+++ b/packageA/pages/jfbuy/jfbuy.wxss
@@ -0,0 +1,429 @@
+/* packageA//pages/goods_share/goods_share.wxss */
+.red {
+ color: #FE6867;
+}
+.gray {
+ color: #7b7b7b;
+}
+.w25 {
+ width: 25%;
+}
+.w50 {
+ width: 50%;
+}
+.w164 {
+ width: 164rpx;
+}
+.bold {
+ font-weight: bold;
+}
+page,
+.container {
+ height: 100%;
+}
+page {
+ background-color: #f2f2f2;
+ /* height: 100%; */
+}
+.container {
+ /* height: 100%; */
+ /* position: relative; */
+}
+
+.search-container {
+ /* display: flex;
+ padding: 26rpx 20rpx;
+ border-bottom: 2rpx solid #f8f8f8; */
+}
+.input-container {
+ /* flex: 1;
+ border-radius: 6rpx 0 0 6rpx;
+ overflow: hidden; */
+}
+.search {
+ /* background-color: #f0f0f0;
+ padding: 10rpx 20rpx;
+ font-size: 28rpx; */
+}
+.btn-search {
+ /* background-color: #FE6867;
+ color: white;
+ padding: 0 30rpx;
+ display: flex;
+ align-items: center;
+ border-radius: 0 6rpx 6rpx 0; */
+}
+.title {
+ display: flex;
+ font-size: 30rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+ position: sticky;
+ position: -webkit-sticky;
+ width: 100%;
+ top: 0;
+ z-index: 3;
+}
+.title .iconfont {
+ color: #ccc;
+ font-size: 16rpx;
+ margin-left: 8rpx;
+}
+.title-item {
+ width: 25%;
+ box-sizing: border-box;
+ text-align: center;
+ padding: 20rpx;
+ position: relative;
+}
+.title-item.active {
+ color: #FE6867;
+ font-weight: bold;
+}
+
+.title-item.active:before {
+ content:'';
+ position: absolute;
+ width: 60%;
+ height: 4rpx;
+ background-color: #FE6867;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ margin: 0 auto;
+}
+.title-item.active:after {
+ font-family: iconfont;
+ content: '\e650';
+ font-size: 18rpx;
+ margin-left: 8rpx;
+}
+.title-item.active.active1:after {
+ font-family: iconfont;
+ content: '\e604';
+ font-size: 18rpx;
+ margin-left: 8rpx;
+}
+.list-container {
+ height: calc(100% - 360rpx);
+ /* height: 100%; */
+}
+.list {
+ box-sizing: border-box;
+ height: calc(100% - 82rpx);
+ background-color: #f2f2f2;
+ /* padding-bottom: 102rpx; */
+}
+.list.active1 {
+ /* height: calc(100% - 82rpx - 78rpx); */
+ /* padding-bottom: 0; */
+}
+.list.active2 {
+ /* padding-bottom: 0; */
+}
+.list-item {
+ display: flex;
+ padding: 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+}
+.img-container {
+ background-color: #f0f0f0;
+ width: 280rpx;
+ height: 248rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.img-container:after {
+
+}
+.details {
+ flex: 1;
+ padding-left: 20rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+.btn-share {
+ box-sizing: border-box;
+ display: inline-block;
+ background-color: #FE6867;
+ color: white;
+ padding: 8rpx 30rpx;
+ border-radius: 6rpx;
+ text-align: center;
+}
+.pdt14 {
+ padding-top: 14rpx;
+}
+.pdtb6 {
+ padding-top: 6rpx;
+ padding-bottom: 6rpx;
+}
+.pdtb8 {
+ padding-top: 8rpx;
+ padding-bottom: 8rpx;
+}
+.pdl20 {
+ padding-left: 104rpx;
+}
+
+
+.no-more {
+ line-height: 3;
+ color: #ccc;
+ /* background-color: #f2f2f2; */
+}
+.nodata {
+ text-align: center;
+ background-color: #f2f2f2;
+}
+.progress-container {
+ width: 55%;
+ padding-right: 10rpx;
+ position: relative;
+ text-align: center;
+}
+.retail {
+ color: #7b7b7b;
+ text-decoration: line-through;
+ font-size: 22rpx;
+ padding-left: 20rpx;
+}
+.name {
+ height: 76rpx;
+ overflow: hidden;
+}
+
+.percent {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ color: white;
+}
+.tabbar {
+ position: fixed;
+ width: 100%;
+ bottom: 0;
+ background-color: white;
+}
+.tabbar:after {
+ position: absolute;
+ content: '';
+ width: 2rpx;
+ height: 50%;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ background-color: #f0f0f0;
+}
+.tabbar-item {
+ width: 50%;
+ text-align: center;
+ padding-top: 30rpx;
+ padding-bottom: 30rpx;
+}
+.tabbar-item .iconfont {
+ margin-right: 10rpx;
+}
+.tabbar-item.active {
+ color: #FE6867;
+}
+
+
+.group-type,
+.group-num {
+ position: relative;
+ font-size: 22rpx;
+}
+.group-type:before,
+.group-num:before {
+ font-family: iconfont;
+}
+.group-type:before {
+ content: '\e66a';
+ color: white;
+ background-color: #FE6867;
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ padding-left: 6rpx;
+ padding-right: 10rpx;
+ line-height: 30rpx;
+}
+.group-num:before {
+ padding-right: 6rpx;
+}
+.group-num:before {
+ content: '\e694';
+ position: relative;
+}
+.group-num {
+ color: white;
+ background-color: #FE6867;
+ border-radius: 34rpx;
+ padding-left: 10rpx;
+ padding-right: 10rpx;
+ margin-right: 14rpx;
+}
+.group-type {
+ color: #FE6867;
+ border: 2rpx solid #FE6867;
+ padding-left: 42rpx;
+ padding-right: 4rpx;
+ border-radius: 6rpx;
+}
+
+.badge {
+ color: white;
+ padding: 0 20rpx;
+ border-radius: 6rpx;
+ background-color: #FE6867;
+ margin-right: 10rpx;
+}
+
+.subTab-title {
+ text-align: center;
+ justify-content: center;
+ align-items: center;
+ font-size: 28rpx;
+}
+.subTab-list {
+ padding: 20rpx;
+}
+.subTab-titleItem {
+ box-sizing: border-box;
+ width: calc(100% / 3);
+ padding: 20rpx 40rpx;
+ background-color: white;
+ border-right: 2rpx solid #f8f8f8;
+}
+.subTab-titleItem:last-child {
+ border-right: none;
+}
+.subTab-titleItem.active {
+ background-color: #FE6867;
+ color: white;
+}
+.subTab-item {
+ padding: 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+ border-radius: 8rpx;
+ box-shadow: 0 8px 12px #e7e9eb;
+}
+.subTab-item ~ .subTab-item {
+ margin-top: 20rpx;
+}
+.pdv10 {
+ padding-top: 10rpx;
+ padding-bottom: 10rpx;
+}
+.pdv20 {
+ padding-top: 20rpx;
+ padding-bottom: 20rpx;
+}
+.pdb10 {
+ padding-bottom: 10rpx;
+}
+.pdb20 {
+ padding-bottom: 20rpx;
+}
+.bdr-b {
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.dash-b {
+ border-bottom: 2rpx dashed #ddd;
+}
+.btn-container {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+}
+
+
+/* .popup-container {
+ content:'';
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ z-index: 3;
+ background-color: rgba(0,0,0,.6);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.popup {
+ width: 90%;
+}
+.popup-content {
+ box-sizing: border-box;
+ width: 100%;
+ background-color: white;
+ padding: 0 20rpx;
+ border-radius: 10rpx;
+ max-height: 1038rpx;
+}
+.icon-close {
+ font-size: 60rpx;
+ color: white;
+}
+.popup-btn {
+ padding-top: 30rpx;
+} */
+
+/* .popup-title { */
+ /* font-size: 28rpx; */
+ /* font-weight: bold;
+ padding: 20rpx 0;
+} */
+/* .popup-title2 { */
+ /* padding: 10rpx 0; */
+ /* padding-bottom: 8rpx;
+}
+.popup-title3 {
+ padding-left: 34rpx;
+ font-size: 30rpx;
+}
+.popup-list {
+ max-height: 602rpx;
+ overflow-y: auto;
+}
+
+
+radio .wx-radio-input {
+ width: 28rpx;
+ height: 28rpx;
+}
+
+
+radio .wx-radio-input.wx-radio-input-checked {
+ background-color: #FE6867;
+ border-color: #FE6867;
+}
+radio .wx-radio-input.wx-radio-input-checked::before{
+ color: white;
+} */
+
+/* .popup-content.active {
+ max-height: 982rpx;
+ overflow: auto;
+} */
+
+.banner-container {
+ height: 360rpx;
+}
+.banner {
+ display: block;
+ width: 100%;
+ height: 100%;
+}
\ No newline at end of file
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.js b/packageA/pages/liveStreamDetails/liveStreamDetails.js
index ffa1f30..563ed96 100644
--- a/packageA/pages/liveStreamDetails/liveStreamDetails.js
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.js
@@ -397,6 +397,18 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un
onLoad: function (options) {
var that = this;
this.getSystemInfo();
+
+ var first_leader=options.first_leader;
+ if(first_leader){
+ //-- user_id代过来免登陆 --
+ getApp().globalData.first_leader=first_leader;
+ //调用接口判断是不是会员
+ getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+o.stoid+"/"+first_leader,{}).then(res=>{
+ if(res.data.code==0){
+ getApp().globalData.guide_id=res.data.data.id;
+ }
+ })
+ }
getApp().request.promiseGet("/api/weshop/wx/livelist/get",{
data:{ id: options.id }
diff --git a/packageA/pages/live_share/live_share.js b/packageA/pages/live_share/live_share.js
new file mode 100644
index 0000000..2631ba1
--- /dev/null
+++ b/packageA/pages/live_share/live_share.js
@@ -0,0 +1,194 @@
+// packageA//pages/goods_share/goods_share.js
+var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ //促销页tab
+ tab2: ['正在直播','即将开始','精彩回放'],
+ currentIndex2: 0,
+ //popup
+ hiddenPopup: true,
+
+ list:[],
+ is_load:0, //是否正在加载
+ is_no_data:0, //没有数据
+ is_no_more:0, //没有更多数据
+ key_str:'',
+ currentPage:1, //当前的页码
+ share_hidden:1, //-- 分享的按钮隐藏 --
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var th=this;
+ //接受有没有导购的参数
+ var first_leader=options.first_leader;
+ if(first_leader){
+ //-- user_id代过来免登陆 --
+ getApp().globalData.user_id=first_leader;
+ getApp().getUserFir();
+ }
+ this.requestGoodsList();
+
+ },
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ // onPullDownRefresh: function () {
+
+ // },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ var th=this;
+ var id=th.data.hui_active.id;
+ var url='/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + id + '&live=ing';
+ if(getApp().globalData.user_id){
+ url+="&first_leader="+getApp().globalData.user_id;
+ }
+ var title=th.data.hui_active.name;
+ var img=th.data.hui_active.share_img;
+ var ob={
+ title:title,
+ path:url,
+ imageUrl: img,
+ };
+ th.setData({share_hidden:1});
+ return ob;
+ },
+
+
+ // 点击tab
+ clickTab2(e) {
+ if(this.data.currentIndex2!=e.target.dataset.index){
+ this.setData({
+ currentIndex2: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[],
+ });
+ this.data.is_load=0;
+ this.data.currentPage=1;
+ this.requestGoodsList();
+ }
+ },
+
+ // 关闭弹出层
+ closePopup() {
+ this.setData({
+ hiddenPopup: true
+ });
+ },
+ // 显示弹出层
+ showPopup() {
+ this.setData({
+ hiddenPopup: false
+ });
+ },
+
+ requestGoodsList:function(){
+ var th=this;
+ if(th.data.is_load) return false; //-- 正在加载
+ if(th.data.is_no_data) return false; //-- 没有数据
+ if(th.data.is_no_more) return false; //-- 没有更多
+ th.data.is_load=1;
+
+ var url="/api/weshop/wx/livelist/page";
+ var req_data={
+ page:this.data.currentPage,
+ store_id:oo.stoid,
+ }
+ switch(th.data.currentIndex2){
+ case 0:
+ req_data.live_status=101;
+ break;
+ case 1:
+ req_data.live_status=102;
+ break;
+ case 2:
+ req_data.live_status=103;
+ break;
+ }
+ if(this.data.key_str && this.data.key_str.trim()){
+ var str=this.data.key_str.trim();
+ req_data.key_str=str;
+ }
+ //-- ---调用接口----
+ app.request.promiseGet(url,{data:req_data,isShowLoading:1}).then(res=>{
+ th.data.is_load=0;
+ if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
+ th.data.currentPage++;
+ var data=res.data.data.pageData;
+ if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});}
+ var list=th.data.list;
+ list=list.concat(data);
+ th.setData({list:list});
+ }else{
+ if(th.data.currentPage==1){
+ th.setData({is_no_data:1});
+ }
+ }
+ })
+ },
+
+ //---点击分享优惠活动---
+ share_index:function(e){
+
+ //--先判断会员状态--
+ var user_info = getApp().globalData.userInfo;
+ if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ //getApp().my_warnning("请先登录",0,this);
+ wx.navigateTo({ url: '/pages/togoin/togoin', })
+ return false;
+ }
+
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ this.setData({share_hidden:0,hui_active:item});
+
+ var com = this.selectComponent("#share_button"); //组件的id
+ com.set_type(1);
+ },
+ //-- ---更多加载----
+ refresh:function(){
+ this.requestGoodsList();
+ },
+
+ cancel:function(){
+ this.setData({share_hidden:1});
+ },
+ go_live:function(e){
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ var url='/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + item.id + '&live=ing';
+ getApp().goto(url);
+ }
+
+
+
+})
\ No newline at end of file
diff --git a/packageA/pages/live_share/live_share.json b/packageA/pages/live_share/live_share.json
new file mode 100644
index 0000000..1f8fbdf
--- /dev/null
+++ b/packageA/pages/live_share/live_share.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "直播间分享",
+ "usingComponents": {
+ "nodata": "/components/nodata/nodata",
+ "share_button": "/components/share/share"
+ },
+ "enablePullDownRefresh": false
+}
\ No newline at end of file
diff --git a/packageA/pages/live_share/live_share.wxml b/packageA/pages/live_share/live_share.wxml
new file mode 100644
index 0000000..353d0c1
--- /dev/null
+++ b/packageA/pages/live_share/live_share.wxml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+ {{item}}
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+ 直播时间:{{filter.format_time(item.start_time, 2)}}
+ 主播:{{item['anchor_name']}}
+ 分享
+
+
+
+
+ 暂无数据
+ - 已全部加载 -
+
+
+
+
+
+
diff --git a/packageA/pages/live_share/live_share.wxss b/packageA/pages/live_share/live_share.wxss
new file mode 100644
index 0000000..0bab69b
--- /dev/null
+++ b/packageA/pages/live_share/live_share.wxss
@@ -0,0 +1,425 @@
+/* packageA//pages/goods_share/goods_share.wxss */
+.red {
+ color: #FE6867;
+}
+.gray {
+ color: #7b7b7b;
+}
+.w25 {
+ width: 25%;
+}
+.w50 {
+ width: 50%;
+}
+.w164 {
+ width: 164rpx;
+}
+.bold {
+ font-weight: bold;
+}
+page {
+ background-color: #f2f2f2;
+ height: 100%;
+}
+.container {
+ background-color: white;
+ height: 100%;
+}
+.search-container {
+ display: flex;
+ padding: 26rpx 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.input-container {
+ flex: 1;
+ border-radius: 6rpx 0 0 6rpx;
+ overflow: hidden;
+}
+.search {
+ background-color: #f0f0f0;
+ padding: 10rpx 20rpx;
+ font-size: 28rpx;
+}
+.btn-search {
+ background-color: #FE6867;
+ color: white;
+ padding: 0 30rpx;
+ display: flex;
+ align-items: center;
+ border-radius: 0 6rpx 6rpx 0;
+}
+.title {
+ display: flex;
+ font-size: 30rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.title .iconfont {
+ color: #ccc;
+ font-size: 16rpx;
+ margin-left: 8rpx;
+}
+.title-item {
+ width: 25%;
+ box-sizing: border-box;
+ text-align: center;
+ padding: 20rpx;
+ position: relative;
+}
+.title-item.active {
+ color: #FE6867;
+ font-weight: bold;
+}
+.title-item.active:after {
+ content:'';
+ position: absolute;
+ width: 50%;
+ height: 4rpx;
+ background-color: #FE6867;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ margin: 0 auto;
+}
+.list-container {
+ height: calc(100% - 118rpx);
+}
+.list {
+ box-sizing: border-box;
+ height: calc(100% - 82rpx);
+ background-color: #f2f2f2;
+ /* padding-bottom: 102rpx; */
+}
+.list.active1 {
+ height: calc(100% - 82rpx - 78rpx);
+ padding-bottom: 0;
+}
+.list.active2 {
+ padding-bottom: 0;
+}
+.list-item {
+ display: flex;
+ padding: 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+}
+.img-container {
+ background-color: #f0f0f0;
+ width: 280rpx;
+ height: 248rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+}
+.img-container:after {}
+
+
+.img-container.live:before {
+ content: '\e664';
+}
+.img-container.coming:before {
+ content: '\e608';
+}
+.img-container.playback:before {
+ content: '\e603';
+}
+.img-container.live:before,
+.img-container.coming:before,
+.img-container.playback:before {
+ font-family: iconfont;
+ background-color: #FE6867;
+ color: white;
+ width: 50rpx;
+ height: 50rpx;
+ line-height: 50rpx;
+ text-align: center;
+ border-radius: 50%;
+ position: absolute;
+ left: 10rpx;
+ top: 10rpx;
+}
+.details {
+ flex: 1;
+ padding-left: 20rpx;
+}
+.btn-share {
+ box-sizing: border-box;
+ display: inline-block;
+ background-color: #FE6867;
+ color: white;
+ padding: 8rpx 30rpx;
+ border-radius: 6rpx;
+ text-align: center;
+}
+.pdt10 {
+ padding-top: 10rpx;
+}
+.pdt14 {
+ padding-top: 14rpx;
+}
+.pdtb6 {
+ padding-top: 6rpx;
+ padding-bottom: 6rpx;
+}
+.pdtb8 {
+ padding-top: 8rpx;
+ padding-bottom: 8rpx;
+}
+.pdl20 {
+ padding-left: 104rpx;
+}
+
+
+.no-more {
+ line-height: 3;
+ color: #ccc;
+ /* background-color: #f2f2f2; */
+}
+.nodata {
+ text-align: center;
+ background-color: #f2f2f2;
+}
+.progress-container {
+ width: 55%;
+ padding-right: 10rpx;
+ position: relative;
+ text-align: center;
+}
+.retail {
+ color: #7b7b7b;
+ text-decoration: line-through;
+ font-size: 22rpx;
+ padding-left: 20rpx;
+}
+.name {
+ height: 76rpx;
+ overflow: hidden;
+}
+
+.percent {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ color: white;
+}
+.tabbar {
+ position: fixed;
+ width: 100%;
+ bottom: 0;
+ background-color: white;
+}
+.tabbar:after {
+ position: absolute;
+ content: '';
+ width: 2rpx;
+ height: 50%;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ background-color: #f0f0f0;
+}
+.tabbar-item {
+ width: 50%;
+ text-align: center;
+ padding-top: 30rpx;
+ padding-bottom: 30rpx;
+}
+.tabbar-item .iconfont {
+ margin-right: 10rpx;
+}
+.tabbar-item.active {
+ color: #FE6867;
+}
+
+
+.group-type,
+.group-num {
+ position: relative;
+ font-size: 22rpx;
+}
+.group-type:before,
+.group-num:before {
+ font-family: iconfont;
+}
+.group-type:before {
+ content: '\e66a';
+ color: white;
+ background-color: #FE6867;
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ padding-left: 6rpx;
+ padding-right: 10rpx;
+ line-height: 30rpx;
+}
+.group-num:before {
+ padding-right: 6rpx;
+}
+.group-num:before {
+ content: '\e694';
+ position: relative;
+}
+.group-num {
+ color: white;
+ background-color: #FE6867;
+ border-radius: 34rpx;
+ padding-left: 10rpx;
+ padding-right: 10rpx;
+ margin-right: 14rpx;
+}
+.group-type {
+ color: #FE6867;
+ border: 2rpx solid #FE6867;
+ padding-left: 42rpx;
+ padding-right: 4rpx;
+ border-radius: 6rpx;
+}
+
+.badge {
+ color: white;
+ padding: 0 20rpx;
+ border-radius: 6rpx;
+ background-color: #FE6867;
+ margin-right: 10rpx;
+}
+
+.subTab-title {
+ text-align: center;
+ justify-content: center;
+ align-items: center;
+ font-size: 28rpx;
+}
+.subTab-list {
+ padding: 20rpx;
+}
+.subTab-titleItem {
+ box-sizing: border-box;
+ width: calc(100% / 3);
+ padding: 20rpx 40rpx;
+ background-color: white;
+ border-right: 2rpx solid #f8f8f8;
+}
+.subTab-titleItem:last-child {
+ border-right: none;
+}
+.subTab-titleItem.active {
+ background-color: #FE6867;
+ color: white;
+}
+.subTab-item {
+ padding: 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+ border-radius: 8rpx;
+ box-shadow: 0 8px 12px #e7e9eb;
+}
+.subTab-item ~ .subTab-item {
+ margin-top: 20rpx;
+}
+.pdv10 {
+ padding-top: 10rpx;
+ padding-bottom: 10rpx;
+}
+.pdv20 {
+ padding-top: 20rpx;
+ padding-bottom: 20rpx;
+}
+.pdb10 {
+ padding-bottom: 10rpx;
+}
+.pdb20 {
+ padding-bottom: 20rpx;
+}
+.bdr-b {
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.dash-b {
+ border-bottom: 2rpx dashed #ddd;
+}
+.btn-container {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+}
+
+
+/* .popup-container {
+ content:'';
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ z-index: 3;
+ background-color: rgba(0,0,0,.6);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.popup {
+ width: 90%;
+}
+.popup-content {
+ box-sizing: border-box;
+ width: 100%;
+ background-color: white;
+ padding: 0 20rpx;
+ border-radius: 10rpx;
+ max-height: 1038rpx;
+}
+.icon-close {
+ font-size: 60rpx;
+ color: white;
+}
+.popup-btn {
+ padding-top: 30rpx;
+}
+
+.popup-title {
+ /* font-size: 28rpx; */
+ /* font-weight: bold;
+ padding: 20rpx 0;
+}
+.popup-title2 { */
+ /* padding: 10rpx 0; */
+ /* padding-bottom: 8rpx;
+}
+.popup-title3 {
+ padding-left: 34rpx;
+ font-size: 30rpx;
+}
+.popup-list {
+ max-height: 602rpx;
+ overflow-y: auto;
+}
+
+
+radio .wx-radio-input {
+ width: 28rpx;
+ height: 28rpx;
+}
+
+
+radio .wx-radio-input.wx-radio-input-checked {
+ background-color: #FE6867;
+ border-color: #FE6867;
+}
+radio .wx-radio-input.wx-radio-input-checked::before{
+ color: white;
+}
+
+.popup-content.active {
+ max-height: 982rpx;
+ overflow: auto;
+} */
+
+
+
+
+
diff --git a/packageA/pages/quan/quan.js b/packageA/pages/quan/quan.js
new file mode 100644
index 0000000..d3d664a
--- /dev/null
+++ b/packageA/pages/quan/quan.js
@@ -0,0 +1,180 @@
+// packageA//pages/goods_share/goods_share.js
+var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ //促销页tab
+ tab2: ['免费发放'],
+ currentIndex2:0,
+ list:[],
+ is_load:0, //是否正在加载
+ is_no_data:0, //没有数据
+ is_no_more:0, //没有更多数据
+ key_str:'',
+ currentPage:1, //当前的页码
+ share_hidden:1, //-- 分享的按钮隐藏 --
+ hiddenPopup:1,
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var th=this;
+ //接受有没有导购的参数
+ var first_leader=options.first_leader;
+ if(first_leader){
+ //-- user_id代过来免登陆 --
+ getApp().globalData.user_id=first_leader;
+ getApp().getUserFir();
+ }
+ this.requestGoodsList();
+ this.setData({getcurday:ut.gettimestamp()});
+
+ wx.setNavigationBarTitle({
+ title: "免费优惠券列表",
+ })
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () { },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ // onPullDownRefresh: function () {
+
+ // },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ var th=this;
+ var id=th.data.hui_active.id;
+ var url="/packageA/pages/quan_pro/quan_pro?id="+id;
+
+ if(getApp().globalData.user_id){
+ url+="&first_leader="+getApp().globalData.user_id;
+ }
+ var title=th.data.hui_active.name;
+ var ob={
+ title:title,
+ path:url,
+ };
+ th.setData({share_hidden:1});
+ return ob;
+ },
+
+ requestGoodsList:function(){
+ var th=this;
+ if(th.data.is_load) return false; //-- 正在加载
+ if(th.data.is_no_data) return false; //-- 没有数据
+ if(th.data.is_no_more) return false; //-- 没有更多
+ th.data.is_load=1;
+
+ var url="/api/weshop/prom/coupon/pageCouponList";
+ var req_data={
+ page:this.data.currentPage,
+ store_id:oo.stoid,
+ type:1
+ }
+
+ //-- ---调用接口----
+ app.request.promiseGet(url,{data:req_data,isShowLoading:1}).then(res=>{
+ th.data.is_load=0;
+ if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
+ th.data.currentPage++;
+ var data=res.data.data.pageData;
+ if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});}
+ var list=th.data.list;
+ list=list.concat(data);
+ th.setData({list:list});
+ }else{
+ if(th.data.currentPage==1){
+ th.setData({is_no_data:1});
+ }
+ }
+ })
+ },
+
+
+ //---点击分享优惠活动---
+ share_index:function(e){
+
+ //--先判断会员状态--
+ var user_info = getApp().globalData.userInfo;
+ if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ //getApp().my_warnning("请先登录",0,this);
+ wx.navigateTo({ url: '/pages/togoin/togoin', })
+ return false;
+ }
+
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ this.setData({share_hidden:0,hui_active:item});
+
+ var com = this.selectComponent("#share_button"); //组件的id
+ com.set_type(1);
+ },
+ //-- ---更多加载----
+ refresh:function(){
+ this.requestGoodsList();
+ },
+
+ //---点击分享优惠活动---
+ share_index:function(e){
+
+ //--先判断会员状态--
+ var user_info = getApp().globalData.userInfo;
+ if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ //getApp().my_warnning("请先登录",0,this);
+ wx.navigateTo({ url: '/pages/togoin/togoin', })
+ return false;
+ }
+
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ this.setData({share_hidden:0,hui_active:item});
+
+ var com = this.selectComponent("#share_button"); //组件的id
+ com.set_type(1);
+ },
+
+ cancel:function(){
+ this.setData({share_hidden:1});
+ },
+
+ go_quan:function(e){
+ var index=e.currentTarget.dataset.index;
+ var item=this.data.list[index];
+ var url="/packageA/pages/quan_pro/quan_pro?id="+item.id;
+ getApp().goto(url);
+ }
+
+
+
+
+
+
+
+})
\ No newline at end of file
diff --git a/packageA/pages/quan/quan.json b/packageA/pages/quan/quan.json
new file mode 100644
index 0000000..7d53138
--- /dev/null
+++ b/packageA/pages/quan/quan.json
@@ -0,0 +1,8 @@
+{
+ "usingComponents": {
+ "nodata": "/components/nodata/nodata",
+ "share_button": "/components/share/share"
+ },
+ "navigationBarTitleText": "免费优惠券列表",
+ "enablePullDownRefresh": false
+}
\ No newline at end of file
diff --git a/packageA/pages/quan/quan.wxml b/packageA/pages/quan/quan.wxml
new file mode 100644
index 0000000..089d1f3
--- /dev/null
+++ b/packageA/pages/quan/quan.wxml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+ 限时使用:
+ {{filters.format_time(getcurday+3600*24*item.startdays)}}
+ {{filters.format_time(item.use_start_time)}}至
+ {{filters.format_time(item.use_end_time)}}不限
+
+ 限时使用:
+ {{filters.format_time(getcurday+3600*24*item.startdays)}}至 {{filters.format_time(getcurday+3600*24*item.days)}}不限
+
+
+ ¥{{filters.toFix(item.money,2)}}
+
+
+ 全场任意产品通用
+ 名牌({{item.useobjectname}})
+ 品类({{item.useobjectname}})
+ 用途({{item.useobjectname}})
+ 分类一({{item.useobjectname}})
+ 单品({{item.useobjectname}})
+
+ 分享
+
+
+
+
+
+ 暂无数据
+ - 已全部加载 -
+
+
+
+
+
+
diff --git a/packageA/pages/quan/quan.wxss b/packageA/pages/quan/quan.wxss
new file mode 100644
index 0000000..6146348
--- /dev/null
+++ b/packageA/pages/quan/quan.wxss
@@ -0,0 +1,513 @@
+/* packageA//pages/goods_share/goods_share.wxss */
+.red {
+ color: #FE6867;
+}
+.gray {
+ color: #7b7b7b;
+}
+.w25 {
+ width: 25%;
+}
+.w50 {
+ width: 50%;
+}
+.w164 {
+ width: 164rpx;
+}
+.bold {
+ font-weight: bold;
+}
+page {
+ background-color: #f2f2f2;
+ height: 100%;
+}
+.container {
+ /* background-color: white; */
+ height: 100%;
+}
+.search-container {
+ display: flex;
+ padding: 26rpx 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.input-container {
+ flex: 1;
+ border-radius: 6rpx 0 0 6rpx;
+ overflow: hidden;
+}
+.search {
+ background-color: #f0f0f0;
+ padding: 10rpx 20rpx;
+ font-size: 28rpx;
+}
+.btn-search {
+ background-color: #FE6867;
+ color: white;
+ padding: 0 30rpx;
+ display: flex;
+ align-items: center;
+ border-radius: 0 6rpx 6rpx 0;
+}
+.title {
+ display: flex;
+ font-size: 30rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.title .iconfont {
+ color: #ccc;
+ font-size: 16rpx;
+ margin-left: 8rpx;
+}
+.title-item {
+ width: 25%;
+ box-sizing: border-box;
+ text-align: center;
+ padding: 20rpx;
+ position: relative;
+}
+.title-item.active {
+ color: #FE6867;
+ font-weight: bold;
+}
+.title-item.active:after {
+ content:'';
+ position: absolute;
+ width: 50%;
+ height: 4rpx;
+ background-color: #FE6867;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ margin: 0 auto;
+}
+.list-container {
+ /* height: 100%; */
+}
+.list {
+ box-sizing: border-box;
+ /* height: calc(100% - 78rpx); */
+ height: 100%;
+ background-color: #f2f2f2;
+ padding: 20rpx 20rpx 0 20rpx;
+ /* padding-bottom: 102rpx; */
+}
+.list.active1 {
+ height: calc(100% - 82rpx - 78rpx);
+ padding-bottom: 0;
+}
+.list.active2 {
+ padding-bottom: 0;
+}
+.list-item {
+ display: flex;
+ padding: 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+}
+.img-container {
+ background-color: #f0f0f0;
+ width: 280rpx;
+ height: 248rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+}
+.img-container:after {
+ font-family: iconfont;
+ content: '\e8c1';
+ color: #bbb;
+ font-size: 80rpx;
+}
+
+
+.img-container.live:before {
+ content: '\e664';
+}
+.img-container.coming:before {
+ content: '\e608';
+}
+.img-container.playback:before {
+ content: '\e603';
+}
+.img-container.live:before,
+.img-container.coming:before,
+.img-container.playback:before {
+ font-family: iconfont;
+ background-color: #FE6867;
+ color: white;
+ width: 50rpx;
+ height: 50rpx;
+ line-height: 50rpx;
+ text-align: center;
+ border-radius: 50%;
+ position: absolute;
+ left: 10rpx;
+ top: 10rpx;
+}
+.details {
+ flex: 1;
+ padding-left: 20rpx;
+}
+.btn-share {
+ box-sizing: border-box;
+ display: inline-block;
+ background-color: #FE6867;
+ color: white;
+ padding: 8rpx 30rpx;
+ border-radius: 6rpx;
+ text-align: center;
+}
+.pdt10 {
+ padding-top: 10rpx;
+}
+.pdt14 {
+ padding-top: 14rpx;
+}
+.pdtb6 {
+ padding-top: 6rpx;
+ padding-bottom: 6rpx;
+}
+.pdtb8 {
+ padding-top: 8rpx;
+ padding-bottom: 8rpx;
+}
+.pdl20 {
+ padding-left: 104rpx;
+}
+
+
+.no-more {
+ line-height: 3;
+ color: #ccc;
+ /* background-color: #f2f2f2; */
+}
+.nodata {
+ text-align: center;
+ background-color: #f2f2f2;
+}
+.progress-container {
+ width: 55%;
+ padding-right: 10rpx;
+ position: relative;
+ text-align: center;
+}
+.retail {
+ color: #7b7b7b;
+ text-decoration: line-through;
+ font-size: 22rpx;
+ padding-left: 20rpx;
+}
+.name {
+ height: 76rpx;
+ overflow: hidden;
+}
+
+.percent {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ color: white;
+}
+.tabbar {
+ position: fixed;
+ width: 100%;
+ bottom: 0;
+ background-color: white;
+}
+.tabbar:after {
+ position: absolute;
+ content: '';
+ width: 2rpx;
+ height: 50%;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ background-color: #f0f0f0;
+}
+.tabbar-item {
+ width: 50%;
+ text-align: center;
+ padding-top: 30rpx;
+ padding-bottom: 30rpx;
+}
+.tabbar-item .iconfont {
+ margin-right: 10rpx;
+}
+.tabbar-item.active {
+ color: #FE6867;
+}
+
+
+.group-type,
+.group-num {
+ position: relative;
+ font-size: 22rpx;
+}
+.group-type:before,
+.group-num:before {
+ font-family: iconfont;
+}
+.group-type:before {
+ content: '\e66a';
+ color: white;
+ background-color: #FE6867;
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ padding-left: 6rpx;
+ padding-right: 10rpx;
+ line-height: 30rpx;
+}
+.group-num:before {
+ padding-right: 6rpx;
+}
+.group-num:before {
+ content: '\e694';
+ position: relative;
+}
+.group-num {
+ color: white;
+ background-color: #FE6867;
+ border-radius: 34rpx;
+ padding-left: 10rpx;
+ padding-right: 10rpx;
+ margin-right: 14rpx;
+}
+.group-type {
+ color: #FE6867;
+ border: 2rpx solid #FE6867;
+ padding-left: 42rpx;
+ padding-right: 4rpx;
+ border-radius: 6rpx;
+}
+
+.badge {
+ color: white;
+ padding: 0 20rpx;
+ border-radius: 6rpx;
+ background-color: #FE6867;
+ margin-right: 10rpx;
+}
+
+.subTab-title {
+ text-align: center;
+ justify-content: center;
+ align-items: center;
+ font-size: 28rpx;
+}
+.subTab-list {
+ padding: 20rpx;
+}
+.subTab-titleItem {
+ box-sizing: border-box;
+ width: calc(100% / 3);
+ padding: 20rpx 40rpx;
+ background-color: white;
+ border-right: 2rpx solid #f8f8f8;
+ flex: 1;
+}
+.subTab-titleItem:last-child {
+ border-right: none;
+}
+.subTab-titleItem.active {
+ background-color: #FE6867;
+ color: white;
+}
+.subTab-item {
+ padding: 20rpx;
+ border-bottom: 2rpx solid #f8f8f8;
+ background-color: white;
+ border-radius: 8rpx;
+ box-shadow: 0 8px 12px #e7e9eb;
+}
+.subTab-item ~ .subTab-item {
+ margin-top: 20rpx;
+}
+.pdv10 {
+ padding-top: 10rpx;
+ padding-bottom: 10rpx;
+}
+.pdv20 {
+ padding-top: 20rpx;
+ padding-bottom: 20rpx;
+}
+.pdb10 {
+ padding-bottom: 10rpx;
+}
+.pdb20 {
+ padding-bottom: 20rpx;
+}
+.bdr-b {
+ border-bottom: 2rpx solid #f8f8f8;
+}
+.dash-b {
+ border-bottom: 2rpx dashed #ddd;
+}
+.btn-container {
+ display: flex;
+ align-items: flex-end;
+ font-size: 26rpx;
+}
+
+
+/* .popup-container {
+ content:'';
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ z-index: 3;
+ background-color: rgba(0,0,0,.6);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.popup {
+ width: 90%;
+}
+.popup-content {
+ box-sizing: border-box;
+ width: 100%;
+ background-color: white;
+ padding: 0 20rpx;
+ border-radius: 10rpx;
+ max-height: 1038rpx;
+}
+.icon-close {
+ font-size: 60rpx;
+ color: white;
+}
+.popup-btn {
+ padding-top: 30rpx;
+}
+
+.popup-title {
+ /* font-size: 28rpx; */
+ /* font-weight: bold;
+ padding: 20rpx 0;
+}
+.popup-title2 { */
+ /* padding: 10rpx 0; */
+ /* padding-bottom: 8rpx;
+}
+.popup-title3 {
+ padding-left: 34rpx;
+ font-size: 30rpx;
+}
+.popup-list {
+ max-height: 602rpx;
+ overflow-y: auto;
+}
+
+
+radio .wx-radio-input {
+ width: 28rpx;
+ height: 28rpx;
+}
+
+
+radio .wx-radio-input.wx-radio-input-checked {
+ background-color: #FE6867;
+ border-color: #FE6867;
+}
+radio .wx-radio-input.wx-radio-input-checked::before{
+ color: white;
+}
+
+.popup-content.active {
+ max-height: 982rpx;
+ overflow: auto;
+} */
+
+
+
+.coupons {
+ color: white;
+ position: relative;
+ padding: 28rpx 24rpx 28rpx 46rpx;
+}
+.coupons.bg-red {
+ background: #F2F2F2 radial-gradient(circle at 0px 50%, transparent 10px, #FF6768 0) top;
+}
+
+
+
+
+.coupons ~ .coupons {
+ margin-top: 20rpx;
+}
+
+.coupon-hd {
+ word-break: break-all;
+ line-height: 1.4;
+}
+.coupon-md {
+ font-size: 26rpx;
+ position: relative;
+ padding-right: 200rpx;
+}
+.coupon-ft {
+ line-height: 1.4;
+}
+.price {
+ position: absolute;
+ right: 24rpx;
+}
+
+.coupons .btn-share {
+ flex-shrink: 0;
+ border-radius: 30rpx;
+ padding: 8rpx 40rpx;
+ background-color: red;
+}
+
+
+.popup-container {
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0,0,0,.5);
+}
+.popup {
+ background-color: white;
+ border-radius: 16rpx;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 500rpx;
+ overflow: hidden;
+}
+.popup-img {
+ display: block;
+ width: 80rpx;
+ height: 80rpx;
+ margin-right: 20rpx;
+ flex-shrink: 0;
+}
+.popup-item {
+ display: flex;
+ align-items: center;
+ padding: 20rpx 90rpx;
+}
+.h70 {
+ height: 70rpx;
+}
+
+.active {
+ background-color: #f2f2f2;
+}
+
+
+
+
diff --git a/packageA/pages/quan_pro/quan_pro.js b/packageA/pages/quan_pro/quan_pro.js
index 15a91bf..c44ecfe 100644
--- a/packageA/pages/quan_pro/quan_pro.js
+++ b/packageA/pages/quan_pro/quan_pro.js
@@ -19,6 +19,20 @@ Page({
},
//------初始化加载----------
onLoad: function(t) {
+
+ var th = this;
+ var first_leader=t.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;
+ }
+ })
+ }
+
var id=t.id;
this.data.id=id;
var goods_list = this.selectComponent("#goods_list"); //组件的id
diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js
index 01f2e95..58dbcfe 100644
--- a/pages/cart/cart2/cart2.js
+++ b/pages/cart/cart2/cart2.js
@@ -112,6 +112,8 @@ Page({
show_card:null, //显示的等级卡
card_name:'', //显示的卡的名称
card_cut_price:null,//减价多少钱
+
+ show_submit:0, //提交按钮变正常显示
},
onLoad: function(t) {
@@ -140,8 +142,10 @@ Page({
//----------子页返回父页触发----------
onShow: function() {
var th=this;
+ th.setData({show_submit:0}); //让提交先掩藏
+ th.data.g_cart_q_time=null;
+
if (th.data.isclose==0){
-
wx.navigateTo({
url: "/pages/index/index/index"
})
@@ -153,7 +157,7 @@ Page({
console.log(ie)
//地址切换要把包邮券清空
- if( !th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){
+ if( !th.data.user_addr || !ie || th.data.user_addr.address_id!=ie.address_id){
var using_quan=th.data.using_quan;
for(var i in using_quan){
var item=using_quan[i];
@@ -164,19 +168,22 @@ Page({
}
th.data.isget_by_quan={};
}
-
+
+
+ th.data.prom_goods_map={};
+ th.data.is_summit_ing=0;
//更换地址回来要重新调用计算价钱的接口
if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){
th.setData({user_addr: ie });
if (th.data.is_b_now == 1) {
if(th.data.bn_goods) {
th.setData({add_back:1});
- th.calculatePrice2();
+ //th.calculatePrice2();
}
}else{
if (th.data.cartlist){
th.setData({add_back:1});
- th.calculatePrice();
+ //th.calculatePrice();
}
}
}else{
@@ -277,26 +284,31 @@ Page({
//------获取会员收货地址-----
getuser_addr:function(func){
+ var th=this;
a.get("/api/weshop/useraddress/page", {
- data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600 },
+ data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600,t:Math.random()},
success: function (su) {
/*---
var user_addr=[
{ 'address_id': 882, 'user_id': 2661, 'consignee': '测试测试测', 'province': 3102, 'city': 3431, 'district': 3466,
'address': 'ed', 'more_address': '山西-长治市-襄垣县-虎(音si)亭镇', 'mobile': 13012345678,'is_default':1},
- ];---*/
- var user_addr = su.data.data.pageData;
- var item = null;
- var def_item=null;
- for (var i = 0; i < user_addr.length; i++) {
- if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i];}
- if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; }
- }
-
- if (item == null) item = def_item;
- if (item == null) item = user_addr[0];
+ ];---*/
+ var item = null;
+ if(su.data.code==0 && su.data.data && su.data.data.pageData){
+ var user_addr = su.data.data.pageData;
+ var def_item=null;
+ for (var i = 0; i < user_addr.length; i++) {
+ if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i];}
+ if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; }
+ }
+
+ if (item == null) item = def_item;
+ if (item == null) item = user_addr[0];
+ }
if(item==undefined) item=null;
+ if(!item) th.setData({user_addr:null}); //地址为空的时候,要清空,因为返回的时候,有缓存
+
func(item);
}
});
@@ -341,7 +353,8 @@ Page({
}
});
},
-
+
+
//-----真的获取购物车,入口--------
get_cart: function () {
var th = this,app=getApp();
@@ -360,11 +373,7 @@ Page({
for (var i = 0; i < carr.length; i++) {
var item = carr[i];
- //要把优惠活动加入,prom_goods_map中,赠品不要运算
- if(item.prom_type==3 && item.is_gift!=1){
- await th.add_prom_goods_map(item);
- }
-
+
//-- 如果是等级会员注册返回 --
if(is_card_back){
th.data.card_name=th.data.userinfo.card_field;
@@ -383,12 +392,17 @@ Page({
// 拼团,搭配购不计算,赠品也不计算,同时会员还未购买等级会员
if(item[th.data.card_name]>0 && item['prom_type']!=5 && item['prom_type']!=6 && !th.data.userinfo.card_field
&& !item.is_gift && !item['is_collocation'] && item.goods_price>item[th.data.card_name] ){
- item.cut_price= item.goods_price-item[th.data.card_name];
- carr[i].cut_price=(item.goods_price-item[th.data.card_name])*item.goods_num;
+ item.cut_price1= item.goods_price-item[th.data.card_name];
+ carr[i].cut_price1=(item.goods_price-item[th.data.card_name])*item.goods_num;
}
}
+ //要把优惠活动加入,prom_goods_map中,赠品不要运算
+ if(item.prom_type==3 && item.is_gift!=1){
+ await th.add_prom_goods_map(item);
+ }
+
item.original_img = oo.imghost + item.original_img;
/*----接口要弄出来的,先顶着-----*/
@@ -399,7 +413,22 @@ Page({
if (arr.length > 0) {
for (var j = 0; j < arr.length; j++) {
if (arr[j].pickup_id == pcid) {
- arr[j].goods.push(item);
+ arr[j].goods.push(item);
+ if(item.is_gift!=1){
+ //确定配送方式
+ if(arr[j].distr_t==0){
+ arr[j].distr_t=item.distr_type;
+ }
+ var e_t=0
+ switch (arr[j].distr_t) {
+ case 0: e_t = 1; break;
+ case 1: e_t = 1; break;
+ case 2: e_t = 0; break;
+ }
+ arr[j].exp_type=e_t;
+ if (e_t == 0) th.setData({ is_all_zt:0});
+ }
+
//-- 把等级卡会优惠多少钱装进去 --
if(item.cut_price) arr[j].card_cut_price+=item.cut_price;
find = 1;break;
@@ -426,7 +455,6 @@ Page({
case 1: e_t = 1; break;
case 2: e_t = 0; break;
}
-
//如果是物流的话,全部自提的控制要弄成0
if (e_t == 0) th.setData({ is_all_zt:0});
@@ -441,14 +469,21 @@ Page({
}
var ie = {
- pickup_id: pcid, pname: pikname, goods: narr, wind: m_wind, distr_t: dis_t,card_cut_price:0,
+ pickup_id: pcid, pname: pikname, goods: narr, wind: m_wind, distr_t: dis_t,card_cut_price:0,exp_type:e_t,
goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0, user_note:0};
-
- if(!th.data.add_back){
- ie.exp_type= e_t
- }
+
+ //-- 如果是回退回来的情况 --
+ if(th.data.cartlist && th.data.cartlist.length>0) {
+ for(var kj in th.data.cartlist){
+ if(ie.pickup_id==th.data.cartlist[kj].pickup_id){
+ ie.exp_type=th.data.cartlist[kj].exp_type;
+ break;
+ }
+ }
+ }
+
//-- 把等级卡会优惠多少钱装进去 --
- if(item.cut_price) ie.card_cut_price+=item.cut_price;
+ if(item.cut_price1) ie.card_cut_price+=item.cut_price1;
arr.push(ie);
}
@@ -496,7 +531,9 @@ Page({
case 1: et = 1; break;
case 2: et = 0; break;
}
-
+
+ if(th.data.bn_goods) et=th.data.bn_exp_type
+
var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
if(et==0 && def_exp_code){
for(var k=0;k {
+ if (res.data.code == 0 && res.data.data.condition) {
+ var get_data = res.data.data;
+ item_map.is_bz = get_data.is_bz; //是不是倍增
+ item_map.bs = get_data.bs; //是不是倍数
+ item_map.is_past = get_data.is_past; //是不是包邮
+ item_map.prom_price = get_data.price>=0?get_data.price:item_map.price;
+ 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;
+ if(get_data.gift_id && get_data.goodsinfo) {
+ item_map.gift_id = get_data.gift_id;
+ item_map.gift_goods_id = get_data.goods_id;
+ item_map.gift_goods_name = get_data.goods_name;
+ item_map.gift_goods_color = get_data.goodsinfo.goods_color ? get_data.goodsinfo.goods_color : '';
+ item_map.gift_goods_spec = get_data.goodsinfo.goods_spec ? get_data.goodsinfo.goods_spec : '';
+ item_map.gift_original_img = get_data.goodsinfo.original_img;
+ item_map.gift_limit_num = get_data.limit_num;
+ item_map.gift_storecount = get_data.gift_storecount;
+ item_map.gift_weight = get_data.goodsinfo.weight;
+ item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type;
+ item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
+
+ }
+ item_map.s_libao = get_data.libao;
+ item_map.s_lb_num = get_data.lb_num;
+ }
+ })
+ }
+
+ //有活动,且优惠活动并没有限制使用优惠券,且有减价
+ //--看有没有减价--
+ //if(item_map.prom_price>=0 && item_map.price-item_map.prom_price){
+ if(item_map.price-item_map.prom_price && item_map.prom_price!==null){
+ if(cart_item.prom_pt_json){
+ cart_item.prom_pt_json.push({"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0})
+ }else{
+ cart_item.prom_pt_json=[{"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}];
+ }
+
+ //-- 如果系统要平摊到单品 --
+ //if(!th.data.ispt_goods){
+ var pt_data={
+ 'prom_id':item_map.prom_id,
+ 'dis': parseFloat((item_map.price-item_map.prom_price).toFixed(2)),
+ 'goods':item_map.goods
+ }
+
+ var pt_res=null;
+ await getApp().request.promisePost("/api/weshop/order/getGoodsSplit",{is_json:1,data:pt_data}).then(res=>{
+ if(res.data.code==0){ pt_res=res.data.data; }
+ })
+ if(pt_res){
+ for (var io in item_map.goods){
+ //平摊赋值
+ item_map.goods[io].account_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account;
+ item_map.goods[io].account_yu_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account_yu;
+ if(!th.data.ispt_goods){
+ item_map.goods[io].account=item_map.goods[io].account_fir;
+ item_map.goods[io].account_yu=item_map.goods[io].account_yu_fir;
+ }
+ }
+ }
+ // }
+
+ o_price-=(item_map.price-item_map.prom_price);
+ //如果有限制使用优惠券,就要减掉参与的活动商品的钱
+ if(!item_map.is_xz_yh) q_conditin=o_price;
+ }
+
+ //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表-----------
+ for(var j=0;j0){
+ for(var i =0;i0) o_price-=c_arr[i].cut_price;
+
var f_o_price=o_price;
//判断包邮券的钱
var q_conditin=0;
q_conditin=o_price;
- //---如果该门店的相关活动,就要算一下减价--
- if(th.data.prom_goods_map[pickid]){
- var ob=th.data.prom_goods_map[pickid];
- for(var ii in ob){
- var item_map=ob[ii];
- if(item_map.bs==undefined || item_map.bs==null) {
- //等待,获取一下优惠活动的信息
- await getApp().request.promiseGet("/api/weshop/goods/getDiscount", {
- data: {
- price: item_map.price, prom_id: item_map.prom_id,
- goods_num: item_map.goods_num, user_id: getApp().globalData.user_id,
- is_bz: item_map.is_bz
- }
- }).then(res => {
- if (res.data.code == 0 && res.data.data.condition) {
- var get_data = res.data.data;
- item_map.is_bz = get_data.is_bz; //是不是倍增
- item_map.bs = get_data.bs; //是不是倍数
- item_map.is_past = get_data.is_past; //是不是包邮
- item_map.prom_price = get_data.price>=0?get_data.price:item_map.price;
- 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;
- if(get_data.gift_id && get_data.goodsinfo) {
- item_map.gift_id = get_data.gift_id;
- item_map.gift_goods_id = get_data.goods_id;
- item_map.gift_goods_name = get_data.goods_name;
- item_map.gift_goods_color = get_data.goodsinfo.goods_color ? get_data.goodsinfo.goods_color : '';
- item_map.gift_goods_spec = get_data.goodsinfo.goods_spec ? get_data.goodsinfo.goods_spec : '';
- item_map.gift_original_img = get_data.goodsinfo.original_img;
- item_map.gift_limit_num = get_data.limit_num;
- item_map.gift_storecount = get_data.gift_storecount;
- item_map.gift_weight = get_data.goodsinfo.weight;
- item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type;
- item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
-
- }
- item_map.s_libao = get_data.libao;
- item_map.s_lb_num = get_data.lb_num;
- }
- })
- }
-
- //有活动,且优惠活动并没有限制使用优惠券,且有减价
- //--看有没有减价--
- if(item_map.prom_price>=0 && item_map.price-item_map.prom_price){
- if(cart_item.prom_pt_json){
- cart_item.prom_pt_json.push({"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0})
- }else{
- cart_item.prom_pt_json=[{"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}];
- }
-
- //-- 如果系统要平摊到单品 --
- //if(!th.data.ispt_goods){
- var pt_data={
- 'prom_id':item_map.prom_id,
- 'dis': parseFloat((item_map.price-item_map.prom_price).toFixed(2)),
- 'goods':item_map.goods
- }
-
- var pt_res=null;
- await getApp().request.promisePost("/api/weshop/order/getGoodsSplit",{is_json:1,data:pt_data}).then(res=>{
- if(res.data.code==0){ pt_res=res.data.data; }
- })
- if(pt_res){
- for (var io in item_map.goods){
- //平摊赋值
- item_map.goods[io].account_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account;
- item_map.goods[io].account_yu_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account_yu;
- if(!th.data.ispt_goods){
- item_map.goods[io].account=item_map.goods[io].account_fir;
- item_map.goods[io].account_yu=item_map.goods[io].account_yu_fir;
- }
- }
- }
- // }
-
- o_price-=(item_map.price-item_map.prom_price);
- //如果有限制使用优惠券,就要减掉参与的活动商品的钱
- if(!item_map.is_xz_yh) q_conditin=o_price;
- }
-
- //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表-----------
- for(var j=0;j=freight_free && freight_free>0 && !is_good_no_by && th.data.is_no_by[pickid]!=1){
continue;
}
+
//--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算--
if(th.data.using_quan[pickid] && th.data.using_quan[pickid].isby==1 && !is_good_no_by){
continue;
}
+
//----------------如果是选择了物流---------------------
if(cart_item.exp_type == 0 && item[j].is_free_shipping==0){
//如果地址不为空
@@ -1038,7 +1105,9 @@ Page({
//计算物流价格
if (cart_item.exp_type == 0) {
freight_free=0; //后面不在进行判断
- var code = th.data.wu_arr[cart_item.wind].code;
+ var code = "";
+ if(th.data.wu_arr && th.data.wu_arr[cart_item.wind])
+ code=th.data.wu_arr[cart_item.wind].code;
cart_item.shipping_price =
th.calculatewuliu(code, o_shipping_price, goods_weight,
goods_piece,th.data.user_addr, freight_free, o_price, rs);
@@ -1062,6 +1131,7 @@ Page({
if(quan_no){
//如果不是包邮券的时候
if(th.data.using_quan[pickid] && th.data.using_quan[pickid].isby!=1) {
+ var ui=2;
//---获取优惠券优惠---
await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", {
data: {
@@ -1197,10 +1267,11 @@ Page({
th.setData({ [atxt]: all_total_m, [atxt1]: all_order_m,
[atxt2]: all_price, [atxt3]: all_user_m, [atxt4]: all_shipping_m,
[atxt5]: all_coupon_price_m,[atxt6]: all_cutprice,
- [atxt7]: all_order_prom,
+ [atxt7]: all_order_prom, show_submit:1
})
th.data.order_prom_list_cart=c_arr;
- th.set_can_num();
+ th.set_can_num();
+ wx.hideLoading();
});
});
@@ -1244,10 +1315,14 @@ Page({
th.calculatePrice();
return false;
}
+
+ wx.showLoading({
+ title:"处理中."
+ })
//-----------计算商品总价--------------
var allpice = good.shop_price * good.buynum;
var cut_price=0;
- if(good.prom_type==3 && good.prom_price){
+ if(good.prom_type==3 && good.prom_price!==null){
cut_price=allpice-good.prom_price;
}
allpice=parseFloat(allpice).toFixed(2);
@@ -1304,12 +1379,12 @@ Page({
goods_piece += good['buynum']; break;
}
- var code = th.data.wu_arr[th.data.index].code;
+ var code ="";
+ if(th.data.wu_arr && th.data.wu_arr[th.data.index]) code=th.data.wu_arr[th.data.index].code;
var freight_free = ee.freight_free; //全场满多少包邮
var no_ex_id=ee.no_ex_id;
th.data.is_no_by[th.data.bn_pick]=0;
-
var no_by_data=null;
var gift_freight_free=freight_free;
//有不包邮区域,且不免运费
@@ -1429,14 +1504,14 @@ Page({
if (th.data.bn_use_money == 1) {
if (amoney> order_m) {
order_m = order_m.toFixed(2);
- th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price })
+ th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 })
}else{
order_m =parseFloat(order_m - amoney);
order_m = order_m.toFixed(2);
- th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price })
+ th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 })
}
}else{
- th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price })
+ th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price,show_submit:1})
}
//优惠活动送积分
if(good.s_intValue){
@@ -1476,14 +1551,14 @@ Page({
if (th.data.bn_use_money == 1) {
if (amoney> order_m) {
order_m = order_m.toFixed(2);
- th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price })
+ th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 })
}else{
order_m =parseFloat(order_m - amoney);
order_m = order_m.toFixed(2);
- th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price })
+ th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 })
}
}else{
- th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price })
+ th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price, show_submit:1 })
}
//优惠活动送积分
if(good.s_intValue){
@@ -1509,6 +1584,8 @@ Page({
th.setData({ [l_txt]:good.s_coupon_id,[l_txt1]:ob });
}
}
+
+ wx.hideLoading();
});
});
@@ -1527,7 +1604,7 @@ Page({
if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){
ff = false; getApp().my_warnning("请选择收货地址",0,th);
- this.data.is_summit_ing = 0;
+ th.data.is_summit_ing = 0;
}
if (!ff) return false;
var addr = th.data.user_addr;
@@ -1536,6 +1613,7 @@ Page({
if(th.data.bn_exp_type==0)
if(th.data.wu_arr==null || th.data.wu_arr.length<=0){
getApp().my_warnning("读取物流失败",0,th);
+ th.data.is_summit_ing = 0;
return false;
}
@@ -1716,7 +1794,9 @@ Page({
console.log(pdata);
}else{
//---------购物车的结算---------
- if (th.data.is_all_zt == 0 && th.data.user_addr == null) { ff = false; getApp().confirmBox("请新建收货地址");}
+ if (th.data.is_all_zt == 0 && th.data.user_addr == null) {
+ th.data.is_summit_ing = 0;
+ ff = false; getApp().confirmBox("请新建收货地址");}
if (!ff) return false;
var addr = th.data.user_addr;
@@ -1726,6 +1806,7 @@ Page({
if(th.data.is_all_zt !=1)
if(th.data.wu_arr==null || th.data.wu_arr.length<=0 ){
+ th.data.is_summit_ing = 0;
getApp().confirmBox("读取物流失败");
return false;
}
@@ -1786,11 +1867,11 @@ Page({
if(t_item.s_intValue>0){
order_prom_list.give_integral=t_item.s_intValue;
}
- if(t_item.s_coupon_id>0){
+ if(t_item.s_coupon_id){
order_prom_list.give_coupon_id=t_item.s_coupon_id;
order_prom_list.g_coupon_num= JSON.stringify(t_item.g_coupon_num);
}
- if(t_item.s_libao>0){
+ if(t_item.s_libao){
order_prom_list.give_lb_id=t_item.s_libao;
order_prom_list.g_lb_num=JSON.stringify(t_item.g_lb_num);
}
@@ -1900,7 +1981,7 @@ Page({
if (pdata.length==0) return;
var str = JSON.stringify(pdata);
-
+
wx.showLoading({title: "加载中"});
wx.request({
url: oo.url + '/api/weshop/order/createWxdOrder',
@@ -1939,7 +2020,7 @@ Page({
util_pay.pay(data.data, function() {
//app.my_warnning("支付成功",1,th);
//setTimeout(function () {
- wx.navigateTo({
+ wx.redirectTo({
url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data
})
//},1000)
@@ -1965,7 +2046,7 @@ Page({
//app.my_warnning("支付成功",1,th);
//setTimeout(function () {
th.setData({ isclose: 0 });
- wx.navigateTo({
+ wx.redirectTo({
url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data,
})
//}, 1000)
@@ -2084,6 +2165,7 @@ Page({
//--------购物车购买时,选择自提和物流-----------
setexptype_w:function(t){
+
var def_exp_code= getApp().globalData.userInfo.def_exp_code,th=this;
var ty = t.currentTarget.dataset.t, txt = t.currentTarget.dataset.txt,
wl_txt = t.currentTarget.dataset.wl_txt,
@@ -2192,6 +2274,7 @@ Page({
if (item == null) return o_shipping_price;
var fw_price = 0, fp_price=0;
item=item.config;
+ if (item == null) return o_shipping_price;
//------按重量----------
if (goods_weight>=0 && item['money']) {
fw_price =parseFloat(item['money']);
@@ -2266,13 +2349,19 @@ Page({
for(var i in quanlist){
quanlist[i].is_using= th.check_in_sele(quanlist[i].CashRepNo,pickid);
- if(!t_user || quanlist[i].CashRepNo!=t_user.coupon_no) quanlist[i].show_red=0;
+ if(t_user && quanlist[i].CashRepNo==t_user.coupon_no)
+ quanlist[i].show_red=1;
+ else
+ quanlist[i].show_red=0;
}
if(get_by_quan_list_cart){
for(var i in get_by_quan_list_cart){
get_by_quan_list_cart[i].is_using= th.check_in_sele(get_by_quan_list_cart[i].no,pickid);
- if(!t_user || get_by_quan_list_cart[i].no!=t_user.coupon_no) get_by_quan_list_cart[i].show_red=0;
+ if(t_user && get_by_quan_list_cart[i].no==t_user.coupon_no)
+ get_by_quan_list_cart[i].show_red=1;
+ else
+ get_by_quan_list_cart[i].show_red=0;
}
th.setData({by_quan_list_cart:get_by_quan_list_cart});
}else {
@@ -2708,12 +2797,13 @@ Page({
},500);
},
//-----获取购物车进来的劵-------
- get_cart_quan:function () {
+ get_cart_quan:async function (order_prom_list_cart) {
var th=this;
var is_xz_yh=1;
//等待值的出现
- getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () {
- var arr=th.data.order_prom_list_cart;
+ //getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () {
+ //var arr=th.data.order_prom_list_cart;
+ var arr=order_prom_list_cart;
//如果系统有限制使用优惠券
if(th.data.is_close_quan) return false;
//------------开始计算使用优惠券相关------------
@@ -2792,7 +2882,7 @@ Page({
th.set_can_num();
}
- })
+ //})
},
//------ 获取立即购买的购物车的劵 --------
diff --git a/pages/cart/cart2/cart2.wxml b/pages/cart/cart2/cart2.wxml
index 43f4e80..eaa234c 100644
--- a/pages/cart/cart2/cart2.wxml
+++ b/pages/cart/cart2/cart2.wxml
@@ -4,7 +4,7 @@
diff --git a/pages/cart/cart_wk/cart_wk.js b/pages/cart/cart_wk/cart_wk.js
index b224433..2efd939 100644
--- a/pages/cart/cart_wk/cart_wk.js
+++ b/pages/cart/cart_wk/cart_wk.js
@@ -28,7 +28,7 @@ Page({
//配送方式 0=用户自选 1=自提 2=物流
distr_type: 0,
//实际配送方式 0物流 1自提
- exp_type: 0,
+ exp_type: 1,
//------物流费用------
exp_price: 0,
enterAddressPage: 0, //进入地址页面
@@ -65,8 +65,7 @@ Page({
wx.navigateTo({
url: "/pages/index/index/index"
})
- }
-
+ }
th.getuser_addr(function(addr) {
if(addr==null || addr==undefined || addr.length==0) {
th.setData({ user_addr: null, enterAddressPage: 1,});
@@ -76,7 +75,7 @@ Page({
});
}
- if (th.data.exp_type == 0){
+ if (th.data.exp_type == 0 && th.data.goods){
th.calculate_wuliu();
}
})
@@ -514,6 +513,7 @@ Page({
//--进入收货地址的编辑页面--
enterAddressPage: function() {
+ getApp().globalData.is_cart_old=1;
this.data.enterAddressPage =1, wx.navigateTo({
url: "/pages/user/address_list/address_list?is_back=1"
});
diff --git a/pages/cart/cart_wk/cart_wk.wxml b/pages/cart/cart_wk/cart_wk.wxml
index a2f5d2e..31d2f97 100644
--- a/pages/cart/cart_wk/cart_wk.wxml
+++ b/pages/cart/cart_wk/cart_wk.wxml
@@ -89,7 +89,7 @@
-
+
尾款金额
¥{{order.tail_money}}
diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js
index ab300ff..018e713 100644
--- a/pages/giftpack/giftpacklist/giftpacklist.js
+++ b/pages/giftpack/giftpacklist/giftpacklist.js
@@ -37,18 +37,30 @@ Page({
getGiftID: options.lbId,
orderSn: options.orderSn
})
+
+ //-- 获取分享人的ID --
+ var first_leader=options.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;
+ }
+ })
+ }
th.close();
},
- onShow: function() {
-
+
+ onShow: function() {
//--先判断会员状态--
var user_info = getApp().globalData.userInfo;
if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
getApp().goto('/pages/togoin/togoin');
return false;
}
-
if (this.data.isBuy == 0) {
this.GetMyGiftList();
} else {
diff --git a/pages/goods/categoryList/categoryList.wxml b/pages/goods/categoryList/categoryList.wxml
index bed28bf..163c5fc 100644
--- a/pages/goods/categoryList/categoryList.wxml
+++ b/pages/goods/categoryList/categoryList.wxml
@@ -119,7 +119,7 @@
-
+
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index 4b4e7c1..40c7e1e 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -241,6 +241,8 @@ Page({
poster:null, //自定义海报
share_b_img:'', //自定义分享的背景
+
+ showPoster: false,
},
//------初始化加载----------
@@ -1536,6 +1538,7 @@ Page({
//--点击分享事件---
onShareAppMessage: function(t) {
+
var th = this;
var price = th.data.data.shop_price;
if (th.data.prom_act) {
@@ -3330,10 +3333,13 @@ Page({
//先画背景
var pg_path = "../../../images/share/share_bg.png";
+ // context.fillStyle="#FFFFFF";
+ // context.fillRect(0,0,554 * unit, 899 * unit);
+
//-- 如果有自定义海报的时候,判断背景的图片 --
if(th.data.share_b_img){
pg_path=th.data.share_b_img;
- }
+ }
context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
//-- 是自定义海报的情况下 --
@@ -3655,10 +3661,13 @@ Page({
})
return false;
}
- wx.previewImage({
- //将图片预览出来
- urls: [that.data.shareImgPath]
- });
+ // wx.previewImage({
+ // //将图片预览出来
+ // urls: [that.data.shareImgPath]
+ // });
+ that.setData({
+ showPoster: true,
+ });
wx.hideLoading();
}
})
@@ -4353,8 +4362,118 @@ Page({
})
}
})
- }
-
-
+ },
+
+ closePoster() {
+ this.setData({
+ showPoster: false,
+ });
+ },
+
+ // 保存图片到手机
+ savePic() {
+ console.log('保存图片');
+ var self = this;
+ // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限
+ this.getSetting().then((res) => {
+ // 判断用户是否授权了保存到相册的权限,如果没有发起授权
+ if (!res.authSetting['scope.writePhotosAlbum']) {
+ this.authorize().then(() => {
+ // 同意授权后保存下载文件
+ this.saveImage(self.data.shareImgPath)
+ .then(() => {
+ self.setData({
+ showPoster: false
+ });
+ });
+ })
+ } else {
+ // 如果已经授权,保存下载文件
+ this.saveImage(self.data.shareImgPath)
+ .then(() => {
+ self.setData({
+ showPoster: false
+ });
+ });
+ }
+
+ })
+ },
+
+ // 获取用户已经授予了哪些权限
+ getSetting() {
+ return new Promise((resolve, reject) => {
+ wx.getSetting({
+ success: res => {
+ resolve(res)
+ }
+ })
+ })
+ },
+
+ // 发起首次授权请求
+ authorize() {
+ // isFirst 用来记录是否为首次发起授权,
+ // 如果首次授权拒绝后,isFirst赋值为1
+ let isFirst = wx.getStorageSync('isFirst') || 0;
+ return new Promise((resolve, reject) => {
+ wx.authorize({
+ scope: 'scope.writePhotosAlbum',
+ // 同意授权
+ success: () => {
+ resolve();
+ },
+ // 拒绝授权,这里是用户拒绝授权后的回调
+ fail: res => {
+ if(isFirst === 0) {
+ wx.setStorageSync('isFirst', 1);
+ wx.showToast({
+ title: '保存失败',
+ icon: 'none',
+ duration: 1000
+ })
+ } else {
+ this.showModal();
+ }
+ console.log('拒绝授权');
+ reject();
+ }
+ })
+ })
+ },
+
+
+ // 保存图片到系统相册
+ saveImage(saveUrl) {
+ var self = this;
+ return new Promise((resolve, reject) => {
+ wx.saveImageToPhotosAlbum({
+ filePath: saveUrl,
+ success: (res) => {
+ wx.showToast({
+ title: '保存成功',
+ duration: 1000,
+ });
+ self.setData({
+ showPlaybill: 'true'
+ });
+ resolve();
+ },
+ fail: () => {
+ wx.showToast({
+ title: '保存失败',
+ duration: 1000,
+ });
+ }
+ })
+ })
+ },
+
+ previewImage() {
+ wx.previewImage({
+ //将图片预览出来
+ urls: [this.data.shareImgPath]
+ });
+ },
});
diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml
index 18429eb..3f7bd0a 100644
--- a/pages/goods/goodsInfo/goodsInfo.wxml
+++ b/pages/goods/goodsInfo/goodsInfo.wxml
@@ -383,14 +383,14 @@
-
+
- 选择门店
+ 选择门店
-
+
更多门店
@@ -421,9 +421,9 @@
-
+
- 领券
+ 领券
满{{item.condition}}减{{item.money}}
@@ -478,7 +478,7 @@
-
+
{{bconfig.service_bz}}
@@ -507,7 +507,7 @@
-
+
宝贝评价({{categories3[0].num}})
查看全部
@@ -523,32 +523,34 @@
-
+
+
+
@@ -563,7 +565,7 @@
- 商品信息
+ 商品信息
@@ -985,7 +987,7 @@
- 选择门店
+ 选择门店
@@ -1483,5 +1485,18 @@
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+ x
+
+
+
+
+
+
+
diff --git a/pages/goods/goodsInfo/goodsInfo.wxss b/pages/goods/goodsInfo/goodsInfo.wxss
index 48bcc8b..1004874 100644
--- a/pages/goods/goodsInfo/goodsInfo.wxss
+++ b/pages/goods/goodsInfo/goodsInfo.wxss
@@ -9,15 +9,15 @@ image {
display: flex;
justify-content: center;
width: 100%;
- height: 80rpx;
- margin-bottom: 20rpx;
+ /* height: 80rpx; */
+ /* margin-bottom: 20rpx; */
background-color: #fff;
- border-bottom: 1rpx #fafafa solid;
+ /* border-bottom: 1rpx #fafafa solid; */
}
.type-box {
width: 25%;
box-sizing: border-box;
- font-size: 36rpx;
+ font-size: 28rpx;
line-height: 76rpx;
padding: 0 20rpx;
text-align: center;
@@ -25,13 +25,27 @@ image {
overflow: hidden;
}
.type-navbar-item {
- border-bottom: 4rpx solid #fff;
+ /* border-bottom: 4rpx solid #fff; */
display: flex;
justify-content: center;
width: 100%;
}
.type-item-on {
- border-bottom: 4rpx solid #333;
+ color: #F95D74;
+ font-weight: bold;
+ /* border-bottom: 4rpx solid #F95D74; */
+ position: relative;
+}
+.type-item-on:after {
+ content: '';
+ position: absolute;
+ width: 50%;
+ height: 4rpx;
+ background-color: #F95D74;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ margin: 0 auto;
}
.swiper_box {
width: 100%;
@@ -46,9 +60,12 @@ image {
width: 560rpx;
line-height: 46rpx;
font-size: 32rpx;
+ font-weight: bold;
color: #333;
- margin-top: 40rpx;
- margin-bottom:20rpx;
+ margin-top: 30rpx;
+ margin-bottom:30rpx;
+ flex: 1;
+ text-align: justify;
}
.goods-collect {
@@ -78,7 +95,7 @@ image {
/* margin-top: 46rpx; */
margin-top:26rpx;
- padding-bottom:12rpx;
+ padding-bottom:20rpx;
}
.prom-info {
@@ -114,7 +131,8 @@ image {
.goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;}
.goods-num {
- display: flex;font-size: 28rpx;
+ display: flex;
+ font-size: 24rpx;
justify-content: space-between;
}
@@ -949,11 +967,12 @@ left:31rpx;}
.bzfu_img{ width: 164rpx; height:34rpx; margin-right: 18rpx; margin-left: 12rpx }
.bz_view{ height:100rpx; padding: 0 34rpx 0 13rpx; color: #333; font-size: 28rpx;
- border-bottom: 3rpx solid #eee; border-top: 3rpx solid #eee; }
+ /* border-bottom: 3rpx solid #eee; */
+ /* border-top: 3rpx solid #eee; */}
.bz_view view{ width: 460rpx; max-height: 70rpx; overflow: hidden;}
.bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333;
- font-size: 32rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx }
+ font-size: 30rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx }
.red_bb{ color: #d70026; min-width:158rpx;width: auto;}
.bg_jj{ width: 18rpx; height:18rpx;
border-top: 2rpx solid #d70026;
@@ -1180,7 +1199,7 @@ left:31rpx;}
background: #ffe3e2;
color: 28rpx;
border-radius:20rpx;
- font-size: 28rpx;
+ font-size: 24rpx;
}
.xc_comment-discuss{
width: 152rpx;
@@ -1190,7 +1209,7 @@ left:31rpx;}
background: #ffe3e2;
color: 28rpx;
border-radius:20rpx;
- font-size: 28rpx;
+ font-size: 24rpx;
margin-left: 28rpx
}
@@ -1274,7 +1293,14 @@ left:31rpx;}
}
.pj_word_size{ font-size: 28rpx}
-.pj_scroll{white-space: nowrap;margin-bottom: 50rpx;}
+.pj_scroll{
+ white-space: nowrap;
+ /* height: 324rpx; */
+ margin-bottom: 50rpx;
+ display: flex;
+ align-items: center;
+ /* box-shadow: 0 8px 12px #e7e9eb; */
+}
/*领券*/
@@ -1285,7 +1311,7 @@ left:31rpx;}
font-size: 23rpx;
}
.cx-frame{
- border-top:3rpx solid #eee;
+ /* border-top:3rpx solid #eee; */
width:99%;
height: 95rpx;
line-height: 95rpx;
@@ -1317,19 +1343,17 @@ left:31rpx;}
}
.xc-coupon-fram .xc-circular{
- width: 24rpx;
- height:20rpx;
+ width: 22rpx;
+ height:22rpx;
background-color:#fff;
position:absolute;
- top:40rpx;
-
-
+ top: 40rpx;
}
.xc-coupon-fram .xc-one{
left:3rpx;
}
.xc-coupon-fram .xc-two{
- left: 175rpx;
+ left: 178rpx;
}
.cx-obtain-coupon{
@@ -2257,7 +2281,7 @@ right:17rpx; top:55rpx;
.no_pj_list{text-align: center; width: 100%; color: #999; margin: 30rpx 0; display: inline-block; font-size: 28rpx}
/* 门店地址 */
.xc-address_frame{
- border-top:1rpx solid #eee;
+ /* border-top:1rpx solid #eee; */
width: 100%;
height: auto;
}
@@ -2322,6 +2346,7 @@ background: white;
width: 100%;
border-radius: 20rpx 20rpx 0 0;
height: 72%;
+bottom: 0;
}
.popup-top{
border-bottom: 1rpx solid #eee;
@@ -2605,4 +2630,56 @@ button.custom-service::after{
.dp_cx_view{border-bottom: 0.02rpx solid #eee; padding-bottom: 40rpx}
.act_content{ margin-top: 40rpx}
.act_content view{ margin-bottom: 12rpx}
-.color_b{color: #ff9c00}
\ No newline at end of file
+.color_b{color: #ff9c00}
+
+.poster-container {
+ box-sizing: border-box;
+ position: fixed;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 999;
+ background-color: rgba(0,0,0,.4);
+ padding: 60rpx;
+}
+
+.poster {
+ box-sizing: border-box;
+ width: 100%;
+ height: 90%;
+ border-radius: 20rpx;
+ /* box-shadow: 0 8px 12px #666; */
+ position: relative;
+ z-index: 999;
+ overflow: hidden;
+}
+.poster-img {
+ display: block;
+ width: 100%;
+ height: 100%;
+}
+.btn-container {
+ display: flex;
+ justify-content: space-around;
+}
+.btn-share {
+ display: block;
+ background-color: #FE6867;
+ color: white;
+ border-radius: 8rpx;
+ line-height: 80rpx;
+ margin-top: 28rpx;
+ padding: 0 60rpx;
+}
+.btn-close {
+ background-color: rgba(0,0,0,.5);
+ color: white;
+ width: 40rpx;
+ height: 40rpx;
+ line-height: 40rpx;
+ text-align: center;
+ border-radius: 50%;
+ position: absolute;
+ right: 20rpx;
+ top: 10rpx;
+}
\ No newline at end of file
diff --git a/pages/index/index/index.js b/pages/index/index/index.js
index 1a2b376..f458aef 100644
--- a/pages/index/index/index.js
+++ b/pages/index/index/index.js
@@ -72,14 +72,25 @@ Page({
max_sw_height: 0, //banner的最大高度
is_disgraceful: 0, //是否显示新人广告
new_image: "", //新人有礼弹窗图片
- new_nav: "", //新人页面跳转地址
-
- w_holiday_pop:0,
-
- },
-
- onLoad: async function() {
- var th = this;
+ new_nav: "", //新人页面跳转地址
+ w_holiday_pop:0,
+
+ },
+
+ onLoad: async function(tt) {
+ var th = this;
+ var first_leader=tt.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;
+ }
+ })
+ }
+
//看一下商家是否开通了权益
//--初始化是否有打勾--
getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", {
@@ -859,7 +870,14 @@ Page({
if(!url || url=='') return;
if(url[0]!='/') url='/'+url;
getApp().goto(url);
- }
+ },
+
+ //----跳转到搭配购买----
+ go_test:function () {
+ wx.navigateTo({ url: "/packageA/pages/goods_share/goods_share", })
+ },
+
+
diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml
index 22bf8b5..8c0a1c7 100644
--- a/pages/index/index/index.wxml
+++ b/pages/index/index/index.wxml
@@ -3,6 +3,8 @@
+
+
@@ -84,7 +86,7 @@
- 人工优先
+ 人工优先
diff --git a/pages/user/assistance/assistance.wxml b/pages/user/assistance/assistance.wxml
index e31fd04..69e5394 100644
--- a/pages/user/assistance/assistance.wxml
+++ b/pages/user/assistance/assistance.wxml
@@ -7,7 +7,9 @@
-
+
+
+
@@ -17,7 +19,7 @@
机会总是留给最有行动力的人
-
+
活动时间:{{filter_s.format_time(zl_act.beginDate,0)}} 至 {{filter_s.format_time(zl_act.endDate,0)}}
@@ -97,6 +99,7 @@
+
@@ -113,6 +116,7 @@
+
diff --git a/pages/user/assistance/assistance.wxss b/pages/user/assistance/assistance.wxss
index 5054598..83017da 100644
--- a/pages/user/assistance/assistance.wxss
+++ b/pages/user/assistance/assistance.wxss
@@ -1,8 +1,8 @@
-page {
+.page {
/* background-color: rgb(208, 17, 25); */
/* width: 100%;
height: 100%; */
-
+ /* height: 100%; */
}
.page {
@@ -11,8 +11,9 @@ page {
.bg-img {
- background: url("https://mshopimg.yolipai.net/public/upload/newpeoplegift/temp/2020/09-26/75640123e5ae953e416527134a6fc477.jpg") no-repeat center center;
- background-size: 100% 100%;
+ display: block;
+ width: 100%;
+ height: 100%;
}
.lumi {
diff --git a/pages/user/assistance/task_assistance.js b/pages/user/assistance/task_assistance.js
index a464e0b..960f422 100644
--- a/pages/user/assistance/task_assistance.js
+++ b/pages/user/assistance/task_assistance.js
@@ -21,6 +21,8 @@ Page({
endDate: "", //活动结束时间
activity_data: "25:20:59", //活动剩余时间
task_number: 0, //任务数
+ giftQty:0, //库存设置数
+
is_task: 0, //历史记录与任务
aitem: "", //活动的轮播图数据
switch_head: 0, //0:我的任务,1:记录
@@ -221,6 +223,7 @@ Page({
th.setData({
aitem: data_aissa,
task_number: task_number,
+ giftQty:data_aissa[0].giftQty,
});
th.go_to_task(th.data.taskid);
@@ -228,7 +231,8 @@ Page({
th.setData({
aitem: data_aissa,
task_number: task_number,
- taskid: taskid
+ taskid: taskid,
+ giftQty:data_aissa[0].giftQty,
});
//判断是不是领取的任务
th.get_user_task();
@@ -365,7 +369,8 @@ Page({
task_number: task_number,
taskid: task_id,
is_dismantle: 0,
- bc_page: 1
+ bc_page: 1,
+ giftQty:aitem[ind].giftQty,
});
if (this.data.switch_head == 1 && th.data.is_clik == 0) {
@@ -554,7 +559,8 @@ Page({
taskid: task_id,
is_dismantle: 0,
is_clik: 1,
- bc_page: 1
+ bc_page: 1,
+ giftQty:aitem[index].giftQty
})
if (this.data.switch_head == 1) {
//判断有没有帮拆记录
@@ -586,6 +592,7 @@ Page({
taskid: task_id,
is_dismantle: 0,
bc_page: 1,
+ giftQty:aitem[index].giftQty
})
if (this.data.switch_head == 1) {
this.dismantle_record();
diff --git a/pages/user/assistance/task_assistance.wxml b/pages/user/assistance/task_assistance.wxml
index 0f6e384..045baf7 100644
--- a/pages/user/assistance/task_assistance.wxml
+++ b/pages/user/assistance/task_assistance.wxml
@@ -1,181 +1,185 @@
-
-
-
-
-
-
- {{aitem[sw_index].helpTaskName}}
-
-
-
- 活动剩余时间:
- {{aitem[0].djs.day}}天
- {{aitem[0].djs.hou}}:
- {{aitem[0].djs.min}}:
- {{aitem[0].djs.sec}}
-
-
-
-
-
-
-
-
-
-
-
-
- 礼包详情
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{is_user_task.zlHelpNum}}/{{is_user_task.helpNum}}
-
-
-
- 今天剩余可领{{task_number}}个任务
-
-
-
- 就选它了
-
-
- 好友拆一拆
-
-
- 立即兑换
-
-
-
-
+
+
+
+
+
+
+
+ {{aitem[sw_index].helpTaskName}}
+
+
+
+ 活动剩余时间:
+ {{aitem[0].djs.day}}天
+ {{aitem[0].djs.hou}}:
+ {{aitem[0].djs.min}}:
+ {{aitem[0].djs.sec}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 礼包详情
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{is_user_task.zlHelpNum}}/{{is_user_task.helpNum}}
+
+
+
+ 今天剩余可领{{task_number}}个任务
+ 不限任务数量
+
+
+
+ 就选它了
+
+
+ 好友拆一拆
+
+
+ 立即兑换
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 我的任务
+
+
+
+ 帮拆记录
+
+
+
+
+
+
+
+
+
+ {{item.helpTaskName}}
+
+
+
+
+ {{item.zlHelpNum}}/{{item.helpNum}}
+ 查看礼包
+ 领取礼包
+
+
+
+
+
+
+
+ 暂无任务记录
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.nickName}}
+
+ {{filter.format_time(item.zltime)}}
+
+
+
+
+
+
+ 点击加载更多
+
+
+
+
+
+
+ 暂无任务记录
+
+
+
+
+
+
+
+
+
+
+
+ 点击加载更多
+
+
+
+ 该任务已被领取了{{usercount}}次
+
+
+ 暂无领取记录
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
- 我的任务
-
-
-
- 帮拆记录
-
-
-
-
-
-
-
-
-
- {{item.helpTaskName}}
-
-
-
-
- {{item.zlHelpNum}}/{{item.helpNum}}
- 查看礼包
- 领取礼包
-
-
-
-
-
-
-
- 暂无任务记录
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.nickName}}
-
- {{filter.format_time(item.zltime)}}
-
-
-
-
-
-
- 点击加载更多
-
-
-
-
-
-
- 暂无任务记录
-
-
-
-
-
-
-
-
-
-
-
- 点击加载更多
-
-
-
- 该任务已被领取了{{usercount}}次
-
-
- 暂无领取记录
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/user/assistance/task_assistance.wxss b/pages/user/assistance/task_assistance.wxss
index ed29596..d878741 100644
--- a/pages/user/assistance/task_assistance.wxss
+++ b/pages/user/assistance/task_assistance.wxss
@@ -1,8 +1,11 @@
page {
/* background: #d01119; */
width: 100%;
- height: 100%;
+ height: 100%;
+}
+.container {
+ height: 100vh;
}
.tesk_list{
@@ -38,7 +41,7 @@ page {
.xc-specific-more-frame {
width: 100%;
height: 40%;
- margin-top: 20rpx;
+ padding-top: 20rpx;
}
.task-number {
@@ -156,14 +159,20 @@ page {
}
.closes {
- margin-top: 20rpx;
+ /* margin-top: 20rpx; */
}
.canvas {
position: fixed;
z-index: 11;
width: 100%;
- top: 20rpx;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background-color: rgba(0,0,0,.5);
+ box-sizing: border-box;
+ padding-top: 60rpx;
}
.close {
@@ -203,15 +212,15 @@ page {
}
.closes {
- margin-top: 20rpx;
+ /* margin-top: 20rpx; */
}
-.canvas {
+/* .canvas {
position: fixed;
z-index: 20;
width: 100%;
top: 20rpx;
-}
+} */
.close {
width: 70rpx;
diff --git a/pages/user/index/filter.wxs b/pages/user/index/filter.wxs
new file mode 100644
index 0000000..3997e16
--- /dev/null
+++ b/pages/user/index/filter.wxs
@@ -0,0 +1,36 @@
+var is_close = function (name,c_list) {
+ if(!c_list) return 0;
+ var map={};
+ map['我的分销']="1";
+ map['我的拼单']="2";
+ map['秒杀活动']="3";
+ map['PLUS会员']="4";
+ map['我的权益']="5";
+ map['联系客服']="6";
+ map['收藏夹']="7";
+ map['我的地址']="8";
+ map['收入卡包']="9";
+ map['专享礼包']="10";
+ map['我的服务']="12";
+ map['我的评价']="13";
+ map['我的礼包']="14";
+ map['助力活动']="15";
+ var index=map[name];
+
+ //我的权益要判断5,和11
+ if(name=="我的权益"){
+ if(c_list.indexOf("11")!=-1) return 1;
+ else if(c_list.indexOf("5")!=-1) return 1;
+ return 0;
+ }else{
+ //不包含,不关闭
+ if(c_list.indexOf(index)==-1) return 0;
+ //包含,就是关闭的
+ return 1
+ }
+
+}
+
+module.exports = {
+ is_close: is_close
+}
diff --git a/pages/user/index/index.js b/pages/user/index/index.js
index e26c997..0176f4d 100644
--- a/pages/user/index/index.js
+++ b/pages/user/index/index.js
@@ -57,24 +57,30 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
- onLoad: function(options) {
+ onLoad: function(options) {
var th=this;
+ //-- 读取会员中心按钮列表 --
+ getApp().request.promiseGet("/api/weshop/userTool/page?pageSize=100", {
+ }).then(res => {
+ if(res.data.code==0 ){
+ var d_list=res.data.data.pageData;
+ th.setData({user_tool:d_list});
+ }
+ })
this.birthday();
- getApp().request.promiseGet("/api/weshop/ad/list?pid=401&store_id=" + os.stoid, {
+ getApp().request.promiseGet("/api/weshop/ad/page?pid=401&store_id=" + os.stoid, {
data: {
enabled: 1
}
}).then(res => {
if(res.data.code==0 && res.data.data){
- var item=res.data.data[0];
- if (item && item.ad_code)
+ var item=res.data.data.pageData[0];
+ if (item && item.ad_code)
th.setData({ad_img:item.ad_code})
}
- })
-
+ })
app.getUserFir();
-
-
+
},
/**
@@ -122,9 +128,7 @@ Page({
}
}
});
-
-
-
+
/*-----统计-----*/
rq.get("/api/weshop/order/waitlist", {
data: {
@@ -298,8 +302,10 @@ Page({
getApp().getConfig2(function(e) {
var t_swi = e.switch_list;
if (t_swi) t_swi = JSON.parse(t_swi)
- if(t_swi){
- th.setData({sys_switch:t_swi})
+ if(t_swi){
+ var user_tool=[];
+ if(t_swi.usertool) user_tool=JSON.parse(t_swi.usertool);
+ th.setData({sys_switch:t_swi,c_list:user_tool});
}
diff --git a/pages/user/index/index.wxml b/pages/user/index/index.wxml
index 9264d59..4a3e699 100644
--- a/pages/user/index/index.wxml
+++ b/pages/user/index/index.wxml
@@ -1,6 +1,6 @@
-
+
@@ -199,73 +199,59 @@
-
-
- 我的拼单
-
-
-
- 秒杀活动
-
-
-
- 我的权益
-
-
-
-
-
-
- 联系客服
-
-
-
-
-
-
-
- plus会员
-
-
-
-
- 收藏夹
-
-
-
-
- 我的评价
-
-
-
-
- 我的地址
-
-
-
-
-
- 收入卡包
-
-
-
-
- 我的服务
-
-
-
- 专享礼包
-
-
-
-
- 助力活动
-
-
-
+
+
+
+
+
+
+
+
+
+ PLUS会员
+
+
+
+
+
+ 助力活动
+
+
+
+
+
+ 我的权益
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+ 联系客服
+
+
+
+
+
+
+ 收入卡包
+
+
+
+
+
diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js
index cc755c5..e1931e7 100644
--- a/pages/user/order_detail/order_detail.js
+++ b/pages/user/order_detail/order_detail.js
@@ -994,6 +994,7 @@ Page({
if(!err_text){
th.more_add_cart();
}else{
+ wx.hideLoading();
// 如果没有获取用户信息
wx.showModal({
title:'确定',
@@ -1008,6 +1009,7 @@ Page({
}
}else{
+ wx.hideLoading();
getApp().confirmBox(err_text);
}
},
@@ -1100,8 +1102,9 @@ Page({
}
})
}
- }
-
+ }
+
+ wx.hideLoading();
if(ok_num==0){
//-- 如果没有获取用户信息 --
wx.showModal({
diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js
index ed589b9..64da06f 100644
--- a/pages/user/order_list/order_list.js
+++ b/pages/user/order_list/order_list.js
@@ -767,6 +767,10 @@ Page({
}).then(res=>{
pickup = res.data.data;
})
+
+ wx.showLoading({
+ title:"处理中."
+ });
//--------获取商品----------
var goods_list=item.order_goods;
@@ -1080,6 +1084,7 @@ Page({
if(!err_text){
th.more_add_cart();
}else{
+ wx.hideLoading();
// 如果没有获取用户信息
wx.showModal({
title:'确定',
@@ -1094,6 +1099,7 @@ Page({
}
}else{
+ wx.hideLoading();
getApp().confirmBox(err_text);
}
},
@@ -1191,8 +1197,9 @@ Page({
}
})
}
- }
-
+ }
+
+ wx.hideLoading();
if(ok_num==0){
//-- 如果没有获取用户信息 --
wx.showModal({
diff --git a/pages/user/plus/plus.js b/pages/user/plus/plus.js
index 6fdc278..bea2645 100644
--- a/pages/user/plus/plus.js
+++ b/pages/user/plus/plus.js
@@ -245,7 +245,11 @@ Page({
{data: {storeId: os.stoid}}).then(res => {
if (res.data.code == 0) is_card = 1;
})
- if (is_card == 0) getApp().my_warnning("请联系商家升级plus功能", 0, th);
+ if (is_card == 0) {
+ getApp().my_warnning("请联系商家升级plus功能", 0, th);
+ return false;
+ }
+
var item = th.data.is_plusCard[th.data.by_index];
var req = {};
req.cardId = item.CardId;