Authored by bevishuang

签到抽奖优化

... ... @@ -222,6 +222,7 @@ Page({
app = app || getApp();
let params = {
position: this.data.luckPosition,
// uid: "600046506"
};
return clockModel.getBrandPicInfos(params).then(res => {
... ... @@ -315,17 +316,18 @@ Page({
isUnderway: true
});
// 签到之前再次查询是否已经签到过,防止登录接口延迟出现多次签到情况
return this.clockLoginEvent().then(res => {
awardPicInfos = res.data.awardPicInfos;
if (util.get(res, 'data.isSign', 'N') === 'Y') {
return {
code: 401,
data: {},
message: '今天已经签到过啦,明天再来!'
};
}
return getUserLocation();
}).then(lres => {
// return this.clockLoginEvent().then(res => {
// awardPicInfos = res.data.awardPicInfos;
// if (util.get(res, 'data.isSign', 'N') === 'Y') {
// return {
// code: 401,
// data: {},
// message: '今天已经签到过啦,明天再来!'
// };
// }
// return getUserLocation();
// })
return getUserLocation().then(lres => {
//请求问题,此处提示,可以提示未中奖
if (lres.code !== 200) {
return this._showToast(lres);
... ... @@ -334,6 +336,7 @@ Page({
return clockModel.signAward({
longitude: lres.data.longitude,
latitude: lres.data.latitude,
// uid: "600046506"
}).then(sres => {
//执行提示,是否中奖
if (sres.code !== 200) {
... ...
... ... @@ -13,7 +13,7 @@
<view class="overflow-hidden-block-start">
<image mode="widthFix" wx:if="{{item.path}}" src="{{helper.imgView(item.path, 100, 100)}}"></image>
</view>
<my-login-page bindloginSuccessCallback="clockLoginEvent"></my-login-page>
<my-login bindloginSuccessCallback="clockAreaTap"></my-login>
<button wx:if="{{hasLocationSetting}}" class="form-sub" formType="submit" type="default" hover-class="none"></button>
<button wx:else class="form-sub" type='default' hover-class='none' bindtap='openMsg'></button>
</view>
... ... @@ -61,11 +61,11 @@
<image mode="widthFix" src="{{helper.image(userPrize.picPath, 180, 180)}}"></image>
</view>
<!-- </view> -->
<text class="clock-result-p1 ellipsis">{{userPrize.name}}</text>
<view class="clock-result-p2">奖品已经放入您的账户</view>
<text class="clock-result-p1 ellipsis" >{{userPrize.name}}</text>
<view class="clock-result-p2" wx:if="{{userPrize.type !== 4}}">奖品已经放入您的账户</view>
</view>
<navigator url="/pages/home/index" open-type="switchTab" hover-class="none" class="clock-result-go">去看看</navigator>
<navigator url="/pages/home/index" open-type="switchTab" hover-class="none" class="clock-result-go" wx:if="{{userPrize.type === 2}}">去看看</navigator>
</view>
</view>
</block>
... ...
... ... @@ -187,7 +187,7 @@ page {
height: 180rpx;
line-height: 180rpx;
/* background-color: #e5e5e5; */
border-radius: 50%;
/* border-radius: 50%; */
overflow: hidden;
display: inline-block;
}
... ...