Commit 5d06f584 authored by wangxuelai's avatar wangxuelai

''

parent b7ac71bb
......@@ -529,6 +529,15 @@
"pages": [
"index"
]
},
{
"root": "business/pages/themeeditorlock",
"name": "businessthemeeditorlock",
"pages": [
"index",
"courses",
"subjecteditor"
]
}
],
"preloadRule": {
......
......@@ -81,12 +81,16 @@ button::after{
padding-right: 10rpx;
}
.self-radio {
width: 28rpx;
height: 28rpx;
border-width: 3rpx;
box-sizing: content-box;
width: 12px;
height: 12px;
border-width: 1px;
border-style: solid;
border-radius: 50%;
position: relative;
/* display: flex;
align-items: center;
justify-content: center; */
}
.self-radio.not-selected {
border-color:rgba(0,0,0,0.4);
......@@ -95,18 +99,18 @@ button::after{
border-color: #65B8F4;
}
.self-radio.selected::after {
width:16rpx;
height:16rpx;
width:8px;
height:8px;
background-color: #65B8F4;
content: '';
display: block;
border-radius: 50%;
position: absolute;
/* position: absolute;
left: 4rpx;
top: 4rpx;
top: 4rpx; */
/* transform: translate(-8rpx, -8rpx); */
/* margin-left: -8rpx;
margin-top: -8rpx; */
margin-left: 2px;
margin-top: 2px;
}
.border-b-1px {
border-bottom: 1rpx solid rgba(0,0,0,0.05);
......
/*
time: 2019-05-20
author: wxl
*/
import {
unlockSubjectShow,
unlockSubjectList
} from '../../../service/business/themeindex.js';
var app = getApp();
Page({
data: {
maxLength: 500,
maxImgCount: 9,
maxVideoCount: 9,
maxAudioCount: 600,
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/',
id: 0,
tid: 0,
sid: 0,
submiting: false,
step: 1,
subjectCount: 0,
subjectArr: [],
selectedTheme: {}
},
onLoad: function(options) { // Do some initialize when page load.
this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器
const {
id,
tid,
sid
} = options;
this.setData({
id,
tid,
sid: sid || ''
});
if(tid != 0){
wx.setNavigationBarTitle({
title: '编辑解锁打卡'
})
}
wx.hideShareMenu();
this.unlockSubjectShow()
},
onReady: function() { // Do something when page ready.
},
unlockSubjectShow () {
wx.showLoading({
title: '数据加载中...'
});
unlockSubjectShow ({
id: this.data.tid
}).then((res) => {
const {code, data} = res;
if(code == 200) {
wx.hideLoading();
this.setData({
subjectCount: data.subject_count
})
this.unlockSubjectList();
}
}).catch(() => {
wx.showToast({
icon: 'none',
title: '内容加载失败'
})
})
},
unlockSubjectList () {
unlockSubjectList({
id: this.data.tid
}).then((res) => {
const {code, data} = res;
if (code == 200) {
this.getSubjectArr(data.list, this.data.subjectCount)
// this.getSubjectArr(data.subject_count);
}
console.log(res, 'resresresresresresresres');
})
},
getSubjectArr (subjectList, subjectCount) {
let subjectArr = []
if (subjectList.length == 0) {
for (let i = 0; i < subjectCount; i++) {
subjectArr.push({
sort: i + 1,
id: 0
})
}
} else {
for (let i = 0; i < subjectCount; i++) {
for (let j = 0, _length = subjectList.length; j < _length; j++) {
if (subjectList[j].sort == i + 1) {
subjectArr.push(subjectList[j])
// continue;
} else {
subjectArr.push({
sort: i + 1,
id: 0
})
break;
// continue;
}
}
}
}
this.setData({
subjectArr
})
console.log(this.data.subjectArr, 'subjectArr');
},
themeSelect (e) {
const {dataset} = e.currentTarget;
this.setData({
selectedTheme: dataset.subject
})
}
})
\ No newline at end of file
{
"navigationBarTitleText": "新建解锁打卡",
"usingComponents": {
"w-switch": "/dist/w-switch/index"
}
}
\ No newline at end of file
<view class="container">
<view class="stepbox" hover-class="none" hover-stop-propagation="false">
<view class="stepitem active" hover-class="none" hover-stop-propagation="false">
<view class="stepimgbox" hover-class="none" hover-stop-propagation="false">
<image class="stepimg" src="{{localImageRoot}}2b/themeeditor/stepactiveb.png" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
</view>
<view class="steptext" hover-class="none" hover-stop-propagation="false">创建解锁打卡</view>
<view class="stepdotbox stepdotboxright" hover-class="none" hover-stop-propagation="false">
<view class="stepdot stepdota" hover-class="none" hover-stop-propagation="false"></view>
<view class="stepdot stepdotb" hover-class="none" hover-stop-propagation="false"></view>
<view class="stepdot stepdotc" hover-class="none" hover-stop-propagation="false"></view>
</view>
</view>
<view class="stepitem center active" hover-class="none" hover-stop-propagation="false">
<view class="stepdotbox stepdotboxleft" hover-class="none" hover-stop-propagation="false">
<view class="stepdot stepdotd" hover-class="none" hover-stop-propagation="false"></view>
<view class="stepdot stepdote" hover-class="none" hover-stop-propagation="false"></view>
<view class="stepdot stepdotf" hover-class="none" hover-stop-propagation="false"></view>
</view>
<view class="stepimgbox" hover-class="none" hover-stop-propagation="false">
<image class="stepimg" src="{{localImageRoot}}2b/themeeditor/stepactiveb.png" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
</view>
<view class="steptext" hover-class="none" hover-stop-propagation="false">解锁规则设置</view>
<view class="stepdotbox stepdotboxright" hover-class="none" hover-stop-propagation="false">
<view class="stepdot stepdota" hover-class="none" hover-stop-propagation="false"></view>
<view class="stepdot stepdotb" hover-class="none" hover-stop-propagation="false"></view>
<view class="stepdot stepdotc" hover-class="none" hover-stop-propagation="false"></view>
</view>
</view>
<view class="stepitem active" hover-class="none" hover-stop-propagation="false">
<view class="stepdotbox stepdotboxleft" hover-class="none" hover-stop-propagation="false">
<view class="stepdot stepdotd" hover-class="none" hover-stop-propagation="false"></view>
<view class="stepdot stepdote" hover-class="none" hover-stop-propagation="false"></view>
<view class="stepdot stepdotf" hover-class="none" hover-stop-propagation="false"></view>
</view>
<view class="stepimgbox" hover-class="none" hover-stop-propagation="false">
<image class="stepimg" src="{{localImageRoot}}2b/themeeditor/stepactive.png" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
</view>
<view class="steptext" hover-class="none" hover-stop-propagation="false">主题内容设置</view>
</view>
</view>
<view class="themelock-editor-container" hover-class="none" hover-stop-propagation="false">
<view class="common-editor-box" hover-class="none" hover-stop-propagation="false">
<view class="box-title" hover-class="none" hover-stop-propagation="false">
<text class="main-title" selectable="false" space="false" decode="false">课时内容设置</text>
</view>
<view class="scroll-box" hover-class="none" hover-stop-propagation="false">
<scroll-view class="subjects-box" scroll-x="{{true}}" style="width: auto;overflow:hidden;" hover-class="none" hover-stop-propagation="false">
<view class="subjectitem {{selectedTheme.sort == item.sort ? 'selected' : ''}}" hover-class="none" hover-stop-propagation="false" wx:for="{{subjectArr}}" wx:key="{{index}}" data-subject="{{item}}" bindtap="themeSelect">{{item.sort}}</view>
<!-- <view class="subjectitem selected " hover-class="none" hover-stop-propagation="false">1</view>
<view class="subjectitem hascontent" hover-class="none" hover-stop-propagation="false">1</view> -->
</scroll-view>
</view>
</view>
<view class="detail-empty-content" hover-class="none" hover-stop-propagation="false">
<image class="edit-icon" src="{{localImageRoot}}2b/themeeditor/editicon.png" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
<text class="" selectable="false" space="false" decode="false">新建课时内容</text>
</view>
</view>
</view>
\ No newline at end of file
@import '../../../style/editor.wxss';
.container {
min-height: 100vh;
background-color: #F7F7F9;
border-bottom: 1rpx solid #F7F7F9;
}
.themelock-editor-container {
padding: 0 24rpx;
background-color: #fff;
border-bottom: 1rpx solid transparent;
}
.stepbox {
display: flex;
align-items: center;
justify-content: center;
background-color: #fff;
padding: 86rpx 0 88rpx 0;
}
.stepitem {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
position: relative;
width: 180rpx;
}
.stepitem.center {
/* margin: 0 30rpx; */
}
.stepitem .stepimgbox {
width: 68rpx;
height: 68rpx;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20rpx;
}
.stepitem .stepimg {
display: block;
width: 62rpx;
height: 62rpx;
}
.stepitem.active .stepimg {
display: block;
width: 68rpx;
height: 68rpx;
}
.stepitem .steptext {
color: #ACACAC;
font-size: 22rpx;
line-height: 24rpx;
}
.stepitem.active .steptext {
color: #65CEFF;
font-size: 24rpx;
font-weight: 700;
}
.stepdotbox {
display: flex;
align-items: center;
justify-content: center;
}
.stepdotbox.stepdotboxleft {
position: absolute;
left: 0rpx;
top: 32rpx;
}
.stepdotbox.stepdotboxright {
position: absolute;
right: 0rpx;
top: 32rpx;
}
.stepdot {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background-color:#65CEFF;
margin: 0 4rpx;
}
.stepdot.stepdota {
opacity: 0.05;
}
.stepdot.stepdotb {
opacity:0.1;
}
.stepdot.stepdotc {
opacity:0.2;
}
.stepdot.stepdotd {
opacity:0.4;
}
.stepdot.stepdote {
opacity:0.6;
}
.stepdot.stepdotf {
}
.common-editor-box {
margin-bottom: 54rpx;
}
.circle-name-box {
position: relative;
background-color: #fff;
}
.circle-name-box .circle-name {
background-color: rgba(248, 248, 248, 1);
border-radius: 8rpx;
width: 100%;
padding: 16rpx 6rpx 19rpx 15rpx;
height: 110rpx;
font-size: 28rpx;
/* margin-top: 20rpx; */
line-height: 39rpx;
font-size: 26rpx;
}
.circle-name-box .length-rate {
position: absolute;
right: 6rpx;
bottom: 13rpx;
color: rgba(0, 0, 0, 0.3);
font-size: 26rpx;
}
.common-editor-box .box-title {
margin-bottom: 40rpx;
}
.main-title {
font-size: 30rpx;
color: #000000;
font-weight: 700;
line-height: 1;
}
.pb50 {
padding-bottom: 50rpx;
}
.mb50 {
margin-bottom: 50rpx;
}
.subjects-box {
width: auto;
}
.subjectitem {
box-sizing: content-box;
width: 80rpx;
height: 80rpx;
border: 2rpx solid rgba(203,203,203,1);
border-radius: 50%;
text-align: center;
font-size: 17px;
line-height: 80rpx;
text-align: center;
color: #959595;
display: inline-block;
margin-right: 30rpx;
}
.subjectitem.selected {
border-color: #75BFF5;
background-color: #65B8F4;
color: #fff;
}
.subjectitem.hascontent {
color: #75BFF5;
border-color: #75BFF5;
}
.scroll-box {
width: auto;
white-space: nowrap;
overflow: hidden;
/* margin-bottom: 54rpx; */
}
.detail-empty-content {
height: 260rpx;
border: 2rpx dashed rgba(203,203,203,1);
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.detail-empty-content .edit-icon {
width: 28rpx;
height: 30rpx;
display: block;
margin-right: 24rpx;
}
.detail-empty-content text {
color: #65B8F4;
font-size: 28rpx;
}
\ No newline at end of file
/*
time: 2019-05-20
author: wxl
*/
import {
getDateInfo
} from '../../../utilities/index.js';
import {
unlockSubjectShow
} from '../../../service/business/themeindex.js';
var app = getApp();
import {
unlockSubjectEditor
} from '../../../service/business/themeeditor.js';
Page({
data: {
maxLength: 500,
maxImgCount: 9,
maxVideoCount: 9,
maxAudioCount: 600,
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/',
id: 0,
tid: 0,
sid: 0,
submiting: false,
step: 1,
params: {
school_id: 0,
class_id: 0,
title: '',
subject_count: 1,
max_clock_count: 1,
join_rule_type: 1,
password: '',
unlock_limit: 1,
unlock_rule_type: 1,
clock_start_time: '00:00',
clock_end_time: '23:59',
push_status: 2,
push_time: '18:00'
}
},
onLoad: function(options) { // Do some initialize when page load.
this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器
const {
id,
tid,
clone,
sid
} = options;
this.setData({
id,
tid,
clone: clone || '',
sid: sid || '',
'params.school_id': sid || '',
'params.class_id': id
});
if(tid != 0){
wx.setNavigationBarTitle({
title: '编辑解锁打卡'
})
}
this.unlockSubjectShow();
wx.hideShareMenu();
},
onReady: function() { // Do something when page ready.
},
unlockSubjectShow () {
if (this.data.tid == 0) {
return
}
wx.showLoading({
title: '数据加载中...'
});
unlockSubjectShow ({
id: this.data.tid
}).then((res) => {
const {code, data} = res;
if(code == 200) {
wx.hideLoading();
this.setData({
params: {
school_id: data.school_id,
class_id: data.class_id,
title: data.title,
subject_count: data.subject_count,
max_clock_count: data.max_clock_count,
join_rule_type: data.join_rule_type,
password: data.password,
unlock_limit: data.unlock_limit,
unlock_rule_type: data.unlock_rule_type,
clock_start_time: data.clock_start_time,
clock_end_time: data.clock_end_time,
push_status: data.push_status,
push_time: data.push_time,
}
})
}
}).catch(() => {
wx.showToast({
icon: 'none',
title: '内容加载失败'
})
})
},
stepback () {
wx.pageScrollTo({
scrollTop: 0,
duration: 0
})
this.setData({
step: 1
})
},
titleInput(e) {
const {
value
} = e.detail;
this.setData({
'params.title': value.length > 20 ? value.substr(0, 20) : value
})
},
subjectCountInput (e) {
const {
value
} = e.detail;
this.setData({
'params.subject_count': value
})
},
psdChange (e) {
const {
value
} = e.detail;
this.setData({
'params.password': Number(value)
})
},
maxClockCountInput (e) {
const {
value
} = e.detail;
this.setData({
'params.max_clock_count': value
})
},
joinRuleChange (e) {
const {dataset} = e.currentTarget;
this.setData({
'params.join_rule_type': Number(dataset.type)
})
},
unlockRuleTypeChange (e) {
const {dataset} = e.currentTarget;
this.setData({
'params.unlock_rule_type': Number(dataset.type)
})
},
unlockLimitChange (e) {
const {
value
} = e.detail;
this.setData({
'params.unlock_limit': value
})
},
dayStimeChange(e) {
const {
value
} = e.detail;
const defineStartDate = (new Date(`2018/02/02 ${value}`)).getTime();
const defineEndDate = (new Date(`2018/02/02 ${this.data.params.clock_end_time}`)).getTime();
if (defineStartDate >= defineEndDate) {
let startTimeStamp = defineEndDate - 60 * 1000;
let dateInfo = getDateInfo(Math.floor(startTimeStamp / 1000));
let hour = dateInfo.hours < 10 ? `0${dateInfo.hours}` : dateInfo.hours;
let minute = dateInfo.minutes < 10 ? `0${dateInfo.minutes}` : dateInfo.minutes;
this.setData({
'params.clock_start_time': `${hour}:${minute}`,
})
} else {
this.setData({
'params.clock_start_time': value,
})
}
},
dayEtimeChange(e) {
const {
value
} = e.detail;
const defineStartDate = (new Date(`2018/02/02 ${this.data.params.clock_start_time}`)).getTime();
const defineEndDate = (new Date(`2018/02/02 ${value}`)).getTime();
if (defineStartDate >= defineEndDate) {
let endTimeStamp = defineStartDate + 60 * 1000;
let dateInfo = getDateInfo(Math.floor(endTimeStamp / 1000));
let hour = dateInfo.hours < 10 ? `0${dateInfo.hours}` : dateInfo.hours;
let minute = dateInfo.minutes < 10 ? `0${dateInfo.minutes}` : dateInfo.minutes;
this.setData({
'params.clock_end_time': `${hour}:${minute}`,
})
} else {
this.setData({
'params.clock_end_time': value,
})
}
},
remindswitch() {
if (Number(this.data.params.push_status) == 2) {
this.setData({
'params.push_status': 1
})
} else if (Number(this.data.params.push_status) == 1) {
this.setData({
'params.push_status': 2
})
}
},
tipTimeChange(e){
const {
value
} = e.detail;
this.setData({
'params.push_time': value,
})
},
nextStep () {
const that = this;
if (this.data.params.title.trim() == '') {
wx.showToast({
title: '请输入主题标题',
duration: 1500,
icon: 'none',
})
return;
}
if (this.data.params.subject_count < 1) {
wx.showToast({
title: '课长不能小于1课时',
duration: 1500,
icon: 'none',
})
return;
}
if (this.data.params.max_clock_count < 1) {
wx.showToast({
title: '每课时打卡次数不能小于1次',
duration: 1500,
icon: 'none',
})
return;
}
if (this.data.params.join_rule_type == 2 && !/^\d{6}$/.test(that.data.params.password)) {
wx.showToast({
title: '请输入6位数字的密码',
duration: 1500,
icon: 'none',
})
return;
}
wx.pageScrollTo({
scrollTop: 0,
duration: 0
})
this.setData({
step: 2
})
},
saveLock () {
const that = this;
if (this.data.params.unlock_limit < 1) {
wx.showToast({
title: '每日可解锁次数必须大于1次',
duration: 1500,
icon: 'none',
})
return;
}
wx.showLoading('保存中...');
unlockSubjectEditor ({
tid: this.data.clone == 'clone' ? 0 : this.data.tid,
data: this.data.params
}).then((res) => {
const {code, data} = res;
if (res.code == 200) {
wx.showToast({
title: '保存成功'
})
wx.navigateTo({
url: `/business/pages/themeeditorlock/courses?id=${this.data.id}&sid=${this.data.sid}&tid=${data.id}`,
success () {
that.setData({
step: 1
})
}
})
}
}).catch(() => {
wx.hideLoading();
})
}
})
\ No newline at end of file
{
"navigationBarTitleText": "新建解锁打卡",
"usingComponents": {
"w-switch": "/dist/w-switch/index"
}
}
\ No newline at end of file
This diff is collapsed.
@import '../../../style/editor.wxss';
.container {
min-height: 100vh;
background-color: #F7F7F9;
border-bottom: 1rpx solid #F7F7F9;
}
.themelock-editor-container {
padding: 0 24rpx;
background-color: #fff;
/* border-bottom: 1rpx solid transparent; */
}
.stepbox {
display: flex;
align-items: center;
justify-content: center;
background-color: #fff;
padding: 86rpx 0 88rpx 0;
}
.stepitem {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
position: relative;
width: 180rpx;
}
.stepitem.center {
/* margin: 0 30rpx; */
}
.stepitem .stepimgbox {
width: 68rpx;
height: 68rpx;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20rpx;
}
.stepitem .stepimg {
display: block;
width: 62rpx;
height: 62rpx;
}
.stepitem.active .stepimg {
display: block;
width: 68rpx;
height: 68rpx;
}
.stepitem .steptext {
color: #ACACAC;
font-size: 22rpx;
line-height: 24rpx;
}
.stepitem.active .steptext {
color: #65CEFF;
font-size: 24rpx;
font-weight: 700;
}
.stepdotbox {
display: flex;
align-items: center;
justify-content: center;
}
.stepdotbox.stepdotboxleft {
position: absolute;
left: 0rpx;
top: 32rpx;
}
.stepdotbox.stepdotboxright {
position: absolute;
right: 0rpx;
top: 32rpx;
}
.stepdot {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background-color:#65CEFF;
margin: 0 4rpx;
}
.stepdot.stepdota {
opacity: 0.05;
}
.stepdot.stepdotb {
opacity:0.1;
}
.stepdot.stepdotc {
opacity:0.2;
}
.stepdot.stepdotd {
opacity:0.4;
}
.stepdot.stepdote {
opacity:0.6;
}
.stepdot.stepdotf {
}
.common-editor-box {
padding: 0;
}
.circle-name-box {
position: relative;
background-color: #fff;
}
.circle-name-box .circle-name {
background-color: rgba(248, 248, 248, 1);
border-radius: 8rpx;
width: 100%;
padding: 16rpx 6rpx 19rpx 15rpx;
height: 110rpx;
font-size: 28rpx;
/* margin-top: 20rpx; */
line-height: 39rpx;
font-size: 26rpx;
}
.circle-name-box .length-rate {
position: absolute;
right: 6rpx;
bottom: 13rpx;
color: rgba(0, 0, 0, 0.3);
font-size: 26rpx;
}
.common-editor-box .box-title {
margin-bottom: 40rpx;
}
.main-title {
font-size: 30rpx;
color: #000000;
font-weight: 700;
line-height: 1;
}
.editplaceholder {
color: #878787;
font-size: 26rpx;
line-height: 39rpx;
}
.pb50 {
padding-bottom: 50rpx;
}
.mb50 {
margin-bottom: 50rpx;
}
.editinputbox {
display: flex;
align-items: center;
}
.editinputbox text {
color: #000000;
font-size: 26rpx;
}
.editinputbox .editinput {
margin: 0 30rpx;
width: 118rpx;
height: 60rpx;
line-height: 60rpx;
background-color: rgba(248,248,248,1);
border-radius: 8rpx;
border: none;
/* padding: 0 10rpx; */
font-size: 26rpx;
color: #878787;
text-align: center;
}
.self-radio-line {
display: flex;
align-items: center;
}
.self-radio-line:first-child {
margin-bottom: 36rpx;
}
.radio-name {
padding-left: 14rpx;
}
.self-radio-box .editinputbox {
padding-left: 40rpx;
margin-top: 20rpx;
}
.self-radio-box .editinputbox .lefttext{
color: #7D7D7D;
font-size: 26rpx;
}
.self-radio-box .editinputbox .editinput {
width: 244rpx;
text-align: left;
padding-left: 16rpx;
padding-right: 10rpx;
}
.self-radio-box .editinputbox .righttext{
color: #ADADAD;
font-size: 24rpx;
}
.submitbtn {
box-sizing: content-box;
text-align: center;
line-height: 80rpx;
font-size: 38rpx;
color: #fff;
font-weight: 700;
letter-spacing: 2rpx;
background-color: #65B8F4;
border-radius: 40rpx;
/* display: inline-block; */
/* padding: 0 70rpx; */
width: 256rpx;
margin: 86rpx auto 166rpx;
}
.submitbtn.save {
width: 350rpx;
}
.content-time-box {
display: flex;
line-height: 1;
font-size: 22rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(0, 0, 0, 1);
}
.time {
padding-bottom: 20rpx;
font-size: 26rpx;
width: 190rpx;
text-align: center;
border-bottom: 1px solid rgba(130, 142, 156, 0.4);
/* padding-bottom: 20rpx; */
color: rgba(101, 184, 244, 1);
position: relative;
}
.zhi {
color: #000;
font-size: 22rpx;
padding: 0 26rpx;
}
.time picker {
/* line-height: 40rpx; */
font-size: 26rpx;
}
.arrowdown {
width: 10rpx;
height: 18rpx;
display: block;
position: absolute;
right: 10rpx;
top: 8rpx;
transform: rotate(90deg);
}
.clockalarm .time {
padding-bottom: 14rpx;
margin: 0 45rpx 0 19rpx;
}
.stepback {
color: rgba(101, 184, 244, 1);
font-size: 26rpx;
display: inline-block;
padding: 24rpx 0 0 24rpx;
}
\ No newline at end of file
This diff is collapsed.
{
"navigationBarTitleText": "新建作业打卡",
"usingComponents": {
"sjd-media-editor": "../../../components/sjdmediaeditor",
"sound-recording": "../../../components/soundrecording",
"w-switch": "/dist/w-switch/index",
"w-button": "/dist/w-button/index",
"w-cell": "/dist/w-cell/index",
"w-cell-group": "/dist/w-cell-group/index",
"w-pane": "/dist/w-pane/index"
}
}
\ No newline at end of file
<view class="container">
<view class="theme-editor-container clearfix {{showWarn ? 'opacitybody' : ''}}">
<view class="broadcast-box clearfix mb24" hover-class="none" hover-stop-propagation="false">
<image class="broadcast-img" src="{{imageRoot}}2b/shopeditor/voiceicon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="">
</image>
<text class="broadcast-text" selectable="false" space="false" decode="false">主题发布后老师带头打卡,可提高学员参与积极性至3倍。</text>
</view>
<view class="common-editor-box mb24" hover-class="none" hover-stop-propagation="false">
<view class="box-title" hover-class="none" hover-stop-propagation="false">
<text class="main-title" selectable="false" space="false" decode="false">课时标题</text>
</view>
<view class="circle-name-box" hover-class="none" hover-stop-propagation="false">
<textarea class="circle-name" name="" id="" bindinput="titleInput" value="{{params.title}}" placeholder="请输入作业主题。如:拍摄一段诗歌朗诵视频"></textarea>
<text class="length-rate" selectable="false" space="false" decode="false">{{params.title.length}}/20</text>
</view>
</view>
<view class="common-editor-box mb24 time-editor-box pd0" hover-class="none" hover-stop-propagation="false">
<view class="box-title clearfix" hover-class="none" hover-stop-propagation="false">
<view class="main-title-box" hover-class="none" hover-stop-propagation="false">
<text class="main-title" selectable="false" space="false" decode="false">学员作业要求</text>
<text class="tips-title" selectable="false" space="false" decode="false">(选填)</text>
</view>
</view>
<view class="box-title box-title-mode timeset-title-box tips-timeset" hover-class="none" hover-stop-propagation="false">
<view class="main-title-box" hover-class="none" hover-stop-propagation="false">
<text class="main-title" selectable="false" space="false" decode="false">文字字数要求</text>
<text class="tips-title" selectable="false" space="false" decode="false">(最多{{maxLength}}字)</text>
</view>
<w-switch slot="content" value="{{ params.text_require_status }}" color="#65B8F4" size="small" bind:onChange="textswitch" />
</view>
<view class="time-ipt-box" hover-class="none" hover-stop-propagation="false" wx-if="{{params.text_require_status == 1}}">
学员打卡最少
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="30" value="{{params.text_require_num}}" bindinput="textInput" placeholder=""></input>个文字
</view>
<view class="box-title box-title-mode timeset-title-box tips-timeset" hover-class="none" hover-stop-propagation="false">
<view class="main-title-box" hover-class="none" hover-stop-propagation="false">
<text class="main-title" selectable="false" space="false" decode="false">图片个数要求</text>
<text class="tips-title" selectable="false" space="false" decode="false">(最多{{maxImgCount}}张)</text>
</view>
<w-switch slot="content" value="{{ params.image_require_status }}" color="#65B8F4" size="small" bind:onChange="imageswitch" />
</view>
<view class="time-ipt-box" hover-class="none" hover-stop-propagation="false" wx-if="{{params.image_require_status == 1 }}">
学员打卡最少
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="30" value="{{params.image_require_num}}" bindinput="imageInput" placeholder=""></input>张图片
</view>
<view class="box-title box-title-mode timeset-title-box tips-timeset" hover-class="none" hover-stop-propagation="false">
<view class="main-title-box" hover-class="none" hover-stop-propagation="false">
<text class="main-title" selectable="false" space="false" decode="false">录音时长要求</text>
<text class="tips-title" selectable="false" space="false" decode="false">(最多{{maxAudioCount}}秒)</text>
</view>
<w-switch slot="content" value="{{ params.audio_require_status}}" color="#65B8F4" size="small" bind:onChange="audioswitch" />
</view>
<view class="time-ipt-box" hover-class="none" hover-stop-propagation="false" wx-if="{{params.audio_require_status == 1}}">
学员打卡最少
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="30" value="{{params.audio_require_num}}" bindinput="audioInput" placeholder=""></input>秒录音
</view>
<view class="box-title box-title-mode timeset-title-box tips-timeset" hover-class="none" hover-stop-propagation="false">
<view class="main-title-box" hover-class="none" hover-stop-propagation="false">
<text class="main-title" selectable="false" space="false" decode="false">视频个数要求</text>
<text class="tips-title" selectable="false" space="false" decode="false">(最多{{maxVideoCount}}个)</text>
</view>
<w-switch slot="content" value="{{ params.video_require_status }}" color="#65B8F4" size="small" bind:onChange="videoswitch" />
</view>
<view class="time-ipt-box" hover-class="none" hover-stop-propagation="false" wx-if="{{params.video_require_status == 1}}">
学员打卡最少
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="30" value="{{params.video_require_num}}" bindinput="videoInput" placeholder=""></input>个视频
</view>
</view>
<view class="common-editor-box self-editor-box mb24 pd0" hover-class="none" hover-stop-propagation="false">
<view class="box-title clearfix" hover-class="none" hover-stop-propagation="false">
<view class="main-title-box" hover-class="none" hover-stop-propagation="false">
<text class="main-title" selectable="false" space="false" decode="false">打卡要求</text>
<text class="tips-title" selectable="false" space="false" decode="false">(选填)</text>
</view>
</view>
<view class="box-title box-title-mode" hover-class="none" hover-stop-propagation="false">
<view class="main-title-box" hover-class="none" hover-stop-propagation="false">
<text class="main-title" selectable="false" space="false" decode="false">强制阅读模式</text>
</view>
<w-switch slot="content" value="{{ params.force_status }}" color="#65B8F4" size="small" bind:onChange="readswitch" />
</view>
<view class="time-ipt-box" hover-class="none" hover-stop-propagation="false" wx-if="{{params.force_status == 1}}">
强制阅读
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="30" value="{{params.force_num}}" bindinput="readtimeInput" placeholder=""></input>分钟
</view>
</view>
<view class="common-editor-box mb24 " hover-class="none" hover-stop-propagation="false">
<view class="box-title" hover-class="none" hover-stop-propagation="false">
<text class="main-title" selectable="false" space="false" decode="false">添加内容</text>
</view>
<sjd-media-editor content="{{params.content}}" id="sjd-media-editor" sid="{{sid}}" bind:addVoice="addVoice" placeholder="{{placeholder}}" bind:playvoice="playvoice" bind:pausevoice="pausevoice" bind:voiceslide="voiceslide" audioStorage="{{audioStorage}}"
bind:slidestart="slidestart" bind:slideend="slideend" bind:delvoice="delvoice" withmask="{{showWarn}}" maxImgBoxLength="{{15}}"></sjd-media-editor>
</view>
<form report-submit="true" bindsubmit="saveTheme">
<button class="submitbtn" form-type="submit">发布主题</button>
</form>
<view class="warn-text-red" hover-class="none" hover-stop-propagation="false">一个主题每个学员只能打卡一次喔!</view>
<sound-recording sid="{{sid}}" show="{{audioStatus.show}}" bind:addVoice="addVoice" bind:pushVoice="pushVoice">
</sound-recording>
</view>
</view>
\ No newline at end of file
@import '../../../style/editor.wxss';
.theme-editor-container {
min-height: 100vh;
background-color: rgba(247, 247, 249, 1);
padding-bottom: 52rpx;
}
.theme-editor-container.opacitybody {
display: none;
}
.question-box {
width: 42rpx;
height: 42rpx;
border-radius: 50%;
background-color: #fff;
box-shadow: 0px -2rpx 18rpx 2rpx rgba(0, 0, 0, 0.08);
color: #65b8f4;
font-size: 30rpx;
text-align: center;
line-height: 42rpx;
margin-left: 20rpx;
}
.theme-editor-container .circle-name-box {
position: relative;
}
.theme-editor-container .broadcast-box {
padding: 22rpx 0 22rpx 24rpx;
background-color: #fff;
}
.theme-editor-container .broadcast-box .broadcast-img {
width: 24rpx;
height: 18rpx;
display: block;
float: left;
margin-top: 10rpx;
}
.theme-editor-container .broadcast-box .broadcast-text {
font-size: 24rpx;
color: #ef9c52;
padding-left: 21rpx;
float: left;
width: 647rpx;
}
.theme-editor-container .circle-name-box .circle-name {
background-color: rgba(248, 248, 248, 1);
border-radius: 8rpx;
width: 100%;
padding: 16rpx 6rpx 19rpx 15rpx;
height: 110rpx;
font-size: 28rpx;
margin-top: 20rpx;
line-height: 39rpx;
font-size: 26rpx;
}
.theme-editor-container .circle-name-box .length-rate {
position: absolute;
right: 6rpx;
bottom: 13rpx;
color: rgba(0, 0, 0, 0.3);
font-size: 26rpx;
}
.theme-editor-container .circle-name-box .circle-name-placeholder {
color: rgba(0, 0, 0, 0.3);
/* color:red; */
line-height: 39rpx;
font-size: 26rpx;
}
.theme-editor-container .submitbtn {
display: block;
margin: 0 auto;
width: 256rpx;
height: 80rpx;
line-height: 80rpx;
background: rgba(101, 184, 244, 1);
border-radius: 40rpx;
font-size: 38rpx;
color: #fff;
letter-spacing: 4rpx;
margin-top: 82rpx;
/* position: fixed;
bottom: 53rpx;
left: 50%;
margin-left: -128rpx; */
}
.theme-editor-container .pd0 {
padding-bottom: 0;
}
.warn-text-red {
color: #7d7d7d;
font-size: 26rpx;
margin-top: 44rpx;
text-align: center;
}
.theme-editor-container .self-editor-box .box-title .main-title {
float: left;
}
.main-title-box {
display: flex;
display: -webkit-flex;
align-items: center;
justify-content: flex-start;
/* float: left; */
}
.theme-editor-container .self-editor-box .box-title {
margin-bottom: 0;
}
.theme-editor-container .self-editor-box .box-title.box-title-mode .main-title-box .main-title {
font-size: 28rpx;
font-weight: 500;
}
.theme-editor-container .self-editor-box .box-title.box-title-mode {
}
.tranparent {
opacity: 0;
}
.theme-editor-container .self-editor-box .box-title .main-title-right {
float: right;
color: #65b8f4;
font-size: 26rpx;
padding-right: 36rpx;
}
.theme-editor-container .self-editor-box .box-title .arrowright {
display: block;
width: 14rpx;
height: 21rpx;
position: absolute;
right: 0;
top: 27rpx;
display: block;
}
.switchimgbox {
display: flex;
align-items: center;
float: right;
}
.switchimg {
width: 74rpx;
height: 36rpx;
float: right;
/* line-height: 73rpx; */
margin-top: 18rpx;
}
.sjd-dialog {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 100;
display: flex;
display: -webkit-flex;
align-items: center;
justify-content: center;
}
.sjd-dialog .sjd-input-dialog-mask {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, 0.7);
/* filter: blur(10px); */
z-index: 1;
}
.sjd-dialog .sjd-input-dialog-content {
background-color: #fff;
border-radius: 6rpx;
position: relative;
z-index: 2;
width: 560rpx;
}
.sjd-dialog .sjd-input-dialog-content .sjd-dialog-box {
padding: 30rpx;
}
.sjd-dialog .sjd-input-dialog-content .sjd-dialog-box .linetext {
font-size: 36rpx;
color: #000;
text-align: center;
line-height: 1;
margin-bottom: 24rpx;
}
.sjd-dialog .sjd-input-dialog-content .sjd-dialog-box .smalllineitem {
color: #999;
font-size: 24rpx;
margin-top: 45rpx;
text-align: center;
}
.sjd-dialog .sjd-input-dialog-content .sjd-dialog-box .input-item {
border: 1px solid rgba(0, 0, 0, 0.1);
border-radius: 5rpx;
padding: 0 10rpx;
width: 443rpx;
line-height: 60rpx;
height: 60rpx;
/* margin-bottom: 45rpx; */
display: block;
margin: 20rpx auto 45rpx;
}
.sjd-dialog .sjd-input-dialog-content .sjd-dialog-box .line {
margin-bottom: 10rpx;
line-height: 1.2;
}
.sjd-dialog .sjd-input-dialog-content .sjd-input-footer {
display: flex;
display: -webkit-flex;
justify-content: center;
border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.sjd-dialog .sjd-input-dialog-content .sjd-input-footer .btn-item {
flex-grow: 1;
line-height: 101rpx;
text-align: center;
font-size: 36rpx;
}
.sjd-dialog .sjd-input-dialog-content .sjd-input-footer .btn-item.cancel {
border-right: 1px solid rgba(0, 0, 0, 0.05);
}
.sjd-dialog .sjd-input-dialog-content .sjd-input-footer .btn-item.sure {
color: #00c200;
}
/* .media-text-item textarea {
height: 600rpx;
} */
.time-ipt-box {
display: flex;
font-size: 26rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(125, 125, 125, 1);
padding: 28rpx 0 44rpx 26rpx;
display: flex;
align-items: center;
}
.iteminput {
width: 74rpx;
border-bottom: 1px solid rgba(130, 142, 156, 0.4);
text-align: center;
font-size: 26rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(101, 184, 244, 1);
}
.timeset-title-box .main-title {
font-size: 28rpx;
font-weight: 500;
}
.timeset-box {
/* display: flex;
justify-content: space-between; */
line-height: 1 !important;
}
.timeset-box .timeset-title-box {
float: left;
}
.timeset-box .content-box {
/* width: 340rpx; */
font-size: 26rpx;
line-height: 1;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(101, 184, 244, 1);
/* padding-bottom: 20rpx; */
overflow: hidden;
/* display: flex; */
float: right;
justify-content: space-between;
border-bottom: 1px solid rgba(130, 142, 156, 0.4);
}
.timeset-box .content-box .time {
text-align: right;
}
.timeset-box .content-box .date {
}
.timeset-box .content-box .time picker{
line-height: 40rpx;
}
.timeset-box .content-time-box {
float: right;
display: flex;
line-height: 1;
font-size: 22rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(0, 0, 0, 1);
}
.timeset-box .content-time-box .time {
font-size: 26rpx;
width: 190rpx;
text-align: center;
border-bottom: 1px solid rgba(130, 142, 156, 0.4);
/* padding-bottom: 20rpx; */
color: rgba(101, 184, 244, 1);
}
.timeset-box .content-time-box .date {
width: 190rpx;
font-size: 26rpx;
text-align: center;
border-bottom: 1px solid rgba(130, 142, 156, 0.4);
/* padding-bottom: 20rpx; */
color: rgba(101, 184, 244, 1);
}
.timeset-title-box .title-tips {
font-size: 24rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(173, 173, 173, 1);
}
.time-editor-box {
padding: 0 24rpx;
}
.time-editor-box .time-ipt-box {
padding: 0rpx 0 40rpx 26rpx;
color: rgba(125, 125, 125, 1);
}
.time-editor-box .time-ipt-box .time {
width: 190rpx;
line-height: 1;
/* padding-bottom: 20rpx; */
text-align: center;
font-size: 26rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(101, 184, 244, 1);
border-bottom: 1px solid rgba(130, 142, 156, 0.4);
}
......@@ -197,6 +197,10 @@ const apis = {
themeCreate: `${api}member/clock/subject/create`,
themeUpdate: `${api}member/clock/subject/update`,
themeApi: `${api}member/subject`,
unlockSubjectCreate: `${api}member/unlock_subject/store`,
unlockSubjectUpdate: `${api}member/unlock_subject/update`,
unlockSingleSubjectCreate: `${api}member/subject`,
unlockSingleSubjectUpdate: `${api}member/subject`
},
circleIndex: {
themeApi: `${api}member/subject`,
......@@ -211,7 +215,9 @@ const apis = {
commentsList: `${api}member/clock/comment/index`,
newLikeIndex: `${api}member/clock/record/newLikeIndex`,
newCommentIndex: `${api}common/comments`,
reviewDel: `${api}member/reviews`
reviewDel: `${api}member/reviews`,
unlockSubjectShow: `${api}member/unlock_subject/show`,
unlockSubjectList: `${api}member/unlock_subject/index`
},
circleMember: {
memberList: `${api}member/clock/user/index`,
......
export default {
imageRoot: 'https://cdn.img.shangjiadao.cn/source/images/dakav3/',
host: 'https://wx.m.shangjiadao.cn/daka',
host2: 'https://wx.m.shangjiadao.cn',
// host: 'https://wx.m.shangjiadao.cn/daka',
// host2: 'https://wx.m.shangjiadao.cn',
storageVersion: '3.0',
imageVersion: '20190517',
// host: 'https://clock.wp53.cn',
// host2: 'https://test.wp53.cn',
host: 'https://clock.wp53.cn',
host2: 'https://test.wp53.cn',
appId: 'wxc1246ea029394785',
miniProgram: {
clock: 'wxdeee20e52a1fd7ee'
......
......@@ -45,9 +45,11 @@ export default {
30005: '该学生不存在',
30006: '该手机号已经领取过',
30009: '获取证书不存在',
40002: '您已经打过卡了',
40001: '主题类型错误',
40002: '已打卡',
40002: '您已经打过卡了',
// 40003: '学校不存在',
40004: '无权操作-学校',
40005: '无权操作-班级',
40003: '已打卡待审核',
40008: '主题不在规定时间内',
40009: '补卡次数已使用完'
......
......@@ -9,39 +9,6 @@ function themeEditor (data) {
url = apis.business.themeEditor.themeApi,
type = 'POST'
}
// let params = {};
// if (data.tid != 0) {
// params = {
// class_id: data.class_id,
// type: data.type,
// title: data.title,
// content: data.content,
// is_cheat: data.is_cheat,
// is_encrypt: data.is_encrypt,
// school_id: data.school_id
// }
// } else {
// params = {
// class_id: data.class_id,
// type: data.type,
// title: data.title,
// content: data.content,
// is_cheat: data.is_cheat,
// is_encrypt: data.is_encrypt,
// school_id: data.school_id
// }
// }
// if(data.clone&&data.clone == 1){
// params = {
// class_id: data.class_id,
// type: data.type,
// title: data.title,
// content: data.content,
// is_cheat: data.is_cheat,
// is_encrypt: data.is_encrypt,
// school_id: data.school_id
// }
// }
return wxRequest({
role: '2b',
url,
......@@ -50,6 +17,31 @@ function themeEditor (data) {
errorresolve: 1,
})
}
function unlockSubjectEditor ({tid, data}) {
let url = tid == 0 ? apis.business.themeEditor.unlockSubjectCreate : apis.business.themeEditor.unlockSubjectUpdate;
let saveData = {};
saveData = tid != 0 ? Object.assign({id: tid}, data) : data
return wxRequest({
role: '2b',
url,
data: saveData,
method: 'POST',
errorresolve: 1,
})
}
function unlockSingleSubjectCreate (data) {
let url = data.id == 0 ? apis.business.themeEditor.unlockSingleSubjectCreate : apis.business.themeEditor.unlockSingleSubjectUpdate + '/' + data.id;
let type = data.id == 0 ? 'POST' :'PUT'
return wxRequest({
role: '2b',
url,
data,
method: type,
errorresolve: 1,
})
}
export {
themeEditor
themeEditor,
unlockSubjectEditor,
unlockSingleSubjectCreate
}
\ No newline at end of file
......@@ -83,6 +83,24 @@ function reviewDel (data) {
errorresolve: 1,
})
}
function unlockSubjectShow (data) {
return wxRequest({
role: '2b',
url: apis.business.themeIndex.unlockSubjectShow,
method: 'GET',
data,
errorresolve: 1,
})
}
function unlockSubjectList (data) {
return wxRequest({
role: '2b',
url: apis.business.themeIndex.unlockSubjectList,
method: 'GET',
data,
errorresolve: 1,
})
}
export {
themeDetail,
clockList,
......@@ -92,5 +110,7 @@ export {
commentDel,
newLikeIndex,
newCommentIndex,
reviewDel
reviewDel,
unlockSubjectShow,
unlockSubjectList
}
\ 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