静态页面目录\static\course\detail\course_main_template.html
#学成网静态资源
server {
listen 91;
server_name localhost;
#公司信息
location /static/company/ {
alias F:/develop/xuecheng/static/company/;
#老师信息
location /static/teacher/ {
alias F:/develop/xuecheng/static/teacher/;
}
#统计信息
location /static/stat/ {
alias F:/develop/xuecheng/static/stat/;
}
location /course/detail/ {
alias F:/develop/xuecheng/static/course/detail/;
}
}
location /static/company/ {
proxy_pass http://static_server_pool;
}
location /static/teacher/ {
proxy_pass http://static_server_pool;
}
location /static/stat/ {
proxy_pass http://static_server_pool;
}
location /course/detail/ {
proxy_pass http://static_server_pool;
}
#静态资源服务
upstream static_server_pool{
server 127.0.0.1:91 weight
=10;
}
#静态资源,包括系统所需要的图片,js、css等静态资源
location /static/img/ {
alias F:/develop/xc_portal_static/img/;
}
location /static/css/ {
alias F:/develop/xc_portal_static/css/;
}
location /static/js/ {
alias F:/develop/xc_portal_static/js/;
}
location /static/plugins/ {
alias F:/develop/xc_portal_static/plugins/;
add_header Access
‐
Control
‐
Allow
‐
Origin http://ucenter.xuecheng
.com;
add_header Access
‐
Control
‐
Allow
‐
Credentials true;
add_header Access
‐
Control
‐
Allow
‐
Methods GET;
}
<script>var courseId
=
"
template
"
</script>
<!
‐‐
#include virtual=
"
/include/course_detail_dynamic.html
"
‐‐
>
</body>
</html>
主要查看 created钩子函数的内容。
var body
= new Vue({ //创建
一
个Vue的实例
el:
"
#body
"
, //挂载点是id
=
"
app
"
的地方
data: {
editLoading: false,
title:
'
测试
'
,
courseId:
''
,
charge:
''
,//203001免费,203002收费
learnstatus:0,//课程状态,1:马上学习,2:立即报名、3:立即购买
course:{},
companyId:
'
template
'
,
company_stat:[],
course_stat:{
"
s601001
"
:
""
,
"
s601002
"
:
""
,
"
s601003
"
:
""
}
},
methods: {
//学习报名
addopencourse(){
...
},
//立即购买
buy(){
...
},
createOrder(){
...
},
getLearnstatus(){//获取学习状态
...
}
},
created() {
// this.charge
=
'
203002
'
this.courseId
=
courseId;
//获取教育机构的统计数据
queryCompanyStat(this.companyId)
.then((res)
=
>{
console.log(res)
if(res.stat){
this.company_stat
= res.stat
console.log(this.company_stat)
}
})
//获取课程的统计数据
queryCourseStat(this.courseId)
.then((res)
=
>{
console.log(res)
if(res.stat){
let stat
= res.stat
for(var i=
0;i<stat.length;i++){
this.course_stat[
'
s
'
+stat
.id]
=
stat
.value
}
}
console.log(this.course_stat)
})
},
mounted(){
// alert(courseId)
}
})
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |