Commit b7c6686e by Administrator

Merge remote-tracking branch 'origin/master'

parents 0b1b54b9 42c29e3e

7.22 KB | W: | H:

37.6 KB | W: | H:

addons/theme/stv1/_static/images/noavatar/big.jpg
addons/theme/stv1/_static/images/noavatar/big.jpg
addons/theme/stv1/_static/images/noavatar/big.jpg
addons/theme/stv1/_static/images/noavatar/big.jpg
  • 2-up
  • Swipe
  • Onion skin
...@@ -2633,7 +2633,6 @@ class PayVideoAction extends CommonAction ...@@ -2633,7 +2633,6 @@ class PayVideoAction extends CommonAction
$exams_module_id = D('ExamsPaper', 'exams')->where(['exams_paper_id' => $vid])->getField('exams_module_id'); $exams_module_id = D('ExamsPaper', 'exams')->where(['exams_paper_id' => $vid])->getField('exams_module_id');
$url = U('exams/Index/paper', ['c' => 0, 'module_id' => $exams_module_id]); $url = U('exams/Index/paper', ['c' => 0, 'module_id' => $exams_module_id]);
$url = U('/'); $url = U('/');
} elseif ($vtype == 'zy_classes') { } elseif ($vtype == 'zy_classes') {
$url = U('course/Classes/view', array('id' => $vid)); $url = U('course/Classes/view', array('id' => $vid));
} }
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<div @click="onTapCourse(child, item)" v-for="(child, idx) in item.child" :key="idx" class="course_each layout_v"> <div @click="onTapCourse(child, item)" v-for="(child, idx) in item.child" :key="idx" class="course_each layout_v">
<div class="layout_h" style="margin-left: 0.75rem;margin-right: 0.75rem;"> <div class="layout_h" style="margin-left: 0.75rem;margin-right: 0.75rem;">
<van-icon size="16" :name="isVideoLocked(child) ? '__THEME__/img/locked.png' : '__THEME__/img/unlocked.png'" ></van-icon> <van-icon size="16" :name="isVideoLocked(child) ? '__THEME__/img/locked.png' : '__THEME__/img/unlocked.png'" ></van-icon>
<div class="layout_v weight_full" style="margin-left: 0.5rem;"> <div @click="subVideo(child)" class="layout_v weight_full" style="margin-left: 0.5rem;">
<span class="text_14_400 color_333333">{{child.title}}</span> <span class="text_14_400 color_333333">{{child.title}}</span>
<span class="text_12_400 color_999999" style="margin-top: 0.25rem;">{{child.duration}}</span> <span class="text_12_400 color_999999" style="margin-top: 0.25rem;">{{child.duration}}</span>
</div> </div>
...@@ -232,6 +232,20 @@ ...@@ -232,6 +232,20 @@
return false return false
} else { } else {
return child.is_free != 1 return child.is_free != 1
// return this.price != 0;
}
}
},
subVideo: function () {
// let isVideoLocked = this.isVideoLocked(child);
return function(child) {
if (!this.isVideoLocked(child)) {
// window.location.href = 1;
// <a href="{:U('course/Video/watch',array('id'=>$vo1['vid'],'s_id'=>$vo1['id']))}">
let url = "{:U('course/Video/watch')}";
url = url.replace('[id]', child.vid);
url = url.replace('[s_id]', child.id);
window.location.href = url;
} }
} }
}, },
......
...@@ -172,6 +172,13 @@ class AdminPaperAction extends AdministratorAction ...@@ -172,6 +172,13 @@ class AdminPaperAction extends AdministratorAction
// }else{ // }else{
$data['level'] = intval($_POST['level']); $data['level'] = intval($_POST['level']);
// } // }
$attache_id = '';
$attache_ids = explode('|', $_POST['attachment_ids']);
if (!empty($attache_ids)) {
$attache_id = array_pop(array_filter($attache_ids));
}
$data['attachment'] = $attache_id;
$data['reply_time'] = intval($_POST['reply_time']); $data['reply_time'] = intval($_POST['reply_time']);
$data['exams_module_id'] = intval($_POST['exams_module_id']); $data['exams_module_id'] = intval($_POST['exams_module_id']);
$data['exams_paper_title'] = t($_POST['exams_paper_title']); $data['exams_paper_title'] = t($_POST['exams_paper_title']);
...@@ -196,7 +203,7 @@ class AdminPaperAction extends AdministratorAction ...@@ -196,7 +203,7 @@ class AdminPaperAction extends AdministratorAction
} }
exit; exit;
} }
$this->pageKeyList = ['exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time', 'exams_limit','best', 'is_rand', 'start_time', 'end_time', 'assembly_type', 'is_screen','price', 'show_user_group', 'sort', 'description']; $this->pageKeyList = ['exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time', 'exams_limit','best', 'is_rand', 'start_time', 'end_time', 'assembly_type', 'is_screen','attachment', 'price', 'show_user_group', 'sort', 'description'];
$this->notEmpty = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time']; $this->notEmpty = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time'];
ob_start(); ob_start();
echo W('CategoryLevel', array('table' => 'exams_subject', 'id' => 'exams_subject_id')); echo W('CategoryLevel', array('table' => 'exams_subject', 'id' => 'exams_subject_id'));
...@@ -289,6 +296,12 @@ class AdminPaperAction extends AdministratorAction ...@@ -289,6 +296,12 @@ class AdminPaperAction extends AdministratorAction
if (end($subjectArr) == 0) { if (end($subjectArr) == 0) {
array_pop($subjectArr); array_pop($subjectArr);
} }
$attache_id = '';
$attache_ids = explode('|', $_POST['attachment_ids']);
if (!empty($attache_ids)) {
$attache_id = array_pop(array_filter($attache_ids));
}
$data['exams_subject_id'] = end($subjectArr); $data['exams_subject_id'] = end($subjectArr);
$data['description'] = t($_POST['description']); $data['description'] = t($_POST['description']);
$data['level'] = intval($_POST['level']); $data['level'] = intval($_POST['level']);
...@@ -308,6 +321,8 @@ class AdminPaperAction extends AdministratorAction ...@@ -308,6 +321,8 @@ class AdminPaperAction extends AdministratorAction
$data['assembly_type'] = isset($_POST['assembly_type']) ? intval($_POST['assembly_type']) : 0; $data['assembly_type'] = isset($_POST['assembly_type']) ? intval($_POST['assembly_type']) : 0;
$data['best'] = isset($_POST['best']) ? intval($_POST['best']) : 0; $data['best'] = isset($_POST['best']) ? intval($_POST['best']) : 0;
$data['price'] = t($_POST['price']); $data['price'] = t($_POST['price']);
$data['attachment'] = $attache_id;
if (M('exams_paper')->where(['exams_paper_id' => $paper_id])->save($data)) { if (M('exams_paper')->where(['exams_paper_id' => $paper_id])->save($data)) {
$this->success('编辑成功'); $this->success('编辑成功');
} else { } else {
...@@ -322,7 +337,7 @@ class AdminPaperAction extends AdministratorAction ...@@ -322,7 +337,7 @@ class AdminPaperAction extends AdministratorAction
$this->error("未找到编辑的试卷"); $this->error("未找到编辑的试卷");
} }
$this->pageTab[] = array('title' => '编辑', 'tabHash' => 'edit', 'url' => U('exams/AdminPaper/edit', ['paper_id' => $paper_id])); $this->pageTab[] = array('title' => '编辑', 'tabHash' => 'edit', 'url' => U('exams/AdminPaper/edit', ['paper_id' => $paper_id]));
$this->pageKeyList = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time', 'exams_limit', 'best', 'is_rand', 'start_time', 'end_time', 'assembly_type', 'is_screen','price', 'show_user_group', 'sort', 'description']; $this->pageKeyList = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time', 'exams_limit', 'best', 'is_rand', 'start_time', 'end_time', 'assembly_type', 'is_screen','attachment', 'price', 'show_user_group', 'sort', 'description'];
$this->notEmpty = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time']; $this->notEmpty = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time'];
ob_start(); ob_start();
echo W('CategoryLevel', array('table' => 'exams_subject', 'id' => 'exams_subject_id', 'default' => $paper['paper_subject_fullpath'])); echo W('CategoryLevel', array('table' => 'exams_subject', 'id' => 'exams_subject_id', 'default' => $paper['paper_subject_fullpath']));
...@@ -351,7 +366,6 @@ class AdminPaperAction extends AdministratorAction ...@@ -351,7 +366,6 @@ class AdminPaperAction extends AdministratorAction
}else{ }else{
$ug_map = 'user_group_id != 1'; $ug_map = 'user_group_id != 1';
} }
$this->opt['show_user_group'] = model('UserGroup')->where($ug_map)->getField('user_group_id,user_group_name'); $this->opt['show_user_group'] = model('UserGroup')->where($ug_map)->getField('user_group_id,user_group_name');
$paper['start_time'] = date('Y-m-d H:i', $paper['start_time']); $paper['start_time'] = date('Y-m-d H:i', $paper['start_time']);
$paper['end_time'] = date('Y-m-d H:i', $paper['end_time']); $paper['end_time'] = date('Y-m-d H:i', $paper['end_time']);
......
...@@ -45,6 +45,17 @@ class ExamsPaperModel extends Model ...@@ -45,6 +45,17 @@ class ExamsPaperModel extends Model
return $list; return $list;
} }
protected function getAttachPathByAttachId($attachid) {
if (empty($attachid)) {
return '';
}
if ($attachInfo = model('Attach')->getAttachById($attachid)) {
return '/data/upload/' . $attachInfo['save_path'] . $attachInfo['save_name'];
} else {
return '';
}
}
/** /**
* 数据处理 * 数据处理
* @Author MartinSun<syh@sunyonghong.com> * @Author MartinSun<syh@sunyonghong.com>
...@@ -62,6 +73,9 @@ class ExamsPaperModel extends Model ...@@ -62,6 +73,9 @@ class ExamsPaperModel extends Model
$data[$key]['exams_module_title'] = $this->getModuleTitleAttr($v['exams_module_id']); $data[$key]['exams_module_title'] = $this->getModuleTitleAttr($v['exams_module_id']);
$data[$key]['level_title'] = $this->getLevelTitle($v['level']); $data[$key]['level_title'] = $this->getLevelTitle($v['level']);
$data[$key]['is_buy'] = $this->isBuy($v['exams_paper_id'], $this->mid); $data[$key]['is_buy'] = $this->isBuy($v['exams_paper_id'], $this->mid);
if ($data[$key]['is_buy'] || $v['price'] == 0) {
$data[$key]['attach'] = $this->getAttachPathByAttachId($v['attachment']);
}
// 判断自动组卷(1)和手动组卷 // 判断自动组卷(1)和手动组卷
if ($v['assembly_type'] == 1) { if ($v['assembly_type'] == 1) {
$paper_options = unserialize($v['paper_options']); $paper_options = unserialize($v['paper_options']);
......
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
</div> </div>
</div> </div>
<div class="class_right layout_center"> <div class="class_right layout_center">
<div @click="onPay(item)" v-if="item.price > 0" class="button_orange layout_center">¥{{item.price}}</div> <div @click="startDo(item)" v-if="item.price == 0 || item.is_buy" class="button_green layout_center">开始做题</div>
<div @click="startDo(item)" v-if="item.price == 0" class="button_green layout_center">开始做题</div> <div @click="onPay(item)" v-else-if="item.price > 0" class="button_orange layout_center">¥{{item.price}}</div>
</div> </div>
</div> </div>
<span style="margin-top: 35vh;" v-if="zhenti.length == 0" class="text_14_400 color_999999 self_center">没有找到!</span> <span style="margin-top: 35vh;" v-if="zhenti.length == 0" class="text_14_400 color_999999 self_center">没有找到!</span>
...@@ -87,8 +87,8 @@ ...@@ -87,8 +87,8 @@
</div> </div>
</div> </div>
<div class="class_right layout_center"> <div class="class_right layout_center">
<div @click="onPay(item)" v-if="item.price > 0" class="button_orange layout_center">¥{{item.price}}</div> <div v-if="item.price == 0|| item.is_buy" @click="onDownload(item)" class="button_green layout_center">下载试题</div>
<div v-if="item.price == 0" class="button_green layout_center">下载试题</div> <div @click="onPay(item)" v-else-if="item.price > 0" class="button_orange layout_center">¥{{item.price}}</div>
</div> </div>
</div> </div>
<span style="margin-top: 35vh;" v-if="download.length == 0" class="text_14_400 color_999999 self_center">没有找到!</span> <span style="margin-top: 35vh;" v-if="download.length == 0" class="text_14_400 color_999999 self_center">没有找到!</span>
...@@ -248,6 +248,12 @@ ...@@ -248,6 +248,12 @@
}) })
}, },
onDownload: function(item){
if (item.attach) {
window.location.href = item.attach;
}
},
onTopTab: function(tab) { onTopTab: function(tab) {
if(this.tab == 0) { if(this.tab == 0) {
this.loadZhenti() this.loadZhenti()
...@@ -292,7 +298,8 @@ ...@@ -292,7 +298,8 @@
price: r.price, price: r.price,
count: r.questions_count, count: r.questions_count,
time: r.reply_time, time: r.reply_time,
person: r.exams_user + "已做" person: r.exams_user + "已做",
is_buy: r.is_buy
} }
})) }))
if(that.condition.length == 0) { if(that.condition.length == 0) {
...@@ -325,7 +332,9 @@ ...@@ -325,7 +332,9 @@
price: r.price, price: r.price,
count: r.questions_count, count: r.questions_count,
time: r.reply_time, time: r.reply_time,
person: r.exams_user + "已做" person: r.exams_user + "已做",
is_buy: r.is_buy,
attach: r.attach
} }
})) }))
if(that.condition.length == 0) { if(that.condition.length == 0) {
......
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