diff --git a/app.json b/app.json index 98945e6..4ecc3b8 100644 --- a/app.json +++ b/app.json @@ -157,7 +157,8 @@ { "root": "packageC/", "name":"pack3", - "pages": [ + "pages": [ + "pages/group_list/group_list", "pages/presell/list/list", "pages/presell/cart/cart", "pages/presell/cart/cart2", @@ -165,7 +166,9 @@ "pages/presell/goodsInfo/goodsInfo", "pages/goods/distributionCategoryList/index", "pages/goods/goodsList/goodsList", - "pages/payForAnother/payForAnother" + "pages/payForAnother/payForAnother", + "pages/luckyGo/luckyGo_list/luckyGo_list", + "pages/luckyGo/luckyGo_details/luckyGo_details" ] } diff --git a/app.wxss b/app.wxss index 9fb42a6..2134717 100644 --- a/app.wxss +++ b/app.wxss @@ -4,6 +4,9 @@ .pdt4 { padding-top: 4rpx; } +.pdt6 { + padding-top: 6rpx; +} .pd10 { padding: 10rpx; } @@ -37,6 +40,9 @@ .pdt12 { padding-top: 12rpx; } +.pdt16 { + padding-top: 16rpx; +} .pdb10 { padding-bottom: 10rpx; } @@ -140,9 +146,7 @@ color: #c7c7c7; } -.c-7b { - color: #7b7b7b; -} + .c-d { color: #ddd; @@ -711,9 +715,9 @@ background: #ffe3e2; /* 图标字体(ty) */ @font-face { font-family: 'iconfont'; /* Project id 2054717 */ - src: url('//at.alicdn.com/t/font_2054717_xyebdzzvo1i.woff2?t=1635153304877') format('woff2'), - url('//at.alicdn.com/t/font_2054717_xyebdzzvo1i.woff?t=1635153304877') format('woff'), - url('//at.alicdn.com/t/font_2054717_xyebdzzvo1i.ttf?t=1635153304877') format('truetype'); + src: url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.woff2?t=1635844276600') format('woff2'), + url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.woff?t=1635844276600') format('woff'), + url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.ttf?t=1635844276600') format('truetype'); } .iconfont { @@ -724,6 +728,14 @@ background: #ffe3e2; -moz-osx-font-smoothing: grayscale; } +.icon-luck:before { + content: "\e621"; +} + +.icon-shizhong:before { + content: "\e74f"; +} + .icon-dingwei:before { content: "\e6b4"; } diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index ec66ad2..e34e511 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -151,6 +151,9 @@ Component({ index = 0, gdata = []; + var user_id=getApp().globalData.user_id; + if(!user_id) user_id=0; + //--初始化卡类-- th.card_init(); var os=getApp().globalData.setting; @@ -162,8 +165,10 @@ Component({ for (var i = 0; i < g_id.length; i++) { str += g_id[i].goodsid + ","; } - str=str.substring(0, str.length - 1); + str=str.substring(0, str.length - 1); + await app.request.get("/api/weshop/goods/getgoodslistOrdby?store_id=" + os.stoid + "&goodsidlist=" + str, { + data:{user_id:user_id}, isShowLoading:false, success: function(res) { th.data.loading=0; @@ -218,6 +223,10 @@ 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; + var user_id=getApp().globalData.user_id; + if(!user_id) user_id=0; + r_data.user_id=user_id; + await app.request.promiseGet("/api/weshop/goods/page", { data:r_data }).then(res => { @@ -245,6 +254,7 @@ Component({ isonsale: 1, orderField: "sort", orderType: 'asc', + user_id:user_id } }).then(res => { th.data.loading=0; diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxml b/components/diy_goodsGroup/diy_goodsGroup.wxml index 8f6347c..2c0e9bc 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.wxml +++ b/components/diy_goodsGroup/diy_goodsGroup.wxml @@ -17,10 +17,18 @@ - + + + + + + + + + + @@ -166,8 +174,20 @@ - + + + + + + + + + @@ -312,9 +332,20 @@ - - + + + + + + + + + + @@ -457,9 +488,18 @@ - - - + + + + + + + + @@ -587,12 +627,8 @@ ¥{{item.shop_price}} ¥{{item.market_price}} - - + - - - 销量:{{item.sales_sum}}件 @@ -622,17 +658,30 @@ - + - + - + + + + + + + + + - + + + diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxss b/components/diy_goodsGroup/diy_goodsGroup.wxss index 55f6a9e..0895c9f 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.wxss +++ b/components/diy_goodsGroup/diy_goodsGroup.wxss @@ -154,6 +154,10 @@ margin-left: 20rpx; } +.zs_t_img_x.zj{ border: 1rpx solid #eee;} +.zs_t_img_x.yj{ border: 1rpx solid #eee;border-radius: 18rpx;} + + .zs_center_x { width: 100%; min-height: 200rpx; @@ -727,8 +731,13 @@ swiper { .one { margin-left: 14rpx; + overflow: hidden; } +.one.zj{ border: 1rpx solid #eee;} +.one.yj{ border: 1rpx solid #eee; border-radius: 18rpx;} + + .sp .sp_top .s_top1_kill { position: absolute; background-color: #c4182e; @@ -814,5 +823,6 @@ top: 10rpx; position: absolute; right: 0rpx; bottom: 10rpx; +} -} \ No newline at end of file +.n_box{ position: absolute !important;z-index: 10} \ No newline at end of file diff --git a/components/diy_seckill/diy_seckill.js b/components/diy_seckill/diy_seckill.js index da941e7..49cea03 100644 --- a/components/diy_seckill/diy_seckill.js +++ b/components/diy_seckill/diy_seckill.js @@ -76,9 +76,12 @@ Component({ }) goodsidlist = ut.sub_last(goodsidlist); + var user_id=getApp().globalData.user_id; + if(!user_id){ user_id=0;} + //--调用接口,读取秒杀-- app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" - + os.stoid + "&goodsidlist=" + goodsidlist, {}).then(res => { + + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id"+user_id, {}).then(res => { console.log(res); //如果秒杀的数组为空的时候 var goodslist = res.data.data; @@ -118,6 +121,7 @@ Component({ g_id.forEach(function (val, ind) { goodslist.forEach(function (vy, indy) { if (val.goodsid == vy.goods_id) { + if(!vy.id) vy.id=vy.prom_id; all_array.push(vy); } }) diff --git a/components/goods_list/goods_list.wxml b/components/goods_list/goods_list.wxml index cdd2466..c505cfc 100644 --- a/components/goods_list/goods_list.wxml +++ b/components/goods_list/goods_list.wxml @@ -4,15 +4,15 @@ - - + + {{item.goods_name}} - + {{item.prom_integral}}积分 diff --git a/packageA/pages/activity_share/activity_share.js b/packageA/pages/activity_share/activity_share.js index 21f8f1a..6cdb951 100644 --- a/packageA/pages/activity_share/activity_share.js +++ b/packageA/pages/activity_share/activity_share.js @@ -167,10 +167,22 @@ Page({ if(item){ var price = item.price; if(!price) price=item.shop_price; - + switch(th.data.currentIndex){ + case 0: item.prom_type=1;break; + case 1: item.prom_type=6;break; + case 2: + if(th.data.currentIndex2==1) item.prom_type = 5; + if(th.data.currentIndex2==2) { + item.prom_type = 3; + item.id=item.prom_id; + } + break; + } + item.prom_id=item.id; + var title= item.goods_name; var img=this.data.url+item.original_img; - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id+"&prom_type="+item.prom_type+"&prom_id="+item.prom_id; if(getApp().globalData.user_id){ url+="&first_leader="+getApp().globalData.user_id; } @@ -547,7 +559,26 @@ Page({ var app = getApp(); var unit = that.data.screenWidth / 750 * 1.35; //基础单位, + + var prom_type=0; + var prom_id=th.data.share_good.id; + switch(th.data.currentIndex){ + case 0: prom_type=1;break; + case 1: prom_type=6;break; + case 2: + if(th.data.currentIndex2==1) prom_type = 5; + if(th.data.currentIndex2==2){ + prom_type = 3; + prom_id=th.data.share_good.prom_id; + } + break; + } + + + var scene = th.data.share_good.goods_id+""; + scene+="."+prom_type+"."+prom_id; + var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; if(user_id>0){ scene+="_"+user_id; @@ -1129,14 +1160,27 @@ Page({ this.data.currentPage=1; this.requestGoodsList(); }, - - - go_goods:function(e){ - var index=e.currentTarget.dataset.index; - var item=this.data.list[index]; - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; - getApp().goto(url); - }, + + + go_goods: function (e) { + var index = e.currentTarget.dataset.index; + var item = this.data.list[index]; + var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; + + switch(this.data.currentIndex){ + case 0: item.prom_type = 1;break; + case 1: item.prom_type = 6;break; + case 2: + if(th.data.currentIndex2==1) item.prom_type = 5; + if(th.data.currentIndex2==2) item.prom_type = 3; + break; + } + + item.prom_id = item.id; + url+="&prom_type="+item.prom_type+"&prom_id="+item.prom_id + + getApp().goto(url); + }, go_coll_good:function(e){ var gid=e.currentTarget.dataset.gid; diff --git a/packageA/pages/distribution/goods/goods.wxml b/packageA/pages/distribution/goods/goods.wxml index aa6f6a3..b2844fc 100644 --- a/packageA/pages/distribution/goods/goods.wxml +++ b/packageA/pages/distribution/goods/goods.wxml @@ -75,13 +75,13 @@ --> - + {{item.goods_name}} - + {{item.prom_integral}}积分 + @@ -214,7 +214,7 @@ - + {{item.goods_name}} @@ -222,7 +222,7 @@ - + {{item.prom_integral}}积分 + diff --git a/packageA/pages/distribution/shop/shop.wxml b/packageA/pages/distribution/shop/shop.wxml index d4f3b96..419c52f 100644 --- a/packageA/pages/distribution/shop/shop.wxml +++ b/packageA/pages/distribution/shop/shop.wxml @@ -69,14 +69,14 @@ - + {{item.goods_name}} - + {{item.prom_integral}} @@ -213,14 +213,14 @@ - + {{item.goods_name}} - + {{item.prom_integral}} diff --git a/packageA/pages/goods_share/goods_share.js b/packageA/pages/goods_share/goods_share.js index de6e31b..6129fd8 100644 --- a/packageA/pages/goods_share/goods_share.js +++ b/packageA/pages/goods_share/goods_share.js @@ -292,6 +292,11 @@ Page({ orderField:this.data.orderField, orderType:this.data.orderType, } + + var user_id=getApp().globalData.user_id; + if(!user_id){ user_id=0;} + req_data.user_id=user_id; + if(this.data.key_str && this.data.key_str.trim()){ var str=this.data.key_str.trim(); req_data.key_str=str; diff --git a/packageB/pages/user/collect_list/collect_list.wxml b/packageB/pages/user/collect_list/collect_list.wxml index d20e43a..c3ba730 100644 --- a/packageB/pages/user/collect_list/collect_list.wxml +++ b/packageB/pages/user/collect_list/collect_list.wxml @@ -22,7 +22,7 @@ + data-url="{{editEd==0?'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id+'&prom_type='+item.prom_type+'&prom_id='+item.prom_id:''}}"> @@ -46,7 +46,7 @@ - {{item.shop_price}} + {{item.prom_price?item.prom_price:item.final_price}} diff --git a/packageB/pages/zuhegou/index/index.js b/packageB/pages/zuhegou/index/index.js index cdb0482..5bb4960 100644 --- a/packageB/pages/zuhegou/index/index.js +++ b/packageB/pages/zuhegou/index/index.js @@ -249,8 +249,7 @@ Page({ return false; } - //获取购物车的内容 - th.get_cart_val(e); + var ee = JSON.parse(JSON.stringify(e)); var appd = getApp().globalData; @@ -342,8 +341,13 @@ Page({ }); } } + //获取购物车的内容 + th.get_cart_val(e); }) + }else{ + //获取购物车的内容 + th.get_cart_val(e); } }, 1); diff --git a/packageC/pages/group_list/group_list.js b/packageC/pages/group_list/group_list.js new file mode 100644 index 0000000..9a67abc --- /dev/null +++ b/packageC/pages/group_list/group_list.js @@ -0,0 +1,255 @@ +var e = getApp(), i = e.request, a = e.globalData.setting,os=a,ut = require("../../../utils/util.js"); +var regeneratorRuntime = require('../../../utils/runtime.js'); +const app = getApp(); +let self = null; + +Page({ + + /** + * 页面的初始数据 + */ + data: { + // type:1, + // goodlist: null, + + isLogin: false, + list: null, + isLoading: false, // 检测是否已经发送请求,防止重复发送请求 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 + pageNum: 1, // 当前页数 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + self = this; + + app.isLogin().then(function(data) {//进入页面前已经授权登录成功 + self.setData({ + userInfo: data, + }); + }); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + if(app.globalData.userInfo) { + if(!this.data.isLogin) { + this.setData({ + userInfo: app.globalData.userInfo, + imghost: app.globalData.setting.imghost, + isLogin: true, + }); + + + let url = '/api/weshop/goods/groupBuy/page'; + let data = { + store_id: app.globalData.setting.stoid, + is_show: 1, + is_end: 0, + timetype:1 + }; + + this.setData({ + list: null, + pageNum: 1, + noMore: false, + }); + + this.getData(true, url, data).then(function() { + self.setData({ + currentData: data, + }); + }); + + this.data.is_timer=1; + + }; + + + //设置全局定时器 + this.data.timer = setInterval(function () { + self.countDown(); + },1000); + + + }; + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + clearInterval(this.data.timer); + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + let data = this.data.currentData; + this.scrollToLower('/api/weshop/goods/groupBuy/page', data); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + + + /** + * 请求数据 + */ + getData: function(isInit, url, data) { + let p = app.request.promiseGet(url, { + data: data, + isShowLoading: true, + }) + .then(function(res) { + if(res.data.code == 0) { + + self.setData({ + isLoading: false + }); + + if(isInit) {// 第一次加载 + self.setData({ + list: res.data.data + }); + } else { + self.setData({ + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData) + }); + }; + + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) { + self.setData({ + noMore: true + }); + }; + + } else { + self.setData({ + 'list.pageData': [] + }); + }; + + }); + + return p; + }, + + + /** + * 上拉加载 + */ + scrollToLower(url, requestData) { + // 数据总量 + let total = this.data.list.total; + // 单页最大数据量 + let pageSize = this.data.list.pageSize; + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’ + if((total != 0)&&(total <= pageSize)) { + this.setData({ + noMore: true + }); + }; + + if(!this.data.isLoading && !this.data.noMore) { + this.setData({ + isLoading: true, + pageNum: this.data.pageNum + 1 + }); + requestData.page = this.data.pageNum; + this.getData(false, url, requestData); + }; + }, + + + //---小于10的格式化函数---- + timeFormat(param) { + return param < 10 ? '0' + param : param; + }, + + + //----倒计时函数----- + countDown() { + if(!this.data.is_timer) return false; + var th=this; + // 获取当前时间,同时得到活动结束时间数组 + let newTime = ut.gettimestamp(); + var endTimeList = this.data.list.pageData; + if(endTimeList == null) return null; + // 对结束时间进行处理渲染到页面 + for(var i = 0; i < endTimeList.length; i++) { + var o = endTimeList[i]; + var endTime = o.end_time; + // if(th.data.type==0) endTime = o.start_time; + let obj = null; + // 如果活动未结束,对时间进行处理 + if (endTime - newTime > 0) { + let time = (endTime - newTime); + // 获取天、时、分、秒 + let day = parseInt(time / (60 * 60 * 24)); + let hou = parseInt(time % (60 * 60 * 24) / 3600); + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); + obj = { + day: this.timeFormat(day), hou: this.timeFormat(hou), min: this.timeFormat(min), sec: this.timeFormat(sec), hide: 1 + } + } else { + //活动已结束,全部设置为'00' + obj = { day: '00', hou: '00', min: '00', sec: '00' } + } + var txt ="goodlist["+i+"].djs"; + th.setData({ [txt]: obj}); + } + }, + + + + //图片失败,默认图片 + bind_bnerr2: function (e) { + var _errImg = e.target.dataset.errorimg; + var val = e.target.dataset.val; + if(val!=undefined && val!=null && val!='null' ){ + var _errObj = {}; + _errObj[_errImg] = "/public/images/default_goods_image_240.gif"; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + } + }, + + goto(e) { + let url = e.target.dataset.url; + app.goto(url); + }, + + +}) \ No newline at end of file diff --git a/packageC/pages/group_list/group_list.json b/packageC/pages/group_list/group_list.json new file mode 100644 index 0000000..d170c3c --- /dev/null +++ b/packageC/pages/group_list/group_list.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "团购", + "enablePullDownRefresh": false, + "usingComponents": { + "nodata": "/components/nodata/nodata" + } +} \ No newline at end of file diff --git a/packageC/pages/group_list/group_list.wxml b/packageC/pages/group_list/group_list.wxml new file mode 100644 index 0000000..2552353 --- /dev/null +++ b/packageC/pages/group_list/group_list.wxml @@ -0,0 +1,28 @@ + + + + + + + + {{item.title}} + + {{item.rebate}}折 + {{item.price}} + {{item.market_price}} + + + + + 已售{{item.buy_num}}件 + {{goodlist[index].djs.day}}天{{goodlist[index].djs.hou}}时{{goodlist[index].djs.min}}分{{goodlist[index].djs.sec}}秒 + + 去团购 + + + + + + + diff --git a/packageC/pages/group_list/group_list.wxss b/packageC/pages/group_list/group_list.wxss new file mode 100644 index 0000000..8c38c5c --- /dev/null +++ b/packageC/pages/group_list/group_list.wxss @@ -0,0 +1,58 @@ +page { + background-color: #f2f2f2; +} + +.list { + padding-left: 20rpx; + padding-right: 20rpx; +} + +.list-item { + background-color: white; + border-radius: 12rpx; + margin-top: 20rpx; + padding: 20rpx; + display: flex; +} + +.tag { + background-color: #ff6768; + color: white; + font-size: 24rpx; + padding-left: 10rpx; + padding-right: 10rpx; +} + +.img-container { + width: 200rpx; + height: 200rpx; +} + +.btn { + background-color: #ff6768; + color: white; + padding: 10rpx 30rpx; + border-radius: 40rpx; + font-size: 26rpx; +} + +.rmb { + position: relative; +} + +.rmb::before { + content: '¥'; + font-size: 24rpx; +} + +.del { + text-decoration: line-through; +} + +.no-more { + font-size: 24rpx; + line-height: 2; + text-align: center; + /* margin-top: 10rpx; */ + color: #ccc; +} \ No newline at end of file diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js new file mode 100644 index 0000000..2015651 --- /dev/null +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js @@ -0,0 +1,973 @@ +var t = require("../../../../utils/util.js"), + ut = t, + e = require("../../../../utils/common.js"), + a = require("../../../../utils/wxParse/wxParse.js"), + s = getApp(), + i = s.request, + rq = i, + oo = s.globalData, + o = s.globalData.setting, + os = o; + var regeneratorRuntime = require('../../../../utils/runtime.js'); + +Page({ + data: { + //activity_type:1,//活动类型 商家1 阶梯2 会员3 + p_status:1,//会员团的详细情况 1是正在行 2是成功 3失败 + sf_length: 1,//人数大于5 + + erweima:false, + meng:false, + zk:true, + stoid: o.stoid, + hiddenName: true, + teamlist:null, + teamgroup:null, + goods:null,//商品数据 + pindGoods: null,//拼单数据 + imageurl: o.imghost, + pay_f:0,//支付是否成功 + order_sn:"",//订单编号 + canvasHidden:false, //画画版 + screenWidth:0, + + pd_xx: 0, //弹框 + max_num:0,//最低成团人数 + min_price:0,//最低价格 + is_show:0,//加载完才显示 + + share_img_localpath:"", //分享图片的本地图片 + share_ewm_localpath: "", //分享的二维码本地图片 + share_head:"", //分享头像的本地图片 + + iurl:os.imghost, + ct_price:0,//阶梯团成团价格 + sf_arr:null, + + }, + onLoad: function (t) { + // wx.setNavigationBarTitle({ title: "拼团订单",}) + + var that=this; + var th=this; + //获取用户设备信息,屏幕宽度 + wx.getSystemInfo({ + success: res => { + that.setData({ screenWidth: res.screenWidth }) + } + }) + var pay_f = t.payf, order_sn = t.ordersn; + this.setData({ pay_f: pay_f, order_sn: order_sn}); + this.init(order_sn); + + //-- 自定义海报 -- + 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); + 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}) + } + } + }) + }, + //关闭展开列表 + click:function(e){ + this.setData({ + hiddenName: !this.data.hiddenName, + zk: !this.data.zk, + }) + }, + //打开收起拼团列表 + czk:function(e){ + this.setData({ + zk:!this.data.zk, + hiddenName: !this.data.hiddenName, + }) + }, + //打开蒙板提示 + cmeng:function(e){ + this.setData({ + meng:!this.data.meng, + }) + }, + + //关闭蒙板提示 + cmc:function(e){ + this.setData({ + meng: !this.data.meng, + }) + }, +//打开二维码提示 + cerweima:function(e){ + this.setData({ + meng: !this.data.meng, + erweima: !this.data.erweima, + }) + }, + + cerc:function(e){ + this.setData({ + erweima: !this.data.erweima, + meng: !this.data.meng, + }) + }, + + async init( order_sn) { + + wx.showLoading(); + + var goods_id = 0,//商品ID, + pageteam=null,// + original_img=null ,//商品图片 + order=null,//订单编号 + id = 0,//团购id + pt_listno = "",//团编号 + pt_prom_id = 0, //活动id + ee = this, + team_id = 0,//活动id + ordertx=[],//头像图片 + share_img=null,//分享图片 + teamlist=null,//活动表 + goods=null,//商品 + teamgroup=null,//活動从表 + max_num=0,//最低价格时的成团人数 + p_status=1; + + //--如果商家团的时候--- + await getApp().request.promisePost("/api/weshop/order/pay/vipAutoTuan", { + data: {orderSn:order_sn,storeId:os.stoid } + }) + + //获取order信息根据订单编号order_sn + await getApp().request.promiseGet("/api/weshop/order/page", { + data: { store_id: o.stoid, order_sn: order_sn,} + }).then(res => { + order = res.data.data.pageData[0]; + pt_prom_id = order.pt_prom_id; + pt_listno = order.pt_listno; + }) + + if (this.data.payf || order.pt_status == 3) p_status = 3; //失败 + if (order.pt_status == 2 || order.pt_status == 4 || order.pt_status == 5) + p_status = 2; //成功 + if (order.pt_status < 2 && !this.data.payf) + p_status = 1; //正在进行 + if ( order.pt_status == 6) p_status = 4; //支付尾款失败 + + //多少人参团头像 + await getApp().request.promiseGet("/api/weshop/order/pagePtList", { + data: { store_id: o.stoid, pt_listno: pt_listno, } + }).then(res => { + ordertx = res.data.data.pageData; + }) + + + var min_price=0; + //获取活动表的信息根据活动pt_prom_id + await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + pt_prom_id, { + data: { } + }).then(res => { + if (res.data.code==0){ + teamlist = res.data.data; + this.setData({teamlist: teamlist}); + //获取当前时间,并且判断剩余时间 + var nt = ut.gettimestamp(); + teamlist.status = 0; + if (nt >= teamlist.start_time) teamlist.status = 1; + + goods_id = res.data.data.goods_id; + id = res.data.data.id; + share_img = ee.data.imageurl + res.data.data.share_imgurl; + + //----------查看阶梯团------------ + if (teamlist.ct_rylist != "" && teamlist.ct_rylist != null && teamlist.ct_rylist != undefined){ + var ct_rylist = JSON.parse(teamlist.ct_rylist); + var max=0; var pri=0; + ct_rylist.forEach(function (val,ind) { + if(val.rynum>max){ + max=val.rynum; + pri = val.price; + } + }) + max_num=max; + min_price=pri; + + } + + + //获取商品信息 + getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, { + }).then(res => { + //商品地址 + original_img = ee.data.imageurl+ res.data.data.original_img, + goods = res.data.data + + ee.setData({goods: goods,image: original_img,}) + + }) + + } + }) + + + //只装5个 + var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num; + if(max_num){ + ct_nun=parseInt(max_num); + if (ct_nun < ordertx.length) ct_nun = ordertx.length; + } + + if(ct_nun>5) ct_nun=5; + for(var i=0;i= ordertx.length) sf_num++ + else + ordertx2.push(ordertx[i]); + } + + var sf_arr=[]; + for (var i=0;i { + teamgroup = res.data.data.pageData[0]; + if (teamgroup){ + var buy_start_date = ut.formatTime(teamgroup.buy_start_date, "yyyy-MM-dd hh:mm:ss"); + teamgroup.buy_start_date=buy_start_date; + } + }) + + + var ct_price = 0, + num_0 = ordertx.length; + if (teamlist.kttype == 3){ + var js_data = JSON.parse(teamlist.ct_rylist); + js_data.forEach(function (val,ind) { + if (num_0<=val.rynum && ct_price==0){ + ct_price=val.price; + } + }) + if(ct_price==0) ct_price=min_price; + } + + //获取大家都在团信息 + getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1?store_id="+ os.stoid +"&is_end=0&is_show=1" , { + data:{page:1,pageSize:2} + }).then(res => { + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ + pageteam = res.data.data.pageData; + ee.setData({pageteam: pageteam,}) + } + + }) + + //--当是成团的时候的操作-- + if(order.pt_status==2 || order.pt_status==4 || order.pt_status==5){ + //设置值 + + ee.setData({ + ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, min_price: min_price, + order: order, share_img: share_img,max_num:max_num, + pindGoods: teamlist,is_show:1, zk:false, + hiddenName: false, ct_price:ct_price,p_status:p_status,sf_arr:sf_arr}); + + //--是否支付了尾款-- + if(order.pt_status==4 || order.pt_status==5){ + ee.setData({is_pay_wk:1}); + } + }else{ + console.log("239什么鬼", teamlist); + //设置值 + ee.setData({ + ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, + order: order, p_status: p_status, min_price:min_price, + share_img: share_img, max_num: max_num, pindGoods: teamlist, is_show: 1, + ct_price: ct_price, p_status: p_status,sf_arr:sf_arr}); + } + + wx.hideLoading(); + + wx.setNavigationBarTitle({ + title: "拼团详情", + }) + + ee.countDown2(); + + //获取分享图片的本地地址 + var path2 = os.imghost + teamlist.share_imgurl; + wx.getImageInfo({ + src: path2, + success: function (res) { + //res.path是网络图片的本地地址 + ee.data.share_img_localpath = res.path; + }, + fail: function (res) { + //失败回调 + } + }); + + + }, + //---小于10的格式化函数---- + timeFormat(param) { + return param < 10 ? '0' + param : param; + }, + countDown2() { + var th = this; + // 获取当前时间,同时得到活动结束时间数组 + var newTime = ut.gettimestamp(); + var o = this.data.teamgroup; + if(!o) return false; + + var endTime = o.kt_end_time; + if (o.status == 0) endTime = o.start_time; + + //看一下,是否要支付尾款 + if(o.team_type==3 && th.data.order.pt_status==2){ + endTime = o.wk_end_time; + } + + let obj = null; + // 如果活动未结束,对时间进行处理 + if (endTime - newTime > 0) { + let time = (endTime - newTime); + // 获取天、时、分、秒 + let day = parseInt(time / (60 * 60 * 24)); + let hou = parseInt(time % (60 * 60 * 24) / 3600); + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); + obj = { + day: this.timeFormat(day), + hou: this.timeFormat(hou), + min: this.timeFormat(min), + sec: this.timeFormat(sec) + } + } else { + //活动已结束,全部设置为'00' + obj = { + day: '00', + hou: '00', + min: '00', + sec: '00' + } + } + var txt = "pindGoods.djs"; + th.setData({ + obj: obj + }); + setTimeout(th.countDown2, 1000); + }, + + //--定义的保存图片方法,分享团--- + saveImageToPhotosAlbum: function () { + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 + var type=1; + if(this.data.teamlist.kttype==3) type=2; + + wx.showLoading({ title: '生成中...', }) + var that = this, th = that; + //设置画板显示,才能开始绘图 + that.setData({ + canvasHidden: true, + }) + + if(this.data.share_hidden) { + this.setData({ + share_hidden: false, + }); + }; + + var app = getApp(); + var unit = that.data.screenWidth / 750 * 1.35; + var scene=th.data.teamgroup.id; + var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; + if(user_id>0){ + scene+="_"+user_id; + } + + //二微码 + var path3 = os.url+ "/api/wx/open/app/user/getWeAppEwm/"+ + os.stoid+"?sceneValue="+scene+"&pageValue=pages/team/team_show/team_show"; + + //读取文件成功则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; + } + + var share_title=th.data.teamlist.share_title; + if(!share_title) + share_title=th.data.teamlist.title; + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); + + //-- 是自定义海报的情况下 -- + if(th.data.poster && parseInt(th.data.poster.style)==2){ + //在线上分享人的情况下 + if(parseInt(th.data.poster.show_headpic)){ + //获取坐标 + var x=parseFloat(th.data.poster.head_x)*2; + var y=parseFloat(th.data.poster.head_y)*2; + var x1=(x+90) *unit; + var y1=(y+50) *unit; + //--昵称--- + context.setFontSize(24 * unit) + context.setFillStyle("black") + context.fillText(app.globalData.userInfo.nickname, x1, y1); + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit; + //强烈推荐 改许程 + var tj_path = "../../../images/share/q_tj.png"; + context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit); + context.setFontSize(16 * unit) + context.setLineJoin('round'); //交点设置成圆角 + context.setFillStyle("white") + context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit); + } + + }else{ + //--昵称--- + context.setFontSize(24 * unit) + context.setFillStyle("black") + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit); + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; + //强烈推荐 + var tj_path = "../../../images/share/q_tj.png"; + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 110 * unit, 30 * unit); + context.setFontSize(18 * unit) + context.setFillStyle("white") + context.fillText('强烈推荐', 152 * unit + width + 20 * unit, 76 * unit); + } + + + //---产品名称--- + context.setFontSize(21.3 * unit); + context.setFillStyle("black"); + + + + + th.draw_Text(context,share_title, + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); + //------产品的价格------- + context.setFontSize(24 * unit) + context.setFillStyle("red") + + var pri0 = th.data.teamlist.price; + pri0=parseFloat(pri0).toFixed(2); + var wd1=th.data.screenWidth-ut.measureText(pri0, 31 * unit)-25; + context.fillText("¥", wd1-15, 180 * unit); + context.setFontSize(31 * unit) + context.fillText(pri0, wd1, 180 * unit); + + //---市场价划掉--- + context.setFillStyle("gray") + context.setFontSize(22 * unit) + pri0= "¥" + parseFloat(th.data.goods.market_price).toFixed(2); + var wd2=th.data.screenWidth-ut.measureText(pri0, 22 * unit)-25; + context.fillText(pri0, wd2, 210 * unit); + + context.setStrokeStyle('gray') + context.setLineWidth(1 * unit) + context.moveTo(wd2-5, 204 * unit) + context.lineTo(wd2+ut.measureText(pri0, 22 * unit)+5, 204 * unit) + context.stroke(); + console.log(th.data.share_img_localpath); + + + //---中间大图--- + context.drawImage(th.data.share_img_localpath, 68 * unit, 242 * unit, 410 * unit, 410 * unit); + + var g_ct=th.data.teamlist.ct_num-th.data.ordertx.length; + var wz= ""; + if(g_ct>0) wz="还差"+g_ct+"人成团,"; + else{ + g_ct= th.data.max_num -th.data.ordertx.length; + if(g_ct>0){ + wz="还差"+g_ct+"人享最低优惠,"; + }else{ + wz="已享受最优惠,"; + } + } + + //-------大图后面就不一样了----------- + switch (type) { + case 1://会员团和商家团的展示 + //---画线--- + context.setLineWidth(1 * unit) + context.moveTo(32 * unit, 670 * unit) + context.lineTo(520 * unit, 670 * unit) + context.stroke(); + + //---文字--- + context.setFontSize(22 * unit) + context.setFillStyle("black") + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); + + //绘制成团图片 + var ct_img ="../../../images/share/ct_num.png"; + context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit); + var ct_num = th.data.teamlist.ct_num; + context.setFontSize(14 * unit) + + 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.teamlist.buy_num+"份", 166 * unit, 763 * unit); + context.setFillStyle("gray") + context.fillText(wz+"快来和我一起拼团吧!", 40 * unit, 826 * unit); + context.setFillStyle("black") + + context.setFontSize(22 * unit) + context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit); + //---二维吗图--- + //-- 自定义海报 -- + if(th.data.poster){ + var erm_x= parseFloat(th.data.poster.ewm_x)*2; + var erm_y= parseFloat(th.data.poster.ewm_y)*2; + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); + }else{ + //---二维吗图--- + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); + } + break + case 2://阶梯团的展示 + //---画线--- + context.setLineWidth(1 * unit) + context.moveTo(32 * unit, 670 * unit) + context.lineTo(520 * unit, 670 * unit) + context.stroke(); + //---文字--- + context.setFontSize(22 * unit) + context.setFillStyle("black") + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); + //---绘制中间阶梯的价格--- + var list= JSON.parse(th.data.teamlist.ct_rylist); + for(var i=0; i canvasWidth) { + han++; + if (han == 2) + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分 + else + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight); + + initHeight += 22; //22为字体的高度 + lineWidth = 0; + lastSubStrIndex = i; + titleHeight += 20; + } + if (i == str.length - 1) { //绘制剩余部分 + ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight); + } + } + }, + + //c点击打开拼团弹窗 + cpd: function() { + console.log("heheh"); + this.setData({ pd_xx: 1,}) + }, + + //点击关闭拼团弹窗 + close_pt_xx: function() { + this.setData({ pd_xx: 0, }) + }, + + go_goodsinfo:function (e) { + var gid=e.currentTarget.dataset.gid; + var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+gid; + wx.navigateTo({ url: url, }) //跳到非tabbar页 + }, + + gohome:function () { + getApp().goto("/pages/index/index/index"); + }, + + //--获取头像的本地缓存,回调写法-- + get_head_temp:function (tt,func) { + var ee=this; + if(ee.data.share_head){ + tt(func); + return false; + } + //---获取分享图片的本地地址,头像和商品图片---- + var path2 = getApp().globalData.userInfo.head_pic; + if(path2==""){ + ee.data.share_head ="../../../images/share/hui_hear_pic.png"; + tt(func); + }else { + path2=path2.replace("http://thirdwx.qlogo.cn","https://wx.qlogo.cn"); + path2=path2.replace("https://thirdwx.qlogo.cn","https://wx.qlogo.cn"); + wx.getImageInfo({ + src: path2, + success: function (res) { + //res.path是网络图片的本地地址 + ee.data.share_head = res.path; + tt(func);; + }, + fail: function (res) { + ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 + tt(func); + } + }); + } + }, + + //--获取商品图片的本地缓存,回调写法-- + get_goods_temp:function (tt) { + var ee=this; + if(ee.data.share_img_localpath) { + tt(); + return false; + } + var path2 = os.imghost + ee.data.teamlist.share_imgurl; + //获取商品是分享图信息 + wx.getImageInfo({ + src: path2, + success: function (res) { + //res.path是网络图片的本地地址 + ee.data.share_img_localpath = res.path; + tt(); + }, + fail: function (res) { + ee.data.share_img_localpath= "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 + tt(); + } + }); + }, + + go_pay_wk:function(){ + var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.order.order_id; + getApp().goto(url); + }, + + img_show_err:function(e){ + var err_img = e.currentTarget.dataset.err; + var ob={}; + ob[err_img] = this.data.iurl + "/miniapp/images/default_g_img.gif"; + this.setData(ob); + + }, + + //------ 分享配置 -------- + onShareAppMessage: function (e) { + var th=this; + var scene=this.data.teamgroup.id; + var url="/pages/team/team_show/team_show?tg_id="+scene; + //--分享图片-- + var img=th.data.iurl+th.data.teamlist.share_imgurl; + //--把会员分享出去-- + if(getApp().globalData.user_id){ + if(url.indexOf("?")>0) + url+="&first_leader="+getApp().globalData.user_id; + else + url+="?first_leader="+getApp().globalData.user_id; + } + // console.log('url+++++>>>>>', url, th.data.teamlist.title); + + var share_title=th.data.teamlist.title; + if(th.data.teamlist.share_title){ + share_title=th.data.teamlist.share_title; + } + + return { + path:url, + title: share_title, + imageUrl: img, + } + }, + + clickShare() { + this.setData({ + share_hidden: true, + }); + }, + + send() { + this.setData({ + share_hidden:false, + }); + }, + + cancel() { + this.setData({ + share_hidden:false, + }); + }, + + + closePoster() { + this.setData({ + showPoster: false, + }); + }, + + + // 保存图片到手机 + savePic() { + console.log('保存图片'); + var self = this; + // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限 + this.getSetting().then((res) => { + // 判断用户是否授权了保存到相册的权限,如果没有发起授权 + if (!res.authSetting['scope.writePhotosAlbum']) { + this.authorize().then(() => { + // 同意授权后保存下载文件 + this.saveImage(self.data.shareImgPath) + .then(() => { + self.setData({ + showPoster: false + }); + }); + }) + } else { + // 如果已经授权,保存下载文件 + this.saveImage(self.data.shareImgPath) + .then(() => { + self.setData({ + showPoster: false + }); + }); + } + + }) + }, + + + // 保存图片到系统相册 + saveImage(saveUrl) { + var self = this; + return new Promise((resolve, reject) => { + wx.saveImageToPhotosAlbum({ + filePath: saveUrl, + success: (res) => { + wx.showToast({ + title: '保存成功', + duration: 1000, + }); + self.setData({ + showPlaybill: 'true' + }); + resolve(); + }, + fail: () => { + wx.showToast({ + title: '保存失败', + duration: 1000, + }); + } + }) + }) + }, + + // 获取用户已经授予了哪些权限 + getSetting() { + return new Promise((resolve, reject) => { + wx.getSetting({ + success: res => { + resolve(res) + } + }) + }) + }, + + // 发起首次授权请求 + authorize() { + // isFirst 用来记录是否为首次发起授权, + // 如果首次授权拒绝后,isFirst赋值为1 + let isFirst = wx.getStorageSync('isFirst') || 0; + return new Promise((resolve, reject) => { + wx.authorize({ + scope: 'scope.writePhotosAlbum', + // 同意授权 + success: () => { + resolve(); + }, + // 拒绝授权,这里是用户拒绝授权后的回调 + fail: res => { + if(isFirst === 0) { + wx.setStorageSync('isFirst', 1); + wx.showToast({ + title: '保存失败', + icon: 'none', + duration: 1000 + }) + } else { + this.showModal(); + } + console.log('拒绝授权'); + reject(); + } + }) + }) + }, + + + + +}) + diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.json b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.json new file mode 100644 index 0000000..c4ea164 --- /dev/null +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.json @@ -0,0 +1,12 @@ +{ + "windom": { + "navigationBarTitleText": "参团详情", + "backgroundTextStyle": "light", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#ffffff", + "backgroundColor": "#eeeeee" + }, + "usingComponents": { + "share": "/components/share/share" + } +} \ No newline at end of file diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml new file mode 100644 index 0000000..a0c8b13 --- /dev/null +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml @@ -0,0 +1,319 @@ + + + + + + + + + + + + + {{goods.goods_name}} + + + + + + {{teamlist.price}} + + 零售价¥{{goods.market_price}} + + + + + 已拼{{teamlist.buy_num}}件 + + + + + + {{teamlist.ct_num}}人拼 + + + + + + + + + + + + + + + 当前价格 + ¥{{ct_price}}, + + 还差{{max_num-ordertx.length}}人享受最低价格¥{{min_price}} + + + 该团已经拼购到最低价了哦~ + + + + + 拼团成功,当前价格 + ¥{{ct_price}} + + + + + + + + + + + 拼团失败 + + + + + + + + 还差 + {{teamlist.ct_num-ordertx.length}}人成团,组团成功为您节省 + {{filters.toFix(goods.market_price-teamlist.price,2)}}元 + + + + 拼团成功,为您节省 + {{filters.toFix(goods.market_price-teamlist.price,2)}}元 + + + + + + + + + + + 团长 + + + + + + + + + + + + + + + + + + + + 剩余 + + {{obj.hou}}: + {{obj.hou}}: + {{obj.min}}: + {{obj.sec}}结束 + + + + + 剩余支付时间: + + {{obj.hou}}时 + {{obj.min}}分 + {{obj.sec}}秒 + + + + 拼团已结束 + + + + + + 还差 + {{teamlist.ct_num-ordertx.length}}人参团, 拼团失败。 + + + + 已经有 + {{ordertx.length}}人参团, 拼团成功。 + + + + + + + + + + + 拼团成功, 规定时间内支付尾款即发货 + + + 点击下方按钮分享给小伙伴,可快速成团! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 查看拼团列表 + + + + + + + + + + + + + + + + + + + + + + 大家都在团 + + + + + + + + + + + + + + + + ¥11.00{{item.price}} + + {{item.ct_num}}2 + 人参团 + + + + + {{item.goods_name}} + + + + + + + + + + + + + + + + + + + 拼团玩法介绍 + + + 1.开团: + 选择心仪商品,点击“发起X人团”按钮,付款后即为开团成功; + + 2.参团: + 进入朋友分享的页面,点击“立即参团”按钮,付款后即为参团成功,若多人同时支付,支付成功时间较早的人获得参团资格; + + 3.成团: + 在开团或参团成功后,点击“邀请小伙伴参团”将页面分享给好友,在有效时间内凑齐人数即为成团,此时商家会开始发货; + + 4.组团失败: + 在有效时间内未凑齐人数,即为组团失败,此时付款项会原路退回到支付账户; + + 5. + 组团有效期间内,拼购商品订单不允许取消。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxss b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxss new file mode 100644 index 0000000..9d13c9f --- /dev/null +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxss @@ -0,0 +1,965 @@ +page{ + background-color:#eee; +} +.top{ + background-color:rgb(216, 230, 220); + color: rgb(98, 155, 13); + text-align: center; + height:120rpx; + width: 100%; + padding-top:24rpx; +} + +.center{ + height: 240rpx; + width: 100%; + position: relative; + background:#fff; +} + +.cenleft{ + width: 240rpx; + height: 100%; + + float: left; + display:flex; + justify-content: center; + align-items: center; +} + +.cenleft image{ + background-color:white ; + width: 200rpx; + height: 200rpx; + +} + + +.cenrt{ + width: 460rpx; margin-top: 10rpx; +} + +.cenright{ + height: 100%; + width: 460rpx; + + float: left; +} + +.cenrtop{ + margin-top: 10rpx; + background-color: red; + color: white; + border-radius:10rpx; + padding-left: 16rpx; + width: 140rpx; + font-size: 32rpx; + float: left; + height: 40rpx; +} + +.cenrtoptitle{ + float: left; + width: 295rpx; + height: 40rpx; + margin-left: 12rpx; + font-size: 28rpx; + margin-top:12rpx; +} + +.cenrtoptitle>span{ + width: 100%; + display: inline-block; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap +} + +.cenrcen{ + height: 70rpx; + margin-top: 35rpx; + width:474rpx; +} +.jg{ font-size: 40rpx; + margin-right: 30rpx;} +.jgx{ + font-size: 28rpx; + color: #777; + text-decoration:line-through; + margin-left: 20rpx; +} + +.cenrfoot{ + align-content: center; + text-align: center; + border: 2rpx solid red; + border-radius:10rpx; + color: red; + float: left; + font-size: 24rpx; + padding: 4rpx 16rpx; +} + +.body{ + background-color: white; + /* min-height:418rpx; */ + width: 100%; + margin-top: 4rpx; + border-top:5rpx solid #eee; + height: auto; +} + +.bodytop{ + background-color: white; + text-align: center; + font-size: 28rpx; + height:100rpx; + line-height:117rpx; + +} + +.bodytop span{ + color: red; +} + + +.bodyimg{ + height:140rpx; + width:590rpx; + + + +} +.bodyimg image{ + +border-radius:50rpx; +height: 96rpx; +width: 96rpx; +background-color:burlywood; +margin-top: 30rpx; + position: absolute; + +} + +.d{ +width:101rpx; + height:101rpx; + display: inline-block; + margin-right:15rpx; + +} + +.bodyimg span{ + background-color:#e22b44; + color: white; + font-size: 24rpx; + border-radius:6rpx; + padding:2rpx 10rpx; + position: relative; + top: 0rpx; + left: 40rpx; +} + + + +.bodyspan{ + color: red; + text-align: center; + font-size: 26rpx; + +} + +.bodyselect{ + line-height: 47rpx; +} + +.bodytime{ + height: 88rpx; + width: 100%; + display: flex; + flex-wrap: nowrap; + margin-left:40rpx; + align-items:center; + +} + +.bodytimeleft{ + text-decoration:line-through; + flex-grow: 1.7; +} + + +.bodytimecen-success{ + text-align: center; + flex-grow: 1; + line-height:75rpx; + font-size: 30rpx; + color: #000; +} +.bodytimecen-success span{ + + color: #18ba5f; + border-radius:7rpx; + font-size: 30rpx; + margin: 0 auto; + +} +.bodytimecen{ + text-align: center; + flex-grow: 1; + + font-size: 30rpx; + color: #000; +} +.bodytimecen span{ + background-color: #333333; + color: white; + border-radius:7rpx; + padding-left: 10rpx; + font-size: 30rpx; + margin: 0 auto; + padding-right:10rpx; + margin-right:5px +} + + +.bodytimecen span:last-child{ + margin-right: 10rpx; +} + +.bodytimeright{ + flex-grow: 1.7; + margin-right:72rpx; + +} + +.bodybutton{ + width: 90%; + margin: 0 auto; + text-align: center; + line-height: 60rpx; + border-radius:15rpx; + height: auto; +} + +.bodybutton button{ + height:60rpx; + width: 100%; + background-color: #e4374d; + color: white; + font-size:26rpx; + border-radius:12rpx; + +} + +.bodyfoot{ + + width: 100%; + text-align: center; + + font-size: 28rpx; + color: #000; + background-color: white; +} + + + + + +.pintuan{ + width: 100%; + height: 84rpx; + background-color: white; + color: black; + text-align: center; + font-size:36rpx; + margin-top: 60rpx; +} + +.pintuanzhou{ +float: left; + +line-height: 84rpx; +width: 220rpx; +} + +.pintuanyou{ + float: right; + color: rgb(168, 167, 167); + line-height: 84rpx; + font-size: 28rpx; + margin-right: 20rpx; +} + +.onegoods{ + background-color: white; + width: 345rpx; + min-height: 490rpx; + height:auto; + + border:2rpx solid #eee; + + float: left; + margin-right:17rpx; + border-radius:20rpx; +} + +.goodsl{ + background-color: white; +} + +.onegoodsimg{ + width: 100%; + height: 360rpx; +} + +.onegoodsimg image{ + height: 100%; + width: 100%; + border-radius:20rpx 20rpx 0 0; + +} + .xc-buttmo-frame{ + min-height: 103rpx; + height: auto; + padding-bottom:15rpx; + + } +.xc-buttmo-frame .onegoodsdesc { + + height: 80rpx; +} + +.xc-buttmo-frame .onegoodsdesc .price{ + + padding-left:10rpx; + height:85rpx; + +} +.xc-ping{ + border-radius: 50%; + background: #fff; + line-height:34rpx; +width:34rpx; +height:34rpx; +font-size:24rpx; + +} +.jgleft{ +border-radius:36rpx; +height:45rpx; +line-height:50rpx; +color:#fff; +padding-left:7rpx; +padding-right:24rpx; +background:#e4374d; +} + +.jgright{ + font-size: 26rpx; + height:16rpx; +padding-right:10rpx; +color:rgb(168, 167, 167); +} + +.jgright span{ + color: rgb(168, 167, 167); +} + +.goodslisttop{ + width: 100%; +} + +.goodslisttop{ + width: 100%; + margin-top: 5rpx; + border-bottom: 4rpx solid #eee; + text-align: center; +} + +.goodslistspan{ + + margin: 0 auto; + padding-top: 20rpx; +} + +.xian{ + width: 100%; + border-bottom: 2rpx solid #eee; + float: left; +} + +.bodyselect{ + height: 90rpx; + background-color: white; + width: 100%; + line-height:90rpx; + +} + + +.changxin{ + overflow: hidden; + width: 100%; + padding-left:20rpx; + +} + +.zhangxi{ + width: 100%; + background-color:white; + color: black; +} + +.img{ + height: 100rpx; + margin-bottom: 0rpx; + float: left; + color: black; + line-height:100rpx; +display:flex; +align-items:center; + +} + +.zhangxi image{ + border-radius:50rpx; + height: 60rpx; + width: 60rpx; + float: left; + + background-color: red; + margin-left: 40rpx; + margin-right:10rpx; + +} + +.zhangxi .zssj{ + width: 413rpx; + margin-left: 28rpx; + float: right; + margin-top:32rpx; +} + +.zspan{ + float: left; + text-align: center; + display: flex; + align-items: center; + justify-content: center; + height: 48rpx; + font-size: 28rpx; + color:#000; + margin-bottom: 10rpx; + padding-bottom: 10rpx; + width: 100%; + background: #fff; + border-bottom:3rpx solid #eee; + margin-top:20rpx; + +} + + + +.mtop{ + text-align: center; + color: white; + background-color:rgba(0, 0, 0, .4); + width: 100%; + height: 100%; + position: fixed; + z-index: 5;top:0;left: 0; + +} + +.mt1{ + margin-top: 200rpx; + margin-bottom: 20rpx; +} + +.mts{ + color:#E1E10B; +} + +.mcou{ + font-size: 48rpx; + +} + +.mfoot{ + width: 100%; + margin-top: 700rpx; +} + + +.mbtn{ + margin-top: 60rrpx; + width: 400rpx; + background: #666666; + color: #fff; + border-radius: 20rpx; + font-size: 32rpx; +} + + + + + + + +.etop{ + padding-top: 200rpx; + width: 100%; + height: 100%; + position: fixed; + left: 0rpx; + top: 0rpx; + z-index: 12rpx; +background-color:rgba(0, 0, 0, .4); + +} + +.emyimage{ + display:flex; + justify-content: center; + align-items: center; +} + + +.emyimage image{ + background-color: red; + width: 300rpx; + height: 300rpx; + margin: 0 auto; + +} + +.espan{ + font-size: 32rpx; + margin-top: 10rpx; +} + +.erweima{ + margin-top: 10rpx; + display: flex; + width: 100%; + +} + +.erzhou{ + width: 200rpx; + + + margin-right: 20rpx; +} + +.erzhou image{ + background-color: blanchedalmond; + width: 200rpx; + height: 200rpx; +} + + +.eright{ + width: 500rpx; + font-size: 32rpx; + +} + + + +.ecc{ + float: right; + margin-right: 48rpx; +} + + +.eee{ + padding-top:40rpx; + +width:90%; +height:70%; + +padding-left:32rpx; +margin-left:20rpx; + +background-color:white; + +} + +.clear{ + clear: both; +} + +.down-arrow { + display: inline-block; + position: relative; + width: 40rpx; + height: 30rpx; + margin-right: 20rpx; +} + +.down-arrow::after { + display: inline-block; + content: " "; + height: 18rpx; + width: 18rpx; + border-width: 0 2rpx 2rpx 0; + border-color: #000; + border-style: solid; + transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0); + transform-origin: center; + transition: transform 0.3s; + position: absolute; + top: 50%; + right: 10rpx; + margin-top: -10rpx; +} + +.down-arrow1 { + display: inline-block; + position: relative; + width: 40rpx; + height: 30rpx; + margin-right: 20rpx; + margin-top: 12rpx; +} + +.down-arrow1::after { + display: inline-block; + content: " "; + height: 18rpx; + width: 18rpx; + border-width: 0 2rpx 2rpx 0; + border-color: #000; + border-style: solid; + transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0); + transform-origin: center; + transition: transform 0.3s; + position: absolute; + top: 50%; + right: 10rpx; + margin-top: -10rpx; +} + +.down-arrow1::after { + transform-origin: center; + transform: rotate(-135deg); + transition: transform 0.3s; +} + +.bview { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); +} + +.juzhong { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.juzhong .xq { + padding: 0 20rpx; + background: #fff; + font-size: 30rpx; + padding-bottom: 20rpx; +} + +.juzhong .xq .title { + text-align: center; + margin: 20rpx 0; + position: relative; + height: 50rpx; +} + +.juzhong .xq .hs1 { + font-size: 28rpx; + color: #ab8f9e; +} + +.juzhong .xq .title .close { + position: absolute; + top: 0; + right: 0; + width: 45rpx; + height: 45rpx; +} + +.pt_qd { + margin-top: 40rpx; + height: auto; +} + +.spec-cart-btn.w100 { + width: 100%; + margin-left: 0; + height: 80rpx; + line-height: 80rpx; +} + +.pt_status_set{ + position: absolute; right: 10rpx; top:50rpx; width: 120rpx; height: 120rpx; +} + + + +.xc-goods-details{ +width:479rpx; +margin-top:20rpx; +height:77rpx; +} + +.xc-valframe{ + border-radius:7rpx; +border:1rpx solid; +margin-top:3rpx; +} +.xc-valframe .xc-frame-img{ + width:30rpx; +height:100%; +background:#e22b44; +} +.xc-valframe .xc-frame-img .picture{ + width:25rpx; +height:25rpx; +margin-top:4rpx; + +} +.xc-ellipsis-img{ +width:56rpx; +height:96rpx; + +} +.xc-ellipsis-img .pictures{ + width:56rpx;height:56rpx; +} +.flex_tou{ display: flex; justify-content: center; width: 100%;} +.xc-ptcomplete{ + width:74%; +height:105rpx; +line-height:105rpx; +float:right; + +} +.xc-ptcomplete .xc-img-frame .img{ + width: 105rpx; + height: 105rpx; + float: right; +} +.xc-ptcomplete-ladder .xc-img-frame{ + width:201rpx; + height: 105rpx; + margin-top:20rpx; +} +.xc-ptcomplete-ladder .xc-img-frame .img{ + width: 105rpx; + height: 105rpx; + float: right; + padding-right:6rpx; +} +.xc-ptcomplete .xc-img-frame{ + width:190rpx; + height: 105rpx; + margin-top:20rpx; +} +.xc-ptcomplete .xc-end{ + width:283rpx; +text-align:right; +} +.iw{ +padding-right:33rpx; +} +.xc-ptcomplete .xc-img-frames{ + width:360rpx; +height:105rpx; +margin-top:20rpx; + +} +.xc-ptcomplete .xc-img-frames .img{ + width: 105rpx; + height: 105rpx; + float: right; + padding-right:6rpx; +} +.xc-home-page-frame{ + padding-top:16rpx; + +} +.xc-home-page-frame .xc-home-page{ + background-color: #e22b44;border-radius:15rpx; +width:90%; +color:#fff; +height:60rpx; +font-size:26rpx; +line-height:60rpx; +} +/* */ +.xc-people-val{ + padding-left:8rpx; +padding-right:8rpx; +} +.xc-onclik{ + width:100%; +height:70rpx; + +} +.xc-green{ + color: #18ba5f; + text-align:center; +flex-grow:1; +height:90rpx; + + +} +.xc-ptcomplete-ladder{ + width:74%; +height:105rpx; +line-height:105rpx; +float:right; +} +.xc-fail-ladder{ + width:61%; +height:105rpx; +line-height:105rpx; +float:right; + +} +.xc-fail-ladder .xc-img-frame{ + width:61%; +height:105rpx; +margin-top:20rpx; +} +.xc-fail-ladder .xc-img-frame .img{ + width: 105rpx; + height: 105rpx; + float: right; + padding-right:6rpx; +} +.xc-list{ + background-color:#e22b44; +color:white; +font-size:17rpx; +border-radius:6rpx; +padding:0 5rpx; +position:absolute; +top:13rpx; +left:80rpx; +width:34rpx; +line-height:25rpx; + +} + +.xc-linellae-frame{ + width: 100%; + height: 60rpx; + background: #eee; +} +.xc-linellae-frame .xc-linellae{ + width: 425rpx; + height: 1rpx; + border-bottom: 1rpx solid #a5a5a5; +} +.xc-recommend-frame{ +background:#eee; +width:200rpx; +height:100%; + +} +.xc-recommend-frame .xc-recommend{ + width: 35rpx; + height: 27rpx; + margin-top:7rpx; +} +.xc-recommend-frame .xc-recommend-word{ +font-size:26rpx; +color: #a9a9a9; +margin-left:5rpx; +} +.xc-rmbs{ + +height:40rpx; +} +.xc-shuoming{ + padding-left:10rpx; +} + + +.poster-container { + box-sizing: border-box; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: calc(100% - 210rpx); + z-index: 1000; +} +.mask { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 999; + background-color: rgba(0,0,0,.4); +} +.poster-wrapper { + width: 100%; +} + +.poster { + box-sizing: border-box; + width: 100%; + height: 905rpx; + border-radius: 20rpx; + /* box-shadow: 0 8px 12px #666; */ + position: relative; + z-index: 999; + overflow: hidden; +} +.poster-img { + display: block; + width: 100%; + height: 100%; +} +.btn-container { + display: flex; + justify-content: space-around; +} +.btn-share { + display: block; + background-color: #FE6867; + color: white; + border-radius: 8rpx; + line-height: 80rpx; + margin-top: 28rpx; + padding: 0 60rpx; +} + + +.btn-close { + /* background-color: rgba(0,0,0,.5); */ + color: #ccc; + width: 50rpx; + height: 50rpx; + line-height: 50rpx; + text-align: center; + border-radius: 50%; + position: absolute; + right: 20rpx; + top: 20rpx; +} + +.icon-close { + font-size: 48rpx; +} \ No newline at end of file diff --git a/packageC/pages/luckyGo/luckyGo_list/luckyGo_list.js b/packageC/pages/luckyGo/luckyGo_list/luckyGo_list.js new file mode 100644 index 0000000..536cee7 --- /dev/null +++ b/packageC/pages/luckyGo/luckyGo_list/luckyGo_list.js @@ -0,0 +1,246 @@ +var t = require("../../../../utils/util.js"), + ut = t, + e = require("../../../../utils/common.js"), + a = require("../../../../utils/wxParse/wxParse.js"), + s = getApp(), + i = s.request, + rq = i, + oo = s.globalData, + o = s.globalData.setting, + os = o; +var regeneratorRuntime = require('../../../../utils/runtime.js'); +var e = getApp(),oo = e.globalData.setting; + +Page({ + data: { + wu:false, + imageurl: os.imghost,//有礼派图片地址, + iurl: os.imghost,//有礼派图片地址, + pt_state:0, + order : null,//订单数据 + currentTab: 0, + current:0, + ordertx:[],//头像 + baseUrl: "/api/weshop/order/page?1=1", + resourceUrl: e.globalData.setting.resourceUrl, + currentPage: 1, + requestData: null, + original_img:null, + timer:null, + + + + + tabArr: ['全部','参团中','已团中','未团中'], + currentTabIndex: 0, + }, + onLoad: function () { + this.data.requestData=new Array(); + this.init(0); + }, + onShow:function(){ + var th=this; + //设置全局定时器 + th.data.timer=setInterval(function () { + th.countDown(); + },1000); + }, + + + clickTab(e) { + this.setData({ + currentTabIndex: e.target.dataset.index, + }); + }, + + + /** + * 点击tab切换 + */ + swichNav: function (e) { + this.data.requestData=[]; + this.data.currentPage=1; + var that = this; + + if (that.data.order == null){ + that.setData({ + wu:true + }) + } + + if (this.data.currentTab === e.target.dataset.current) { + return false; + } else { + that.setData({ + currentTab: e.target.dataset.current, + }) + that.init(e.target.dataset.current); + } + }, + + async init(current) { + var where="1=1"; + var user_id = getApp().globalData.user_id; + switch (current){ + case "1": + where+="&pt_status=1"; + break; + case "2": + where += "&pt_ok=1"; + break; + case "3": + where += "&pt_status=3"; + break; + } + + var goods_id = 0,//商品ID, + original_img = [],//商品图片 + ee = this, + ordertx=[],//头像 + order = null,//订单数据 + goods = null,//商品数据 + users = null,//会员数据 + order_goods=null;//订单商品表 + + //获取订单表的信息根据活动user_id,pt_prom_id>0 AND pay_time>0 + /*--- + await getApp().request.promiseGet("/api/weshop/order/page?"+where, { + data: { is_pt:1,store_id: os.stoid, user_id: user_id, pageSize: 6, page: this.data.currentPage,} + }).then(res => { + order = res.data.data.pageData; + this.data.currentPage++; + })--*/ + + await getApp().request.promiseGet("/api/weshop/order/pageTuan?"+where, { + data: { is_pt:1,store_id: os.stoid, user_id: user_id, pageSize: 6, page: this.data.currentPage,} + }).then(res => { + order = res.data.data.pageData; + this.data.currentPage++; + }) + + + wx.showLoading({ title: "加载中"}); + for (i = 0; i < order.length; i++) { + //获取订单从表信息 + await getApp().request.promiseGet("/api/weshop/ordergoods/pageGoods", { + data: { store_id: os.stoid, order_id: order[i].order_id } + }).then(res => { + order_goods = res.data.data.pageData; + order[i].order_goods = order_goods; + order[i].gimage = ee.data.imageurl + order_goods[0].original_img; + }) + + + //获取订单表信息根据上面查询的订单号order[i].pt_listno + await getApp().request.promiseGet("/api/weshop/order/pagePtList", { + data: { store_id: os.stoid, pt_listno: order[i].pt_listno,pageSize:60,page:1} + }).then(res => { + //console.log("ordertx"); + ordertx = res.data.data.pageData; + //console.log(ordertx); + order[i].tx=ordertx; + }) + + + + if (order[i].is_zsorder== 4) { + var num = 0; + var jt_data = JSON.parse(order[i].ct_rylist); + for (var m in jt_data) { + if (jt_data[m].rynum > num) num = jt_data[m].rynum; + } + order[i].max_ct_num = num; + } + + var sf_num = order[i].ct_num; + if (order[i].ct_num>=3){ sf_num=3;} + sf_num=sf_num-ordertx.length; + if(sf_num>0) { + var arr = []; + for(var j=0;j + {{item}} + + + + + + + 参团中,还差2 + + + + + 商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称 + + 15 + 零售价25 + + 未团中可获得XXXX帮团奖励 + + + + 共1件,实付金额:15.00 + + 查看订单 + 邀请好友 + + + + + + + 已团中,待发货 + + + + + 商品名称商品名称 + + 15 + 零售价25 + + 未团中可获得XXXX帮团奖励 + + + + 共1件,实付金额:15.00 + + 查看订单 + + + + + + + + 未团中,已退款 + + + + + 商品名称商品名称 + + 15 + 零售价25 + + 未团中可获得XXXX帮团奖励 + + + + 共1件,实付金额:15.00 + + 查看订单 + 查看奖励 + + + + + + + + + + + + 帮团奖励 + + + + + + + 我是名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称 + 数量:100 + + + + + + + 我是名称 + 数量:11 + + + + + + + 我是名称 + 数量:11 + + + + + + + 我是名称 + 数量:11 + + + + + + + + + +—— 已经到底啦 —— + \ No newline at end of file diff --git a/packageC/pages/luckyGo/luckyGo_list/luckyGo_list.wxss b/packageC/pages/luckyGo/luckyGo_list/luckyGo_list.wxss new file mode 100644 index 0000000..fcc140c --- /dev/null +++ b/packageC/pages/luckyGo/luckyGo_list/luckyGo_list.wxss @@ -0,0 +1,143 @@ +.bdt { + border-top: 2rpx solid #f5f5f5; +} + +page { + background-color: #f2f2f2; +} + +.btn { + border: 2rpx solid #ff6768; + padding: 10rpx 20rpx; + border-radius: 40rpx; +} + +.btn.gray { + border-color: #ccc; +} + +.tab-hd { + display: flex; + text-align: center; + font-size: 28rpx; + background-color: white; + position: sticky; + top: 0; + z-index: 2; +} + +.tab-hd-item { + flex-grow: 1; + padding: 20rpx; + position: relative; +} + +.tab-hd-item.active { + color: #ff6768; +} + +.tab-hd-item.active::after { + content: ''; + position: absolute; + width: 30%; + height: 4rpx; + left: 0; + right: 0; + bottom: 0; + margin: 0 auto; + background-color: #ff6768; +} + +.title { + height: 88rpx; +} + +.tab-bd { + padding-left: 20rpx; + padding-right: 20rpx; +} + +.list { + overflow: hidden; +} + +.list-item { + background-color: white; + margin-top: 20rpx; + border-radius: 12rpx; + font-size: 28rpx; +} + +.arrow { + position: relative; +} + +.arrow::after { + font-family: iconfont; + content: '\e61f'; + position: absolute; + right: 0; + color: #ccc; +} + +.img-container { + width: 200rpx; + height: 200rpx; + flex-shrink: 0; + padding-right: 20rpx; +} + +.rmb::before { + content: '¥'; + font-size: 24rpx; +} + +.del { + text-decoration: line-through; +} + +.no-more { + font-size: 24rpx; + line-height: 2; + text-align: center; + margin-top: 10rpx; + color: #ccc; +} + + +.popup-container { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(0,0,0,.8); +} + +.popup { + background-color: #FFFAE7; + position: fixed; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + border-radius: 12rpx; + min-width: 600rpx; + color: #AF481D; +} + + + +.popup-list-item { + display: flex; + padding: 20rpx; +} + +.popup-list-item .img-container { + width: 140rpx; + height: 140rpx; +} + + .popup-title { + font-size: 28rpx; + height: 88rpx; + } \ No newline at end of file diff --git a/packageC/pages/presell/cart/cart.js b/packageC/pages/presell/cart/cart.js index c439edf..2b3e327 100644 --- a/packageC/pages/presell/cart/cart.js +++ b/packageC/pages/presell/cart/cart.js @@ -656,7 +656,7 @@ Page({ }) }else{ th.setData({quan_price:0}); - if(th.data.using_quan[bn_pick].isby==1){ + if(th.data.using_quan && th.data.using_quan[bn_pick] && th.data.using_quan[bn_pick].isby==1){ var txt="using_quan["+bn_pick+"]"; th.setData({[txt]:{}}); } diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js index 76dbd56..8fdfb8f 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.js +++ b/packageC/pages/presell/goodsInfo/goodsInfo.js @@ -3936,7 +3936,7 @@ Page({ } 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}; + 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; } diff --git a/pages/activity/seckill_list/seckill_list.js b/pages/activity/seckill_list/seckill_list.js index a11f645..7c98985 100644 --- a/pages/activity/seckill_list/seckill_list.js +++ b/pages/activity/seckill_list/seckill_list.js @@ -76,7 +76,7 @@ Page({ }, onHide:function(){ //--清理定时器-- - clearInterval(this.timer); + clearInterval(this.data.timer); this.setData({isshow:0}); }, //---小于10的格式化函数---- diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js index 02bd993..5d65ea5 100644 --- a/pages/cart/cart/cart.js +++ b/pages/cart/cart/cart.js @@ -155,6 +155,7 @@ Page({ }, //-------------获取购物车列表,要安装门店进行分类订单----------- getCardList: function() { + var th = this; //要获取会员是不是等级会员 @@ -190,6 +191,7 @@ Page({ th.get_cart(); th.get_ser_cart(); } + } }) @@ -219,6 +221,7 @@ Page({ state:0 }, success:async function(su) { + console.log(su,10000); //按门店分类的数组 var arr = new Array(), carr = su.data.data.pageData; @@ -385,9 +388,11 @@ Page({ if(!th.data.zuhe_map[item.prom_id]){ //如果有组合购 var isok = 1; + var is_flag=1; var act=null; var url="/api/weshop/prom/zhbuy/get/"+os.stoid+"/"+item.prom_id+"/"+getApp().globalData.userInfo.user_id; await getApp().request.promiseGet(url, {}).then(res => { + console.log(res,1000); if(res.data.code==0 && res.data.data){ if(res.data.data.is_show!=1){ isok=0; @@ -405,12 +410,11 @@ Page({ isok=0; } act=res.data.data; - + }else{ - //未找到商品的活动 - isok = 0; - } - + //未找到商品的活动 + is_flag = 0; + } }) if (!isok){ var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; @@ -419,7 +423,6 @@ Page({ continue; } th.data.zuhe_map[item.prom_id]=act; - var url1 = "/api/weshop/prom/zhbuyGoods/page"; var req_data = { page: 1, @@ -430,8 +433,17 @@ Page({ await getApp().request.promiseGet(url1, { data: req_data }).then(res => { + console.log(res,2000); if (ut.ajax_ok(res)) { var gdlist = res.data.data.pageData; + gdlist.forEach(i=>{ + if(item.goods_id==i.goods_id&&!is_flag){ + item.prom_type=0; + item.prom_type1=0; + item.prom_id=0; + item.prom_id1=0 + } + }) th.data.zuhe_map_good[item.prom_id]=gdlist; } }) @@ -451,12 +463,12 @@ Page({ item.buyqty=t_item.buyqty; item.zh_b_num=promgoodsbuynum; item.act=th.data.zuhe_map[item.prom_id]; - }else{ - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; - getApp().request.delete(url, {}); - th.data.zuhe_map[item.prom_id]=-1; - continue; - } + }//else{ + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; + // getApp().request.delete(url, {}); + // th.data.zuhe_map[item.prom_id]=-1; + // continue; + // } } else if(item.prom_type == 0) { //如果有优惠活动,要更新活动 @@ -563,7 +575,9 @@ Page({ } } - + // console.log('AAAAAAAAAAAA', all_num); + // getApp().globalData.cartGoodsNum = all_num; + th.setData({ requestData: arr, all_num: all_num, @@ -662,7 +676,7 @@ Page({ } } - + // console.log('BBBBBB', all_num); th.setData({ service_data: arr, all_num2: all_num, @@ -773,7 +787,8 @@ Page({ var a = t.currentTarget.dataset.item; var b = t.currentTarget.dataset.pitems; a = this.data.requestData[b].goods[a]; - + + console.log('add+'); if (a.goods_num limit && limit > 0) { @@ -2094,7 +2117,11 @@ Page({ var url = '/api/weshop/cart/delIds/' + oo.stoid + '/' + user_id + "/" + glist; getApp().request.delete(url, { success: function(t) { + // console.log('del done1111111111'); th.getCardList(); + getApp().requestCardNum(th); + // console.log('all================', th.data.all_num); + // getApp().globalData.cartGoodsNum = } }); } @@ -2105,10 +2132,12 @@ Page({ getApp().request.delete(url, { success: function(t) { th.getCardList(); + getApp().requestCardNum(th); + console.log('all2================', th.data.all_num); } }); } - + }, //跳到首页 goto: function(e) { @@ -2376,6 +2405,28 @@ Page({ go_url(e){ var url=e.currentTarget.dataset.url; getApp().goto(url); + }, + + //跳转到商品 + go_gd:function (e) { + var gd= e.currentTarget.dataset.gd; + var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; + var url="/api/weshop/activitylist/getGoodActInfo"; + var req_data={ + store_id:os.stoid,goodsidlist:gd,is_detail:1 + }; + //获取秒杀的多规格 + getApp().request.promiseGet(url, {data:req_data}).then(res=>{ + if(res.data.code==0 && res.data.data){ + if(res.data.data.length==1){ + good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; + } + getApp().goto(good_url); + + }else{ + getApp().goto(good_url); + } + }) } }); \ No newline at end of file diff --git a/pages/cart/cart/cart.wxml b/pages/cart/cart/cart.wxml index 9dc7ee6..bbd4c83 100644 --- a/pages/cart/cart/cart.wxml +++ b/pages/cart/cart/cart.wxml @@ -56,7 +56,6 @@ - @@ -77,7 +76,7 @@ - + 赠品 @@ -102,7 +101,7 @@ - {{items.goods_name}} + {{items.goods_name}} diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index b4e76c1..57a9112 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -124,6 +124,7 @@ Page({ in_zhact_gdmap:{}, //不同门店参与同一活动的限购 hid_inp:1, user_note:{}, + zuhe_map_good:{}, }, onLoad: function (t) { wx.setNavigationBarTitle({title: "填写订单",}) @@ -289,7 +290,6 @@ Page({ } }, 1); - //值在这里换 getApp().globalData.plus_buy_back = 0; }, @@ -454,6 +454,7 @@ Page({ //要把组合购的东西拿出来算一下 if (item1.prom_type == 7) { var isok = 1; + var is_flag=1; //如果有组合购 var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item1.prom_id+'/'+getApp().globalData.userInfo.user_id; await getApp().request.promiseGet(url, {}).then(res => { @@ -465,25 +466,45 @@ Page({ if (ut.gettimestamp() > res.data.data.end_time) { isok = 0; } + item1.act = res.data.data; } else { //未找到商品的活动 - isok = 0; + is_flag = 0; } - item1.act = res.data.data; }) - if (!isok) { getApp().my_warnning("组合购的活动已经过期", 0, th); return false; } - + var url1 = "/api/weshop/prom/zhbuyGoods/page"; + var req_data = { + page: 1, + pageSize: 2000, + store_id: os.stoid, + zh_id: item1.prom_id, + } + await getApp().request.promiseGet(url1, { + data: req_data + }).then(res => { + if (ut.ajax_ok(res)) { + var gdlist = res.data.data.pageData; + gdlist.forEach(i=>{ + if(item1.goods_id==i.goods_id&&!is_flag){ + item1.prom_type=0; + item1.prom_type1=0; + item1.prom_id=0; + item1.prom_id1=0 + } + }) + th.data.zuhe_map_good[item1.prom_id]=gdlist; + } + }) } } //在分组的时候,就不要再调用接口,await for (var i = 0; i < carr.length; i++) { var item = carr[i]; - //-- 如果是等级会员注册返回 -- if (is_card_back) { th.data.card_name = th.data.userinfo.card_field; @@ -667,22 +688,26 @@ Page({ //存储不同活动的商品列表 u_item.zh_prom_goods = {}; for (let var1 in obj) { - var h_item = obj[var1]; - var gdlist = null; - var url1 = "/api/weshop/prom/zhbuyGoods/page"; - var req_data = { - page: 1, - pageSize: 2000, - store_id: os.stoid, - zh_id: h_item.prom_id, - } - await getApp().request.promiseGet(url1, { - data: req_data - }).then(res => { - if (ut.ajax_ok(res)) { - gdlist = res.data.data.pageData; - } - }) + var h_item=obj[var1]; + var gdlist= th.data.zuhe_map_good[h_item.prom_id]; + //获取活动需要的商品列表 + // u_item.zh_prom_goods[h_item.prom_id]=gdlist; + // var h_item = obj[var1]; + // var gdlist = null; + // var url1 = "/api/weshop/prom/zhbuyGoods/page"; + // var req_data = { + // page: 1, + // pageSize: 2000, + // store_id: os.stoid, + // zh_id: h_item.prom_id, + // } + // await getApp().request.promiseGet(url1, { + // data: req_data + // }).then(res => { + // if (ut.ajax_ok(res)) { + // gdlist = res.data.data.pageData; + // } + // }) //获取活动需要的商品列表 u_item.zh_prom_goods[h_item.prom_id] = {gdlist: gdlist, act: h_item.act}; } @@ -780,10 +805,10 @@ Page({ } } - if(gg.prom_type){ + gd.prom_type=gg.prom_type; gd.prom_id=gg.prom_id; - } + switch (gd.prom_type) { case 0: case 2: @@ -3815,6 +3840,11 @@ Page({ var index = e.currentTarget.dataset.index; var txt = "cartlist[" + index + "].focus"; this.setData({[txt]:0}) + }, + + go_url:function (e) { + var url = e.currentTarget.dataset.url; + getApp().goto(url); } diff --git a/pages/cart/cart2/cart2.wxml b/pages/cart/cart2/cart2.wxml index f4be337..0983b21 100644 --- a/pages/cart/cart2/cart2.wxml +++ b/pages/cart/cart2/cart2.wxml @@ -78,26 +78,21 @@ - + + 组合购 - + {{items.goods_name}} {{filters.show_gui_ge(items.goods_spec,items.goods_color)}} - - - - - - {{filters.toFix(items.goods_price,2)}} @@ -255,10 +250,10 @@ - + - + {{bn_goods.goods_name}} diff --git a/pages/cart/cart2/cart2.wxss b/pages/cart/cart2/cart2.wxss index e4fe5ad..fd3dca2 100644 --- a/pages/cart/cart2/cart2.wxss +++ b/pages/cart/cart2/cart2.wxss @@ -19,9 +19,6 @@ box-shadow: 16rpx 0px 12px #e7e9eb; } - - - page { /* background-color: #FAFAFA; */ background-color: #F0F0F0; @@ -995,3 +992,16 @@ margin-left: 20rpx; top:36rpx } +.zuhe { + width: 140rpx; + text-align: center; + height:40rpx; + position: absolute; + top: 15rpx; + left: -37rpx; + transform: rotate(-45deg); + background-color: rgb(255,0,0); + font-size:22rpx; + color: #fff; + line-height: 37rpx; +} diff --git a/pages/cart/cart2/zh_calculate.js b/pages/cart/cart2/zh_calculate.js index 3b90dd4..f42189f 100644 --- a/pages/cart/cart2/zh_calculate.js +++ b/pages/cart/cart2/zh_calculate.js @@ -193,6 +193,11 @@ module.exports = { new_g.prom_type = 0; new_g.prom_id = 0; goods.push(new_g); + + //如果商品的数量已经为空了 + if(goods[idx].goods_num<=0){ + goods.splice(idx,1); + } } } diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js index 5d62b2d..548ef2f 100644 --- a/pages/goods/categoryList/categoryList.js +++ b/pages/goods/categoryList/categoryList.js @@ -52,7 +52,7 @@ Page({ currentPage: 1, allData: null, openFilterModal: !1, - baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=goods_id&orderType=desc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", + baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=sort&orderType=asc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", requestUrl: "", tabname: "goods_id", //排序的字段 adname: "desc", //升降的字段 @@ -791,7 +791,7 @@ Page({ var that = this; that.data.requestUrl = t; e.get("/api/weshop/goods/page?1=1", { - data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, + data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, success: function (data) { console.log(data.data.data.pageData) that.setData({ @@ -853,7 +853,7 @@ Page({ console.log("page:=" + page) var s = this e.get("/api/weshop/goods/page?1=1", { - data: { page: page, cat_id: cid, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, + data: { page: page, cat_id: cid, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, success: function (e) { console.log(e.data.data.pageData) s.setData({ diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index a855ddb..527dfd7 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -605,7 +605,7 @@ Page({ }).then(res => { var t = res; var data = t.data.data.pageData; - if (data.length > 0) { + if (data && data.length > 0) { //ee.setData({ is_collect: 1, collect_id: data[0].collect_id, }); is_collect = 1; collect_id = data[0].collect_id; @@ -1399,7 +1399,7 @@ Page({ add_cart_next(e, t, a, o, newd, CanOutQty) { var th = this, i = getApp().request; //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ - if (o.prom_type != 1 && ((o.prom_type != 6 && o.prom_type != 4) || th.data.is_normal)) { + if ((o.prom_type != 1 || o.prom_id<=0) && ((o.prom_type != 6 && o.prom_type != 4) || th.data.is_normal)) { var conf = th.data.bconfig; if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { var s_list = JSON.parse(conf.switch_list); @@ -2135,7 +2135,7 @@ Page({ var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" - + th.data.sele_g.gid+"&prom_type="+th.data.sele_g.prom_type+"&prom_id="+th.data.sele_g.prom_id; + + th.data.sele_g.goods_id+"&prom_type="+th.data.sele_g.prom_type+"&prom_id="+th.data.sele_g.prom_id; if (getApp().globalData.user_id) { url += "&first_leader=" + getApp().globalData.user_id; } @@ -3529,6 +3529,12 @@ Page({ success: function (t) { if (t.data.code == 0) { var g_buy_num = t.data.data.goodsbuynum; + + //如果是秒杀的时候 + if(th.data.prom_type==0 && gd.prom_type == 1 ){ + gd.prom_type= 0; + } + if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) { //----获取活动购买数---- getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { @@ -4191,6 +4197,95 @@ Page({ } }) }, + + + drawPoster(context, unit, img, vpath) { + // 1.灰色背景 + context.setFillStyle('#f2f1f6'); + context.rect(0,0,554*unit,899*unit); + context.fill(); + // 2.商城名称 + let shopName = this.data.sto_sele_name_1; + // let shopNameLen = context.measureText(shopName); + // let x_shopNameLen = (554 - shopNameLen.width)/2*unit; + // console.log('11111111111111',shopNameLen,x_shopNameLen); + context.setTextAlign('center'); + context.setFontSize(26*unit); + context.setFillStyle('black'); + context.fillText(shopName, 277*unit, 60*unit); + // // 3.推荐来源 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`; + // let fromTextLen = context.measureText(fromText); + // let x_fromText = (375 - fromTextLen.width)/2; + // console.log('222222',fromTextLen,x_fromText); + context.setTextAlign('center'); + context.setFontSize(22*unit); + context.setFillStyle('#96959a'); + context.fillText(fromText, 277*unit, 105*unit); + // 4.海报背景 + // context.beginPath(); + // context.setStrokeStyle('#f2f1f6'); + context.setFillStyle('white'); + context.fillRect(37*unit, 157*unit, 480*unit, 673*unit); + // context.stroke(); + // context.fill(); + // 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.强烈推荐 + // context.beginPath(); + let tj_path = "../../../images/share/q_tj.png"; + context.beginPath() + context.drawImage(tj_path, 54*unit, 648*unit, 85*unit, 30*unit); + context.setFontSize(16*unit) + context.setLineJoin('round'); //交点设置成圆角 + context.setFillStyle("white") + context.setTextAlign('left'); + context.fillText('强烈推荐', 64*unit, 672*unit); + // 7.商品价格 + let price = '¥' + this.data.data.shop_price; + // if (th.data.prom_act) + // pri0 = th.data.prom_act.price; + context.setFontSize(32*unit); + context.setFillStyle('#DE1117'); + context.fillText(price, 54*unit, 730*unit); + // 8.商品标题 + context.setFontSize(20*unit); + context.setFillStyle('#898989'); + this.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); + 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(); + + }, + + //--定义的保存图片方法,分享团--- saveImageToPhotosAlbum: function () { @@ -4222,10 +4317,8 @@ Page({ 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; - if(th.data.sele_g.prom_type==1){ - 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; @@ -4241,67 +4334,90 @@ Page({ os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; console.log(path3); + - //读取文件成功则OK-- + // 读取文件成功则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"; // context.fillStyle="#FFFFFF"; // context.fillRect(0,0,554 * unit, 899 * unit); + + // if(type == 0) { + // this.drawPoster(context); + // return false; + // }; + //-- 如果有自定义海报的时候,判断背景的图片 -- if (th.data.share_b_img) { pg_path = th.data.share_b_img; } - context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); + // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); + + + if(type == 0) { // 如果是普通商品,绘制新海报 + th.drawPoster(context, unit, th.data.share_goods_img, vpath); + } else { + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); + }; + + // th.drawPoster(context, unit, th.data.share_goods_img, vpath); + //-- 是自定义海报的情况下 -- - 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); - } + if(type != 0) { + + 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 == 6 || th.data.prom_type == 4) { @@ -4312,7 +4428,7 @@ Page({ //---产品名称--- //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 - if (type != 4) { + if (type != 4 && type != 0) { context.setFillStyle("black"); context.setFontSize(21.3 * unit) th.draw_Text(context, share_title, @@ -4345,7 +4461,7 @@ Page({ context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit); context.stroke(); - } else { + } else if(type == 4 && type != 0) { context.setFillStyle("black"); context.setFontSize(21.3 * unit) th.draw_Text(context, share_title, @@ -4365,10 +4481,15 @@ Page({ } //---中间大图--- - context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); + if(type != 0) { + context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); + }; + + + //-------大图后面就不一样了----------- switch (type) { - case 0: //普通商品的展示 + case 0: break;//普通商品的展示 case 4: //中间的几个字 if (th.data.poster && parseInt(th.data.poster.style) == 2) { @@ -4435,7 +4556,6 @@ Page({ context.fillText("长按识别二维码", 40 * unit, 806 * unit); context.fillText("立即开始兑换", 40 * unit, 846 * unit); - } //---二维吗图--- @@ -4447,7 +4567,7 @@ Page({ } else { //---二维吗图--- context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); - } + }; break; case 1: //秒杀商品的展示 @@ -4490,7 +4610,6 @@ Page({ 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); @@ -4536,7 +4655,6 @@ Page({ 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); @@ -4587,45 +4705,50 @@ Page({ //--- 如果是自定义海报的时候 --- - 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(); - } + if(type != 0) { + + 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(); + } + + }; + //把画板内容绘制成图片,并回调 画板图片路径 @@ -5748,7 +5871,7 @@ Page({ }; //获取秒杀的多规格 getApp().request.promiseGet(url, {data:req_data}).then(res=>{ - if(res.data.code==0 && res.data.data){ + if(res.data.code==0 && res.data.data && res.data.data.length){ th.setData({more_flash:res.data.data}); }else{ func(false); diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index 5aecce7..3c7a5f3 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -87,7 +87,8 @@ 零售价¥{{filters.toFix(data.market_price,2)}} - + + + + + + 已成团{{prom_act.buy_num}}期 + + + + + {{prom_act.ct_num}}人团 + + + 距活动结束还有 距活动开始还有 @@ -204,6 +217,72 @@ + + + + + + @@ -246,6 +325,9 @@ + + + @@ -281,7 +363,8 @@ - + + @@ -289,14 +372,13 @@ - - {{g_filters.get_card_price(data,card_list,0)}} + {{g_filters.get_card_price(data,card_list,0)}} - + - 销量:{{sele_g.sales_sum}}件 - 折扣:{{sele_g.disc}}折 + 销量:{{data.sales_sum}}件 + 折扣:{{data.disc}}折 {{categories3[0].num}}人评价 @@ -420,10 +499,7 @@ 选择门店 - - 更多门店 - - + 更多门店 @@ -498,6 +574,7 @@ + @@ -1113,10 +1190,7 @@ 选择门店 - - 更多门店 - - + 更多门店 (库存不足) @@ -1384,10 +1458,7 @@ - - {{choice_sort_store==0?'更多门店':'返回'}} - - + {{choice_sort_store==0?'更多门店':'返回'}} diff --git a/pages/goods/goodsInfo/goodsInfo.wxss b/pages/goods/goodsInfo/goodsInfo.wxss index 8cb1bfc..66fc945 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxss +++ b/pages/goods/goodsInfo/goodsInfo.wxss @@ -2690,7 +2690,7 @@ border-radius: 55rpx; } .carde_frame{ height: 50rpx; - line-height: 18rpx + /* line-height: 18rpx */ } button.custom-service { line-height: normal; border: 0;} @@ -2858,4 +2858,21 @@ button.custom-service::after{ color: #fff; } -.mt20{ margin-top: 20rpx} \ No newline at end of file +.mt20{ margin-top: 20rpx} + +.group .group-list.luck { + padding: 0 20rpx; + justify-content: flex-start; +} + +.group-list.luck .gtou ~ .gtou { + margin-left: -16rpx; +} + +.gtou.more { + background-color: #ddd; + text-align: center; + line-height: 70rpx; + border-radius: 50%; + color: #aaa; +} \ No newline at end of file diff --git a/pages/goods/goodsList/goodsList.wxml b/pages/goods/goodsList/goodsList.wxml index 6318e21..381a377 100644 --- a/pages/goods/goodsList/goodsList.wxml +++ b/pages/goods/goodsList/goodsList.wxml @@ -177,7 +177,7 @@ {{item.goods_name}} - + diff --git a/pages/goods/search/search.wxml b/pages/goods/search/search.wxml index e8c8f42..a27767a 100644 --- a/pages/goods/search/search.wxml +++ b/pages/goods/search/search.wxml @@ -35,7 +35,7 @@ {{item.goods_name}} - + {{item.prom_integral}}积分 diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml index e8b0e0f..b78889d 100644 --- a/pages/index/index/index.wxml +++ b/pages/index/index/index.wxml @@ -215,7 +215,52 @@ - + + + + + + + + + + + 幸运购 + + + 查看全部 + + + + + + + + + + + 我是商品 + + + 189.00 + 零售价:155 + + + + 去参团 + + + + + + *5人成团,5人得商品,5人全额退款并得惊喜礼品 + + + + + + + diff --git a/pages/index/index/index.wxss b/pages/index/index/index.wxss index d956d5e..fb89c60 100644 --- a/pages/index/index/index.wxss +++ b/pages/index/index/index.wxss @@ -2,7 +2,8 @@ background: #ff7295; } -.icon-presell { +.icon-presell, +.icon-luck { color: #ED6064; font-size: 18px; margin-right: 4rpx; @@ -1115,3 +1116,82 @@ page { margin-right: 10rpx; } + + +/* .luck { + padding-left: 20rpx; + padding-right: 20rpx; +} */ + +.luck .list-item { + background-color: white; + padding: 20rpx; + border-radius: 12rpx; +} + +.luck .img-container { + width: 200rpx; + height: 200rpx; + border-radius: 14rpx; + overflow: hidden; + flex-shrink: 0; + position: relative; +} + +.luck .img-container::before { + content: '幸运购'; + position: absolute; + left: 0; + top: 0; + padding: 4rpx; + background-color: rgba(255,103,103,.7); + color: white; + font-size: 22rpx; + border-radius: 0 0 14rpx 0; +} + +.luck .name::before { + content: '5人团'; + background-color: #FF6768; + color: white; + font-size: 26rpx; + padding-left: 10rpx; + padding-right: 10rpx; + border-radius: 20rpx; + margin-right: 10rpx; +} + +.rmb::before { + content: '¥'; + font-size: 24rpx; +} + +.del { + text-decoration: line-through; +} + +.luck .btn { + background-color: #FF6768; + border-radius: 20rpx; + padding-left:20rpx; + padding-right: 20rpx; + color: white; +} + +.luck .name { + height: 88rpx; +} + + +.luck .progress { + position: relative; +} +.luck .progress::before { + position: absolute; + width: 100%; + content: attr(data-content); + font-size: 20rpx; + color: white; + text-align: center; +} + diff --git a/pages/togoin/togoin.js b/pages/togoin/togoin.js index 2f09226..56c47b6 100644 --- a/pages/togoin/togoin.js +++ b/pages/togoin/togoin.js @@ -64,6 +64,14 @@ Page({ //-- 会员授权 -- bindGetUserInfo: function(ee) { + + if(!this.data.isAgree) { + wx.showToast({ + title: '请您先阅读和勾选指定的内容', + icon: 'none', + }); + return false; + } var that = this; //-- 点击授权 -- that.getUserProfile(function(res){ @@ -286,7 +294,30 @@ Page({ close_pop_back:function(){ this.close_pop(); wx.navigateBack({ delta: 1}) - } + }, + + + // 是否同意协议 + isAgree(e) { + let isAgree = null; + if(e.detail.value[0]) { + isAgree = true; + } else { + isAgree = false; + }; + // this.data.isAgree = isAgree; + this.setData({ + isAgree, + }); + }, + + + //通过路径跳转到其他页面 + goto: function(e) { + console.log('xxxx', e); + var url = e.currentTarget.dataset.url; + getApp().goto(url); + }, diff --git a/pages/togoin/togoin.wxml b/pages/togoin/togoin.wxml index 6973d20..8b6ebf5 100644 --- a/pages/togoin/togoin.wxml +++ b/pages/togoin/togoin.wxml @@ -2,7 +2,7 @@ - + @@ -14,6 +14,13 @@ + + + + + + 我已阅读同意 《用户使用协议》《隐私政策》 + diff --git a/pages/togoin/togoin.wxss b/pages/togoin/togoin.wxss index 4563ed4..64b347e 100644 --- a/pages/togoin/togoin.wxss +++ b/pages/togoin/togoin.wxss @@ -4,7 +4,7 @@ page{ } .logins { width: 100%; - padding-bottom: 130rpx; + /* padding-bottom: 130rpx; */ background-position: center; background-repeat: no-repeat; background-size: cover @@ -26,7 +26,7 @@ page{ border-radius: 48rpx; color: rgb(255,255,255); font-size: 32rpx; - margin-top:150rpx; + margin-top: 40rpx; } .we_chat{ width: 55rpx; @@ -65,3 +65,13 @@ button{ .middle_view{ position: absolute; left: 0; width: 100%; text-align: center; } + +/*checkbox 选项框大小 */ +checkbox .wx-checkbox-input { + width: 30rpx; + height: 30rpx; +} + +.gray { + color: #767f8e; +} diff --git a/pages/user/index/index.js b/pages/user/index/index.js index 73e6d66..7b79d40 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -67,7 +67,7 @@ Page({ getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{ var dis=rs.data.data; for(var i in d_list){ - if(d_list[i].name=='我的分销' && dis && dis.switch==0){ + if(d_list[i].name=='我的分销' && (!dis || dis.switch==0)){ d_list.splice(i,1); } } diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js index ad29c11..277b338 100644 --- a/pages/user/order_detail/order_detail.js +++ b/pages/user/order_detail/order_detail.js @@ -1441,6 +1441,28 @@ Page({ corpId: id, success(res) {} }) + }, + + //跳转到商品 + go_gd:function (e) { + var gd= e.currentTarget.dataset.gd; + var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; + var url="/api/weshop/activitylist/getGoodActInfo"; + var req_data={ + store_id:os.stoid,goodsidlist:gd,is_detail:1 + }; + //获取秒杀的多规格 + getApp().request.promiseGet(url, {data:req_data}).then(res=>{ + if(res.data.code==0 && res.data.data){ + if(res.data.data.length==1){ + good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; + } + getApp().goto(good_url); + + }else{ + getApp().goto(good_url); + } + }) } diff --git a/pages/user/order_detail/order_detail.wxml b/pages/user/order_detail/order_detail.wxml index af5b3ea..6d4f920 100644 --- a/pages/user/order_detail/order_detail.wxml +++ b/pages/user/order_detail/order_detail.wxml @@ -20,12 +20,12 @@ - + - - + + {{item.goods_name}} {{filters.show_gui_ge(item.goods_spec,item.goods_color)}} diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index 4ade40e..19ec610 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -1205,7 +1205,7 @@ Page({ b_item.prom_type = 7; b_item.prom_id = res.data.data.id; good.prom_type = 7; - good.prom_id = prom.b_item.prom_id; + good.prom_id = b_item.prom_id; } }