diff --git a/app.js b/app.js index cc2b2b6..38e250f 100644 --- a/app.js +++ b/app.js @@ -72,7 +72,7 @@ App({ room_id:null, //直播间分享的房间ID room_goods_id:null, //直播间分享的商品ID - + }, auth: o, request: a, @@ -106,7 +106,12 @@ App({ app.globalData.user_id= user.user_id; } wx.setStorageSync("userinfo",user); - } + }else{ + user=null; + app.globalData.userInfo=null; + app.globalData.user_id= 0; + wx.setStorageSync("userinfo",null); + } }) } } @@ -246,6 +251,7 @@ App({ //----------------获取商家开启的物流-------------------- getwuliu: function (t, o){ + this.globalData.wuliu=null; var th = this, st = this.globalData.setting; this.globalData.wuliu && !o ? "function" == typeof t && t(this.globalData.wuliu) : a.get("/api/weshop/storeshipping/list", { @@ -612,9 +618,7 @@ App({ this.globalData.config2=null; //清除config2的缓存 this.globalData.config=null; //清除config的缓存 this.globalData.gr_index=0; //商品分组的序列 - for(var i = 1; i < 50; i++) { - clearInterval(i); - } + }, clear_word:function (word) { @@ -716,7 +720,7 @@ App({ }); }, - + }); diff --git a/app.json b/app.json index 2a3e288..88cba8b 100644 --- a/app.json +++ b/app.json @@ -154,7 +154,11 @@ "pages/user/view_comment/view_comment", "pages/user/add_comment/add_comment", "pages/user/user_coupon/user_coupon", - "pages/user/buyDetails/buyDetails" + "pages/user/buyDetails/buyDetails", + "pages/evaluate/evaluate", + "pages/evaluate_list/evaluate_list", + "pages/luckactivity/luckinfo/luckinfo", + "pages/luckactivity/index/index" ] } diff --git a/app.wxss b/app.wxss index 51e5315..9b0bd37 100644 --- a/app.wxss +++ b/app.wxss @@ -25,6 +25,9 @@ .pdt10 { padding-top: 10rpx; } +.pdt12 { + padding-top: 12rpx; +} .pdb10 { padding-bottom: 10rpx; } @@ -84,6 +87,11 @@ padding-right: 40rpx; } +.w20 { + width: 20%; + box-sizing: border-box; +} + .w25 { width: 25%; box-sizing: border-box; @@ -117,6 +125,10 @@ color: #c7c7c7; } +.c-7b { + color: #7b7b7b; +} + .c-d { color: #ddd; } @@ -129,7 +141,7 @@ color: #555; } -.c7b { +.c-7b { color: #7b7b7b; } @@ -165,6 +177,7 @@ margin-left: 20rpx; } + .mgb20 { margin-bottom: 20rpx; } @@ -179,6 +192,10 @@ margin-right: 20rpx; } +.mgt30 { + margin-top: 30rpx; +} + .h68 { height: 68rpx; } @@ -561,9 +578,7 @@ background: #b9b9b9; color: #333; } -.xc-black3{ -color: #333; -} + .xc-fixed{ position: fixed; @@ -627,6 +642,9 @@ background: #ffe3e2; .fs40 { font-size: 40rpx !important; } +.fs50 { + font-size: 50rpx !important; +} .ai_c { align-items: center; } @@ -671,9 +689,9 @@ background: #ffe3e2; /* 图标字体(ty) */ @font-face { font-family: 'iconfont'; /* Project id 2054717 */ - src: url('//at.alicdn.com/t/font_2054717_vx6pr6zmhth.woff2?t=1623117016358') format('woff2'), - url('//at.alicdn.com/t/font_2054717_vx6pr6zmhth.woff?t=1623117016358') format('woff'), - url('//at.alicdn.com/t/font_2054717_vx6pr6zmhth.ttf?t=1623117016358') format('truetype'); + src: url('//at.alicdn.com/t/font_2054717_l5nx11noek8.woff2?t=1626055955086') format('woff2'), + url('//at.alicdn.com/t/font_2054717_l5nx11noek8.woff?t=1626055955086') format('woff'), + url('//at.alicdn.com/t/font_2054717_l5nx11noek8.ttf?t=1626055955086') format('truetype'); } .iconfont { @@ -684,6 +702,26 @@ background: #ffe3e2; -moz-osx-font-smoothing: grayscale; } +.icon-zhuanpan:before { + content: "\e642"; +} + +.icon-tel:before { + content: "\e610"; +} + +.icon-liwu:before { + content: "\e64e"; +} + +.icon-share:before { + content: "\e785"; +} + +.icon-shuangjiantouxia:before { + content: "\e660"; +} + .icon-plyy:before { content: "\e729"; } diff --git a/components/diy_store_select/diy_store_select.wxss b/components/diy_store_select/diy_store_select.wxss index 105ad22..9fc3390 100644 --- a/components/diy_store_select/diy_store_select.wxss +++ b/components/diy_store_select/diy_store_select.wxss @@ -1,163 +1,212 @@ -.store_sele{width: 100%;z-index: 8; height: 88rpx; padding: 0 15rpx;position: fixed; color: white; - top: 0; left: 0; background-color: #ff7295; font-size: 30rpx; } - - .store_sele1{ height: 100rpx; padding: 0 15rpx; color: #666;background-color: #fff; font-size: 32rpx;} - - -.logo_box{ width: 64rpx; height:64rpx;margin-right: 15rpx; } +.store_sele { + width: 100%; + z-index: 8; + height: 60rpx; + padding: 0 15rpx; + /* position: fixed; */ + color: white; + /* top: 0; + left: 0; */ + background-color: #ff7295; + font-size: 26rpx; + box-sizing: border-box; +} + +.store_sele1 { + height: 100rpx; + padding: 0 15rpx; + color: #666; + background-color: #fff; + font-size: 32rpx; +} + + +.logo_box { + width: 48rpx; + height: 48rpx; + margin-right: 10rpx; +} + .pd-view { - height: 80rpx; + /* height: 80rpx; */ +} + +.circle { + border-radius: 50%; } -.circle{ border-radius: 50%;} /*-- 门店选择 --*/ /* 选择门店的弹窗 */ -.mongolia-layer{ -position: fixed; -left: 0; -top: 0; -right: 0; -bottom: 0; -z-index: 11; -background: rgba(0,0,0,0.4); -width: 100%; -height: 91.9%; - -} - -.popup-frame{ -position: fixed; -bottom:110rpx; -z-index: 20; -background: white; -width: 100%; -border-radius: 20rpx 20rpx 0 0; -height: 72%; - -} -.popup-top{ - border-bottom: 1rpx solid #eee; - height: 155rpx; - width: 95%; - margin: auto; - line-height: 155rpx; - -} -.bg_rights{ - border-top: 2rpx solid ; - border-right: 2rpx solid ; - transform: rotate(45deg); - display:inline-block; - width:15rpx;height:15rpx; - border-color:#da0b31; +.mongolia-layer { + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 11; + background: rgba(0, 0, 0, 0.4); + width: 100%; + height: 91.9%; + +} + +.popup-frame { + position: fixed; + bottom: 110rpx; + z-index: 20; + background: white; + width: 100%; + border-radius: 20rpx 20rpx 0 0; + height: 72%; + +} + +.popup-top { + border-bottom: 1rpx solid #eee; + height: 155rpx; + width: 95%; + margin: auto; + line-height: 155rpx; + +} + +.bg_rights { + border-top: 2rpx solid; + border-right: 2rpx solid; + transform: rotate(45deg); + display: inline-block; + width: 15rpx; + height: 15rpx; + border-color: #da0b31; } + .modal-closes { - position: absolute; - right: 30rpx; - top: -15rpx; - height: 25rpx; - -} -.choose_more{ - margin-top: 40rpx; - margin-right: 20rpx; - -} -.choose_mores{ - margin-top: 30rpx; - margin-right: 15rpx; - -} -.store-list{ - width: 95%; - height: 72%; - overflow-y: scroll; - margin: auto; -} -.store-list .store_choose{ - width: 100%; - height: 120rpx; - line-height: 125rpx; - border-bottom: 1rpx solid #eee; - -} -.store-list .store_choose .store{ -width: 100%; -margin: auto; -line-height: 37rpx; -padding-left: 20rpx; - -} -.xc-hook{ - width: 35rpx; - height: 35rpx; - transform: rotate(-145deg); -line-height: 37rpx; -text-align: center; -} - .xc-hooks{ - width: 30rpx; - height: 30rpx; - border: 1rpx solid #999; - } - .address-frame{ - width: 93%; -margin-left: 7rpx; - - } - .nearby_store{ -margin-left: 17rpx; - } - .address_name{ - margin-right: 10rpx; - - } - .address-val{ - height: 38rpx; -line-height: 38rpx; - - } - .store-bottom{ - width: 85%; - margin: auto; - height: 70rpx; - } - .determine{ - width: 260rpx; - height: 55rpx; - border-radius: 50rpx; - line-height: 55rpx; - } - .default{ - width: 260rpx; - height: 55rpx; - border:3rpx solid #c8c8c8; - border-radius: 50rpx; - line-height: 55rpx; - } - .store-bottom-frame{ - width: 95%; - margin: auto; - } - - - /* 门店分类列表 */ - .sort_store_list{ - height: 82%; - overflow: hidden; - overflow-y: scroll; - width: 95%; - margin: auto; - } - .sort_store_list .sort-store-frame{ - width: 100%; - height: 100rpx; - line-height:100rpx; - border-bottom: 1rpx solid #eee; - - } - .sort_store_list .sort-store-frame .sort-store{ - width: 94.5%; - margin: auto; - } - .ai_center{ align-items: center;} \ No newline at end of file + position: absolute; + right: 30rpx; + top: -15rpx; + height: 25rpx; + +} + +.choose_more { + margin-top: 40rpx; + margin-right: 20rpx; + +} + +.choose_mores { + margin-top: 30rpx; + margin-right: 15rpx; + +} + +.store-list { + width: 95%; + height: 72%; + overflow-y: scroll; + margin: auto; +} + +.store-list .store_choose { + width: 100%; + height: 120rpx; + line-height: 125rpx; + border-bottom: 1rpx solid #eee; + +} + +.store-list .store_choose .store { + width: 100%; + margin: auto; + line-height: 37rpx; + padding-left: 20rpx; + +} + +.xc-hook { + width: 35rpx; + height: 35rpx; + transform: rotate(-145deg); + line-height: 37rpx; + text-align: center; +} + +.xc-hooks { + width: 30rpx; + height: 30rpx; + border: 1rpx solid #999; +} + +.address-frame { + width: 93%; + margin-left: 7rpx; + +} + +.nearby_store { + margin-left: 17rpx; +} + +.address_name { + margin-right: 10rpx; + +} + +.address-val { + height: 38rpx; + line-height: 38rpx; + +} + +.store-bottom { + width: 85%; + margin: auto; + height: 70rpx; +} + +.determine { + width: 260rpx; + height: 55rpx; + border-radius: 50rpx; + line-height: 55rpx; +} + +.default { + width: 260rpx; + height: 55rpx; + border: 3rpx solid #c8c8c8; + border-radius: 50rpx; + line-height: 55rpx; +} + +.store-bottom-frame { + width: 95%; + margin: auto; +} + + +/* 门店分类列表 */ +.sort_store_list { + height: 82%; + overflow: hidden; + overflow-y: scroll; + width: 95%; + margin: auto; +} + +.sort_store_list .sort-store-frame { + width: 100%; + height: 100rpx; + line-height: 100rpx; + border-bottom: 1rpx solid #eee; + +} + +.sort_store_list .sort-store-frame .sort-store { + width: 94.5%; + margin: auto; +} + +.ai_center { + align-items: center; +} diff --git a/components/full_screen/filter.wxs b/components/full_screen/filter.wxs deleted file mode 100644 index 68e2458..0000000 --- a/components/full_screen/filter.wxs +++ /dev/null @@ -1,12 +0,0 @@ -var format = function (text) { - - if (!text) { - return - } - var reg = getRegExp('\\\\n', 'g') - return text.replace(reg, '\n') -} - -module.exports = { - format: format -} diff --git a/components/full_screen/full_screen.js b/components/full_screen/full_screen.js deleted file mode 100644 index 81f7d8f..0000000 --- a/components/full_screen/full_screen.js +++ /dev/null @@ -1,68 +0,0 @@ -// components/userqy_pop_up/userqy_pop_up.js -var o = getApp().globalData.setting -Component({ - /** - * 页面的初始数据 - */ - data: { - control: 1, - is_full_screen_show:0, //全屏显示 - sec_show:3, //倒计时的秒数 - full_ad:null, //全屏广告 - url:o.imghost, - full_screen:0, - is_full_screen_men:1, - hidden:0, - }, - - pageLifetimes:{ - hide: function() { - // 页面被隐藏 - clearInterval(this.data.full_screen); - }, - }, - - ready: function () {}, - properties: {}, - methods: { - close_full_screen(){ - this.setData({is_full_screen_show:0,sec_show:0}); - }, - //-- 跳转到满屏广告的链接 -- - go_full_ad(){ - if(!this.data.full_ad) return false; - if(!this.data.full_ad.ad_weapplink) return false; - getApp().goto(this.data.full_ad.ad_weapplink); - }, - get_the_full_screen(){ - if(this.data.full_ad) { - return false; - } - var th=this; - //获取全屏的广告 - getApp().request.promiseGet("/api/weshop/ad/page?pid=1001&store_id=" + o.stoid,{ - data: { enabled: 1 } - }).then(res=>{ - //判断是不是有全屏广告 - if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ - th.setData({ - is_full_screen_show:1, - full_ad:res.data.data.pageData[0], - }) - //--定时关闭-- - th.data.full_screen=setInterval(function(){ - if(!th.data.sec_show) { - clearInterval(th.data.full_screen); - th.close_full_screen(); - return false; - } - th.data.sec_show--; - th.setData({sec_show:th.data.sec_show}); - },1000) - - } - }) - } - }, - -}) \ No newline at end of file diff --git a/components/full_screen/full_screen.wxml b/components/full_screen/full_screen.wxml deleted file mode 100644 index ce01065..0000000 --- a/components/full_screen/full_screen.wxml +++ /dev/null @@ -1,7 +0,0 @@ - - - 跳过 {{sec_show}} - - - - diff --git a/components/full_screen/full_screen.wxss b/components/full_screen/full_screen.wxss deleted file mode 100644 index f5220b9..0000000 --- a/components/full_screen/full_screen.wxss +++ /dev/null @@ -1,16 +0,0 @@ -.full_screen{ - position: fixed;left: 0;top: 0; - z-index: 1000000000000; - background-color: rgba(0,0,0,0.4); - width: 100%; - height: 100%; - background-position: center; - background-size: 100% 100%; - background-repeat: no-repeat; -} -.skip_box{ - float: right; margin-top: 10rpx; margin-right: 10rpx; - background-color: gainsboro; width: 120rpx; - height: 48rpx; font-size: 28rpx; line-height: 48rpx; - text-align: center; border-radius: 20rpx; - } \ No newline at end of file diff --git a/components/goods_list/goods_list.wxml b/components/goods_list/goods_list.wxml index 7352331..cdd2466 100644 --- a/components/goods_list/goods_list.wxml +++ b/components/goods_list/goods_list.wxml @@ -4,31 +4,34 @@ - - + + - + {{item.goods_name}} - - {{item.prom_integral}}积分 - + - - - - {{item.prom_price}} - - - - - - - {{item.market_price}} - - + + + {{item.prom_integral}}积分 + + + + + + {{item.prom_price}} + + + + + + + {{item.market_price}} + + + + @@ -48,7 +51,7 @@ - + @@ -64,7 +67,7 @@ {{filter.toFix(item.shop_price,2)}} - + @@ -108,7 +111,7 @@ {{filter.toFix(item.shop_price,2)}} - + @@ -119,7 +122,7 @@ - + @@ -127,14 +130,14 @@ {{filter.toFix(item.shop_price,2)}} - + {{item.market_price}} - + diff --git a/components/goods_list/goods_list.wxss b/components/goods_list/goods_list.wxss index 31d0361..4722ef3 100644 --- a/components/goods_list/goods_list.wxss +++ b/components/goods_list/goods_list.wxss @@ -1,6 +1,10 @@ .collects { - margin-top: 40rpx; - margin-bottom: 40rpx; + /* margin-top: 40rpx; */ + /* margin-bottom: 40rpx; */ +} + +.pdt10 { + padding-top: 10rpx; } .ai-center{ @@ -82,40 +86,53 @@ .goods_name { height: 62rpx; - margin-top: 6rpx; + /* margin-top: 6rpx; */ line-height: 30rpx; } .hang { - width: 100%; - margin: auto; - padding-left: 21rpx; + /* width: 100%; */ + /* margin: auto; + padding-left: 21rpx; */ + display: flex; + flex-wrap: wrap; + /* margin: 0 auto; */ + padding: 0 20rpx; + box-sizing: border-box; + /* justify-content: space-evenly; */ } .hang .collect { - width: 347rpx; - height: 520rpx; + width: calc((100% - 20rpx) / 2); + /* height: 520rpx; */ border-radius: 25rpx; - border: 1rpx solid rgb(214, 214, 214); + border: 2rpx solid #ebedf0; overflow: hidden; - margin-right: 14rpx; - margin-bottom: 5rpx; + box-sizing: border-box; + margin-top: 20rpx; + /* margin-right: 14rpx; + margin-bottom: 5rpx; */ +} + +.hang .collect:nth-child(2n+1) { + margin-right: 20rpx; } .collect .bottom { - padding: 0rpx 20rpx; + padding: 20rpx; } .collect .sp { width: 100%; - height: 326rpx; + height: 340rpx; + display: block; } .collect .money { - margin-top: 28rpx; + /* margin-top: 28rpx; margin-bottom: 8rpx; line-height: 28rpx; - align-items: baseline; + align-items: baseline; */ } .collect .money view { @@ -177,7 +194,7 @@ .nothing .Foil { width: 80rpx; height: 2rpx; - background-color: rgb(138, 138, 138); + background-color: #ebedf0; } .line_th { diff --git a/components/my-qrcode/my-qrcode.js b/components/my-qrcode/my-qrcode.js new file mode 100644 index 0000000..27a6dca --- /dev/null +++ b/components/my-qrcode/my-qrcode.js @@ -0,0 +1,46 @@ +// pages/user/yhq/qr_code/qr_code.js +const { + barcode, + qrcode +} = require('../../utils/index.js') + +Component({ + data: { + q_show:0, + object:null, + index:0, + is_fw:0, + + barcode_canvas:null, + qrcode_canvas:null, + }, + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + }, + ready: function () { + }, + + methods: { + //关闭 + close: function (e) { + this.setData({q_show: 0,barcode_canvas:null,qrcode_canvas:null }); + this.triggerEvent('close',{},{bubbles: true}); + }, + + //打开 + open:function (e) { + this.data.index++; + var list=[{index:this.data.index }]; + + this.setData({q_show: 1,object:e,barcode_canvas:list,qrcode_canvas:list,is_fw:e.is_fw }); + var val=e.val; + + // barcode('barcode'+this.data.index,val, 620, 160,this); + qrcode('qrcode'+this.data.index, val, 520, 520,this); + } + }, + + + + +}) \ No newline at end of file diff --git a/components/full_screen/full_screen.json b/components/my-qrcode/my-qrcode.json index a88fc2f..a74b8d1 100644 --- a/components/full_screen/full_screen.json +++ b/components/my-qrcode/my-qrcode.json @@ -1,4 +1,4 @@ { - "component": true, - "usingComponents": {} + "component": true, + "usingComponents": {} } \ No newline at end of file diff --git a/components/my-qrcode/my-qrcode.wxml b/components/my-qrcode/my-qrcode.wxml new file mode 100644 index 0000000..8406d34 --- /dev/null +++ b/components/my-qrcode/my-qrcode.wxml @@ -0,0 +1,10 @@ + + + + + 兑换码:{{object.val}} + 请向店员出示二维码核销兑换 + + + + diff --git a/components/my-qrcode/my-qrcode.wxss b/components/my-qrcode/my-qrcode.wxss new file mode 100644 index 0000000..ae090c1 --- /dev/null +++ b/components/my-qrcode/my-qrcode.wxss @@ -0,0 +1,122 @@ +@import '../../app.wxss'; + +.xc-pop-up{ + position:fixed; + z-index:5; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + + +.xc-obscuration{ + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 11; + background: rgba(0,0,0,0.4); + width: 100%; + height: 100%; + + + +} + + /* Y */ +.xc-qr-frame{ + /* width:90%; + min-height: 696rpx; + background: #fff; + z-index: 55; + position: fixed; + top:180rpx; */ + /* height: auto; */ + /* padding-bottom:20rpx; */ + /* left:35rpx; */ + /* overflow: hidden; + border-radius: 16rpx; */ +} + +/* 二维码和条形码的边框Y */ +.barqrcode{ + background-color: white; + border-radius: 16rpx; + padding: 0 40rpx 40rpx; + text-align: center; +} +/* 点击条形Y */ +.barcode { + /* background-color: white; + border-radius: 12rpx; */ +} +canvas{ + width:100%; + height:55px; +display:block; + +} +.q_code{ + color: #333; +} + + +/* 二维码边框Y*/ +.qrcode_rim { + width: 550rpx; + height:544rpx; +display:flex; +flex-direction:column; +position: absolute; +left: 75rpx; +top: 5rpx; + +} +.qrcode{ + width: 520rpx; + height: 520rpx; +} +.r-code{ + /* font-size:28rpx; + padding-left: 25rpx; */ + /* margin-top: -5.5rpx; */ + +} + +.shut{ + color: white; + text-align: right; + padding-bottom: 30rpx; + position: relative; +} + + +.icon-close { + font-size: 48rpx; +} + +.shut::after { + content: ''; + width: 2rpx; + height: 32rpx; + background-color: white; + position: absolute; + bottom: 0; + right: 24rpx; +} + +.mt{ margin-top:130rpx} +.mts{ margin-top:70rpx} +.flex{ + display: flex; + justify-content:center; +} + +.code_show{ + text-align: center;position: relative; left: -20rpx; +} + +.c-9 { + color: #999; +} \ No newline at end of file diff --git a/components/share/share.js b/components/share/share.js index 4058661..ab3e5f7 100644 --- a/components/share/share.js +++ b/components/share/share.js @@ -12,7 +12,10 @@ Component({ }, set_type(type){ this.setData({type:type}) - } + }, + send() { + this.triggerEvent('send',{},{bubbles: true}); + }, } }) \ No newline at end of file diff --git a/components/share/share.wxml b/components/share/share.wxml index 7e71849..7bc7b89 100644 --- a/components/share/share.wxml +++ b/components/share/share.wxml @@ -2,7 +2,7 @@ - diff --git a/custom-tab-bar/index.wxss b/custom-tab-bar/index.wxss index 9d5b4b3..a48f6ac 100644 --- a/custom-tab-bar/index.wxss +++ b/custom-tab-bar/index.wxss @@ -1,14 +1,46 @@ -.main_bar{ - width:100%; border-top: 1rpx solid #ebebeb; position: fixed; bottom: 0; left: 0; z-index: 10000; - display: flex; justify-content: space-around; +.main_bar { + width: 100%; + border-top: 1rpx solid #ebebeb; + position: fixed; + bottom: 0; + left: 0; + z-index: 10000; + display: flex; + justify-content: space-around; } -.tabbar_item{ - position:relative;height:100%;float:left;text-align:center;padding:0px 0; + +.tabbar_item { + position: relative; + height: 100%; + float: left; + text-align: center; + padding: 0px 0; } -.tab_img{display: flex; justify-content: center;align-items: center} -.nav_imgage{ - height: 58rpx; width: 58rpx;background-position: center;background-repeat: no-repeat;background-size: auto 92%; + +.tab_img { + display: flex; + justify-content: center; + align-items: center +} + +.nav_imgage { + height: 52rpx; + width: 52rpx; + background-position: center; + background-repeat: no-repeat; + background-size: 100%; +} + +.cart_num { + top: 0; + background-color: red; + color: #fff; + font-size: 20rpx; + border-radius: 50%; + width: 40rpx; + line-height: 40rpx; + height: 40rpx; + position: absolute; + z-index: 100; + right: 30rpx; } -.cart_num{ - top:0;background-color: red;color: #fff;font-size: 20rpx;border-radius: 50%;width: 40rpx;line-height:40rpx;height: 40rpx;position: absolute;z-index: 100;right:30rpx; -} \ No newline at end of file diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js index c06928f..06683ea 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -199,8 +199,10 @@ Page({ //------初始化加载---------- onLoad: function(t) { - console.log("--服务卡项--"); - console.log(t); + // console.log("--服务卡项--"); + // console.log('fdsfasfasf111111111111111====================',t); + + var ee = this, that = ee, @@ -320,7 +322,7 @@ Page({ //如果有开启近距离的话,同时距离优不一样了 if (that.data.lat != null) { //如果经纬度有变化的话 - if( appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){ + if(e && appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){ that.data.fir_def_store=e; that.setData({ def_pick_store: e, @@ -884,7 +886,7 @@ Page({ data: dd, }).then(res => { var e = res; - if (e.data.code == 0) { + if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length>0) { //--普通门店排版-- setTimeout(function(){ var sto_list=th.data.data.storageId; @@ -1078,12 +1080,16 @@ Page({ }); //-----如果没有默认门店,要取第一个门店作为默认店------ if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) { - th.setData({ - def_pick_store:e.data.data.pageData[0], - sto_sele_name: e.data.data.pageData[0].pickup_name, - sto_sele_id: e.data.data.pageData[0].pickup_id, - sto_sele_distr: e.data.data.pageData[0].distr_type - }) + + if(e.data.data && e.data.data.pageData && e.data.data.pageData.length>0){ + th.setData({ + def_pick_store:e.data.data.pageData[0], + sto_sele_name: e.data.data.pageData[0].pickup_name, + sto_sele_id: e.data.data.pageData[0].pickup_id, + sto_sele_distr: e.data.data.pageData[0].distr_type + }) + } + } } }, @@ -1857,7 +1863,8 @@ Page({ }); return false; } - + + if(!item) return false; th.setData({ def_pick_store: item, @@ -1961,6 +1968,9 @@ Page({ } }); + + if(!item) return false; + th.setData({ def_pick_store: item, sto_sele_name: item.pickup_name, @@ -2175,6 +2185,14 @@ Page({ imageUrl:this.data.gallery[0].image_url, } }, + + + + clickCollapse() { + this.setData({ + flag: !this.data.flag, + }) + }, diff --git a/packageA/pages/goodsInfo/goodsInfo.wxml b/packageA/pages/goodsInfo/goodsInfo.wxml index 711a282..dac8e3c 100644 --- a/packageA/pages/goodsInfo/goodsInfo.wxml +++ b/packageA/pages/goodsInfo/goodsInfo.wxml @@ -39,7 +39,7 @@ {{data.goods_name}} - + 销量:{{data.sales_sum}} 有效天数:{{data.validDays?data.validDays:'不限'}} @@ -55,7 +55,7 @@ 选择门店 - + 更多门店 @@ -86,28 +86,42 @@ - - - {{store_config.service_bz}} - + + + + {{store_config.service_bz}} + + + + + + + + + + + + + + - - + + - + 项目名称 耗时(分) 手工费 次数 - + {{item.projectName}} {{item.timeConsuming}} {{item.money}} @@ -143,29 +157,33 @@ - - - - - - 客服 - - - - - - {{cartGoodsNum}} - 购物车 - - + + + + + + + 客服 + + + + + + {{cartGoodsNum}} + 购物车 + + + + - - 加入购物车 - 立即购买 - + + + 加入购物车 + 立即购买 + @@ -227,7 +245,7 @@ 购买数量 - - + - + diff --git a/packageA/pages/goodsInfo/goodsInfo.wxss b/packageA/pages/goodsInfo/goodsInfo.wxss index 6173baa..c8f37aa 100644 --- a/packageA/pages/goodsInfo/goodsInfo.wxss +++ b/packageA/pages/goodsInfo/goodsInfo.wxss @@ -9,15 +9,19 @@ image { display: flex; justify-content: center; width: 100%; + position: fixed; + top: 0; + z-index: 999; /* height: 80rpx; */ /* margin-bottom: 20rpx; */ background-color: #fff; + border-top: 2rpx solid #ebedf0; /* border-bottom: 1rpx #fafafa solid; */ } .type-box { width: 25%; box-sizing: border-box; - font-size: 28rpx; + font-size: 32rpx; line-height: 76rpx; padding: 0 20rpx; text-align: center; @@ -29,12 +33,14 @@ image { display: flex; justify-content: center; width: 100%; + font-size: 26rpx; } .type-item-on { color: #F95D74; font-weight: bold; /* border-bottom: 4rpx solid #F95D74; */ position: relative; + font-size: 30rpx; } .type-item-on:after { content: ''; @@ -53,19 +59,21 @@ image { } .goods-title { display: flex; - justify-content: space-between; overflow: hidden; + justify-content: space-between; + /* overflow: hidden; */ /* height: 108rpx; */ } .goods-name { - width: 560rpx; - line-height: 46rpx; + /* width: 560rpx; */ + /* line-height: 46rpx; */ font-size: 32rpx; font-weight: bold; color: #333; - margin-top: 30rpx; - margin-bottom:30rpx; + /* margin-top: 30rpx; + margin-bottom:30rpx; */ flex: 1; text-align: justify; + margin: 10rpx 0 20rpx; } .goods-collect { @@ -89,13 +97,13 @@ image { .goods-price { font-size: 60rpx; /* padding: 20rpx 34rpx; */ - padding:0rpx 34rpx; + /* padding:0rpx 34rpx; */ /* line-height: 60rpx; */ color: #999; - + padding: 20rpx; /* margin-top: 46rpx; */ - margin-top:26rpx; - padding-bottom:20rpx; + /* margin-top:26rpx; + padding-bottom:20rpx; */ } .prom-info { @@ -111,13 +119,13 @@ image { border-radius: 4rpx; } .market-price { - display: flex; - margin-left: -5rpx; + /* display: flex; + margin-left: -5rpx; */ } .market-price .yuan{ - top:24rpx; - font-size: 36rpx + /* top:24rpx; */ + font-size: 30rpx } .market-price>view>text { @@ -125,7 +133,8 @@ image { } .market-price>.yj{ - color: #999999; font-size: 26rpx;margin-left: 16rpx;position: relative;top:30rpx; + color: #999999; font-size: 24rpx;/* margin-left: 16rpx;position: relative;top:30rpx; */ + display: inline-block; } .goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;} @@ -134,6 +143,7 @@ image { display: flex; font-size: 24rpx; justify-content: space-between; + } .goods-detail .twen{ @@ -348,11 +358,11 @@ image { } .join-cart>view { - width: 32%; + width: 29%; } .join-cart>.new_split { - width: 17%; + width: 13%; text-align: center; padding: 0; margin: 0; @@ -551,29 +561,28 @@ border-radius: 0 56rpx 55rpx 0; /* padding: 0 30rpx; */ font-size: 32rpx; box-sizing: border-box; - border-radius: 20rpx; + border-radius: 20rpx 20rpx 0 0; /* height: 72%; */ } -.spec-model .pding{padding: 0 30rpx;} +.spec-model .pding{padding: 0 20rpx;} .spec-goods { padding: 30rpx 0 20rpx; /* float: left; */ - display: flex; width: 100%; - border-bottom:2rpx solid #eee; + /* border-bottom:2rpx solid #eee; */ } .spec-img { - /* float: left; */ + float: left; height: 186rpx; width: 186rpx; border: 4rpx solid #eee } .spec-goods-info { - /* float: left; */ + float: left; padding: 0 25rpx; width: 400rpx; } @@ -608,17 +617,17 @@ border-radius: 0 56rpx 55rpx 0; .quhuo{font-size: 30rpx; color: #000} .b_num{ - display: flex; - font-size: 30rpx; - color: #333; + display: flex;font-size: 30rpx; color: #333; + justify-content: space-between; + align-items: center; padding: 20rpx; } .count { - position: fixed; + /* position: fixed; */ display: flex; height: 50rpx; - border: 1rpx solid #000; + /* border: 1rpx solid #000; */ font-size: 28rpx; right: 30rpx; } @@ -636,11 +645,29 @@ border-radius: 0 56rpx 55rpx 0; } .spec_bt.act{background: #d60021;color: #fff;border: 1rpx solid #d60021;} .sub { - border-right: 1px solid #000; + /* border-right: 1px solid #000; */ +} +.sub.active { + /* background-color: #ddd; */ + color: #ccc; +} + +.sub, .add, .count>input { + /* border-right: 1px solid #000; */ + background-color: #f8f8f8; + border-radius: 8rpx; +} +.sub.active { + /* background-color: #ddd; */ + color: #ccc; +} +.count>input { + margin: 0 10rpx; + line-height: normal; } .add { - border-left: 1px solid #000; + /* border-left: 1px solid #000; */ } .spec-btn { @@ -662,14 +689,15 @@ border-radius: 0 56rpx 55rpx 0; } .spec-cart-btns { - width: 92%; + /* width: 92%; */ line-height: 70rpx; - margin: 20rpx auto; - /* margin-top: 160rpx; */ - border-radius: 20rpx; -/* position: fixed; -bottom: 50rpx; -left: 4%; */ + /* margin: 0rpx auto; + margin-top: 160rpx; */ + /* border-radius: 20rpx; */ +/* position: fixed; */ +/* bottom: 50rpx; */ +/* left: 4%; */ + padding: 20rpx; } .spec-cart-btn { @@ -763,8 +791,8 @@ left:31rpx;} /*------拼单------*/ .pt_view{ text-align: center; width: 100%; height: 100rpx; line-height: 100rpx; font-size: 26rpx} .pt_view .secondkill-img{width: 100%;height: 100%;} -.pt_fir{ background: #fff;margin-bottom: 10rpx; } -.pt_fir .pt_fir_title{display: flex; align-items: center; margin-left: 10rpx; margin-top: 20rpx; font-size: 28rpx; position: relative;} +.pt_fir{ background: #fff;/* margin-bottom: 10rpx; */} +.pt_fir .pt_fir_title{display: flex; align-items: center; /* margin-left: 10rpx; margin-top: 20rpx; */ font-size: 28rpx; position: relative;} .pt_fir .pt_fir_title .kt_type{ color: #fff;background:#e9030d; width: 100rpx; line-height: 40rpx; border-radius: 6rpx; margin: 0 10rpx; height: 40rpx; font-size: 24rpx; text-align: center;} .pt_fir .pt_fir_title .price{color: #e9030d;font-size: 26rpx;} @@ -786,7 +814,7 @@ left:31rpx;} .t_gz{padding: 10rpx 20rpx; font-size:28rpx } .pt_fir.se1{height: auto; margin: 0} -.pt_fir.se2{height: auto; margin: 0;border-top:6rpx solid #eeeeee;border-bottom:2rpx solid #eeeeee;} +.pt_fir.se2{height: auto; margin: 0;/* border-top:6rpx solid #eeeeee;border-bottom:2rpx solid #eeeeee; */} .pt_hb{height:78rpx; line-height: 75rpx; position: relative; font-size: 32rpx;overflow: hidden;width:695rpx;margin-left:28rpx; border-bottom: 1rpx solid #E5E5E5 } @@ -808,14 +836,14 @@ left:31rpx;} .pt_fir .pt_fir_title.no-mar-b{margin-bottom: 0;padding-bottom: 10rpx; margin-left: 20rpx} .pt_fir .pt_fir_title.boder-1{border-bottom: 1rpx #e7e7e7 solid} -.jie_price{padding: 10rpx 30rpx;} +.jie_price{/* padding: 10rpx 30rpx; */} .jie_price_title{font-size: 30rpx; color: #a26270; margin-bottom: 10rpx} .price_list{display: flex; width: 100%;} .price_item{width: 25%;font-size: 28rpx; color: #4c336c} -.pt_fir.se2 .zzk-1{margin-top: 23rpx; font-size: 30rpx;position: relative; margin-bottom: 30rpx; border-left:4rpx solid red;margin-left:14rpx;height:30rpx;line-height:30rpx;padding-left:5rpx;} -.ckgd{position: absolute;top:0;right:57rpx; color:#d70025; font-size: 32rpx;} -.ckgd .arrow-one{width:18rpx;height:18rpx;border-color:#da0b31;margin-top:5rpx;} +.pt_fir.se2 .zzk-1{/* margin-top: 23rpx; */ font-size: 30rpx;position: relative; /* margin-bottom: 30rpx; */ border-left:4rpx solid red;/* margin-left:14rpx; */height:30rpx;line-height:30rpx;/* padding-left:5rpx; */} +.ckgd{/* position: absolute;top:0;right:57rpx; */ color:#d70025; font-size: 26rpx;} +.ckgd .arrow-one{width:14rpx;height:14rpx;border-color:#da0b31;/* margin-top:5rpx; */ margin:auto;} .bview{ position: fixed; top:0; left:0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); @@ -842,65 +870,71 @@ left:31rpx;} /*---多少人参加团--*/ .group { - padding-top:25rpx; - width: 91%; - min-height: 92rpx; - border-bottom:2rpx solid #eee; - padding-bottom:25rpx; + padding-top:20rpx; + padding-bottom:20rpx; + width: 100%; + /* min-height: 92rpx; */ + border-bottom: 2rpx solid #ebedf0; } .group .group-list { - - height: 90rpx; - padding: 0 130rpx 0 100rpx; - width: 470rpx; + display: flex; + align-items: center; + justify-content: space-around; + /* height: 90rpx; */ + /* padding: 0 130rpx 0 100rpx; */ + /* width: 470rpx; - position: absolute; + position: absolute; */ } .group .group-list .gtou { - width: 80rpx; - height: 80rpx; - float: left; + width: 70rpx; + height: 70rpx; + /* float: left; position: relative; top: 6rpx; - left: -96rpx; + left: -96rpx; */ } .group .group-list .gtou image { - width: 80rpx; - height: 80rpx; - border-radius: 200rpx; - background-color: green; + display: block; + width: 100%; + height: 100%; + border-radius: 50%; + background-color: #f0f0f0; } .group .group-list .gdn { - float: left; + width: 140rpx; + text-align: center; + /* float: left; */ font-size: 26rpx; - line-height: 48rpx; + /* padding-left: 20rpx; */ + /* line-height: 48rpx; height: 48rpx; width: 168rpx; position: relative; left: -80rpx; - top:20rpx; - font-weight:600; + top:20rpx; */ + font-weight:bold; } .group .group-list .ghaicha { - width:300rpx; + /* width:300rpx; */ font-size: 27rpx; - margin-left:180rpx; + /* margin-left:180rpx; top:13rpx; - left:-3rpx; - font-weight:600; + left:-3rpx; */ + font-weight: bold; } .group .group-list .ghaicha .gred { - height: 48rpx; - width: 300rpx; + /* height: 48rpx; + width: 300rpx; */ } .gsj { @@ -911,9 +945,9 @@ left:31rpx;} .group .group-list .cjt { height:42rpx; width: 137rpx; - position: absolute; + /* position: absolute; right: 4rpx; - top:25rpx; + top:25rpx; */ line-height: 42rpx; font-size: 24rpx; color: #fff; @@ -926,7 +960,7 @@ left:31rpx;} .gbody { background-color: white; } -.t_show{overflow: hidden; display: flex; width: 300rpx; color: #292929; line-height: 36rpx;font-size:26rpx; +.t_show{/* overflow: hidden; */ display: flex; /* width: 300rpx; */ color: #292929; /* line-height: 36rpx; */font-size:26rpx; } .join-cart>view.set_width { width:58%; @@ -955,8 +989,8 @@ left:31rpx;} white-space:nowrap; } -.tuwen_title{ height: 86rpx; background-color:#eeeeee; margin-bottom: 32rpx; position: relative; - display: flex; justify-content: center;align-items: center; } +.tuwen_title{ /* height: 86rpx; */ background-color:#eeeeee; /* margin-bottom: 32rpx; */ position: relative; + display: flex; justify-content: center;align-items: center; padding: 20rpx;} .tuwen_title .g_line{ width:496rpx; @@ -968,27 +1002,28 @@ left:31rpx;} overflow: hidden; justify-content: center;align-items: center; } .tuwen_title .center_s image{ width: 34rpx; height: 26rpx; margin-right: 10rpx} -.t_g_info{ margin: 0 34rpx;margin-bottom: 20rpx; display: flex; align-items: center } +.t_g_info{ /* margin: 0 34rpx;margin-bottom: 20rpx; */ display: flex; align-items: center;padding: 20rpx; } .red_shu{ width: 10rpx; height: 36rpx; background-color:#da0035; margin-right: 8rpx; } -.tb-l{ line-height: 96rpx;} -.table_s{ border:#e4e4e4 1rpx solid; width: 682rpx; margin: 0 34rpx;font-size: 30rpx;} -.tb_item{display: flex; height: 96rpx; border-bottom: 1rpx solid #e4e4e4 } -.item_left{width: 214rpx; height: 100%; background: #f9f9f9 ;border-right:1rpx solid #e4e4e4} .item_left text{ margin-left: 44rpx;} -.item_right{width: 468rpx; height: 100%; overflow : hidden;white-space:nowrap; - text-overflow: ellipsis;} -.item_right text{ margin-left: 66rpx;} +.tb-l{ /* line-height: 96rpx; */} +.table_s{ border:#e4e4e4 1rpx solid; box-sizing: border-box;font-size: 26rpx;} +.tb_item{display: flex; /* height: 96rpx; */ border-bottom: 1rpx solid #e4e4e4 } +.item_left{width: 210rpx; height: 100%; box-sizing:border-box; text-align: center;padding: 20rpx; background: #f9f9f9 ;border-right:2rpx solid #e4e4e4} .item_left text{ /* margin-left: 44rpx; */} +.item_right{flex:1; height: 100%; overflow : hidden;white-space:nowrap;text-overflow: ellipsis; padding: 20rpx;} +.item_right text{ /* margin-left: 66rpx; */} -.bzfu_img{ width: 164rpx; height:34rpx; margin-right: 18rpx; margin-left: 12rpx } - .bz_view{ height:100rpx; padding: 0 34rpx 0 13rpx; color: #333; font-size: 28rpx; +.table_s .tb-l:last-child {border-bottom: none;} + +.bzfu_img{ width: 164rpx; height:34rpx; /* margin-right: 18rpx; margin-left: 12rpx */ } + .bz_view{ /* height:100rpx; padding: 0 34rpx 0 13rpx; */ color: #333; font-size: 28rpx; padding: 20rpx 20rpx 20rpx 10rpx; /* border-bottom: 3rpx solid #eee; */ /* border-top: 3rpx solid #eee; */} - .bz_view view{ width: 460rpx; max-height: 70rpx; overflow: hidden;} + .bz_view view{ width: 460rpx; /* max-height: 70rpx; */ /* overflow: hidden; */} -.bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333; - font-size: 30rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx } -.red_bb{ color: #d70026; min-width:158rpx;width: auto;} -.bg_jj{ width: 18rpx; height:18rpx; +.bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 20rpx; color: #333; + font-size: 30rpx; /* height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx */ } +.red_bb{ color: #d70026; /* min-width:158rpx;width: auto; */} +.bg_jj{ width: 14rpx; height:14rpx; border-top: 2rpx solid #d70026; border-right: 2rpx solid #d70026; transform: rotate(45deg);display:inline-block; @@ -999,6 +1034,7 @@ left:31rpx;} .bz-content { flex-grow: 1; text-align: justify; + padding: 0 30rpx 0 20rpx; } /* 顶部边框 */ @@ -1199,20 +1235,23 @@ left:31rpx;} .xc_comment{ display: flex; + justify-content: space-around; width: 100%; - height: 42rpx; - padding-left: 34rpx; + box-sizing: border-box; + padding: 10rpx 20rpx; + /* height: 42rpx; + padding-left: 34rpx; */ color: #333; } .xc_comment-have-pictures{ width: 153rpx; - height: 42rpx; + /* height: 42rpx; */ line-height: 42rpx; text-align: center; background: #ffe3e2; color: 28rpx; - border-radius:20rpx; + border-radius:21rpx; font-size: 24rpx; } .xc_comment-discuss{ @@ -1229,22 +1268,25 @@ left:31rpx;} .xc_comment-detail{ display: flex; - margin-top: 40rpx; - width: 524rpx; - margin-left: 34rpx; - border-radius: 25rpx; - border: 2rpx solid #d6d4d5; - overflow: hidden; + /* margin-top: 40rpx; */ + /* width: 524rpx; */ + /* margin-left: 34rpx; */ + border-radius: 24rpx; + border: 2rpx solid #ebedf0; + margin-left: 20rpx; + box-sizing: border-box; + /* overflow: hidden; */ } .xc_user-img{ - border-radius:50%; + border-radius:50%; + margin: auto 0; } .xc_comment-user{ display: flex; - margin-top: 22rpx; - margin-left: 22rpx; + /* margin-top: 22rpx; + margin-left: 22rpx; */ } .xc_user{ width: 170rpx; @@ -1252,34 +1294,34 @@ left:31rpx;} margin-left: 6rpx; overflow: hidden; } -.xc_user-name{ height: 25rpx;} +.xc_user-name{ /* height: 25rpx; */} .xc_comment-img{ width: 22rpx; height: 22rpx; - margin-top: 14rpx; + /* margin-top: 14rpx; */ margin-right: 5rpx } .xc_comment-font{ - height: 75rpx; - margin-left: 22rpx; + /* height: 75rpx; */ + /* margin-left: 22rpx; */ white-space:normal; overflow: hidden; - margin-top: 8rpx; - line-height: 38rpx; + /* margin-top: 8rpx; + line-height: 38rpx; */ } .xc_comment-val{ - width: 88%; + /* width: 88%; height: 30rpx; margin-left: 22rpx; display: flex; margin-top: 15rpx; - margin-bottom:15rpx; + margin-bottom:15rpx; */ } .xc_comment-time{ - height: 30rpx; - font-size: 24rpx; + /* height: 30rpx; */ + font-size: 22rpx; color: #a5a5a5; overflow: hidden; } @@ -1290,14 +1332,17 @@ left:31rpx;} .xc_comment-left{ display:inline-block; width: 312rpx; + padding: 20rpx; } .xc_goods-img-frame{ - display:inline-block; - width: 40%; + border-radius: 0 22rpx 22rpx 0; + overflow: hidden; + /* display:inline-block; */ + /* width: 40%; height: 90%; text-align: center; padding-top: 30rpx; - vertical-align: top; + vertical-align: top; */ } .xc_imgs{ width: 50rpx; @@ -1308,11 +1353,13 @@ left:31rpx;} .pj_word_size{ font-size: 28rpx} .pj_scroll{ - white-space: nowrap; + /* white-space: nowrap; */ /* height: 324rpx; */ - margin-bottom: 50rpx; + /* margin-bottom: 50rpx; */ display: flex; align-items: center; + padding: 20rpx 0; + /* box-sizing: border-box; */ /* box-shadow: 0 8px 12px #e7e9eb; */ } @@ -1326,57 +1373,61 @@ left:31rpx;} } .cx-frame{ /* border-top:3rpx solid #eee; */ - width:99%; + /* width:99%; height: 95rpx; line-height: 95rpx; - padding-left:24rpx; - - + padding-left:24rpx; */ + padding: 20rpx; } .cx-frame .cx-sizs{ - width: 68rpx; - height: 100%; - line-height: 100rpx; - overflow: hidden; - margin-left: 10rpx; + /* width: 68rpx; */ + /* height: 100%; */ + /* line-height: 100rpx; */ + /* overflow: hidden; */ + /* margin-left: 10rpx; */ } .xc-coupon-fram{ position: relative; - width:200rpx; - padding-top:30rpx; + margin-right: 16rpx; + /* width:200rpx; */ + /* padding-top:30rpx; */ } .xc-coupon-fram .xc-coupon{ - width:175rpx ; + /* width:175rpx ; height: 40rpx; - line-height: 40rpx; + line-height: 40rpx; */ background-color:#d60021 ; - margin:0 auto; + /* margin:0 auto; */ color:#fff; - + padding: 6rpx 20rpx; } .xc-coupon-fram .xc-circular{ - width: 22rpx; - height:22rpx; - background-color:#fff; + width: 16rpx; + height:16rpx; + background-color: white; position:absolute; - top: 40rpx; + top: 50%; + /* left: -10rpx; */ + transform: translateY(-50%); } .xc-coupon-fram .xc-one{ - left:3rpx; + left: -8rpx; } .xc-coupon-fram .xc-two{ - left: 178rpx; + right: -8rpx; } .cx-obtain-coupon{ - width: 65rpx; + /* width: 65rpx; height: 100%; - padding-left:15rpx; + padding-left:15rpx; */ color: #d70025; - position: absolute; - right: 5rpx; + display: flex; + align-items: center; + /* position: absolute; + right: 5rpx; */ } /* 自定义弹出窗口 */ @@ -1391,18 +1442,20 @@ left:31rpx;} } .cx-popup .top{ - width: 90%; - height:85rpx; - border-bottom: 4rpx solid #d5d5d5; - padding-top: 50rpx; - font-weight:600; + /* width: 90%; + height:85rpx; */ + font-size: 32rpx; + padding: 20rpx 0; + border-bottom: 2rpx solid #ebedf0; + /* padding-top: 50rpx; + font-weight:600; */ } .cx-popup .top-frame{ - width: 100%; + /* width: 100%; display: flex; justify-content: center; - overflow: hidden; + overflow: hidden; */ } .xc-valid-coupon{ width: 90%; @@ -1413,41 +1466,52 @@ left:31rpx;} .xc-frame{ position: relative; } -.xc-coupon-frame{ - width: 90%; +.xc-coupon-frame { + width: 100%; max-height: 560rpx; overflow: auto; } -.xc-coupon-frame .coupon{ - width:99%; +.xc-coupon-frame .rel:not(:first-child) { + margin-top: 20rpx; +} +.xc-coupon-frame .coupon { + width:100%; height: 168rpx; border-radius: 25rpx; - border:3rpx solid #ffdcdc; + border:2rpx solid #ffdcdc; overflow: hidden; - margin-top:16rpx; + /* margin-top:16rpx; */ + box-sizing: border-box; } +/* .xc-coupon-frame .coupon ~ .coupon { + margin-top:16rpx; +} */ .xc-coupon-left{ width: 216rpx; - height: 100%; + /* height: 100%; */ background-color: #ffeeef; border-right: 4rpx dashed #ffdbd9; overflow: hidden; - line-height: 100%; - + /* line-height: 100%; */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex-shrink: 0; } .xc-money{ color: #f30026; text-align:center; } .xc-rmb{ - width:44rpx; - padding-top:7rpx; + /* width:44rpx; + padding-top:7rpx; */ } .xc-money-frame{ - margin-left:35rpx; - margin-top:48rpx; + /* margin-left:35rpx; + margin-top:48rpx; */ } .xc-spacing{ @@ -1455,45 +1519,52 @@ left:31rpx;} } .xc-circular-one{ position: absolute; - top:-8rpx; - left:208rpx; - width: 27rpx; + top:-15rpx; + left:205rpx; + width: 30rpx; height: 30rpx; background: #fff; overflow: hidden; } .xc-circular-two{ position: absolute; - top:150rpx; - left:207rpx; - width: 27rpx; + bottom: -15rpx; + /* top:150rpx; */ + left:205rpx; + width: 30rpx; height:30rpx; background: #fff; } .xc-detail-coupon{ - margin-left: 22rpx; + /* margin-left: 22rpx; overflow: hidden; - padding-top: 43rpx; - + padding-top: 43rpx; */ + /* display: flex; + align-items: center; */ } .xc-coupon-right{ - width: 455rpx; - height: 100%; + /* width: 455rpx; + height: 100%; */ background: #fffaf9; + padding: 20rpx; + box-sizing: border-box; + width: 100%; + justify-content: space-between; + align-items: center; } .xc-below{ - margin-top:22rpx; + margin-top:20rpx; } .xc-get{ - width: 132rpx; - height: 48rpx; + width: 140rpx; + /* height: 48rpx; */ color: #fff; text-align: center; - border-radius:20rpx; - line-height:48rpx; - margin-left:20rpx; + border-radius:27rpx; + line-height:54rpx; + /* margin-left:20rpx; */ } .background{ @@ -1511,16 +1582,19 @@ left:31rpx;} .cx-confirm{ width: 100%; - height: 160rpx; + padding: 20rpx; + box-sizing: border-box; + /* height: 160rpx; */ } .cx-confirm .confirm{ - width: 372rpx; - height: 60rpx; - background: #f40026; + /* width: 372rpx; + height: 60rpx; */ + background-color: #f40026; color: #fff; - border-radius:20rpx; - line-height:60rpx; + border-radius:10rpx; + line-height: 80rpx; + font-size: 28rpx; } @@ -1531,17 +1605,21 @@ left:31rpx;} /* 分享 */ +.icon-share { + font-size: 46rpx; + color: #d60021; +} .xc-share-frame{ - width: 129rpx; + /* width: 129rpx; height: 48rpx; border-top-left-radius: 18rpx; - border-bottom-left-radius: 18rpx; - background: #d60021; - position:absolute; + border-bottom-left-radius: 18rpx; */ + /* background: #d60021; */ + /* position:absolute; left:622rpx; top:-37rpx; line-height:50rpx; - margin-top:52rpx; + margin-top:52rpx; */ } .xc-share-frame-jieti{ width: 129rpx; @@ -1559,6 +1637,7 @@ left:31rpx;} } + .xc-share-frame .share-frame,.xc-share-frame-jieti .share-frame{ width: 30rpx; height: 30rpx; @@ -1779,10 +1858,10 @@ xc-ensure-div{ padding-top: 24rpx; overflow: hidden; } -.xc-frame{ - width: 100%; - margin-top:20rpx; - +.xc-frame { + /* width: 100%; + margin-top:20rpx; */ + padding: 20rpx; } .xc-frame .list-frame{ @@ -1817,7 +1896,7 @@ xc-ensure-div{ } .xc-money-frame{ - margin-left:35rpx; + /* margin-left:35rpx; */ } .xc-coupon-effect{ @@ -1952,11 +2031,11 @@ xc-ensure-div{ } .xc-video{ - width:100rpx; - height: 50rpx; - line-height: 50rpx; + /* width:100rpx; */ + /* height: 50rpx; + line-height: 50rpx; */ text-align: center; - margin-left:-30rpx; + /* margin-left:-30rpx; */ } @@ -2030,7 +2109,7 @@ xc-ensure-div{ .wsize{font-size: 32rpx} -.five-level-word{font-size: 28rpx;} +.five-level-word{font-size: 24rpx;} /*-- 推荐商品 --*/ @@ -2103,13 +2182,13 @@ padding-left:24rpx; .xc-linellae-frame{ width: 100%; - height: 60rpx; + height: 80rpx; background: #f2f2f2; } .xc-linellae-frame .xc-linellae{ width: 386rpx; height: 1rpx; - border-bottom: 1rpx solid #a5a5a5; + border-bottom: 1rpx solid #ebedf0; } .xc-recommend-frame{ background:#f2f2f2; @@ -2132,7 +2211,8 @@ margin-top: 1rpx; } .xc-price-frame{ color: #ec0022; -height:44rpx; + align-items: baseline; +/* height:44rpx; */ } .xc-price-frame .sign{ margin-top:19rpx; @@ -2163,6 +2243,9 @@ padding-left:-4rpx; .xc-explain{ color:#292929; width:542rpx; + margin: 10rpx 0 20rpx; + width: 100%; + font-weight: bold; } .xc-item{width: 16%; font-size: 26rpx; color: #666;margin-right:5rpx;} .xc-item .yuan{ @@ -2268,15 +2351,16 @@ margin-top:5rpx; } .xc-goods-explain{ width:100%; - padding-left:30rpx; + /* padding-left:30rpx; margin-left:-9rpx; - height: 150rpx + height: 150rpx */ } .xc-partner-frame{ border-bottom:2rpx solid #eee; width:100%; -padding:0 20rpx; -height:56rpx; +padding:20rpx; +/* height:56rpx; */ +box-sizing: border-box; } .xc-person-number{ width:120rpx; @@ -2298,41 +2382,43 @@ right:17rpx; top:55rpx; /* border-top:1rpx solid #eee; */ width: 100%; height: auto; + padding: 20rpx; + box-sizing: border-box; } .on_height{ height: 90rpx; } .sn_height{ - min-height: 170rpx; height: auto;padding: 10rpx 0; + /* min-height: 170rpx; height: auto;padding: 10rpx 0; */ } .xc-address_frame .address_frame{ - width: 92%; -padding-left: 10rpx; -margin: auto; + width: 100%; +/* padding-left: 10rpx; +margin: auto; */ } .shop_name{ } .stores-img{ -width: 40rpx; - height: 35rpx; + width: 28rpx; + height: 28rpx; margin-right: 10rpx; } .shop_name{ margin-right: 10rpx; } .address{ - width: 87%; + /* width: 100%; margin-top: 5rpx; - margin-bottom: 5rpx; + margin-bottom: 5rpx; */ } .distance{ - padding-left: 15rpx; - padding-right: 15rpx; + padding-left: 20rpx; + padding-right: 20rpx; background: #eee; border-radius: 20rpx; - margin-right: 5rpx; + /* margin-right: 5rpx; */ color: #999; height: 38rpx; line-height: 38rpx; @@ -2518,8 +2604,8 @@ margin-top: 10rpx; } .xc-goods-attribute{ border-bottom: 1px solid #eee; -padding-bottom: 15px; -margin-bottom:40rpx; +padding-bottom: 20rpx; +/* margin-bottom:40rpx; */ } .xc-val-fream{ width: 105rpx; @@ -2546,11 +2632,11 @@ border-radius: 55rpx; .s_btn{ margin-top: 25rpx; } /* 美妆价的样式 */ .beauty-makeup-frame{ - width: 101.5%; - margin: auto; + /* width: 101.5%; + margin: auto; */ height: 120rpx; border-radius: 15rpx; - margin-top: 18px; + margin-top: 10px; } .beauty-makeup-frame .left{ @@ -2558,11 +2644,12 @@ border-radius: 55rpx; height: 100%; background:#f7f7f7; border-radius: 20rpx 0rpx 0rpx 20rpx; - padding-left: 20rpx; + /* padding: 0 10rpx; */ } .card-frame{ - margin-top: 0rpx; padding-right: 23rpx; - margin-right: 15rpx; + margin-top: 0rpx; + /* padding-right: 23rpx; + margin-right: 15rpx; */ } .advert-card{ margin-top: 0rpx!important; @@ -2576,13 +2663,13 @@ border-radius: 55rpx; } .grade-card-frame{ - height:45rpx ; + /* height:45rpx ; */ background: #3c300a; border-radius: 20rpx; - margin-top: 10px; - margin-left: 7rpx; + /* margin-top: 10px; + margin-left: 7rpx; */ justify-content: center; - padding: 0 15rpx; + padding: 4rpx 12rpx; } .grade-card-frame .img{ width: 24rpx; @@ -2596,7 +2683,7 @@ border-radius: 55rpx; max-width: 165rpx; } .card-effect{ - margin-left: 15rpx; + /* margin-left: 15rpx; */ } .at_once_carde{ width:65rpx; @@ -2620,22 +2707,23 @@ button.custom-service::after{ border: 0; } .no_store{color:#d60021; font-size: 26rpx;} -.cx_show_view{ width: 580rpx; line-height: 30rpx; margin-bottom: 6rpx; } +.cx_show_view{ width: 580rpx; /* line-height: 30rpx; margin-bottom: 6rpx; */ } .cx_show_view .word{ width: 400rpx} .prom_condition { color: #d60021; - width: 180rpx; - height: 30rpx; + /* width: 180rpx; */ + /* height: 30rpx; */ font-size: 20rpx; - padding-top: 0.01rpx; - display: flex; + /* padding-top: 0.01rpx; */ + /* display: flex; justify-content: center; - align-items: center; - border: #d60021 solid 1rpx; + align-items: center; */ + border: 2rpx solid #d60021; border-radius: 10rpx; margin-right:10rpx ; - margin-left: 10rpx; - + /* margin-left: 10rpx; */ + font-size: 24rpx; + padding: 0 10rpx; } .hui_img{ width: 44rpx; height: 44rpx; margin-right: 8rpx} .order_hui{color: #444; width: 420rpx} @@ -2733,4 +2821,25 @@ button.custom-service::after{ .quan_price{ background-color: #ff4700; color: #fff; padding: 10rpx 25rpx; margin-left: 10rpx; border-radius: 30rpx; } -.stock{ width: 25%; height: 60rpx; border: 1rpx solid #eee; text-align: center; line-height: 60rpx;} \ No newline at end of file + +/*--闪白屏--*/ +.g_img_box{ + background-position: center center; + background-repeat: no-repeat; + -webkit-background-size: cover; + -moz-background-size: cover; + background-size: cover; +} + + + +.arrow { + width: auto !important; + position: absolute; + right: 0; + top: 10rpx; +} + +.stock { + flex: 1; +} \ No newline at end of file diff --git a/packageA/pages/jfbuy/jfbuy.wxml b/packageA/pages/jfbuy/jfbuy.wxml index eee8668..e8182f9 100644 --- a/packageA/pages/jfbuy/jfbuy.wxml +++ b/packageA/pages/jfbuy/jfbuy.wxml @@ -51,8 +51,8 @@ {{item.integral}}积分 + ¥{{item.addmoney}} - 零售价:¥{{item.shop_price}} - 销量:{{item.sales_sum}} + 零售价:¥{{item.market_price}} + 销量:{{item.buy_num}} diff --git a/packageA/pages/my_service2/appment_main.js b/packageA/pages/my_service2/appment_main.js index 73a63b6..413a898 100644 --- a/packageA/pages/my_service2/appment_main.js +++ b/packageA/pages/my_service2/appment_main.js @@ -3,6 +3,8 @@ var e = getApp(), os = a, t = e.request, d = e.globalData; + var ut = require("../../../utils/util.js"); + Page({ /** * 页面的初始数据 @@ -11,21 +13,17 @@ Page({ inurl: a.url, //接口网址 iurl: a.imghost, //服务器网址 store: 0, //是否显示服务门店列表 - beautician: 0, //是否显示美容师列表 - beautician_name: "", //选中的美容师名称 - beauticianID: "", //美容师id - bea_index: "", //美容师列表下标 + placeholder: "填写备注", //备注为空的placeholder store_list: [], //门店列表 - beautician_list: [], //美容师列表 - store_name: "", //选择的服务门店 + + store_name: "", //选择的服务门店 fir_pick_index: 0, //选择的门店下标 curpage: 1, //当前分页数 pageSize: 8, //页大小 total: 0, ismore: 0, //是否加载完毕 - itemId: "", //服务id - project_id: "", //项目id + isScroll: true, //scroll-y是否可以滑动 key_word: "", //是否按门店文字查询 is_service_read: 0, //是否调用过门店接口 @@ -34,8 +32,7 @@ Page({ remarks: "", //备注 storageId: "", //线下门店id url: "/packageA/pages/my_service/appment_main", //本页面地址路径用于选择时间页面跳转回来 - buyType: "", //项目类型 - time: "", //选择预约时间 + tment_count: "", //可预约人数 lat: "", //纬度坐标 lon: "", //经度坐标 @@ -44,19 +41,22 @@ Page({ is_sub: 0, //判断是否重复提交 is_textea: 1, //备注是否是可输入 - // 拖拽参数 - writePosition: [], //默认定位参数 - writesize: [0, 0],// X Y 定位 - window: [0, 0], //屏幕尺寸 - write: [0, 0], //定位参数 - scrolltop: 0,//据顶部距离 - v:{}, - - project: ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'], - md: [{name:'美导1',time:'08:30-22:00'},{name:'美导2',time:'09:30-18:00'},], - timeList: [], - deltaX: 0, - col_arr:[], + write: [0, 0], //定位参数 + scrolltop: 0,//据顶部距离 + v:{}, + + //project: ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'], + //md: [{name:'美导1',time:'08:30-22:00'},{name:'美导2',time:'09:30-18:00'},], + timeList: [], + deltaX: 0, + col_arr:[], + wp:[], + datet:null, + s_top:0, + + cur_sele_i:-1, + cur_sele_j:-1 + }, //控制备注输入 check_text: function() { @@ -67,6 +67,7 @@ Page({ beautician: 0 }) }, + onclickstore: function() { var th = this; var store = th.data.store; @@ -85,6 +86,8 @@ Page({ wx.showLoading({ title: '加载中', }) + + //获取门店 th.query_store(); } } @@ -96,104 +99,82 @@ Page({ remarks: remarks }) }, - //提交成功及发送模版代码 + + + //单个预约的提交成功及发送模版代码 success: function() { + var user_id=getApp().globalData.userInfo.user_id; + wx.showLoading({ title: '加载中', }); var th = this; var store = th.data.store_name; //门店名称 - var bea_name = th.data.beautician_name; //美容师名称 - var time = th.data.time; //预约时间 - var is_sub = th.data.is_sub; //是否重复提交 - var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径 - var serviceId = th.data.itemId; //服务id - var beauticianID = th.data.beauticianID; //美容师id - var buyType = th.data.buyType; //服务项目类型 - var storeId = a.stoid; //商家id - var storageId = th.data.storageId; //门店id - var userId = th.data.options.userid; //用户id - var remarks = th.data.remarks; //用户备注 - var project_id = th.data.project_id; //项目id - var validay = th.data.validay; - var json = { - "arrangeTime": time + ":00", - "beauticianId": beauticianID, - "buyType": buyType, - "effectiveDay": "", - "number": "", - "projectId": project_id, - "remark": remarks, - "serviceId": serviceId, - "states": 0, - "storageId": storageId, - "storeId": storeId, - "userId": userId, - "validay": validay, - "isxz": 1 - - } - var data = JSON.stringify(json); + var datet = th.data.datet; //预约时间 + //接口路径 + var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/batchinsert"; + var req_arr={ + "storageId": th.data.storageId, + "storeId": a.stoid, + "userId": user_id, + "remark": '', + "isxz": 1, + "states": 0, + "list":[] + }; + for(var i in this.data.v){ + for(var j in this.data.v[i]){ + var item=this.data.v[i][j]; + var md=this.data.md[i]; + var tn=this.data.timeArr[j]; + var json = { + "arrangeTime":datet+' '+ tn + ":00", + "beauticianId":encodeURIComponent(md.staffid) , + "buyType": item.BuyType, + //"effectiveDay": "", + //"number": "", + "projectId": item.ProjectID, + "serviceId": item.ServiceID, + "validay": item.Validay, + } + req_arr.list.push(json); + } + } + console.log(req_arr); + //return false; + var js_data = JSON.stringify(req_arr); wx.request({ url: url, - data: json, + data: js_data, method: 'post', header: { 'content-type': 'application/json' }, // 设置请求的 header success: function(res) { - th.setData({ - is_sub: 0 - }) + th.setData({ is_sub: 0}) wx.hideLoading(); if (res.data.code == 0) { - getApp().my_warnning("预约成功", 1, th); - // var store_name = th.data.store_name; //预约门店 - var number = res.data.data.Number; - // var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口 - //var userinfo = getApp().globalData.userInfo; - //var name = d.userInfo.nickname; - // var json = { - // // "formId": formid, - // "keyWord": [{ - // "keyword": res.data.data.ServiceName - // }, - // { - // "keyword": time.substring(0, 16) - // }, { - // "keyword": res.data.data.BeauticianName - // }, { - // "keyword": res.data.data.StorageName - // }, { - // "keyword": res.data.data.Address - // } - // ], - // "page": "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid, - // "storeId": a.stoid, - // "typeId": "1011", - // "userId": th.data.options.userid - // }; - // var data = JSON.stringify(json); - // //调用发送预约成功模版接口 - // wx.request({ - // url: th.data.inurl + temp_url, - // data: data, - // method: 'post', - // header: { - // 'content-type': 'application/json' - // }, // 设置请求的 header - // success: function(data) {} - // }) - - wx.redirectTo({ - url: "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid, - }); - + getApp().my_warnning("预约成功", 1, th); + + if(res.data.data.length>1){ + var number = res.data.data[0].Number; + wx.redirectTo({ + url: "/packageA/pages/my_service/tment_order_list?number=" + number+"&userid="+user_id, + }); + + }else{ + var number = res.data.data[0].Number; + wx.redirectTo({ + url: "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+user_id, + }); + } + } else { getApp().my_warnning(res.data.msg, 0, th); th.settime(); } } }) - }, + + //定时显示texteat settime: function() { var th = this; @@ -203,141 +184,59 @@ Page({ }) }, 2000); }, - //提交预约 + + + //-- 提交预约 -- sub_success: function(e) { var th = this; - var temp_url = th.data.inurl + "/api/wx/weappSendlist/page"; + //和推送消息有关系 + var temp_url = th.data.inurl + "/api/wx/weappSendlist/page"; var template_id = ""; - if (th.data.is_sub == 1) { - return false; - } - var store = th.data.store_name; //门店名称 - var bea_name = th.data.beautician_name; //美容师名称 - var time = th.data.time; //预约时间 - var is_sub = th.data.is_sub; //是否重复提交 - th.setData({ - is_textea: 0, - is_sub: 1 - }) + + //门店名称 + var store = th.data.store_name; //提交预约前的判断 if (store == "") { - getApp().my_warnning("请选择服务门店", 0, th); - th.setData({ - is_sub: 0 - }) - th.settime(); - return false; - } else if (bea_name == "") { - getApp().my_warnning("请选择美容师", 0, th); - th.setData({ - is_sub: 0 - }) - th.settime(); - return false; - } else if (time == undefined || time == '') { - getApp().my_warnning("请选择预约时间", 0, th); - th.setData({ - is_sub: 0 - }) - th.settime(); - return false; - } else { - var version =""; - //判断微信版本是否达到预约成功订阅的要求 - wx.getSystemInfo({ - success(res) { - version = res.version; - } - }) - wx.showLoading({ - title: '加载中', - }) - - th.success(); - // if (th.ver(version, '7.0.4') >= 0) { - // //获取模版id - // getApp().request.promiseGet(temp_url, { - // data: { - // store_id: a.stoid, - // typeid: "1011" - // } - // }).then(res => { - // if (res.data.code == 0 && res.data.data.pageData.length > 0) { - // template_id = res.data.data.pageData[0].template_id; - // // //授权订阅 - // wx.requestSubscribeMessage({ - // tmplIds: [template_id], - // success(res) { - // th.success(); - // }, - // fail(res) { - // th.success(); - // } - // }) - // } else { - // th.success(); - // } - // }) - // } else { - // // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示 - // wx.showModal({ - // title: '提示', - // content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' - // }) - // th.setData({ - // is_sub: 0 - // }) - // } - - } - }, - //版本判断 - ver:function(v1,v2){ - v1 = v1.split('.') - v2 = v2.split('.') - var num1 = "" ; - var num2 = ""; - var len = Math.max(v1.length, v2.length) - - while (v1.length < len) { - v1.push('0') - } - while (v2.length < len) { - v2.push('0') - } - - for (let i = 0; i < len; i++) { - num1 = parseInt(v1[i]) - num2 = parseInt(v2[i]) - - if (num1 > num2) { - return 1 - } else if (num1 < num2) { - return -1 - } - } - return 0 - }, - goto: function(e) { - var th = this; - th.setData({ - beautician: 0, - is_textea: 0 - }) - if (th.data.store_name == "") { - getApp().my_warnning("请选择服务门店", 0, th); - th.settime(); - } else if (th.data.beautician_name == "") { - getApp().my_warnning("请选择美容师", 0, th); - th.settime(); - } else { - th.setData({ - is_textea: 1 - }) - var url = e.currentTarget.dataset.url; - getApp().goto(url); - } + getApp().my_warnning("请选择服务门店", 0, th); + return false; + } + + if(Object.keys(th.data.v).length === 0){ + getApp().my_warnning("请选择美导和预约时间", 0, th); + return false; + } + + if(th.data.is_sub) return false; + th.setData({ is_sub: 1}); + + + //获取模版id + getApp().request.get(temp_url, { + data: { + store_id: a.stoid, + typeid: "1011" + }, + success:function(res){ + if (res.data.code == 0 && res.data.data.pageData.length > 0) { + template_id = res.data.data.pageData[0].template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: [template_id], + success(res) { + th.success(); + }, + fail(res) { + th.success(); + } + }) + } else { + th.success(); + } + } + }) + }, + //点击选择门店 choose_for_store: function(e) { var th = this; @@ -355,6 +254,7 @@ Page({ }) } }, + //确认选择门店 choice_store: function() { var th = this; @@ -367,8 +267,51 @@ Page({ storageId: Id, is_textea: 1 }) + + th.get_project_guide(); + }, - onReachBottom: function() { + + //获取美导和项目 + get_project_guide(){ + var th=this,user=getApp().globalData.userInfo; + var req={ + storeId:os.stoid, + userId:user.user_id, + StorageId:encodeURIComponent(this.data.storageId), + } + getApp().request.get("/api/weshop/marketing/reservation/sm/pageNew",{ + data:req, + success:function(res){ + if(ut.ajax_ok(res)){ + th.setData({project:res.data.data.pageData}) + } + } + }) + + req.SeekTime=this.data.datet; + getApp().request.get("/api/weshop/marketing/reservation/listStaffAndTime",{ + data:req, + success:function(res){ + if(ut.ajax_ok2(res)){ + th.setData({v:{},col_arr:[]}) + //-- 有些时间是全部没有的 -- + th.setTimeShow(res.data.data) + }else{ + th.setData({md:[]}); + } + } + }) + + //获取第一个元素的位置 + setTimeout(function(){ + th.queryMultipleNodes(); + },1000) + + }, + + + onGetBottom: function() { var th = this; if (this.data.total <= th.data.pageSize) return; if (this.data.ismore) return; @@ -378,6 +321,7 @@ Page({ }) th.query_store(); }, + //分页查询门店信息 query_store: function() { var th = this; @@ -385,14 +329,13 @@ Page({ is_textea: 0 }) var itemId = th.data.itemId; //服务id - var url = "/api/weshop/marketing/reservation/storage/pagenew"; + var url = "/api/weshop/marketing/reservation/storage/pageAll"; var key_word = th.data.key_word; key_word = key_word.replace(/\s+/g, ""); getApp().request.promiseGet(url, { data: { - userId: th.data.options.userid, + userId: getApp().globalData.user_id, storeId: a.stoid, - serviceId: itemId, latitude: th.data.lat, longitude: th.data.lon, page: th.data.curpage, @@ -534,8 +477,9 @@ Page({ th.setData({ is_textea: 1 }) - console.log('optionsxxx===>', this.data.options); - // console.log('1-->', "/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id); + + console.log('optionsxxx===>', this.data.options); + // console.log('1-->', "/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id); wx.navigateTo({ url: "/packageA/pages/my_service/cosmetology_list?userid=" + this.data.options.userid + '&storageId=' + storageId + '&itemId=' + itemId + "&projectId=" + project_id }); @@ -546,15 +490,30 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function(options) { + + + // 如果数值位数为1,则补0 + function appendZero(obj) { + if (obj < 10) { + return "0" + "" + obj; + } else { + return obj; + } + }; this.getTimeList(23, 30); var th = this; + var now_date = new Date(); + var md = now_date.getFullYear()+"-"+appendZero(now_date.getMonth() + 1) + "-" + appendZero(now_date.getDate()); + th.setData({ - options, + options, itemId: options.service_id, buyType: options.BuyType, project_id: options.ProjectID, - validay: options.Validay + validay: options.Validay, + datet:md, + nowDate:md }); wx.getLocation({ type: 'gcj02', @@ -584,87 +543,30 @@ Page({ th.data.is_get_local_ok = 1; } }); - - // 获取当前默认导购信息及归属门店信息 - if(options.firstleader) { - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+a.stoid+"/"+options.firstleader,{}).then(res=>{ - if(res.data.code==0){ - getApp().globalData.guide_id=res.data.data.id; - - getApp().request.promiseGet('/api/weshop/shoppingGuide/geIdStaffInfo', { - data: { - store_id: a.stoid, - guide_id: e.globalData.guide_id, - UserCode: th.data.options.usercode, - } - }).then(res => { - console.log('res==>', a.stoid, e.globalData.guide_id, th.data.options.usercode); - if(res.data.data.Tech) { - - var data={ - store_name: res.data.data.StorageName, - beautician_name: res.data.data.StaffName, - beauticianID: res.data.data.StaffId, - StorageId: res.data.data.StorageId, - } - th.check_firleader(data); - } - }); - - - }; - }); - }; - - + + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/togoin/togoin', + }) + return false; + } }, - //查询剩下可预约人数 - query_more: function() { - var th = this; - var url = "/api/weshop/marketing/reservation/can/reservation/countnew"; - var beauticianID = th.data.beauticianID; //美容师id - var projectID = th.data.itemId; //服务id - var seekTime = th.data.time; //预约日期 - var storageId = th.data.storageId; //门店id - var storeId = a.stoid; //商家id - getApp().request.promiseGet(url, { - data: { - beauticianId: beauticianID, - seekTime: seekTime, - serviceId: projectID, - storageId: storageId, - storeId: storeId - } - }).then(res => { - if (res.data.code == 0) { - var tment_count = res.data.data.CanReservation; - th.setData({ - tment_count: tment_count - }) - } else { - getApp().my_warnning(res.data.msg, 0, th); - th.settime(); - } - }) + - }, /** * 生命周期函数--监听页面显示 */ onShow: function() { var th = this; - var seekTime = th.data.time; //预约日期 - if (seekTime != "") { - th.query_more(); - } th.setData({ - time: th.data.time.substring(0, 16), is_textea: 1 }) - th.query_project(); - - th.queryMultipleNodes(); + }, + + //获取单个服务项目信息 query_project: function() { var th = this; @@ -687,81 +589,17 @@ Page({ } }) }, - //关闭导航 - // close: function() { - // var th = this; - // var nav_b = th.selectComponent("#nav_b"); //组件的id - // nav_b.close_box(); - // } - - //判断分享的导购是不是有门店,是不是该门店下又该会员 - check_firleader(data){ - var th=this; - var itemId = this.data.itemId; //服务id - var url = "/api/weshop/marketing/reservation/storage/pagenew"; - var key_word = data.store_name; - key_word = key_word.replace(/\s+/g, ""); - getApp().request.promiseGet(url, { - data: { - userId: th.data.options.userid, - storeId: os.stoid, - serviceId: itemId, - latitude: th.data.lat, - longitude: th.data.lon, - page: 1, - pageSize: 1000, - keyWord: key_word - } - }).then(res => { - //-- 如果是门店的话 -- - if (res.data.code == 0 && res.data.data && res.data.data.pageData) { - var store_data=null; - for(var i in res.data.data.pageData){ - var it=res.data.data.pageData[i]; - if(it.Id==data.StorageId){ - store_data={ - store_name: data.store_name, - StorageId: data.StorageId, - }; - break; - } - } - if(!store_data) return false; - th.setData(store_data) - - }else{ - return false; - } - - //导购接口地址 - var url = "/api/weshop/marketing/reservation/staff/pagenew"; - return getApp().request.promiseGet(url, { - isShowLoading:1, - data: { - storeId: os.stoid, - userId: th.data.options.userid, - serviceId: itemId, - storageId: data.StorageId - } - }) - }).then(res=>{ - if (res && res.data && res.data.code == 0) { - var beautician_list=res.data.data; - for(var i in beautician_list){ - var item=beautician_list[i]; - if(item.staffid==data.beauticianID){ - th.setData({ - beautician_name:data.beautician_name, - beauticianID:data.beauticianID, - }) - break; - } - } - - } - }) - }, + + + //开始拖拽项目列表 + touchmove1: function (e) { + var that = this; + var position = [e.touches[0].pageX-15, e.touches[0].pageY-that.data.s_top]; + that.setData({ + wp: position + }); + }, //开始拖拽 touchmove: function (e) { @@ -772,59 +610,233 @@ Page({ write: position }); }, - touchend:function(e){ - var that = this,th=that; - if(!that.data.copy_btn) return false; - var position =th.data.write; - var arr=th.data.col_arr; - for(var i=0;i1?new Date(d_str+d_arr[1]):0; - - for(var j=0; jt2 && t2>0) continue; - //如果坐标在网格内 - if( position[0]>th.data.f_x+i*th.data.f_width && position[0]th.data.f_y +j*th.data.f_hei && position[1]1){ + wx.showToast({ + title: '当前项目预约次数已超出项目剩余数,请先修改', icon: 'none', duration: 2000 + }); + return false; + } + wx.showModal({ + title: "当前项目已有预约是否修改?", + success: function (res) { + if(res.confirm){ + delete th.data.v[i][sj]; + if(!th.data.v[i]) + th.data.v[i]={} + th.data.v[i][j]=th.data.sele_project; + var ind=arr.indexOf(sj); + arr.splice(ind, 1); + arr.push(j); + th.setData({ + v: th.data.v,col_arr:arr + }); + + } + } + }) + return false; + }else{ + var txt="v["+i+"]["+j+"]"; arr.push(j); th.setData({ - [txt]: th.data.projectName, + [txt]: th.data.sele_project, col_arr:arr - }); - break; - } + }); + return false; + } + }) + + } + } + + } + + th.checK_is_can_yy(item,tn,function(res){ + if(res){ + if(res>1){ + wx.showToast({ + title: '当前项目预约次数已超出项目剩余数,请先修改', icon: 'none', duration: 2000 + }); + return false; + } + + wx.showModal({ + title: "当前项目已有预约是否修改?", + success: function (res) { + if(res.confirm){ + + var ii=th.data.cur_sele_i; + var jj=th.data.cur_sele_j; + delete th.data.v[ii][jj]; + if(!th.data.v[i]) + th.data.v[i]={} + th.data.v[i][j]=th.data.sele_project; + var ind=arr.indexOf(jj); + arr.splice(ind, 1); + arr.push(j); + th.setData({ + v: th.data.v,col_arr:arr + }); + } + } + }) + + }else{ + var txt="v["+i+"]["+j+"]"; + arr.push(j); + th.setData({ + [txt]: th.data.sele_project, + col_arr:arr + }); + } + - } - } - th.setData({copy_btn:0}) + + }); }, + + + + //删除响应的预约 close_this:function (e){ var txt=e.currentTarget.dataset.txt; var sindex=parseInt(e.currentTarget.dataset.sindex); - var arr=this.data.col_arr; - var ind=arr.indexOf(sindex); + var arr=this.data.col_arr; + var ind=arr.indexOf(sindex); arr.splice(ind,1) this.setData({[txt]:null,col_arr:arr}) }, - onPageScroll(e) { - // console.log('滚动距离', e); - this.data.scrolltop = e.scrollTop; - }, + //计算滚蛋的距离 + onPageScroll(e) { this.data.scrolltop = e.scrollTop;}, + + //确认有没有预约 + checK_is_can_yy(item, tn, back) { + var th = this; + var req = { + beauticianId: encodeURIComponent(item.staffid), + seekTime: this.data.datet + " " + tn + ":00", + serviceId: encodeURIComponent(this.data.sele_project.ServiceID), + storageId: encodeURIComponent(this.data.storageId), + storeId: os.stoid + } + getApp().request.get("/api/weshop/marketing/reservation/can/reservation/countnew", { + data: req, + success: function (res) { + th.setData({ copy_btn: 0 }); + if (res.data.code == 0) { + if (!res.data.data.CanReservation && parseInt(res.data.data.canReservation) <= 0) { + wx.showToast({ + title: '该项目不可以预约', icon: 'none', duration: 2000 + }); + return false; + } + + if (!th.data.v) { back(); return false; } + + var arr = Object.keys(th.data.v); + if (arr.length == 0) { back(); return false; } + + var num = 0; + var sele_arr=[]; + for (var i in th.data.v) { + if (!th.data.v[i]) continue; + for (var j in th.data.v[i]) { + if (th.data.v[i][j] && th.data.v[i][j].ServiceID == th.data.sele_project.ServiceID) { + num++; + th.data.cur_sele_i=i; + th.data.cur_sele_j=j; + } + } + } + + if (!num) { back(); return false; } + //如果已经超出次数的时候,就不能预约了 + if (num >= parseInt(res.data.data.CanReservation)) { + + back(num); + return false; + } + back(); + + } else { + wx.showToast({ + title: res.data.msg, + icon: 'none', + duration: 2000 + }) + } + } + }) + }, //声明节点查询的方法 queryMultipleNodes: function() { @@ -833,16 +845,24 @@ Page({ query.select('.content_view').boundingClientRect() // 这段代码的意思是选择Id=productServe的节点,获取节点位置信息的查询请求 query.selectViewport().scrollOffset() // 这段代码的意思是获取页面滑动位置的查询请求 query.exec(res => { + if(!res || res.length==0) return false; + if(!res[0]) return false; + console.log(res); th.data.f_x=res[0].left; th.data.f_y=res[0].top; th.data.f_hei=res[0].height; th.data.f_width=res[0].width; - }) + }, + /*-- getcopy(e) { + + },--*/ + //项目元素点击后的效果 + getName(e) { var that=this; console.log('e', e); var x=e.currentTarget.dataset.offsetLeft; @@ -850,52 +870,74 @@ Page({ var position = [x, y]; that.setData({ write: position,copy_btn:1 - }); - - }, - - getName(e) { - // console.log('e1', e); - let name = e.currentTarget.dataset.name; + }); + // console.log('e1', e); + let index = e.currentTarget.dataset.index; + let name = this.data.project[index]; + + this.setData({ - projectName: name, + sele_project: name,prj_index:index }); + + }, + + //-- 项目列表长按 -- + setmove1(){ + this.setData({move1:1}); }, - - // 生成时间段 - getTimeList(hours,step) { - var minutes=60; + //-- 生成时间段 -- + getTimeList(hours,step) { + var minutes=60; var timeArr = []; hours = hours; step = step; + + // 如果数值位数为1,则补0 + function appendZero(obj) { + if (obj < 10) { + return "0" + "" + obj; + } else { + return obj; + } + }; + + var now_date=new Date(); + var md = now_date.getFullYear()+"-"+appendZero(now_date.getMonth() + 1) + "-" + appendZero(now_date.getDate()); - for(var i = 8; i < hours; i++){ - var str = ''; - if(i < 10) { - str = 0 + '' + i; - } else { - str = '' + i; - }; - - for(var j = 0; j < minutes; j++) { - if(j % step == 0){ - var s = j < 10 ? ':' + 0 + '' + j : ':' + j; - s = str + s; - timeArr.push(s); - }; - }; - }; - - // console.log('timeArr', timeArr); - this.setData({ - timeArr, - }); + for(var i = 8; i < hours; i++){ + var str = ''; + if(i < 10) { + str = 0 + '' + i; + } else { + str = '' + i; + }; + + for(var j = 0; j < minutes; j++) { + if(j % step == 0){ + var s = ':' + appendZero(j); + s = str + s; + //-- 不是当天 -- + if(this.data.datet && this.data.datet!=md){ + timeArr.push(s); + }else{ + var d1=md+" "+s; + var date1=new Date(d1); + //必须是大于 + if(date1.getTime()>now_date.getTime()){ + timeArr.push(s); + } + } + + }; + }; + }; + + this.setData({timeArr,}); }, - - - + scroll(e) { // console.log('e', e.detail.deltaX); let deltaX = e.detail.deltaX; @@ -904,8 +946,104 @@ Page({ // }; this.data.deltaX = -deltaX; }, - + + pickerTap:function() { + var date = new Date(); + var monthDay = ['今天','明天']; + // 月-日 + for (var i = 2; i <= 14; i++) { + var date1 = new Date(date); + date1.setDate(date.getDate() + i); + var md = (date1.getFullYear()+"-"+date1.getMonth() + 1) + "-" + date1.getDate(); + monthDay.push(md); + } + this.setData(monthDay); + }, + + + //-- 选择时间的时候 -- + bindDateChenge: function(e) { + var th=this; + var nd=new Date(this.data.nowDate); + var nd1=new Date(e.detail.value); + if(nd1.getTime() now_date.getTime()) { + arr.push(ti_time_arr[j]); + } + } + data[i].listtime = arr; + } + this.setData({md:data}); + + + + }, + + + }) \ No newline at end of file diff --git a/packageA/pages/my_service2/appment_main.js.rej b/packageA/pages/my_service2/appment_main.js.rej deleted file mode 100644 index efecfee..0000000 --- a/packageA/pages/my_service2/appment_main.js.rej +++ /dev/null @@ -1,10 +0,0 @@ -diff a/packageA/pages/my_service/appment_main.js b/packageA/pages/my_service/appment_main.js (rejected hunks) -@@ -647,7 +647,7 @@ - var project_id = th.data.project_id; //服务项目id - getApp().request.promiseGet(url, { - data: { -- storeId: a.stoid, -+ storeId: th.data.options.storeid, - userId: th.data.options.userid, - projectId: project_id - } diff --git a/packageA/pages/my_service2/appment_main.json b/packageA/pages/my_service2/appment_main.json index d6e82a4..0b45084 100644 --- a/packageA/pages/my_service2/appment_main.json +++ b/packageA/pages/my_service2/appment_main.json @@ -3,6 +3,8 @@ "enablePullDownRefresh": false, "usingComponents": { "warn": "/components/long_warn/long_warn", - "nav_b": "/components/nav_b/nav_b" + "nav_b": "/components/nav_b/nav_b", + "nodata": "/components/nodata/nodata" + } } \ No newline at end of file diff --git a/packageA/pages/my_service2/appment_main.wxml b/packageA/pages/my_service2/appment_main.wxml index 27c9dc0..4fc5fd6 100644 --- a/packageA/pages/my_service2/appment_main.wxml +++ b/packageA/pages/my_service2/appment_main.wxml @@ -1,33 +1,43 @@ - - - - - + + + + + - - - - {{item}} - + + + + + {{item.ServiceName}} + + + - - + + + + + + + + + + + + {{datet==""?'选择日期':datet}} + + + + + + @@ -40,8 +50,11 @@ {{store_name==""?'选择服务门店':store_name}} - - + + + + + 时间 @@ -56,89 +69,21 @@ --> - {{item.name}} + {{item.StaffName}} - - {{v[index][subindex]?v[index][subindex]:''}} - × + + + + {{v[index][subindex]?v[index][subindex].ServiceName:''}} + × + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -146,9 +91,10 @@ 我的预约 -
- -
+
+ + +
@@ -165,7 +111,7 @@
- + @@ -206,8 +152,11 @@ - + + + \ No newline at end of file diff --git a/packageA/pages/my_service2/appment_main.wxml.rej b/packageA/pages/my_service2/appment_main.wxml.rej deleted file mode 100644 index be50729..0000000 --- a/packageA/pages/my_service2/appment_main.wxml.rej +++ /dev/null @@ -1,143 +0,0 @@ -diff a/packageA/pages/my_service/appment_main.wxml b/packageA/pages/my_service/appment_main.wxml (rejected hunks) -@@ -17,54 +17,120 @@ - - -
-+ -+ -+ -+ -+ 时间 -+ 8:00 -+ 9:00 -+ -+ -+ -+ -+ 张三 -+ 100 -+ 200 -+ -+ -+ 张三 -+ 100 -+ 200 -+ -+ -+ 张三 -+ 100 -+ 200 -+ -+ -+ 张三 -+ 100 -+ 200 -+ -+ -+ 张三 -+ 100 -+ 200 -+ -+ -+ 张三 -+ 100 -+ 200 -+ -+ -+ 张三 -+ 100 -+ 200 -+ -+ -+ 1张三 -+ 300 -+ 300 -+ -+ -+ -+ -+ -+ -+ 项目1 -+ -+ -+ -+ 项目1 -+ -+ -+ -+ -+ -+ - -- -+ - -- -+ - - -- -- -+ -+ - -- -+ - -- -+ -+ -+ -+ - - -- -+ - -- -+ - - -- -+ -+ - - -- -+ - -- -+ + + + + + + + + 导购名称: + + {{it.StaffName?it.StaffName:'无'}} + + + + + 购买商品: + {{it.list[0].WareName}} + + + + + 购买时间: + {{it.BillDate}} + + + + + 评价时间: + {{EvaluateDatetime}} + + + + + + + + + + + + + + + + {{proposal}} + + + + + + + {{item.LabelName}} + + + + + + + {{item.LabelName}} + + + + + + + + + + + + + + + + 评价成功 + + + + + + + + + 确认提交 + + + + + + + 评价其他 + + + 查看已评价的订单 + + + + + + + + 溜街 + + + + + + 领券 + + + + + + + 点击领取礼品 + + + + + + + + diff --git a/packageB/pages/evaluate/evaluate.wxss b/packageB/pages/evaluate/evaluate.wxss new file mode 100644 index 0000000..a48f95a --- /dev/null +++ b/packageB/pages/evaluate/evaluate.wxss @@ -0,0 +1,174 @@ +.container { + border-top: 7rpx solid rgb(245, 245, 245); + padding-bottom: 100rpx; + background-color: rgb(255, 255, 255); +} + +.head { + height: 270rpx; +} + +.headimg { + width: 190rpx; + height: 190rpx; + border-radius: 50%; +} + +.item { + margin-bottom: 20rpx; +} + +.itemlf { + width: 195rpx; +} + +.itemlr { + width: 360rpx; +} + +.starss { + margin-top: 15rpx; + border-top: 3rpx dashed rgb(203, 203, 203); + padding-top: 25rpx; + padding-left: 15rpx; +} + +.stars { + width: 50rpx; + height: 50rpx; + margin-right: 20rpx; +} + +.datetime { + width: 190rpx; +} + +.tea_labs { + padding: 0rpx 56rpx; + margin-top: 20rpx; +} + +.proposal { + right: 20rpx; + bottom: 20rpx; + color: rgb(152, 152, 152); +} + +.textarea { + width: 100%; + height: 200rpx; + margin-top: 70rpx; + border: 2rpx solid rgb(203, 203, 203); + border-radius: 13rpx; + padding-top: 25rpx; + padding-left: 30rpx; + margin-bottom: 30rpx; + padding-right: 15rpx; + padding-bottom: 20rpx; +} + +.labels { + display: inline-block; + max-height: 240rxp; + line-height: 50rpx; + padding-left: 15rpx; +} + +.label { + padding: 0rpx 10rpx; + height: 48rpx; + line-height: 48rpx; + border: 2rpx solid rgb(218, 218, 218); + color: rgb(152, 152, 152); + border-radius: 5rpx; + margin-right: 20rpx; + width: 165rpx; + display: inline-block; + text-align: center; + margin-bottom: 10rpx; +} + +/* 选择标签的样式 */ + +.checklabel { + border: 2rpx solid rgb(214, 1, 33); + background-color: rgb(255, 231, 235); + color: rgb(214, 1, 33); +} + +.feedback { + color: rgb(152, 152, 152); + margin-bottom: 70rpx; +} + +.Subs { + background-color: rgb(255, 255, 255); + position: fixed; + width: 100%; + bottom: 40rpx; +} + +.Submission { + width: 400rpx; + height: 65rpx; + border-radius: 60rpx; + background-color: rgb(214, 1, 33); + color: rgb(255, 255, 255); +} +.Submission.yellow-b{ + background-color: #ffb03f; + +} + +.clonri { + margin: 0rpx; +} + +.subSuccess { + position: fixed; + z-index: 3; + top: 435rpx; + left: 66rpx; + background-color: #a6a6a6a4; + width: 615rpx; + height: 315rpx; + border-radius: 20rpx; + color: rgb(255, 255, 255); +} + +.Success { + width: 110rpx; + height: 110rpx; + margin-top: 50rpx; + margin-bottom: 45rpx; +} + +.show_icon{ + width: 50%; + margin: 0 auto; + display: flex; justify-content: space-between; +} + +.icon_item{ + display: flex;align-items: center; justify-content: center; font-size: 26rpx; text-align: center; + width: 140rpx; height: 140rpx; border: 1rpx solid #eee; border-radius: 50%; line-height: 34rpx; +} + +.go_right::after{ + content: ''; + display: inline-block; + width: 20rpx; + height: 20rpx; + border-top:1rpx solid #999 ; + border-right: 1rpx solid #999; + transform: rotate(45deg); +} + +.show_pop_div{ + position: fixed; max-height:50%; left: 0;top:50%; transform: translateY(-50%); overflow-y: auto; + background-color: #fff; text-align: center; z-index: 100000; width: 100%; min-height: 300rpx; +} + +.show_pop_div .title{ + height: 100rpx; line-height: 100rpx; border-bottom: 1rpx solid #eee; font-size: 34rpx; +} diff --git a/packageB/pages/evaluate_list/evaluate_list.js b/packageB/pages/evaluate_list/evaluate_list.js new file mode 100644 index 0000000..0ef06b7 --- /dev/null +++ b/packageB/pages/evaluate_list/evaluate_list.js @@ -0,0 +1,110 @@ + var e = getApp(), + os = e.globalData.setting, + t = e.request, + d = e.globalData; +Page({ + /** + * 页面的初始数据 + */ + data: { + url: os.url, //接口网址 + iurl: os.imghost, + defimgurl: "/miniapp/images/no-head.jpg", + list:[], + }, + + //图片失败,默认图片 + bind_bnerr1: function (e) { + var th = this; + var _errImg = e.target.dataset.errorimg; + var _Img = e.target.dataset.img; + if (_Img != undefined) { + var _errObj = {}; + _errObj[_errImg] = "/miniapp/images/no-head.jpg"; + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + var th=this; + getApp().getConfig(function(e){ + th.setData({img:e.store_logo}); + }) + + var IsEvaluate=options.IsEvaluate?options.IsEvaluate:0; + this.setData({IsEvaluate:parseInt(IsEvaluate) }); + this.get_list(); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + + }, + + get_list:function(){ + var th=this; + var req={ + storeId:os.stoid, + VIPId:getApp().globalData.userInfo.erpvipid, + IsEvaluate:0 + } + if(parseInt(this.data.IsEvaluate)){ + req.IsEvaluate=1; + } + + var url="/api/weshop/evaluation/FormListNew/page"; //获取评价列表 + getApp().request.get(url,{ + data:req, + success:function(res){ + console.log(res); + th.setData({is_get:1}); + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ + th.setData({list:res.data.data.pageData}); + } + }, + }) + }, + + go_evaluate(e){ + var idx=e.currentTarget.dataset.index; + var item=this.data.list[idx]; + var posno=item.PosNo; + getApp().goto("/packageB/pages/evaluate/evaluate?number="+posno); + }, + + //弹出显示商品详情 + show_pop:function(e){ + var idx=e.currentTarget.dataset.index; + var item=this.data.list[idx]; + var posno=item.PosNo; + var th=this; + //获取商品详情 + var url="/api/weshop/evaluation/Evaluatewares/page"; + getApp().request.get(url,{ + isShowLoading:true, + data:{storeId:os.stoid,POSNo:posno}, + success:function(res){ + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ + th.setData({show_goods_list:res.data.data.pageData,sh_pop:1}); + } + } + }) + }, + + //关闭弹出 + close_pop:function(){ + this.setData({ + show_goods_list:null,sh_pop:0 + }) + } + + + + + +}) \ No newline at end of file diff --git a/packageB/pages/evaluate_list/evaluate_list.json b/packageB/pages/evaluate_list/evaluate_list.json new file mode 100644 index 0000000..bd72270 --- /dev/null +++ b/packageB/pages/evaluate_list/evaluate_list.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "评价列表", + "usingComponents": { + "qr_code": "/components/qr_code/qr_code", + "warn": "/components/long_warn/long_warn" + } +} \ No newline at end of file diff --git a/packageB/pages/evaluate_list/evaluate_list.wxml b/packageB/pages/evaluate_list/evaluate_list.wxml new file mode 100644 index 0000000..04aae0b --- /dev/null +++ b/packageB/pages/evaluate_list/evaluate_list.wxml @@ -0,0 +1,51 @@ + + + + + 暂无订单或未设置评价信息 + + + + + + + + + + + + 4.9 + + + {{item.WareName}} + + + + 消费时间:{{item.BillDate}} + 查看评价 + 去评价 + + + + + + + + + + + + + + diff --git a/packageB/pages/evaluate_list/evaluate_list.wxss b/packageB/pages/evaluate_list/evaluate_list.wxss new file mode 100644 index 0000000..d2f31e1 --- /dev/null +++ b/packageB/pages/evaluate_list/evaluate_list.wxss @@ -0,0 +1,28 @@ +.item{ padding:10rpx 20rpx; border-bottom: 20rpx solid #ebeced} +.line_item{ height: 36rpx;} +.logo{ + width: 160rpx; height: 160rpx; border-radius: 50%; border: 1rpx solid #eee; +} +.go_right{position: relative;top:-10rpx;right: 10rpx;} +.go_right::after{ + content: ''; + display: inline-block; + width: 20rpx; + height: 20rpx; + border-top:1rpx solid #333 ; + border-right: 1rpx solid #333; + transform: rotate(45deg); +} +.btn{ + padding: 10rpx 16rpx; border: 1rpx solid #c4182e; color: #c4182e; border-radius: 8rpx; +} + + +.show_pop_div{ + width: 96%; margin-left: 2%; position: fixed; max-height:50%; left: 0;top:50%; transform: translateY(-50%); overflow-y: auto; + background-color: #fff; text-align: center; z-index: 100000; min-height: 300rpx; +} + +.show_pop_div .title{ + height: 100rpx; line-height: 100rpx; border-bottom: 1rpx solid #eee; font-size: 34rpx; +} diff --git a/packageB/pages/luckactivity/index/g_filter.wxs b/packageB/pages/luckactivity/index/g_filter.wxs new file mode 100644 index 0000000..9719e7d --- /dev/null +++ b/packageB/pages/luckactivity/index/g_filter.wxs @@ -0,0 +1,29 @@ +var g_filters = { + has_char:function(url,key){ + if(!url) return -1; + return url.indexOf(key); + }, + beg_time:function(beg_date){ + var fmt1 = beg_date.substring(0, 19); + var reg = getRegExp("-", "g"); + var fmt2 = fmt1.replace(reg, '/'); + var t1 = getDate(fmt2); + var tnow=getDate(); + if(t1<=tnow) return 1; + return 0; + }, + end_time:function(end_date){ + var fmt1 = end_date.substring(0, 19); + var reg = getRegExp("-", "g"); + var fmt2 = fmt1.replace(reg, '/'); + var t1 = getDate(fmt2); + var tnow=getDate(); + if(t1>=tnow) return 1; + return 0; + } +} +module.exports = { + has_char: g_filters.has_char, + beg_time: g_filters.beg_time, + end_time: g_filters.end_time, +} \ No newline at end of file diff --git a/packageB/pages/luckactivity/index/index.js b/packageB/pages/luckactivity/index/index.js new file mode 100644 index 0000000..222d866 --- /dev/null +++ b/packageB/pages/luckactivity/index/index.js @@ -0,0 +1,255 @@ +// packageA//pages/myGift/myGift.js +const app = getApp(); +let self = null; +var os = app.globalData.setting; + +Page({ + + /** + * 页面的初始数据 + */ + data: { + tabArr: ['抽奖列表', '历史抽奖'], + currentIndex: 0, + + list: null, + isLoading: false, // 检测是否已经发送请求,防止重复发送请求 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 + pageNum: 1, // 当前页数 + }, + + clickTab(e) { + let index = e.target.dataset.index; + let url = '/api/weshop/marketing/marketingLuckForm/page'; + let data = { + store_id: app.globalData.setting.stoid, + }; + + this.setData({ + list: null, + pageNum: 1, + noMore: false, + currentIndex: index, + }); + + if(index == 0) { + data.is_end = 0; + } else if(index == 1) { + data.is_end = 1; + }; + + this.getData(true, url, data).then(function() { + self.setData({ + currentData: data, + }); + }); + }, + + /** + * 生命周期函数--监听页面加载 + */ + 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/marketing/marketingLuckForm/page'; + let data = { + store_id: app.globalData.setting.stoid, + is_end: 0, + }; + + this.setData({ + list: null, + pageNum: 1, + noMore: false, + }); + + this.getData(true, url, data).then(function() { + self.setData({ + currentData: data, + }); + }); + + // 获取广告 + app.request.promiseGet("/api/weshop/ad/page", { + data: { + pid: 1201, + store_id: app.globalData.setting.stoid, + enabled: 1 + } + }).then(res => { + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ + var a = res.data.data.pageData; + var narr=[]; + for(var i in a){ + var tt = { + 'ad_code': os.imghost + a[i].ad_code, + 'media_link': '', + 'ad_weapplink':a[i].ad_weapplink + }; + narr.push(tt); + } + + self.setData({ + ad_data: narr, + }); + } + }) + + + }; + }; + + + + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + let data = this.data.currentData; + console.log('触底!', data); + this.scrollToLower('/api/weshop/marketing/marketingLuckForm/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); + }; + }, + + /** + * 点击跳转 + */ + goto(e) { + // let url = ''; + // if(e.target.dataset.url) { + // url = e.target.dataset.url; + // } else { + // url = e.currentTarget.dataset.url; + // } + let id = e.currentTarget.dataset.id; + let title = e.currentTarget.dataset.title; + let url = `/packageB/pages/luckactivity/luckinfo/luckinfo?id=${id}&title=${title}`; + app.goto(url); + }, + + + +}) \ No newline at end of file diff --git a/packageB/pages/luckactivity/index/index.json b/packageB/pages/luckactivity/index/index.json new file mode 100644 index 0000000..7c5c498 --- /dev/null +++ b/packageB/pages/luckactivity/index/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "幸运大转盘", + "enablePullDownRefresh": false, + "usingComponents": { + "warn": "/components/long_warn/long_warn", + "nav_b": "/components/nav_b/nav_b", + "my_confirm": "/components/my_confirm/my_confirm", + "nodata": "/components/nodata/nodata" + } +} \ No newline at end of file diff --git a/packageB/pages/luckactivity/index/index.wxml b/packageB/pages/luckactivity/index/index.wxml new file mode 100644 index 0000000..c9ab532 --- /dev/null +++ b/packageB/pages/luckactivity/index/index.wxml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + {{item}} + + + + + + + + + + {{item.act_name}} + + 活动时间:{{filter.format_time(item.begindate) + ' 至 ' + filter.format_time(item.enddate)}} + 兑换时间:{{filter.format_time(item.begindate) + ' 至 ' + filter.format_time(item.enddate)}} + + + + 立即参与 + 去兑换 + + + + + + + + + + + + + + + diff --git a/packageB/pages/luckactivity/index/index.wxss b/packageB/pages/luckactivity/index/index.wxss new file mode 100644 index 0000000..0c76dbb --- /dev/null +++ b/packageB/pages/luckactivity/index/index.wxss @@ -0,0 +1,181 @@ +@charset "utf-8"; + +.c-a4 { + color: #a4a4a4; +} + +.c-red { + color: #FF6768; +} + +.h88 { + height: 88rpx; +} + + +page { + background-color: #f0f0f0; +} + +.tab-title { + display: flex; + position: sticky; + background-color: white; + top: 0; + font-size: 30rpx; + z-index: 999; +} + +.tab-title::after { + position: absolute; + content: ''; + width: 2rpx; + height: 40%; + background-color: #f0f0f0; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: auto; +} + +.tab-title-item { + flex: 1; + text-align: center; + padding-top: 20rpx; + padding-bottom: 20rpx; + position: relative; +} + +.tab-title-item.active { + color: #FF6768; + font-weight: bold; + +} + +.tab-title-item::after { + position: absolute; + content: ''; + left: 100%; + bottom: 0; + width: 0; + border-bottom: 2rpx solid #FF6768; + /* height: 3rpx; */ + transition: 0.2s all linear; +} + +.tab-title-item.active::after { + /* left: 100%; */ + width: 100%; + left: 0; + /* background-color: #FF6768; */ + /* transition-delay: 0.1s; */ +} + +.tab-title-item.active ~ .tab-title-item::after { + /* width: 100%; */ + left: 0; +} + +.tab-content { + padding-top: 20rpx; + padding-left: 20rpx; + padding-right: 20rpx; +} + +.tab-item { + padding: 20rpx; + background-color: white; + border-radius: 10rpx; + overflow: hidden; + display: flex; + align-items: center; +} + +.tab-item ~ .tab-item { + margin-top: 20rpx; +} + +.icon-zhuanpan { + font-size: 120rpx; + color: #FF6768; +} + +.img-container { + /* background-color: #dedede; */ + /* height: 300rpx; */ + width: 100%; + height: 200rpx; +} + +.img-container2 { + width: 200rpx; + height: 200rpx; + background-color: #dedede; + margin-right: 20rpx; + flex-shrink: 0; + display: flex; + align-items: center; + position: relative; +} + +.img-container2.error::before { + font-family: iconfont; + position: absolute; + content: '\e8c1'; +} + +.img { + display: block; + width: 100%; + height: 100%; +} + +.desc-container { + /* padding: 20rpx; */ + padding-left: 20rpx; + flex: 1; +} + + + +.rmb::before { + content: '¥'; +} + +.date { + color: #a4a4a4; + font-size: 24rpx; +} + +.btn-container { + display: flex; + justify-content: flex-end; + font-size: 26rpx; +} + +.btn { + font-size: 28rpx; + padding: 12rpx 30rpx; + border-radius: 8rpx; + text-align: center; + display: inline-block; + text-align: right; +} + +.btn.red { + background-color: #FF6768; + color: white; +} + +.btn.pink { + background-color: #FACAD6; + color: #FF6768; +} + +.noMore { + padding: 20rpx; + color: #bbb; + text-align: center; + font-size: 22rpx; +} \ No newline at end of file diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.js b/packageB/pages/luckactivity/luckinfo/luckinfo.js new file mode 100644 index 0000000..3f30273 --- /dev/null +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.js @@ -0,0 +1,766 @@ +const app = getApp(); +let imghost = app.globalData.setting.imghost; +let self = null; + +Page({ + data: { + start: false, + list: null, + isLoading: false, // 检测是否已经发送请求,防止重复发送请求 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 + pageNum: 1, // 当前页数 + imghost: imghost, + + prizes: [], + defaultConfig: { + offsetDegree: 22.5, + }, + // defaultStyle: { + // fontColor: '#d64737', + // fontSize: '14px' + // }, + blocks: [ //背景图 + // { padding: '13px', background: '#d64737', top: '20rpx' } + { + padding: '76rpx', + // background: 'pink', + imgs: [{ + src: imghost + 'miniapp/images/luckDraw/weel.png', + width: '700rpx', + height: '700rpx', + rotate: true, + }] + } + ], + buttons: [ + // { radius: '50px', background: '#d64737' }, + // { radius: '45px', background: '#fff' }, + // { radius: '41px', background: '#f6c66f', pointer: true }, + // { + // radius: '35px', background: '#ffdea0', + // fonts: [{ text: '开始\n抽奖', fontSize: '18px', top: -18 }] + // } + { + radius: '60rpx', + // background: 'black', + // pointer: true, + imgs: [{ + src: imghost + 'miniapp/images/luckDraw/pointer.png', + width: '188rpx', + height: '230rpx', + top: '-130rpx', + }], + } + ], + }, + + onLoad(options) { + console.log('imghost+++++', imghost); + self = this; + this.data.options = options; + // this.setData({ + // options, + // imghost, + // }); + console.log('this data', this.data.imghost); + wx.setNavigationBarTitle({ + title: options.title, + }); + app.isLogin().then(function(data) {//进入页面前已经授权登录成功 + self.setData({ + userInfo: data, + // imghost, + }); + }); + }, + + onShow() { + if(app.globalData.userInfo) { + if(!this.data.isLogin) { + + this.setData({ + userInfo: app.globalData.userInfo, + isLogin: true, + }); + + // console.log('imghost', this.data.imghost); + let user_id = app.globalData.userInfo.user_id; + let store_id = app.globalData.setting.stoid; + let id = this.data.options.id; + let url = `/api/weshop/marketing/marketingLuckForm/getLuckInfo/${store_id}/${id}/${user_id}`; + + + app.request.get(url, { + success: function(res) { + if(res.data.code == 0) { + self.setData({ + luckInfo: res.data.data, + }); + } else { + wx.showToast({ + title: res.data.msg, + icon: 'none', + }); + self.data.msg = res.data.msg; + }; + + // console.log('luckInfo', res.data.data); + let luckInfo = res.data.data; + + if(luckInfo && luckInfo.template_type != null && luckInfo.template_type == 1) { //获取模板 + let url = `/api/weshop/marketing/marketingLuckTemplate/get/${store_id}/${luckInfo.template_id}`; + app.request.get(url, { + success: function(res) { + // console.log('prizes//////', res.data.data); + self.setData({ + template: res.data.data, + bannerUrl: imghost + (res.data.data.bannerUrl ? res.data.data.bannerUrl:'miniapp/images/luckDraw/bg.png'), //背景图 + 'blocks[0].imgs[0].src': imghost + (res.data.data.wheelBaseUrl ? res.data.data.wheelBaseUrl:'miniapp/images/luckDraw/weel.png'), //转盘 + 'buttons[0].imgs[0].src': imghost + (res.data.data.wheelPointerUrl ? res.data.data.wheelPointerUrl:'miniapp/images/luckDraw/pointer.png'), //指针 + }); + }, + }); + } else { + if(luckInfo && luckInfo.store_bannerUrl) { + self.setData({ + bannerUrl: imghost + luckInfo.store_bannerUrl, + }); + }; + + }; + + }, + }); + + // 获取奖品展示的奖品 + app.request.get('/api/weshop/marketing/marketingLuckList/page', { + data: { + store_id, + luck_formid: id, + }, + success: function(res) { + + let award = res.data.data.pageData; + self.setData({ + award, + }); + console.log('award', award); + self.prizeLayout(award); + + }, + }); + + + //获取兑奖记录 + app.request.get('/api/weshop/marketing/marketingLuckRecord/page', { + isShowLoading: false, + data: { + store_id: app.globalData.setting.stoid, + user_id: app.globalData.userInfo.user_id, + luck_formid: this.data.options.id, + luck_state: 1 + }, + success: function(res) { + if(res.data.code == 0) { + self.setData({ + record: res.data.data.pageData, + }); + }; + }, + }); + + + //获取中奖人员名单 + app.request.get('/api/weshop/marketing/marketingLuckRecord/page', { + isShowLoading: false, + data: { + store_id: app.globalData.setting.stoid, + luck_formid: this.data.options.id, + luck_state: 1, + pageSize: 20, + }, + success: function(res) { + if(res.data.code == 0) { + self.setData({ + nameList: res.data.data.pageData, + }); + }; + }, + }); + + }; + }; + }, + + // 设置转盘奖品布局 + prizeLayout(award) { + let prizes = []; + let length = award.length; + let thx = {fonts: [{ text: '谢谢\n参与', top: '18%', wordWrap:false, fontColor: 'rgba(255,255,255,.6)'}]}; + + if(length == 1) { + [0,2,4,6].map(function(item, index) { + prizes[item] = { + id: award[0].id, + lbtype: award[0].lbtype, + fonts: [{ text: award[0].luck_goods_name + ' x' + award[0].num, top: '18%', wordWrap:false, fontColor: 'transparent'}], + imgs: [ + { + src: self.prizeSrc(award[0].lbtype) ? self.prizeSrc(award[0].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'), + width: '135rpx', + height: '107rpx', + top: '12%', + } + ], + }; + }); + + [1,3,5,7].map(function(item, index) { + prizes[item] = thx; + }); + + this.data.thxIndexArr = [1,3,5,7]; + }; + + if(length == 2) { + [0,4].map(function(item, index) { + prizes[item] = { + id: award[0].id, + lbtype: award[0].lbtype, + fonts: [{ text: award[0].luck_goods_name + ' x' + award[0].num, top: '18%', wordWrap:false, fontColor: 'transparent'}], + imgs: [ + { + src: self.prizeSrc(award[0].lbtype) ? self.prizeSrc(award[0].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'), + width: '135rpx', + height: '107rpx', + top: '12%', + } + ], + }; + }); + + [2,6].map(function(item, index) { + prizes[item] = { + id: award[1].id, + lbtype: award[1].lbtype, + fonts: [{ text: award[1].luck_goods_name + ' x' + award[1].num, top: '18%', wordWrap:false, fontColor: 'transparent'}], + imgs: [ + { + src: self.prizeSrc(award[1].lbtype) ? self.prizeSrc(award[1].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'), + width: '135rpx', + height: '107rpx', + top: '12%', + } + ], + }; + }); + + [1,3,5,7].map(function(item, index) { + prizes[item] = thx; + }); + this.data.thxIndexArr = [1,3,5,7]; + }; + + + if(length == 3) { + [0,4].map(function(item, index) { + prizes[item] = { + id: award[0].id, + lbtype: award[0].lbtype, + fonts: [{ text: award[0].luck_goods_name + ' x' + award[0].num, top: '18%', wordWrap:false, fontColor: 'transparent'}], + imgs: [ + { + src: self.prizeSrc(award[0].lbtype) ? self.prizeSrc(award[0].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'), + width: '135rpx', + height: '107rpx', + top: '12%', + } + ], + }; + }); + + [1,5].map(function(item, index) { + prizes[item] = { + id: award[1].id, + lbtype: award[1].lbtype, + fonts: [{ text: award[1].luck_goods_name + ' x' + award[1].num, top: '18%', wordWrap:false, fontColor: 'transparent'}], + imgs: [ + { + src: self.prizeSrc(award[1].lbtype) ? self.prizeSrc(award[1].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'), + width: '135rpx', + height: '107rpx', + top: '12%', + } + ], + }; + }); + + [2,6].map(function(item, index) { + prizes[item] = { + id: award[2].id, + lbtype: award[2].lbtype, + fonts: [{ text: award[2].luck_goods_name + ' x' + award[2].num, top: '18%', wordWrap:false, fontColor: 'transparent'}], + imgs: [ + { + src: self.prizeSrc(award[2].lbtype) ? self.prizeSrc(award[2].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'), + width: '135rpx', + height: '107rpx', + top: '12%', + } + ], + }; + }); + + [3,7].map(function(item, index) { + prizes[item] = thx; + }); + + this.data.thxIndexArr = [3,7]; + }; + + + if(length == 4) { + [0,2,4,6].map(function(item, index) { + prizes[item] = { + id: award[index].id, + lbtype: award[index].lbtype, + fonts: [{ text: award[index].luck_goods_name + ' x' + award[index].num, top: '18%', wordWrap:false, fontColor: 'transparent'}], + imgs: [ + { + src: self.prizeSrc(award[index].lbtype) ? self.prizeSrc(award[index].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'), + width: '135rpx', + height: '107rpx', + top: '12%', + } + ], + }; + }); + + [1,3,5,7].map(function(item, index) { + prizes[item] = thx; + }); + + this.data.thxIndexArr = [1,3,5,7]; + }; + + if(length == 5) { + [0,2,3,5,6].map(function(item, index) { + prizes[item] = { + id: award[index].id, + lbtype: award[index].lbtype, + fonts: [{ text: award[index].luck_goods_name + ' x' + award[index].num, top: '18%', wordWrap:false, fontColor: 'transparent'}], + imgs: [ + { + src: self.prizeSrc(award[index].lbtype) ? self.prizeSrc(award[index].lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'), + width: '135rpx', + height: '107rpx', + top: '12%', + } + ], + }; + }); + + [1,4,7].map(function(item, index) { + prizes[item] = thx; + }); + + this.data.thxIndexArr = [1,4,7]; + }; + + if(length == 6) { + prizes = award.map(function(item, index) { + return { + id: item.id, + lbtype: item.lbtype, + fonts: [{ text: item.luck_goods_name + ' x' + item.num, top: '18%', wordWrap:false, fontColor: 'transparent'}], + imgs: [ + { + src: self.prizeSrc(item.lbtype) ? self.prizeSrc(item.lbtype): (imghost + 'miniapp/images/luckDraw/lb.png'), + width: '135rpx', + height: '107rpx', + top: '12%', + } + ], + }; + }); + + prizes.push(thx); + prizes.splice(3, 0, thx); + + this.data.thxIndexArr = [3,7]; + }; + + // console.log('prizes', prizes); + + this.setData({ + prizes, + }); + }, + + // 根据lbtype指定奖品类别图标 + prizeSrc(lbtype) { + let src = ''; + // let imghost = this.data.imghost; + switch(lbtype) { + case 1: { //积分 + src = imghost + 'miniapp/images/luckDraw/jf.png'; + break; + }; + case 2: { //成长值 + src = imghost + 'miniapp/images/luckDraw/czz.png'; + break; + }; + case 3: { //优惠券 + src = imghost + 'miniapp/images/luckDraw/yhq.png'; + break; + }; + case 4: { //服务项目 + src = imghost + 'miniapp/images/luckDraw/fw.png'; + break; + }; + case 5: { //赠品 + src = imghost + 'miniapp/images/luckDraw/zp.png'; + break; + }; + case 6: { //礼包 + src = imghost + 'miniapp/images/luckDraw/lb.png'; + break; + }; + }; + return src; + }, + + // 获取抽奖结果匹配对应奖品在奖品列表里的所有索引号 + luckyIndex(arr, target) { + var results=[], + len = arr.length, + pos = 0; + while(pos < len){ + // pos = arr[pos].indexOf(target, pos); + if(arr[pos].id == target) { + results.push(pos);//找到就存储索引 + + }; + pos+=1;//并从下个位置开始搜索 + // if(pos === -1){//未找到就退出循环完成搜索 + // break; + // }; + + } + // console.log('当前奖品列表', this.data.prizes); + // console.log('中奖结果在当前奖品列表中的索引', results); + + return results; + }, + + start () { + if(!this.data.luckInfo) { + wx.showToast({ + title: this.data.msg, + icon: 'none', + }); + return; + }; + + if(this.data.luckInfo.user_LuckNumDay != 0) { + // console.log('start choujiang'); + // let start = false; + if(!this.data.start) { + this.data.start = true; + // 获取抽奖组件实例 + const $lucky = this.selectComponent('#myLucky'); + // 调用play方法开始旋转 + $lucky.play(); + + // 获取抽奖结果 + app.request.post('/api/weshop/marketing/marketingLuckForm/startLuck', { + isShowLoading: false, + data: { + storeId: app.globalData.setting.stoid, + userId: app.globalData.userInfo.user_id, + LuckId: this.data.options.id, + }, + success: function(res) { + + if(res.data.code == 0) { + console.log('开始摇奖', res.data.data); + self.setData({ + 'luckInfo.user_LuckNumDay': self.data.luckInfo.user_LuckNumDay - 1 + }); + // console.log('请求成功', res.data.data); + let luckyId = res.data.data.id; + let indexArr = self.luckyIndex(self.data.prizes, luckyId); + // console.log('抽奖奖品id', luckyId); + // console.log('奖品列表', self.data.prizes); + // console.log('奖品对应的索引数组', indexArr); + let random = Math.random() * indexArr.length >> 0; + // console.log('random', random); + let index = indexArr[random]; + setTimeout(() => { + $lucky.stop(index); + self.data.start = false; + }, 3000); + + + } else { + // console.log('请求出错'); + let thxIndexArr = self.data.thxIndexArr; + const random = Math.random() * thxIndexArr.length >> 0; + const index = thxIndexArr[random]; + // console.log('谢谢参与数组', thxIndexArr); + // console.log('请求出错产生谢谢参与的随机数', index); + setTimeout(() => { + $lucky.stop(index); + self.data.start = false; + }, 3000); + }; + }, + + fail: function() { + // console.log('出错'); + let thxIndexArr = self.data.thxIndexArr; + const random = Math.random() * thxIndexArr.length >> 0; + const index = thxIndexArr[random]; + setTimeout(() => { + $lucky.stop(index); + self.data.start = false; + }, 3000); + }, + + }); + + } + + + } else { + wx.showToast({ + title: '你今天的抽奖次数已用完啦!~', + icon: 'none', + }); + }; + + }, + end (event) { + // 中奖奖品详情 + // console.log('zjiangla~~',event.detail.lbtype); + let lbtype; + let resultTitle = event.detail.fonts[0].text.replace('\n',''); + if(event.detail.lbtype == 5) { + lbtype = 5; + } else { + lbtype = -1; + }; + this.setData({ + hiddenCanvas: true, + showResult: true, + showMask: true, + resultTitle, + currentLbtype: lbtype, + }); + }, + + showPopup() { + this.setData({ + list: null, + pageNum: 1, + noMore: false, + }); + this.getData(true, '/api/weshop/marketing/marketingLuckRecord/page', { + store_id: app.globalData.setting.stoid, + user_id: app.globalData.userInfo.user_id, + luck_formid: this.data.options.id, + luck_state: 1, + pageSize: 50, + }).then(function(res) { + self.setData({ + showPopup: true, + showMask: true, + hiddenCanvas: true, + // record: self.data.list.pageData, + }); + }); + // app.request.get('/api/weshop/marketing/marketingLuckRecord/page', { + // // isShowLoading: false, + // data: { + // store_id: app.globalData.setting.stoid, + // user_id: app.globalData.userInfo.user_id, + // luck_formid: this.data.options.id, + // luck_state: 1 + // }, + // success: function(res) { + // // console.log('中奖记录', res.data.data); + // if(res.data.code == 0) { + // self.setData({ + // showPopup: true, + // showMask: true, + // hiddenCanvas: true, + // record: self.data.list.pageData, + // }); + + + // }; + // }, + + // }); + + }, + + closePopup() { + this.setData({ + showPopup: false, + showMask: false, + hiddenCanvas: false, + }); + }, + + closeResult() { + this.setData({ + showResult: false, + showMask: false, + hiddenCanvas: false, + }); + }, + + loadmore() { + this.scrollToLower('/api/weshop/marketing/marketingLuckRecord/page', { + store_id: app.globalData.setting.stoid, + user_id: app.globalData.userInfo.user_id, + luck_formid: this.data.options.id, + luck_state: 1, + pageSize: 50, + }); + }, + + + /** + * 请求数据 + */ + 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); + }; + }, + + + goto(e) { + let url = ''; + let type = e.currentTarget.dataset.type; + switch(type) { + case 1: { + url = '/pages/user/integral/integral'; + break; + }; + case 2: { + url = '/pages/user/grow_value/grow_value'; + break; + }; + case 3: { + url = '/pages/user/coupons/coupons'; + break; + }; + case 4: { + url = '/pages/user/my_service/i_service'; + break; + }; + case 6: { + url = '/packageA/pages/myGift/myGift'; + break; + }; + }; + app.goto(url); + }, + + showQr(e) { + let store_id = app.globalData.setting.stoid; + let id = e.currentTarget.dataset.id; + let url = `/api/weshop/marketing/marketingLuckList/updateGoodsVerifyCode/${store_id}/${id}`; + app.request.put(url, { + success: function(res) { + if(res.data.code == 0) { + let data = res.data.data; + console.log('data!!!!', data); + let barcode = self.selectComponent("#qrcode"); + barcode.open({val: data}); + self.setData({ + hiddenCanvas: true, + showPopup: false, + }); + }; + }, + + }); + }, + + closeQr() { + this.setData({ + hiddenCanvas: false, + showMask: false, + }); + }, + + clickReceive() { + this.setData({ + showResult: false, + }); + this.showPopup(); + }, +}) \ No newline at end of file diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.json b/packageB/pages/luckactivity/luckinfo/luckinfo.json new file mode 100644 index 0000000..e8748c5 --- /dev/null +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.json @@ -0,0 +1,9 @@ +{ + "usingComponents": { + "lucky-wheel":"/packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index", + "qrcode": "/components/my-qrcode/my-qrcode", + "nodata": "/components/nodata/nodata" + }, + "enablePullDownRefresh": false, + "navigationBarTitleText": "幸运大转盘" +} \ No newline at end of file diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.wxml b/packageB/pages/luckactivity/luckinfo/luckinfo.wxml new file mode 100644 index 0000000..aa67f42 --- /dev/null +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.wxml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + {{item.nickname}} + 获得了"{{item.luck_goods_name}}" + + + + + + + + + + + + 今天你还有 {{filter.show_default(luckInfo.user_LuckNumDay, '0')}} 次抽奖机会 + + + + + + + + + + + + + + + + {{item.luck_goods_name}} + + 价值:{{item.luck_goods_price}} + 数量:{{item.luck_goods_qty}} + + + + + + + + + + {{luckInfo.remark}} + + + + + + + + + + + + + + + + 提供技术支持 + + + + + + + + + + + + + + + + {{item.luck_name}} + + 价值:{{item.luck_goods_price}} + + 兑换状态:{{item.state == 0 ? '未兑换':'已兑换'}} + {{((item.luck_type == 5)&&(item.state == 1)) ? '已兑换':'兑换'}} + + + + + + + + + + + + + + + + + {{resultTitle}} + 继续加油噢~ + + + 恭喜你获得 + {{resultTitle}} + + + + + 立即领取 + + + + + + + + + + \ No newline at end of file diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.wxss b/packageB/pages/luckactivity/luckinfo/luckinfo.wxss new file mode 100644 index 0000000..66b7bd2 --- /dev/null +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.wxss @@ -0,0 +1,430 @@ +/* packageB//pages/luckactivity/index/index.wxss */ + +page { + /* background-color: rgb(129, 2, 253); */ +} + +page, +.luck-container { + /* height: 100%; */ +} + + + +.luck-container { + background-size: 100% auto !important; + padding: 50% 20rpx 0; +} + +.weel-container { + padding-bottom: 80rpx; +} + +.badge { + display: block; + width: 362rpx; + height: 57rpx; + margin: 30rpx auto; + position: relative; + font-size: 26rpx; + color: white; +} + +.badge::before { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +.badge.prizes::before { + content: '奖品展示'; +} + +.badge.activity::before { + content: '活动展示'; +} + +.prize-container { + width: 62rpx; + height: 64rpx; + border: 2rpx solid #eeedf0; +} + +.list { + /* padding: 0 20rpx; */ +} + +.list-item { + display: flex; + padding: 20rpx; +} + +.list-item ~ .list-item { + border-top: 2rpx solid #ebedf0; +} + +.img-container { + width: 140rpx; + height: 140rpx; + margin-right: 20rpx; + /* background-color: gray; */ +} + +.img { + display: block; + width: 100%; + height: 100%; +} + +.item-r { + display: flex; + flex-direction: column; + justify-content: space-between; + flex: 1; +} + +.tel { + display: flex; + align-items: center; + color: #00a0e0; + font-size: 28rpx; +} +.icon-tel { + font-size: 28rpx; + margin-right: 6rpx; +} + +.qrcode-container { + background-color: white; + border-radius: 12rpx; + margin-top: 40rpx; + padding: 20rpx; + text-align: center; + /* display: block; + width: 100%; + height: 100%; */ +} + +.qrcode { + width: 200rpx; + height: 200rpx; + background-color: gray; +} + +.logo { + width: 120rpx; + height: 40rpx; + margin-right: 10rpx; +} + +.gift-container { + background-color: rgba(44, 44, 44, 0.2); + width: 100rpx; + height: 100rpx; + border-radius: 50%; + color: white; + position: fixed; + right: 20rpx; + bottom: 20rpx; + display: flex; + justify-content: center; + align-items: center; + z-index: 1; +} + +.gift-container.active::after { + content: ''; + position: absolute; + width: 14rpx; + height: 14rpx; + background-color: #f74c31; + border: 2rpx solid #fff; + border-radius: 50%; + top: 6rpx; + right: 10rpx; +} + +.icon-liwu { + font-size: 40rpx; +} + + + + +.tip-to-down { + position: relative; + /* display: block; + text-align: center; + margin: auto; + margin-top: .4rem; + width: 6rem; + z-index: 2; + -webkit-transform: translate(0, -50%); */ + transform: translate(0, -50%); + /* color: #fff; + font: normal 400 20px/1 'Josefin Sans', sans-serif; + letter-spacing: .1em; + text-decoration: none; + -webkit-transition: opacity .3s; */ + transition: opacity .3s; +} +.tip-to-down text { + position: absolute; + top: 0; + left: 50%; + width: 1rem; + height: 1rem; + margin-left: -12px; + border-left: 1px solid #fff; + border-bottom: 1px solid #fff; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + -webkit-animation: sdb07 2s infinite; + animation: sdb07 2s infinite; + opacity: 0; + box-sizing: border-box; +} +.tip-to-down text:nth-of-type(1) { + -webkit-animation-delay: 0s; + animation-delay: 0s; +} +.tip-to-down text:nth-of-type(2) { + top: 16px; + -webkit-animation-delay: .15s; + animation-delay: .15s; +} + +@-webkit-keyframes sdb07 { + 0% { + opacity: 0; + } + 50% { + opacity: 1; + } + 100% { + opacity: 0; + } +} +@keyframes sdb07 { + 0% { + opacity: 0; + } + 50% { + opacity: 1; + } + 100% { + opacity: 0; + } +} + + +.popup-container { + position: fixed; + width: 100%; + bottom: 0; + background-color: white; + z-index: 1; + padding: 0 20rpx; + box-sizing: border-box; + z-index: 998; +} + +.popup-container .img-container { + width: 140rpx; + height: 140rpx; + flex-shrink: 0; +} + +.popup-list { + max-height: 79vh; + overflow: auto; +} + +.popup-item { + padding: 20rpx 0; + display: flex; + align-items: center; + /* flex: 1; */ +} + +.popup-item ~ .popup-item { + border-top: 2rpx solid #ebedf0; +} + +.rmb::before { + content: '¥'; + font-size: 24rpx; +} + +.btn { + color: #ff2d4b; + border: 2rpx solid #ff2d4b; + border-radius: 8rpx; + padding: 6rpx 20rpx; +} + +.btn2 { + font-size: 26rpx; + color: white; + background-color: #ff2d4b; + padding: 20rpx 40rpx; + text-align: center; +} + +.close-container { + color: white; + position: absolute; + right: 20rpx; + top: -80rpx; +} +.icon-close { + font-size: 40rpx; +} + +.close-container::after { + content: ''; + position: absolute; + width: 2rpx; + height: 40rpx; + background-color: white; + left: 50%; + top: 42rpx; + transform: translateX(-50%); +} + + + + + + + +.br12 { + border-radius: 12rpx; +} + +.text-underline { + text-decoration:underline; +} + +.txt-red { + color: #ff2d4b; +} + +.bdb { + border-bottom: 2rpx solid #ebedf0; +} + +.c-yellow { + color: yellow; +} + + + + +.mask { + position: fixed; + width: 100%; + height: 100%; + top: 0; + background-color: rgba(0,0,0,.5); + z-index: 1; +} + + +.popup-container2 { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 999; + width: 85%; +} + +.popup { + background-color: white; + border-radius: 12rpx; + padding: 60rpx; + margin-top: 20rpx; +} + +.block { + display: block; +} + +.img-container2 { + width: 300rpx; + height: 200rpx; + margin: 60rpx auto 0; +} + +.note { + font-size: 24rpx; + white-space: nowrap; + color: #7b7b7b; +} + +.c-tb { + color: #ff6200; +} + +.noMore { + padding: 20rpx; + color: #bbb; + text-align: center; + font-size: 22rpx; +} + +.my-qrcode { + /* background-color: red; */ +} + +.swiper-container { + position: absolute; + top: 0; + left: 0; + padding: 20rpx 10rpx; + width: 100%; + box-sizing: border-box; +} + +.swiper { + height: 60rpx; + color: white; + font-size: 26rpx; +} + +.swiper-item { + /* width: auto !important; + background-color: rgba(0,0,0,.4); + border-radius: 60rpx; */ + position: relative; +} + +.item { + position: absolute; + display: flex; + align-items: center; + border-radius: 60rpx; + background-color: rgba(0,0,0,.4); +} + +.avatar-container { + width: 60rpx; + height: 60rpx; + border-radius: 50%; + overflow: hidden; + flex-shrink: 0; +} + +.img-block { + width: 100%; + height: 100%; + display: block; +} + +.nickname { + color: #FFE12F; + padding: 0 10rpx; +} + diff --git a/packageB/pages/luckactivity/luckinfo/tool.wxs b/packageB/pages/luckactivity/luckinfo/tool.wxs new file mode 100644 index 0000000..28771b5 --- /dev/null +++ b/packageB/pages/luckactivity/luckinfo/tool.wxs @@ -0,0 +1,36 @@ +var tools = { + showDefaultImg: function(type) { + var src = ''; + switch(type) { + case 1: { //积分 + src = 'miniapp/images/luckDraw/jf.png'; + break; + }; + case 2: { //成长值 + src = 'miniapp/images/luckDraw/czz.png'; + break; + }; + case 3: { //优惠券 + src = 'miniapp/images/luckDraw/yhq.png'; + break; + }; + case 4: { //服务项目 + src = 'miniapp/images/luckDraw/fw.png'; + break; + }; + case 5: { //赠品 + src = 'miniapp/images/luckDraw/zp.png'; + break; + }; + case 6: { //礼包 + src = 'miniapp/images/luckDraw/lb.png'; + break; + }; + }; + return src; + }, +}; + +module.exports = { + showDefaultImg: tools.showDefaultImg, +} \ No newline at end of file diff --git a/pages/cart/cart/cart.wxml b/pages/cart/cart/cart.wxml index ad72782..e8b2f10 100644 --- a/pages/cart/cart/cart.wxml +++ b/pages/cart/cart/cart.wxml @@ -114,7 +114,7 @@ - + diff --git a/pages/cart/cart/cart.wxss b/pages/cart/cart/cart.wxss index 94bdba2..c792aeb 100644 --- a/pages/cart/cart/cart.wxss +++ b/pages/cart/cart/cart.wxss @@ -104,7 +104,7 @@ radio { .count { display: flex; bottom: 5rpx; - border: 2rpx solid rgb(236, 236, 236); + /* border: 2rpx solid rgb(236, 236, 236); */ margin-bottom: 3rpx; } @@ -129,12 +129,23 @@ radio { font-size: 32rpx; } -.sub { - border-right: 2rpx solid rgb(236, 236, 236); +.sub, .add, .count>input { + /* border-right: 1px solid #000; */ + background-color: #f8f8f8; + border-radius: 8rpx; +} +.sub.active { + /* background-color: #ddd; */ + color: #ccc; +} +.count>input { + margin: 0 10rpx; + line-height: normal; } .add { - border-left: 2rpx solid rgb(236, 236, 236); + /* background-color: #f8f8f8; */ + /* border-left: 1px solid #000; */ } .pay-for { @@ -362,3 +373,8 @@ page { padding: 0; vertical-align: top; } + +.sub.active { + /* background-color: #ddd; */ + color: #ccc; +} diff --git a/pages/cart/cart2/c_filter.wxs b/pages/cart/cart2/c_filter.wxs index 7216131..e8eda3e 100644 --- a/pages/cart/cart2/c_filter.wxs +++ b/pages/cart/cart2/c_filter.wxs @@ -1,5 +1,6 @@ var filters = { toFix:function(val,count){ + if(!val) return parseFloat(0).toFixed(count); return val.toFixed(count) }, format_time:function(ts,isFull) { diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 5517e31..c30b87a 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -108,14 +108,17 @@ Page({ order_prom_list_cart:null, ispt_goods:0, //是否平摊至单品,0要平摊 1不平摊 - rank_switch:0, //是不是开同等级卡 - show_card:null, //显示的等级卡 - card_name:'', //显示的卡的名称 - card_cut_price:null,//减价多少钱 - - show_submit:0, //提交按钮变正常显示 - is_get_offline:1, + + rank_switch:0, //是不是开同等级卡 + show_card:null, //显示的等级卡 + card_name:'', //显示的卡的名称 + card_cut_price:null,//减价多少钱 + + show_submit:0, //提交按钮变正常显示 + is_get_offline:1, + tabs: ['门店自提','快递邮寄'], + currentTabIndex: 1, }, onLoad: function(t) { wx.setNavigationBarTitle({ title: "填写订单",}) @@ -223,8 +226,10 @@ Page({ getApp().getConfig2(function (ee) { var json_d = JSON.parse(ee.switch_list); th.data.json_d=json_d; - th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 - th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch}); + th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 + var is_default_logistics=json_d.is_default_logistics; + + th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch,is_default_logistics:is_default_logistics}); var rank_switch=json_d.rank_switch; var max_price=-1; @@ -276,8 +281,15 @@ Page({ //-------------------获取物流--------------- get_wuliu(func) { var th = this; - to.getwuliu(function (e) { - th.setData({ wu_arr: e }) + to.getwuliu(function (e) { + //系统是是否开启了默认的物流 + if(th.data.is_default_logistics){ + //如果第一个不是开启默认,说明要让用户自己选 + if(!e[0].is_default){ + th.setData({is_default_logistics:0}); + } + } + th.setData({ wu_arr: e }) typeof func == "function" && func(); }) }, @@ -489,9 +501,9 @@ Page({ var narr = new Array(); narr.push(item); - //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号----------------- + //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号,计算默认的物流,不管是不是自提都算一下----------------- var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; - if(e_t==0 && def_exp_code){ + if(def_exp_code){ for(var k=0;k order_m) { - order_m = order_m.toFixed(2); + order_m = parseFloat(order_m).toFixed(2); th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 }) }else{ - order_m =parseFloat(order_m - amoney); + order_m =parseFloat(order_m) - parseFloat(amoney); order_m = order_m.toFixed(2); th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 }) } @@ -1672,6 +1696,10 @@ Page({ total_m= parseFloat( total_m)+ parseFloat( th.data.formData.shipping_price); order_m = parseFloat(order_m)+ parseFloat( th.data.formData.shipping_price); var atxt= "formData.total_amount"; + + total_m=total_m.toFixed(2); + order_m=order_m.toFixed(2); + th.setData({ [atxt]: total_m, }) var txt = "formData.user_money"; @@ -1681,10 +1709,10 @@ Page({ //--------------如果使用余额--------------------- if (th.data.bn_use_money == 1) { if (amoney> order_m) { - order_m = order_m.toFixed(2); + order_m = parseFloat(order_m).toFixed(2); th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 }) }else{ - order_m =parseFloat(order_m - amoney); + order_m =parseFloat(order_m) - parseFloat(amoney); order_m = order_m.toFixed(2); th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 }) } @@ -1868,7 +1896,10 @@ Page({ //积分购,先要带is_integral_normal=1 if(gg.is_integral_normal) goods.is_integral_normal=1; - + + //先要带is_pd_normal=1 + if(gg.is_pd_normal) goods.is_pd_normal=1; + //如果不立即购买或者秒杀,如果是线下库存购买的时候 if(goods.prom_type!=1 && goods.prom_type!=6 && th.data.sales_rules==2){ var isok=1; @@ -3423,7 +3454,9 @@ Page({ //是不是线下 var is_get_offline=item.is_offline; this.setData({pop_offline_index:index,is_offline_show:1,show_off_price:off_price.toFixed(2),is_get_offline:is_get_offline}); - } + }, + + diff --git a/pages/cart/cart2/cart2.wxml b/pages/cart/cart2/cart2.wxml index a525d4c..f3dd606 100644 --- a/pages/cart/cart2/cart2.wxml +++ b/pages/cart/cart2/cart2.wxml @@ -4,18 +4,52 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + - {{user_addr.more_address}}{{' '}}{{user_addr.address}} - - + + + + + {{user_addr.more_address}}{{' '}}{{user_addr.address}} + @@ -33,7 +67,7 @@ --> - + @@ -112,13 +146,14 @@ {{order.store_prom}} - - - + + + + + - - - + @@ -128,7 +163,7 @@ 门店自提 - + @@ -138,26 +173,35 @@ - + 快递邮寄 - - + + + + + {{wu_arr[item.wind].name}} + + + + + + + + + + 选择物流 {{wu_arr[item.wind].name}} - - - - - - + + + + + @@ -188,7 +232,7 @@ - + @@ -198,7 +242,7 @@ - + @@ -224,7 +268,7 @@ - + {{filters.toFix(bn_goods.shop_price,2)}} x{{bn_goods.buynum}} @@ -247,7 +291,7 @@ {{filters.show_gui_ge(buy_now_gift_goods.goods_spec,buy_now_gift_goods.goods_color)}} - + 0 x{{buy_now_gift_goods.buynum}} @@ -270,7 +314,7 @@ {{filters.show_gui_ge(item.goods_spec,item.goods_color)}} - + {{item.price}} x{{item.goods_num}} @@ -319,23 +363,14 @@ - - - - - 门店自提 - - - - 快递邮寄 - - - - - {{wu_arr[index].name}} - + + + 选择物流 + + {{wu_arr[index].name}} + - + @@ -406,7 +441,7 @@ - 应付金额:¥{{formData.order_amount}} + 应付金额:{{formData.order_amount}} diff --git a/pages/cart/cart2/cart2.wxss b/pages/cart/cart2/cart2.wxss index a3ed00c..d8c09c8 100644 --- a/pages/cart/cart2/cart2.wxss +++ b/pages/cart/cart2/cart2.wxss @@ -20,6 +20,8 @@ } + + page { /* background-color: #FAFAFA; */ background-color: #F0F0F0; @@ -31,6 +33,32 @@ page { /* padding-top: 28rpx; */ padding-bottom: 120rpx; } + +.tab-container { + font-size: 28rpx; + margin-top: 20rpx; + display: flex; +} + +.tab-wrapper { + background-color: #ccc; + display: flex; + border-radius: 40rpx; + overflow: hidden; +} + +.tab { + padding: 20rpx 30rpx; + +} + + +.tab.active { + background-color: white; + border-radius: 40rpx; +} + + .user-mes { position: relative; background-color: #fff; @@ -38,23 +66,25 @@ page { color: #444; /* margin-top: 28rpx; */ border-radius: 14rpx; + padding: 20rpx 70rpx 20rpx 20rpx; } .user-contact { - padding: 24rpx 26rpx; - font-weight: 600; + /* padding: 24rpx 26rpx; + font-weight: 600; */ } .location { position: relative; - padding: 0 70rpx 24rpx; + /* padding: 0 70rpx 24rpx; */ } .pos-icon { - position: absolute; - left: 28rpx; - top: 6rpx; - width: 30rpx; - height: 36rpx; + /* position: absolute; */ + /* left: 28rpx; + top: 6rpx; */ + width: 20rpx; + height: 24rpx; + display: inline-block; } .border-img { @@ -132,12 +162,12 @@ page { .use-item{ display: flex; align-items: center; - height: 80rpx; + /* height: 80rpx; */ /* border-bottom: 1px solid #ddd; */ - font-size: 30rpx; + font-size: 26rpx; /* width:95%; margin:auto; */ - padding: 0 26rpx; + padding: 20rpx; } .use-item>view{ display: flex; @@ -148,9 +178,9 @@ margin:auto; */ } .use-item .dp{ display: block; - width: 50rpx; - height: 50rpx; - margin-left: -6rpx; + width: 40rpx; + height: 40rpx; + /* margin-left: -6rpx; */ } .set-item { @@ -182,11 +212,11 @@ margin:auto; */ .coupon-mes { /* box-sizing: border-box; */ - height:95rpx; - padding: 0 26rpx; + /* height:95rpx; */ + padding: 20rpx; background-color: #fff; font-size: 30rpx; - color: #444; + /* color: #444; */ /* width: 100%; */ border-radius: 14rpx; margin-top: 20rpx; @@ -225,9 +255,9 @@ margin:auto; */ .word-box { font-size: 26rpx; /* width: 600rpx; */ - padding: 10rpx; + /* padding: 10rpx; height: 28rpx; - line-height: 40rpx; + line-height: 40rpx; */ } .max-word { @@ -237,7 +267,7 @@ margin:auto; */ } .information { - padding: 0 26rpx; + /* padding: 20rpx; */ background-color: #fff; /* margin-bottom: 120rpx; */ } @@ -245,10 +275,11 @@ margin:auto; */ .information .item { display: flex; justify-content: space-between; - height: 60rpx; - line-height: 60rpx; - font-size: 26rpx; - color: #777; + /* height: 60rpx; + line-height: 60rpx; */ + font-size: 24rpx; + /* color: #333; */ + padding: 20rpx; } .btn-wrap { @@ -364,12 +395,13 @@ margin:auto; */ background-color: white; } .xc-right{ - width:20rpx; - height:20rpx; + width:12rpx; + height:12rpx; border-top:2rpx solid #000; border-right:2rpx solid #000; transform:rotate(45deg); display:inline-block; + margin-left: 10rpx; } .xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; } @@ -904,7 +936,7 @@ margin-left: 20rpx; .plus_buy{ background-color: #fff; margin:15rpx 0; - padding: 20rpx 10rpx; + padding: 20rpx; position: relative; } diff --git a/pages/cart/cart2_inte/cart2_inte.js b/pages/cart/cart2_inte/cart2_inte.js index 50de9a3..6bbe117 100644 --- a/pages/cart/cart2_inte/cart2_inte.js +++ b/pages/cart/cart2_inte/cart2_inte.js @@ -93,8 +93,9 @@ Page({ getApp().getConfig2(function (ee) { var json_d = JSON.parse(ee.switch_list); th.data.json_d=json_d; - th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 - th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch}); + th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 + var is_default_logistics=json_d.is_default_logistics; + th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch,is_default_logistics:is_default_logistics}); var rank_switch=json_d.rank_switch; var max_price=-1; @@ -204,8 +205,14 @@ Page({ get_wuliu(func) { var th = this; to.getwuliu(function (e) { - th.setData({ wu_arr: e }) - typeof func == "function" && func(); + if(th.data.is_default_logistics){ + //如果第一个不是开启默认,说明要让用户自己选 + if(!e[0].is_default){ + th.setData({is_default_logistics:0}); + } + } + th.setData({ wu_arr: e }) + typeof func == "function" && func(); }) }, //------获取会员信息-----先获取用户信息,在进行下一步--- @@ -294,6 +301,8 @@ Page({ a.get("/api/weshop/goods/get/" + oo.stoid+"/"+e, { success:async function (t) { var gd = t.data.data; + if(!gd) return false; + t.data.data.original_img = oo.imghost + t.data.data.original_img; t.data.data['buynum'] = gg.goods_num; var distr_t=0,et=0 @@ -1030,9 +1039,10 @@ Page({ if (rse.data.code==0){ getApp().globalData.userInfo.def_exp_code=is_shipping_code; th.setData({ open_express: 0 }); - //----计算此时购物车的价格---- - if(th.data.is_b_now==1) th.calculatePrice2(); - else th.calculatePrice(); + //----计算此时购物车的价格,这个页面没有calculatePrice(),2021.7.19-------- + //if(th.data.is_b_now==1) th.calculatePrice2(); + //else th.calculatePrice(); + th.calculatePrice2(); } } }) diff --git a/pages/cart/cart2_inte/cart2_inte.wxml b/pages/cart/cart2_inte/cart2_inte.wxml index cda87da..243a2df 100644 --- a/pages/cart/cart2_inte/cart2_inte.wxml +++ b/pages/cart/cart2_inte/cart2_inte.wxml @@ -4,6 +4,19 @@ + + + + + + + + + + + - - - - - 门店自提 - - - - 快递邮寄 - - - - - {{wu_arr[index].name}} - + + + + + 选择物流 + + {{wu_arr[index].name}} + + - + diff --git a/pages/cart/cart2_inte/cart2_inte.wxss b/pages/cart/cart2_inte/cart2_inte.wxss index a3ed00c..869aaf8 100644 --- a/pages/cart/cart2_inte/cart2_inte.wxss +++ b/pages/cart/cart2_inte/cart2_inte.wxss @@ -252,7 +252,7 @@ margin:auto; */ } .btn-wrap { - height: 94rpx; + height: 100rpx; box-sizing: border-box; display: flex; justify-content: space-between; @@ -262,7 +262,8 @@ margin:auto; */ bottom: 0; left: 0; width: 100%; - padding: 0 30rpx; + padding: 0 30rpx; + font-size: 30rpx; } .tips-btn { @@ -958,3 +959,28 @@ margin-left: 20rpx; top:36rpx } + +.tab-container { + font-size: 28rpx; + margin-top: 20rpx; + display: flex; +} + +.tab-wrapper { + background-color: #ccc; + display: flex; + border-radius: 40rpx; + overflow: hidden; +} + +.tab { + padding: 20rpx 30rpx; + +} + + +.tab.active { + background-color: white; + border-radius: 40rpx; +} + diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index 9015c36..a857563 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -95,8 +95,12 @@ Page({ var th = this; console.log("getwuliu4545"); to.getwuliu(function (e) { - console.log("ws"); - console.log(e); + if (th.data.is_default_logistics) { + //如果第一个不是开启默认,说明要让用户自己选 + if (!e[0].is_default) { + th.setData({ is_default_logistics: 0 }); + } + } th.setData({ wu_arr: e }) typeof func == "function" && func(); }) @@ -165,6 +169,8 @@ Page({ a.get("/api/weshop/goods/get/" + oo.stoid+"/"+gg.goods_id, { success: function (t) { var gd = t.data.data; + if(!gd) return false; + t.data.data.original_img = oo.imghost + t.data.data.original_img; t.data.data['buynum'] = gg.goods_num; console.log(t.data.data); @@ -277,80 +283,81 @@ Page({ }, //----------子页返回父页触发---------- - onShow: function() { - var th=this; - if (th.data.isclose==0){ - wx.navigateTo({ - url: "/pages/index/index/index" - }) - }else{ - this.getuser_addr(function(ie){ - //更换地址回来要重新调用计算价钱的接口 - th.setData({user_addr: ie }); - if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){ - th.setData({add_back:1}); - if(this.data.bn_goods) th.calculatePrice2(); - } - }) - //--更新默认地址--,看一下是不是跳到地址页面 - if(!getApp().globalData.is_cart_old){ - this.update_code(); - }else{ - getApp().globalData.is_cart_old=0; - } - } - - - //先获取是否有关闭使用优惠券 - getApp().getConfig2(function (ee) { - var json_d = JSON.parse(ee.switch_list); - th.data.json_d=json_d; - th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 - th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch}); - - var rank_switch=json_d.rank_switch; - var max_price=-1; - var show_card=null; - var name=""; - //如果有开等级卡的时候, - //因为都是调接口,要返回在计算 - if(rank_switch==2){ - //-- 获取所有的等级卡, -- - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid, - {}).then(res => { - if(res.data.code==0){ - var plusCard = res.data.data; - //-- 循环判断,拿到最贵的那张卡 -- - for(var ih in plusCard){ - if(plusCard[ih].IsStopBuy == true){ continue; } - if(max_price<0){ - max_price=plusCard[ih].CardFee; - name='card'+plusCard[ih]['CorrPrice']; - show_card=plusCard[ih]; - }else{ - if(max_price + + + + + + + + + + + - - - - - - - - - - - - 门店自提 - - - - - - - - - - - 快递邮寄 - - - - {{wu_arr[index].name}} - - + + + 选择物流 + + {{wu_arr[index].name}} + + + + + + + + + + + + + - + - 美得得超市{{pickup.pickup_name}} + {{pickup.pickup_name}} @@ -49,8 +63,7 @@ - - + - - - 使用物流: - - {{wu_arr[index].name}} - + + 选择物流: + + {{wu_arr[index].name}} + @@ -125,4 +138,49 @@ - \ No newline at end of file + + + + + + + + + + + + 选择物流名字 + + + + × + + + + + + + + Γ + + + + + {{express_list.name}} + + + + + + + 确定 + + + 设为默认 + + + + + diff --git a/pages/cart/cart_wk/cart_wk.wxss b/pages/cart/cart_wk/cart_wk.wxss index 760dd32..282ca14 100644 --- a/pages/cart/cart_wk/cart_wk.wxss +++ b/pages/cart/cart_wk/cart_wk.wxss @@ -1,3 +1,4 @@ +page{ color: #333;} .bdr_t-14 { border-top-left-radius: 14rpx; border-top-right-radius: 14rpx; @@ -329,5 +330,184 @@ page { .anniu_view>view{width: 50%; border-right:1rpx solid #ededed;} +.tab-container { + font-size: 28rpx; + margin-top: 20rpx; + display: flex; +} + +.tab-wrapper { + background-color: #ccc; + display: flex; + border-radius: 40rpx; + overflow: hidden; +} + +.tab { + padding: 20rpx 30rpx; + +} + + +.tab.active { + background-color: white; + border-radius: 40rpx; +} + +.xc-right{ + width:20rpx; + height:20rpx; + border-top:2rpx solid #666; + border-right:2rpx solid #666; + transform:rotate(45deg); + display:inline-block; +} + + +/* 自定义弹出窗口 */ +.cx-popup{ + width:100%; + height:880rpx; + background: #fff; + z-index: 35; + border-top-left-radius: 20rpx; + border-top-right-radius: 20rpx; + position:fixed; + bottom:0; + left: 0; + /* padding-bottom: 25rpx; */ +} + +.cx-popup .top{ + width:95%; + height:100rpx; + border-bottom:3rpx solid #ddd; + margin: auto; + margin-top: 30rpx; + +} +.xc-top-content{ + width: 93%; + height:85rpx; + padding-top: 30rpx; + font-size: 34rpx; + font-weight: 600; + +} + +.xc-close{ + width: 37rpx; +height: 37rpx; +border-radius: 50%; +border: 3rpx solid #333; +text-align: center; +line-height: 34rpx; +font-size: 29rpx; +color: #333; + +} + +.xc-confirm { + width: 50%; + border-radius: 50rpx; + height: 80rpx; + margin:0 auto; + background:#d60021; + color:#fff; + font-size:28rpx; + margin-top: 28rpx; +} + +.up{ animation: up .7s; } +.down{ animation: down 1s; } +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } } +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } } + + +.xc-close-express{ + width: 40rpx; +height: 40rpx; +border-radius: 50%; +border: 3rpx solid #333; +text-align: center; +font-size:32rpx; +line-height: 38rpx; +color: #333; +margin-top: 5rpx; +} +.cx-popup .tops{ + width: 100%; +height: 145rpx; +border-bottom: 3rpx solid #eee; + +} +.top-content { + width: 82%; +padding-top: 33px; +height: 100%; +padding-left: 40rpx; +} +.close-frame{ + margin-top: 30rpx; + +} + +.xc-hook { +width: 33rpx; +height: 33rpx; +transform: rotate(-135deg); +line-height: 35rpx; +text-align: center; +margin-right: 20rpx + + +} +.xc-hooks { +width: 30rpx; +height: 30rpx; +border: 1rpx solid #999; +margin-right: 20rpx; +} +.express_list_frame{ + display: flex; +height: 80rpx; +align-items: center; +padding-left: 40rpx; +border-bottom: 1rpx solid #eee; + +} +.express_list{ + width: 100%; + height: 65%; + overflow-y: auto; + margin-bottom: 40rpx; + +} +.xc-confirms { + box-sizing: border-box; + width: 40%; + border-radius: 50rpx; + height: 80rpx; + margin:0 auto; + font-size:28rpx; + background: #fff; + color: #333; + border: 2rpx solid #333; +} +.determine-frame{ + width: 100%; + height: 130rpx; + +} +.xc-determine{ + height: 80rpx; + width: 40%; + border-radius: 50rpx; +background: #d60021; +color: #fff; +font-size: 28rpx; +margin: 0 auto; + +} diff --git a/pages/goods/goodsInfo/buy_integral.wxml b/pages/goods/goodsInfo/buy_integral.wxml index be8b5ca..5d268cb 100644 --- a/pages/goods/goodsInfo/buy_integral.wxml +++ b/pages/goods/goodsInfo/buy_integral.wxml @@ -59,7 +59,7 @@ - +