diff --git a/components/diy_luckyGo/diy_luckyGo.js b/components/diy_luckyGo/diy_luckyGo.js new file mode 100644 index 0000000..3fb2f91 --- /dev/null +++ b/components/diy_luckyGo/diy_luckyGo.js @@ -0,0 +1,231 @@ +// var e = function(e) { +// return e && e.__esModule ? e : { +// default: e +// }; +// }(require("../../utils/LoadMore3.js")), +// n = new e.default(), +var t = getApp(), + a = t.request, + o = t.globalData.setting, + os = o, + i = require("../../utils/util.js"), + ut = i, + s = require("../../utils/common.js"); +var regeneratorRuntime = require('../../utils/runtime.js'); +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + object: { + type: Object, + value: null, + }, + goods_array: { + type: Array, + value: [] + }, + newTime: { + type: Number, + value: 0 + }, + }, + data: { + // 这里是一些组件内部数据 + yc: false, + someData: null, + ylp_img: "https://mshopimg.yolipai.net/", + imghost: os.imghost, + timer: null, + }, + + pageLifetimes: { + //要处理一下,游客登录后的界面的变化,主要还该是改变会员 + show: function () { + //会员身份变化 + var th = this; + var g_id = this.data.object; + this.init(g_id); + setTimeout(function () { + if (th.data.goods_array && th.data.goods_array.length > 0) { + th.data.timer = setInterval(function () { + th.countDown2(th); + }, 1000); + } + },600) + } + }, + + ready: function () { + var g_id = this.data.object; + this.init(g_id); + }, + detached() { + // 页面被被销毁的时候,清除定时器 + clearInterval(this.data.timer); + }, + methods: { + // 这里是一个自定义方法 + customMethod: function () { }, + init: function (g_id) { + var th = this, app = getApp(), goodsidlist = ""; + if (g_id.data_type == 2) { + if (g_id.data && g_id.data.length > 0) { + //--先把商品ID串起来-- + g_id.data.forEach(function (val, ind) { + var item = {}; + goodsidlist += val.goodsid + ","; + }) + 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+"&user_id="+user_id, {}).then(res => { + console.log(res); + //如果秒杀的数组为空的时候 + var goodslist = res.data.data; + //就算是添加的活动已经过期,就要用最新的进行中活动 + if (goodslist && goodslist.length > 0) { + th.set_goods_list(g_id.data, goodslist); + } + }); + } + } else { + th.no_gid_set(); + } + }, + + //当是默认的情况 + no_gid_set() { + var user_id=getApp().globalData.user_id; + if(!user_id){ user_id=0;} + // var req={ store_id: os.stoid, is_end: 0, is_show: 1, timetype: 2,user_id:user_id}; 原来的 + var req={ store_id: os.stoid, is_end: 0, timetype: 1}; + getApp().request.promiseGet("/api/weshop/prom/luckyActivity/page", + { isShowLoading: 1, data:req } + ).then(res => { + if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) { + var goodsidlist = res.data.data.pageData; + this.set_goods_list(null, goodsidlist); + // console.log('goodsidlist', goodsidlist); + } + }); + }, + + //就算是添加的活动已经过期,就要用最新的活动 + set_goods_list(g_id, goodslist) { + // 判断火热,预热 + var newTime = ut.gettimestamp(), all_array = [], th = this; + th.setData({ newTime: newTime }); + if (g_id) { + /*--商品队列按照添加的顺序排列--*/ + 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); + } + }) + }) + } else { + all_array = goodslist; + } + + + if (all_array.length == 0) { + all_array = goodslist; + } + + for(let i in all_array){ + let item=all_array[i]; + if(item.user_price) item.price=item.user_price; + } + + var arr = new Array(); + //--三个三个一组--- + for (var i = 0; i < all_array.length; i += 3) { + arr.push(all_array.slice(i, i + 3)); + } + /*--熏染到前台--*/ + + th.setData({ goods_array: arr }); + console.log('goods_array', arr); + + th.data.timer = setInterval(function () { + th.countDown2(th); + }, 1000); + }, + + + + //---小于10的格式化函数---- + timeFormat: function (param) { + return param < 10 ? '0' + param : param; + }, + //----秒杀倒计时函数----- + countDown2: function (ob) { + if (ob == undefined) return false; + var ee = ob; + // 获取当前时间,同时得到活动结束时间数组 + var newTime = ut.gettimestamp(); + this.setData({ newTime: newTime }); + + var List = ee.data.goods_array; + if (List.length == 0) return false; + for (var j = 0; j < List.length; j++) { + // 对结束时间进行处理渲染到页面 + var endTimeList = List[j]; + for (var i = 0; i < endTimeList.length; i++) { + var o = endTimeList[i]; + var endTime = o.end_time; + if (newTime < o.start_time) 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) + } + } else { + //活动已结束,全部设置为'00' + obj = { + day: '00', + hou: '00', + min: '00', + sec: '00' + } + } + var txt = "goods_array[" + j + "][" + i + "].djs"; + ee.setData({ + [txt]: obj + }); + } + } + }, + + + //图片失败,默认图片 + bind_bnerr3: function (e) { + var _errImg = e.target.dataset.errorimg; + var _errObj = {}; + _errObj[_errImg] = "/public/images/default_goods_image_240.gif"; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + }, + + go: function (e) { + let url = e.currentTarget.dataset.url; + getApp().goto(url); + } + }, + + +}) \ No newline at end of file diff --git a/components/diy_luckyGo/diy_luckyGo.json b/components/diy_luckyGo/diy_luckyGo.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_luckyGo/diy_luckyGo.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_luckyGo/diy_luckyGo.wxml b/components/diy_luckyGo/diy_luckyGo.wxml new file mode 100644 index 0000000..af81d04 --- /dev/null +++ b/components/diy_luckyGo/diy_luckyGo.wxml @@ -0,0 +1,85 @@ + + + + + 幸运购 + + + + + + + + + + + + + + + + + + + + {{aitem.title}} + + + {{filters.price(aitem.group_price)}} + {{aitem.market_price}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{aitem.title}} + + + {{filters.price(aitem.group_price)}} + 零售价:{{aitem.market_price}} + + + + 已抢光 + 去参团 + + + + + *{{aitem.group_num}}人成团,{{aitem.group_win}}人得商品,{{aitem.group_num - aitem.group_win}}人全额退款并得惊喜礼品 + + + + + + + diff --git a/components/diy_luckyGo/diy_luckyGo.wxss b/components/diy_luckyGo/diy_luckyGo.wxss new file mode 100644 index 0000000..eb3a155 --- /dev/null +++ b/components/diy_luckyGo/diy_luckyGo.wxss @@ -0,0 +1,137 @@ +@import '../../app.wxss'; + + + +.s_it { + width: 100%; + display: flex; + background-color: white; +} + + + + + + +swiper { + height: 450rpx; +} + +.nav { + width: calc(100% / 3); + box-sizing: border-box; +} + +.arrow-r { + width: 30rpx; + height: 30rpx; +} + +.icon-luck { + color: #ED6064; + margin-right: 4rpx; +} + + + + +.list-item { + background-color: white; + padding: 20rpx; +} + +.img-container { + width: 220rpx; + height: 220rpx; + border-radius: 14rpx; + overflow: hidden; + flex-shrink: 0; + position: relative; +} + +.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; +} + + + +.img-container.row::before { + content: attr(data-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; +} + +.name::before { + content: attr(data-content); + background-color: #FF6768; + color: white; + font-size: 24rpx; + padding-left: 10rpx; + padding-right: 10rpx; + border-radius: 20rpx; + margin-right: 10rpx; +} + +.name.clearbadge::before { + content: none; +} + +.rmb::before { + content: '¥'; + font-size: 24rpx; +} + +.del { + text-decoration: line-through; +} + +.btn { + background-color: #FF6768; + border-radius: 20rpx; + padding-left:20rpx; + padding-right: 20rpx; + color: white; +} + +.name { + height: 88rpx; +} + +.no-more { + font-size: 24rpx; + line-height: 2; + text-align: center; + padding-top: 20rpx; + padding-bottom: 20rpx; + color: #ccc; +} + +.progress { + position: relative; +} +.progress::before { + position: absolute; + width: 100%; + content: attr(data-content); + font-size: 20rpx; + color: white; + text-align: center; +} + +.btn.gray { + background-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 index a975c52..5a235c2 100644 --- a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js @@ -986,7 +986,7 @@ Page({ // } // } return { - title: "邀你一起参加幸运购", + title: "邀您一起参加幸运购", path: pagePath, imageUrl: imgPath, } diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 5ce06a8..0e02998 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -702,7 +702,7 @@ Page({ //---展示--- onShow: function () { - console.log('djfijsaoifjoisadjfoij'); + // console.log('djfijsaoifjoisadjfoij'); var goods_list = null, th = this, that = this; var show_prew_img = this.data.show_prew_img if (show_prew_img) { @@ -844,7 +844,7 @@ Page({ //获取统一条形码,普通商品和优惠促销的商品 - if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5 || ee.data.data.prom_type == 7) { + if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5 || ee.data.data.prom_type == 7 || ee.data.data.prom_type == 9) { //默认门店要拿下门店库存 if (that.data.sales_rules == 2 && that.data.is_newsales_rules) { //获取门店 @@ -3027,7 +3027,7 @@ Page({ var user_id=getApp().globalData.user_id; if(!user_id) user_id=0; - if (prom_type == 3 || prom_type == 0 || prom_type == 5 || prom_type == 7) { + if (prom_type == 3 || prom_type == 0 || prom_type == 5 || prom_type == 7 || prom_type == 9) { this.setData({ prom_type: 0,isshow: 1, }); diff --git a/pages/index/index/index.json b/pages/index/index/index.json index 0f62f01..c7badaa 100644 --- a/pages/index/index/index.json +++ b/pages/index/index/index.json @@ -19,7 +19,8 @@ "service": "/components/diy_service/diy_service", "scan": "/components/diy_scan/diy_scan", "store_select": "/components/diy_store_select/diy_store_select", - "presell": "/components/diy_pregoods/diy_pregoods" + "presell": "/components/diy_pregoods/diy_pregoods", + "luckyGo": "/components/diy_luckyGo/diy_luckyGo" }, "enablePullDownRefresh": false } \ No newline at end of file diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml index 9a5b471..32d715e 100644 --- a/pages/index/index/index.wxml +++ b/pages/index/index/index.wxml @@ -505,6 +505,11 @@ + + + + + diff --git a/pages/index/index/index.wxss b/pages/index/index/index.wxss index f0c8adf..c881b75 100644 --- a/pages/index/index/index.wxss +++ b/pages/index/index/index.wxss @@ -64,7 +64,7 @@ width: 48rpx; height: 48rpx; margin: 0 18rpx; - border-radius: 50%; + /* border-radius: 50%; */ overflow: hidden; } diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index fc677ee..7a63157 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -195,6 +195,22 @@ Page({ } }) } + // 如果是幸运购活动 + if(glist[0].prom_type==9){ + await getApp().request.promiseGet('/api/weshop/prom/luckyOrder/list', { + data: { + store_id: os.stoid, + user_id: oo.user_id, + order_id: item.order_id, + } + }).then(res => { + if(res.data.code==0){ + // console.log('luckyGo', res.data.data[0]['team_status']); + data[ind]['team_status'] = res.data.data[0]['team_status']; + // data[ind]['ord_url']='/packageC/pages/presell/cart/cart'; + } + }) + } //------------对比一下有没有退款记录------------ await getApp().request.promiseGet("/api/weshop/order/returngoods/page", { data: { diff --git a/pages/user/order_list/order_list.wxml b/pages/user/order_list/order_list.wxml index c411b46..474e163 100644 --- a/pages/user/order_list/order_list.wxml +++ b/pages/user/order_list/order_list.wxml @@ -40,7 +40,7 @@ 订单编号:{{item.order_sn}} - + 尾款支付失败 @@ -64,6 +64,19 @@ 退款中 + + + 已退款 + 已支付,待成团 + 未支付 + 待发货 + 待收货 + 待评价 + 已评价 + 已取消 + + + 组团中 @@ -82,6 +95,8 @@ 退款中 + +