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..cd8b892 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -2444,9 +2444,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..69f769b 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); @@ -533,6 +534,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 +571,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 +655,109 @@ Page({ }, + //在启用线下的时候,要判断一下是不是有库存 + async check_pk_store_conut(func,is_no_msg,gd,by_num){ + var th=this; + if(this.data.sales_rules!=2){ + func(); + } + //门店库存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 +774,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 +1695,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,7 +2238,7 @@ 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; @@ -2127,6 +2249,8 @@ Page({ if (item.prom_id != th.data.act.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 +2268,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/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..2c13749 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -5375,8 +5375,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/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js index 357861e..0ee31fa 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.js +++ b/packageC/pages/presell/goodsInfo/goodsInfo.js @@ -2894,7 +2894,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) @@ -3148,8 +3166,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/presell/goodsInfo/goodsInfo.wxml b/packageC/pages/presell/goodsInfo/goodsInfo.wxml index c0d7388..cbcef19 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.wxml +++ b/packageC/pages/presell/goodsInfo/goodsInfo.wxml @@ -524,7 +524,7 @@ - {{cartGoodsNum}} + 购物车 diff --git a/packageC/pages/presell/pregoodsInfo/goodsInfo.js b/packageC/pages/presell/pregoodsInfo/goodsInfo.js index d72e20a..5625eb8 100644 --- a/packageC/pages/presell/pregoodsInfo/goodsInfo.js +++ b/packageC/pages/presell/pregoodsInfo/goodsInfo.js @@ -3115,8 +3115,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..4b40c14 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}} + + + + + + 商家暂未设置分类 + 去逛逛 + + - - - - + + - - - - 搜索店铺商品 - - - - - + + + + 搜索店铺商品 - - - - - - - - - 国家 - - - - - - 品牌 - - - - - - - - 项目 - - - - - - - - - - - + + + + + + + + + + + 国家 + + + + + + 品牌 + + + + + + + + 项目 + + + + + + + + + + + - - - - {{ittms.items.name}} - + + + {{ittms.items.name}} + - - - - - - - - - - - + + + + + + + + + + + - - {{ishaf_three==1?good_list.name:classify_name}} + + {{ishaf_three==1?good_list.name:classify_name}} - - - - - - - - {{bitem.name}} - - - {{bitem.enname}} - - - - - - + + + + + + + + {{bitem.name}} + + + {{bitem.enname}} + + + + + + - - + + - - - - - - - {{classify_name}} - - - {{brand_list.zm}} - - - - - {{user.name}} - - - - - - - - - - {{item.zm}} - - - - - - - - - - - - {{classify_name}} - - - - - - - - - {{item.name}} - - - - - - - 暂无项目 - - - - + + + + + + {{classify_name}} + + + {{brand_list.zm}} + + + + + {{user.name}} + + + + + + + + + + {{item.zm}} + + + + + + + + + + + + {{classify_name}} + + + + + + + + + {{item.name}} + + + + + + + 暂无项目 + + + + - - - + + + - - - {{classify_name}} - - 更多 - - + + + {{classify_name}} + + 更多 + - - - - - + + + + + + - - - - + + + + + + + + {{item.goods_name}} + + + + + + {{item.prom_integral}}积分 + + + {{item.prom_price}} + + + + + + + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + + + + + + + + + + + + {{item[card_field]}} + + + {{card_name}} + - - {{item.goods_name}} - - - - - - {{item.prom_integral}}积分 - + - {{item.prom_price}} - - - - - - - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - - - - - - - - - - - - {{item[card_field]}} - - - {{card_name}} - - - - - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - - - {{item.shop_price}} - - - - - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - - - - - - {{item.shop_price}} - - - - - {{g_filter.get_card_price(item,card_list,0)}} - - - {{g_filter.get_card_price(item,card_list,1)}} - - - - - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - - - - {{item.shop_price}} - - - - - - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - - - - - {{item.shop_price}} - - - - - - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - + + + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} - - - 暂无更多 - - - + + + + + {{item.shop_price}} + + + + + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + + + + + + {{item.shop_price}} + + + + + {{g_filter.get_card_price(item,card_list,0)}} + + + {{g_filter.get_card_price(item,card_list,1)}} + + + - - 该类别暂无推荐商品 {{countDownNum}} 秒后自动跳到下一个类别 - 该类别暂无推荐商品 - + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + + + + {{item.shop_price}} + + + + + + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + + + + + {{item.shop_price}} + + + + + + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + - - - - - - - + + + 暂无更多 + + + 上滑查看下一个分类 + + + + + + + + + 该类别暂无推荐商品 + {{countDownNum}} 秒后自动跳到下一个类别 + + 该类别暂无推荐商品 + + + + + + + + + - - - - - - - 商家暂未设置分类 - 去逛逛 - - - + + + + + + + 商家暂未设置分类 + 去逛逛 + + + \ No newline at end of file diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 34ea947..6c6eee2 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) { @@ -5038,13 +5041,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 +5100,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 +5171,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, @@ -5195,7 +5208,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 +5236,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 +5354,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 +5365,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 +5391,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 +5401,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 +5440,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 +5449,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 +5488,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 +5519,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 +5534,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 +5736,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..a9f23a8 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -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 {