4f648b66 by simon

版本提交

1 parent d1f8bfaf
Showing 104 changed files with 790 additions and 41 deletions
...@@ -23,5 +23,20 @@ App({ ...@@ -23,5 +23,20 @@ App({
23 userInfo: null, 23 userInfo: null,
24 wxcode: store.getItem("wxcode"), 24 wxcode: store.getItem("wxcode"),
25 tlMemberCode: "" 25 tlMemberCode: ""
26 },
27 // 获取用户基本信息
28 queryIndex() {
29 return new Promise((resolve, reject) => {
30 this.post({
31 url: this.api.index,
32 data: {},
33 loading: true,
34 }).then((result) => {
35 this.globalData.indexInfo = result;
36 resolve(result)
37 }).catch((err) => {
38 reject();
39 });
40 });
26 } 41 }
27 }) 42 })
......
1 { 1 {
2 "pages": [ 2 "pages": [
3 "pages/index/index", 3 "pages/index/index",
4 "pages/register/register",
4 "pages/authorize/authorize", 5 "pages/authorize/authorize",
5 "pages/wish/wish", 6 "pages/wish/wish",
6 "pages/create-wish/create-wish", 7 "pages/create-wish/create-wish",
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
95 } 95 }
96 96
97 // 居中按钮样式 97 // 居中按钮样式
98 @mixin btn-center($width, $height) { 98 @mixin btc($width, $height) {
99 width: $width; 99 width: $width;
100 height: $height; 100 height: $height;
101 line-height: $height; 101 line-height: $height;
......
...@@ -203,3 +203,38 @@ ...@@ -203,3 +203,38 @@
203 } 203 }
204 204
205 205
206
207 .bis {
208 background-repeat: no-repeat;
209 background-size: 100% 100%;
210 }
211
212
213 //flex 布局和 子元素 对其方式
214 .fl {
215 display: flex;
216 }
217
218 .fj {
219 display: flex;
220 justify-content: space-between;
221 }
222
223 //水平和垂直居中
224 .fcc {
225 display: flex;
226 justify-content: center;
227 align-items: center;
228 }
229
230 // 为元素设定的宽度和高度决定了元素的边框盒。
231 .bb {
232 box-sizing: border-box;
233 }
234
235 // 满屏
236 .fullp {
237 width: 100%;
238 height: 100%;
239 }
240
......
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: 400px;
18 }
19
20 .btn {
21 position: relative;
22 margin: 0 auto;
23 @include cb(300px, 80px);
24 }
25 }
1 <view class="comp-item">
2 <image class="bg" src="../../image/oss/tips/tips-group-member.png" mode="widthFix" />
3 <view class="space1"></view>
4 <view bindtap="hideMask" class="btn">知道了</view>
5 </view>
1 let app = getApp();
2 Component({
3 properties: {
4 // 这里定义了innerText属性,属性值可以在组件使用时指定
5 innerText: {
6 type: String,
7 value: 'default value',
8 }
9 },
10 data: {
11 // 这里是一些组件内部数据
12 someData: {}
13 },
14 methods: {
15 // 这里是一个自定义方法
16 customMethod() {
17 this.triggerEvent('evtcomp', {
18 name: "_evt_custom"
19 })
20 },
21 // 隐藏蒙层
22 toQeustionHandler() {
23 app.router.push({
24 path:"question"
25 })
26 }
27 }
28 })
1 @import '../../assets/scss/mixins';
2 @import '../../assets/scss/utils';
3
4 .comp-item {
5 position: relative;
6 width: 654px;
7 height: 666px;
8
9 // background-color: wheat;
10 .bg {
11 position: absolute;
12 width: 654px;
13 height: 666px;
14 }
15
16 .space1 {
17 height: 420px;
18 }
19
20 .btn {
21 position: relative;
22 margin: 0 auto;
23 @include cb(300px, 80px);
24 }
25 }
1 <view class="comp-item">
2 <image class="bg" src="../../image/oss/tips/tips-register-ed.png" mode="widthFix" />
3 <view class="space1"></view>
4 <view bindtap="toQeustionHandler" class="btn">马上答题</view>
5 </view>
1 let app = getApp();
2 Component({
3 properties: {
4 // 这里定义了innerText属性,属性值可以在组件使用时指定
5 innerText: {
6 type: String,
7 value: 'default value',
8 }
9 },
10 data: {
11 // 这里是一些组件内部数据
12 someData: {}
13 },
14 methods: {
15 // 这里是一个自定义方法
16 customMethod() {
17 this.triggerEvent('evtcomp', {
18 name: "_evt_custom"
19 })
20 },
21 // 去注册页面
22 toRegister() {
23 app.router.push({
24 path: "register"
25 })
26 }
27 }
28 })
1 @import '../../assets/scss/mixins';
2 @import '../../assets/scss/utils';
3
4 .comp-item {
5 position: relative;
6 width: 654px;
7 height: 645px;
8
9 // background-color: wheat;
10 .bg {
11 position: absolute;
12 width: 654px;
13 height: 645px;
14 }
15
16 .space1 {
17 height: 472px;
18 }
19
20 .btn {
21 position: relative;
22 margin: 0 auto;
23 @include cb(300px, 80px);
24 }
25 }
1 <view class="comp-item">
2 <image class="bg" src="../../image/oss/tips/tips-login.png" mode="widthFix" />
3 <view class="space1"></view>
4 <view bindtap="toRegister" class="btn">马上登陆</view>
5 </view>
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: 578px;
8
9 // background-color: wheat;
10 .bg {
11 position: absolute;
12 width: 654px;
13 height: 578px;
14 }
15
16 .space1 {
17 height: 392px;
18 }
19
20 .btn {
21 position: relative;
22 margin: 0 auto;
23 @include cb(300px, 80px);
24 }
25 }
1 <view class="comp-item">
2 <image class="bg" src="../../image/oss/tips/tips-register-ed.png" mode="widthFix" />
3 <view class="space1"></view>
4 <view bindtap="hideMask" class="btn">我知道了</view>
5 </view>
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: 400px;
18 }
19
20 .btn {
21 position: relative;
22 margin: 0 auto;
23 @include cb(300px, 80px);
24 }
25 }
1 <view class="comp-item">
2 <image class="bg" src="../../image/oss/tips/tips-shake.png" mode="widthFix" />
3 <!-- <view class="space1"></view>
4 <view bindtap="hideMask" class="btn">知道了</view> -->
5 </view>
...@@ -49,7 +49,7 @@ function checkSessionId() { ...@@ -49,7 +49,7 @@ function checkSessionId() {
49 } 49 }
50 50
51 const fetch = function ({ 51 const fetch = function ({
52 loading = false, 52 loading = true,
53 toast = true, 53 toast = true,
54 sid = true, 54 sid = true,
55 auth = true, 55 auth = true,
......
...@@ -73,6 +73,7 @@ Page({ ...@@ -73,6 +73,7 @@ Page({
73 }, 73 },
74 // 跳转到首页 74 // 跳转到首页
75 toIndex() { 75 toIndex() {
76 console.log("toIndex");
76 app.router.push({ 77 app.router.push({
77 path: "index", 78 path: "index",
78 openType: "redirect" 79 openType: "redirect"
......
1 let app = getApp(); 1 let app = getApp();
2 Page({ 2 Page({
3 data: { 3 data: {
4 // ruleTipsVisible: true, 4 tipsRegisterVisible: false,
5 curStatus: 1, // 当前场景
5 }, 6 },
6 onShareAppMessage() {}, 7 onShareAppMessage() {},
7 onLoad(options) {}, 8 onLoad(options) {
9 this.initData();
10 },
11 initData() {
12 app.queryIndex().then((result) => {});
13 },
14 /**
15 * 点击提交心愿单按钮
16 * 首先要根据自身状态判断
17 */
18 onSubmitHandler() {
19 this.checkSubmit().then((result) => {
20
21 }).catch((err) => {
22
23 });;
24 },
25 /**
26 * 提交前判断状态
27 * 判断顺序
28 * 1.crm登陆
29 * 2.黑名单 (团购会员)
30 * 3.新会员
31 *
32 */
33 checkSubmit() {
34 return new Promise((resolve, reject) => {
35 let indexInfo = app.globalData.indexInfo;
36 console.log("indexInfo:", indexInfo);
37 let {
38 isCrmLogin,
39 isNewMember,
40 isBlackList,
41 newMemberJudge,
42 oldMemberJudge,
43 wishBillCode
44 } = indexInfo;
45 // 未登陆 出注册弹窗提示
46 if (isCrmLogin == 0) {
47 // app.router.push({
48 // path: 'register'
49 // });
50 this.setData({
51 tipsRegisterVisible: true
52 })
53 reject();
54 return;
55 }
56 // 黑名单
57 if (isBlackList == 1) {
58 reject();
59 return;
60 }
61 // 新老会员
62 // isNewMember
63 // if(isNewMember == 1){
64 // }else{
65 // }
66 resolve();
67 });
68
69 },
70 // 换一批
71 onChangeStatusHandler() {
72 let curStatus = this.data.curStatus;
73 curStatus++;
74 if (curStatus > 3) {
75 curStatus = 1;
76 }
77 this.setData({
78 curStatus
79 })
80 },
8 // 子组件事件 81 // 子组件事件
9 evtcomp(evt) { 82 evtcomp(evt) {
10 let { 83 let {
...@@ -23,8 +96,4 @@ Page({ ...@@ -23,8 +96,4 @@ Page({
23 break; 96 break;
24 } 97 }
25 }, 98 },
26 // 提交心愿单
27 onWishHandler() {
28
29 }
30 }) 99 })
......
1 { 1 {
2 "navigationBarTitleText": "丸美心愿单", 2 "navigationBarTitleText": "丸美心愿单",
3 "usingComponents": { 3 "usingComponents": {
4 "rule-tips-comp": "../../component/rule-tips-comp/rule-tips-comp", 4 "tips-register-comp": "../../component/tips-register-comp/tips-register-comp",
5 "van-popup": "../../ui/vant-weapp/popup/index" 5 "van-popup": "../../ui/vant-weapp/popup/index"
6 } 6 }
7 } 7 }
......
...@@ -2,20 +2,130 @@ ...@@ -2,20 +2,130 @@
2 @import '../../assets/scss/utils'; 2 @import '../../assets/scss/utils';
3 3
4 .page { 4 .page {
5 .bgc { 5 .bgc {}
6 background-color: wheat; 6
7 // 场景1背景
8 .bgc1 {
9 background-color: #ffd5da;
7 } 10 }
8 11
9 .bg {} 12
13 .bg {
14 image {
15 position: absolute;
16 width: 750px;
17 height: 1303px;
18 }
19 }
10 20
11 .main { 21 .main {
12 .top-space { 22 .top-space {
13 height: 0px; 23 height: 610px;
14 } 24 }
15 25
16 .content { 26 .content {
17 position: relative; 27 position: relative;
18 28
29 // 换一批按钮
30 .change-btn {
31 margin-left: 48px;
32 box-shadow: 0px 6px 30px 0 rgba(126, 40, 40, 0.5);
33 background-color: #ffffff;
34 @include btc(160px, 54px);
35 border-radius: 27px;
36 font-size: 28px;
37 font-weight: 300;
38 color: #ba3039;
39 @extend .fcc;
40
41 .icon {
42 margin-right: 12px;
43 width: 29px;
44 height: 29px;
45 }
46 }
47
48 // 许愿单
49 .wish-container {
50 position: relative;
51
52 // 背景图
53 .ebg {
54 width: 746px;
55 height: 539px;
56 position: absolute;
57 left: 0;
58 right: 0;
59 top: 0;
60 margin: 0 auto;
61 }
62
63 // 心愿
64 .wish {
65 position: relative;
66 margin: 0 auto 0;
67 display: flex;
68 justify-content: space-between;
69 @extend .bb;
70 // padding-top: 116px;
71 padding: 116px 90px 0;
72
73 &-item {
74 position: relative;
75 text-align: center;
76
77 .display {
78 position: relative;
79 width: 140px;
80 height: 140px;
81 border-radius: 70px;
82 background-image: radial-gradient(circle at 0 0, #ffffff, #f2e6e6);
83
84 .prod {
85 max-width: 100px;
86 max-height: 120px;
87 }
88
89 .close {
90 width: 30px;
91 height: 30px;
92 position: absolute;
93 bottom: 0;
94 right: 0;
95 }
96 }
97
98 .name {
99 width: 160px;
100 margin: 8px auto 0;
101 color: #333333;
102 font-size: 20px;
103 // font-weight: 300;
104 }
105
106 .val {
107 @extend .fcc;
108 color: #b93138;
109 font-size: 20px;
110
111 .icon {
112 margin-left: 6px;
113 width: 11px;
114 height: 18px;
115 }
116 }
117 }
118 }
119
120 // 提交心愿按钮
121 .submit-btn {
122 margin: 48px auto 0;
123 width: 234px;
124 height: 64px;
125 line-height: 64px;
126 }
127 }
128
19 .btn { 129 .btn {
20 @include cb; 130 @include cb;
21 } 131 }
......
1 <view class="page"> 1 <view class="page">
2 <view class="app__bgc bgc"></view> 2 <view class="app__bgc bgc {{curStatus==1?'bgc1':''}}"></view>
3 <view class="app__bg bg"></view> 3 <view class="app__bg bg">
4 <image src="{{'../../image/oss/create-wish/create-wish-'+curStatus+'.png'}}" mode="scaleToFill" />
5 </view>
4 <view class="app__content main"> 6 <view class="app__content main">
5 <view class="top-space"></view> 7 <view class="top-space"></view>
6 <view class="content"> 8 <view class="content">
7 <view class="btn" bindtap="onWishHandler" >提交心愿单</view> 9 <!-- <view class="btn" bindtap="onWishHandler">提交心愿单</view> -->
10 <!-- 换一批按钮 -->
11 <view class="change-btn" bindtap="onChangeStatusHandler">
12 <image class="icon" src="../../image/oss/create-wish/cw-exchange-btn.png" mode="widthFix" />
13 换一批
14 </view>
15 <!-- 心愿单 -->
16 <view class="wish-container">
17 <image class="ebg" mode="widthFix" src="../../image/oss/create-wish/cw-border.png" />
18 <!-- 心愿容器 -->
19 <view class="wish">
20 <view class="wish-item">
21 <view class="display">
22 <image class="prod" mode="aspectFit" src="../../image/oss/prize/prize_3.png" />
23 <image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" />
24 </view>
25 <view class="name">丸美弹力蛋白凝时紧致乳</view>
26 <view class="val">
27 <image class="icon" mode="widthFix" src="../../image/oss/create-wish/cw-light.png" />
28 需要弹力值5403
29 </view>
30 </view>
31 <view class="wish-item">
32 <view class="display">
33 <image class="prod" mode="aspectFit" src="../../image/oss/prize/prize_3.png" />
34 <image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" />
35 </view>
36 <view class="name">丸美弹力蛋白凝时紧致乳</view>
37 <view class="val">
38 <image class="icon" mode="widthFix" src="../../image/oss/create-wish/cw-light.png" />
39 需要弹力值5403
40 </view>
41 </view>
42 <view class="wish-item">
43 <view class="display">
44 <image class="prod" mode="aspectFit" src="../../image/oss/prize/prize_3.png" />
45 <image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" />
46 </view>
47 <view class="name">丸美弹力蛋白凝时紧致乳</view>
48 <view class="val">
49 <image class="icon" mode="widthFix" src="../../image/oss/create-wish/cw-light.png" />
50 需要弹力值5403
51 </view>
52 </view>
53 </view>
54 <!-- 提交心愿单 -->
55 <view bindtap="onSubmitHandler" class="btn submit-btn">提交心愿单</view>
56 </view>
8 </view> 57 </view>
9 </view> 58 </view>
10 </view> 59 </view>
11 <van-popup show="{{ ruleTipsVisible }}"> 60 <van-popup show="{{ tipsRegisterVisible }}">
12 <rule-tips-comp bind:evtcomp="evtcomp"></rule-tips-comp> 61 <tips-register-comp bind:evtcomp="evtcomp"></tips-register-comp>
13 </van-popup> 62 </van-popup>
......
...@@ -3,10 +3,30 @@ Page({ ...@@ -3,10 +3,30 @@ Page({
3 data: { 3 data: {
4 authorized: true, 4 authorized: true,
5 canIUse: wx.canIUse('button.open-type.getUserInfo'), 5 canIUse: wx.canIUse('button.open-type.getUserInfo'),
6 ruleTipsVisible: false, 6 tipsRuleVisible: false,
7 }, 7 },
8 onShareAppMessage() {}, 8 onShareAppMessage() {},
9 onLoad(options) {}, 9 onLoad(options) {
10 this.initData();
11 },
12 initData() {
13 app.queryIndex().then((result) => {
14 console.log("result:", result);
15 })
16 },
17 // 开始互动游戏
18 onStartHandler() {
19 let path = "createWish";
20 app.router.push({
21 path: "createWish"
22 })
23 },
24 // 显示规则页面
25 onShowRuleHandler() {
26 this.setData({
27 tipsRuleVisible: true
28 })
29 },
10 // 子组件事件 30 // 子组件事件
11 evtcomp(evt) { 31 evtcomp(evt) {
12 let { 32 let {
...@@ -17,7 +37,7 @@ Page({ ...@@ -17,7 +37,7 @@ Page({
17 37
18 case "_evt_hide_rule_tips": 38 case "_evt_hide_rule_tips":
19 this.setData({ 39 this.setData({
20 ruleTipsVisible: false 40 tipsRuleVisible: false
21 }) 41 })
22 break; 42 break;
23 43
...@@ -25,17 +45,4 @@ Page({ ...@@ -25,17 +45,4 @@ Page({
25 break; 45 break;
26 } 46 }
27 }, 47 },
28 // 开始互动游戏
29 onStartHandler() {
30 let path = "createWish";
31 app.router.push({
32 path: "createWish"
33 })
34 },
35 // 显示规则页面
36 onShowRuleHandler() {
37 this.setData({
38 ruleTipsVisible: true
39 })
40 }
41 }) 48 })
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 "navigationBarTitleText": "我的心愿单", 2 "navigationBarTitleText": "我的心愿单",
3 "usingComponents": { 3 "usingComponents": {
4 "authorize-comp": "../../component/authorize-comp/authorize-comp", 4 "authorize-comp": "../../component/authorize-comp/authorize-comp",
5 "rule-tips-comp": "../../component/rule-tips-comp/rule-tips-comp", 5 "tips-rule-comp": "../../component/tips-rule-comp/tips-rule-comp",
6 "van-popup": "../../ui/vant-weapp/popup/index" 6 "van-popup": "../../ui/vant-weapp/popup/index"
7 } 7 }
8 } 8 }
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
56 top: 24px; 56 top: 24px;
57 right: 0; 57 right: 0;
58 @include border-left-radius(30px); 58 @include border-left-radius(30px);
59 @include btn-center(162px, 60px); 59 @include btc(162px, 60px);
60 font-size: 30px; 60 font-size: 30px;
61 color: #bf0221; 61 color: #bf0221;
62 // border-radius: 30px; 62 // border-radius: 30px;
......
...@@ -25,6 +25,6 @@ ...@@ -25,6 +25,6 @@
25 <!-- <van-popup show="{{ authorizeVisible }}" > 25 <!-- <van-popup show="{{ authorizeVisible }}" >
26 <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> 26 <authorize-comp bind:evtcomp="evtcomp"></authorize-comp>
27 </van-popup> --> 27 </van-popup> -->
28 <van-popup show="{{ ruleTipsVisible }}"> 28 <van-popup show="{{ tipsRuleVisible }}">
29 <rule-tips-comp bind:evtcomp="evtcomp"></rule-tips-comp> 29 <tips-rule-comp bind:evtcomp="evtcomp"></tips-rule-comp>
30 </van-popup> 30 </van-popup>
......
1 let Date = require('../../utils/date.js');
2 let Utils = require('../../utils/util.js');
3
1 let app = getApp(); 4 let app = getApp();
2 Page({ 5 Page({
3 data: {}, 6 data: {
7 tipsRegisteredVisible: false,
8 // form start
9 name: "",
10 mobile: "",
11 verifyCode: "",
12 birthday: "",
13 password: "",
14 sex: 0,
15 isTerms: false,
16 // form end
17 auth_time: 0,
18 sendAuthCode: true,
19 /*布尔值,通过v-show控制显示‘获取按钮’还是‘倒计时’ */
20 },
4 onShareAppMessage() {}, 21 onShareAppMessage() {},
5 onLoad(options) {}, 22 onLoad(options) {
23 this.initData();
24 },
25 initData() {
26
27 },
28 showLog(msg) {
29 wx.showToast({
30 title: msg,
31 icon: "none"
32 })
33 },
34 doRegister() {
35 this.checkForm().then((result) => {
36 // 注册
37 let data = {
38 mobile: this.data.mobile,
39 name: this.data.name,
40 birthday: this.data.birthday,
41 verifyCode: this.data.verifyCode,
42 }
43 app.post({
44 url: app.api.register,
45 data: data
46 }).then((result) => {
47 wx.showModal({
48 title: "登陆成功",
49 content: "继续生成我的心愿单",
50 confirmText: "马上前往",
51 showCancel: false,
52 success(res) {
53 app.router.push({
54 openType: "reLaunch",
55 path: "createWish"
56 })
57 }
58 })
59 });
60 })
61 },
62 // 表单检查
63 checkForm() {
64 return new Promise((resolve, reject) => {
65 if (!this.data.name) {
66 this.showLog("请输入姓名");
67 reject();
68 } else if (!this.data.mobile) {
69 this.showLog("请输入手机号码");
70 reject();
71 } else if (!Utils.checkMobile(this.data.mobile)) {
72 this.showLog("请输正确手机号码");
73 reject();
74 } else if (!this.data.verifyCode) {
75 this.showLog("请输入验证码");
76 reject();
77 } else if (!this.data.isTerms) {
78 this.showLog("请同意服务条款");
79 reject();
80 } else {
81 resolve();
82 }
83 });
84 },
85 // 是否同意条款
86 onTermsHandler() {
87 console.log("onTermsHandler");
88 this.setData({
89 isTerms: !this.data.isTerms
90 })
91 },
92 // 跳转至会员条款
93 onPolicyHandler() {
94
95 },
96 // 获取验证码
97 reqGetSmsRequest() {
98 if (!this.data.sendAuthCode) return;
99 let mobile = this.data.mobile
100 if (!mobile || !Utils.checkMobile(mobile)) {
101 this.showLog("请输入正确的手机号码");
102 return
103 }
104 this.getAuthCode();
105 app.post({
106 url: app.api.mobileVerifyCode,
107 data: {
108 mobile: mobile,
109 forRegister: 1
110 }
111 }).then((result) => {
112 wx.showToast({
113 title: "短信发送成功",
114 icon: "none"
115 })
116 });
117 },
118 // 倒数
119 getAuthCode() {
120 let _this = this;
121 _this.setData({
122 sendAuthCode: false,
123 auth_time: 60
124 })
125 var auth_timetimer = setInterval(() => {
126 _this.setData({
127 auth_time: _this.data.auth_time - 1
128 })
129 if (_this.data.auth_time <= 0) {
130 _this.setData({
131 sendAuthCode: true
132 });
133 clearInterval(auth_timetimer)
134 }
135 }, 1000)
136 },
137
138 bindMobileInput(e) {
139 this.setData({
140 "mobile": e.detail.value
141 })
142 },
143 bindNameInput(e) {
144 this.setData({
145 "name": e.detail.value
146 })
147 },
148 bindBirthdayInput(e) {
149 this.setData({
150 "birthday": e.detail.value
151 })
152 },
153 bindVerifyCodeInput(e) {
154 this.setData({
155 "verifyCode": e.detail.value
156 })
157 },
158 bindBirthdayChange(e) {
159 this.setData({
160 birthday: e.detail.value
161 })
162 },
6 // 子组件事件 163 // 子组件事件
7 evtcomp(evt) { 164 evtcomp(evt) {
8 let { 165 let {
...@@ -11,7 +168,10 @@ Page({ ...@@ -11,7 +168,10 @@ Page({
11 } = evt.detail; 168 } = evt.detail;
12 switch (name) { 169 switch (name) {
13 170
14 case "_evt_hide": 171 case "_evt_hide_mask":
172 this.setData({
173 tipsRegisteredVisible: false
174 })
15 break; 175 break;
16 176
17 default: 177 default:
......