Commit bfc1d384 by 冷斌

fix bug

parent 730808d4
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
</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_title']}', {$vo['exams_paper_id']})" class="home_button_green layout_center">下载试题</div> <div @click="onDownload('{$vo['exams_paper_title']}', {$vo['attach']})" class="home_button_green layout_center">下载试题</div>
<else /> <else />
<div @click="showYulan({$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>
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
<else />¥{$vo['price']}</if> <else />¥{$vo['price']}</if>
</span> </span>
<if condition="$vo['price'] eq 0 or $vo['is_buy'] eq 1"> <if condition="$vo['price'] eq 0 or $vo['is_buy'] eq 1">
<van-image @click="onDownload('{$vo['exams_paper_title']}', {$vo['exams_paper_id']})" src="__THEME__/img/down_load_icon.png" width="13" height="16"></van-image> <van-image @click="onDownload('{$vo['exams_paper_title']}', {$vo['attach']})" src="__THEME__/img/down_load_icon.png" width="13" height="16"></van-image>
<else /> <else />
<van-image @click="showYulan({$vo['exams_paper_id']})" src="__THEME__/img/down_load_icon.png" width="13" height="16"></van-image> <van-image @click="showYulan({$vo['exams_paper_id']})" src="__THEME__/img/down_load_icon.png" width="13" height="16"></van-image>
</if> </if>
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
<div class="tips_title">提示</div> <div class="tips_title">提示</div>
<div class="tips_body">套餐下架后用户便无法找到该商品进行购买,你确定要下架吗?</div> <div class="tips_body">套餐下架后用户便无法找到该商品进行购买,你确定要下架吗?</div>
<div class="tips_foot"> <div class="tips_foot">
<div @click="onDownload('{$vo['exams_paper_title']}', {$vo['exams_paper_id']})" class="tips_foot_L" >下载预览</div> <div @click="onDownload('{$vo['exams_paper_title']}', {$vo['attach']})" class="tips_foot_L" >下载预览</div>
<div @click="onPay({$vo['exams_paper_id']})" class="tips_foot_R">下载全部</div> <div @click="onPay({$vo['exams_paper_id']})" class="tips_foot_R">下载全部</div>
</div> </div>
</div> </div>
...@@ -246,7 +246,17 @@ ...@@ -246,7 +246,17 @@
}, },
onDownload: function (title, path) { onDownload: function (title, path) {
if ( path ) { if ( path ) {
window.location.href = path; var link = document.createElement('a');
// 设置下载的文件名
link.download = title;
link.style.display = 'none';
//设置下载路径
link.href = path;
//触发点击
document.body.appendChild(link);
link.click();
//移除节点
document.body.removeChild(link);
this.close_yulan(); this.close_yulan();
} else { } else {
alert('当前课程无文件下载'); alert('当前课程无文件下载');
......
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