Commit 7f3bf94a by 冷斌

fix bug

parent a039f927
...@@ -119,9 +119,9 @@ ...@@ -119,9 +119,9 @@
</if> </if>
<else /> <else />
<if condition="$vo['price'] eq 0 or $vo['is_buy'] eq 1"> <if condition="$vo['price'] eq 0 or $vo['is_buy'] eq 1">
<div @click="onDownload({$vo['exams_paper_id']})" class="home_button_green layout_center">下载试题</div> <div @click="onDownload('{$vo['exams_paper_title']}', {$vo['exams_paper_id']})" class="home_button_green layout_center">下载试题</div>
<else /> <else />
<div @click="onDownload({$vo['exams_paper_id']})" class="home_button_orange layout_center">下载预览</div> <div @click="showYulan({$vo['exams_paper_id']})" class="home_button_orange layout_center">下载预览</div>
</if> </if>
</if> </if>
...@@ -239,11 +239,26 @@ ...@@ -239,11 +239,26 @@
close_yulan: function () { close_yulan: function () {
this.exams_paper_id = 0; this.exams_paper_id = 0;
}, },
onDownload: function (isBuy, price, path) { onDownload: function (title, path) {
// if ( path ) { if ( path ) {
// window.location.href = path; var link = document.createElement('a');
// } // 设置下载的文件名
this.exams_paper_id = isBuy; link.download = title;
link.style.display = 'none';
//设置下载路径
link.href = path;
//触发点击
document.body.appendChild(link);
link.click();
//移除节点
document.body.removeChild(link);
this.close_yulan();
} else {
alert('当前课程无文件下载');
}
},
showYulan: function (id) {
this.exams_paper_id = id;
}, },
onPay: function(id) { onPay: function(id) {
if (MID <= 0) { if (MID <= 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