29013641 by simon

1

1 parent 2daada2a
...@@ -24,4 +24,6 @@ module.exports = { ...@@ -24,4 +24,6 @@ module.exports = {
24 }, 24 },
25 // 静态资源CDN 域名,配合CDN 功能实用,线上请确保在mp管理端已经注册域名 25 // 静态资源CDN 域名,配合CDN 功能实用,线上请确保在mp管理端已经注册域名
26 "assetsCDN": "https://kdcdn.oss-cn-shenzhen.aliyuncs.com" 26 "assetsCDN": "https://kdcdn.oss-cn-shenzhen.aliyuncs.com"
27 // "assetsCDN": "https://kd.cdn.xyiyang.com"
28
27 }; 29 };
......
...@@ -28,5 +28,9 @@ ...@@ -28,5 +28,9 @@
28 "scope.userLocation": { 28 "scope.userLocation": {
29 "desc": "你的位置信息将用显示附近门店" 29 "desc": "你的位置信息将用显示附近门店"
30 } 30 }
31 },
32 "usingComponents": {
33 "authorize-comp": "../../component/authorize-comp/authorize-comp",
34 "van-popup": "../../ui/vant-weapp/popup/index"
31 } 35 }
32 } 36 }
......
1 let app = getApp();
1 Component({ 2 Component({
2 properties: { 3 properties: {
3 // 这里定义了innerText属性,属性值可以在组件使用时指定 4 // 这里定义了innerText属性,属性值可以在组件使用时指定
...@@ -20,8 +21,30 @@ Component({ ...@@ -20,8 +21,30 @@ Component({
20 // 隐藏蒙层 21 // 隐藏蒙层
21 hideMask() { 22 hideMask() {
22 this.triggerEvent('evtcomp', { 23 this.triggerEvent('evtcomp', {
23 name: "_evt_hide_authorize" 24 name: "_evt_hide_mask"
24 }); 25 });
26 },
27 bindGetUserInfo(e) {
28 wx.showLoading();
29 this.getUserInfo(e.detail);
30 },
31 getUserInfo(e) {
32 let _this = this;
33 app.globalData.userInfo = e.userInfo;
34 console.log("before register : code = ", app.store.getItem("wxcode") )
35 app.post({
36 url: app.api.register,
37 sid: false,
38 data: {
39 encryptedData: e.encryptedData,
40 iv: e.iv,
41 code: app.store.getItem("wxcode"),
42 tlMemberCode: app.globalData.tlMemberCode
25 } 43 }
44 }).then((res2) => {
45 wx.hideLoading();
46 _this.hideMask();
47 }).catch((err) => {})
48 },
26 } 49 }
27 }) 50 })
......
1 .comp-item{ 1 @import '../../assets/scss/mixins';
2 @import '../../assets/scss/utils';
3
4
5 .comp-item {
6 font-weight: 300;
2 width: 557px; 7 width: 557px;
3 height: 505px; 8 height: 505px;
4 border-radius: 10px; 9 border-radius: 10px;
5 background-color: #ffffff; 10 background-color: #ffffff;
11
12 .cspace {
13 height: 24px;
14 }
15
16 .cont {
17 text-align: center;
18
19 .logo {
20 margin: 0 auto;
21 width: 200px;
22 height: 153px;
23
24 image {
25 width: 200px;
26 height: 153px;
27 }
28 }
29
30 .tips {
31 margin-top: 50px;
32 font-size: 32px;
33
34 color: #333333;
35
36 }
37 }
38
39 .btn {
40 @include cb(300px, 80px);
41 position: absolute;
42 left: 0;
43 right: 0;
44 bottom: 80px;
45 margin: 0 auto;
46 }
47
6 } 48 }
......
1 <view class="comp-item"> 1 <view class="comp-item">
2 2 <view class="cspace"></view>
3 <view class="cont">
4 <view class="logo">
5 <image mode="widthFix" src="../../image/logo.png" />
6 </view>
7 <view class="tips">参与活动需要您的微信授权哦</view>
8 </view>
9 <button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">确认授权</button>
3 </view> 10 </view>
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
32 32
33 .tips { 33 .tips {
34 margin-top: 32px; 34 margin-top: 32px;
35 // height: 210px;
36 color: #999999; 35 color: #999999;
37 font-size: 28px; 36 font-size: 28px;
38 @extend .bb; 37 @extend .bb;
...@@ -44,12 +43,10 @@ ...@@ -44,12 +43,10 @@
44 43
45 .btn { 44 .btn {
46 @include cb(234px, 64px); 45 @include cb(234px, 64px);
47 // position: relative;
48 position: absolute; 46 position: absolute;
49 left: 0; 47 left: 0;
50 right: 0; 48 right: 0;
51 bottom: 100px; 49 bottom: 100px;
52 margin: 0 auto; 50 margin: 0 auto;
53 // @include cb(300px, 80px);
54 } 51 }
55 } 52 }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 <view class="space1"></view> 4 <view class="space1"></view>
5 <view class="tit">· 太棒了 ·</view> 5 <view class="tit">· 太棒了 ·</view>
6 <view class="tips"> 6 <view class="tips">
7 共获得 7 领取
8 <span class="val">{{wishInfo.totalElasticValue}}</span> 8 <span class="val">{{wishInfo.totalElasticValue}}</span>
9 弹力值 9 弹力值
10 </view> 10 </view>
...@@ -22,6 +22,6 @@ ...@@ -22,6 +22,6 @@
22 </view> 22 </view>
23 </view> 23 </view>
24 <view class="btn-wrap"> 24 <view class="btn-wrap">
25 <view bindtap="toMyWishHandler" class="btn">立即查看</view> 25 <view bindtap="toMyWishHandler" class="btn">继续收集</view>
26 </view> 26 </view>
27 </view> 27 </view>
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
4 .comp-item { 4 .comp-item {
5 position: relative; 5 position: relative;
6 width: 654px; 6 width: 654px;
7 height: 666px; 7 height: 1093px;
8 8
9 // background-color: wheat; 9 // background-color: wheat;
10 .bg { 10 .bg {
11 position: absolute; 11 position: absolute;
12 width: 654px; 12 width: 654px;
13 height: 666px; 13 height: 1093px;
14 } 14 }
15 15
16 .space1 { 16 .space1 {
...@@ -18,19 +18,22 @@ ...@@ -18,19 +18,22 @@
18 } 18 }
19 19
20 .btn { 20 .btn {
21 position: relative;
22 margin: 0 auto;
23 @include cb(234px, 64px); 21 @include cb(234px, 64px);
22 position: absolute;
23 left: 0;
24 right: 0;
25 bottom: 100px;
26 margin: 0 auto;
24 } 27 }
25 28
26 .nickname{ 29 .nickname {
27 position: absolute; 30 position: absolute;
28 width: 100%; 31 width: 100%;
29 text-align: center; 32 text-align: center;
30 font-size: 40px; 33 font-size: 40px;
31 font-weight: 300; 34 font-weight: 300;
32 color: #ba3138; 35 color: #ba3138;
33 top: 152px; 36 top: 68px;
34 @include ellipsis(1); 37 @include ellipsis(1);
35 } 38 }
36 } 39 }
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
2 <image class="bg" src="../../image/oss/tips/tips-new.png" mode="widthFix" /> 2 <image class="bg" src="../../image/oss/tips/tips-new.png" mode="widthFix" />
3 <view class="nickname">{{userInfo.nickname}}</view> 3 <view class="nickname">{{userInfo.nickname}}</view>
4 <view class="space1"></view> 4 <view class="space1"></view>
5 <view bindtap="toQeustionHandler" class="btn">马上答题</view> 5 <view bindtap="toQeustionHandler" class="btn">马上参与</view>
6 </view> 6 </view>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
44 .stock1 { 44 .stock1 {
45 margin: 22px auto 0; 45 margin: 22px auto 0;
46 font-size: 24px; 46 font-size: 24px;
47 width: 410px; 47 width: 430px;
48 .tips { 48 .tips {
49 color: #333333; 49 color: #333333;
50 } 50 }
......
...@@ -14,12 +14,13 @@ ...@@ -14,12 +14,13 @@
14 </view> 14 </view>
15 <!-- 有库存 --> 15 <!-- 有库存 -->
16 <view wx:if="{{status == 1}}" class="stock stock1"> 16 <view wx:if="{{status == 1}}" class="stock stock1">
17 <view class="tips">您可选择直接邮寄到家,或到附近丸美柜台自提</view> 17 <!-- <view class="tips">您可选择直接邮寄到家,或到附近丸美柜台自提</view> -->
18 <view class="tips2">ps:选择之后不可修改哦!</view> 18 <view class="tips2">礼品可选邮寄到家或到丸美柜台自提噢~</view>
19 </view> 19 </view>
20 <!-- 无库存 --> 20 <!-- 无库存 -->
21 <view wx:else class="stock stock2"> 21 <view wx:else class="stock stock2">
22 <text class="tips">目前线上库存已不足\n需要女神亲自到丸美柜台领取哦!</text> 22 <!-- <text class="tips">目前线上库存已不足\n需要女神亲自到丸美柜台领取哦!</text> -->
23 <text class="tips2">目前线上库存已不足\n需要女神亲自到丸美柜台领取哦!</text>
23 </view> 24 </view>
24 </view> 25 </view>
25 <view class="btn-wrap"> 26 <view class="btn-wrap">
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
4 .comp-item { 4 .comp-item {
5 position: relative; 5 position: relative;
6 width: 654px; 6 width: 654px;
7 height: 645px; 7 height: 585px;
8 8
9 // background-color: wheat; 9 // background-color: wheat;
10 .bg { 10 .bg {
11 position: absolute; 11 position: absolute;
12 width: 654px; 12 width: 654px;
13 height: 645px; 13 height: 585px;
14 } 14 }
15 15
16 .space1 { 16 .space1 {
...@@ -18,9 +18,11 @@ ...@@ -18,9 +18,11 @@
18 } 18 }
19 19
20 .btn { 20 .btn {
21 position: relative;
22 margin: 0 auto;
23 // @include cb(300px, 80px);
24 @include cb(234px, 64px); 21 @include cb(234px, 64px);
22 position: absolute;
23 left: 0;
24 right: 0;
25 bottom: 100px;
26 margin: 0 auto;
25 } 27 }
26 } 28 }
......
...@@ -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 })
......
...@@ -18,9 +18,20 @@ ...@@ -18,9 +18,20 @@
18 } 18 }
19 19
20 .btn { 20 .btn {
21 position: relative;
22 margin: 0 auto;
23 // @include cb(300px, 80px);
24 @include cb(234px, 64px); 21 @include cb(234px, 64px);
22 position: absolute;
23 left: 0;
24 right: 0;
25 bottom: 100px;
26 margin: 0 auto;
27 }
28
29
30 .call{
31 width: 180px;
32 height: 40px;
33 position: absolute;
34 left: 380px;
35 top: 248px;
25 } 36 }
26 } 37 }
......
...@@ -2,4 +2,5 @@ ...@@ -2,4 +2,5 @@
2 <image class="bg" src="../../image/oss/tips/tips-register-ed.png" mode="widthFix" /> 2 <image class="bg" src="../../image/oss/tips/tips-register-ed.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>
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
4 .comp-item { 4 .comp-item {
5 position: relative; 5 position: relative;
6 width: 654px; 6 width: 654px;
7 height: 911px; 7 height: 1598px;
8 8
9 // background-color: wheat; 9 // background-color: wheat;
10 .bg { 10 .bg {
11 position: absolute; 11 position: absolute;
12 width: 654px; 12 width: 654px;
13 height: 911px; 13 height: 1598px;
14 } 14 }
15 15
16 .space1 { 16 .space1 {
...@@ -18,9 +18,12 @@ ...@@ -18,9 +18,12 @@
18 } 18 }
19 19
20 .btn { 20 .btn {
21 position: relative;
22 margin: 0 auto;
23 @include cb(300px, 80px);
24 // @include cb(234px, 64px); 21 // @include cb(234px, 64px);
22 @include cb(300px, 80px);
23 position: absolute;
24 left: 0;
25 right: 0;
26 bottom: 100px;
27 margin: 0 auto;
25 } 28 }
26 } 29 }
......
...@@ -3,9 +3,32 @@ let Store = require('./../utils/stroage'); ...@@ -3,9 +3,32 @@ let Store = require('./../utils/stroage');
3 let Router = require('./../router/index'); 3 let Router = require('./../router/index');
4 const errMsg = '服务异常,请稍后重试'; 4 const errMsg = '服务异常,请稍后重试';
5 5
6 let isWxLogin = false;
7
8 function wxLogin() {
9 return new Promise((resolve, reject) => {
10 if (isWxLogin) {
11 resolve();
12 } else {
13 wx.login({
14 success: function (res) {
15 isWxLogin = true;
16 Store.setItem('wxcode', res.code);
17 resolve();
18 }
19 });
20 }
21 });
22 }
23
24
6 // 检查并获取sessionid 25 // 检查并获取sessionid
7 function checkSessionId() { 26 function checkSessionId(sid) {
8 return new Promise((resolve, reject) => { 27 return new Promise((resolve, reject) => {
28 if (!sid) {
29 resolve();
30 return;
31 }
9 let sessionId = Store.getItem('sessionId'); 32 let sessionId = Store.getItem('sessionId');
10 if (sessionId) { 33 if (sessionId) {
11 resolve(); 34 resolve();
...@@ -20,17 +43,15 @@ function checkSessionId() { ...@@ -20,17 +43,15 @@ function checkSessionId() {
20 }); 43 });
21 } 44 }
22 45
23 // 重新登陆 46 // session丢失
24 function login() { 47 function login() {
25 return new Promise((resolve, reject) => { 48 return new Promise((resolve, reject) => {
26 wx.login({ 49 wxLogin().then((result) => {
27 success: function (res) {
28 Store.setItem('wxcode', res.code);
29 let baseUrl = config.NET_CONFIG.baseApi; 50 let baseUrl = config.NET_CONFIG.baseApi;
30 wx.request({ 51 wx.request({
31 url: baseUrl + '/warubiEyeCreamApi/app/login', 52 url: baseUrl + '/warubiEyeCreamApi/app/login',
32 data: { 53 data: {
33 code: res.code 54 code: Store.getItem('wxcode')
34 }, 55 },
35 method: 'POST', 56 method: 'POST',
36 success: function (res2) { 57 success: function (res2) {
...@@ -42,16 +63,25 @@ function login() { ...@@ -42,16 +63,25 @@ function login() {
42 Store.setItem('sessionId', content.sessionId); 63 Store.setItem('sessionId', content.sessionId);
43 resolve(); 64 resolve();
44 } else { 65 } else {
45 wx.showToast({ 66 wx.hideLoading();
46 title: errMsg, 67 let pages = getCurrentPages();
47 icon: 'none' 68 let view = pages[pages.length - 1];
69 if (view) {
70 try {
71 wx.login({
72 success: function (res) {
73 Store.setItem('wxcode', res.code);
74 view.showAuth();
75 }
48 }); 76 });
77 } catch (error) {}
78 }
49 reject(); 79 reject();
50 } 80 }
51 } 81 }
52 }) 82 })
53 } 83 })
54 }); 84
55 }); 85 });
56 } 86 }
57 87
...@@ -77,7 +107,7 @@ const fetch = function ({ ...@@ -77,7 +107,7 @@ const fetch = function ({
77 if (isMock && mode != 'log') { 107 if (isMock && mode != 'log') {
78 baseUrl = config.MOCKAPI; //环境配置 108 baseUrl = config.MOCKAPI; //环境配置
79 } 109 }
80 checkSessionId().then((result) => { 110 checkSessionId(sid).then((result) => {
81 wx.request({ 111 wx.request({
82 url: baseUrl + url, //请求地址 112 url: baseUrl + url, //请求地址
83 data: data, //自定义参数 113 data: data, //自定义参数
......

87 KB | W: | H:

89.5 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
...@@ -12,14 +12,22 @@ Page({ ...@@ -12,14 +12,22 @@ Page({
12 data: { 12 data: {
13 groupMemberCoopVisible: false, 13 groupMemberCoopVisible: false,
14 tipsCommonVisible: false, 14 tipsCommonVisible: false,
15 authorizeVisible: false,
15 tipsInnerText: "", 16 tipsInnerText: "",
16 options: null, 17 options: null,
17 wishInfo: {}, 18 wishInfo: {},
18 wishList: [], 19 wishList: [],
19 coopInfo: {}, 20 coopInfo: {},
21 userInfo: {},
20 canShake: true, 22 canShake: true,
23 status: 0,
21 }, 24 },
22 onShareAppMessage() {}, 25 onShareAppMessage() {},
26 showAuth() {
27 this.setData({
28 authorizeVisible: true
29 })
30 },
23 onLoad(options) { 31 onLoad(options) {
24 this.setData({ 32 this.setData({
25 options 33 options
...@@ -30,6 +38,9 @@ Page({ ...@@ -30,6 +38,9 @@ Page({
30 }, 38 },
31 initData() { 39 initData() {
32 app.queryIndex().then((result) => { 40 app.queryIndex().then((result) => {
41 this.setData({
42 userInfo: app.globalData.userInfo
43 })
33 // 判断是否需要授权 44 // 判断是否需要授权
34 if (result.isNeedAuth == 1) { 45 if (result.isNeedAuth == 1) {
35 app.router.push({ 46 app.router.push({
...@@ -70,9 +81,6 @@ Page({ ...@@ -70,9 +81,6 @@ Page({
70 }, 81 },
71 // 助力 82 // 助力
72 queryWishbillAssist() { 83 queryWishbillAssist() {
73 // this.setData({
74 // canShake: false
75 // })
76 app.post({ 84 app.post({
77 url: app.api.wishbillAssist, 85 url: app.api.wishbillAssist,
78 data: { 86 data: {
...@@ -128,9 +136,9 @@ Page({ ...@@ -128,9 +136,9 @@ Page({
128 billCode: this.data.options.code 136 billCode: this.data.options.code
129 } 137 }
130 }).then((result) => { 138 }).then((result) => {
131 let isAssist = result.isAssist; 139 let status = result.isAssist;
132 this.setData({ 140 this.setData({
133 isAssist 141 status
134 }) 142 })
135 let wishList = result.wishGifts; 143 let wishList = result.wishGifts;
136 wishList.forEach(element => { 144 wishList.forEach(element => {
...@@ -157,6 +165,7 @@ Page({ ...@@ -157,6 +165,7 @@ Page({
157 this.setData({ 165 this.setData({
158 groupMemberCoopVisible: false, 166 groupMemberCoopVisible: false,
159 tipsCommonVisible: false, 167 tipsCommonVisible: false,
168 authorizeVisible: false,
160 }) 169 })
161 }, 170 },
162 // 子组件事件 171 // 子组件事件
......
...@@ -154,10 +154,43 @@ ...@@ -154,10 +154,43 @@
154 154
155 position: relative; 155 position: relative;
156 156
157 .portrait-wrap {
158 position: relative;
159 width: 400px;
160 height: 100px;
161 margin: 20px auto 0;
162 display: flex;
163 justify-content: space-between;
164
165 .connect {
166 position: absolute;
167 left: 0;
168 right: 0;
169 top: 0;
170 bottom: 0;
171 margin: auto;
172 width: 290px;
173 height: 54px;
174 }
175
176 .portrait {
177 position: relative;
178 width: 100px;
179 height: 100px;
180
181 image {
182 width: 100px;
183 height: 100px;
184 border-radius: 50px;
185 }
186 }
187 }
188
157 .user { 189 .user {
158 height: 150px; 190 height: 150px;
159 display: flex; 191 display: flex;
160 align-items: center; 192 align-items: center;
193 justify-content: space-between;
161 padding: 0 98px; 194 padding: 0 98px;
162 @extend .bb; 195 @extend .bb;
163 196
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 <view class="content"> 9 <view class="content">
10 <!-- 摇一摇 --> 10 <!-- 摇一摇 -->
11 <!-- bindtap="queryWishbillAssist" --> 11 <!-- bindtap="queryWishbillAssist" -->
12 <view wx:if="{{coopInfo.isAssist != 1}}" class="shake"> 12 <view wx:if="{{status != 1}}" class="shake">
13 <image class="ebg" mode="widthFix" src="../../image/oss/coop/coop-c2.png" /> 13 <image class="ebg" mode="widthFix" src="../../image/oss/coop/coop-c2.png" />
14 <view class="space1"></view> 14 <view class="space1"></view>
15 <view class="cont"> 15 <view class="cont">
...@@ -31,14 +31,23 @@ ...@@ -31,14 +31,23 @@
31 <image class="ebg" mode="widthFix" src="../../image/oss/coop/coop-c3.png" /> 31 <image class="ebg" mode="widthFix" src="../../image/oss/coop/coop-c3.png" />
32 <view class="space1"></view> 32 <view class="space1"></view>
33 <view class="cont"> 33 <view class="cont">
34 <view class="user"> 34 <!-- <view class="user">
35 <image class="portrait" mode="widthFix" src="{{wishInfo.member.avatar}}" /> 35 <image class="portrait" mode="widthFix" src="{{wishInfo.member.avatar}}" />
36 <view class="nickname"> 36 <view class="nickname">
37 你的好友{{wishInfo.member.nickname}}的心愿单需要你的帮助哦!拿起手机摇一摇,即可为ta贡献弹力值! 37 你的好友{{wishInfo.member.nickname}}的心愿单需要你的帮助哦!拿起手机摇一摇,即可为ta贡献弹力值!
38 </view> 38 </view>
39 </view> -->
40 <view class="portrait-wrap">
41 <image class="connect" mode="widthFix" src="../../image/oss/coop/coop-c4.png" />
42 <view class="portrait">
43 <image mode="widthFix" src="{{userInfo.avatar}}" />
44 </view>
45 <view class="portrait">
46 <image mode="widthFix" src="{{wishInfo.member.avatar}}" />
47 </view>
39 </view> 48 </view>
40 <view class="tips2"> 49 <view class="tips2">
41 <text class="t1">太厉害了\n您总共摇出了{{coopInfo.totalElasticValue}}弹力值</text> 50 <text class="t1">太厉害了\n您总共摇出了{{wishInfo.totalElasticValue}}弹力值</text>
42 </view> 51 </view>
43 <!-- 奖品 --> 52 <!-- 奖品 -->
44 <view class="wish"> 53 <view class="wish">
...@@ -73,7 +82,9 @@ ...@@ -73,7 +82,9 @@
73 <van-popup show="{{ groupMemberCoopVisible }}"> 82 <van-popup show="{{ groupMemberCoopVisible }}">
74 <tips-group-member-coop-comp bind:evtcomp="evtcomp"></tips-group-member-coop-comp> 83 <tips-group-member-coop-comp bind:evtcomp="evtcomp"></tips-group-member-coop-comp>
75 </van-popup> 84 </van-popup>
76
77 <van-popup show="{{ tipsCommonVisible }}"> 85 <van-popup show="{{ tipsCommonVisible }}">
78 <tips-common-comp bind:evtcomp="evtcomp" inner-text="{{tipsInnerText}}"></tips-common-comp> 86 <tips-common-comp bind:evtcomp="evtcomp" inner-text="{{tipsInnerText}}"></tips-common-comp>
79 </van-popup> 87 </van-popup>
88 <van-popup show="{{ authorizeVisible }}">
89 <authorize-comp bind:evtcomp="evtcomp"></authorize-comp>
90 </van-popup>
......
...@@ -53,7 +53,6 @@ Page({ ...@@ -53,7 +53,6 @@ Page({
53 userInfo: app.globalData.userInfo 53 userInfo: app.globalData.userInfo
54 }) 54 })
55 this.queryWishbillPrizeCandidate(); 55 this.queryWishbillPrizeCandidate();
56 this.queryWishbillDetail();
57 }); 56 });
58 this.initShake(); 57 this.initShake();
59 }, 58 },
......
...@@ -3,23 +3,35 @@ Page({ ...@@ -3,23 +3,35 @@ Page({
3 data: { 3 data: {
4 canIUse: wx.canIUse('button.open-type.getUserInfo'), 4 canIUse: wx.canIUse('button.open-type.getUserInfo'),
5 tipsRuleVisible: false, 5 tipsRuleVisible: false,
6 authorizeVisible: false,
6 indexInfo: {} 7 indexInfo: {}
7 }, 8 },
8 onShareAppMessage() {}, 9 onShareAppMessage() {},
10 showAuth() {
11 this.setData({
12 authorizeVisible: true
13 })
14 },
9 onLoad(options) { 15 onLoad(options) {
10 this.initData(); 16 // this.initData();
11 }, 17 },
12 initData() { 18 initData() {
19 // app.queryIndex({
20 // auth: false
21 // }).then((result) => {
22 // this.setData({
23 // indexInfo: app.globalData.indexInfo
24 // })
25 // })
26 },
27 // 开始互动游戏 判断是否会员
28 onStartHandler() {
13 app.queryIndex({ 29 app.queryIndex({
14 auth: false 30 auth: false
15 }).then((result) => { 31 }).then((result) => {
16 this.setData({ 32 this.setData({
17 indexInfo: app.globalData.indexInfo 33 indexInfo: app.globalData.indexInfo
18 }) 34 })
19 })
20 },
21 // 开始互动游戏 判断是否会员
22 onStartHandler() {
23 let { 35 let {
24 wishBillCode 36 wishBillCode
25 } = app.globalData.indexInfo; 37 } = app.globalData.indexInfo;
...@@ -30,6 +42,9 @@ Page({ ...@@ -30,6 +42,9 @@ Page({
30 app.router.push({ 42 app.router.push({
31 path: path 43 path: path
32 }) 44 })
45 })
46
47
33 }, 48 },
34 // 显示规则页面 49 // 显示规则页面
35 onShowRuleHandler() { 50 onShowRuleHandler() {
...@@ -37,6 +52,13 @@ Page({ ...@@ -37,6 +52,13 @@ Page({
37 tipsRuleVisible: true 52 tipsRuleVisible: true
38 }) 53 })
39 }, 54 },
55 hideMask() {
56 this.setData({
57 tipsRuleVisible: false,
58 authorizeVisible: false,
59 })
60 },
61
40 // 子组件事件 62 // 子组件事件
41 evtcomp(evt) { 63 evtcomp(evt) {
42 let { 64 let {
...@@ -46,9 +68,7 @@ Page({ ...@@ -46,9 +68,7 @@ Page({
46 switch (name) { 68 switch (name) {
47 69
48 case "_evt_hide_mask": 70 case "_evt_hide_mask":
49 this.setData({ 71 this.hideMask();
50 tipsRuleVisible: false
51 })
52 break; 72 break;
53 73
54 default: 74 default:
......
1 { 1 {
2 "navigationBarTitleText": "我的心愿单", 2 "navigationBarTitleText": "我的心愿单",
3 "usingComponents": { 3 "usingComponents": {
4 "authorize-comp": "../../component/authorize-comp/authorize-comp",
5 "tips-rule-comp": "../../component/tips-rule-comp/tips-rule-comp", 4 "tips-rule-comp": "../../component/tips-rule-comp/tips-rule-comp",
6 "van-popup": "../../ui/vant-weapp/popup/index" 5 "van-popup": "../../ui/vant-weapp/popup/index"
7 } 6 }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 <image class="d1" src="../../image/oss/index/index-c4.png" mode="widthFix" /> 9 <image class="d1" src="../../image/oss/index/index-c4.png" mode="widthFix" />
10 <image class="d2" src="../../image/oss/index/index-c3.png" mode="widthFix" /> 10 <image class="d2" src="../../image/oss/index/index-c3.png" mode="widthFix" />
11 </view> 11 </view>
12 <view class="app__content main"> 12 <view class="app__content main" >
13 <view class="top-space"></view> 13 <view class="top-space"></view>
14 <view class="content"> 14 <view class="content">
15 <!-- 已授权 直接到下一步操作 --> 15 <!-- 已授权 直接到下一步操作 -->
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
27 </view> 27 </view>
28 </view> 28 </view>
29 </view> 29 </view>
30 <!-- <van-popup show="{{ authorizeVisible }}" > 30 <van-popup show="{{ authorizeVisible }}" >
31 <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> 31 <authorize-comp bind:evtcomp="evtcomp"></authorize-comp>
32 </van-popup> --> 32 </van-popup>
33 <van-popup show="{{ tipsRuleVisible }}"> 33 <van-popup show="{{ tipsRuleVisible }}" bind:click-overlay="hideMask">
34 <tips-rule-comp bind:evtcomp="evtcomp"></tips-rule-comp> 34 <tips-rule-comp bind:evtcomp="evtcomp"></tips-rule-comp>
35 </van-popup> 35 </van-popup>
......
...@@ -198,7 +198,8 @@ Page({ ...@@ -198,7 +198,8 @@ Page({
198 fontSize: 26, 198 fontSize: 26,
199 lineNum: 3, 199 lineNum: 3,
200 baseLine: 'middle', 200 baseLine: 'middle',
201 text: `${userInfo.nickname}正在参加丸美眼霜节心愿单活动,需要你的倾情相助!`, 201 // text: `${userInfo.nickname}正在参加丸美眼霜节心愿单活动,需要你的倾情相助!`,
202 text: `我正在参加丸美集弹力值领心愿礼,需要你的倾情相助!`,
202 color: '#666666', 203 color: '#666666',
203 zIndex: 111 204 zIndex: 111
204 }]; 205 }];
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
83 83
84 .right { 84 .right {
85 color: #ffffff; 85 color: #ffffff;
86 background-color: #32ba32; 86 background-color: #b83138;
87 border: none; 87 border: none;
88 } 88 }
89 89
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
41 <view class="score">{{questionResult.elasticValue}}</view> 41 <view class="score">{{questionResult.elasticValue}}</view>
42 <view class="t1">弹力值</view> 42 <view class="t1">弹力值</view>
43 </view> 43 </view>
44 <view class="tips">还凭您的盛世美颜获得更多惊喜</view> 44 <view class="tips">到店购物即可使用,绝不要错过噢~</view>
45 <view class="coupon"> 45 <view class="coupon">
46 <view wx:for="{{questionResult.coupons}}" wx:key="{{index}}" class="coupon-item {{item.type==4?'coupon-item2':''}}"> 46 <view wx:for="{{questionResult.coupons}}" wx:key="{{index}}" class="coupon-item {{item.type==4?'coupon-item2':''}}">
47 <image wx:if="{{item.type==4}}" class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-2.png" /> 47 <image wx:if="{{item.type==4}}" class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-2.png" />
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
55 </view> 55 </view>
56 </view> 56 </view>
57 </view> 57 </view>
58 <view bindtap="onCreateWishHandler" class="create-wish-btn">创建心愿单</view> 58 <view bindtap="onCreateWishHandler" class="create-wish-btn">马上创建心愿单</view>
59 </view> 59 </view>
60 </view> 60 </view>
61 </view> 61 </view>
......
1 let Date = require('../../utils/date.js'); 1 let Date = require('../../utils/date.js');
2 let Utils = require('../../utils/util.js'); 2 let Utils = require('../../utils/util.js');
3 3
4
4 let app = getApp(); 5 let app = getApp();
5 Page({ 6 Page({
6 data: { 7 data: {
8 windowWidth: 0,
7 tipsInnerText: "", 9 tipsInnerText: "",
8 redirect: "createWish", // 注册完的重定向页面 10 redirect: "createWish", // 注册完的重定向页面
9 tipsRegisteredVisible: false, 11 tipsRegisteredVisible: false,
...@@ -26,12 +28,21 @@ Page({ ...@@ -26,12 +28,21 @@ Page({
26 ], 28 ],
27 isTerms: false, 29 isTerms: false,
28 // form end 30 // form end
31 thumbX: 44,
32 thumbXTarget: 350, // 正确的指数
33 thumbXFixed: 20, // 运行的误差
34 movableViewX: 0, // 滑块的值
35 isPlzAuth: false, //滑块验证
29 auth_time: 0, 36 auth_time: 0,
30 sendAuthCode: true, 37 sendAuthCode: true,
31 /*布尔值,通过v-show控制显示‘获取按钮’还是‘倒计时’ */ 38 /*布尔值,通过v-show控制显示‘获取按钮’还是‘倒计时’ */
32 }, 39 },
33 onShareAppMessage() {}, 40 onShareAppMessage() {},
34 onLoad(options) { 41 onLoad(options) {
42 let windowWidth = wx.getSystemInfoSync().windowWidth;
43 this.setData({
44 windowWidth
45 })
35 let { 46 let {
36 redirect 47 redirect
37 } = options; 48 } = options;
...@@ -40,6 +51,7 @@ Page({ ...@@ -40,6 +51,7 @@ Page({
40 redirect 51 redirect
41 }) 52 })
42 } 53 }
54
43 this.initData(); 55 this.initData();
44 }, 56 },
45 initData() {}, 57 initData() {},
...@@ -67,17 +79,18 @@ Page({ ...@@ -67,17 +79,18 @@ Page({
67 }).then((result) => { 79 }).then((result) => {
68 if (result.status == 1) { 80 if (result.status == 1) {
69 wx.showModal({ 81 wx.showModal({
70 title: "登陆成功", 82 title: "注册成功",
71 content: "继续生成我的心愿单", 83 content: "请登录您的账号",
72 confirmText: "马上前往", 84 confirmText: "马上前往",
73 showCancel: false, 85 showCancel: false,
74 success(res) { 86 success(res) {
75 app.router.push({ 87 _this.toLoginHandler();
76 openType: "redirectTo",
77 path: _this.data.redirect
78 })
79 } 88 }
80 }) 89 })
90 } else if (result.status == 2) {
91 this.setData({
92 tipsRegisteredVisible: true,
93 })
81 } else { 94 } else {
82 this.setData({ 95 this.setData({
83 tipsInnerText: result.errMsg, 96 tipsInnerText: result.errMsg,
...@@ -111,6 +124,9 @@ Page({ ...@@ -111,6 +124,9 @@ Page({
111 } else if (this.data.sex != 0 && this.data.sex != 1) { 124 } else if (this.data.sex != 0 && this.data.sex != 1) {
112 this.showLog("请选择性别"); 125 this.showLog("请选择性别");
113 reject(); 126 reject();
127 } else if (!this.data.isPlzAuth) {
128 this.showLog("请完成拼图验证");
129 reject();
114 } else if (!this.data.isTerms) { 130 } else if (!this.data.isTerms) {
115 this.showLog("请同意服务条款"); 131 this.showLog("请同意服务条款");
116 reject(); 132 reject();
...@@ -178,6 +194,36 @@ Page({ ...@@ -178,6 +194,36 @@ Page({
178 }, 1000) 194 }, 1000)
179 }, 195 },
180 196
197 // 监听滑动变量
198 onThumbChangeHandler(e) {
199 let thumbX = e.detail.x * 750 / this.data.windowWidth + 44;
200 this.setData({
201 thumbX: thumbX,
202 })
203 },
204
205 // 滑动停止
206 onTouchEndHandler(e) {
207 let {
208 thumbX,
209 thumbXTarget,
210 thumbXFixed
211 } = this.data;
212 let result = Math.abs(thumbXTarget - thumbX);
213 if (result < thumbXFixed) {
214 this.showLog("验证成功")
215 this.setData({
216 isPlzAuth: true
217 })
218 } else {
219 this.showLog("验证失败")
220 }
221 this.setData({
222 thumbX: 44,
223 movableViewX: 0,
224 })
225 },
226
181 bindMobileInput(e) { 227 bindMobileInput(e) {
182 this.setData({ 228 this.setData({
183 "mobile": e.detail.value 229 "mobile": e.detail.value
...@@ -212,7 +258,6 @@ Page({ ...@@ -212,7 +258,6 @@ Page({
212 this.setData({ 258 this.setData({
213 sex: e.detail.value 259 sex: e.detail.value
214 }) 260 })
215 console.log("sex:", this.data.sex);
216 }, 261 },
217 262
218 // 子组件事件 263 // 子组件事件
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
5 $formWidth:560px; 5 $formWidth:560px;
6 6
7 .page { 7 .page {
8 padding-bottom: $pageBottom;
9
8 .bgc { 10 .bgc {
9 background-color: #fff2ef; 11 background-color: #fff2ef;
10 } 12 }
...@@ -97,23 +99,79 @@ $formWidth:560px; ...@@ -97,23 +99,79 @@ $formWidth:560px;
97 border: solid 1px #db9a9d; 99 border: solid 1px #db9a9d;
98 100
99 .plz { 101 .plz {
102 position: relative;
100 @include border-top-radius($borderRadius); 103 @include border-top-radius($borderRadius);
101 width: $formWidth; 104 width: $formWidth;
102 height: 183px; 105 height: 183px;
103 106
104 image { 107 .ebg {
105 @include border-top-radius($borderRadius); 108 @include border-top-radius($borderRadius);
106 width: $formWidth; 109 width: $formWidth;
107 height: 183px; 110 height: 183px;
108 } 111 }
112
113 .block {
114 position: absolute;
115 width: 83px;
116 height: 83px;
117 top: 41px;
118 z-index: 11;
119 }
120
121 .shadow {
122 left: 348px;
123 }
124
125 .thumb {
126
127 left: 44px;
109 } 128 }
129 }
130
131
110 132
111 .slider { 133 .slider {
134 position: relative;
112 width: 560px; 135 width: 560px;
113 height: 70px; 136 height: 70px;
114 border-top: solid 1px #db9a9d; 137 border-top: solid 1px #db9a9d;
115 background-color: #ffffff; 138 background-color: #ffffff;
116 @include border-bottom-radius($borderRadius); 139 @include border-bottom-radius($borderRadius);
140
141 &-bar {
142 position: relative;
143 width: 410px;
144 padding: 0 45px;
145 height: 48px;
146 border-radius: 24px;
147 background-color: #fff0ed;
148 margin: 12px auto 0;
149
150 .tips {
151 width: 410px;
152 height: 48px;
153 line-height: 48px;
154 font-size: 24px;
155 color: #b83138;
156
157 }
158 .tips-wait {
159 text-align: right;
160 padding-left: 16px;
161 // @extend .bb;
162 }
163
164 .tips-authorized {
165 text-align: center;
166 }
167
168 &-thumb {
169 width: 109px;
170 height: 80px;
171 position: absolute;
172 top: -12px;
173 }
174 }
117 } 175 }
118 } 176 }
119 177
......
...@@ -60,12 +60,25 @@ ...@@ -60,12 +60,25 @@
60 </radio-group> 60 </radio-group>
61 </view> 61 </view>
62 <!-- 滑动拼图 --> 62 <!-- 滑动拼图 -->
63 <!-- <view class="puzzle"> 63 <view class="puzzle">
64 <!-- <view class="plz" bindtouchstart="onTouchStartHandler" bindtouchmove='onTouchMoveHandler' bindtouchend='onTouchEndHandler'> -->
64 <view class="plz"> 65 <view class="plz">
65 <image src="../../image/oss/register/plz-cont.png" mode="widthFix" /> 66 <image class="ebg" src="../../image/oss/register/plz-cont.png" mode="widthFix" />
67 <block wx:if="{{!isPlzAuth}}">
68 <image class="block shadow" mode="widthFix" src="../../image/oss/register/plz-block.png?ver=1" />
69 <image style="left:{{thumbX}}rpx;" class="block thumb" mode="widthFix" src="../../image/oss/register/plz-block-inline.png?ver=1" />
70 </block>
71 </view>
72 <view class="slider">
73 <movable-area class="slider-bar">
74 <view wx:if="{{!isPlzAuth}}" class="tips tips-wait">拖动左侧滑块,完成上方拼图验证</view>
75 <view wx:else class="tips tips-authorized">验证成功</view>
76 <movable-view wx:if="{{!isPlzAuth}}" x="{{movableViewX}}" bindchange="onThumbChangeHandler" direction="horizontal">
77 <image bindtouchend="onTouchEndHandler" class="slider-bar-thumb" mode="widthFix" src="../../image/oss/register/slider-block.png" />
78 </movable-view>
79 </movable-area>
80 </view>
66 </view> 81 </view>
67 <view class="slider"></view>
68 </view> -->
69 <!-- 条款/政策 --> 82 <!-- 条款/政策 -->
70 <view class="policy"> 83 <view class="policy">
71 <span bindtap="onTermsHandler" class="check"> 84 <span bindtap="onTermsHandler" class="check">
......
...@@ -12,7 +12,7 @@ Page({ ...@@ -12,7 +12,7 @@ Page({
12 data: { 12 data: {
13 isOverShare: true, //自定义分享 13 isOverShare: true, //自定义分享
14 tipsRuleVisible: false, 14 tipsRuleVisible: false,
15 tipsPirzeVisible: false, 15 tipsPirzeVisible: true,
16 userInfo: {}, 16 userInfo: {},
17 wishInfo: {}, 17 wishInfo: {},
18 wishList: [], 18 wishList: [],
......
...@@ -56,9 +56,9 @@ ...@@ -56,9 +56,9 @@
56 <view class="coop"> 56 <view class="coop">
57 <view class="tit">· 我的弹力帮帮团 ·</view> 57 <view class="tit">· 我的弹力帮帮团 ·</view>
58 <view class="tips"> 58 <view class="tips">
59 积累 59
60 <span class="t1">{{helperInfo.total}}</span> 60 <span class="t1">{{helperInfo.total}}</span>
61 人助力,获得 61 位好友帮忙,收集到
62 <span class="t1">{{helperInfo.totalElasticValue}}</span> 62 <span class="t1">{{helperInfo.totalElasticValue}}</span>
63 弹力值! 63 弹力值!
64 </view> 64 </view>
......
...@@ -82,11 +82,16 @@ function getLastScreenHeight(useHeight = 0, unit = 'rpx') { ...@@ -82,11 +82,16 @@ function getLastScreenHeight(useHeight = 0, unit = 'rpx') {
82 * px转rpx 82 * px转rpx
83 * @param {*} value 83 * @param {*} value
84 */ 84 */
85 function pxToRpx(value) { 85 function px2rpx(value) {
86 let sysInfo = wx.getSystemInfoSync(); 86 return value * 750 / wx.getSystemInfoSync().windowWidth;
87 let clientWidth = sysInfo.windowWidth; 87 }
88 let result = value / 750 * clientWidth 88
89 return result; 89 /**
90 * rpx转px
91 * @param {*} value
92 */
93 function rpx2px(value) {
94 return value / 750 * wx.getSystemInfoSync().windowWidth;
90 } 95 }
91 96
92 97
...@@ -265,7 +270,8 @@ module.exports = { ...@@ -265,7 +270,8 @@ module.exports = {
265 debounce: debounce, 270 debounce: debounce,
266 throttle: throttle, 271 throttle: throttle,
267 param2Obj: param2Obj, 272 param2Obj: param2Obj,
268 pxToRpx: pxToRpx, 273 px2rpx: px2rpx,
274 rpx2px: rpx2px,
269 formatWeek: formatWeek, 275 formatWeek: formatWeek,
270 getBindtapData: getBindtapData, 276 getBindtapData: getBindtapData,
271 wxacodeGet: wxacodeGet, 277 wxacodeGet: wxacodeGet,
......