Commit 47367233 authored by wangxuelai's avatar wangxuelai

'闯关打卡新建关卡时添加关卡'

parent b9f49751
......@@ -240,7 +240,8 @@ Page({
radioList: [
],
radioname: '',
confirmId: 0
confirmId: 0,
// has_subjects_count: 0
},
onLoad: function(options) { // Do some initialize when page load.
const that = this;
......@@ -355,7 +356,6 @@ Page({
this.setData({
subjecSort: bigArr,
})
console.log(bigArr, 'bigArr');
},
onReady: function() { // Do something when page ready.
......@@ -1966,6 +1966,9 @@ Page({
if (value > 199) {
value = 199;
}
if (value == 0) {
value = 1;
}
this.setData({
copySubjectCount: Number(value)
})
......@@ -1984,6 +1987,13 @@ Page({
},
sureChangePsd () {
const lockSubjects = this.data.lockSubjects;
if (this.data.copySubjectCount == 0) {
wx.showToast({
title: '关卡数不能为0',
icon: 'none'
})
return;
}
if (this.data.copySubjectCount >= this.data.lockparams.subject_count) {
for (let i = 0; i < this.data.copySubjectCount - this.data.lockparams.subject_count; i++) {
lockSubjects.push({
......@@ -2044,7 +2054,9 @@ Page({
const { item, index, } = e.currentTarget.dataset;
const sort = this.data.currentSortIndex * 10 + index + 1;
let addSort = 0; // 是否是新增的主题
if (this.id > 0 && sort > this.lockparams.subject_count) {
console.log(this.data.lockparams.has_subjects_count, 'this.data.lastSubjectCount');
console.log(sort, 'sort');
if (this.data.tid > 0 && sort > this.data.lockparams.has_subjects_count) {
addSort = 1;
}
wx.navigateTo({
......@@ -2361,7 +2373,9 @@ Page({
push_status: data.push_status,
push_time: data.push_time,
sign_up_status: data.sign_up_status,
has_subjects_count: data.has_subjects_count,
},
lastSubjectCount: Number(data.subject_count),
radioname: data.sign_up_content ? data.sign_up_content.radioname : '',
radioList: data.sign_up_content ? data.sign_up_content.radioList : '',
lockSubjects: lockSubjects,
......
......@@ -321,7 +321,6 @@
</view>
</view>
<view class="locksubjectlist">
<!-- <view class="locksubjectitem" wx:for="{{lockSubjects.slice(currentSortIndex * 10,currentSortIndex * 10 + 10)}}" wx:key="index"> -->
<view class="locksubjectitem" wx:for="{{lockSubjectLists}}" wx:key="index" data-item="{{item}}" data-index="{{index}}" bindtap="goModifyClockSubject">
<view class="topbox">
<view class="sorttitle">第{{currentSortIndex * 10 + index + 1}}关</view>
......@@ -340,8 +339,8 @@
<view class="modal-dialog" wx:if="{{changesubjectCountInputShow}}">
<view class="modal-mask"></view>
<view class="modal-box">
<input type="number" placeholder="请输入闯关打卡关卡总数" value="{{copySubjectCount}}" bindinput="subjectCountInput" />
<view>
<input type="number" placeholder="请输入闯关打卡关卡总数" class="inputPsd" value="{{copySubjectCount}}" bindinput="subjectCountInput" />
<view class="modal-btn-box">
<view class="modal-btn" bindtap="hideChangePsd">关闭</view>
<view class="modal-btn" bindtap="sureChangePsd">确定</view>
</view>
......
......@@ -961,4 +961,39 @@ page{
justify-content: center;
margin: 0 auto;
margin-top: 46rpx;
}
.modal-btn-box {
display: flex;
align-items: center;
}
.modal-dialog .modal-box .modal-btn{
width: 100%;
height: 100rpx;
display: flex;
flex: 1;
align-items: center;
justify-content: center;
border-top: 1px solid rgba(0,0,0,.05);
font-size: 30rpx;
color: #434343;
font-weight: bold;
}
.modal-dialog .modal-box .inputPsd {
width: 420rpx;
height: 78rpx;
border-radius: 38rpx;
background:rgba(238,238,237,1);
display: block;
margin: 80rpx auto;
text-align: center;
padding: 0 30rpx;
}
.modal-dialog .modal-box .modal-btn:first-child {
border-right: 1px solid rgba(0,0,0,.05);
}
.modal-dialog .modal-box .modal-btn:last-child {
color: #65B8F4;
}
.borderbottom1px {
border-bottom: 1px solid #F1F2F3;
}
\ No newline at end of file
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