diff --git a/app.json b/app.json index ab2d141..df3ae1a 100644 --- a/app.json +++ b/app.json @@ -230,7 +230,8 @@ "name": "pack6", "pages": [ "pages/wuliu/wuliu", - "pages/free_delivery/free_delivery" + "pages/free_delivery/free_delivery", + "pages/xcxServiceChat/xcxServiceChat" ] } diff --git a/components/diy_public/diy_public.js b/components/diy_public/diy_public.js index 343b329..2eadc60 100644 --- a/components/diy_public/diy_public.js +++ b/components/diy_public/diy_public.js @@ -1,7 +1,7 @@ // var e = function(e) { // return e && e.__esModule ? e : { // default: e -// }; +// }; // }(require("../../utils/LoadMore3.js")), // n = new e.default(), var t = getApp(), @@ -48,7 +48,8 @@ Component({ imgobj:{ '1':"/miniapp/images/component/seckill.png", '2':"/miniapp/images/component/pingd/pingd.png", - '6':"/miniapp/images/component/pingd/pingd.png" + '6':"/miniapp/images/component/pingd/pingd.png", + '8':"/miniapp/images/component/presale.png", }, nav1:'/packageA/pages/goodsInfo/goodsInfo?', nav2:'/pages/goods/goodsInfo/goodsInfo?', @@ -99,6 +100,13 @@ Component({ nav2:'/pages/goods/goodsInfo/goodsInfo?' }) } + if (this.data.prom_type==8) { //预售 + this.setData({ + prom_text:'已售', + nav1:'/packageC/pages/presell/goodsInfo/goodsInfo?', + nav2:'/packageC/pages/presell/goodsInfo/goodsInfo?' + }) + } var g_id = this.data.object; this.init(g_id); @@ -153,12 +161,21 @@ Component({ +os.stoid+"&aidlist="+goodsidlist + "&user_id="+user_id; } + if (th.data.prom_type==8) { //预售 + gUrl="/api/weshop/marketing/marketingPresellList/page?store_id=" + +os.stoid+"&goodsidlist="+goodsidlist + "&user_id="+user_id+'&is_end=0&timetype=3&isuse=1'; + } - app.request.promiseGet(gUrl, {}).then(res => { + app.request.promiseGet(gUrl, {}).then(res => { + //如果秒杀的数组为空的时候 var goodslist = res.data.data; + if (th.data.prom_type==8) { //预售 + goodslist = res.data.data ? res.data.data.pageData : [] + } + //就算是添加的活动已经过期,就要用最新的进行中活动 if (goodslist && goodslist.length > 0) { th.set_goods_list(g_id.data, goodslist); @@ -197,6 +214,18 @@ Component({ timetype: 2, } } + if (this.data.prom_type==8) { //预售 + gUrl="/api/weshop/marketing/marketingPresellList/page?page=1&pageSize=9" + req={ + store_id:os.stoid, + is_end:0, + timetype:3, + isuse:1, + page:1, + user_id:user_id, + pageSize:9 + } + } getApp().request.promiseGet(gUrl, { isShowLoading: 1, data:req } @@ -211,6 +240,7 @@ Component({ //就算是添加的活动已经过期,就要用最新的活动 set_goods_list(g_id, goodslist) { + let prom_type=this.data.prom_type goodslist.forEach(function (vy, indy) { if(!vy.id) vy.id=vy.prom_id; @@ -240,29 +270,30 @@ Component({ let item=all_array[i]; if(item.user_price) item.price=item.user_price; if(item.start_time > newTime) { - item.status = 0; + item.status = 0; //活动没开始 } else if(item.end_time > newTime) { - item.status = 1; + item.status = 1; // 活动进行中 }; } - var promisies = []; - for (const key in all_array) { - if (Object.hasOwnProperty.call(all_array, key)) { - const val = all_array[key]; - - promisies[key] = getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + - os.stoid + "/"+prom_type+"/" + val.id, - {} - ).then(res => { - if (res.data.code == 0) { - if (res.data.data <= 0) all_array[key].status = 2; - }; - }); - } - } + var promisies = []; + if (th.data.prom_type !=8) { + for (const key in all_array) { + if (Object.hasOwnProperty.call(all_array, key)) { + const val = all_array[key]; + promisies[key] = getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + + os.stoid + "/"+prom_type+"/" + val.id, + {} + ).then(res => { + if (res.data.code == 0) { + if (res.data.data <= 0) all_array[key].status = 2;//已售完 + }; + }); + } + } + } Promise.all(promisies).then(() => { @@ -271,10 +302,24 @@ Component({ for(let i in all_array){ let item=all_array[i]; if(newTime > item.end_time) { - all_array[i].status = 3; + all_array[i].status = 3; //活动结束 }; // let price=all_array[i].price.toFixed(2) let price=all_array[i].price + '' + if (th.data.prom_type==8) { //预售 + price = all_array[i].presell_price + '' + if (all_array[i].status ===0) { + all_array[i].goods_num=all_array[i].presell_sumqty*1 + all_array[i].virtual_qty*1 + all_array[i].buy_num=all_array[i].buy_goodnum + }else{ + all_array[i].goods_num=all_array[i].presell_sumqty*1 + all_array[i].virtual_qty*1 + all_array[i].buy_num=all_array[i].buy_goodnum + all_array[i].virtual_qty*1 + } + + + } + + if (price && price.indexOf('.') > -1) { let priceArr = price.split(".") all_array[i].price_n = priceArr[0] @@ -416,6 +461,9 @@ Component({ if (this.data.prom_type==2) { //团购 url="/packageC/pages/group_list/group_list"; } + if (this.data.prom_type==8) { //预售 + url="/packageC/pages/presell/list/list"; + } wx.navigateTo({ url diff --git a/components/diy_public/diy_public.wxml b/components/diy_public/diy_public.wxml index aa9b237..c5060cf 100644 --- a/components/diy_public/diy_public.wxml +++ b/components/diy_public/diy_public.wxml @@ -16,7 +16,7 @@ - + @@ -76,7 +76,7 @@ - + @@ -130,7 +130,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -231,7 +231,7 @@ - + @@ -422,7 +422,7 @@ - + diff --git a/components/diy_seckill/diy_seckill.js b/components/diy_seckill/diy_seckill.js index 271aa21..992772e 100644 --- a/components/diy_seckill/diy_seckill.js +++ b/components/diy_seckill/diy_seckill.js @@ -217,7 +217,28 @@ Component({ all_array[i].price_n = price } - all_array[i].residue=all_array[i].goods_num*1 - all_array[i].buy_num*1 + let virtual = all_array[i].virtual ? all_array[i].virtual : 0 + if (all_array[i].status) { + if (all_array[i].is_virtual_count ) { + // all_array[i].goods_num -= all_array[i].virtual + all_array[i].buy_num += virtual*1 + all_array[i].residue = all_array[i].goods_num*1 - all_array[i].buy_num*1 + }else{ + all_array[i].buy_num += virtual*1 + all_array[i].residue=all_array[i].goods_num*1 + virtual*1 - all_array[i].buy_num*1 + } + }else{ + if (all_array[i].is_virtual_count ) { + // all_array[i].goods_num -= all_array[i].virtual + all_array[i].buy_num = 0 + all_array[i].residue = all_array[i].goods_num*1 - all_array[i].buy_num*1 + }else{ + all_array[i].buy_num = 0 + all_array[i].residue=all_array[i].goods_num*1 + virtual*1 - all_array[i].buy_num*1 + } + } + + // all_array[i].residue=all_array[i].goods_num*1 - all_array[i].buy_num*1 if (all_array[i].residue && all_array[i].residue > 0 && all_array[i].status !=2) { empty.push(all_array[i]) } diff --git a/packageA/pages/goodsInfo/goodsInfo.wxml b/packageA/pages/goodsInfo/goodsInfo.wxml index f6ef259..431ccb4 100644 --- a/packageA/pages/goodsInfo/goodsInfo.wxml +++ b/packageA/pages/goodsInfo/goodsInfo.wxml @@ -114,7 +114,7 @@ - 总数量:{{prom_act.goods_num+prom_act.virtual}}件 + 总数量:{{prom_act.is_virtual_count ? prom_act.goods_num : (prom_act.goods_num+prom_act.virtual)}}件 限购:{{prom_act.buy_limit}}件 限购:不限 diff --git a/packageA/pages/quan_pro/quan_pro.js b/packageA/pages/quan_pro/quan_pro.js index ce95aab..2f2658e 100644 --- a/packageA/pages/quan_pro/quan_pro.js +++ b/packageA/pages/quan_pro/quan_pro.js @@ -52,6 +52,8 @@ Page({ th.setData({getcurday:ut.gettimestamp()}); var rs=await getApp().request.promiseGet("/api/weshop/prom/coupon/get/"+th.data.id, {}) + // console.error('分享请求数据'); + // console.error(rs); if(!rs){ th.setData({is_get:1}); return false; @@ -64,6 +66,17 @@ Page({ //如果只限定链接的时候,要取消分享按钮 if(r_data.is_share){ wx.hideShareMenu(); + wx.offCopyUrl() + //替换掉复制链接 + wx.onCopyUrl(() => { + setTimeout(()=>{ + wx.setClipboardData({ + data: '暂不支持分享', + success (res) { } + }) + },500) + return { query: 'a=1&b=2' } + }) } if(r_data.store_id!=os.stoid){ diff --git a/packageF/pages/xcxServiceChat/xcxServiceChat.js b/packageF/pages/xcxServiceChat/xcxServiceChat.js new file mode 100644 index 0000000..e60a7d9 --- /dev/null +++ b/packageF/pages/xcxServiceChat/xcxServiceChat.js @@ -0,0 +1,129 @@ +// packageF/pages/xcxServiceChat/xcxServiceChat.js +var t = getApp(), +a = t.request, +o = t.globalData.setting +Page({ + + /** + * 页面的初始数据 + */ + data: { + url: o.imghost, + imgUrl:'', + userinfo:{}, + window_info:{}, + imgBoxOffw:true, + imgBoxOffh:true, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + let window_info = wx.getWindowInfo() + console.error(window_info); + console.log(window_info); + this.getad() + wx.setNavigationBarTitle({ + title: '联系客服' + }) + this.setData({ + userinfo: getApp().globalData.userInfo, + window_info, + }); + + }, + //获取客服广告 + async getad(){ + //---首页广告------- + await getApp().request.promiseGet("/api/weshop/ad/page?pids=1209&store_id=" + o.stoid, { + data: {} + }).then(res => { + if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) { + let a = res.data.data.pageData[0]; + let imgUrl = this.data.url + a.ad_code + wx.getImageInfo({ + src: imgUrl, + success: res=>{ + let imgBoxOffw = true + let imgBoxOffh = true + if (res.width > this.data.window_info.screenWidth) { + imgBoxOffw = false + } + if (res.height > this.data.window_info.screenWidth) { + imgBoxOffh = false + } + + this.setData({ + imgUrl, + imgBoxOffw, + imgBoxOffh + }) + } + }) + + } + }) + }, + //联系客服 + con_weixin () { + console.log(123456); + console.log(this.data.sys_switch); + // getApp().con_wx(this); + var url=this.data.sys_switch.weapp_customertype_url; + var id=this.data.sys_switch.weapp_customertype_appid; + wx.openCustomerServiceChat({ + extInfo: {url: url}, + corpId: id, + success(res) {} + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/packageF/pages/xcxServiceChat/xcxServiceChat.json b/packageF/pages/xcxServiceChat/xcxServiceChat.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/packageF/pages/xcxServiceChat/xcxServiceChat.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/packageF/pages/xcxServiceChat/xcxServiceChat.wxml b/packageF/pages/xcxServiceChat/xcxServiceChat.wxml new file mode 100644 index 0000000..9c37cca --- /dev/null +++ b/packageF/pages/xcxServiceChat/xcxServiceChat.wxml @@ -0,0 +1,4 @@ + + diff --git a/packageF/pages/xcxServiceChat/xcxServiceChat.wxss b/packageF/pages/xcxServiceChat/xcxServiceChat.wxss new file mode 100644 index 0000000..cb765fb --- /dev/null +++ b/packageF/pages/xcxServiceChat/xcxServiceChat.wxss @@ -0,0 +1,25 @@ +/* packageF/pages/xcxServiceChat/xcxServiceChat.wxss */ + +.mainBox{ + width: 100vw; + height: 100vh; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; +} +.imgBox{ + height: 100vh; + width: 100vw; + background-position: 50%; + background-repeat: no-repeat; + background-attachment: fixed; + position: relative; + /* object-fit: contain; */ + + /* object-fit: cover; */ +} +image{ + margin: auto; +} \ No newline at end of file diff --git a/pages/activity/seckill_list/seckill_list.wxml b/pages/activity/seckill_list/seckill_list.wxml index 4a156b0..1bc8153 100644 --- a/pages/activity/seckill_list/seckill_list.wxml +++ b/pages/activity/seckill_list/seckill_list.wxml @@ -46,9 +46,9 @@ - + - 剩余{{type==1?filters.toFix(100-(item.buy_num+item.virtual)/(item.goods_num+item.virtual)*100,0):'100'}}% + 剩余{{type==1?filters.toFix(100-(item.buy_num+item.virtual)/((item.is_virtual_count ? item.goods_num : item.goods_num+item.virtual))*100,0):'100'}}% diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index b6c975f..956e0c9 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -456,7 +456,7 @@ - 总数量:{{prom_act.goods_num+prom_act.virtual}}件 + 总数量:{{prom_act.is_virtual_count ? prom_act.goods_num : (prom_act.goods_num+prom_act.virtual)}}件 限购:{{prom_act.buy_limit}}件 限购:不限 @@ -1316,7 +1316,7 @@ 已售:{{prom_act.buy_num+prom_act.virtual}} 已售:{{prom_act.buy_num}} - 可售:{{prom_act.goods_num-prom_act.buy_num}} + 可售:{{(prom_act.is_virtual_count && prom_act.virtual) ? (prom_act.goods_num - prom_act.buy_num - prom_act.virtual) : (prom_act.goods_num-prom_act.buy_num)}} diff --git a/pages/index/index/index.js b/pages/index/index/index.js index 88aae79..1083a83 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -208,8 +208,9 @@ Page({ getApp().request.promiseGet('/api/weshop/redmoney/redConfig/get/' + getApp().globalData.setting.stoid, { data: {} }).then(function (data) { - let code = data.data.code; - if (code == 0) { + let code = data.data.code; + let resdata = data.data.data; + if (code == 0 && resdata.is_index) { th.setData({ showHongbao: true, diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml index 28bb6eb..15aa246 100644 --- a/pages/index/index/index.wxml +++ b/pages/index/index/index.wxml @@ -516,6 +516,9 @@ + + + diff --git a/pages/template/index.wxml b/pages/template/index.wxml index f5ca734..4071247 100644 --- a/pages/template/index.wxml +++ b/pages/template/index.wxml @@ -69,6 +69,9 @@ + + +