diff --git a/app.js b/app.js index 59fa07e..ab59cec 100644 --- a/app.js +++ b/app.js @@ -52,6 +52,8 @@ App({ config2: null, //门店配置 code: null, user_id:null,// qa-6519858,// + // user_id:6520314,// qa-6519858,// + // user_id:14148118,// qa-6519858,// buy_now: null, picklist: null, //门店列表 wuliuprice: null, //物流价格表 @@ -1197,5 +1199,66 @@ App({ }; }, + //跳转视频号 + openChannelsActivity(obj){ + if (!obj.finderUserName) { + wx.showToast({ + title: '参数缺少,跳转失败', + duration: 2000, + }); + } + console.log('视频号参数:') + console.log(obj) + if (obj.video_type==1) { //1是直播 2 是 视频 + wx.getChannelsLiveInfo({ + finderUserName:obj.finderUserName, + success:(res)=>{ + let {feedId ,status,nonceId} = res + if (true || status == 2) { + wx.openChannelsLive({ + finderUserName:obj.finderUserName, + feedId, + nonceId, + success:()=>{ + console.log('进入直播间成功') + }, + fail:(error)=>{ + console.log('进入直播间失败') + console.log(error) + } + }) + } + }, + fail:(error)=>{ + console.log('跳转失败1') + console.log(error) + wx.showModal({ + title: '提示', + content: '获取直播失败:'+error.err_code, + showCancel:false, + success (res) { + if (res.confirm) { + console.log('用户点击确定') + } else if (res.cancel) { + console.log('用户点击取消') + } + } + }) + } + }) + }else{ + wx.openChannelsActivity({ + finderUserName:obj.finderUserName, + feedId:obj.feedId, + success:()=>{ + console.log('跳转成功') + }, + fail:(error)=>{ + console.log('跳转失败') + console.log(error) + } + }) + } + }, }); diff --git a/app.json b/app.json index 25b15a6..7b545a5 100644 --- a/app.json +++ b/app.json @@ -22,7 +22,6 @@ "pages/user/return_goods_info/return_goods_info", "pages/user/return_goods/return_goods", "pages/user/express/express", - "pages/user/get_user_info/get_user_info", "pages/activity/seckill_list/seckill_list", "pages/activity/pind_list/pind_list", "pages/team/team_success/team_success", @@ -34,12 +33,11 @@ "pages/user/userqy/userqy", "pages/user/user_spsy/user_spsy", - "pages/user/user_fw/user_fw", + "pages/user/grow_value/grow_value", "pages/payment/pay_success/pay_success", "pages/user/plus/plus", "pages/user/cardinfo/cardinfo", - "pages/user/Detailed/Detailed", "pages/user/my_service/appment_main", "pages/user/my_service/i_service", "pages/user/my_service/cosmetology_list", @@ -209,7 +207,9 @@ "root": "packageE/", "name": "pack5", "pages": [ - "pages/togoin/togoin" + "pages/togoin/togoin", + "pages/user/Detailed/Detailed", + "pages/user/user_fw/user_fw" ] } diff --git a/components/diy_advertising/diy_advertising.js b/components/diy_advertising/diy_advertising.js index 91c128d..a1f66ce 100644 --- a/components/diy_advertising/diy_advertising.js +++ b/components/diy_advertising/diy_advertising.js @@ -43,7 +43,16 @@ Component({ var url=e.currentTarget.dataset.url; getApp().goto(url); }, - + nv_void(e){ + var feedId=e.currentTarget.dataset.feedid; + var finderUserName=e.currentTarget.dataset.finderusername; + var video_type=e.currentTarget.dataset.video_type; + getApp().openChannelsActivity({ + feedId, + finderUserName, + video_type + }) + }, imageLoad:function(e){ var imgwidth = e.detail.width; var imgheight = e.detail.height; diff --git a/components/diy_advertising/diy_advertising.wxml b/components/diy_advertising/diy_advertising.wxml index 9ef022d..97f2898 100644 --- a/components/diy_advertising/diy_advertising.wxml +++ b/components/diy_advertising/diy_advertising.wxml @@ -19,6 +19,11 @@ + + + + + @@ -53,6 +58,11 @@ + + + + + @@ -97,6 +107,12 @@ + + + + + + @@ -140,6 +156,11 @@ + + + + + @@ -171,6 +192,12 @@ + + + + + + @@ -202,6 +229,11 @@ + + + + + @@ -234,6 +266,11 @@ + + + + + @@ -265,6 +302,11 @@ + + + + + @@ -304,6 +346,11 @@ + + + + + @@ -334,6 +381,11 @@ + + + + + @@ -367,6 +419,11 @@ + + + + + @@ -397,6 +454,11 @@ + + + + + @@ -434,6 +496,11 @@ + + + + + @@ -464,6 +531,11 @@ + + + + + @@ -498,6 +570,11 @@ + + + + + @@ -528,6 +605,11 @@ + + + + + @@ -567,6 +649,11 @@ + + + + + @@ -597,6 +684,11 @@ + + + + + @@ -631,6 +723,11 @@ + + + + + @@ -655,6 +752,11 @@ + + + + + @@ -683,6 +785,11 @@ + + + + + @@ -721,6 +828,14 @@ + + + + + {{item.title}} + + + diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index 980be53..1ee8e01 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -29,7 +29,8 @@ Component({ imghost: o.imghost, is_recommend: 0, is_hot: 0, - is_new: 0, + is_new: 0, + isyhgoods:0, baseUrl: "/api/weshop/goods/page", resourceUrl: t.globalData.setting.resourceUrl, url: t.globalData.setting.imghost, @@ -77,7 +78,7 @@ Component({ //最新的版本才有nav_list if (nav_list) { - nav_item = nav_list[0]; + nav_item = nav_list[0]; //要算一下商品goodsid for (var ij in nav_list) { var item = nav_list[ij]; @@ -134,6 +135,9 @@ Component({ if (nav_item && nav_item.goodsclass == 3) { this.data.is_new = 1 } + if (nav_item && nav_item.goodsclass == 4) { + this.data.isyhgoods = 1 + } this.data.requestData = new Array(); this.data.g_id = nav_item.data; @@ -225,6 +229,7 @@ Component({ if (th.data.is_recommend) r_data.is_recommend = th.data.is_recommend; if (th.data.is_hot) r_data.is_hot = th.data.is_hot; if (th.data.is_new) r_data.is_new = th.data.is_new; + if (th.data.isyhgoods) r_data.isyhgoods = th.data.isyhgoods; var user_id = getApp().globalData.user_id; if (!user_id) user_id = 0; @@ -239,7 +244,7 @@ Component({ th.setData({ goods_btn: res.data.data.pageData, total: res.data.data.total - }) + }) th.data.currentPage++; //设置商品熏染 th.set_good(goods); @@ -277,12 +282,20 @@ Component({ }, setLoading: function () { - var that = this; - if (this.data.loading) return false; - this.data.loading = 1; - that.init(that.data.classstyle_id, that.data.wgroup); + if(this.data.object.column==5){return} + if( this.data.goods_btn.length!=0 || this.data.object.goodscount*this.data.page - + @@ -24,8 +24,8 @@ - - + + @@ -898,5 +898,5 @@ - +暂无数据 \ No newline at end of file diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxss b/components/diy_goodsGroup/diy_goodsGroup.wxss index 4c5461b..616c4bf 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.wxss +++ b/components/diy_goodsGroup/diy_goodsGroup.wxss @@ -904,7 +904,13 @@ top: 10rpx; .zs_goods_xiao_wai{ padding-top:1rpx } .s1_gk_a1.list_border{ display: block; border-bottom: 1rpx solid #eee} - +.nodata-title { + padding-top: 40rpx; + padding-bottom: 40rpx; + color: #bbb; + font-size: 28rpx; + text-align: center; +} diff --git a/components/diy_live/diy_live.js b/components/diy_live/diy_live.js index 2fb8f34..6c513d1 100644 --- a/components/diy_live/diy_live.js +++ b/components/diy_live/diy_live.js @@ -24,7 +24,8 @@ Component({ data: { // 弹窗显示控制 showHongbao:false, - showHongbaoSmall: false, + showHongbaoSmall: false, + imghost:getApp().globalData.setting.imghost }, /** diff --git a/components/diy_live/diy_live.wxml b/components/diy_live/diy_live.wxml index 3a73ee2..ffefe69 100644 --- a/components/diy_live/diy_live.wxml +++ b/components/diy_live/diy_live.wxml @@ -3,7 +3,7 @@ - + 直播 diff --git a/components/diy_nav/diy_nav.js b/components/diy_nav/diy_nav.js index 7509b78..8e1db16 100644 --- a/components/diy_nav/diy_nav.js +++ b/components/diy_nav/diy_nav.js @@ -48,6 +48,18 @@ Component({ var url=e.currentTarget.dataset.url; console.log('url==>', url); getApp().goto(url); + }, + nv_void(e){ + console.log('导航') + console.log(e) + var feedId=e.currentTarget.dataset.feedid; + var finderUserName=e.currentTarget.dataset.finderusername; + var video_type=e.currentTarget.dataset.video_type; + getApp().openChannelsActivity({ + feedId, + finderUserName, + video_type + }) } } }) \ No newline at end of file diff --git a/components/diy_nav/diy_nav.wxml b/components/diy_nav/diy_nav.wxml index 4ab5090..ed60f50 100644 --- a/components/diy_nav/diy_nav.wxml +++ b/components/diy_nav/diy_nav.wxml @@ -13,6 +13,11 @@ + + + + + @@ -36,6 +41,11 @@ + + + + + diff --git a/components/diy_notice/diy_notice.js b/components/diy_notice/diy_notice.js index 16cb045..27c7776 100644 --- a/components/diy_notice/diy_notice.js +++ b/components/diy_notice/diy_notice.js @@ -26,5 +26,15 @@ Component({ var url=e.currentTarget.dataset.url; getApp().goto(url); }, + nv_void(e){ + var feedId=e.currentTarget.dataset.feedid; + var finderUserName=e.currentTarget.dataset.finderusername; + var video_type=e.currentTarget.dataset.video_type; + getApp().openChannelsActivity({ + feedId, + finderUserName, + video_type + }) + } } }) \ No newline at end of file diff --git a/components/diy_notice/diy_notice.wxml b/components/diy_notice/diy_notice.wxml index 6086942..2f45c6f 100644 --- a/components/diy_notice/diy_notice.wxml +++ b/components/diy_notice/diy_notice.wxml @@ -32,6 +32,20 @@ + + + + + + + {{object.noticetxt}} + {{object.noticetxt}} + {{object.noticetxt}} + + + + + diff --git a/components/diy_picMax/diy_picMax.js b/components/diy_picMax/diy_picMax.js index a293a74..fd3bb0e 100644 --- a/components/diy_picMax/diy_picMax.js +++ b/components/diy_picMax/diy_picMax.js @@ -32,7 +32,16 @@ Component({ var url = e.currentTarget.dataset.url; getApp().goto(url); }, - + nv_void(e){ + var feedId=e.currentTarget.dataset.feedid; + var finderUserName=e.currentTarget.dataset.finderusername; + var video_type=e.currentTarget.dataset.video_type; + getApp().openChannelsActivity({ + feedId, + finderUserName, + video_type + }) + }, previewImage(e){ let src =e.currentTarget.dataset.src; wx.previewImage({ diff --git a/components/diy_picMax/diy_picMax.wxml b/components/diy_picMax/diy_picMax.wxml index 77393e1..a6b21a2 100644 --- a/components/diy_picMax/diy_picMax.wxml +++ b/components/diy_picMax/diy_picMax.wxml @@ -14,6 +14,10 @@ + + + + @@ -34,6 +38,10 @@ + + + + diff --git a/components/diy_title/diy_title.js b/components/diy_title/diy_title.js index 20d76fc..cef6ad0 100644 --- a/components/diy_title/diy_title.js +++ b/components/diy_title/diy_title.js @@ -24,6 +24,16 @@ Component({ var txt="object.title_img"; ob[txt] = iurl +'/miniapp/images/logo.png?v=1'; this.setData(ob); - } + }, + nv_void(e){ + var feedId=e.currentTarget.dataset.feedid; + var finderUserName=e.currentTarget.dataset.finderusername; + var video_type=e.currentTarget.dataset.video_type; + getApp().openChannelsActivity({ + feedId, + finderUserName, + video_type + }) + } } }) diff --git a/components/diy_title/diy_title.wxml b/components/diy_title/diy_title.wxml index eba7b92..3e71532 100644 --- a/components/diy_title/diy_title.wxml +++ b/components/diy_title/diy_title.wxml @@ -13,6 +13,9 @@ {{object.title_name}} + + {{object.title_name}} + {{object.title_name}} @@ -38,6 +41,14 @@ + + + + {{object.title_right}} + + + + diff --git a/custom-tab-bar/index.wxml b/custom-tab-bar/index.wxml index 23f8d7f..9d3b940 100644 --- a/custom-tab-bar/index.wxml +++ b/custom-tab-bar/index.wxml @@ -6,7 +6,7 @@ style="color: {{active==idx?fontcolor_sele:fontcolor}};"> - {{cartGoodsNum}} + {{item.nav_name}} diff --git a/images/gt.png b/images/gt.png deleted file mode 100644 index 5e68248..0000000 --- a/images/gt.png +++ /dev/null diff --git a/images/share/default_g_img.gif b/images/share/default_g_img.gif deleted file mode 100644 index fd72ed1..0000000 --- a/images/share/default_g_img.gif +++ /dev/null diff --git a/packageA/pages/activity_share/activity_share.js b/packageA/pages/activity_share/activity_share.js index f954081..940e4e5 100644 --- a/packageA/pages/activity_share/activity_share.js +++ b/packageA/pages/activity_share/activity_share.js @@ -1203,9 +1203,17 @@ Page({ ee.data.share_goods_img = res.path; tt(); }, - fail: function(res) { - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 - tt(); + fail: function(res) { + + //获取默认空白图 + wx.getImageInfo({ + src: ee.data.url+'/miniapp/images/default_g_img.gif', + success: function(res) { + ee.data.share_goods_img = res.path; //分享的图片不能用网络的 + tt(); + } + }) + } }); }, diff --git a/packageA/pages/distribution/order/order.wxml b/packageA/pages/distribution/order/order.wxml index e54e036..a199bce 100644 --- a/packageA/pages/distribution/order/order.wxml +++ b/packageA/pages/distribution/order/order.wxml @@ -14,7 +14,7 @@ {{filter.status(item.status, statusArr)}} - + diff --git a/packageA/pages/distribution/shop/shop.js b/packageA/pages/distribution/shop/shop.js index f9452e5..fb36af6 100644 --- a/packageA/pages/distribution/shop/shop.js +++ b/packageA/pages/distribution/shop/shop.js @@ -84,6 +84,15 @@ Page({ }) // this.getData(true, '/api/weshop/users/distribut/pagemyshop', this.data.currentQuery); } + + getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{ + var dis=rs.data.data; + if( dis){ + self.setData({storeDistribut:dis}) + } + }) + + }, /** @@ -318,10 +327,17 @@ Page({ * 用户点击右上角分享 *--点击分享事件--分享我的小店 *--*/ - onShareAppMessage: function (t) { getApp().globalData.no_clear=1; + onShareAppMessage: function (t) { + getApp().globalData.no_clear=1; var th = this; var title = "我的小店"; + + if(this.data.storeDistribut){ + title=this.data.storeDistribut.distributSharetitle; + title+=" "+this.data.storeDistribut.distributShareremark; + } + var user_id = this.data.first_leader; if (!user_id) { user_id = getApp().globalData.user_id diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js index b9d642a..2032b38 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -853,6 +853,13 @@ Page({ } + if(this.data.goodsInputNum==0){ + getApp().my_warnning('请输入购买数量', 1, th, 450); + return false; + } + + + if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind; th.setData({ @@ -870,6 +877,8 @@ Page({ var limitNum = 0; // 已购买数量 var boughtNum = 0; + + var is_ok=1; // 秒杀活动 if(this.data.prom_type == 1) { @@ -895,6 +904,7 @@ Page({ // title: '超出活动库存', // }); getApp().my_warnning('超出活动库存', 0, self); + is_ok=0; return false; } else { // 可购买数量>0 @@ -922,8 +932,9 @@ Page({ // }); getApp().my_warnning('超出活动库存', 0, self); th.setData({ - goodsInputNum: res, + goodsInputNum: res || 1 }); + is_ok=0; return false; }; }; @@ -935,8 +946,9 @@ Page({ // }); getApp().my_warnning('超出限购数量', 0, self); th.setData({ - goodsInputNum: canBuyNum, + goodsInputNum: canBuyNum || 1, }); + is_ok=0; return false; }; }; @@ -955,7 +967,10 @@ Page({ }; - + if(!is_ok) return false; + + + if(action=="buy"){ //--------------此时操作的数据------------ var newd = { @@ -1243,7 +1258,7 @@ Page({ // }); getApp().my_warnning('超出活动库存', 0, self); th.setData({ - goodsInputNum: res, + goodsInputNum: res || 1, }); return false; }; @@ -1256,7 +1271,7 @@ Page({ // }); getApp().my_warnning('超出限购数量', 0, self); th.setData({ - goodsInputNum: canBuyNum, + goodsInputNum: canBuyNum || 1, }); return false; }; @@ -2444,9 +2459,15 @@ Page({ tt(); }, fail: function(res) { + //获取默认空白图 + wx.getImageInfo({ + src: ee.data.iurl+'/miniapp/images/default_g_img.gif', + success: function(res) { + ee.data.share_goods_img = res.path; //分享的图片不能用网络的 + tt(); + } + }) - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 - tt(); } }); }, diff --git a/packageA/pages/goods_share/goods_share.js b/packageA/pages/goods_share/goods_share.js index a16e3d8..15f3333 100644 --- a/packageA/pages/goods_share/goods_share.js +++ b/packageA/pages/goods_share/goods_share.js @@ -806,8 +806,16 @@ Page({ tt(); }, fail: function(res) { - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 - tt(); + + //获取默认空白图 + wx.getImageInfo({ + src: ee.data.url+'/miniapp/images/default_g_img.gif', + success: function(res) { + ee.data.share_goods_img = res.path; //分享的图片不能用网络的 + tt(); + } + }) + } }); }, diff --git a/packageA/pages/quan_list/quan_list.js b/packageA/pages/quan_list/quan_list.js index 3baf596..304a1dd 100644 --- a/packageA/pages/quan_list/quan_list.js +++ b/packageA/pages/quan_list/quan_list.js @@ -32,6 +32,9 @@ Page({ //---展示--- onShow: function () { + //检查能不能分享 + getApp().check_can_share(); + console.log("onShow:1"); this.data.curpage = 1; this.setData({ dataList: null }); @@ -41,6 +44,8 @@ Page({ //var data = [{ is_get:0,money:50,condition:500,id:1,name: "券名字", endtype: 0, use_start_time: 1579596090, use_end_time: 1611218490, everyone_num: 2,interval_time:1,color:"red"}]; //th.setData({dataList: data}); this.setData({ getcurday: ut.gettimestamp() }); + + }, onHide: function () { @@ -184,5 +189,36 @@ Page({ var index = e.currentTarget.dataset.ind; var item = this.data.dataList[index]; getApp().goto("/packageA/pages/quan_pro/quan_pro?id=" + item.id); - } + }, + + + //发送给好友 + onShareAppMessage:async function(e) { + getApp().globalData.no_clear=1; + var url= `packageA/pages/quan_list/quan_list`; + var userInfo = getApp().globalData.userInfo; + //是分销商才带 + if (userInfo) { + url += "?first_leader=" + userInfo.user_id; + } + var ob = { + title:"优惠券列表", + path: url, + //imageUrl:this.data.url+this.data.store_config.store_logo, + }; + return ob; + }, + + //发送给朋友圈 + onShareTimeline() { + getApp().globalData.no_clear=1; + var user_id= getApp().globalData.user_id + return { + title:"优惠券列表", + query: 'first_leader='+user_id + } + }, + + + }); diff --git a/packageA/pages/quan_pro/quan_pro.js b/packageA/pages/quan_pro/quan_pro.js index 59d4fde..77a823f 100644 --- a/packageA/pages/quan_pro/quan_pro.js +++ b/packageA/pages/quan_pro/quan_pro.js @@ -44,6 +44,10 @@ Page({ //---展示,显示券的信息--- onShow: function() { + + //检查能不能分享 + getApp().check_can_share(); + var th=this; var user_id=getApp().globalData.user_id; getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", { @@ -170,4 +174,33 @@ Page({ show_success:0 }) }, + + //发送给好友 + onShareAppMessage:async function(e) { + getApp().globalData.no_clear=1; + var url= "packageA/pages/quan_pro/quan_pro?id="+this.data.id; + var userInfo = getApp().globalData.userInfo; + //是分销商才带 + if (userInfo) { + url += "&first_leader=" + userInfo.user_id; + } + var ob = { + title:this.data.q_data.name, + path: url, + //imageUrl:this.data.url+this.data.store_config.store_logo, + }; + return ob; + }, + + //发送给朋友圈 + onShareTimeline() { + getApp().globalData.no_clear=1; + var user_id= getApp().globalData.user_id + return { + title:this.data.q_data.name, + query: 'id='+this.data.id+'&first_leader='+user_id + } + }, + + }); diff --git a/packageA/pages/service_share/service_share.js b/packageA/pages/service_share/service_share.js index 747fa0e..e498c8e 100644 --- a/packageA/pages/service_share/service_share.js +++ b/packageA/pages/service_share/service_share.js @@ -784,9 +784,15 @@ Page({ ee.data.share_goods_img = res.path; tt(); }, - fail: function(res) { - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 - tt(); + fail: function(res) { + //获取默认空白图 + wx.getImageInfo({ + src: ee.data.url+'/miniapp/images/default_g_img.gif', + success: function(res) { + ee.data.share_goods_img = res.path; //分享的图片不能用网络的 + tt(); + } + }) } }); }, diff --git a/packageB/pages/zuhegou/index/index.js b/packageB/pages/zuhegou/index/index.js index 8e81cd1..dcc4b7f 100644 --- a/packageB/pages/zuhegou/index/index.js +++ b/packageB/pages/zuhegou/index/index.js @@ -116,7 +116,9 @@ Page({ sort_store: 0, //门店分类 choice_sort_store: 0, //选择分类门店 fir_pick_index: 0, //门店选择的下标 - sec_pick_index: 0 //门店选择的下标,地区选择之后的内页 + sec_pick_index: 0, //门店选择的下标,地区选择之后的内页 + + sales_map:{}, //线下销售的map }, /** @@ -311,7 +313,6 @@ Page({ getApp().getConfig2(function (e) { ee.setData({ bconfig: e, - sales_rules: e.sales_rules, }); //设置基本参数 th.wait_for_store_config(e); @@ -357,12 +358,17 @@ Page({ } } //获取购物车的内容 - th.get_cart_val(e); + setTimeout(function(){ + th.get_cart_val(e); + },1000) + }) } else { //获取购物车的内容 - th.get_cart_val(e); + setTimeout(function(){ + th.get_cart_val(e); + },1000) } }, 1); @@ -533,6 +539,9 @@ Page({ //说明是加入购物车是时候 this.data.is_zuhe_addcart = 1; if (!haveAdded) { + + + th.data.sele_g = this.data.list[index]; if (!th.data.sele_g.num) th.data.goodsInputNum = 1; @@ -567,11 +576,14 @@ Page({ } return false; } else { - th.setData({ - is_no_pipei: 0 - }); - th.check_is_in_cart(function () { - th.add_cart_func(); + //先判断一下线下库存 + th.check_pk_store_conut(function(){ + th.setData({ + is_no_pipei: 0 + }); + th.check_is_in_cart(function () { + th.add_cart_func(); + }) }) } } else { @@ -648,6 +660,110 @@ Page({ }, + //在启用线下的时候,要判断一下是不是有库存 + async check_pk_store_conut(func,is_no_msg,gd,by_num){ + var th=this; + if(this.data.sales_rules!=2){ + if(func) func(); + return false; + } + //门店库存no + var pkno= gd && gd.pickup_no?gd.pickup_no:this.data.def_pick_store.pickup_no; + var pickup_id=gd && gd.pick_id?gd.pick_id:this.data.def_pick_store.pickup_id; + var lock = []; + var plist=null; + var good=gd || th.data.sele_g; + var buy_num=by_num || th.data.goodsInputNum; + + if(this.data.sales_map[good.goods_id]){ + + var mp=this.data.sales_map[good.goods_id]; + var lock_num=mp.lock_num; + var CanOutQty=mp.CanOutQty; + if (CanOutQty < lock_num +buy_num) { + + if(!is_no_msg) { + wx.showToast({ + title: "门店库存不足", + icon: 'none', + duration: 2000 + }) + } + return false; + } + if(is_no_msg) return true; + func(); + + }else { + //先读取门店的lock,采用链式写法,少用await + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { + data: {store_id: os.stoid, wareId: good.goods_id, pageSize: 1000} + }).then(res => { + if (res.data.code == 0 && res.data.data.total > 0) { + lock = res.data.data.pageData + } + + }) + //---通过接口获取门店的线下库存信息-- + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { + data: { + storageNos: pkno, + wareIds: encodeURIComponent(good.erpwareid), + storeId: os.stoid, + pageSize: 2000 + } + }).then(res => { + if (ut.ajax_ok(res)) { + plist = res.data.data.pageData[0]; + } + }) + + if(!plist){ + if(!is_no_msg) { + wx.showToast({ + title: "该商品在门店未找到库存", + icon: 'none', + duration: 2000 + }) + } + return false; + } + + var lock_num = th.find_lock_num(pickup_id, lock); + this.data.sales_map[good.goods_id]={ + CanOutQty:plist.CanOutQty, + lock_num:lock_num + } + + if (plist.CanOutQty < lock_num + buy_num) { + if(!is_no_msg) { + wx.showToast({ + title: "该商品在门店未找到库存", + icon: 'none', + duration: 2000 + }) + } + return false; + } + if(is_no_msg) return true; + func(); + } + + }, + + find_lock_num(pick_id, lock) { + var lock_num = 0; + if (!lock) return 0; + if (lock.length < 0) return 0; + for (var i in lock) { + if (pick_id == lock[i].pickupId) { + lock_num += lock[i].outQty; + } + } + return lock_num; + }, + + /** * 增加数量 */ @@ -664,13 +780,17 @@ Page({ this.data.changing = 1; var index = e.currentTarget.dataset.index; - this.data.sele_g = this.data.list[index]; + this.data.sele_g = th.data.list[index]; this.data.sele_index = index; - th.data.goodsInputNum = this.data.sele_g.num + 1; - if (this.data.sele_g.cart_num) { - th.data.s_cart_num = this.data.sele_g.cart_num + 1; - } - th.add_cart_func(); + th.data.goodsInputNum = th.data.sele_g.num + 1; + + th.check_pk_store_conut(function(){ + if (th.data.sele_g.cart_num) { + th.data.s_cart_num = th.data.sele_g.cart_num + 1; + } + th.add_cart_func(); + }) + }, /** @@ -1581,11 +1701,19 @@ Page({ //只是单纯的选择门店 if (this.data.only) { this.data.only = 0; + this.data.sales_map={}; + return false; } - th.check_is_in_cart(function () { - th.add_cart_func(); + + //-- 判断一下库存 -- + th.check_pk_store_conut(function(){ + th.check_is_in_cart(function () { + th.add_cart_func(); + }) }) + + }, @@ -2116,17 +2244,23 @@ Page({ getApp().request.get("/api/weshop/cart/list", { data: req, success: async function (e) { - if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length) { + if(ut.ajax_ok(e)) { var map = {}; var mlist = e.data.data.pageData; th.data.cart_list = mlist; - for (let i in mlist) { let item = mlist[i]; if (item.prom_type != 7) continue; if (item.prom_id != th.data.act.id) continue; + if(th.data.def_pick_store && th.data.def_pick_store.pickup_id){ + if(item.pick_id!=th.data.def_pick_store.pickup_id){ + continue; + } + } map[item.goods_id] = item; } + + //-- 循环活动的从表 -- for (let j in th.data.list) { let item_j = th.data.list[j]; item_j.current_price = item_j.shop_price; @@ -2144,6 +2278,16 @@ Page({ if (map[item_j.goods_id]) { var cart_num = map[item_j.goods_id].goods_num; item_j.num = cart_num; + item_j.pickup_no = map[item_j.goods_id].pickup_no; + item_j.pick_id = map[item_j.goods_id].pick_id; + + //判断库存是不是存在 + var can_qty=await th.check_pk_store_conut(null,1,item_j,cart_num); + if(!can_qty){ + item_j.num=0; + continue; + } + item_j.cart_num = cart_num; item_j.cart_id = map[item_j.goods_id].id; if (item_j.buyqty > 0) { diff --git a/packageC/pages/goods/distributionCategoryList/index.js b/packageC/pages/goods/distributionCategoryList/index.js index bce472c..13e3a79 100644 --- a/packageC/pages/goods/distributionCategoryList/index.js +++ b/packageC/pages/goods/distributionCategoryList/index.js @@ -143,9 +143,9 @@ Page({ that.setData({ store_config: e, is_do: 1 }); //---有勾品类--- - if (that.data.is_show_pl) { - that.getGoodsCategoris(); - } + //if (that.data.is_show_pl) { + // that.getGoodsCategoris(); + //} if (that.data.is_show_gb != 1 && that.data.is_show_pp != 1 && that.data.is_show_pl) { that.data.pl_timer = setInterval(function () { if (that.data.catelist.length > 0) { @@ -521,6 +521,7 @@ Page({ let { currentData } = this.data; currentData.cat_id = this.data.cat_id; currentData.page = this.data.stylePage; + currentData.parent_id = 0; let url = '/api/weshop/users/distribut/pagemyshop'; getApp().promiseGet(url, { diff --git a/packageC/pages/goods/distributionCategoryList/index.wxml b/packageC/pages/goods/distributionCategoryList/index.wxml index ad0d7cb..f34a559 100644 --- a/packageC/pages/goods/distributionCategoryList/index.wxml +++ b/packageC/pages/goods/distributionCategoryList/index.wxml @@ -33,7 +33,8 @@ - + {{item.name}} diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js index 4b14fcc..cf05702 100644 --- a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js @@ -952,8 +952,14 @@ Page({ tt(); }, fail: function (res) { - ee.data.share_img_localpath= "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 - tt(); + //获取默认空白图 + wx.getImageInfo({ + src: os.imghost+'/miniapp/images/default_g_img.gif', + success: function(res) { + ee.data.share_img_localpath = res.path; //分享的图片不能用网络的 + tt(); + } + }) } }); }, diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index 7b03c7e..65d3955 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -317,6 +317,39 @@ Page({ //检查测肤 getApp().check_skin_face(t,0,gid); + //-- 自定义海报 -- + 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 && res.data.data && res.data.data.pageData && res.data.data.pageData[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); + console.log('自定义海报参数-------'); + console.log(json_data); + 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}) + + } + } + }) + //---获取手机地址坐标-- //--如果tg_id是空的话,分享回来-- // console.log('扫描海报gid'); @@ -714,7 +747,7 @@ Page({ data: { store_id: os.stoid, type: 1, - pageSize: 3, + pageSize: 100, page: 1, is_share: 0, }, @@ -722,7 +755,24 @@ Page({ fir_quan = res1.data.data.pageData; }) } - + //过滤不是本商品的单品优惠券------------------- + if(fir_quan.length > 0 ){ + let goodInfo = ee.data.data + for (let index = fir_quan.length-1; index >= 0; index--) { + if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券 + if (fir_quan[index].useobjectno != goodInfo.goods_sn) { + fir_quan.splice(index,1) + } + } + } + } + let arr=[] + let length = fir_quan.length + if (length <= 3) { + arr=fir_quan + }else{ + arr=fir_quan.splice(0,3); + } //--------获取视频图片--------- await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { 1: 1 @@ -748,7 +798,7 @@ Page({ is_collect: is_collect, collect_id: collect_id, categories3: categories3, - fir_quan: fir_quan, + fir_quan: arr, fir_comments: fir_com, mapurl_f_img: mapurl_f_img, mapurl: mapurl, @@ -4450,7 +4500,18 @@ Page({ wx.hideLoading(); quan_list = res.data.data.pageData; }) - + //过滤不是本商品的单品优惠券 + if (quan_list.length > 0) { + let goodInfo = th.data.data + for (let index = quan_list.length-1; index >= 0; index--) { + if (quan_list[index].useobjecttype==20) { //判断是单品优惠券 + if (quan_list[index].useobjectno != goodInfo.goods_sn) { + quan_list.splice(index,1) + } + } + } + } + //------------------------ if (quan_list) { for (var ind in quan_list) { var ep = quan_list[ind]; @@ -4620,7 +4681,7 @@ Page({ // 8.商品标题 context.setFontSize(20 * unit); context.setFillStyle('#898989'); - this.draw_Text(context, this.data.data.goods_name, + getApp().draw_Text(context, this.data.data.goods_name, 54 * unit, 770 * unit, 240 * unit, 240 * unit, unit); // 9.小程序码 context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit); @@ -4717,7 +4778,7 @@ Page({ // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); - if (type == 0) { // 如果是普通商品,绘制新海报 + if (!th.data.share_b_img && (type == 9)) { // 如果是普通商品,绘制新海报 th.drawPoster(context, unit, th.data.share_goods_img, vpath); } else { context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); @@ -4727,7 +4788,7 @@ Page({ //-- 是自定义海报的情况下 -- - if (type != 0) { + if (th.data.share_b_img || type != 0) { @@ -4758,10 +4819,10 @@ Page({ } } else { //--昵称--- - context.setFontSize(24 * unit); - context.setFillStyle("black"); - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 60 * unit); - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; + // context.setFontSize(24 * unit); + // context.setFillStyle("black"); + // context.fillText(app.globalData.userInfo.nickname, 152 * unit, 60 * unit); + // var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; //强烈推荐 改许程 // var tj_path = "../../../../images/share/q_tj.png"; // let txt_gn = th.data.luckGoInfo.group_num + '人团'; @@ -4772,9 +4833,9 @@ Page({ // context.setFillStyle("white"); // context.fillText(txt_gn, 149 * unit + width + 15 * unit, 75 * unit); // 发出幸运购活动邀请 - context.setFillStyle("#7f7f7f") - context.setFontSize(21.3 * unit) - context.fillText("向您发出幸运购邀请", 152 * unit, 90 * unit); + // context.setFillStyle("#7f7f7f") + // context.setFontSize(21.3 * unit) + // context.fillText("向您发出幸运购邀请", 152 * unit, 90 * unit); } @@ -4791,7 +4852,7 @@ Page({ //---产品名称--- //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 - if (type != 4 && type != 0) { + if (th.data.share_b_img || (type != 4 && type != 9)) { context.setFillStyle("black"); context.setFontSize(21.3 * unit) th.draw_Text(context, share_title, @@ -4852,11 +4913,29 @@ Page({ } //---中间大图--- - if (type != 0) { + if ( th.data.share_b_img || type != 9) { context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); }; + //---自定义海报 产品质量保证 + if(th.data.share_b_img && th.data.poster.show_quality==1 ){ + 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); + + } //-------大图后面就不一样了----------- switch (type) { @@ -5073,74 +5152,76 @@ Page({ case 9: + if(th.data.share_b_img){ - //---画线--- - context.setLineWidth(1 * unit) - context.moveTo(32 * unit, 680 * unit) - context.lineTo(520 * unit, 680 * unit) - context.stroke(); - - //---文字--- - context.setFillStyle("black") - context.setFontSize(24 * unit) - context.font = 'normal bold 18px'; - context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit); - - //还差N人,即可成团 - let group_num = th.data.luckGoInfo.group_num; - let num_joined = th.data.luckGoInfo.num; - let delta1 = group_num - num_joined; - let width_delta1 = ut.measureText(delta1, 15); - context.setFillStyle("black"); - context.setFontSize(21.3 * unit); - context.fillText(group_num + "人团,还差", 40 * unit, 772 * unit); - context.setFillStyle("#FF6768"); - context.setFontSize(21.3 * unit); - context.fillText(delta1, 160 * unit, 772 * unit); - context.setFillStyle("black"); - context.setFontSize(21.3 * unit); - context.fillText("人,即可成团", (170 + width_delta1) * unit, 772 * unit); - - // N人得商品,N人全额退款 - let group_win = th.data.luckGoInfo.group_win; - let delta2 = group_num - group_win; - let width_delta2 = ut.measureText(delta2, 16); - let width_groupNum = ut.measureText(group_num, 15); - let width_groupWin = ut.measureText(group_win, 15); - context.setFillStyle("#FF6768"); - context.setFontSize(21.3 * unit); - context.fillText(group_win, 40 * unit, 806 * unit); - context.setFillStyle("black"); - context.setFontSize(21.3 * unit); - context.fillText("人得商品,", (54 + width_groupWin) * unit, 806 * unit); - context.setFillStyle("#FF6768"); - context.setFontSize(21.3 * unit); - context.fillText(delta2, 160 * unit, 806 * unit); - context.setFillStyle("black"); - context.setFontSize(21.3 * unit); - context.fillText("人全额退款", (170 + width_delta2) * unit, 806 * unit); - - // 并得帮团惊喜礼品 - context.setFillStyle("black") - context.setFontSize(21.3 * unit) - context.fillText("并得帮团", 40 * unit, 840 * unit); - context.setFillStyle("#FF6768") - context.setFontSize(21.3 * unit) - context.fillText("惊喜礼品", 130 * unit, 840 * unit); - context.setFillStyle("black") - context.setFontSize(21.3 * unit) - context.fillText("!", 220 * unit, 840 * unit); + + //---画线--- + context.setLineWidth(1 * unit) + context.moveTo(32 * unit, 680 * unit) + context.lineTo(520 * unit, 680 * unit) + context.stroke(); + //---文字--- + context.setFillStyle("black") + context.setFontSize(24 * unit) + context.font = 'normal bold 18px'; + context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit); + + //还差N人,即可成团 + let group_num = th.data.luckGoInfo.group_num; + let num_joined = th.data.luckGoInfo.num; + let delta1 = group_num - num_joined; + let width_delta1 = ut.measureText(delta1, 15); + context.setFillStyle("black"); + context.setFontSize(21.3 * unit); + context.fillText(group_num + "人团,还差", 40 * unit, 772 * unit); + context.setFillStyle("#FF6768"); + context.setFontSize(21.3 * unit); + context.fillText(delta1, 160 * unit, 772 * unit); + context.setFillStyle("black"); + context.setFontSize(21.3 * unit); + context.fillText("人,即可成团", (170 + width_delta1) * unit, 772 * unit); + + // N人得商品,N人全额退款 + let group_win = th.data.luckGoInfo.group_win; + let delta2 = group_num - group_win; + let width_delta2 = ut.measureText(delta2, 16); + let width_groupNum = ut.measureText(group_num, 15); + let width_groupWin = ut.measureText(group_win, 15); + context.setFillStyle("#FF6768"); + context.setFontSize(21.3 * unit); + context.fillText(group_win, 40 * unit, 806 * unit); + context.setFillStyle("black"); + context.setFontSize(21.3 * unit); + context.fillText("人得商品,", (54 + width_groupWin) * unit, 806 * unit); + context.setFillStyle("#FF6768"); + context.setFontSize(21.3 * unit); + context.fillText(delta2, 160 * unit, 806 * unit); + context.setFillStyle("black"); + context.setFontSize(21.3 * unit); + context.fillText("人全额退款", (170 + width_delta2) * unit, 806 * unit); + + // 并得帮团惊喜礼品 + context.setFillStyle("black") + context.setFontSize(21.3 * unit) + context.fillText("并得帮团", 40 * unit, 840 * unit); + context.setFillStyle("#FF6768") + context.setFontSize(21.3 * unit) + context.fillText("惊喜礼品", 130 * unit, 840 * unit); + context.setFillStyle("black") + context.setFontSize(21.3 * unit) + context.fillText("!", 220 * unit, 840 * unit); + } //---二维吗图--- //-- 自定义海报 -- - if (th.data.poster) { + if (th.data.share_b_img && 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, 136 * unit, 136 * unit); } else { //---二维吗图--- - context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); + // context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); } break; @@ -5150,7 +5231,7 @@ Page({ //--- 如果是自定义海报的时候 --- - if (type != 0) { + if ( th.data.share_b_img || type != 9) { if (th.data.poster && parseInt(th.data.poster.style) == 2) { @@ -5324,7 +5405,7 @@ Page({ - //--获取头像的本地缓存,回调写法-- + //--获取头像的本地缓存,回调写法-- get_head_temp: function (tt, func) { var ee = this; if (ee.data.share_head) { @@ -5375,8 +5456,14 @@ Page({ tt(); }, fail: function (res) { - ee.data.share_goods_img = "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 - tt(); + //获取默认空白图 + wx.getImageInfo({ + src: ee.data.iurl+'/miniapp/images/default_g_img.gif', + success: function(res) { + ee.data.share_goods_img = res.path; //分享的图片不能用网络的 + tt(); + } + }) } }); }, diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml index ba1fc77..2ea6553 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml @@ -899,7 +899,7 @@ - {{cartGoodsNum}} + 购物车 diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js index 357861e..32ff65a 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.js +++ b/packageC/pages/presell/goodsInfo/goodsInfo.js @@ -7,7 +7,7 @@ var ut = require("../../../../utils/util.js"), oo = s.globalData, o = s.globalData.setting, os = o; -//评价加载更多 +//评价加载更多 var more = function (e) { return e && e.__esModule ? e : { default: e @@ -250,13 +250,13 @@ Page({ share_hidden: false, pre_arr: null, - - hiddenCS: true, + + hiddenCS: true, }, //------初始化加载---------- onLoad: function (t) { - self = this; + self = this; var ee = this, that = ee, th = ee, pre_id = t.pre_id, gid = t.goods_id, @@ -264,8 +264,8 @@ Page({ first_leader = t.first_leader, room_id = t.room_id, room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id - //检查测肤 - getApp().check_skin_face(t,0,gid); + //检查测肤 + getApp().check_skin_face(t, 0, gid); //-- 自定义海报 -- getApp().request.promiseGet("/api/weshop/goods/poster/page", { @@ -314,7 +314,7 @@ Page({ } this.setData({ - gid:gid,pre_id:pre_id,presell_id:presell_id + gid: gid, pre_id: pre_id, presell_id: presell_id }) if (first_leader) { @@ -561,7 +561,7 @@ Page({ data: { store_id: os.stoid, type: 1, - pageSize: 3, + pageSize: 100, page: 1, is_share: 0, }, @@ -569,7 +569,24 @@ Page({ fir_quan = res1.data.data.pageData; }) } - + //过滤不是本商品的单品优惠券------------------- + if (fir_quan.length > 0) { + let goodInfo = ee.data.data || {} + for (let index = fir_quan.length - 1; index >= 0; index--) { + if (fir_quan[index].useobjecttype == 20) { //判断是单品优惠券 + if (fir_quan[index].useobjectno != goodInfo.goods_sn) { + fir_quan.splice(index, 1) + } + } + } + } + let arr = [] + let length = fir_quan.length + if (length <= 3) { + arr = fir_quan + } else { + arr = fir_quan.splice(0, 3); + } //--------获取视频图片--------- await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { 1: 1 @@ -587,7 +604,7 @@ Page({ is_collect: is_collect, collect_id: collect_id, categories3: categories3, - fir_quan: fir_quan, + fir_quan: arr, fir_comments: fir_com, mapurl_f_img: mapurl_f_img, mapurl: mapurl, @@ -597,7 +614,7 @@ Page({ //---展示--- onShow: function () { - getApp().check_can_share(); + getApp().check_can_share(); var goods_list = null, th = this, that = this; //-- 如果是预览图片,页面不重新更新 -- @@ -672,8 +689,8 @@ Page({ //-- 把商品的赋值 -- ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data)); - ee.data.sele_g_id=t.data.data.goods_id; - ee.data.sele_g=t.data.data; + ee.data.sele_g_id = t.data.data.goods_id; + ee.data.sele_g = t.data.data; //获取用户的默认门店 getApp().get_user_store(function (e) { @@ -681,7 +698,7 @@ Page({ th.data.fir_def_store = {}; //赋值空对象 return false; } - if(getApp().globalData.is_dj_pk) th.setData({has_def:1}) + if (getApp().globalData.is_dj_pk) th.setData({ has_def: 1 }) var ee = JSON.parse(JSON.stringify(e)); @@ -1045,7 +1062,7 @@ Page({ newd.goods_price = th.data.prom_price; newd.member_goods_price = th.data.prom_price, - newd.prom_type = 8; + newd.prom_type = 8; newd.prom_id = o.prom_id; if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); @@ -1084,8 +1101,8 @@ Page({ return s.my_warnning("库存不足!", 0, th); } - if (item.goods_num + th.data.goodsInputNum >th.data.pre_arr.presell_sumqty-th.data.pre_arr.buy_goodnum) { - return s.my_warnning("库存不足!", 0, th); + if (item.goods_num + th.data.goodsInputNum > th.data.pre_arr.presell_sumqty - th.data.pre_arr.buy_goodnum) { + return s.my_warnning("库存不足!", 0, th); } var updata = { @@ -1156,10 +1173,10 @@ Page({ app.set_b_now(e); //如果是全额付款的话 - if(this.data.presellForm.presell_type==1){ - getApp().goto("/packageC/pages/presell/cart/cart2") - }else{ - getApp().goto("/packageC/pages/presell/cart/cart2_pre"); + if (this.data.presellForm.presell_type == 1) { + getApp().goto("/packageC/pages/presell/cart/cart2") + } else { + getApp().goto("/packageC/pages/presell/cart/cart2_pre"); } }, @@ -1213,8 +1230,8 @@ Page({ } var e = th.data.sele_g.store_count; - var e2=th.data.pre_arr.presell_sumqty-th.data.pre_arr.buy_goodnum; - if(e2 { + getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + th.data.sele_g.goods_id + "/0" + "/" + getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; th.data.prom_goods = r_data.promGoodsLists; @@ -1444,38 +1461,38 @@ Page({ contactService: function () { getApp().com_call(this); }, - - // 获取客服电话 - getTel() { - return new Promise((resolve, reject) => { - s.getConfig(function (t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function (rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().my_warnning("商家未设置电话", 0, th); - return false; - } - self.setData({ - store_tel: rs.data.data.store_tel, - }); - // s.confirmBox("请联系客服:" + rs.data.data.store_tel); - } - }) - } else { - self.setData({ - store_tel: t.store_tel, - }); - // s.confirmBox("请联系客服:" + t.store_tel); - }; - resolve(); - }); - }); - }, - + + // 获取客服电话 + getTel() { + return new Promise((resolve, reject) => { + s.getConfig(function (t) { + if (t.store_tel == undefined) { + getApp().request.get("/api/weshop/store/get/" + os.stoid, { + isShowLoading: 1, + data: {}, + success: function (rs) { + getApp().globalData.config = rs.data.data; + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { + getApp().my_warnning("商家未设置电话", 0, th); + return false; + } + self.setData({ + store_tel: rs.data.data.store_tel, + }); + // s.confirmBox("请联系客服:" + rs.data.data.store_tel); + } + }) + } else { + self.setData({ + store_tel: t.store_tel, + }); + // s.confirmBox("请联系客服:" + t.store_tel); + }; + resolve(); + }); + }); + }, + //-------获取购物车数量---------- requestCardNum: function () { var t = this; @@ -1515,7 +1532,7 @@ Page({ b[i] = this.data.iurl + e[i]; } this.data.show_prew_img = 1; - getApp().pre_img2(b,t) + getApp().pre_img2(b, t) }, @@ -1526,16 +1543,16 @@ Page({ b[i] = this.data.iurl + e[i]; } this.data.show_prew_img = 1; - getApp().pre_img2(b,t) + getApp().pre_img2(b, t) }, previewGoodsCommentImgs: function (t) { var e = this, a = this.data.data.comment[t.currentTarget.dataset.cidx].img; - getApp().globalData.no_clear=1; + getApp().globalData.no_clear = 1; a = a.map(function (t) { return e.data.url + t; - }), getApp().pre_img2(a,t); + }), getApp().pre_img2(a, t); this.data.show_prew_img = 1; }, closePromModal: function () { @@ -1550,19 +1567,20 @@ Page({ }, //--点击分享事件--- - onShareAppMessage: function (t) { getApp().globalData.no_clear=1; + onShareAppMessage: function (t) { + getApp().globalData.no_clear = 1; var th = this; - var price = th.data.pre_arr.presell_price; + var price = th.data.pre_arr.presell_price; var img = th.data.data.original_img; - var title = th.data.presellForm.share_title; + var title = th.data.presellForm.share_title; if (!title) title = th.data.prom_act.title; if (th.data.prom_type == 4) title = th.data.prom_act.name; //if (th.data.presellForm.share_img) // img = th.data.iurl + th.data.presellForm.share_img; - var url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + th.data.gid+"&pre_id="+th.data.pre_arr.id; + var url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + th.data.gid + "&pre_id=" + th.data.pre_arr.id; if (getApp().globalData.user_id) { url += "&first_leader=" + getApp().globalData.user_id; } @@ -1580,13 +1598,13 @@ Page({ path: url, imageUrl: img, }; - + ob.title += '\n' + th.data.presellForm.share_remark; - - - console.log(ob,888); - + + console.log(ob, 888); + + return ob; }, @@ -1609,22 +1627,22 @@ Page({ //----------装载同一活动中的商品---------- async get_sku(stoid, gd, g_id, is_normal, func) { - var tt = this, arrdata = null; - var now = ut.gettimestamp(); - var rq_data={ - store_id: o.stoid, - sku: gd.sku, - more_spec: gd.more_spec, - isonsale: 1, - is_on_sale: 1, - pageSize: 500, - orderField: 'gg_ordid,goods_spec,sort', - prom_type: 8, - }; + var tt = this, arrdata = null; + var now = ut.gettimestamp(); + var rq_data = { + store_id: o.stoid, + sku: gd.sku, + more_spec: gd.more_spec, + isonsale: 1, + is_on_sale: 1, + pageSize: 500, + orderField: 'gg_ordid,goods_spec,sort', + prom_type: 8, + }; - if(tt.data.presellForm && tt.data.presellForm.id){ - rq_data.prom_id=tt.data.presellForm.id; - } + if (tt.data.presellForm && tt.data.presellForm.id) { + rq_data.prom_id = tt.data.presellForm.id; + } await getApp().request.promiseGet("/api/weshop/goods/page", { data: rq_data @@ -1755,31 +1773,31 @@ Page({ //选择了不同的规格的时候要判断是不是有活动正在进行中 async sele_spec_chech_activity() { - var prom = null, goodsinfo = this.data.sele_g, th = this; - - var all_pre_goods=th.data.all_pre_goods; - if(all_pre_goods){ - var userInfo = getApp().globalData.userInfo; - var pre_data = { store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1, goods_id: th.data.gid }; - if (userInfo) { - pre_data.user_id = userInfo.user_id; - } - await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/page", { - data: pre_data, - }).then(e => { - if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) { - all_pre_goods=e.data.data.pageData; - th.data.all_pre_goods=e.data.data.pageData; - } - }) + var prom = null, goodsinfo = this.data.sele_g, th = this; + + var all_pre_goods = th.data.all_pre_goods; + if (all_pre_goods) { + var userInfo = getApp().globalData.userInfo; + var pre_data = { store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1, goods_id: th.data.gid }; + if (userInfo) { + pre_data.user_id = userInfo.user_id; } - - var idx=all_pre_goods.findIndex(function (ele) { - return ele.goods_id==goodsinfo.goods_id; + await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/page", { + data: pre_data, + }).then(e => { + if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) { + all_pre_goods = e.data.data.pageData; + th.data.all_pre_goods = e.data.data.pageData; + } }) - var pre_arr =all_pre_goods[idx]; - th.setData({ pre_arr: pre_arr }) - th.data.prom_buy_limit=pre_arr.vip_butyqty; + } + + var idx = all_pre_goods.findIndex(function (ele) { + return ele.goods_id == goodsinfo.goods_id; + }) + var pre_arr = all_pre_goods[idx]; + th.setData({ pre_arr: pre_arr }) + th.data.prom_buy_limit = pre_arr.vip_butyqty; }, @@ -1870,7 +1888,7 @@ Page({ th.setData({ all_pick_list: e.data.data.pageData }); //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购 预售-- - if (th.data.sales_rules == 2 && !th.data.is_newsales_rules && ((th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4 && th.data.prom_type !=8 ) || is_normal == 1)) { + if (th.data.sales_rules == 2 && !th.data.is_newsales_rules && ((th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4 && th.data.prom_type != 8) || is_normal == 1)) { setTimeout(function () { th.deal_pickup_dline(e); }, 800) @@ -1906,15 +1924,15 @@ Page({ success: function (ee) { if (ee.data.code == 0) { - var check_all_cate=0; - if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0){ - for(let i in ee.data.data.pageData){ - let item=ee.data.data.pageData[i]; - if(item.is_show==1){ - check_all_cate=1;break - } - } + var check_all_cate = 0; + if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) { + for (let i in ee.data.data.pageData) { + let item = ee.data.data.pageData[i]; + if (item.is_show == 1) { + check_all_cate = 1; break + } } + } if (check_all_cate) { @@ -1923,29 +1941,29 @@ Page({ var newarr = new Array(); var qita = new Array(); - var is_del_pk=0; + var is_del_pk = 0; //----要进行门店分组-------- for (var i = 0; i < sto_arr.length; i++) { //找一下这个门店有没有在分类数组内 var find2 = 0, find2name = "", sort = 0; - is_del_pk=0; + is_del_pk = 0; for (var m = 0; m < sto_cate.length; m++) { - if (sto_arr[i].category_id == sto_cate[m].cat_id) { - if (sto_cate[m].is_show != 1) { - is_del_pk = 1; - sto_arr.splice(i, 1); - i--; - } else { - find2 = sto_cate[m].cat_id; - find2name = sto_cate[m].cat_name; - sort = sto_cate[m].sort; - is_del_pk = 0; - } - break; + if (sto_arr[i].category_id == sto_cate[m].cat_id) { + if (sto_cate[m].is_show != 1) { + is_del_pk = 1; + sto_arr.splice(i, 1); + i--; + } else { + find2 = sto_cate[m].cat_id; + find2name = sto_cate[m].cat_name; + sort = sto_cate[m].sort; + is_del_pk = 0; } + break; + } } - if(is_del_pk) continue; + if (is_del_pk) continue; if (newarr.length > 0) { var find = 0; @@ -1991,17 +2009,17 @@ Page({ } - var def_arr = new Array(); - //-- 开始就看10个门店 -- - for (var k = 0; k < 10; k++) { - if (k == sto_arr.length) break; - def_arr.push(sto_arr[k]); - } + var def_arr = new Array(); + //-- 开始就看10个门店 -- + for (var k = 0; k < 10; k++) { + if (k == sto_arr.length) break; + def_arr.push(sto_arr[k]); + } - th.setData({ - def_pickpu_list: def_arr, - pickpu_list: ee.data.data.pageData - }); + th.setData({ + def_pickpu_list: def_arr, + pickpu_list: ee.data.data.pageData + }); //门店分类要排序下 function compare(property) { return function (a, b) { @@ -2025,15 +2043,15 @@ Page({ } - var sd={ - all_sto: newarr, - is_show_sto_cat:1 - } - if(!sto_arr || sto_arr.length<=10){ - sd.is_show_sto_cat=-1; - sd.only_pk=sto_arr; - } - th.setData(sd); + var sd = { + all_sto: newarr, + is_show_sto_cat: 1 + } + if (!sto_arr || sto_arr.length <= 10) { + sd.is_show_sto_cat = -1; + sd.only_pk = sto_arr; + } + th.setData(sd); } else { th.setData({ @@ -2382,21 +2400,21 @@ Page({ } } else { - //活动已结束,全部设置为'00' - obj = { - day: '00', - hou: '00', - min: '00', - sec: '00' - } - th.setData({ - prom_time_text: '活动已经结束:', - prom_st: 3 - }) - th.setData({ - djs: obj - }); - return false; + //活动已结束,全部设置为'00' + obj = { + day: '00', + hou: '00', + min: '00', + sec: '00' + } + th.setData({ + prom_time_text: '活动已经结束:', + prom_st: 3 + }) + th.setData({ + djs: obj + }); + return false; } @@ -2410,56 +2428,56 @@ Page({ //-------------获取购买数量的总函数---------------- - get_buy_num: function (gd, func) { - var map = this.data.g_buy_num, - th = this, - user_id = getApp().globalData.user_id; - if (user_id == null) { - map.set(gd.goods_id, 0); + get_buy_num: function (gd, func) { + var map = this.data.g_buy_num, + th = this, + user_id = getApp().globalData.user_id; + if (user_id == null) { + map.set(gd.goods_id, 0); + th.setData({ + g_buy_num: map, + prom_buy_num: 0, + }); + "function" == typeof func && func(); + return false; + } + + if (map.has(gd.goods_id)) { + "function" == typeof func && func(); + } else { + //----获取商品购买数---- + getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { + data: { + store_id: os.stoid, + user_id: user_id, + goods_id: gd.goods_id, + }, + success: function (t) { + if (t.data.code == 0) { + var g_buy_num = t.data.data.goodsbuynum; + map.set(gd.goods_id, g_buy_num); th.setData({ - g_buy_num: map, - prom_buy_num: 0, + g_buy_num: map, }); - "function" == typeof func && func(); - return false; - } - - if (map.has(gd.goods_id)) { - "function" == typeof func && func(); - } else { - //----获取商品购买数---- - getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { - data: { - store_id: os.stoid, - user_id: user_id, - goods_id: gd.goods_id, - }, - success: function (t) { - if (t.data.code == 0) { - var g_buy_num = t.data.data.goodsbuynum; - map.set(gd.goods_id, g_buy_num); - th.setData({ - g_buy_num: map, - }); - getApp().request.get("/api/weshop/order/orderPresell/countBuyGoodsSum",{ - data: {store_id: os.stoid, user_id: user_id, goods_id: gd.goods_id, prom_id: gd.prom_id}, - success: function (e) { - if (e.data.code == 0) { - th.setData({prom_buy_num: e.data.data.sumgoodsnum}) - "function" == typeof func && func(); - } else { - th.setData({prom_buy_num: 0,}) - "function" == typeof func && func(); - } - - } - }); - - } + getApp().request.get("/api/weshop/order/orderPresell/countBuyGoodsSum", { + data: { store_id: os.stoid, user_id: user_id, goods_id: gd.goods_id, prom_id: gd.prom_id }, + success: function (e) { + if (e.data.code == 0) { + th.setData({ prom_buy_num: e.data.data.sumgoodsnum }) + "function" == typeof func && func(); + } else { + th.setData({ prom_buy_num: 0, }) + "function" == typeof func && func(); } + + } }); + + } } - }, + }); + } + }, //--拼单推荐的显示--- tj_Click: function (e) { @@ -2471,7 +2489,7 @@ Page({ //-------跳转pt商品------- go_to_nopay: function () { - var th =this,url = "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id; + var th = this, url = "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id; getApp().goto(url); }, @@ -2615,7 +2633,18 @@ Page({ wx.hideLoading(); quan_list = res.data.data.pageData; }) - + //过滤不是本商品的单品优惠券 + if (quan_list.length > 0) { + let goodInfo = th.data.data + for (let index = quan_list.length - 1; index >= 0; index--) { + if (quan_list[index].useobjecttype == 20) { //判断是单品优惠券 + if (quan_list[index].useobjectno != goodInfo.goods_sn) { + quan_list.splice(index, 1) + } + } + } + } + //------------------------ if (quan_list) { for (var ind in quan_list) { var ep = quan_list[ind]; @@ -2712,7 +2741,13 @@ Page({ } }) }, - + saveImageFn(){ + if(this.data.share_b_img){ + this.saveImageToPhotosAlbum() + }else{ + this.saveImageToPhotosAlbumDef() + } + }, //--定义的保存图片方法,分享团--- saveImageToPhotosAlbum: function () { //--先判断会员状态-- @@ -2894,7 +2929,25 @@ Page({ //share_goods_img?share_goods_img:th.data.data.share_goods_img; //---中间大图--- context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); + //---自定义海报 产品质量保证 + if(th.data.poster.show_quality==1 ){ + 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) @@ -3020,8 +3073,609 @@ Page({ } }); }, + //--定义的保存图片方法,分享团--- + saveImageToPhotosAlbumDef: 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: '/packageE/pages/togoin/togoin',}) + return false; + } + + if (this.data.share_hidden) { + this.setData({share_hidden: false,}); + }; + + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 + var type = this.data.prom_type; + console.log('商品类型-----'); + console.log(type); + // if (type == 2) type = -1; + if (type == 4) type = 0; + if (type == 8) type = 0; + if (type == 2) type = 0; + if (type == 6) type = 2; // 6拼团 2团购 + if (type == 10) type = -1; + + + if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; + console.log('商品类型。。。。。'); + console.log(type); + wx.showLoading({title: '生成中...',}) + var that = this, th = that; + //设置画板显示,才能开始绘图 + that.setData({ + canvasHidden: false + }) + + var app = getApp(); + var unit = that.data.screenWidth / 750 * 1.35; //基础单位, + var path2 = that.data.data.original_img; + var scene = th.data.gid + ""; + scene += "." + th.data.sele_g.prom_type + "." + th.data.sele_g.prom_id; + + var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; + if (user_id > 0) { + scene += "_" + user_id; + } + //-- 如果不是会员分享过来的要分享给别人 -- + if (getApp().globalData.room_id && th.data.data.goods_id == getApp().globalData.room_goods_id && !getApp().globalData.room_user_share) { + //固定房间是第3个字符 + if (!user_id) scene += "_0"; + scene += "_" + getApp().globalData.room_id; + } + + ///二微码 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + + os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/presell/goodsInfo/goodsInfo"; + + console.log(path3); + // 读取文件成功则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); + console.log('海报类型-----') + console.log(type); + + if ( !th.data.share_b_img && (type == 0 || type == 1 || type == 2 || type == 3 )){ // 如果是普通商品,绘制新海报 + th.drawPoster(context, unit, th.data.share_goods_img, vpath, type); + } else { + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); + // 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, 136 * unit, 136 * unit); + // th.drawPoster(context, unit, th.data.share_goods_img, vpath); + }; + + // th.drawPoster(context, unit, th.data.share_goods_img, vpath); + + + //-- 是自定义海报的情况下 -- + if (th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) { + + 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); + + //context.setFillStyle("black") + //context.setFontSize(24 * unit) + //context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * 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, 75 * unit); + } + + }; + + + var share_title = th.data.data.goods_name; + if (th.data.prom_type == 1 || th.data.prom_type == 2 || th.data.prom_type == 6 || th.data.prom_type == 4) { + share_title = th.data.prom_act.share_title; + if (!share_title) share_title = th.data.prom_act.title; + if (th.data.prom_type == 4) share_title = th.data.prom_act.name; + } + + //---产品名称--- + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 + if (th.data.share_b_img || (type != 4 && type != 0 && type != 1 && type != 2 && type != 3)) { + context.setFillStyle("black"); + context.setFontSize(21.3 * unit) + getApp().draw_Text(context, share_title, + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); + + //------产品的价格------- + context.setFontSize(23 * unit) + context.setFillStyle("red") + + var pri0 = th.data.data.shop_price; + if (th.data.card_field && th.data.data[th.data.card_field]) { + pri0 = th.data.data[th.data.card_field]; + } + + if (th.data.prom_act) + pri0 = th.data.prom_price; + pri0 = parseFloat(pri0).toFixed(2); + var wd1 = th.data.screenWidth - ut.measureText(pri0, 31 * unit) - 25; + context.fillText("¥", wd1 - 15, 185 * unit); + context.setFontSize(31 * unit) + context.fillText(pri0, wd1, 185 * unit); + + //---市场价划掉--- + /*-- + context.setFillStyle("gray") + context.setFontSize(22 * unit) + pri0 = "¥" + th.data.data.market_price.toFixed(2); + var wd2 = th.data.screenWidth - ut.measureText(pri0, 22 * unit) - 25; + context.fillText(pri0, wd2, 213 * unit); + + context.setStrokeStyle('gray'); + context.setLineWidth(1 * unit); + context.moveTo(wd2 - 5, 206 * unit); + context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit); + context.stroke();--*/ + + } else if ( ( type == 4 && type != 0 && type != 1 && type != 2 && type != 3)) { + context.setFillStyle("black"); + context.setFontSize(21.3 * unit) + getApp().draw_Text(context, share_title, + 38 * unit, 170 * unit, 20 * unit, 300 * unit, unit); + //------ 产品的价格 ----- + var pri0 = th.data.prom_act.addmoney; + var integral = th.data.prom_act.integral; + var text = ""; + if (integral) { + text = integral + "积分"; + } + if (pri0 && integral) { + text += "+"; + } + if (pri0) { + text += "¥" + pri0; + } + + if (!pri0 && !integral) { + text = "0积分"; + } + context.setFillStyle("red"); + context.fillText(text, 38 * unit, 235 * unit); + + } + + //---中间大图--- + if ( th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) { + context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); + } + ; + + //---自定义海报 产品质量保证 + if(th.data.share_b_img && th.data.poster.show_quality==1 ){ + 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); + + } + //-------大图后面就不一样了----------- + switch (type) { + case 0: + if(!th.data.share_b_img){ + break + } + //---画线--- + 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); + // <--- 原来end + // context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 816 * unit); + // context.setFontSize(18 * unit) + // context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 850 * unit); + //---二维吗图--- + context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); + break;//普通商品的展示 + case 4: + // 中间的几个字 + 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) + + if (type == 0 || type == -1) { + // 原来start ---> + context.setFontSize(24 * unit) + context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit); + + context.setFontSize(22 * unit) + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 806 * unit); + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit); + + } else { + context.setFontSize(24 * unit) + context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit); + context.setFontSize(22 * unit) + context.fillText("长按识别二维码", 40 * unit, 806 * unit); + context.fillText("立即开始兑换", 40 * unit, 846 * unit); + + } + + //---二维吗图--- + //-- 自定义海报 -- + if (th.data.share_b_img || 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, 136 * unit, 136 * unit); + } else { + //---二维吗图--- + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); + } + ; + + break; + case 1: //秒杀商品的展示 + if(!th.data.share_b_img){ + break + } + //---画线--- + 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.setFillStyle("black") + context.setFontSize(24 * unit) + context.fillText(th.data.sto_sele_name_1, 40 * unit, 786 * unit); + //---文字--- + context.setFontSize(22 * unit) + context.setFillStyle("black") + context.fillText("特惠好物,限时秒杀", 40 * unit, 826 * unit); + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 866 * unit); + + + //---二维吗图--- + //-- 自定义海报 -- + if (th.data.share_b_img || 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, 135 * unit, 135 * unit); + } else { + //---二维吗图--- + context.drawImage(vpath, 390 * unit, 726 * unit, 135 * unit, 135 * unit); + } + break; + + case 2: //会员团和商家团的展示 + if(!th.data.share_b_img){ + break + } + //---画线--- + context.setLineWidth(1 * unit) + context.moveTo(32 * unit, 670 * unit) + context.lineTo(520 * unit, 670 * unit) + context.stroke(); + //---文字--- + context.setFillStyle("black") + context.setFontSize(24 * unit) + context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * 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, 806 * unit); + context.setFillStyle("black") + context.font = 'normal bold 18px sans-serif'; + context.setFontSize(21.3 * unit) + context.fillText("长按识别二维码,立即参团", 40 * unit, 836 * unit); + + + //---二维吗图--- + //-- 自定义海报 -- + if (th.data.share_b_img || 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, 136 * unit, 136 * unit); + } else { + //---二维吗图--- + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); + } + break + case 3: //阶梯团的展示 + if(!th.data.share_b_img){ + break + } + //---画线--- + context.setLineWidth(1 * unit) + context.moveTo(32 * unit, 670 * unit) + context.lineTo(520 * unit, 670 * unit) + context.stroke(); + //---文字--- + context.setFillStyle("black") + context.setFontSize(24 * unit) + context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * 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("black") + context.fillText("快来和我一起拼团吧!", 40 * unit, 820 * unit); + //context.font = 'normal bold 18px sans-serif'; + context.setFontSize(21 * unit) + context.fillText("长按识别二维码,立即参团", 40 * unit, 850 * unit); + + + //-- 自定义海报 -- + if (th.data.share_b_img || 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, 136 * unit, 136 * unit); + } else { + //---二维吗图--- + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); + } + break + + + case -1: //秒杀商品的展示 + //---画线--- + context.setLineWidth(1 * unit) + context.moveTo(32 * unit, 670 * unit) + context.lineTo(520 * unit, 670 * unit) + context.stroke(); + + + context.setFillStyle("black") + context.setFontSize(24 * unit) + context.fillText(th.data.sto_sele_name_1, 40 * unit, 744 * unit); + //---文字--- + context.setFontSize(22 * unit) + context.setFillStyle("black") + context.fillText("长按识别二维码", 40 * unit, 800 * unit); + context.fillText("立即开始抢购", 40 * unit, 846 * unit); + + + //---二维吗图--- + //-- 自定义海报 -- + if (th.data.share_b_img || 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, 135 * unit, 135 * unit); + } else { + //---二维吗图--- + context.drawImage(vpath, 390 * unit, 726 * unit, 135 * unit, 135 * unit); + } + break; + + + } + + + //--- 如果是自定义海报的时候 --- + if ( th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) { + + 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; + } + + that.setData({ + showPoster: true, + }); + wx.hideLoading(); + } + }) + }, 500) + + }); + }); + }, + fail: function (res) { + console.log(res); + wx.hideLoading(); + + } + }); + }, + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) { var lineWidth = 0; @@ -3049,7 +3703,144 @@ Page({ } } }, + drawPoster(context, unit, img, vpath, type) { + // 1.灰色背景 + context.setFillStyle('#f2f1f6'); + context.rect(0, 0, 554 * unit, 899 * unit); + context.fill(); + + // 2.商城名称 + let shopName = this.data.sto_sele_name_1; + context.setTextAlign('center'); + context.setFontSize(26 * unit); + context.setFillStyle('black'); + context.fillText(shopName, 277 * unit, 60 * unit); + + // 3.推荐来源 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`; + context.setTextAlign('center'); + context.setFontSize(22 * unit); + context.setFillStyle('#96959a'); + context.fillText(fromText, 277 * unit, 105 * unit); + + // 4.海报背景 + context.setFillStyle('white'); + context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit); + + // 5.商品图片 + // 图片的x坐标 + let bg_x = 37 * unit + // 图片的y坐标 + let bg_y = 157 * unit + // 图片宽度 + let bg_w = 480 * unit + // 图片高度 + let bg_h = 474 * unit + // 图片圆角 + let bg_r = 4 + // 绘制海报背景图片圆角 + context.save() + context.beginPath() + context.arc(bg_x + bg_r, bg_y + bg_r, bg_r, Math.PI, Math.PI * 1.5) + context.arc(bg_x + bg_w - bg_r, bg_y + bg_r, bg_r, Math.PI * 1.5, Math.PI * 2) + context.arc(bg_x + bg_w, bg_y + bg_h, bg_r, 0, Math.PI * 0.5) + context.arc(bg_x, bg_y + bg_h, 0, Math.PI * 0.5, Math.PI) + context.clip() + context.drawImage(img, bg_x, bg_y, bg_w, bg_h); + context.restore(); + + // 6.强烈推荐 + let src = ''; + context.beginPath(); + if(type == 0) { // 普通 + src = '../../../../images/share/q_tj.png'; + context.drawImage(src, 54 * unit, 648 * unit, 85 * unit, 30 * unit); + context.setFontSize(16 * unit) + context.setFillStyle("white") + context.setTextAlign('left'); + context.fillText('强烈推荐', 64 * unit, 668 * unit); + }; + if(type == 1) { // 秒杀 + src = '../../../images/share/miao_share.png'; + context.drawImage(src, 54 * unit, 648 * unit, 200 * unit, 36 * unit); + context.setTextAlign('left'); + }; + if(type == 2) { // 商家和会员团 + src = '../../../images/share/ct_num.png'; + context.drawImage(src, 54 * unit, 648 * unit, 120 * unit, 30 * unit); + context.setTextAlign('left'); + + let ct_num = self.data.prom_act.ct_num; + context.setFontSize(16 * unit) + context.font = 'normal'; + context.setFillStyle("red") + if (ct_num < 10) { + context.fillText(ct_num + "人拼团", 100 * unit, 670 * unit); + } else { + context.fillText(ct_num + "人拼团", 96 * unit, 670 * unit); + } + context.setFontSize(22 * unit) + context.fillText("已拼" + self.data.prom_act.buy_num + "份", 186 * unit, 672 * unit); + }; + if(type == 3) { // 阶梯团 + let list = self.data.prom_act.ct_rylist; + for (let i = 0; i < list.length; i++) { + let item = list[i]; + let wi = i * 90 * unit; + context.font = 'normal'; + context.setTextAlign('left'); + context.setFontSize(16 * unit) + context.setFillStyle("red") + context.fillText("¥", 50 * unit + wi, 680 * unit); + context.setFontSize(22 * unit) + let pri = parseFloat(item.price).toFixed(2); + context.fillText(pri, 66 * unit + wi, 680 * unit); + context.setFillStyle("gray") + context.fillText("满" + item.rynum + "人", 50 * unit + wi, 716 * unit); + } + }; + + // 7.商品价格 + if(type != 3) { + let price = this.data.data.shop_price; + if (this.data.card_field && this.data.data[this.data.card_field]) { + price = this.data.data[this.data.card_field]; + } + if (this.data.prom_act) price = this.data.prom_price; + price = parseFloat(price).toFixed(2); + context.setFontSize(32 * unit); + context.setFillStyle('#DE1117'); + if (this.data.prom_type == 4 && this.data.prom_integral){ + context.fillText(this.data.prom_integral+'积分+¥' + price, 54 * unit, 735 * unit); + }else{ + if(this.data.prom_type ==8){ + price = this.data.presellList.presell_price + context.fillText('¥' + price, 54 * unit, 735 * unit); + }else{ + context.fillText('¥' + price, 54 * unit, 735 * unit); + } + } + + }; + + // 8.商品标题 + context.setFontSize(20 * unit); + context.setFillStyle('#898989'); + getApp().draw_Text(context, this.data.data.goods_name, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1); + + // 9.小程序码 + context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit); + context.setFontSize(16 * unit); + context.setFillStyle('#777'); + context.fillText('长按识别二维码', 378 * unit, 810 * unit); + + // 10.竖线 + context.beginPath(); + context.setFillStyle('#eee'); + context.rect(354 * unit, 670 * unit, 1 * unit, 130 * unit); + context.fill(); + }, // ----视频图片---- // 图片计数器 swiperChange: function (e) { @@ -3135,7 +3926,7 @@ Page({ tt(); return false; } - var img_url = ee.data.data.original_img; + var img_url = ee.data.data.original_img; //var img_url = ee.data.presellForm.share_img; //img_url?img_url:ee.data.data.original_img; @@ -3148,8 +3939,14 @@ Page({ tt(); }, fail: function (res) { - ee.data.share_goods_img = "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 - tt(); + //获取默认空白图 + wx.getImageInfo({ + src: ee.data.iurl + '/miniapp/images/default_g_img.gif', + success: function (res) { + ee.data.share_goods_img = res.path; //分享的图片不能用网络的 + tt(); + } + }) } }); }, @@ -3189,22 +3986,22 @@ Page({ getHistoryBuy() { let _this = this; let req_data = { - store_id: os.stoid, - goods_id: this.data.gid, - pay_status: 1, - rndid: 1 + store_id: os.stoid, + goods_id: this.data.gid, + pay_status: 1, + rndid: 1 }; getApp().request.promiseGet('/api/weshop/ordergoods/list', { - data: req_data, + data: req_data, }) - .then(res => { - if (ut.ajax_ok(res)) { - _this.setData({ - historyBuyInfo: res.data.data.pageData, - }) - } - }) -}, + .then(res => { + if (ut.ajax_ok(res)) { + _this.setData({ + historyBuyInfo: res.data.data.pageData, + }) + } + }) + }, //--调用更新阶梯团的接口-- update_jiti: function (id) { @@ -3232,8 +4029,8 @@ Page({ var bconfig = th.data.bconfig; //如果开启了,则不在选择门店 - if(this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store){ - return false; + if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) { + return false; } if (!th.data.only_pk && !th.data.def_pickpu_list) { @@ -3857,7 +4654,7 @@ Page({ onShareTimeline() { - getApp().globalData.no_clear=1; + getApp().globalData.no_clear = 1; var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; if (!store_name) store_name = getApp().globalData.setting.appName; @@ -3872,10 +4669,10 @@ Page({ }, clickShare() { - if(!getApp().globalData.user_id){ - getApp().goto("/packageE/pages/togoin/togoin"); - return false; - } + if (!getApp().globalData.user_id) { + getApp().goto("/packageE/pages/togoin/togoin"); + return false; + } this.setData({ share_hidden: true, }); }, @@ -3906,206 +4703,206 @@ Page({ }, //获取预售的信息 - async get_pre_prom(func) { - var th = this; - var presell_id = null; - var pre_arr = null; - - if (!th.data.pre_id) { - var presell_id = th.data.presell_id; - var url = "/api/weshop/marketing/marketingPresellList/list" - var rd = { - store_id: os.stoid, - presell_id: presell_id, - goods_id: th.data.gid - } - //------获取预售从表---------- - await getApp().request.promiseGet(url, { - data: rd - }).then(res => { - if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { - var arr = res.data.data[0]; - presell_id = arr.presell_id; - th.setData({ - presellList: arr, - }) - } - }) + async get_pre_prom(func) { + var th = this; + var presell_id = null; + var pre_arr = null; - } else { - //------获取预售从表---------- - await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/get/" + os.stoid + "/" + th.data.pre_id, {}).then(res => { - if (res.data.code == 0 && res.data.data) { - var arr = res.data.data; - presell_id = arr.presell_id; - th.setData({ - presellList: arr, - }) - } - }) + if (!th.data.pre_id) { + var presell_id = th.data.presell_id; + var url = "/api/weshop/marketing/marketingPresellList/list" + var rd = { + store_id: os.stoid, + presell_id: presell_id, + goods_id: th.data.gid + } + //------获取预售从表---------- + await getApp().request.promiseGet(url, { + data: rd + }).then(res => { + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { + var arr = res.data.data[0]; + presell_id = arr.presell_id; + th.setData({ + presellList: arr, + }) } + }) - if (!presell_id) { - wx.showToast({title: "未找到活动商品", icon: 'none', duration: 3000}); - ut.wx_back(); - return false; + } else { + //------获取预售从表---------- + await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/get/" + os.stoid + "/" + th.data.pre_id, {}).then(res => { + if (res.data.code == 0 && res.data.data) { + var arr = res.data.data; + presell_id = arr.presell_id; + th.setData({ + presellList: arr, + }) } + }) + } - var gnext=1; - //------获取预售主表---------- - await getApp().request.promiseGet(`/api/weshop/marketing/marketingPresellForm/get/${os.stoid}/${presell_id}`, {}).then(res => { - if (res.data.code == 0 && res.data.data) { - var act_data = res.data.data; - if (act_data.is_end) { - wx.showToast({title: "活动已经结束", icon: 'none', duration: 3000}); - setTimeout(function () { - ut.wx_back(); - }, 2000) - gnext=0; - return false; - } - if (act_data.isuse == 0) { - wx.showToast({title: "活动未启用", icon: 'none', duration: 3000}); - setTimeout(function () { - ut.wx_back(); - }, 2000) - gnext=0; - return false; - } - - var err_txt="活动定金时间已经结束"; - var end_time = act_data.end_time; - if (act_data.presell_type == 1) { - err_txt="活动时间已经结束"; - } - if (end_time < ut.gettimestamp()) { - wx.showToast({title:err_txt, icon: 'none', duration: 3000}); - setTimeout(function () { - getApp().goto("/pages/index/index/index"); - }, 2000) - gnext=0; - return false; - } - - if (act_data.presell_type == 0) { - end_time = act_data.pay_enddate; - err_txt="活动尾款时间已经结束"; - } - if (end_time < ut.gettimestamp()) { - wx.showToast({title:err_txt, icon: 'none', duration: 3000}); - setTimeout(function () { - ut.wx_back(); - }, 2000) - gnext=0; - return false; - } - - if (act_data.start_time > ut.gettimestamp()) { - wx.showToast({title:"活动还未开始", icon: 'none', duration: 3000}); - setTimeout(function () { - ut.wx_back(); - }, 2000) - gnext=0; - return false; - } + if (!presell_id) { + wx.showToast({ title: "未找到活动商品", icon: 'none', duration: 3000 }); + ut.wx_back(); + return false; + } - th.setData({ - presellForm: res.data.data, - }); - th.countDown(res.data.data.end_time) - } - }) + var gnext = 1; + //------获取预售主表---------- + await getApp().request.promiseGet(`/api/weshop/marketing/marketingPresellForm/get/${os.stoid}/${presell_id}`, {}).then(res => { + if (res.data.code == 0 && res.data.data) { + var act_data = res.data.data; + if (act_data.is_end) { + wx.showToast({ title: "活动已经结束", icon: 'none', duration: 3000 }); + setTimeout(function () { + ut.wx_back(); + }, 2000) + gnext = 0; + return false; + } + if (act_data.isuse == 0) { + wx.showToast({ title: "活动未启用", icon: 'none', duration: 3000 }); + setTimeout(function () { + ut.wx_back(); + }, 2000) + gnext = 0; + return false; + } - if(!gnext){ - return false; + var err_txt = "活动定金时间已经结束"; + var end_time = act_data.end_time; + if (act_data.presell_type == 1) { + err_txt = "活动时间已经结束"; + } + if (end_time < ut.gettimestamp()) { + wx.showToast({ title: err_txt, icon: 'none', duration: 3000 }); + setTimeout(function () { + getApp().goto("/pages/index/index/index"); + }, 2000) + gnext = 0; + return false; } - var userInfo = getApp().globalData.userInfo; - var pre_data = {store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1, prom_type: 8, prom_id: presell_id,pageSize:1000}; - if (userInfo) { - pre_data.user_id = userInfo.user_id; + if (act_data.presell_type == 0) { + end_time = act_data.pay_enddate; + err_txt = "活动尾款时间已经结束"; } - await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/page", { - data: pre_data, - }).then(e => { - if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) { - - th.data.all_pre_goods = e.data.data.pageData; - var idx = e.data.data.pageData.findIndex(function (ele) { - return ele.id == th.data.presellList.id; - }) - - pre_arr = e.data.data.pageData[idx]; - th.setData({pre_arr: pre_arr,show:1}) - th.data.prom_buy_limit = pre_arr.vip_butyqty; - } - }) - if (!pre_arr) { - wx.showToast({title: "当前会员身份不符或者时间已过期,无法参与", icon: 'none', duration: 3000}); - setTimeout(function () { - ut.wx_back(); - }, 2000) - return false; + if (end_time < ut.gettimestamp()) { + wx.showToast({ title: err_txt, icon: 'none', duration: 3000 }); + setTimeout(function () { + ut.wx_back(); + }, 2000) + gnext = 0; + return false; } - if (func) { - func(); + + if (act_data.start_time > ut.gettimestamp()) { + wx.showToast({ title: "活动还未开始", icon: 'none', duration: 3000 }); + setTimeout(function () { + ut.wx_back(); + }, 2000) + gnext = 0; + return false; } - }, - con_weixin:function () { - getApp().con_wx(this); - }, - - // 预览海报 - previewPoster() { - getApp().globalData.no_clear=1; - wx.previewImage({ - current: this.data.shareImgPath, // 当前显示图片的http链接 - urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表 - }); - }, - - - click_contact:function () { - getApp().globalData.no_clear=1; - }, - - //打开客服操作菜单 - openCS() { - // 判断会员状态 - let user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) { - wx.navigateTo({ - url: '/packageE/pages/togoin/togoin', - }) - return false; - }; - // csType/在线客服设置: - // 0关闭(如果有设置热线电话,则显示拨打热线电话)、 - // 1小程序客服、 - // 2企业微信客服 - if(this.data.sys_switch) { - let csType = this.data.sys_switch.weapp_customertype; - if(csType == 0) { - // 拨打电话号码 - this.contactService(); - } else { - this.getTel() - .then(() => { - self.setData({ - hiddenCS: false, - }); - }); - }; - }; - - }, - - //关闭客服操作菜单 - closeCS() { - this.setData({ - hiddenCS: true, - }); - }, + th.setData({ + presellForm: res.data.data, + }); + th.countDown(res.data.data.end_time) + } + }) + + if (!gnext) { + return false; + } + + var userInfo = getApp().globalData.userInfo; + var pre_data = { store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1, prom_type: 8, prom_id: presell_id, pageSize: 1000 }; + if (userInfo) { + pre_data.user_id = userInfo.user_id; + } + await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/page", { + data: pre_data, + }).then(e => { + if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) { + + th.data.all_pre_goods = e.data.data.pageData; + var idx = e.data.data.pageData.findIndex(function (ele) { + return ele.id == th.data.presellList.id; + }) + + pre_arr = e.data.data.pageData[idx]; + th.setData({ pre_arr: pre_arr, show: 1 }) + th.data.prom_buy_limit = pre_arr.vip_butyqty; + } + }) + if (!pre_arr) { + wx.showToast({ title: "当前会员身份不符或者时间已过期,无法参与", icon: 'none', duration: 3000 }); + setTimeout(function () { + ut.wx_back(); + }, 2000) + return false; + } + if (func) { + func(); + } + }, + + con_weixin: function () { + getApp().con_wx(this); + }, + + // 预览海报 + previewPoster() { + getApp().globalData.no_clear = 1; + wx.previewImage({ + current: this.data.shareImgPath, // 当前显示图片的http链接 + urls: [this.data.shareImgPath],// 需要预览的图片http链接列表 + }); + }, + + + click_contact: function () { + getApp().globalData.no_clear = 1; + }, + + //打开客服操作菜单 + openCS() { + // 判断会员状态 + let user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) { + wx.navigateTo({ + url: '/packageE/pages/togoin/togoin', + }) + return false; + }; + // csType/在线客服设置: + // 0关闭(如果有设置热线电话,则显示拨打热线电话)、 + // 1小程序客服、 + // 2企业微信客服 + if (this.data.sys_switch) { + let csType = this.data.sys_switch.weapp_customertype; + if (csType == 0) { + // 拨打电话号码 + this.contactService(); + } else { + this.getTel() + .then(() => { + self.setData({ + hiddenCS: false, + }); + }); + }; + }; + + }, + + //关闭客服操作菜单 + closeCS() { + this.setData({ + hiddenCS: true, + }); + }, }); diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.wxml b/packageC/pages/presell/goodsInfo/goodsInfo.wxml index c0d7388..9c34892 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.wxml +++ b/packageC/pages/presell/goodsInfo/goodsInfo.wxml @@ -524,7 +524,7 @@ - {{cartGoodsNum}} + 购物车 @@ -939,7 +939,7 @@ - + @@ -951,7 +951,10 @@ - + + + + diff --git a/packageC/pages/presell/pregoodsInfo/goodsInfo.js b/packageC/pages/presell/pregoodsInfo/goodsInfo.js index d72e20a..243429b 100644 --- a/packageC/pages/presell/pregoodsInfo/goodsInfo.js +++ b/packageC/pages/presell/pregoodsInfo/goodsInfo.js @@ -556,7 +556,7 @@ Page({ data: { store_id: os.stoid, type: 1, - pageSize: 3, + pageSize: 100, page: 1, is_share: 0, }, @@ -564,7 +564,25 @@ Page({ fir_quan = res1.data.data.pageData; }) } - + //过滤不是本商品的单品优惠券------------------- + if(fir_quan.length > 0 ){ + let goodInfo = ee.data.data + for (let index = fir_quan.length-1; index >= 0; index--) { + if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券 + if (fir_quan[index].useobjectno != goodInfo.goods_sn) { + fir_quan.splice(index,1) + } + } + } + } + let arr=[] + let length = fir_quan.length + if (length <= 3) { + arr=fir_quan + }else{ + arr=fir_quan.splice(0,3); + } + //--------获取视频图片--------- //--------获取视频图片--------- await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { 1: 1 @@ -580,7 +598,7 @@ Page({ is_collect: is_collect, collect_id: collect_id, categories3: categories3, - fir_quan: fir_quan, + fir_quan: arr, fir_comments: fir_com, mapurl_f_img: mapurl_f_img, mapurl: mapurl, @@ -2578,7 +2596,18 @@ Page({ wx.hideLoading(); quan_list = res.data.data.pageData; }) - + //过滤不是本商品的单品优惠券 + if (quan_list.length > 0) { + let goodInfo = th.data.data + for (let index = quan_list.length-1; index >= 0; index--) { + if (quan_list[index].useobjecttype==20) { //判断是单品优惠券 + if (quan_list[index].useobjectno != goodInfo.goods_sn) { + quan_list.splice(index,1) + } + } + } + } + //------------------------ if (quan_list) { for (var ind in quan_list) { var ep = quan_list[ind]; @@ -3115,8 +3144,14 @@ Page({ tt(); }, fail: function (res) { - ee.data.share_goods_img = "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 - tt(); + //获取默认空白图 + wx.getImageInfo({ + src: ee.data.iurl+'/miniapp/images/default_g_img.gif', + success: function(res) { + ee.data.share_goods_img = res.path; //分享的图片不能用网络的 + tt(); + } + }) } }); }, diff --git a/packageD/pages/user/coupons/coupons.js b/packageD/pages/user/coupons/coupons.js index 92104c9..680eb67 100644 --- a/packageD/pages/user/coupons/coupons.js +++ b/packageD/pages/user/coupons/coupons.js @@ -11,10 +11,10 @@ const { qrcode } = require('../../../../utils/index.js'); let _this = null; - + Page({ data: { - + iurl: getApp().globalData.setting.imghost, val:false, datet: "", dates: "", @@ -96,9 +96,47 @@ Page({ }, - + //跳转商品 + nvShop(){ + let url= '/pages/goods/goodsList/goodsList' + getApp().goto(url) + }, + //跳转商品详情 + nvShopInfo(e){ + let useobjectid = e.currentTarget.dataset.useobjectid; + //------------------------------------------------ + getApp().request.get('/api/weshop/goods/list', { + data: { + store_id: os.stoid, + erpwareid: useobjectid, + }, + success(res) { + if (res.data.code ==0) { + let good = res.data.data; + if (good.length>0) { + let item = good[0] + let url = `/pages/goods/goodsInfo/goodsInfo?goods_id=${item.goods_id}&prom_type=${item.prom_type}&prom_id=${item.prom_id}` + getApp().goto(url) + }else{ + getApp().showWarning("该商品不存在"); + } + } + } + }) - + + + // wx.reLaunch({ + // url: '/pages/goods/goodsInfo/goodsInfo', + // }) + + + + + + + //------------------------------------------------ + }, // 点击选中二维码 click: function (e) { diff --git a/packageD/pages/user/coupons/coupons.wxml b/packageD/pages/user/coupons/coupons.wxml index dae9b75..ce8691e 100644 --- a/packageD/pages/user/coupons/coupons.wxml +++ b/packageD/pages/user/coupons/coupons.wxml @@ -20,11 +20,15 @@ 包邮券 微券来源: 微信商城 - {{filter.showBtnText(currentIndex)}} + {{filter.showBtnText(currentIndex)}} - + 有效期:{{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}} 至 {{time.format_time(detail.use_end_time)}} 有效期:不限 + + + + @@ -46,15 +50,17 @@ 微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}} - {{filter.showBtnText(currentIndex)}} + {{filter.showBtnText(currentIndex)}} - + 有效期:{{detail.BeginDate==null ? " " : time.replace_time2(detail.BeginDate)}} 至 {{time.replace_time2(detail.ValidDate)}} 有效期:不限 + + - + 使用说明:{{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark1}};活动名称:{{detail.ActName}}、活动编号:{{detail.ActNo}} diff --git a/pages/user/Detailed/Detailed.js b/packageE/pages/user/Detailed/Detailed.js index 16cdf46..3109a8b 100644 --- a/pages/user/Detailed/Detailed.js +++ b/packageE/pages/user/Detailed/Detailed.js @@ -3,9 +3,9 @@ var t = getApp(), a = t.request, o = t.globalData.setting, os = o, - i = require("../../../utils/util.js"), + i = require("../../../../utils/util.js"), ut = i, - s = require("../../../utils/common.js"); + s = require("../../../../utils/common.js"); Page({ /** @@ -222,12 +222,12 @@ Page({ //开启画布 const ctx = wx.createCanvasContext('myCanvas'); //先画背景 - ctx.drawImage("../../../images/share/mackground.png", 0, 0, 554 * unit, 899 * unit); + ctx.drawImage("../../../../images/share/mackground.png", 0, 0, 554 * unit, 899 * unit); ctx.setFontSize(24 * unit); ctx.setFillStyle("rgb(0,0,0)"); ctx.fillText(nickname, 152 * unit, 76 * unit); var width = 24 * nickname.length * unit + 2 * unit; - var tj_path = "../../../images/share/q_tj.png"; + var tj_path = "../../../../images/share/q_tj.png"; ctx.drawImage(tj_path, 152 * unit + width, 54 * unit, 95 * unit, 30 * unit); ctx.setFontSize(18 * unit); ctx.setLineJoin('round'); //交点设置成圆角 diff --git a/pages/user/Detailed/Detailed.json b/packageE/pages/user/Detailed/Detailed.json index f681560..f681560 100644 --- a/pages/user/Detailed/Detailed.json +++ b/packageE/pages/user/Detailed/Detailed.json diff --git a/pages/user/Detailed/Detailed.wxml b/packageE/pages/user/Detailed/Detailed.wxml index 1518fcc..7a70cab 100644 --- a/pages/user/Detailed/Detailed.wxml +++ b/packageE/pages/user/Detailed/Detailed.wxml @@ -5,7 +5,7 @@ - {{datet}} + {{datet}} - - - - - 商家暂未设置分类 - 去逛逛 - - - + + + + + + + 商家暂未设置分类 + 去逛逛 + + + \ No newline at end of file diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 34ea947..ae82373 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -286,13 +286,16 @@ Page({ if (json_str) { var json_data = JSON.parse(json_str); + console.log('自定义海报参数-------'); + console.log(json_data); 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) { @@ -414,6 +417,7 @@ Page({ is_show_gb: 1 }); } + console.log('获取系统参数'); console.log(e); var json_d = JSON.parse(e.switch_list); ee.setData({ @@ -737,15 +741,33 @@ Page({ data: { store_id: os.stoid, type: 1, - pageSize: 3, + pageSize: 100, page: 1, is_share: 0, }, }).then(res1 => { + fir_quan = res1.data.data.pageData; }) } - + //过滤不是本商品的单品优惠券------------------- + if(fir_quan.length > 0 ){ + let goodInfo = ee.data.data + for (let index = fir_quan.length-1; index >= 0; index--) { + if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券 + if (fir_quan[index].useobjectno != goodInfo.goods_sn) { + fir_quan.splice(index,1) + } + } + } + } + let arr=[] + let length = fir_quan.length + if (length <= 3) { + arr=fir_quan + }else{ + arr=fir_quan.splice(0,3); + } //--------获取视频图片--------- await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { 1: 1 @@ -761,7 +783,7 @@ Page({ is_collect: is_collect, collect_id: collect_id, categories3: categories3, - fir_quan: fir_quan, + fir_quan: arr, fir_comments: fir_com, mapurl_f_img: mapurl_f_img, mapurl: mapurl, @@ -1841,6 +1863,7 @@ Page({ goods_price: newd.goods_price, member_goods_price: newd.goods_price, store_id: th.data.stoid, + prom_id:newd.prom_id //把活动id带上去(用于购物车失效变成有效商品) }; //---是不是从收藏夹出来的--- @@ -1853,6 +1876,7 @@ Page({ updata['guide_type'] = 0; } } + i.put("/api/weshop/cart/update", { data: updata, @@ -2268,7 +2292,7 @@ Page({ sort_store: 0, open_ind_store: open_store, }) - //--先判断会员状态-- + //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { wx.navigateTo({ @@ -2921,7 +2945,8 @@ Page({ } }) } - + console.log('活动详情------------'); + console.log(prom); //----------如果有活动,并且在进行中,就不计算线下库存--------------- var now = ut.gettimestamp(); if (prom) { @@ -3584,7 +3609,7 @@ Page({ prom_end_time: prom_end_time, prom_start_time: prom_start_time, isshow: 1, - prom_act: t.data.data + // prom_act: t.data.data }); ee.get_sto(); @@ -4765,7 +4790,18 @@ Page({ wx.hideLoading(); quan_list = res.data.data.pageData; }) - + //过滤不是本商品的单品优惠券 + if (quan_list.length > 0) { + let goodInfo = th.data.data + for (let index = quan_list.length-1; index >= 0; index--) { + if (quan_list[index].useobjecttype==20) { //判断是单品优惠券 + if (quan_list[index].useobjectno != goodInfo.goods_sn) { + quan_list.splice(index,1) + } + } + } + } + //------------------------ if (quan_list) { for (var ind in quan_list) { var ep = quan_list[ind]; @@ -4994,11 +5030,15 @@ Page({ if (this.data.card_field && this.data.data[this.data.card_field]) { price = this.data.data[this.data.card_field]; } - if (this.data.prom_act) price = this.data.prom_price; + if (this.data.prom_act) price = this.data.prom_price; price = parseFloat(price).toFixed(2); context.setFontSize(32 * unit); - context.setFillStyle('#DE1117'); - context.fillText('¥' + price, 54 * unit, 735 * unit); + context.setFillStyle('#DE1117'); + if (this.data.prom_type == 4 && this.data.prom_integral){ + context.fillText(this.data.prom_integral+'积分+¥' + price, 54 * unit, 735 * unit); + }else{ + context.fillText('¥' + price, 54 * unit, 735 * unit); + } }; @@ -5038,13 +5078,18 @@ Page({ //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 var type = this.data.prom_type; - if (type == 2) type = -1; + console.log('商品类型-----'); + console.log(type); + // if (type == 2) type = -1; + if (type == 4) type = 0; + if (type == 2) type = 0; if (type == 6) type = 2; // 6拼团 2团购 if (type == 10) type = -1; - + if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; - + console.log('商品类型。。。。。'); + console.log(type); wx.showLoading({title: '生成中...',}) var that = this, th = that; //设置画板显示,才能开始绘图 @@ -5092,19 +5137,24 @@ Page({ pg_path = th.data.share_b_img; } // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); + console.log('海报类型-----') + console.log(type); - - if (type == 0 || type == 1 || type == 2 || type == 3) { // 如果是普通商品,绘制新海报 + if ( !th.data.share_b_img && (type == 0 || type == 1 || type == 2 || type == 3 )){ // 如果是普通商品,绘制新海报 th.drawPoster(context, unit, th.data.share_goods_img, vpath, type); } else { context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); + // 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, 136 * unit, 136 * unit); + // th.drawPoster(context, unit, th.data.share_goods_img, vpath); }; - + // th.drawPoster(context, unit, th.data.share_goods_img, vpath); //-- 是自定义海报的情况下 -- - if (type != 0 && type != 1 && type != 2 && type != 3) { + if (th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) { if (th.data.poster && parseInt(th.data.poster.style) == 2) { //在线上分享人的情况下 @@ -5158,7 +5208,7 @@ Page({ //---产品名称--- //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 - if (type != 4 && type != 0 && type != 1 && type != 2 && type != 3) { + if (th.data.share_b_img || (type != 4 && type != 0 && type != 1 && type != 2 && type != 3)) { context.setFillStyle("black"); context.setFontSize(21.3 * unit) getApp().draw_Text(context, share_title, @@ -5179,6 +5229,11 @@ Page({ var wd1 = th.data.screenWidth - ut.measureText(pri0, 31 * unit) - 25; context.fillText("¥", wd1 - 15, 185 * unit); context.setFontSize(31 * unit) + // if(th.data.prom_type==4){ + // context.fillText(th.data.prom_integral+'积分'+pri0, wd1, 185 * unit); + // }else{ + // context.fillText(pri0, wd1, 185 * unit); + // } context.fillText(pri0, wd1, 185 * unit); //---市场价划掉--- @@ -5195,7 +5250,7 @@ Page({ context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit); context.stroke();--*/ - } else if (type == 4 && type != 0 && type != 1 && type != 2 && type != 3) { + } else if ( ( type == 4 && type != 0 && type != 1 && type != 2 && type != 3)) { context.setFillStyle("black"); context.setFontSize(21.3 * unit) getApp().draw_Text(context, share_title, @@ -5223,18 +5278,56 @@ Page({ } //---中间大图--- - if (type != 0 && type != 1 && type != 2 && type != 3) { + if ( th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) { context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); } ; + + //---自定义海报 产品质量保证 + if(th.data.share_b_img && th.data.poster.show_quality==1 ){ + 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); - - //-------大图后面就不一样了----------- + } + //-------大图后面就不一样了----------- switch (type) { case 0: + if(!th.data.share_b_img){ + break + } + //---画线--- + 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); + // <--- 原来end + // context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 816 * unit); + // context.setFontSize(18 * unit) + // context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 850 * unit); + //---二维吗图--- + context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); break;//普通商品的展示 case 4: - //中间的几个字 + // 中间的几个字 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"; @@ -5303,7 +5396,7 @@ Page({ //---二维吗图--- //-- 自定义海报 -- - if (th.data.poster) { + if (th.data.share_b_img || 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, 136 * unit, 136 * unit); @@ -5314,7 +5407,10 @@ Page({ ; break; - case -12: //秒杀商品的展示 + case 1: //秒杀商品的展示 + if(!th.data.share_b_img){ + break + } //---画线--- context.setLineWidth(1 * unit) context.moveTo(32 * unit, 670 * unit) @@ -5337,7 +5433,7 @@ Page({ //---二维吗图--- //-- 自定义海报 -- - if (th.data.poster) { + if (th.data.share_b_img || 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, 135 * unit, 135 * unit); @@ -5347,7 +5443,10 @@ Page({ } break; - case -2: //会员团和商家团的展示 + case 2: //会员团和商家团的展示 + if(!th.data.share_b_img){ + break + } //---画线--- context.setLineWidth(1 * unit) context.moveTo(32 * unit, 670 * unit) @@ -5383,7 +5482,7 @@ Page({ //---二维吗图--- //-- 自定义海报 -- - if (th.data.poster) { + if (th.data.share_b_img || 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, 136 * unit, 136 * unit); @@ -5392,7 +5491,10 @@ Page({ context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); } break - case -3: //阶梯团的展示 + case 3: //阶梯团的展示 + if(!th.data.share_b_img){ + break + } //---画线--- context.setLineWidth(1 * unit) context.moveTo(32 * unit, 670 * unit) @@ -5428,7 +5530,7 @@ Page({ //-- 自定义海报 -- - if (th.data.poster) { + if (th.data.share_b_img || 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, 136 * unit, 136 * unit); @@ -5459,7 +5561,7 @@ Page({ //---二维吗图--- //-- 自定义海报 -- - if (th.data.poster) { + if (th.data.share_b_img || 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, 135 * unit, 135 * unit); @@ -5474,7 +5576,7 @@ Page({ //--- 如果是自定义海报的时候 --- - if (type != 0 && type != 1 && type != 2 && type != 3) { + if ( th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) { if (th.data.poster && parseInt(th.data.poster.style) == 2) { @@ -5676,8 +5778,14 @@ Page({ tt(); }, fail: function (res) { - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 - tt(); + //获取默认空白图 + wx.getImageInfo({ + src: ee.data.iurl+'/miniapp/images/default_g_img.gif', + success: function(res) { + ee.data.share_goods_img = res.path; //分享的图片不能用网络的 + tt(); + } + }) } }); }, diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index 82e49f0..9b90aa1 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -169,7 +169,7 @@ {{djs.min}} - + {{djs.sec}} @@ -264,7 +264,7 @@    ¥{{filters.toFix(data.shop_price,2)}} - + @@ -604,7 +604,7 @@ - + 领券 @@ -1034,7 +1034,7 @@ - {{cartGoodsNum}} + 购物车 diff --git a/pages/index/index/index.js b/pages/index/index/index.js index e076bd2..12e8ac3 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -14,7 +14,7 @@ var e = function (e) { var regeneratorRuntime = require('../../../utils/runtime.js'); var api = require('../../../api/api.js'); var d = getApp().globalData; - + var full_screen = require('full_screen.js'); @@ -78,7 +78,7 @@ Page({ showHongbao: false, showHongbaoSmall: false, - + goodsGroupArr:[], //商品模块列表 is_full_screen_show: 0, //全屏显示 sec_show: 3, //倒计时的秒数 full_ad: null, //全屏广告 @@ -297,8 +297,34 @@ Page({ }); } }) - }, - + }, + onReady(){ + console.log('渲染完成----') + console.log(this.data.template_arr); + console.log('....................'); + }, + + //获取商品模块实例 + newGoodsGroup(){ + let arr=[] + if (this.data.template_arr.length == 0) { + return + } + this.data.template_arr.map((item,index)=>{ + if (item.ename == 'goodsGroup') { + arr.push(`goodsGroup${index}`) + } + }) + if (arr.length > 0) { + this.setData({ + goodsGroupArr : arr + }) + arr.map(item=>{ + let a = '.'+item + this[item] = this.selectComponent(a); + }) + } + }, //关闭新用户领取广告 close_disgraceful: function () { @@ -523,13 +549,17 @@ Page({ if (data && data.length > 0) { var temp_data = data[0]; var t_arr = JSON.parse(temp_data.json_str); - + console.log('商品列表------------1') + console.log(t_arr) + console.log('商品列表------------2') th.setData({ template_arr: t_arr, isTemplate: 1, bgcolor_t: temp_data.bkcolor - }); - + }); + setTimeout(()=>{ + th.newGoodsGroup() + },1000) //---如果有设定顶部的颜色的时候-- if (temp_data.top_color && temp_data.top_color != 'null') { @@ -723,6 +753,8 @@ Page({ }, //---加载更多是靠这个函数---- onReachBottom: function () { + console.log('下拉加载2'); + var goods_list = this.selectComponent("#goods_list"); //组件的id if (goods_list) goods_list.get_list(); @@ -731,7 +763,17 @@ Page({ let item = getApp().globalData.func_list[i]; item.re_show(); } - } + } + + + //自定义时商品自动加载更多 + let goodsGroupArr = this.data.goodsGroupArr + if (this.data.isTemplate && goodsGroupArr.length >0) { + goodsGroupArr.map(item=>{ + this[item].automore() + }) + } + }, onPullDownRefresh: function (e) { @@ -1226,8 +1268,26 @@ Page({ getApp().goto(url); }, - - + //视频号跳转 + nv_void(){ + // getApp().openChannelsActivity() + wx.getChannelsLiveInfo({ + finderUserName:'sphYA5FuPCZxHaw', + success:(res)=>{ + console.log(res) + }, + fail:(error)=>{ + console.log(error) + } + }) + }, + getchir(){ + const child = this.selectComponent('.goodsg'); + console.log('子组件--------111111------') + console.log(child) + console.log('子组件----------2222----') + + }, }); diff --git a/pages/index/index/index.json b/pages/index/index/index.json index e3ab55c..5cc0ca5 100644 --- a/pages/index/index/index.json +++ b/pages/index/index/index.json @@ -26,5 +26,6 @@ "mp-dialog": "weui-miniprogram/dialog/dialog", "mp-sticky": "/components/mp-sticky/mp-sticky" }, - "enablePullDownRefresh": false + "enablePullDownRefresh": false, + "onReachBottomDistance":300 } \ No newline at end of file diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml index e4d74d2..182b918 100644 --- a/pages/index/index/index.wxml +++ b/pages/index/index/index.wxml @@ -209,7 +209,7 @@ - + @@ -375,7 +375,7 @@ - + @@ -392,7 +392,14 @@ - + + + + + + + + @@ -410,7 +417,7 @@ - + diff --git a/pages/team/team_success/team_success.js b/pages/team/team_success/team_success.js index 81cf88e..945c203 100644 --- a/pages/team/team_success/team_success.js +++ b/pages/team/team_success/team_success.js @@ -794,8 +794,14 @@ Page({ tt(); }, fail: function (res) { - ee.data.share_img_localpath= "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 - tt(); + //获取默认空白图 + wx.getImageInfo({ + src: os.imghost+'/miniapp/images/default_g_img.gif', + success: function(res) { + ee.data.share_img_localpath = res.path; //分享的图片不能用网络的 + tt(); + } + }) } }); }, diff --git a/pages/template/index.js b/pages/template/index.js index 2c7e9c2..f8b6b28 100644 --- a/pages/template/index.js +++ b/pages/template/index.js @@ -11,7 +11,8 @@ var t = getApp(), Page({ data: { url: os.imghost, - temp_id:0, + temp_id:0, + goodsGroupArr:[] }, onLoad: function(e) { @@ -46,7 +47,27 @@ Page({ } }, - + //获取商品模块实例 + newGoodsGroup(){ + let arr=[] + if (this.data.template_arr.length == 0) { + return + } + this.data.template_arr.map((item,index)=>{ + if (item.ename == 'goodsGroup') { + arr.push(`goodsGroup${index}`) + } + }) + if (arr.length > 0) { + this.setData({ + goodsGroupArr : arr + }) + arr.map(item=>{ + let a = '.'+item + this[item] = this.selectComponent(a); + }) + } + }, //当隐藏的时候就关闭计时器 onHide: function() { @@ -70,6 +91,9 @@ Page({ isTemplate: 1, bgcolor_t: temp_data.bkcolor }); + setTimeout(()=>{ + th.newGoodsGroup() + },1000) //---如果有设定顶部的颜色的时候-- if(temp_data.top_color && temp_data.top_color!='null' ){ @@ -156,6 +180,14 @@ Page({ item.re_show(); } } + + //自定义时商品自动加载更多 + let goodsGroupArr = this.data.goodsGroupArr + if (this.data.isTemplate && goodsGroupArr.length >0) { + goodsGroupArr.map(item=>{ + this[item].automore() + }) + } }, diff --git a/pages/template/index.json b/pages/template/index.json index c8f5ff7..dca47df 100644 --- a/pages/template/index.json +++ b/pages/template/index.json @@ -22,5 +22,6 @@ "scan": "/components/diy_scan/diy_scan", "presell": "/components/diy_pregoods/diy_pregoods" }, - "enablePullDownRefresh": false + "enablePullDownRefresh": false, + "onReachBottomDistance":300 } \ No newline at end of file diff --git a/pages/template/index.wxml b/pages/template/index.wxml index 405353f..0c62bce 100644 --- a/pages/template/index.wxml +++ b/pages/template/index.wxml @@ -15,7 +15,7 @@ - + diff --git a/pages/user/assistance/task_assistance.wxml b/pages/user/assistance/task_assistance.wxml index 045baf7..f2a12b8 100644 --- a/pages/user/assistance/task_assistance.wxml +++ b/pages/user/assistance/task_assistance.wxml @@ -59,6 +59,12 @@ style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};"> 好友拆一拆 + + + 立即兑换 diff --git a/pages/user/cardinfo/cardinfo.js b/pages/user/cardinfo/cardinfo.js index 20fb5be..2492876 100644 --- a/pages/user/cardinfo/cardinfo.js +++ b/pages/user/cardinfo/cardinfo.js @@ -673,7 +673,7 @@ Page({ tt(); }, fail: function (res) { - ee.data.head_pic = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 + ee.data.head_pic = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 tt(); } }); @@ -707,7 +707,7 @@ Page({ to_user_money:function(){ //提现小于0的值也不提现 if(!this.data.free.VIPRebate || parseFloat(this.data.free.VIPRebate)<=0){ - getApp().my_warnning("您目前没有可提现的金额",0,th); return false; + getApp().my_warnning("您目前没有可提现的金额",0,this); return false; } this.setData({yu_e_show:1}) }, diff --git a/pages/user/cardinfo/cardinfo.wxml b/pages/user/cardinfo/cardinfo.wxml index 2341d85..e54425a 100644 --- a/pages/user/cardinfo/cardinfo.wxml +++ b/pages/user/cardinfo/cardinfo.wxml @@ -1,5 +1,4 @@ - @@ -63,7 +62,7 @@ - 明细 + 明细 转到余额 diff --git a/pages/user/get_user_info/get_user_info.js b/pages/user/get_user_info/get_user_info.js deleted file mode 100644 index 827f65c..0000000 --- a/pages/user/get_user_info/get_user_info.js +++ /dev/null @@ -1,25 +0,0 @@ -var e = getApp(); - -e.request; - -Page({ - data: { - url: e.globalData.setting.url, - resourceUrl: e.globalData.setting.resourceUrl, - requestData: null - }, - onLoad: function() {}, - onShow: function() {}, - bindGetUserinfo: function(t) { - if (void 0 != t.detail.userInfo) try { - wx.setStorageSync("wx_user_info", t.detail.encryptedData), e.globalData.wechatUser = t.detail.userInfo, - e.auth.login(e.globalData.code, t.detail, function(t) { - e.showSuccess("登录成功", function() { - wx.navigateBack(); - }); - }); - } catch (e) { - console.log(e); - } else console.log("bindGetUserinfo fail . res.detail.userInfo is undefined"); - } -}); \ No newline at end of file diff --git a/pages/user/get_user_info/get_user_info.json b/pages/user/get_user_info/get_user_info.json deleted file mode 100644 index 78e2c5d..0000000 --- a/pages/user/get_user_info/get_user_info.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "navigationBarTitleText": "登录" -} \ No newline at end of file diff --git a/pages/user/get_user_info/get_user_info.wxml b/pages/user/get_user_info/get_user_info.wxml deleted file mode 100644 index ffbf8ab..0000000 --- a/pages/user/get_user_info/get_user_info.wxml +++ /dev/null @@ -1,6 +0,0 @@ - - - 请先登录, 以便操作更多功能 - - 返回首页 - diff --git a/pages/user/get_user_info/get_user_info.wxss b/pages/user/get_user_info/get_user_info.wxss deleted file mode 100644 index 9cbd46c..0000000 --- a/pages/user/get_user_info/get_user_info.wxss +++ /dev/null @@ -1,159 +0,0 @@ -page { - background-color: #fff; -} - -.container { - display: flex; - height: 100%; - align-items: center; - justify-content: center; - background-color: #fff; - padding-bottom: 100rpx; -} - -.login-in { - width: 100%; - box-sizing: border-box; -} - -.order-item { - display: flex; - justify-content: space-around; - height: 200rpx; - padding: 10rpx 0; - border-bottom: 1px solid #ddd; -} - -.goods-ico { - display: flex; - align-items: center; -} - -.goods-img { - width: 180rpx; - height: 180rpx; - font-size: 0; - margin-top: 10rpx; -} - -.goods-cont { - position: relative; - width: 430rpx; - height: 200rpx; - font-size: 28rpx; -} - -.goods-name { - width: 370rpx; - height: 64rpx; - margin: 8rpx 0; - line-height: 32rpx; - color: #333; -} - -.goods-attribute { - max-height: 52rpx; - line-height: 26rpx; - font-size: 24rpx; - color: #999; -} - -.goods-price { - height: 40rpx; - line-height: 40rpx; - margin-top: 10rpx; -} - -.btn-del { - position: absolute; - right: 0; - top: 8rpx; - width: 34rpx; - height: 34rpx; -} - -.count { - position: absolute; - right: 0; - bottom: 5rpx; - width: 156rpx; - height: 50rpx; - border: 1px solid #ddd; -} - -.count>view,.count>input { - float: left; - width: 50rpx; - height: 50rpx; - line-height: 50rpx; - text-align: center; -} - -.sub { - border-right: 1px solid #ddd; -} - -.add { - border-left: 1px solid #ddd; -} - -.pay-for { - width: 100%; - height: 100rpx; - position: fixed; - left: 0; - bottom: 0; - font-size: 28rpx; - color: #666; - background-color: #f0f2f5; -} - -.pay-for .pay-btn { - float: right; - width: 200rpx; - height: 100rpx; - line-height: 100rpx; - text-align: center; - background-color: #f23030; - color: #fff; - border-radius: 0; -} - -.pay-for .consumer { - float: right; - margin-right: 20rpx; - line-height: 50rpx; -} - -.pay-for .checkbox { - float: left; - padding-left: 40rpx; - line-height: 100rpx; - display: flex; - align-items: center; -} - -.pay-for .ico-check { - display: flex; - align-items: center; - margin-right: 20rpx; -} - -.getuse_info { - width: 60%; - background-color: #ff354d; - color: #fff; - border: none; - border-radius: 8rpx; -} - -.similer { - margin: 0 auto; - margin-top: 20px; - width: 60%; - height: 64rpx; - line-height: 64rpx; - font-size: 28rpx; - border-radius: 8rpx; - border: 1px solid #999; -} \ No newline at end of file diff --git a/pages/user/index/index.js b/pages/user/index/index.js index 9e8a4df..569a443 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -711,7 +711,7 @@ Page({ url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id); break; case "02": - getApp().goto("/pages/user/user_fw/user_fw?gradeId=" + th.data.gradeId + "&FormId=" + item.Id); + getApp().goto("/packageE/pages/user/user_fw/user_fw?gradeId=" + th.data.gradeId + "&FormId=" + item.Id); break; case "03": getApp().goto("/pages/user/user_spsy/user_spsy?img=" + diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index 1174760..95de390 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -10,7 +10,7 @@ var t = function(t) { oo = e.globalData, r = e.request, rq = r, - a = require("../../../utils/common.js"), + a = require("../../../utils/common.js"), s = new t.default(); var regeneratorRuntime = require('../../../utils/runtime.js'); var ut= require('../../../utils/util.js'); @@ -481,6 +481,45 @@ Page({ } }); }, + //-----删除订单----- + deleteSerOrderData: function(t) { + var th = this; + var order_id = t.currentTarget.dataset.orderid; + let order_sn = t.currentTarget.dataset.ordersn; + var index = t.currentTarget.dataset.index; + // var up_data={order_id: order_id,isdel:1}; + // var order=th.data.orderList[index]; + // if(order.order_status!=6){ + // up_data.order_status=5; + // } + wx.showModal({ + title: "是否删除订单?", + success: function(tt) { + tt.confirm && rq.put("/api/weshop/recharge/update", { + data: { + store_id: os.stoid, + order_id: order_id, + order_sn: order_sn, + order_status: 5, + }, + success: function(t) { + let cardList = th.data.cardList + cardList.splice(index,1) + th.setData({ + cardList + }) + // for (var e = 0; e < th.data.orderList.length; e++) + // if (th.data.orderList[e].order_id == order_id) { + // th.data.orderList.splice(e, 1), th.setData({ + // orderList: th.data.orderList + // }); + // break; + // } + } + }) + } + }); + }, deleteOrderData2: function(order_id) { var th = this; diff --git a/pages/user/order_list/order_list.wxml b/pages/user/order_list/order_list.wxml index d1c347d..dd0a79d 100644 --- a/pages/user/order_list/order_list.wxml +++ b/pages/user/order_list/order_list.wxml @@ -73,8 +73,12 @@ 待发货 待收货 - 待评价 - 已评价 + 待评价 + + + 已评价 + + 已取消 @@ -90,8 +94,12 @@ 未支付 待发货 待收货 - 待评价 - 已评价 + 待评价 + + + 已评价 + + 已取消 @@ -103,8 +111,12 @@ 待发货 待收货 - 待评价 - 已评价 + 待评价 + + + 已评价 + + 已取消 @@ -294,9 +306,15 @@ 待支付 - 待评价 - 已评价 - 已取消 + 待评价 + + + 已评价 + + + 已取消 + + 已作废 @@ -367,7 +385,7 @@ 取消订单 - + 订单详情 diff --git a/pages/user/userqy/userqy.js b/pages/user/userqy/userqy.js index 58789d0..f0f6af4 100644 --- a/pages/user/userqy/userqy.js +++ b/pages/user/userqy/userqy.js @@ -197,7 +197,7 @@ Page({ +url+"&gradeId="+th.data.gradeId+"&FormId="+item.Id); break; case "02": - getApp().goto("/pages/user/user_fw/user_fw?gradeId="+th.data.gradeId+"&FormId="+item.Id); + getApp().goto("/packageE/pages/user/user_fw/user_fw?gradeId="+th.data.gradeId+"&FormId="+item.Id); break; case "03": getApp().goto("/pages/user/user_spsy/user_spsy?img="+url+"&gradeId="+th.data.gradeId+"&FormId="+item.Id); diff --git a/utils/auth.js b/utils/auth.js index f5bf325..7dc9db5 100644 --- a/utils/auth.js +++ b/utils/auth.js @@ -269,7 +269,7 @@ module.exports = { }, goGetUserInfo: function() { wx.navigateTo({ - url: "/pages/user/get_user_info/get_user_info" + url: "/packageE/pages/togoin/togoin" }); } }; diff --git a/utils/wxParse/wxParse.wxss b/utils/wxParse/wxParse.wxss index 11f43ac..8a56072 100644 --- a/utils/wxParse/wxParse.wxss +++ b/utils/wxParse/wxParse.wxss @@ -178,6 +178,7 @@ view.wxParse view{ .wxParse-li-text { align-items: center; line-height: 20px; + position: relative; } .wxParse-li-circle {