cadba6d8 by simon

版本提交

1 parent 4f648b66
Showing 40 changed files with 693 additions and 34 deletions
......@@ -33,7 +33,16 @@ App({
loading: true,
}).then((result) => {
this.globalData.indexInfo = result;
if (result.isNeedAuth == 1) {
//需要授权
this.router.push({
path: "authorize"
})
reject();
// resolve();
} else {
resolve(result)
}
}).catch((err) => {
reject();
});
......
......@@ -5,6 +5,7 @@
"pages/authorize/authorize",
"pages/wish/wish",
"pages/create-wish/create-wish",
"pages/question/question",
"pages/new-welfare/new-welfare",
"pages/user-table/user-table",
"pages/rank/rank",
......
......@@ -41,3 +41,4 @@ $fontSizeLarge: 36px;
$fontSizeLarger: 44px;
$pageBottom:80px;
......
Component({
properties: {
// 这里定义了innerText属性,属性值可以在组件使用时指定
innerText: {
type: String,
value: 'default value',
}
},
data: {
// 这里是一些组件内部数据
someData: {}
},
methods: {
// 这里是一个自定义方法
customMethod() {
this.triggerEvent('evtcomp', {
name: "_evt_custom"
})
},
// 隐藏蒙层
hideMask() {
this.triggerEvent('evtcomp', {
name: "_evt_hide_mask"
});
}
}
})
@import '../../assets/scss/mixins';
@import '../../assets/scss/utils';
.comp-item {
position: relative;
width: 654px;
height: 588px;
// background-color: wheat;
.bg {
position: absolute;
width: 654px;
height: 588px;
}
.space1 {
height: 108px;
}
.cont {
position: relative;
text-align: center;
}
.tit {
color: #333333;
font-size: 40px;
font-weight: 300;
text-align: center;
margin: 0 auto;
}
.tips {
margin-top: 24px;
height: 210px;
color: #999999;
font-size: 28px;
@extend .bb;
padding: 0 100px;
}
.btn {
position: relative;
margin: 0 auto;
// @include cb(300px, 80px);
@include cb(234px, 64px);
}
}
<view class="comp-item">
<image class="bg" src="../../image/oss/tips/tips-border-small.png" mode="widthFix" />
<view class="space1"></view>
<view class="cont">
<view class="tit">· 温馨提示 ·</view>
<view class="tips">
<text decode="{{true}}" >{{innerText}}</text>
</view>
<view bindtap="hideMask" class="btn">我知道了</view>
</view>
</view>
......@@ -22,6 +22,12 @@ Component({
this.triggerEvent('evtcomp', {
name: "_evt_hide_mask"
});
},
// 打电话
onCallHandler(){
wx.makePhoneCall({
phoneNumber: '400-830-4000' //仅为示例,并非真实的电话号码
})
}
}
})
......
......@@ -22,4 +22,13 @@
margin: 0 auto;
@include cb(300px, 80px);
}
.call{
width: 170px;
height: 40px;
position: absolute;
// background-color: wheat;
left: 300px;
top: 294px;
}
}
......
......@@ -2,4 +2,5 @@
<image class="bg" src="../../image/oss/tips/tips-group-member.png" mode="widthFix" />
<view class="space1"></view>
<view bindtap="hideMask" class="btn">知道了</view>
<view bindtap="onCallHandler" class="call"></view>
</view>
......
......@@ -20,6 +20,10 @@ Component({
},
// 隐藏蒙层
toQeustionHandler() {
// console.log("toQeustionHandler");
this.triggerEvent('_evt_hide_mask', {
name: "_evt_custom"
})
app.router.push({
path:"question"
})
......
......@@ -14,12 +14,22 @@
}
.space1 {
height: 420px;
height: 480px;
}
.btn {
position: relative;
margin: 0 auto;
@include cb(300px, 80px);
@include cb(234px, 64px);
}
.nickname{
position: absolute;
width: 100%;
text-align: center;
font-size: 40px;
font-weight: 300;
color: #ba3138;
top: 152px;
}
}
......
<view class="comp-item">
<image class="bg" src="../../image/oss/tips/tips-register-ed.png" mode="widthFix" />
<image class="bg" src="../../image/oss/tips/tips-new.png" mode="widthFix" />
<view class="nickname">nickname</view>
<view class="space1"></view>
<view bindtap="toQeustionHandler" class="btn">马上答题</view>
</view>
......
......@@ -20,6 +20,7 @@
.btn {
position: relative;
margin: 0 auto;
@include cb(300px, 80px);
// @include cb(300px, 80px);
@include cb(234px, 64px);
}
}
......
......@@ -20,6 +20,7 @@
.btn {
position: relative;
margin: 0 auto;
@include cb(300px, 80px);
// @include cb(300px, 80px);
@include cb(234px, 64px);
}
}
......
......@@ -20,7 +20,7 @@ Component({
// 隐藏蒙层
hideMask() {
this.triggerEvent('evtcomp', {
name: "_evt_hide_rule_tips"
name: "_evt_hide_mask"
});
}
}
......
......@@ -21,5 +21,6 @@
position: relative;
margin: 0 auto;
@include cb(300px, 80px);
// @include cb(234px, 64px);
}
}
......
......@@ -20,6 +20,7 @@
.btn {
position: relative;
margin: 0 auto;
@include cb(300px, 80px);
// @include cb(300px, 80px);
@include cb(234px, 64px);
}
}
......
......@@ -131,6 +131,9 @@ const fetch = function ({
}
// resolve(res);
// 直接返回content
// 再多封一层,把errMsg塞带content去
// let content = res.content;
// content.errMsg = res.errMsg;
resolve(res.content);
} else {
// 有些特殊状况不需要toast 需要弹窗
......

22.1 KB | W: | H:

17.5 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

16.3 KB | W: | H:

16.4 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

20.4 KB | W: | H:

29.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
......@@ -52,6 +52,7 @@ Page({
let _this = this;
this.refreshIndexData().then((result) => {
if (result.isNeedAuth == 1) {
console.log("result.isNeedAuth:",result.isNeedAuth);
// 未授权
wx.login({
success: function (res) {
......@@ -63,6 +64,7 @@ Page({
authorized: false
})
} else {
console.log("result.isNeedAuth:",result.isNeedAuth);
// 已经授权
// setTimeout(() => {
_this.toIndex();
......
......@@ -2,6 +2,8 @@ let app = getApp();
Page({
data: {
tipsRegisterVisible: false,
tipsGroupMemberVisible: false,
tipsNewMemberVisible: false,
curStatus: 1, // 当前场景
},
onShareAppMessage() {},
......@@ -38,15 +40,12 @@ Page({
isCrmLogin,
isNewMember,
isBlackList,
newMemberJudge,
oldMemberJudge,
hadAnswerQuestion,
isSelfAssist,
wishBillCode
} = indexInfo;
// 未登陆 出注册弹窗提示
if (isCrmLogin == 0) {
// app.router.push({
// path: 'register'
// });
this.setData({
tipsRegisterVisible: true
})
......@@ -55,14 +54,28 @@ Page({
}
// 黑名单
if (isBlackList == 1) {
this.setData({
tipsGroupMemberVisible: true
})
reject();
return;
}
// 新老会员
// isNewMember
// if(isNewMember == 1){
// }else{
// }
if (isNewMember == 1) {
// 新会员
if (hadAnswerQuestion) {
// 已经答题,提示创建心愿单
} else {
// 未答题,提示答题
this.setData({
tipsNewMemberVisible: true
})
}
} else {
// 老会员
}
resolve();
});
......@@ -86,9 +99,11 @@ Page({
} = evt.detail;
switch (name) {
case "_evt_hide_rule_tips":
case "_evt_hide_mask":
this.setData({
ruleTipsVisible: false
ruleTipsVisible: false,
tipsGroupMemberVisible: false,
tipsNewMemberVisible:false,
})
break;
......
......@@ -2,6 +2,8 @@
"navigationBarTitleText": "丸美心愿单",
"usingComponents": {
"tips-register-comp": "../../component/tips-register-comp/tips-register-comp",
"tips-group-member-comp": "../../component/tips-group-member-comp/tips-group-member-comp",
"tips-new-comp": "../../component/tips-new-comp/tips-new-comp",
"van-popup": "../../ui/vant-weapp/popup/index"
}
}
......
......@@ -80,10 +80,12 @@
height: 140px;
border-radius: 70px;
background-image: radial-gradient(circle at 0 0, #ffffff, #f2e6e6);
@extend .fcc;
.prod {
max-width: 100px;
max-height: 120px;
max-width: 200px;
max-height: 200px;
margin-bottom: 10px;
}
.close {
......
......@@ -30,7 +30,7 @@
</view>
<view class="wish-item">
<view class="display">
<image class="prod" mode="aspectFit" src="../../image/oss/prize/prize_3.png" />
<image class="prod" mode="aspectFit" src="../../image/oss/prize/prize_2.png" />
<image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" />
</view>
<view class="name">丸美弹力蛋白凝时紧致乳</view>
......@@ -41,7 +41,7 @@
</view>
<view class="wish-item">
<view class="display">
<image class="prod" mode="aspectFit" src="../../image/oss/prize/prize_3.png" />
<image class="prod" mode="aspectFit" src="../../image/oss/prize/prize_1.png" />
<image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" />
</view>
<view class="name">丸美弹力蛋白凝时紧致乳</view>
......@@ -60,3 +60,9 @@
<van-popup show="{{ tipsRegisterVisible }}">
<tips-register-comp bind:evtcomp="evtcomp"></tips-register-comp>
</van-popup>
<van-popup show="{{ tipsGroupMemberVisible }}">
<tips-group-member-comp bind:evtcomp="evtcomp"></tips-group-member-comp>
</van-popup>
<van-popup show="{{ tipsNewMemberVisible }}">
<tips-new-comp bind:evtcomp="evtcomp"></tips-new-comp>
</van-popup>
......
import {
getBindtapData
} from '../../utils/util';
import Date from '../../utils/date';
let app = getApp();
Page({
data: {
questionList: [], // 题目列表
// questionResult: {
// "status": 1,
// "elasticValue": 50,
// "coupons": [{
// "couponId": "20839",
// "couponCode": "RLLL1IHG",
// "rule": "RLLL1IHG",
// "startDate": 1564479217000,
// "endDate": 1567094399000,
// "type": 4,
// "name": "眼部护理体验券-7月24日",
// "state": 0
// }]
// },
questionResult:{},
// 答题结果
questionNumList: ["A", "B", "C", "D"],
myAnswer: [], //我的答案
},
onShareAppMessage() {},
onLoad(options) {
this.initData();
},
initData() {
this.queryQuestionList();
},
/**
* 跳转至创建心愿单
*/
onCreateWishHandler() {
app.router.push({
openType: "redirectTo",
path: "createWish"
})
},
/**
* 点击答案
* 设置选择的按钮
*/
onSelectAnswerHandler(evt) {
let curIndex = getBindtapData(evt, "index");
let curPIndex = getBindtapData(evt, "pindex");
let questionList = this.data.questionList;
// 重置本题的选中状态
questionList[curPIndex].answers.forEach(element => {
element.selected = false;
});
questionList[curPIndex].answers[curIndex].selected = true;
questionList[curPIndex].selected = true; // 题目已被选择
let myAnswer = this.data.myAnswer;
let curAnswer = {
questionCode: questionList[curPIndex].questionCode,
answerNo: questionList[curPIndex].answers[curIndex].answerNo
}
myAnswer[curPIndex] = curAnswer;
this.setData({
questionList,
myAnswer
})
},
/**
* 提交答案
*/
onSubmitQuestionResultHandler() {
let _this = this;
// 检查是否有提没提交 完整判断应该判断题目数要大于0,这里就算了
let questionList = this.data.questionList;
let isComplete = questionList.every((item) => {
return item.selected == true;
})
let myAnswer = this.data.myAnswer;
if (isComplete) {
wx.showModal({
content: "确认提交?",
confirmText: "确认",
success(res) {
app.post({
url: app.api.answerSubmit,
data: myAnswer
}).then((result) => {
let questionResult = result;
questionResult.coupons.forEach(element => {
element.endDateStr = new Date(element.endDate).toString("yy-MM-dd");
});
_this.setData({
questionResult
})
console.log("answerSubmit:", _this.data.questionResult);
})
}
})
} else {
wx.showModal({
content: "答题未完成",
confirmText: "继续答题",
showCancel: false,
success(res) {
}
})
}
},
/**
* 请求问题列表
*/
queryQuestionList() {
return new Promise((resolve, reject) => {
app.post({
url: app.api.questionList,
data: {}
}).then((result) => {
let {
questionList
} = result;
console.log("questionList", questionList);
this.setData({
questionList: questionList
})
resolve();
})
});
},
// 子组件事件
evtcomp(evt) {
let {
name,
data
} = evt.detail;
switch (name) {
case "_evt_hide":
break;
default:
break;
}
},
})
{
"navigationBarTitleText": "有奖问答"
}
@import '../../assets/scss/mixins';
@import '../../assets/scss/utils';
.page {
padding-bottom: 0;
.bgc {}
.bg {}
.decoration {
position: relative;
.d1 {
position: absolute;
width: 533px;
height: 227px;
top: 0;
right: 0;
}
}
.main {
.top-space {
height: 48px;
}
.content {
position: relative;
// 标题
.tit {
font-size: 36px;
color: #a01635;
text-align: center;
}
// 问题
.question {
@extend .bb;
padding: 40px 52px 0;
&-item {
margin-bottom: 60px;
// 问题
.ques {
display: flex;
align-items: center;
color: #333333;
.light {
width: 18px;
height: 36px;
margin-right: 10px;
}
}
// 答案
.answer {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
margin-top: 32px;
&-item {
width: 312px;
height: 72px;
line-height: 72px;
border-radius: 36px;
border: solid 1px #999999;
@extend .bb;
padding: 0 10px;
font-size: 22px;
color: #333333;
margin-bottom: 28px;
}
.selected {
border: solid 2px #ac0521;
color: #ac0521;
}
.right {
color: #ffffff;
background-color: #32ba32;
border: none;
}
}
}
}
// 提交按钮
.submit-btn {
margin: 0 auto;
@include cb(300px, 80px);
margin-bottom: 52px;
}
// 结果
.result {
position: relative;
margin: 60px auto 0;
width: 750px;
height: 1043px;
.d1 {
position: absolute;
top: -20px;
right: 0;
width: 318px;
height: 218px;
}
.d2 {
position: absolute;
left: 0;
bottom: -4px;
width: 122px;
height: 252px;
}
.bg {
position: absolute;
width: 738px;
height: 1043px;
}
.cont {
position: relative;
text-align: center;
.space1 {
height: 80px;
}
.tit {
color: #333333;
font-size: 30px;
}
// 球形
.ball {
margin: 28px auto 0;
width: 194px;
height: 194px;
border-radius: 97px;
background-image: linear-gradient(to top, #c22f3b, #e92647 99%), linear-gradient(to bottom, #bb343a, #bb343a);
display: flex;
align-content: center;
flex-wrap: wrap;
font-size: 24px;
color: #ffffff;
.t1 {
width: 100%;
}
.score {
width: 100%;
font-size: 70px;
height: 80px;
line-height: 80px;
}
}
.tips {
margin-top: 40px;
text-align: center;
font-size: 24px;
color: #333333;
}
// 优惠券
.coupon {
position: relative;
margin-top: 18px;
&-item {
position: relative;
width: 578px;
height: 198px;
margin: 0 auto 12px;
.ebg {
left: 0;
top: 0;
position: absolute;
width: 578px;
height: 198px;
}
.cont {
position: relative;
.name {
position: absolute;
left: 40px;
top: 40px;
color: #ffffff;
font-size: 34px;
}
.detail {
position: absolute;
border-radius: 24px;
font-size: 24px;
border: solid 1px rgba($color: #ffffff, $alpha: 0.8);
color: rgba($color: #ffffff, $alpha: 0.8);
@include btc(140px, 48px);
top: 40px;
right: 26px;
}
.card-info {
position: absolute;
top: 146px;
color: #fbe4c9;
font-size: 24px;
}
.card-no {
left: 28px;
}
.card-date {
right: 28px;
}
}
}
&-item2 {
.name {
color: #653d0d;
}
.card-info {
color: #fce6c2;
}
}
}
}
.create-wish-btn {
@include cb(300px, 80px);
position: absolute;
bottom: 80px;
left: 0;
right: 0;
margin: 0 auto;
}
}
}
}
}
<view class="page">
<view class="app__bgc bgc"></view>
<view class="app__bg bg"></view>
<view class="decoration">
<image class="d1" src="../../image/oss/question/question-c1.png" mode="widthFix" />
</view>
<view class="app__content main">
<view class="top-space"></view>
<view class="content">
<!-- 标题 -->
<view class="tit">· 欢迎来到丸美小课堂 ·</view>
<!-- 问题 -->
<view class="question">
<view data-data="{{item}}" data-index="{{index}}" wx:for="{{questionList}}" wx:key="{{index}}" class="question-item">
<view class="ques">
<image class="light" mode="widthFix" src="../../image/oss/question/question-light.png" />
{{item.question}}
</view>
<view class="answer">
<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':''}}">
{{questionNumList[index2]}}.{{item2.answer}}
</view>
</view>
</view>
</view>
<!-- 提交 -->
<view bindtap="onSubmitQuestionResultHandler" wx:if="{{questionResult.status != 1}}" class="submit-btn">
确认提交
</view>
<!-- 结果 -->
<view wx:else class="result">
<image class="d1" mode="widthFix" src="../../image/oss/question/question-d1.png" />
<image class="bg" mode="widthFix" src="../../image/oss/question/result-border.png" />
<image class="d2" mode="widthFix" src="../../image/oss/question/question-d2.png" />
<view class="cont">
<view class="space1"></view>
<view class="tit">测验结果:答对1题,答错2题</view>
<view class="ball">
<view class="t1">获得</view>
<view class="score">{{questionResult.elasticValue}}</view>
<view class="t1">弹力值</view>
</view>
<view class="tips">还凭您的盛世美颜获得更多惊喜</view>
<view class="coupon">
<view wx:for="{{questionResult.coupons}}" wx:key="{{index}}" class="coupon-item {{item.type==4?'coupon-item2':''}}">
<image class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-1.png" />
<view class="cont">
<view class="name">{{item.name}}</view>
<!-- <view class="detail">查看详情</view> -->
<view class="card-info card-no">劵码:{{item.couponCode}}</view>
<view class="card-info card-date">有效期:即日起至{{item.endDateStr}}</view>
</view>
</view>
<!-- <view class="coupon-item coupon-item2">
<image class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-2.png" />
<view class="cont">
<view class="name">眼部保养劵</view>
<view class="detail">查看详情</view>
<view class="card-info card-no">劵码:ABCD 1234</view>
<view class="card-info card-date">有效期:即日起至19.10.31</view>
</view>
</view> -->
</view>
</view>
<view bindtap="onCreateWishHandler" class="create-wish-btn">去创建心愿单</view>
</view>
</view>
</view>
</view>
......@@ -4,14 +4,17 @@ let Utils = require('../../utils/util.js');
let app = getApp();
Page({
data: {
tipsInnerText:"",
redirect: "createWish", // 注册完的重定向页面
tipsRegisteredVisible: false,
tipsCommonVisible: false,
// form start
name: "",
mobile: "",
verifyCode: "",
birthday: "",
password: "",
sex: 0,
password: "qq123456",
sex: 1,
isTerms: false,
// form end
auth_time: 0,
......@@ -23,7 +26,6 @@ Page({
this.initData();
},
initData() {
},
showLog(msg) {
wx.showToast({
......@@ -32,6 +34,7 @@ Page({
})
},
doRegister() {
let _this = this;
this.checkForm().then((result) => {
// 注册
let data = {
......@@ -39,11 +42,14 @@ Page({
name: this.data.name,
birthday: this.data.birthday,
verifyCode: this.data.verifyCode,
password: this.data.password,
sex: this.data.sex,
}
app.post({
url: app.api.register,
url: app.api.crmRegister,
data: data
}).then((result) => {
if (result.status == 1) {
wx.showModal({
title: "登陆成功",
content: "继续生成我的心愿单",
......@@ -51,11 +57,17 @@ Page({
showCancel: false,
success(res) {
app.router.push({
openType: "reLaunch",
path: "createWish"
openType: "redirectTo",
path: _this.data.redirect
})
}
})
} else {
this.setData({
tipsInnerText: result.errMsg,
tipsCommonVisible: true,
})
}
});
})
},
......@@ -105,6 +117,7 @@ Page({
app.post({
url: app.api.mobileVerifyCode,
data: {
picVerifyCode:"",
mobile: mobile,
forRegister: 1
}
......@@ -170,7 +183,8 @@ Page({
case "_evt_hide_mask":
this.setData({
tipsRegisteredVisible: false
tipsRegisteredVisible: false,
tipsCommonVisible: false
})
break;
......
......@@ -2,6 +2,7 @@
"navigationBarTitleText": "登陆",
"usingComponents": {
"tips-register-ed-comp": "../../component/tips-register-ed-comp/tips-register-ed-comp",
"tips-common-comp": "../../component/tips-common-comp/tips-common-comp",
"van-popup": "../../ui/vant-weapp/popup/index"
}
}
......
......@@ -71,11 +71,8 @@ $formWidth:560px;
font-size: 30px;
padding: 0 32px;
}
}
}
}
// 拼图
......
......@@ -69,3 +69,6 @@
<van-popup show="{{ tipsRegisteredVisible }}">
<tips-register-ed-comp bind:evtcomp="evtcomp"></tips-register-ed-comp>
</van-popup>
<van-popup show="{{ tipsCommonVisible }}">
<tips-common-comp bind:evtcomp="evtcomp" inner-text="{{tipsInnerText}}"></tips-common-comp>
</van-popup>
......
......@@ -2,13 +2,14 @@ const routerPath = {
index: '/pages/index/index', // 首页
wish: '/pages/wish/wish', // 我的心愿单
createWish: '/pages/create-wish/create-wish', // 创建心愿单
newWelfare: '/pages/new-welfare/new-welfare', // 新人福利
question: '/pages/question/question', //问答
userTable: '/pages/user-table/user-table', // 用户表单
rank: '/pages/rank/rank', // 排行榜
poster: '/pages/poster/poster', // 海报页
coop: '/pages/coop/coop', // 协作页/好友查看
register: '/pages/register/register', // 注册
authorize: '/pages/authorize/authorize', // 授权
newWelfare: '/pages/new-welfare/new-welfare', // 新人福利
example: '/pages/example/example',
more: '/pages/more/more',
......@@ -65,8 +66,7 @@ function to(openType, url) {
let obj = {
url
};
if (openType == 'redirect') {
if (openType == 'redirectTo') {
wx.redirectTo(obj);
} else if (openType == 'reLaunch') {
wx.reLaunch(obj);
......