From d2dc5dfc3c08e1e538f3ec2ca40a4025f807d695 Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Wed, 30 Dec 2020 09:21:12 +0800 Subject: [PATCH] 1 直播分享的优化 2 预存的充值的过期显示 3 自定义组件商品分组,视频本地上传的功能,扫一扫的组件 4 秒杀列表,拼单列表的广告,礼包的广告 5. 积分0积分的时候的优化 --- components/diy_goodsGroup/diy_goodsGroup.js | 16 ++++++++++------ components/diy_goodsGroup/diy_goodsGroup.wxml | 6 ++++-- components/diy_video/diy_video.js | 15 +++++++++++++-- components/diy_video/diy_video.wxml | 2 +- packageA/pages/chongzhi/chongzhi.wxml | 1 + packageA/pages/liveStreamDetails/liveStreamDetails.js | 23 ++++++++++++++++++++++- pages/activity/pind_list/pind_list.js | 20 +++++++++++++++++++- pages/activity/pind_list/pind_list.wxml | 9 +++++++-- pages/activity/seckill_list/seckill_list.js | 19 +++++++++++++++++++ pages/activity/seckill_list/seckill_list.wxml | 8 ++++++-- pages/giftpack/buygiftpack/giftpackbuy.js | 34 ++++++++++++++++++++++++++++++++++ pages/giftpack/buygiftpack/giftpackbuy.wxml | 17 +++++++++++++---- pages/giftpack/buygiftpack/giftpackbuy.wxss | 2 +- pages/giftpack/giftpacklist/giftpacklist.js | 9 +++++++-- pages/giftpack/mygiftpack/mygiftpack.js | 18 ++++++++++++++++++ pages/giftpack/mygiftpack/mygiftpack.wxml | 19 ++++++++++++++----- pages/giftpack/mygiftpack/mygiftpack.wxss | 2 +- pages/goods/goodsInfo/buy_integral.wxml | 1 + pages/goods/goodsInfo/goodsInfo.js | 3 ++- pages/goods/goodsInfo/goodsInfo.wxml | 5 +++-- pages/index/index/index.json | 9 +++++---- pages/index/index/index.wxml | 4 ++++ pages/template/index.json | 6 ++++-- pages/template/index.wxml | 4 ++++ 24 files changed, 213 insertions(+), 39 deletions(-) diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index 9e8818a..889a03c 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -121,9 +121,13 @@ Component({ methods: { // 这里是一个自定义方法 - init: function (classstyle_id, wgroup) { + init:async function (classstyle_id, wgroup) { + + this.setData({classstyle_id:classstyle_id}) + var th = this; var g_id = this.data.g_id; + var len=this.data.firist_type_data.length; if (classstyle_id == 1) { //---手动选择的时候--- g_id = this.data.firist_type_data[th.data.firist_type_curr]; @@ -147,7 +151,7 @@ Component({ str += g_id[i].goodsid + ","; } str=str.substring(0, str.length - 1); - app.request.get("/api/weshop/goods/getgoodslistOrdby?store_id=" + os.stoid + "&goodsidlist=" + str, { + await app.request.get("/api/weshop/goods/getgoodslistOrdby?store_id=" + os.stoid + "&goodsidlist=" + str, { isShowLoading:false, success: function(res) { @@ -179,8 +183,8 @@ Component({ } //---控制有没有加载更多的按钮--- - if (th.data.firist_type_curr == th.data.firist_type_data.length) {th.setData({ goods_btn: [] }); } - else th.setData({ goods_btn: res.data}); + if (th.data.firist_type_curr >= len) {th.setData({ goods_btn: [] }); } + else th.setData({ goods_btn: [1,2]}); } } @@ -199,7 +203,7 @@ Component({ 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; - app.request.promiseGet("/api/weshop/goods/page", { + await app.request.promiseGet("/api/weshop/goods/page", { data:r_data }).then(res => { //商品地址 @@ -216,7 +220,7 @@ Component({ break; case "3": var item = {}; - app.request.promiseGet("/api/weshop/goodsGroup/pageGoodsList", { + await app.request.promiseGet("/api/weshop/goodsGroup/pageGoodsList", { data: { store_id:os.stoid , gpid: wgroup, diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxml b/components/diy_goodsGroup/diy_goodsGroup.wxml index 37b1a76..458a9e3 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.wxml +++ b/components/diy_goodsGroup/diy_goodsGroup.wxml @@ -602,14 +602,16 @@ + + - + - + diff --git a/components/diy_video/diy_video.js b/components/diy_video/diy_video.js index 75e7c98..9564a86 100644 --- a/components/diy_video/diy_video.js +++ b/components/diy_video/diy_video.js @@ -1,3 +1,7 @@ +var t = getApp(), + a = t.request, + os = t.globalData.setting; + Component({ properties: { object: { @@ -11,10 +15,17 @@ Component({ // 这里是一些组件内部数据 someData: {}, videoUrl: "", + url:os.imghost }, - ready: function () { - this.create_url(); + ready: function () { + //-- 如果是本地视频的时候 -- + if(this.properties.object.style!=2){ + //网络地址 + this.create_url(); + }else{ + this.setData({videoUrl:this.properties.object.src}); + } }, methods: { // 这里是一个自定义方法 diff --git a/components/diy_video/diy_video.wxml b/components/diy_video/diy_video.wxml index f021759..fc763f0 100644 --- a/components/diy_video/diy_video.wxml +++ b/components/diy_video/diy_video.wxml @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/packageA/pages/chongzhi/chongzhi.wxml b/packageA/pages/chongzhi/chongzhi.wxml index bc2e4ed..cf0c47c 100644 --- a/packageA/pages/chongzhi/chongzhi.wxml +++ b/packageA/pages/chongzhi/chongzhi.wxml @@ -36,6 +36,7 @@ 立即使用 + 已过期 详情 diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.js b/packageA/pages/liveStreamDetails/liveStreamDetails.js index 563ed96..24b87c4 100644 --- a/packageA/pages/liveStreamDetails/liveStreamDetails.js +++ b/packageA/pages/liveStreamDetails/liveStreamDetails.js @@ -399,13 +399,18 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un this.getSystemInfo(); var first_leader=options.first_leader; + var staffId=options.staffId; + var storageId=options.storageId; + if(first_leader){ //-- user_id代过来免登陆 -- getApp().globalData.first_leader=first_leader; //调用接口判断是不是会员 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+o.stoid+"/"+first_leader,{}).then(res=>{ if(res.data.code==0){ - getApp().globalData.guide_id=res.data.data.id; + getApp().globalData.guide_id=res.data.data.id; + getApp().globalData.staffId=staffId; + getApp().globalData.storageId=storageId; } }) } @@ -420,6 +425,22 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un that.setData({ details: obj }) + + //-- 如果是导购的时候 -- + if(getApp().globalData.guide_id && getApp().globalData.user_id){ + //报错领取记录 + var record={}; + record.storeId=os.stoid; + record.ReceiveTime=ut.formatTime(); + record.ReceiveType=7; + record.ReceiveUserId=getApp().globalData.user_id; + record.ShareStaffId=getApp().globalData.staffId; + record.ShareStorageId=getApp().globalData.storageId; + record.shareActId=details.id; + record.shareActName=details.name; + getApp().request.promiseGet.post('api/weshop/MdReceiveType/saveReceive',{data:record}).then(res=>{}) + } + // 请求主图 diff --git a/pages/activity/pind_list/pind_list.js b/pages/activity/pind_list/pind_list.js index ea1bb48..29f9906 100644 --- a/pages/activity/pind_list/pind_list.js +++ b/pages/activity/pind_list/pind_list.js @@ -14,12 +14,14 @@ Page({ timer:null, ismore:1, isshow:0, - iurl: os.imghost, + iurl: os.imghost, + ad_data:null, }, //------初始化加载---------- onLoad: function(t) { var first_leader = t.first_leader; + var th=this; console.log("------------"); console.log(first_leader); @@ -33,6 +35,22 @@ Page({ } }) } + + getApp().request.promiseGet("/api/weshop/ad/page?pid=801&store_id=" + os.stoid, { + data: { + enabled: 1 + } + }).then(res => { + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ + var a = res.data.data.pageData; + var tt = { + 'ad_code': os.imghost + a[0].ad_code, + 'media_link': '', + 'ad_weapplink':a[0].ad_weapplink + }; + th.setData({ad_data:tt}); + } + }) }, onShow: function(t) { diff --git a/pages/activity/pind_list/pind_list.wxml b/pages/activity/pind_list/pind_list.wxml index 12741c4..7b197d2 100644 --- a/pages/activity/pind_list/pind_list.wxml +++ b/pages/activity/pind_list/pind_list.wxml @@ -2,8 +2,13 @@ - - + + + + + + + diff --git a/pages/activity/seckill_list/seckill_list.js b/pages/activity/seckill_list/seckill_list.js index aa6e5e0..e21f627 100644 --- a/pages/activity/seckill_list/seckill_list.js +++ b/pages/activity/seckill_list/seckill_list.js @@ -11,11 +11,13 @@ Page({ timer:null, ismore:1, //是否可以加载更多 isshow:0, + ad_data:null, }, //------初始化加载---------- onLoad: function(t) { var first_leader = t.first_leader; + var th=this; console.log("------------"); console.log(first_leader); @@ -29,6 +31,23 @@ Page({ } }) } + + getApp().request.promiseGet("/api/weshop/ad/page?pid=701&store_id=" + os.stoid, { + data: { + enabled: 1 + } + }).then(res => { + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ + var a = res.data.data.pageData; + var tt = { + 'ad_code': os.imghost + a[0].ad_code, + 'media_link': '', + 'ad_weapplink':a[0].ad_weapplink + }; + th.setData({ad_data:tt}); + } + }) + }, diff --git a/pages/activity/seckill_list/seckill_list.wxml b/pages/activity/seckill_list/seckill_list.wxml index 8de10eb..646a37e 100644 --- a/pages/activity/seckill_list/seckill_list.wxml +++ b/pages/activity/seckill_list/seckill_list.wxml @@ -2,8 +2,12 @@ - - + + + + + + diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index 7cfb105..ef114b1 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -25,6 +25,7 @@ Page({ curpage: 1, //当前分页数 pageSize: 10, //页大小 total: 0, //总数量 + ad_data:null, }, onLoad: function(options) { @@ -35,6 +36,25 @@ Page({ getStorageID: a.stoid, getUserID: d.user_id }) + + + getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, { + data: { + enabled: 1 + } + }).then(res => { + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ + var a = res.data.data.pageData; + var tt = { + 'ad_code': os.imghost + a[0].ad_code, + 'media_link': '', + 'ad_weapplink':a[0].ad_weapplink, + 'bgcolor':a[0].bgcolor, + }; + th.setData({ad_data:tt}); + } + }) + }, onShow: function() { @@ -73,6 +93,13 @@ Page({ "userId": that.getUserID, //用户ID "buyFrom": 2 }; + + //-- 分享导购要记录 -- + if(getApp().globalData.guide_id){ + json.guide_id=getApp().globalData.guide_id; + } + + var data = JSON.stringify(json); var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; getApp().request.json_post(url, json, @@ -134,6 +161,13 @@ Page({ "userId": that.getUserID, //用户ID "buyFrom": 2 }; + + //-- 分享导购要记录 -- + if(getApp().globalData.guide_id){ + json.guide_id=getApp().globalData.guide_id; + } + + var data = JSON.stringify(json); var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; getApp().request.json_post(url, json, diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxml b/pages/giftpack/buygiftpack/giftpackbuy.wxml index 0669a52..ed1d5c4 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.wxml +++ b/pages/giftpack/buygiftpack/giftpackbuy.wxml @@ -1,7 +1,16 @@ - - - - + + + + + + + + + + + + + 礼包列表 diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxss b/pages/giftpack/buygiftpack/giftpackbuy.wxss index 45f3688..4125b40 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.wxss +++ b/pages/giftpack/buygiftpack/giftpackbuy.wxss @@ -6,7 +6,7 @@ */ page { - background-color: #fb7454; + /* background-color: #fb7454; */ } .top_img { diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index 5d1f2c8..b641929 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -141,10 +141,8 @@ Page({ } - ) - }, GetBuyIntegral: function(e) { var that = this.data; @@ -175,6 +173,13 @@ Page({ "userId": d.user_id, //用户ID "buyFrom":2 }; + + //-- 分享导购要记录 -- + if(getApp().globalData.guide_id){ + json.guide_id=getApp().globalData.guide_id; + } + + var data = JSON.stringify(json); var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; getApp().request.json_post(url, json, diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js index 4cc3f63..2bd7c82 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.js +++ b/pages/giftpack/mygiftpack/mygiftpack.js @@ -25,6 +25,7 @@ Page({ curpage: 1, //当前分页数 pageSize: 10, //页大小 total: 0, //总数量 + ad_data:null, }, onLoad: function(options) { @@ -36,6 +37,23 @@ Page({ loadingType: 0, getDate: i.formatTime(new Date().getTime()) }) + + getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, { + data: { + enabled: 1 + } + }).then(res => { + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ + var a = res.data.data.pageData; + var tt = { + 'ad_code': os.imghost + a[0].ad_code, + 'media_link': '', + 'ad_weapplink':a[0].ad_weapplink, + 'bgcolor':a[0].bgcolor, + }; + th.setData({ad_data:tt}); + } + }) }, onShow: function() { diff --git a/pages/giftpack/mygiftpack/mygiftpack.wxml b/pages/giftpack/mygiftpack/mygiftpack.wxml index ff1c746..1fdc67e 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.wxml +++ b/pages/giftpack/mygiftpack/mygiftpack.wxml @@ -1,8 +1,17 @@ - - - - - + + + + + + + + + + + + + + 礼包列表 diff --git a/pages/giftpack/mygiftpack/mygiftpack.wxss b/pages/giftpack/mygiftpack/mygiftpack.wxss index 3cd1647..6418ac2 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.wxss +++ b/pages/giftpack/mygiftpack/mygiftpack.wxss @@ -235,7 +235,7 @@ } page { - background-color: rgb(250, 120, 88); + /* background-color: rgb(250, 120, 88); */ } .After_all { height: 80rpx; diff --git a/pages/goods/goodsInfo/buy_integral.wxml b/pages/goods/goodsInfo/buy_integral.wxml index 251c1d7..a49250f 100644 --- a/pages/goods/goodsInfo/buy_integral.wxml +++ b/pages/goods/goodsInfo/buy_integral.wxml @@ -11,6 +11,7 @@ {{prom_integral}}积分 + {{prom_price}}元 + 0积分 diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 5d420cd..9df4e20 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -3763,7 +3763,8 @@ Page({ 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, 215 * unit); diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index f32a9f2..cf4f050 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -235,12 +235,13 @@ - + {{prom_integral}} 积分 + - {{filters.toFix(prom_price,2)}}元 + {{filters.toFix(prom_price,2)}}元 + 0积分    零售价:¥{{data.market_price}} diff --git a/pages/index/index/index.json b/pages/index/index/index.json index 66a0ff2..63d46fb 100644 --- a/pages/index/index/index.json +++ b/pages/index/index/index.json @@ -1,5 +1,4 @@ -{ - +{ "usingComponents": { "goods_recommend":"/components/goods_list/goods_list", "nav": "/components/diy_nav/diy_nav", @@ -17,6 +16,8 @@ "assist":"/components/diy_assist/diy_assist", "picMax": "/components/diy_picMax/diy_picMax", "mvideo": "/components/diy_video/diy_video", - "service": "/components/diy_service/diy_service" - } + "service": "/components/diy_service/diy_service", + "scan": "/components/diy_scan/diy_scan" + }, + "enablePullDownRefresh": false } \ No newline at end of file diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml index 4d4ee9c..66f3926 100644 --- a/pages/index/index/index.wxml +++ b/pages/index/index/index.wxml @@ -348,6 +348,10 @@ + + + + diff --git a/pages/template/index.json b/pages/template/index.json index 1443fce..418f686 100644 --- a/pages/template/index.json +++ b/pages/template/index.json @@ -18,6 +18,8 @@ "assist":"/components/diy_assist/diy_assist", "picMax": "/components/diy_picMax/diy_picMax", "mvideo": "/components/diy_video/diy_video", - "service": "/components/diy_service/diy_service" - } + "service": "/components/diy_service/diy_service", + "scan": "/components/diy_scan/diy_scan" + }, + "enablePullDownRefresh": false } \ No newline at end of file diff --git a/pages/template/index.wxml b/pages/template/index.wxml index 0dbbeea..452f71f 100644 --- a/pages/template/index.wxml +++ b/pages/template/index.wxml @@ -57,6 +57,10 @@ + + + + -- libgit2 0.21.4