diff --git a/pages/spellGroup/mySpellGroup/index.js b/pages/spellGroup/mySpellGroup/index.js index a3ccf8e..8eeed74 100644 --- a/pages/spellGroup/mySpellGroup/index.js +++ b/pages/spellGroup/mySpellGroup/index.js @@ -13,6 +13,12 @@ Page({ teljpgUrl: imgurl.teljpg.url, wmhome: imgurl.wmhome.url, share01: imgurl.share01.url, + close02: imgurl.close02.url, + closedUrl: imgurl.closed.url, + quesGouUrl: imgurl.ques_gou.url, + headbgUrl: imgurl.headbg.url, + quesBgUrl: imgurl.ques_bg.url, + couponChannelId: '', couponId: '', data: null, @@ -118,6 +124,10 @@ Page({ formId: e.detail.formId, queueData: null }) + that.getQuestions(); + }, + getQuestions(type){ + let that = this; Http.get({ url: config.api.getQuestion, data: { @@ -128,7 +138,7 @@ Page({ wx.hideLoading(); if (res.data == undefined) { // 立即购买 - that.orderFunc(); + that.orderFunc(type); } else if (res.data) { var animation = wx.createAnimation({}); animation.translate((that.data.widthScreen - that.data.widthScreen), 0).scale(1).opacity(1).step({ @@ -154,6 +164,66 @@ Page({ }); }) }, + /** + * 点击提交问题单选 + */ + formSubmit: function (e) { + console.log(e); + let that = this; + /** + * 多选 + */ + if (e.currentTarget.dataset.flags == 'multi') { + if (that.data.anwserId.length == 0) { + var answserIs = null + } else { + var answserIs = that.data.anwserId.join(","); + } + } else if (e.currentTarget.dataset.flags == 'single') { + var answserIs = e.detail.value; + } + console.log(answserIs) + console.log(e.currentTarget.dataset.questionid) + Http.post({ + url: config.api.answerQuestion, + data: { + answer: answserIs, + questionId: e.currentTarget.dataset.questionid + } + }) + .then(res => { + that.closeQuestion(); + }) + .catch(err => { + wx.showToast({ + title: err.message, + icon: 'none', + duration: 2000, + mask: false + }); + }) + }, + /** + * 多选 + */ + checkboxChange: function (e) { + console.log(e) + this.setData({ + anwserId: e.detail.value + }) + }, + + closeQuestion: function () { + let that = this; + that.setData({ + display: "none", + zIndex: 11, + opacity: 0 + }) + setTimeout(function () { + that.orderFunc(); + }, 500) + }, // 时间格式化输出,如11:03 25:19 每1s都会调用一次 dateformat(micro_second) { // 总秒数 @@ -276,12 +346,14 @@ Page({ * 发起拼团 */ gotoSpell(e) { - this.setData({ + let that = this; + that.setData({ canSpell: false, formId: e.detail.formId }) - this.orderFunc(0) + that.getQuestions(0); }, + //参与别人的拼团 gotoPartner() { wx.navigateTo({ diff --git a/pages/spellGroup/mySpellGroup/index.wxss b/pages/spellGroup/mySpellGroup/index.wxss index 546de20..a4d4fce 100644 --- a/pages/spellGroup/mySpellGroup/index.wxss +++ b/pages/spellGroup/mySpellGroup/index.wxss @@ -55,7 +55,7 @@ button::after{ border: none; } .title{ position: relative; background-color: #fff; - z-index: 100; + z-index: 10; width: 750rpx; padding-top: 30rpx; padding-left: 30rpx; @@ -401,7 +401,7 @@ button::after{ border: none; } right:28rpx; top:-27rpx; width:108rpx; - z-index:1000; + z-index:10; } .fenxiang image { @@ -591,7 +591,7 @@ height: 90rpx; z-index: 10; } -.con { +.b1 .con { position: absolute; top: 35rpx; right: 0; @@ -601,16 +601,16 @@ height: 90rpx; width: 587rpx; } -.con .image { +.b1 .con .image { display: block; width: 100%; } -.img { +.b1 .img { margin-top: -50rpx; } -.question { +.b1 .question { display: block; width: 587rpx; background: #fff; @@ -619,7 +619,7 @@ height: 90rpx; overflow: hidden; } -.ques { +.b1 .ques { display: block; width: 511rpx; margin: 0 auto; @@ -630,7 +630,7 @@ height: 90rpx; border-bottom: 1rpx solid #eee; } -.titles { +.b1 .titles { width: 511rpx; display: block; text-align: center; @@ -644,32 +644,32 @@ height: 90rpx; border-bottom: 1rpx solid #eee; } -.quessss >view:last-child { +.b1 .quessss >view:last-child { border-bottom: 0; } -.wmclose { +.b1 .wmclose { position: relative; z-index: 10000; display: block; width: 70rpx; } -.ques_gou { +.b1 .ques_gou { position: absolute; width: 20rpx; top: 160rpx; left: 23rpx; } -.btnss { +.b1 .btnss { color: #f8755b; font-weight: bold; font-size: 30rpx !important; text-align: center !important; } -.radios { +.b1 .radios { display: block; font-size: 28rpx; height: 95rpx; @@ -678,7 +678,7 @@ height: 90rpx; text-indent: 0.5em; } -.elecard { +.b1 .elecard { display: inline-block; margin-left: 6rpx; color: #af6e34; @@ -690,7 +690,7 @@ height: 90rpx; padding: 0 6rpx; } -.applyshop { +.b1 .applyshop { font-size: 30rpx; height: 70rpx; line-height: 70rpx; @@ -698,7 +698,7 @@ height: 90rpx; text-indent: 1em; } -.btns { +.b1 .btns { /* padding: 0 33rpx; */ position: fixed; left: 0; @@ -710,31 +710,31 @@ height: 90rpx; background: #fff; } -.btns .fr,.btns .fl { +.b1 .btns .fr,.btns .fl { width: 277rpx; height: 95rpx; border-radius: 48rpx; text-align: center; } -.btns .fl { +.b1 .btns .fl { margin-left: 20rpx; color: #fff; background: rgba(255, 169, 2, 1); box-shadow: 0px 8px 8px 1px rgba(255, 169, 2, 0.32); } -.btns .fl text { +.b1 .btns .fl text { display: block; font-size: 30rpx; line-height: 34rpx; } -.btns .fl text:nth-of-type(1) { +.b1 .btns .fl text:nth-of-type(1) { margin-top: 12rpx; } -.btns .fr { +.b1 .btns .fr { font-size: 30rpx; color: #fff; margin-right: 20rpx; @@ -743,14 +743,14 @@ height: 90rpx; box-shadow: 0px 8px 8px 1px rgba(246, 93, 51, 0.32); } -.support-tansfer { +.b1 .support-tansfer { width: 60%; border-radius: 50rpx; margin-top: 30rpx; background: #02c0ff !important; } -.shaddow { +.b1 .shaddow { z-index: 100; position: fixed; width: 100%; @@ -760,7 +760,7 @@ height: 90rpx; overflow: hidden; } -.alert-box { +.b1 .alert-box { position: fixed; top: 200rpx; left: 10%; @@ -772,7 +772,7 @@ height: 90rpx; border-radius: 20rpx; } -.user-img { +.b1 .user-img { position: absolute; top: -50rpx; left: 250rpx; @@ -785,12 +785,12 @@ height: 90rpx; overflow: hidden; } -.user-img image { +.b1 .user-img image { width: 100rpx; height: 100rpx; } -.close { +.b1 .close { position: absolute; z-index: 300; right: 0; @@ -800,14 +800,14 @@ height: 90rpx; overflow: hidden; } -.close image { +.b1 .close image { display: block; width: 26rpx; height: 26rpx; margin: 20rpx 0 0 52rpx; } -.a-title { +.b1 .a-title { text-align: center; margin-top: 76rpx; font-size: 36rpx; @@ -817,7 +817,7 @@ height: 90rpx; line-height: 44rpx; } -.a-img { +.b1 .a-img { position: relative; width: 80%; border-radius: 20rpx; @@ -827,7 +827,7 @@ height: 90rpx; margin: 30rpx auto 0; } -.a-received { +.b1 .a-received { position: absolute; width: 100%; height: 294rpx; @@ -844,12 +844,12 @@ height: 90rpx; font-family: PingFang-SC-Medium; } -.a-img image { +.b1 .a-img image { width: 100%; height: 100%; } -.bottom { +.b1 .bottom { text-align: center; height: 70rpx; line-height: 70rpx; @@ -857,7 +857,7 @@ height: 90rpx; font-size: 32rpx; } -.presslimit { +.b1 .presslimit { color: red; font-size: 26rpx; letter-spacing: 1.16rpx; @@ -866,22 +866,22 @@ height: 90rpx; text-overflow: ellipsis; } -checkbox-group, radio-group { +.b1 checkbox-group, radio-group { height: 400rpx; overflow-y: scroll; } -.detailImg { +.b1 .detailImg { width: 92%; margin: 10rpx auto 0; } -.detailImg image { +.b1 .detailImg image { display: block; width: 100%; margin-bottom: 20rpx; } -.content { +.b1 .content { margin: 0; padding: 0; width: 100%; @@ -889,7 +889,7 @@ checkbox-group, radio-group { background: #f3f3f3; position: relative; } -.poster{ +.b1 .poster{ width: 100%; height: 100%; padding: 20rpx; @@ -897,7 +897,7 @@ checkbox-group, radio-group { top: 0; left: 0; } -.bottomsave { +.b1 .bottomsave { width: 100%; height: 140rpx; line-height: 140rpx; @@ -909,7 +909,7 @@ checkbox-group, radio-group { box-shadow: 0 0rpx 150rpx #ccc; background: #fff; } -.saveposter { +.b1 .saveposter { color: #fff; width: 380rpx; height: 80rpx; @@ -918,7 +918,7 @@ checkbox-group, radio-group { margin-top: 30rpx; font-size: 32rpx; } -.modal { +.b1 .modal { width: 100%; height: 100%; position: fixed; @@ -930,7 +930,7 @@ checkbox-group, radio-group { color: #fff; } -.modal-content { +.b1 .modal-content { width: 540rpx; height: 233rpx; line-height: 60rpx; @@ -945,23 +945,23 @@ checkbox-group, radio-group { display: flex; } -.modal-content view { +.b1 .modal-content view { display: inline-block; flex: 1; text-align: center; } -.modal-content view>text { +.b1 .modal-content view>text { color: #000; display: block; font-size: 30rpx; } -.modal-content view>image { +.b1 .modal-content view>image { margin-top: 40rpx; width: 90rpx; height: 90rpx; } -.wx-swiper-dots{ +.b1 .wx-swiper-dots{ margin-bottom: 30rpx; } \ No newline at end of file