Commit b7288cfd authored by 吴颖's avatar 吴颖

'签到限制,课程瞬间限制'

parent 000a0252
......@@ -53,7 +53,7 @@ Page({
},
gocourseinstant: function () {
wx.navigateTo({
url: '../../index/courseInstant/courseInstant',
url: '../../index/courseInstant/courseInstant?type=check&lesson_id=' + this.data.lesson_id,
})
},
......
......@@ -8,6 +8,7 @@ var qiniuUploader = require("../../../utils/qiniuUploader");
Page({
data: {
lesson_id: '',
type: '', // 查看还是修改
videoBox: [],
videoShow: true,
imgBox: [],
......@@ -20,12 +21,12 @@ Page({
*/
onLoad: function (options) {
this.setData({
lesson_id: options.lesson_id ? options.lesson_id : ''
lesson_id: options.lesson_id ? options.lesson_id : '',
type: options.type ? options.type : '',
})
if (this.data.lesson_id) {
this.getDetail()
}
},
getDetail() {
let params = {
......@@ -34,6 +35,22 @@ Page({
lesson_id: this.data.lesson_id
},
callback:(data)=>{
console.log(JSON.parse(data.class_moment))
let class_moment = JSON.parse(data.class_moment)
let arr1 = [], arr2 = []
for(var i=0; i< class_moment.length; i++) {
if (class_moment[i].type == 'video') {
arr1.push(class_moment[i])
} else {
arr2.push(class_moment[i])
}
}
this.setData({
videoBox: arr1,
imgBox: arr2
})
console.log(arr1)
console.log(arr2)
console.log(data)
}
}
......
......@@ -6,11 +6,11 @@
<view class="imgBox flex-h">
<view class="img videoBox" wx:for="{{videoBox}}" wx:for-item="item" wx:key="idx">
<video src="{{item.url}}" data-index="{{index}}"></video>
<view class="delete-btn" data-index="{{index}}" catchtap="deleteVideo">
<view class="delete-btn" data-index="{{index}}" catchtap="deleteVideo" wx:if="{{type != 'check'}}">
<text class='iconfont iconguanbi'></text>
</view>
</view>
<view class='addBox flex-h flex-vc flex-hc' bindtap="chooseVideo" wx:if="{{videoShow}}">
<view class='addBox flex-h flex-vc flex-hc' bindtap="chooseVideo" wx:if="{{imgBox.length < 1}}">
<text class='iconfont iconshipin'></text>
</view>
</view>
......@@ -23,15 +23,15 @@
<view class="imgBox flex-h flex-hw">
<view class="img" wx:for="{{imgBox}}" wx:for-item="item" wx:key="idx">
<image src="{{item.url}}" data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image>
<view class="delete-btn" data-index="{{index}}" catchtap="deleteImg">
<view class="delete-btn" data-index="{{index}}" catchtap="deleteImg" wx:if="{{type != 'check'}}">
<text class='iconfont iconguanbi'></text>
</view>
</view>
<view class='addBox flex-h flex-vc flex-hc' bindtap="chooseImg" wx:if="{{imgBox.length < 9}}">
<view class='addBox flex-h flex-vc flex-hc' bindtap="chooseImg" wx:if="{{imgBox.length < 9 && type != 'check' }}">
<text class='iconfont iconxiangji'></text>
</view>
</view>
</view>
<view class="button">
<view class="button" wx:if="{{type != 'check'}}">
<view class="submit" catchtap="save">提交</view>
</view>
\ No newline at end of file
......@@ -27,7 +27,6 @@ page {
.img {
width: 210rpx;
height: 210rpx;
border: 1px solid #EBEBEB;
border-radius: 5rpx;
margin-right: 30rpx;
margin-bottom: 30rpx;
......
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