diff --git a/components/questionnaire/questionnaire.js b/components/questionnaire/questionnaire.js deleted file mode 100644 index 1808454..0000000 --- a/components/questionnaire/questionnaire.js +++ /dev/null @@ -1,103 +0,0 @@ -const Http = require("../../utils/HttpBasics"); -var config = require("../../config/config.js"); -Component({ - properties: { - questionnaire: { - type: Object, - value: {} - }, - questionId: { - type: String, - value: {} - } - }, - data: { - widthScreen: null, - moveData: null, - rotateData: null, - alphaData: null, - scaleData: null, - skewData: null, - matrixData: null, - flag: false, - }, - methods:{ - close:function(){ - this.alphaClick(); - this.queueClick(); - // 子组件向父组件传值 - // 传值到 coupon=>detail页面 - var myEvent = "questions1"; - this.triggerEvent('myevent', myEvent); - }, - /** - * 点击提交问题单选 - */ - formSubmit:function(e){ - let that = this; - /** - * 多选 - */ - if (e.currentTarget.dataset.flags =='multi'){ - if (that.data.anwserId.length==0){ - var answserIs = "" - }else{ - var answserIs = that.data.anwserId.join(","); - } - } - else{ - var answserIs = e.target.dataset.answerid; - } - Http.post({ - url: config.api.answerQuestion, - data: { - answer: answserIs, - questionId: e.currentTarget.dataset.questionid - } - }) - .then(res => { - this.alphaClick(); - this.queueClick(); - }) - .catch(err => { - wx.showToast({ - title: err.errMsg, - icon: 'none', - duration: 2000, - mask: false - }); - }) - // 子组件向父组件传值 - // 传值到 coupon=>detail页面 - var myEvent1 = "questions2"; - this.triggerEvent('myevent', myEvent1); - }, - /** - * 多选 - */ - checkboxChange:function(e){ - this.setData({ - anwserId:e.detail.value - }) - }, - - queueClick: function () { - let that = this; - var animation = wx.createAnimation({}); - setTimeout(function () { - that.setData({ flag: true }) - }, 600) - animation.translate((this.data.widthScreen - 0), 0).scale(0).opacity(0.5).step({ duration: 1000 }) - that.setData({ queueData: animation.export()}) - }, - alphaClick: function (even) { - let that = this; - var animation = wx.createAnimation({}); - setTimeout(function () { - that.setData({ flag: true }) - }, 600) - animation.opacity(0).step({ duration: 1000 }) - that.setData({ alphaData: animation.export()}); - } - }, -}); \ No newline at end of file diff --git a/components/questionnaire/questionnaire.json b/components/questionnaire/questionnaire.json deleted file mode 100644 index 2176e13..0000000 --- a/components/questionnaire/questionnaire.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - - } -} \ No newline at end of file diff --git a/components/questionnaire/questionnaire.wxml b/components/questionnaire/questionnaire.wxml deleted file mode 100644 index 49dd9c6..0000000 --- a/components/questionnaire/questionnaire.wxml +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file diff --git a/components/questionnaire/questionnaire.wxss b/components/questionnaire/questionnaire.wxss deleted file mode 100644 index 9a9684a..0000000 --- a/components/questionnaire/questionnaire.wxss +++ /dev/null @@ -1,84 +0,0 @@ -.b1 { - position: fixed; - top: 0px; - bottom: 0px; - left: 0px; - right: 0px; - background: rgba(0, 0, 0, 0.8); - overflow: hidden; - z-index: 100; -} - -.con { - position: absolute; - top: 35rpx; - right: 0; - bottom: 0; - left: 0; - margin: auto; - width: 587rpx; -} - -.con .image{ - display: block; - width: 100%; -} - -.img { - margin-top: -50rpx; -} -.question { - display: block; - width: 587rpx; - background: #fff; - border-bottom-left-radius: 22rpx; - border-bottom-right-radius: 22rpx; - overflow: hidden; -} - -.ques { - display: block; - width: 511rpx; - margin: 0 auto; - height: 95rpx; - line-height: 95rpx; - font-size: 30rpx; - color: #333; - border-bottom: 1rpx solid #eee; -} - - -.title { - width: 511rpx; - display: block; - text-align: center; - height: 50rpx; - margin: 0 auto; - padding-top:10rpx; - padding-bottom:20rpx; - font-size: 32rpx; - font-weight: bold; - line-height: 41rpx; - border-bottom: 1rpx solid #eee; -} -.quessss >view:last-child{ - border-bottom:0; -} -.close{ - position: relative; - z-index: 10000; - display: block; - width: 70rpx; -} -.ques_gou{ - position: absolute; - width: 20rpx; - top: 160rpx; - left: 23rpx; -} -.btns{ - color: #f8755b; - font-weight: bold; - font-size: 30rpx!important; - text-align: center!important; -} \ No newline at end of file diff --git a/config/config.js b/config/config.js index 74bd335..cbac748 100755 --- a/config/config.js +++ b/config/config.js @@ -1,6 +1,6 @@ var config = { - // url: "https://ciformall.youlane.cn/C/api", - url:"https://c.malls.iformall.com/C/api", + url: "https://ciformall.youlane.cn/C/api", + // url:"https://c.malls.iformall.com/C/api", // url:'https://ctest.malls.iformall.com/C/api', api: { /** @@ -166,7 +166,7 @@ var config = { }, weapp: { - AppId: "wx026ee7f6290aa336" + AppId: "wxea71200db93d756b" }, ErrorCode: { NICK_NOT_AUTH: 11004, diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index d3baec5..5c7eee8 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -23,6 +23,7 @@ Page({ id: null, result: [], end_time: null, + checked:false, clock: "已经截止", questionnaire: {}, questionId: null, @@ -36,7 +37,7 @@ Page({ opacity:0, queueData:null, zIndex:11, - display:null, + display:"none", showbutton:false }, phone: function () { @@ -51,20 +52,23 @@ Page({ * 点击提交问题单选 */ formSubmit: function (e) { + console.log(e); let that = this; /** * 多选 */ - console.log(e); if (e.currentTarget.dataset.flags == 'multi') { if (that.data.anwserId.length == 0) { - var answserIs = "" + var answserIs = null } else { var answserIs = that.data.anwserId.join(","); } - } else { - var answserIs = e.target.dataset.answerid; + } + 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: { @@ -88,6 +92,7 @@ Page({ * 多选 */ checkboxChange: function (e) { + console.log(e) this.setData({ anwserId: e.detail.value }) @@ -95,13 +100,11 @@ Page({ closeQuestion: function () { let that = this; - setTimeout(function(){ - that.setData({ - display: "none", - zIndex: 11, - opacity: 0 - }) - },500) + that.setData({ + display: "none", + zIndex: 11, + opacity: 0 + }) setTimeout(function () { that.orderFunc(); }, 500) @@ -133,10 +136,11 @@ Page({ animation.translate((that.data.widthScreen - that.data.widthScreen), 0).scale(1).opacity(1).step({ duration: 500 }) - that.setData({ queueData: animation.export(), zIndex:9, + opacity:1, + display:"block", questionnaire: JSON.parse(res.data.content), questionId: res.data.id }); diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index 2a2669e..6ad09ac 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -4,11 +4,10 @@ - + - + @@ -67,7 +66,7 @@ {{data.merchantName}} {{data.addr}}{{data.buildingName}}{{data.floorName}} - + @@ -92,7 +91,7 @@ - + @@ -101,12 +100,17 @@ {{questionnaire.title}} - - - {{item.name}} - + + + + + + + @@ -114,8 +118,7 @@ {{item.name}} - 确定 + 确定 \ No newline at end of file diff --git a/pages/coupon/detail/index.wxss b/pages/coupon/detail/index.wxss index 9cd89b4..6d2a366 100644 --- a/pages/coupon/detail/index.wxss +++ b/pages/coupon/detail/index.wxss @@ -425,4 +425,12 @@ page { font-weight: bold; font-size: 30rpx!important; text-align: center!important; +} +.radios{ + display: block; + font-size:28rpx; + height: 95rpx; + line-height: 95rpx; + color: #333; + text-indent: .5em; } \ No newline at end of file diff --git a/project.config.json b/project.config.json index 0286e72..255eeac 100644 --- a/project.config.json +++ b/project.config.json @@ -12,7 +12,7 @@ }, "compileType": "miniprogram", "libVersion": "2.0.9", - "appid": "wx026ee7f6290aa336", + "appid": "wxea71200db93d756b", "projectname": "C", "isGameTourist": false, "condition": {