Commit 7d45ae9f authored by 汪欢's avatar 汪欢

3

parent 9fe2e482
......@@ -51,19 +51,18 @@ Component({
// }
// })
this.props.onUserCredit();
// this.props.onUserCredit();
}else{
console.log('fail')
// 错误码判断不同情况
if(res.code === '500000'){
commonToast(res.message);
}
// console.log('fail')
}
})
// console.log('succ',success)
// if(success){
// console.log('success');
// }else{
// console.log('failed')
// }
// success
this.onOrderNowModalClose();
......
......@@ -34,6 +34,8 @@ Page({
userCredits: '',
// 总楼层
totalFloor: '',
// 单人最多购买楼层
eachBuyMostFloor:'',
countDown: '',
ruleModalVisible: false,
......@@ -134,8 +136,8 @@ Page({
},
// 加楼层
addFloor() {
let { canBuyFloor } = this.data;
if (canBuyFloor < 100) {
let { canBuyFloor,eachBuyMostFloor } = this.data;
if (canBuyFloor < eachBuyMostFloor) {
this.setData({
canBuyFloor: canBuyFloor + 1
})
......@@ -211,6 +213,7 @@ Page({
let totalFloor = data.totalFloor;
let end = data.endTime;
let start = data.startTime;
let eachBuyMostFloor = data.eachBuyMostFloor;
// startTime = data.startTime;
// endingTime = data.endTime;
......@@ -231,7 +234,8 @@ Page({
prizeList: list,
start: start,
end: end,
totalFloor
totalFloor,
eachBuyMostFloor
})
} else {
console.log('返回失败')
......
......@@ -121,6 +121,20 @@
position: absolute;
overflow-y: auto;
}
.jie_shu_ye .zhong_jiang_ming_dan .zhong_jiang_zhuang_tai .yi_zhong_jiang .no_prize{
width: 458rpx;
height: 320rpx;
top:20rpx;
left: 10rpx;
opacity: 1;
position: absolute;
text-align: center;
}
/*
*/
.jie_shu_ye .zhong_jiang_ming_dan .zhong_jiang_zhuang_tai .yi_zhong_jiang .dixxx_ceng68 {
width: 84rpx;
height: 23rpx;
......
......@@ -52,7 +52,7 @@
<label class="ba_la_kao_bei4">巴***拉</label> -->
<!-- 有中奖用户 -->
<view style="position:absolute" a:for="{{prizeMenu}}" a:key="idx" a:for-item="prizeItem" >
<view style="position:absolute" a:if="{{prizeMenu != null}}" a:for="{{prizeMenu}}" a:key="idx" a:for-item="prizeItem" >
<view style="height:40rpx;position:absolute">
<label style="{{prizeItem.prizestyle.prizefloor}}">第{{prizeItem.floor}}层</label>
<label style="{{prizeItem.prizestyle.prizeuser}}">{{prizeItem.username}}</label>
......@@ -60,6 +60,8 @@
</view>
</view>
<view class="no_prize">无中奖名单</view>
</view>
<!-- <view class="wei_zhong_jiang">
<label class="zong_lou_ceng_bu_zu_wu_ren_zhong_jiang">总楼层不足,无人中奖</label>
......
......@@ -120,54 +120,62 @@ Page({
async getPrizeMenu(){
let {data} = await API.getFloorPrize() || {};
console.log(data,'prizemenu')
// 用户名单处理
let floorPrize = data;
var personMenuArr = [];
for(let i=0; i<floorPrize.length;i++){
let userName = floorPrize[i].userNick ;
console.log(userName,'userName');
if(userName.length >=2){
console.log(userName.length);
let length = userName.length;
let f = userName.toString().substr(0,1);
// console.log('f',f);
let last = userName.toString().substr(length -1,1)
// console.log('last',last)
userName = f + "***" + last;
// console.log('22222',userName)
}
floorPrize[i].username = userName;
let prizeStyle = {
prizefloor: {
left: 0,
top: 40 * i + 'rpx',
position: 'absolute',
color: 'white'
},
prizeuser: {
left: 200 + 'rpx',
top: 40 * i + 'rpx',
position: 'absolute',
color: 'white'
},
prizeimage: {
left: 400 + 'rpx',
position: 'absolute',
verticalAlign:'middle',
top: 40 * i + 10 + 'rpx',
color: 'white',
width:40 + 'rpx',
height: 30 + 'rpx'
if(data != null){
// 用户名单处理
let floorPrize = data;
var personMenuArr = [];
for(let i=0; i<floorPrize.length;i++){
let userName = floorPrize[i].userNick ;
console.log(userName,'userName');
if(userName.length >=2){
console.log(userName.length);
let length = userName.length;
let f = userName.toString().substr(0,1);
// console.log('f',f);
let last = userName.toString().substr(length -1,1)
// console.log('last',last)
userName = f + "***" + last;
// console.log('22222',userName)
}
floorPrize[i].username = userName;
let prizeStyle = {
prizefloor: {
left: 0,
top: 40 * i + 'rpx',
position: 'absolute',
color: 'white'
},
prizeuser: {
left: 200 + 'rpx',
top: 40 * i + 'rpx',
position: 'absolute',
color: 'white'
},
prizeimage: {
left: 400 + 'rpx',
position: 'absolute',
verticalAlign:'middle',
top: 40 * i + 10 + 'rpx',
color: 'white',
width:40 + 'rpx',
height: 30 + 'rpx'
}
}
floorPrize[i].prizestyle = prizeStyle;
}
floorPrize[i].prizestyle = prizeStyle;
console.log(floorPrize,'arr')
this.setData({
prizeMenu: floorPrize
})
} else {
// 无中奖
this.setData({
prizeMenu:null
})
}
console.log(floorPrize,'arr')
this.setData({
prizeMenu: floorPrize
})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment