Commit 1a0d37df authored by lvtz's avatar lvtz

fix

parent a008214a
......@@ -362,7 +362,8 @@
"setting",
"chooseclass",
"subjecteditor",
"lockthemelist"
"lockthemelist",
"sortlist"
]
},
{
......
......@@ -369,19 +369,18 @@ button::after {
.form-fixbtn {
width: 365rpx;
height: 80rpx;
background: rgba(22, 176, 253, 1);
background: #35BAFD;
border-radius: 40rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 30rpx;
font-size: 32rpx;
color: #fff;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 86rpx;
z-index: 9;
box-shadow: 0 2px 20rpx #16b0fd;
}
/* 没有更多 */
.has-nomore {
......
......@@ -2495,6 +2495,12 @@ Page({
successDailogShow: false
})
},
// 闯关调整顺序
toSortLocks () {
wx.navigateTo({
url: `/business/pages/themeeditor/sortlist?sid=${this.data.sid}&&tid=${this.data.tid}`
})
},
getHelp (e) {
const { type } = e.currentTarget.dataset;
if (type == 1) {
......
......@@ -93,7 +93,7 @@
</view>
</view>
</view>
<view class="section-tip" style="color: #999999;margin-bottom:12px;">打卡时间结束后将无法提交打卡!</view>
<view class="section-tip" style="margin-bottom:12px;">打卡时间结束后将无法提交打卡!</view>
<view class="section-wrap">
<view class="section-item" bindtap="goyinxiaoPage">
<view class="form-item">
......@@ -104,7 +104,7 @@
</view>
</view>
</view>
<view class="section-tip" style="color: #999999;">可在学生加入打卡前展示, 此功能可收集有意向学生的联系方式 <text style="color: #16B0FD;" data-type="4" bindtap="getHelp">了解详情</text></view>
<view class="section-tip">可在学生加入打卡前展示, 此功能可收集有意向学生的联系方式 <text style="color: #16B0FD;" data-type="4" bindtap="getHelp">了解详情</text></view>
</view>
<view class="section-wrap" bindtap="bindMoreSetting">
<view class="section-item">
......@@ -115,7 +115,7 @@
</view>
</view>
</view>
<view class="section-tip" style="color: #999999;">设置学生打卡参与方式、作业要求、打卡模式等</view>
<view class="section-tip">设置学生打卡参与方式、作业要求、打卡模式等</view>
</view>
</block>
<block wx:if="{{editType == 2}}">
......@@ -194,7 +194,7 @@
</view>
</view>
</view>
<view class="section-tip" style="color: #999999;margin-bottom:12px;">打卡时间结束后将无法提交打卡!</view>
<view class="section-tip" style="margin-bottom:12px;">打卡时间结束后将无法提交打卡!</view>
<view class="section-wrap pdlpdr24" style="margin-bottom: 0;">
<view class="section-item">
<view class="form-item">
......@@ -218,7 +218,7 @@
</view>
</view>
</view>
<view class="section-tip" style="color: #999999;margin-bottom:12px;">选中的日期,学生不用打卡!</view>
<view class="section-tip" style="margin-bottom:12px;">选中的日期,学生不用打卡!</view>
<view class="section-wrap">
<view class="section-item" bindtap="goyinxiaoPage">
<view class="form-item">
......@@ -229,7 +229,7 @@
</view>
</view>
</view>
<view class="section-tip" style="color: #999999;">可在学生加入打卡前展示, 此功能可收集有意向学生的联系方式 <text style="color: #16B0FD;" data-type="4" bindtap="getHelp">了解详情</text></view>
<view class="section-tip">可在学生加入打卡前展示, 此功能可收集有意向学生的联系方式 <text style="color: #16B0FD;" data-type="4" bindtap="getHelp">了解详情</text></view>
<view class="section-wrap" bindtap="bindMoreSetting">
<view class="section-item">
<view class="form-item">
......@@ -239,7 +239,7 @@
</view>
</view>
</view>
<view class="section-tip" style="color: #999999;">设置学生打卡参与方式、作业要求、打卡模式等</view>
<view class="section-tip">设置学生打卡参与方式、作业要求、打卡模式等</view>
</view>
</view>
</block>
......@@ -258,7 +258,6 @@
<view class="section-item borderbottom1px">
<view class="form-item title" >
<view class="item-l">共关卡数</view>
<view class="item-l" style="opacity: 0;margin-right: 76rpx">共关卡</view>
<view class="item-r">
<view class="subjectCountInputbox" bindtap="toChangesubjectCountInput">{{lockparams.subject_count}}</view>关
</view>
......@@ -275,9 +274,9 @@
</view>
</view>
</view>
<view class="section-tip" style="color: #999999;">可在学生加入打卡前展示, 此功能可收集有意向学生的联系方式 <text data-type="4" bindtap="getHelp" style="color: #16B0FD;">了解详情</text></view>
<view class="section-tip">可在学生加入打卡前展示, 此功能可收集有意向学生的联系方式 <text data-type="4" bindtap="getHelp" style="color: #16B0FD;">了解详情</text></view>
</view>
<view class="new-setting-box">
<view class="section-wrap new-setting-box">
<view class="title-wrapper">
<view class="title-box">
<text class="title">报名信息收集</text>
......@@ -298,28 +297,26 @@
<view class="item" wx:for="{{radioList}}" wx:key="index">
<view class="index-name">{{item.text}}</view>
<input class="item-ipt" type="text" maxlength="{{30}}" placeholder="输入内容" value="{{item.name}}" bindinput="itemnameIpt" data-index="{{index}}"/>
<image class="del-icon" bindtap="delCheckitme" data-index="{{index}}" src="{{imageRoot}}2b/common/reddelicon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" />
<image class="del-icon" bindtap="delCheckitme" data-index="{{index}}" src="{{imageRoot}}2b/common/reddelicon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"/>
</view>
<view class="add-item-btn" bindtap="addCheckItem" wx:if="{{radioList.length<=4}}">添加选项</view>
</view>
<view class="addRadio" wx:if="{{radioList.length==0}}" bindtap="addRadio">添加自定义单选项</view>
</view>
</view>
<view class="locksubjectbox" style="margin-bottom: 24rpx">
<view class="section-wrap locksubjectbox" wx:if="{{lockSubjectLists.length>0}}">
<view class="locksubjectbigtitle" wx:if="{{subjecSort.length > 1}}">
<view class="bigtitle" wx:for="{{subjecSort}}" wx:key="index" data-index="{{index}}" data-item="{{item}}" bindtap="selectSubjectSort">
<view class="bigtitle {{currentSortIndex == index ? 'active' : ''}}" wx:for="{{subjecSort}}" wx:key="index" data-index="{{index}}" data-item="{{item}}" bindtap="selectSubjectSort">
<view class="bigtitletext" wx:if="{{item.length > 1}}">第{{item[0]}}-{{item[item.length - 1]}}关</view>
<view class="bigtitletext" wx:if="{{item.length == 1}}">第{{item[0]}}关</view>
<view class="activeline {{currentSortIndex == index ? 'active' : ''}}"></view>
</view>
<view class="sort-btn" bindtap="toSortLocks"><image class="icon-sort" src="{{localImageRoot}}2b/themeeditor/icon_sort.png?{{imageVersion}}"></image>调整顺序</view>
</view>
<view class="locksubjectlist">
<view class="locksubjectitem" wx:for="{{lockSubjectLists}}" wx:key="index" data-item="{{item}}" data-index="{{index}}" bindtap="goModifyClockSubject">
<view class="topbox">
<view class="sorttitle">第{{currentSortIndex * 5 + index + 1}}关</view>
<view class="editbtn">编辑</view>
</view>
<view class="sorttitle">第{{currentSortIndex * 5 + index + 1}}关</view>
<view class="subjecttitle">{{item.title || '未设置'}}</view>
<view class="editbtn">编辑</view>
</view>
</view>
</view>
......@@ -332,7 +329,7 @@
</view>
</view>
</view>
<view class="section-tip" style="color: #999999;">设置学生打卡参与方式、作业要求、打卡模式等</view>
<view class="section-tip">设置学生打卡参与方式、作业要求、打卡模式等</view>
</view>
</block>
<sound-recording sid="{{sid}}" show="{{audioStatus.show}}" bind:addVoice="addVoice" bind:pushVoice="pushVoice">
......
......@@ -88,14 +88,9 @@ page{
width: 630rpx;
height: 90rpx;
border-radius: 49rpx;
background: rgba(22,176,253,1);
font-size: 32rpx;
bottom: 36rpx;
text-align: center;
line-height: 90rpx;
display: flex;
align-items: center;
justify-content: center;
}
.showorhide-icon{
......@@ -205,7 +200,7 @@ page{
}
.section-tip{
font-size: 22rpx;
color: #AAAAAA;
color: #999;
padding: 4rpx 22rpx 7rpx;
line-height: 48rpx;
}
......@@ -666,67 +661,94 @@ page{
}
.locksubjectbox {
background-color: #fff;
padding: 18rpx 24rpx;
padding: 30rpx 0;
position: relative;
}
.locksubjectbox .sort-btn{
display: flex;
align-items: center;
font-size: 22rpx;
color: #35BAFD;
position: absolute;
right: 24rpx;
top: 13rpx;
}
.locksubjectbox .sort-btn .icon-sort{
width: 26rpx;
height: 26rpx;
margin-right: 10rpx;
}
.locksubjectbigtitle {
display: flex;
align-items: center;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
/* white-space: nowrap; */
flex-wrap: wrap;
margin: 0 -20rpx;
position: relative;
padding-bottom: 20rpx;
}
.locksubjectbigtitle .bigtitle {
margin: 0 20rpx 22rpx;
}
.locksubjectbigtitle .bigtitle .bigtitletext {
color: #222222;
font-size: 26rpx;
line-height: 1;
margin-bottom: 6rpx;
padding: 10rpx 20rpx;
position: relative;
}
.locksubjectbigtitle .bigtitle .activeline {
.locksubjectbigtitle .bigtitle.active::after{
content: '';
width: 26rpx;
height: 6rpx;
border-radius: 3rpx;
background-color: transparent;
}
.locksubjectbigtitle .bigtitle .activeline.active {
background-color: #16B0FD;
margin: 0 auto;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
}
.locksubjectbigtitle .bigtitle .bigtitletext {
color: #999;
font-size: 26rpx;
line-height: 37rpx;
}
.locksubjectbigtitle .bigtitle.active .bigtitletext{
color: #222;
}
.locksubjectlist {
.locksubjectlist {
padding: 0 24rpx;
}
.locksubjectitem {
border-radius: 10rpx;
background-color: #fff;
box-shadow:0px -2rpx 4rpx 1px rgba(214,205,189,0.5);
margin-bottom: 24rpx;
padding: 18rpx;
border-radius: 20rpx;
background-color: #F9F9F9;
margin-bottom: 20rpx;
padding: 24rpx;
position: relative;
}
.locksubjectitem .sorttitle {
font-size: 26rpx;
line-height: 1;
.locksubjectitem:last-of-type {
margin-bottom: 0
}
.locksubjectitem .topbox {
.locksubjectitem .sorttitle {
font-size: 22rpx;
color: #999;
line-height: 30rpx;
margin-bottom: 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.locksubjectitem .subjecttitle{
font-size: 26rpx;
color: #555;
line-height: 37rpx;
width: 560rpx;
}
.locksubjectitem .editbtn {
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
padding: 24rpx;
color: #16B0FD;
font-size: 26rpx;
}
.new-setting-box{
margin-top: 25rpx;
background:rgba(255,255,255,1);
padding: 34rpx 24rpx;
margin-bottom: 24rpx;
background: #fff;
}
.new-setting-box .title-wrapper{
display: flex;
......@@ -749,7 +771,6 @@ page{
line-height:1;
}
.new-setting-box .content{
padding: 0rpx 0 32rpx 0;
}
.new-setting-box .content .tips{
font-size:24rpx;
......
import {
unlockSubjectListGet,
} from '../../../service/business/common.js';
import Touches from '../../../utilities/touchs.js'
var app = getApp();
Page({
data: {
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/',
sid: 0,
tid: 0,
page: 1,
subjectCount: 1,
lockSubjects: [],
},
onLoad: function(options) { // Do some initialize when page load.
const { sid, tid } = options;
this.setData({
sid,
tid,
})
this.getUnlockSubject();
},
onReady: function() { // Do something when page ready.
},
onShow: function() { // Do something when page show.
},
onPullDownRefresh() {
this.getUnlockSubject();
},
getUnlockSubject() {
unlockSubjectListGet({
page: 1,
perPage: 200,
id: this.data.tid,
school_id: this.data.sid
}).then((res) => {
const { code, data } = res;
if (code == 200) {
this.setData({
lockSubjects: data.list
})
wx.stopPullDownRefresh();
} else {
}
}).catch((e) => {
})
},
touchS: function (e) { // touchstart
let startX = Touches.getClientX(e)
startX && this.setData({ startX })
},
touchM: function (e) { // touchmove
let lockSubjects = Touches.touchM(e, this.data.lockSubjects, this.data.startX)
lockSubjects && this.setData({ lockSubjects })
},
touchE: function (e) { // touchend
const width = 125 // 定义操作列表宽度
let lockSubjects = Touches.touchE(e, this.data.lockSubjects, this.data.startX, width)
lockSubjects && this.setData({ lockSubjects })
},
itemDelete (e) {
let lockSubjects = Touches.deleteItem(e, this.data.lockSubjects)
lockSubjects && this.setData({ lockSubjects })
}
})
\ No newline at end of file
{
"navigationBarTitleText": "调整关卡顺序",
"enablePullDownRefresh": true,
"usingComponents": {
"sjd-media-editor": "../../../components/newsjdmediaeditor",
"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-checkbox": "/dist/w-checkbox/index",
"w-pane": "/dist/w-pane/index",
"expiredTip": "../../components/expiredTip"
}
}
\ No newline at end of file
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="container">
<view class="tip-box">
<view class="tip">未打卡的关卡可调整顺序,长按并上下拖动卡片即可调整关卡顺序,向左滑动可删除关卡</view>
</view>
<view class="list-box" wx:for="{{lockSubjects}}" wx:key="index">
<view class="list-item">
<view class="item-sorttitle">第{{index + 1}}关</view>
<view class="item-wrap">
<view class="item-info" data-index="{{index}}" bindtouchstart="touchS" bindtouchmove="touchM" bindtouchend="touchE" style="left:{{item.left + 'rpx'}}">
<view class="item-title">{{item.title}}</view>
<image class="icon-opt" src="{{localImageRoot}}2b/themeeditor/btn_opt.png?{{imageVersion}}"></image>
</view>
<view class="box-opt">
<image class="icon-del" src="{{localImageRoot}}2b/themeeditor/icon_del.png?{{imageVersion}}"></image>
<view class="text" bindtap="itemDelete" data-index="{{index}}">删除</view>
</view>
</view>
</view>
</view>
<view class="form-fixbtn" bindtap="">保存</view>
</view>
.container {
min-height: 100vh;
background-color: #f9f9f9;
padding-bottom: 150rpx;
}
.tip-box {
background: #f5fcff;
padding: 20rpx 24rpx;
}
.tip-box .tip {
font-size: 26rpx;
color: #35bafd;
line-height: 38rpx;
}
.list-box {
padding: 15rpx 24rpx;
}
.list-box .list-item {
margin-bottom: 8rpx;
}
.list-box .list-item:last-of-type {
margin-bottom: 0;
}
.list-box .list-item .item-sorttitle {
font-size: 22rpx;
color: #999;
line-height: 30rpx;
padding: 16rpx 0;
}
.list-box .list-item .item-wrap {
background-color: #fff;
height: 100rpx;
position: relative;
border-radius: 20rpx;
overflow: hidden;
}
.list-box .list-item .item-info {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 2;
transition: left 0.2s ease-in-out;
background: #fff;
padding: 0 24rpx;
}
.list-box .list-item .item-info .item-title {
font-size: 26rpx;
color: #555;
line-height: 37rpx;
}
.list-box .list-item .item-info .icon-opt {
width: 26rpx;
height: 18rpx;
}
.list-box .list-item .box-opt {
position: absolute;
top: 0;
right: 0;
width: 125rpx;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: red;
border-radius: 0 22rpx 22rpx 0;
}
.list-box .list-item .box-opt .icon-del {
width: 30rpx;
height: 30rpx;
}
.list-box .list-item .box-opt .text {
font-size: 22rpx;
color: #fff;
padding-top: 10rpx;
}
.form-fixbtn {
width: 630rpx;
height: 90rpx;
border-radius: 49rpx;
bottom: 36rpx;
}
......@@ -49,6 +49,8 @@ Page({
video_require_num: 0,
audio_require_status: 2,
audio_require_num: 0,
clock_count: 0,
sort: 1,
},
submiting: false,
audioStatus: { // 录音弹窗的交互状态
......@@ -179,6 +181,8 @@ Page({
'params.title': data.title,
'params.audio_require_status': data.audio_require_status,
'params.audio_require_num': data.audio_require_num,
'params.clock_count': data.clock_count,
'params.sort': data.sort
})
}
}).catch(() => {
......@@ -795,12 +799,21 @@ Page({
// }
del () {
const that = this;
let clockCount = that.data.params.clock_count;
if (this.data.id == 0) {
} else {
if(that.data.params.sort==1){
wx.showToast({
title: '第一关无法删除',
icon: 'none'
})
return
}
wx.showModal({
title: '提示',
content: '删除作业将清除数据',
title: '',
content: clockCount>0?'删除后将清空此关卡打卡内容\r\n 确定要删除吗?':'确定要删除此关卡吗?',
confirmColor: '#35BAFD',
success (res) {
console.log(res);
if (res.confirm) {
......
......@@ -95,19 +95,13 @@
</view>
</view>
</view>
<form report-submit="true" bindsubmit="saveTheme">
<button class="submitbtn" form-type="submit">发布关卡内容</button>
</form>
<sound-recording sid="{{sid}}" show="{{audioStatus.show}}" bind:addVoice="addVoice" bind:pushVoice="pushVoice">
</sound-recording>
<!-- <cover-view class="btnbox">
<cover-view class="btn" bindtap="setting" wx:if="{{id != 0}}">删除</cover-view>
<cover-view class="btn share {{id != 0 ? 'withdelbtn' : ''}}">保存</cover-view>
<cover-view class="btnbox {{id != 0 ? 'btnbox2' : ''}}">
<cover-view class="btn" bindtap="del" wx:if="{{id != 0}}">删除</cover-view>
<cover-view class="btn share" bindtap="saveTheme">保存</cover-view>
</cover-view>
<view class="btnbox">
<view class="btn" bindtap="del" wx:if="{{id != 0}}">删除</view>
<view class="btn share {{id != 0 ? '' : 'withdelbtn'}}" bindtap="saveTheme">保存</view>
</view> -->
</view>
</view>
<view class="videodialog" wx:if="{{videostatus.videoShow}}">
......
......@@ -2,7 +2,7 @@
.theme-editor-container {
min-height: 100vh;
background-color: #f5f5f5;
background-color: #F9F9F9;
padding-bottom: 150rpx;
}
.common-editor-box {
......@@ -307,6 +307,7 @@
bottom: 0;
z-index: 2;
display: flex;
background: #fff;
box-shadow: 0px -2rpx 4rpx 0px rgba(214,205,189,0.5);
}
.btnbox .btn {
......@@ -317,26 +318,18 @@
justify-content: center; */
line-height: 98rpx;
text-align: center;
width: 50%;
width: 100%;
display: inline-block;
background-color: #fff;
font-size: 30rpx;
font-size: 32rpx;
letter-spacing: 2rpx;
color: #666666;
color: #999;
position: relative;
}
.sharebtn {
position: absolute;
opacity: 0;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.btnbox .btn.share {
background-color: #16B0FD;
color: #FFFFFF;
color: #fff;
}
.btnbox .btn.share.withdelbtn {
width: 100%;
.btnbox2 .btn{
width: 50%;
}
\ No newline at end of file
export default {
imageRoot: 'https://cdn.img.shangjiadao.cn/qingxiao/dakav2/images/',
host: 'https://qxapi.qingxiao.online/daka',
host2: 'https://wx.m.shangjiadao.cn',
// host: 'https://qxapi.qingxiao.online/daka',
// host2: 'https://wx.m.shangjiadao.cn',
storageVersion: '5.0',
imageVersion: '20200420',
// 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'
......
class Touches {
constructor() {
}
_getIndex(e) { // 获取滑动列表的下标值
return e.currentTarget.dataset.index
}
_getMoveX(e, startX) { // 获取滑动过程中滑动的距离
return this.getClientX(e) - startX
}
_getEndX(e, startX) { // 获取滑动结束滑动的距离
let touch = e.changedTouches
if (touch.length === 1) {
return touch[0].clientX - startX
}
}
_resetData(dataList) { // 重置数据, 把所有的列表 left 置为 0
for (let i in dataList) {
dataList[i].left = 0
}
return dataList
}
getClientX(e) { // 获取滑动的横坐标
let touch = e.touches
if (touch.length === 1) {
return touch[0].clientX
}
}
touchM(e, dataList, startX) { // touchmove 过程中更新列表数据
let list = this._resetData(dataList)
list[this._getIndex(e)].left = this._getMoveX(e, startX)
return list
}
touchE(e, dataList, startX, width) { // touchend 更新列表数据
let list = this._resetData(dataList)
let disX = this._getEndX(e, startX)
let left = 0
if (disX < 0) { // 判断滑动方向, (向左滑动)
// 滑动的距离大于删除宽度的一半就显示操作列表 否则不显示
Math.abs(disX) > width / 2 ? left = -width : left = 0
} else { // 向右滑动复位
left = 0
}
list[this._getIndex(e)].left = left
return list
}
deleteItem(e, dataList) { // 删除功能
dataList.splice(this._getIndex(e), 1)
return dataList
}
}
export default new Touches()
\ 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