版本提交
Showing
40 changed files
with
704 additions
and
45 deletions
| ... | @@ -33,7 +33,16 @@ App({ | ... | @@ -33,7 +33,16 @@ App({ |
| 33 | loading: true, | 33 | loading: true, |
| 34 | }).then((result) => { | 34 | }).then((result) => { |
| 35 | this.globalData.indexInfo = result; | 35 | this.globalData.indexInfo = result; |
| 36 | resolve(result) | 36 | if (result.isNeedAuth == 1) { |
| 37 | //需要授权 | ||
| 38 | this.router.push({ | ||
| 39 | path: "authorize" | ||
| 40 | }) | ||
| 41 | reject(); | ||
| 42 | // resolve(); | ||
| 43 | } else { | ||
| 44 | resolve(result) | ||
| 45 | } | ||
| 37 | }).catch((err) => { | 46 | }).catch((err) => { |
| 38 | reject(); | 47 | reject(); |
| 39 | }); | 48 | }); | ... | ... |
| ... | @@ -5,6 +5,7 @@ | ... | @@ -5,6 +5,7 @@ |
| 5 | "pages/authorize/authorize", | 5 | "pages/authorize/authorize", |
| 6 | "pages/wish/wish", | 6 | "pages/wish/wish", |
| 7 | "pages/create-wish/create-wish", | 7 | "pages/create-wish/create-wish", |
| 8 | "pages/question/question", | ||
| 8 | "pages/new-welfare/new-welfare", | 9 | "pages/new-welfare/new-welfare", |
| 9 | "pages/user-table/user-table", | 10 | "pages/user-table/user-table", |
| 10 | "pages/rank/rank", | 11 | "pages/rank/rank", | ... | ... |
| 1 | Component({ | ||
| 2 | properties: { | ||
| 3 | // 这里定义了innerText属性,属性值可以在组件使用时指定 | ||
| 4 | innerText: { | ||
| 5 | type: String, | ||
| 6 | value: 'default value', | ||
| 7 | } | ||
| 8 | }, | ||
| 9 | data: { | ||
| 10 | // 这里是一些组件内部数据 | ||
| 11 | someData: {} | ||
| 12 | }, | ||
| 13 | methods: { | ||
| 14 | // 这里是一个自定义方法 | ||
| 15 | customMethod() { | ||
| 16 | this.triggerEvent('evtcomp', { | ||
| 17 | name: "_evt_custom" | ||
| 18 | }) | ||
| 19 | }, | ||
| 20 | // 隐藏蒙层 | ||
| 21 | hideMask() { | ||
| 22 | this.triggerEvent('evtcomp', { | ||
| 23 | name: "_evt_hide_mask" | ||
| 24 | }); | ||
| 25 | } | ||
| 26 | } | ||
| 27 | }) |
| 1 | @import '../../assets/scss/mixins'; | ||
| 2 | @import '../../assets/scss/utils'; | ||
| 3 | |||
| 4 | .comp-item { | ||
| 5 | position: relative; | ||
| 6 | width: 654px; | ||
| 7 | height: 588px; | ||
| 8 | |||
| 9 | // background-color: wheat; | ||
| 10 | .bg { | ||
| 11 | position: absolute; | ||
| 12 | width: 654px; | ||
| 13 | height: 588px; | ||
| 14 | } | ||
| 15 | |||
| 16 | .space1 { | ||
| 17 | height: 108px; | ||
| 18 | } | ||
| 19 | |||
| 20 | .cont { | ||
| 21 | position: relative; | ||
| 22 | text-align: center; | ||
| 23 | } | ||
| 24 | |||
| 25 | .tit { | ||
| 26 | color: #333333; | ||
| 27 | font-size: 40px; | ||
| 28 | font-weight: 300; | ||
| 29 | text-align: center; | ||
| 30 | margin: 0 auto; | ||
| 31 | } | ||
| 32 | |||
| 33 | .tips { | ||
| 34 | margin-top: 24px; | ||
| 35 | height: 210px; | ||
| 36 | color: #999999; | ||
| 37 | font-size: 28px; | ||
| 38 | @extend .bb; | ||
| 39 | padding: 0 100px; | ||
| 40 | } | ||
| 41 | |||
| 42 | .btn { | ||
| 43 | position: relative; | ||
| 44 | margin: 0 auto; | ||
| 45 | // @include cb(300px, 80px); | ||
| 46 | @include cb(234px, 64px); | ||
| 47 | } | ||
| 48 | } |
| 1 | <view class="comp-item"> | ||
| 2 | <image class="bg" src="../../image/oss/tips/tips-border-small.png" mode="widthFix" /> | ||
| 3 | <view class="space1"></view> | ||
| 4 | <view class="cont"> | ||
| 5 | <view class="tit">· 温馨提示 ·</view> | ||
| 6 | <view class="tips"> | ||
| 7 | <text decode="{{true}}" >{{innerText}}</text> | ||
| 8 | </view> | ||
| 9 | <view bindtap="hideMask" class="btn">我知道了</view> | ||
| 10 | </view> | ||
| 11 | </view> |
| ... | @@ -22,6 +22,12 @@ Component({ | ... | @@ -22,6 +22,12 @@ Component({ |
| 22 | this.triggerEvent('evtcomp', { | 22 | this.triggerEvent('evtcomp', { |
| 23 | name: "_evt_hide_mask" | 23 | name: "_evt_hide_mask" |
| 24 | }); | 24 | }); |
| 25 | }, | ||
| 26 | // 打电话 | ||
| 27 | onCallHandler(){ | ||
| 28 | wx.makePhoneCall({ | ||
| 29 | phoneNumber: '400-830-4000' //仅为示例,并非真实的电话号码 | ||
| 30 | }) | ||
| 25 | } | 31 | } |
| 26 | } | 32 | } |
| 27 | }) | 33 | }) | ... | ... |
| ... | @@ -22,4 +22,13 @@ | ... | @@ -22,4 +22,13 @@ |
| 22 | margin: 0 auto; | 22 | margin: 0 auto; |
| 23 | @include cb(300px, 80px); | 23 | @include cb(300px, 80px); |
| 24 | } | 24 | } |
| 25 | |||
| 26 | .call{ | ||
| 27 | width: 170px; | ||
| 28 | height: 40px; | ||
| 29 | position: absolute; | ||
| 30 | // background-color: wheat; | ||
| 31 | left: 300px; | ||
| 32 | top: 294px; | ||
| 33 | } | ||
| 25 | } | 34 | } | ... | ... |
| ... | @@ -2,4 +2,5 @@ | ... | @@ -2,4 +2,5 @@ |
| 2 | <image class="bg" src="../../image/oss/tips/tips-group-member.png" mode="widthFix" /> | 2 | <image class="bg" src="../../image/oss/tips/tips-group-member.png" mode="widthFix" /> |
| 3 | <view class="space1"></view> | 3 | <view class="space1"></view> |
| 4 | <view bindtap="hideMask" class="btn">知道了</view> | 4 | <view bindtap="hideMask" class="btn">知道了</view> |
| 5 | <view bindtap="onCallHandler" class="call"></view> | ||
| 5 | </view> | 6 | </view> | ... | ... |
| ... | @@ -20,6 +20,10 @@ Component({ | ... | @@ -20,6 +20,10 @@ Component({ |
| 20 | }, | 20 | }, |
| 21 | // 隐藏蒙层 | 21 | // 隐藏蒙层 |
| 22 | toQeustionHandler() { | 22 | toQeustionHandler() { |
| 23 | // console.log("toQeustionHandler"); | ||
| 24 | this.triggerEvent('_evt_hide_mask', { | ||
| 25 | name: "_evt_custom" | ||
| 26 | }) | ||
| 23 | app.router.push({ | 27 | app.router.push({ |
| 24 | path:"question" | 28 | path:"question" |
| 25 | }) | 29 | }) | ... | ... |
| ... | @@ -14,12 +14,22 @@ | ... | @@ -14,12 +14,22 @@ |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | .space1 { | 16 | .space1 { |
| 17 | height: 420px; | 17 | height: 480px; |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | .btn { | 20 | .btn { |
| 21 | position: relative; | 21 | position: relative; |
| 22 | margin: 0 auto; | 22 | margin: 0 auto; |
| 23 | @include cb(300px, 80px); | 23 | @include cb(234px, 64px); |
| 24 | } | ||
| 25 | |||
| 26 | .nickname{ | ||
| 27 | position: absolute; | ||
| 28 | width: 100%; | ||
| 29 | text-align: center; | ||
| 30 | font-size: 40px; | ||
| 31 | font-weight: 300; | ||
| 32 | color: #ba3138; | ||
| 33 | top: 152px; | ||
| 24 | } | 34 | } |
| 25 | } | 35 | } | ... | ... |
| 1 | <view class="comp-item"> | 1 | <view class="comp-item"> |
| 2 | <image class="bg" src="../../image/oss/tips/tips-register-ed.png" mode="widthFix" /> | 2 | <image class="bg" src="../../image/oss/tips/tips-new.png" mode="widthFix" /> |
| 3 | <view class="nickname">nickname</view> | ||
| 3 | <view class="space1"></view> | 4 | <view class="space1"></view> |
| 4 | <view bindtap="toQeustionHandler" class="btn">马上答题</view> | 5 | <view bindtap="toQeustionHandler" class="btn">马上答题</view> |
| 5 | </view> | 6 | </view> | ... | ... |
| ... | @@ -131,6 +131,9 @@ const fetch = function ({ | ... | @@ -131,6 +131,9 @@ const fetch = function ({ |
| 131 | } | 131 | } |
| 132 | // resolve(res); | 132 | // resolve(res); |
| 133 | // 直接返回content | 133 | // 直接返回content |
| 134 | // 再多封一层,把errMsg塞带content去 | ||
| 135 | // let content = res.content; | ||
| 136 | // content.errMsg = res.errMsg; | ||
| 134 | resolve(res.content); | 137 | resolve(res.content); |
| 135 | } else { | 138 | } else { |
| 136 | // 有些特殊状况不需要toast 需要弹窗 | 139 | // 有些特殊状况不需要toast 需要弹窗 | ... | ... |
src/image/oss/prize/prize_1.png
100644 → 100755
src/image/oss/prize/prize_2.png
100644 → 100755
src/image/oss/prize/prize_3.png
100644 → 100755
src/image/oss/prize/prize_s_1.png
deleted
100644 → 0
14.5 KB
src/image/oss/prize/prize_s_2.png
deleted
100644 → 0
15.2 KB
src/image/oss/prize/prize_s_3.png
deleted
100644 → 0
12.5 KB
src/image/oss/question/result-border.png
0 → 100644
40.8 KB
| ... | @@ -52,6 +52,7 @@ Page({ | ... | @@ -52,6 +52,7 @@ Page({ |
| 52 | let _this = this; | 52 | let _this = this; |
| 53 | this.refreshIndexData().then((result) => { | 53 | this.refreshIndexData().then((result) => { |
| 54 | if (result.isNeedAuth == 1) { | 54 | if (result.isNeedAuth == 1) { |
| 55 | console.log("result.isNeedAuth:",result.isNeedAuth); | ||
| 55 | // 未授权 | 56 | // 未授权 |
| 56 | wx.login({ | 57 | wx.login({ |
| 57 | success: function (res) { | 58 | success: function (res) { |
| ... | @@ -63,6 +64,7 @@ Page({ | ... | @@ -63,6 +64,7 @@ Page({ |
| 63 | authorized: false | 64 | authorized: false |
| 64 | }) | 65 | }) |
| 65 | } else { | 66 | } else { |
| 67 | console.log("result.isNeedAuth:",result.isNeedAuth); | ||
| 66 | // 已经授权 | 68 | // 已经授权 |
| 67 | // setTimeout(() => { | 69 | // setTimeout(() => { |
| 68 | _this.toIndex(); | 70 | _this.toIndex(); | ... | ... |
| ... | @@ -2,6 +2,8 @@ let app = getApp(); | ... | @@ -2,6 +2,8 @@ let app = getApp(); |
| 2 | Page({ | 2 | Page({ |
| 3 | data: { | 3 | data: { |
| 4 | tipsRegisterVisible: false, | 4 | tipsRegisterVisible: false, |
| 5 | tipsGroupMemberVisible: false, | ||
| 6 | tipsNewMemberVisible: false, | ||
| 5 | curStatus: 1, // 当前场景 | 7 | curStatus: 1, // 当前场景 |
| 6 | }, | 8 | }, |
| 7 | onShareAppMessage() {}, | 9 | onShareAppMessage() {}, |
| ... | @@ -38,15 +40,12 @@ Page({ | ... | @@ -38,15 +40,12 @@ Page({ |
| 38 | isCrmLogin, | 40 | isCrmLogin, |
| 39 | isNewMember, | 41 | isNewMember, |
| 40 | isBlackList, | 42 | isBlackList, |
| 41 | newMemberJudge, | 43 | hadAnswerQuestion, |
| 42 | oldMemberJudge, | 44 | isSelfAssist, |
| 43 | wishBillCode | 45 | wishBillCode |
| 44 | } = indexInfo; | 46 | } = indexInfo; |
| 45 | // 未登陆 出注册弹窗提示 | 47 | // 未登陆 出注册弹窗提示 |
| 46 | if (isCrmLogin == 0) { | 48 | if (isCrmLogin == 0) { |
| 47 | // app.router.push({ | ||
| 48 | // path: 'register' | ||
| 49 | // }); | ||
| 50 | this.setData({ | 49 | this.setData({ |
| 51 | tipsRegisterVisible: true | 50 | tipsRegisterVisible: true |
| 52 | }) | 51 | }) |
| ... | @@ -55,14 +54,28 @@ Page({ | ... | @@ -55,14 +54,28 @@ Page({ |
| 55 | } | 54 | } |
| 56 | // 黑名单 | 55 | // 黑名单 |
| 57 | if (isBlackList == 1) { | 56 | if (isBlackList == 1) { |
| 57 | this.setData({ | ||
| 58 | tipsGroupMemberVisible: true | ||
| 59 | }) | ||
| 58 | reject(); | 60 | reject(); |
| 59 | return; | 61 | return; |
| 60 | } | 62 | } |
| 61 | // 新老会员 | 63 | // 新老会员 |
| 62 | // isNewMember | 64 | // isNewMember |
| 63 | // if(isNewMember == 1){ | 65 | if (isNewMember == 1) { |
| 64 | // }else{ | 66 | // 新会员 |
| 65 | // } | 67 | if (hadAnswerQuestion) { |
| 68 | // 已经答题,提示创建心愿单 | ||
| 69 | } else { | ||
| 70 | // 未答题,提示答题 | ||
| 71 | this.setData({ | ||
| 72 | tipsNewMemberVisible: true | ||
| 73 | }) | ||
| 74 | } | ||
| 75 | } else { | ||
| 76 | // 老会员 | ||
| 77 | |||
| 78 | } | ||
| 66 | resolve(); | 79 | resolve(); |
| 67 | }); | 80 | }); |
| 68 | 81 | ||
| ... | @@ -86,9 +99,11 @@ Page({ | ... | @@ -86,9 +99,11 @@ Page({ |
| 86 | } = evt.detail; | 99 | } = evt.detail; |
| 87 | switch (name) { | 100 | switch (name) { |
| 88 | 101 | ||
| 89 | case "_evt_hide_rule_tips": | 102 | case "_evt_hide_mask": |
| 90 | this.setData({ | 103 | this.setData({ |
| 91 | ruleTipsVisible: false | 104 | ruleTipsVisible: false, |
| 105 | tipsGroupMemberVisible: false, | ||
| 106 | tipsNewMemberVisible:false, | ||
| 92 | }) | 107 | }) |
| 93 | break; | 108 | break; |
| 94 | 109 | ... | ... |
| ... | @@ -2,6 +2,8 @@ | ... | @@ -2,6 +2,8 @@ |
| 2 | "navigationBarTitleText": "丸美心愿单", | 2 | "navigationBarTitleText": "丸美心愿单", |
| 3 | "usingComponents": { | 3 | "usingComponents": { |
| 4 | "tips-register-comp": "../../component/tips-register-comp/tips-register-comp", | 4 | "tips-register-comp": "../../component/tips-register-comp/tips-register-comp", |
| 5 | "tips-group-member-comp": "../../component/tips-group-member-comp/tips-group-member-comp", | ||
| 6 | "tips-new-comp": "../../component/tips-new-comp/tips-new-comp", | ||
| 5 | "van-popup": "../../ui/vant-weapp/popup/index" | 7 | "van-popup": "../../ui/vant-weapp/popup/index" |
| 6 | } | 8 | } |
| 7 | } | 9 | } | ... | ... |
| ... | @@ -80,10 +80,12 @@ | ... | @@ -80,10 +80,12 @@ |
| 80 | height: 140px; | 80 | height: 140px; |
| 81 | border-radius: 70px; | 81 | border-radius: 70px; |
| 82 | background-image: radial-gradient(circle at 0 0, #ffffff, #f2e6e6); | 82 | background-image: radial-gradient(circle at 0 0, #ffffff, #f2e6e6); |
| 83 | @extend .fcc; | ||
| 83 | 84 | ||
| 84 | .prod { | 85 | .prod { |
| 85 | max-width: 100px; | 86 | max-width: 200px; |
| 86 | max-height: 120px; | 87 | max-height: 200px; |
| 88 | margin-bottom: 10px; | ||
| 87 | } | 89 | } |
| 88 | 90 | ||
| 89 | .close { | 91 | .close { | ... | ... |
| ... | @@ -30,7 +30,7 @@ | ... | @@ -30,7 +30,7 @@ |
| 30 | </view> | 30 | </view> |
| 31 | <view class="wish-item"> | 31 | <view class="wish-item"> |
| 32 | <view class="display"> | 32 | <view class="display"> |
| 33 | <image class="prod" mode="aspectFit" src="../../image/oss/prize/prize_3.png" /> | 33 | <image class="prod" mode="aspectFit" src="../../image/oss/prize/prize_2.png" /> |
| 34 | <image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" /> | 34 | <image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" /> |
| 35 | </view> | 35 | </view> |
| 36 | <view class="name">丸美弹力蛋白凝时紧致乳</view> | 36 | <view class="name">丸美弹力蛋白凝时紧致乳</view> |
| ... | @@ -41,7 +41,7 @@ | ... | @@ -41,7 +41,7 @@ |
| 41 | </view> | 41 | </view> |
| 42 | <view class="wish-item"> | 42 | <view class="wish-item"> |
| 43 | <view class="display"> | 43 | <view class="display"> |
| 44 | <image class="prod" mode="aspectFit" src="../../image/oss/prize/prize_3.png" /> | 44 | <image class="prod" mode="aspectFit" src="../../image/oss/prize/prize_1.png" /> |
| 45 | <image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" /> | 45 | <image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" /> |
| 46 | </view> | 46 | </view> |
| 47 | <view class="name">丸美弹力蛋白凝时紧致乳</view> | 47 | <view class="name">丸美弹力蛋白凝时紧致乳</view> |
| ... | @@ -60,3 +60,9 @@ | ... | @@ -60,3 +60,9 @@ |
| 60 | <van-popup show="{{ tipsRegisterVisible }}"> | 60 | <van-popup show="{{ tipsRegisterVisible }}"> |
| 61 | <tips-register-comp bind:evtcomp="evtcomp"></tips-register-comp> | 61 | <tips-register-comp bind:evtcomp="evtcomp"></tips-register-comp> |
| 62 | </van-popup> | 62 | </van-popup> |
| 63 | <van-popup show="{{ tipsGroupMemberVisible }}"> | ||
| 64 | <tips-group-member-comp bind:evtcomp="evtcomp"></tips-group-member-comp> | ||
| 65 | </van-popup> | ||
| 66 | <van-popup show="{{ tipsNewMemberVisible }}"> | ||
| 67 | <tips-new-comp bind:evtcomp="evtcomp"></tips-new-comp> | ||
| 68 | </van-popup> | ... | ... |
src/pages/question/question.js
0 → 100755
| 1 | import { | ||
| 2 | getBindtapData | ||
| 3 | } from '../../utils/util'; | ||
| 4 | import Date from '../../utils/date'; | ||
| 5 | let app = getApp(); | ||
| 6 | Page({ | ||
| 7 | data: { | ||
| 8 | questionList: [], // 题目列表 | ||
| 9 | // questionResult: { | ||
| 10 | // "status": 1, | ||
| 11 | // "elasticValue": 50, | ||
| 12 | // "coupons": [{ | ||
| 13 | // "couponId": "20839", | ||
| 14 | // "couponCode": "RLLL1IHG", | ||
| 15 | // "rule": "RLLL1IHG", | ||
| 16 | // "startDate": 1564479217000, | ||
| 17 | // "endDate": 1567094399000, | ||
| 18 | // "type": 4, | ||
| 19 | // "name": "眼部护理体验券-7月24日", | ||
| 20 | // "state": 0 | ||
| 21 | // }] | ||
| 22 | // }, | ||
| 23 | questionResult:{}, | ||
| 24 | // 答题结果 | ||
| 25 | questionNumList: ["A", "B", "C", "D"], | ||
| 26 | myAnswer: [], //我的答案 | ||
| 27 | }, | ||
| 28 | onShareAppMessage() {}, | ||
| 29 | onLoad(options) { | ||
| 30 | this.initData(); | ||
| 31 | }, | ||
| 32 | initData() { | ||
| 33 | this.queryQuestionList(); | ||
| 34 | }, | ||
| 35 | /** | ||
| 36 | * 跳转至创建心愿单 | ||
| 37 | */ | ||
| 38 | onCreateWishHandler() { | ||
| 39 | app.router.push({ | ||
| 40 | openType: "redirectTo", | ||
| 41 | path: "createWish" | ||
| 42 | }) | ||
| 43 | }, | ||
| 44 | /** | ||
| 45 | * 点击答案 | ||
| 46 | * 设置选择的按钮 | ||
| 47 | */ | ||
| 48 | onSelectAnswerHandler(evt) { | ||
| 49 | let curIndex = getBindtapData(evt, "index"); | ||
| 50 | let curPIndex = getBindtapData(evt, "pindex"); | ||
| 51 | let questionList = this.data.questionList; | ||
| 52 | // 重置本题的选中状态 | ||
| 53 | questionList[curPIndex].answers.forEach(element => { | ||
| 54 | element.selected = false; | ||
| 55 | }); | ||
| 56 | questionList[curPIndex].answers[curIndex].selected = true; | ||
| 57 | questionList[curPIndex].selected = true; // 题目已被选择 | ||
| 58 | let myAnswer = this.data.myAnswer; | ||
| 59 | let curAnswer = { | ||
| 60 | questionCode: questionList[curPIndex].questionCode, | ||
| 61 | answerNo: questionList[curPIndex].answers[curIndex].answerNo | ||
| 62 | } | ||
| 63 | myAnswer[curPIndex] = curAnswer; | ||
| 64 | this.setData({ | ||
| 65 | questionList, | ||
| 66 | myAnswer | ||
| 67 | }) | ||
| 68 | }, | ||
| 69 | /** | ||
| 70 | * 提交答案 | ||
| 71 | */ | ||
| 72 | onSubmitQuestionResultHandler() { | ||
| 73 | let _this = this; | ||
| 74 | // 检查是否有提没提交 完整判断应该判断题目数要大于0,这里就算了 | ||
| 75 | let questionList = this.data.questionList; | ||
| 76 | let isComplete = questionList.every((item) => { | ||
| 77 | return item.selected == true; | ||
| 78 | }) | ||
| 79 | let myAnswer = this.data.myAnswer; | ||
| 80 | |||
| 81 | if (isComplete) { | ||
| 82 | wx.showModal({ | ||
| 83 | content: "确认提交?", | ||
| 84 | confirmText: "确认", | ||
| 85 | success(res) { | ||
| 86 | app.post({ | ||
| 87 | url: app.api.answerSubmit, | ||
| 88 | data: myAnswer | ||
| 89 | }).then((result) => { | ||
| 90 | let questionResult = result; | ||
| 91 | questionResult.coupons.forEach(element => { | ||
| 92 | element.endDateStr = new Date(element.endDate).toString("yy-MM-dd"); | ||
| 93 | }); | ||
| 94 | _this.setData({ | ||
| 95 | questionResult | ||
| 96 | }) | ||
| 97 | console.log("answerSubmit:", _this.data.questionResult); | ||
| 98 | }) | ||
| 99 | } | ||
| 100 | }) | ||
| 101 | } else { | ||
| 102 | wx.showModal({ | ||
| 103 | content: "答题未完成", | ||
| 104 | confirmText: "继续答题", | ||
| 105 | showCancel: false, | ||
| 106 | success(res) { | ||
| 107 | |||
| 108 | } | ||
| 109 | }) | ||
| 110 | } | ||
| 111 | }, | ||
| 112 | /** | ||
| 113 | * 请求问题列表 | ||
| 114 | */ | ||
| 115 | queryQuestionList() { | ||
| 116 | return new Promise((resolve, reject) => { | ||
| 117 | app.post({ | ||
| 118 | url: app.api.questionList, | ||
| 119 | data: {} | ||
| 120 | }).then((result) => { | ||
| 121 | let { | ||
| 122 | questionList | ||
| 123 | } = result; | ||
| 124 | console.log("questionList", questionList); | ||
| 125 | this.setData({ | ||
| 126 | questionList: questionList | ||
| 127 | }) | ||
| 128 | resolve(); | ||
| 129 | }) | ||
| 130 | }); | ||
| 131 | }, | ||
| 132 | // 子组件事件 | ||
| 133 | evtcomp(evt) { | ||
| 134 | let { | ||
| 135 | name, | ||
| 136 | data | ||
| 137 | } = evt.detail; | ||
| 138 | switch (name) { | ||
| 139 | |||
| 140 | case "_evt_hide": | ||
| 141 | break; | ||
| 142 | |||
| 143 | default: | ||
| 144 | break; | ||
| 145 | } | ||
| 146 | }, | ||
| 147 | }) |
src/pages/question/question.json
0 → 100755
src/pages/question/question.scss
0 → 100755
| 1 | @import '../../assets/scss/mixins'; | ||
| 2 | @import '../../assets/scss/utils'; | ||
| 3 | |||
| 4 | .page { | ||
| 5 | padding-bottom: 0; | ||
| 6 | |||
| 7 | .bgc {} | ||
| 8 | |||
| 9 | .bg {} | ||
| 10 | |||
| 11 | .decoration { | ||
| 12 | position: relative; | ||
| 13 | |||
| 14 | .d1 { | ||
| 15 | position: absolute; | ||
| 16 | width: 533px; | ||
| 17 | height: 227px; | ||
| 18 | top: 0; | ||
| 19 | right: 0; | ||
| 20 | } | ||
| 21 | } | ||
| 22 | |||
| 23 | .main { | ||
| 24 | .top-space { | ||
| 25 | height: 48px; | ||
| 26 | } | ||
| 27 | |||
| 28 | .content { | ||
| 29 | position: relative; | ||
| 30 | |||
| 31 | // 标题 | ||
| 32 | .tit { | ||
| 33 | font-size: 36px; | ||
| 34 | color: #a01635; | ||
| 35 | text-align: center; | ||
| 36 | } | ||
| 37 | |||
| 38 | // 问题 | ||
| 39 | .question { | ||
| 40 | @extend .bb; | ||
| 41 | padding: 40px 52px 0; | ||
| 42 | |||
| 43 | &-item { | ||
| 44 | margin-bottom: 60px; | ||
| 45 | |||
| 46 | // 问题 | ||
| 47 | .ques { | ||
| 48 | display: flex; | ||
| 49 | align-items: center; | ||
| 50 | color: #333333; | ||
| 51 | |||
| 52 | .light { | ||
| 53 | width: 18px; | ||
| 54 | height: 36px; | ||
| 55 | margin-right: 10px; | ||
| 56 | } | ||
| 57 | } | ||
| 58 | |||
| 59 | // 答案 | ||
| 60 | .answer { | ||
| 61 | display: flex; | ||
| 62 | justify-content: space-between; | ||
| 63 | flex-wrap: wrap; | ||
| 64 | margin-top: 32px; | ||
| 65 | |||
| 66 | &-item { | ||
| 67 | width: 312px; | ||
| 68 | height: 72px; | ||
| 69 | line-height: 72px; | ||
| 70 | border-radius: 36px; | ||
| 71 | border: solid 1px #999999; | ||
| 72 | @extend .bb; | ||
| 73 | padding: 0 10px; | ||
| 74 | font-size: 22px; | ||
| 75 | color: #333333; | ||
| 76 | margin-bottom: 28px; | ||
| 77 | } | ||
| 78 | |||
| 79 | .selected { | ||
| 80 | border: solid 2px #ac0521; | ||
| 81 | color: #ac0521; | ||
| 82 | } | ||
| 83 | |||
| 84 | .right { | ||
| 85 | color: #ffffff; | ||
| 86 | background-color: #32ba32; | ||
| 87 | border: none; | ||
| 88 | } | ||
| 89 | |||
| 90 | } | ||
| 91 | |||
| 92 | |||
| 93 | } | ||
| 94 | } | ||
| 95 | |||
| 96 | // 提交按钮 | ||
| 97 | .submit-btn { | ||
| 98 | margin: 0 auto; | ||
| 99 | @include cb(300px, 80px); | ||
| 100 | margin-bottom: 52px; | ||
| 101 | } | ||
| 102 | |||
| 103 | // 结果 | ||
| 104 | .result { | ||
| 105 | position: relative; | ||
| 106 | margin: 60px auto 0; | ||
| 107 | width: 750px; | ||
| 108 | height: 1043px; | ||
| 109 | |||
| 110 | .d1 { | ||
| 111 | position: absolute; | ||
| 112 | top: -20px; | ||
| 113 | right: 0; | ||
| 114 | width: 318px; | ||
| 115 | height: 218px; | ||
| 116 | } | ||
| 117 | |||
| 118 | .d2 { | ||
| 119 | position: absolute; | ||
| 120 | left: 0; | ||
| 121 | bottom: -4px; | ||
| 122 | width: 122px; | ||
| 123 | height: 252px; | ||
| 124 | } | ||
| 125 | |||
| 126 | .bg { | ||
| 127 | position: absolute; | ||
| 128 | width: 738px; | ||
| 129 | height: 1043px; | ||
| 130 | } | ||
| 131 | |||
| 132 | .cont { | ||
| 133 | position: relative; | ||
| 134 | text-align: center; | ||
| 135 | |||
| 136 | .space1 { | ||
| 137 | height: 80px; | ||
| 138 | } | ||
| 139 | |||
| 140 | .tit { | ||
| 141 | color: #333333; | ||
| 142 | font-size: 30px; | ||
| 143 | } | ||
| 144 | |||
| 145 | // 球形 | ||
| 146 | .ball { | ||
| 147 | margin: 28px auto 0; | ||
| 148 | width: 194px; | ||
| 149 | height: 194px; | ||
| 150 | border-radius: 97px; | ||
| 151 | background-image: linear-gradient(to top, #c22f3b, #e92647 99%), linear-gradient(to bottom, #bb343a, #bb343a); | ||
| 152 | display: flex; | ||
| 153 | align-content: center; | ||
| 154 | flex-wrap: wrap; | ||
| 155 | |||
| 156 | font-size: 24px; | ||
| 157 | color: #ffffff; | ||
| 158 | |||
| 159 | .t1 { | ||
| 160 | width: 100%; | ||
| 161 | } | ||
| 162 | |||
| 163 | .score { | ||
| 164 | width: 100%; | ||
| 165 | font-size: 70px; | ||
| 166 | height: 80px; | ||
| 167 | line-height: 80px; | ||
| 168 | } | ||
| 169 | } | ||
| 170 | |||
| 171 | .tips { | ||
| 172 | margin-top: 40px; | ||
| 173 | text-align: center; | ||
| 174 | font-size: 24px; | ||
| 175 | color: #333333; | ||
| 176 | } | ||
| 177 | |||
| 178 | // 优惠券 | ||
| 179 | .coupon { | ||
| 180 | position: relative; | ||
| 181 | margin-top: 18px; | ||
| 182 | |||
| 183 | &-item { | ||
| 184 | position: relative; | ||
| 185 | width: 578px; | ||
| 186 | height: 198px; | ||
| 187 | margin: 0 auto 12px; | ||
| 188 | |||
| 189 | .ebg { | ||
| 190 | left: 0; | ||
| 191 | top: 0; | ||
| 192 | position: absolute; | ||
| 193 | width: 578px; | ||
| 194 | height: 198px; | ||
| 195 | } | ||
| 196 | |||
| 197 | .cont { | ||
| 198 | position: relative; | ||
| 199 | |||
| 200 | .name { | ||
| 201 | position: absolute; | ||
| 202 | left: 40px; | ||
| 203 | top: 40px; | ||
| 204 | color: #ffffff; | ||
| 205 | font-size: 34px; | ||
| 206 | } | ||
| 207 | |||
| 208 | .detail { | ||
| 209 | position: absolute; | ||
| 210 | border-radius: 24px; | ||
| 211 | font-size: 24px; | ||
| 212 | border: solid 1px rgba($color: #ffffff, $alpha: 0.8); | ||
| 213 | color: rgba($color: #ffffff, $alpha: 0.8); | ||
| 214 | @include btc(140px, 48px); | ||
| 215 | top: 40px; | ||
| 216 | right: 26px; | ||
| 217 | } | ||
| 218 | |||
| 219 | .card-info { | ||
| 220 | position: absolute; | ||
| 221 | top: 146px; | ||
| 222 | color: #fbe4c9; | ||
| 223 | font-size: 24px; | ||
| 224 | } | ||
| 225 | |||
| 226 | .card-no { | ||
| 227 | left: 28px; | ||
| 228 | } | ||
| 229 | |||
| 230 | .card-date { | ||
| 231 | right: 28px; | ||
| 232 | } | ||
| 233 | } | ||
| 234 | } | ||
| 235 | |||
| 236 | &-item2 { | ||
| 237 | .name { | ||
| 238 | color: #653d0d; | ||
| 239 | } | ||
| 240 | |||
| 241 | .card-info { | ||
| 242 | color: #fce6c2; | ||
| 243 | } | ||
| 244 | } | ||
| 245 | } | ||
| 246 | } | ||
| 247 | |||
| 248 | .create-wish-btn { | ||
| 249 | @include cb(300px, 80px); | ||
| 250 | position: absolute; | ||
| 251 | bottom: 80px; | ||
| 252 | left: 0; | ||
| 253 | right: 0; | ||
| 254 | margin: 0 auto; | ||
| 255 | } | ||
| 256 | |||
| 257 | } | ||
| 258 | } | ||
| 259 | } | ||
| 260 | } |
src/pages/question/question.wxml
0 → 100755
| 1 | <view class="page"> | ||
| 2 | <view class="app__bgc bgc"></view> | ||
| 3 | <view class="app__bg bg"></view> | ||
| 4 | <view class="decoration"> | ||
| 5 | <image class="d1" src="../../image/oss/question/question-c1.png" mode="widthFix" /> | ||
| 6 | </view> | ||
| 7 | <view class="app__content main"> | ||
| 8 | <view class="top-space"></view> | ||
| 9 | <view class="content"> | ||
| 10 | <!-- 标题 --> | ||
| 11 | <view class="tit">· 欢迎来到丸美小课堂 ·</view> | ||
| 12 | <!-- 问题 --> | ||
| 13 | <view class="question"> | ||
| 14 | <view data-data="{{item}}" data-index="{{index}}" wx:for="{{questionList}}" wx:key="{{index}}" class="question-item"> | ||
| 15 | <view class="ques"> | ||
| 16 | <image class="light" mode="widthFix" src="../../image/oss/question/question-light.png" /> | ||
| 17 | {{item.question}} | ||
| 18 | </view> | ||
| 19 | <view class="answer"> | ||
| 20 | <view bindtap="onSelectAnswerHandler" data-pdata="{{item}}" data-pindex="{{index}}" data-data="{{item2}}" data-index="{{index2}}" wx:for="{{item.answers}}" wx:key="index2" wx:for-index="index2" wx:for-item="item2" class="answer-item {{item2.selected ? 'selected':''}}"> | ||
| 21 | {{questionNumList[index2]}}.{{item2.answer}} | ||
| 22 | </view> | ||
| 23 | </view> | ||
| 24 | </view> | ||
| 25 | </view> | ||
| 26 | <!-- 提交 --> | ||
| 27 | <view bindtap="onSubmitQuestionResultHandler" wx:if="{{questionResult.status != 1}}" class="submit-btn"> | ||
| 28 | 确认提交 | ||
| 29 | </view> | ||
| 30 | <!-- 结果 --> | ||
| 31 | <view wx:else class="result"> | ||
| 32 | <image class="d1" mode="widthFix" src="../../image/oss/question/question-d1.png" /> | ||
| 33 | <image class="bg" mode="widthFix" src="../../image/oss/question/result-border.png" /> | ||
| 34 | <image class="d2" mode="widthFix" src="../../image/oss/question/question-d2.png" /> | ||
| 35 | <view class="cont"> | ||
| 36 | <view class="space1"></view> | ||
| 37 | <view class="tit">测验结果:答对1题,答错2题</view> | ||
| 38 | <view class="ball"> | ||
| 39 | <view class="t1">获得</view> | ||
| 40 | <view class="score">{{questionResult.elasticValue}}</view> | ||
| 41 | <view class="t1">弹力值</view> | ||
| 42 | </view> | ||
| 43 | <view class="tips">还凭您的盛世美颜获得更多惊喜</view> | ||
| 44 | <view class="coupon"> | ||
| 45 | <view wx:for="{{questionResult.coupons}}" wx:key="{{index}}" class="coupon-item {{item.type==4?'coupon-item2':''}}"> | ||
| 46 | <image class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-1.png" /> | ||
| 47 | <view class="cont"> | ||
| 48 | <view class="name">{{item.name}}</view> | ||
| 49 | <!-- <view class="detail">查看详情</view> --> | ||
| 50 | <view class="card-info card-no">劵码:{{item.couponCode}}</view> | ||
| 51 | <view class="card-info card-date">有效期:即日起至{{item.endDateStr}}</view> | ||
| 52 | </view> | ||
| 53 | </view> | ||
| 54 | <!-- <view class="coupon-item coupon-item2"> | ||
| 55 | <image class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-2.png" /> | ||
| 56 | <view class="cont"> | ||
| 57 | <view class="name">眼部保养劵</view> | ||
| 58 | <view class="detail">查看详情</view> | ||
| 59 | <view class="card-info card-no">劵码:ABCD 1234</view> | ||
| 60 | <view class="card-info card-date">有效期:即日起至19.10.31</view> | ||
| 61 | </view> | ||
| 62 | </view> --> | ||
| 63 | </view> | ||
| 64 | </view> | ||
| 65 | <view bindtap="onCreateWishHandler" class="create-wish-btn">去创建心愿单</view> | ||
| 66 | </view> | ||
| 67 | </view> | ||
| 68 | </view> | ||
| 69 | </view> |
| ... | @@ -4,14 +4,17 @@ let Utils = require('../../utils/util.js'); | ... | @@ -4,14 +4,17 @@ let Utils = require('../../utils/util.js'); |
| 4 | let app = getApp(); | 4 | let app = getApp(); |
| 5 | Page({ | 5 | Page({ |
| 6 | data: { | 6 | data: { |
| 7 | tipsInnerText:"", | ||
| 8 | redirect: "createWish", // 注册完的重定向页面 | ||
| 7 | tipsRegisteredVisible: false, | 9 | tipsRegisteredVisible: false, |
| 10 | tipsCommonVisible: false, | ||
| 8 | // form start | 11 | // form start |
| 9 | name: "", | 12 | name: "", |
| 10 | mobile: "", | 13 | mobile: "", |
| 11 | verifyCode: "", | 14 | verifyCode: "", |
| 12 | birthday: "", | 15 | birthday: "", |
| 13 | password: "", | 16 | password: "qq123456", |
| 14 | sex: 0, | 17 | sex: 1, |
| 15 | isTerms: false, | 18 | isTerms: false, |
| 16 | // form end | 19 | // form end |
| 17 | auth_time: 0, | 20 | auth_time: 0, |
| ... | @@ -23,7 +26,6 @@ Page({ | ... | @@ -23,7 +26,6 @@ Page({ |
| 23 | this.initData(); | 26 | this.initData(); |
| 24 | }, | 27 | }, |
| 25 | initData() { | 28 | initData() { |
| 26 | |||
| 27 | }, | 29 | }, |
| 28 | showLog(msg) { | 30 | showLog(msg) { |
| 29 | wx.showToast({ | 31 | wx.showToast({ |
| ... | @@ -32,6 +34,7 @@ Page({ | ... | @@ -32,6 +34,7 @@ Page({ |
| 32 | }) | 34 | }) |
| 33 | }, | 35 | }, |
| 34 | doRegister() { | 36 | doRegister() { |
| 37 | let _this = this; | ||
| 35 | this.checkForm().then((result) => { | 38 | this.checkForm().then((result) => { |
| 36 | // 注册 | 39 | // 注册 |
| 37 | let data = { | 40 | let data = { |
| ... | @@ -39,23 +42,32 @@ Page({ | ... | @@ -39,23 +42,32 @@ Page({ |
| 39 | name: this.data.name, | 42 | name: this.data.name, |
| 40 | birthday: this.data.birthday, | 43 | birthday: this.data.birthday, |
| 41 | verifyCode: this.data.verifyCode, | 44 | verifyCode: this.data.verifyCode, |
| 45 | password: this.data.password, | ||
| 46 | sex: this.data.sex, | ||
| 42 | } | 47 | } |
| 43 | app.post({ | 48 | app.post({ |
| 44 | url: app.api.register, | 49 | url: app.api.crmRegister, |
| 45 | data: data | 50 | data: data |
| 46 | }).then((result) => { | 51 | }).then((result) => { |
| 47 | wx.showModal({ | 52 | if (result.status == 1) { |
| 48 | title: "登陆成功", | 53 | wx.showModal({ |
| 49 | content: "继续生成我的心愿单", | 54 | title: "登陆成功", |
| 50 | confirmText: "马上前往", | 55 | content: "继续生成我的心愿单", |
| 51 | showCancel: false, | 56 | confirmText: "马上前往", |
| 52 | success(res) { | 57 | showCancel: false, |
| 53 | app.router.push({ | 58 | success(res) { |
| 54 | openType: "reLaunch", | 59 | app.router.push({ |
| 55 | path: "createWish" | 60 | openType: "redirectTo", |
| 56 | }) | 61 | path: _this.data.redirect |
| 57 | } | 62 | }) |
| 58 | }) | 63 | } |
| 64 | }) | ||
| 65 | } else { | ||
| 66 | this.setData({ | ||
| 67 | tipsInnerText: result.errMsg, | ||
| 68 | tipsCommonVisible: true, | ||
| 69 | }) | ||
| 70 | } | ||
| 59 | }); | 71 | }); |
| 60 | }) | 72 | }) |
| 61 | }, | 73 | }, |
| ... | @@ -105,6 +117,7 @@ Page({ | ... | @@ -105,6 +117,7 @@ Page({ |
| 105 | app.post({ | 117 | app.post({ |
| 106 | url: app.api.mobileVerifyCode, | 118 | url: app.api.mobileVerifyCode, |
| 107 | data: { | 119 | data: { |
| 120 | picVerifyCode:"", | ||
| 108 | mobile: mobile, | 121 | mobile: mobile, |
| 109 | forRegister: 1 | 122 | forRegister: 1 |
| 110 | } | 123 | } |
| ... | @@ -170,7 +183,8 @@ Page({ | ... | @@ -170,7 +183,8 @@ Page({ |
| 170 | 183 | ||
| 171 | case "_evt_hide_mask": | 184 | case "_evt_hide_mask": |
| 172 | this.setData({ | 185 | this.setData({ |
| 173 | tipsRegisteredVisible: false | 186 | tipsRegisteredVisible: false, |
| 187 | tipsCommonVisible: false | ||
| 174 | }) | 188 | }) |
| 175 | break; | 189 | break; |
| 176 | 190 | ... | ... |
| ... | @@ -2,6 +2,7 @@ | ... | @@ -2,6 +2,7 @@ |
| 2 | "navigationBarTitleText": "登陆", | 2 | "navigationBarTitleText": "登陆", |
| 3 | "usingComponents": { | 3 | "usingComponents": { |
| 4 | "tips-register-ed-comp": "../../component/tips-register-ed-comp/tips-register-ed-comp", | 4 | "tips-register-ed-comp": "../../component/tips-register-ed-comp/tips-register-ed-comp", |
| 5 | "tips-common-comp": "../../component/tips-common-comp/tips-common-comp", | ||
| 5 | "van-popup": "../../ui/vant-weapp/popup/index" | 6 | "van-popup": "../../ui/vant-weapp/popup/index" |
| 6 | } | 7 | } |
| 7 | } | 8 | } | ... | ... |
| ... | @@ -69,3 +69,6 @@ | ... | @@ -69,3 +69,6 @@ |
| 69 | <van-popup show="{{ tipsRegisteredVisible }}"> | 69 | <van-popup show="{{ tipsRegisteredVisible }}"> |
| 70 | <tips-register-ed-comp bind:evtcomp="evtcomp"></tips-register-ed-comp> | 70 | <tips-register-ed-comp bind:evtcomp="evtcomp"></tips-register-ed-comp> |
| 71 | </van-popup> | 71 | </van-popup> |
| 72 | <van-popup show="{{ tipsCommonVisible }}"> | ||
| 73 | <tips-common-comp bind:evtcomp="evtcomp" inner-text="{{tipsInnerText}}"></tips-common-comp> | ||
| 74 | </van-popup> | ... | ... |
| ... | @@ -2,13 +2,14 @@ const routerPath = { | ... | @@ -2,13 +2,14 @@ const routerPath = { |
| 2 | index: '/pages/index/index', // 首页 | 2 | index: '/pages/index/index', // 首页 |
| 3 | wish: '/pages/wish/wish', // 我的心愿单 | 3 | wish: '/pages/wish/wish', // 我的心愿单 |
| 4 | createWish: '/pages/create-wish/create-wish', // 创建心愿单 | 4 | createWish: '/pages/create-wish/create-wish', // 创建心愿单 |
| 5 | newWelfare: '/pages/new-welfare/new-welfare', // 新人福利 | 5 | question: '/pages/question/question', //问答 |
| 6 | userTable: '/pages/user-table/user-table', // 用户表单 | 6 | userTable: '/pages/user-table/user-table', // 用户表单 |
| 7 | rank: '/pages/rank/rank', // 排行榜 | 7 | rank: '/pages/rank/rank', // 排行榜 |
| 8 | poster: '/pages/poster/poster', // 海报页 | 8 | poster: '/pages/poster/poster', // 海报页 |
| 9 | coop: '/pages/coop/coop', // 协作页/好友查看 | 9 | coop: '/pages/coop/coop', // 协作页/好友查看 |
| 10 | register: '/pages/register/register', // 注册 | 10 | register: '/pages/register/register', // 注册 |
| 11 | authorize: '/pages/authorize/authorize', // 授权 | 11 | authorize: '/pages/authorize/authorize', // 授权 |
| 12 | newWelfare: '/pages/new-welfare/new-welfare', // 新人福利 | ||
| 12 | example: '/pages/example/example', | 13 | example: '/pages/example/example', |
| 13 | more: '/pages/more/more', | 14 | more: '/pages/more/more', |
| 14 | 15 | ||
| ... | @@ -65,8 +66,7 @@ function to(openType, url) { | ... | @@ -65,8 +66,7 @@ function to(openType, url) { |
| 65 | let obj = { | 66 | let obj = { |
| 66 | url | 67 | url |
| 67 | }; | 68 | }; |
| 68 | 69 | if (openType == 'redirectTo') { | |
| 69 | if (openType == 'redirect') { | ||
| 70 | wx.redirectTo(obj); | 70 | wx.redirectTo(obj); |
| 71 | } else if (openType == 'reLaunch') { | 71 | } else if (openType == 'reLaunch') { |
| 72 | wx.reLaunch(obj); | 72 | wx.reLaunch(obj); | ... | ... |
-
Please register or sign in to post a comment