Commit 08059838 authored by xiabin's avatar xiabin

修改vue文件

parent 35217efb
<script>
import Vue from 'vue';
export default new Vue();
</script>
<template> <template>
<div class="container v-list mx900" v-show="lists.length > 0"> <div class="container v-list mx900" v-show="lists.length > 0">
<div class="row"> <div class="row">
<div v-for="(index,item) in lists" class="col-md-4"> <div v-for="(item,index) in lists" class="col-md-4">
<div class="v-main-box"> <div class="v-main-box">
<div class="v-screen"> <div class="v-screen">
<a @click="itemClick(item.id)" href="javascript:;"> <a @click="itemClick(item.id)" href="javascript:;">
...@@ -111,11 +111,13 @@ ...@@ -111,11 +111,13 @@
classId: { classId: {
required: true required: true
} }
} },
, mounted()
ready()
{ {
this.getLists(this.classId, this.page, this.num); var self = this;
this.nextTick(function(){
self.getLists(self.classId, self.page, self.num);
});
} }
} }
</script> </script>
...@@ -67,9 +67,12 @@ ...@@ -67,9 +67,12 @@
} }
}, },
components: {}, components: {},
ready() mounted()
{ {
this.getLists(this.classId); var self = this;
this.$nextTick(function () {
self.getLists(this.classId);
});
} }
} }
</script> </script>
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
<div class="container"> <div class="container">
<div class="video-description"> <div class="video-description">
<div class="title">课程介绍</div> <div class="title">课程介绍</div>
<div class="text"> <div v-html="coursewareInfo.intro" class="text">
{{{coursewareInfo.intro}}}
</div> </div>
</div> </div>
...@@ -147,8 +146,11 @@ ...@@ -147,8 +146,11 @@
}); });
} }
}, },
ready(){ mounted(){
this.getCommentlists(this.coursewareInfo.id, this.page, this.num); var self = this;
this.$nextTick(function () {
self.getCommentlists(self.coursewareInfo.id, self.page, self.num);
});
} }
} }
</script> </script>
<template xmlns:v-el="http://www.w3.org/1999/xhtml"> <template xmlns:ref="http://www.w3.org/1999/xhtml">
<div class="container"> <div class="container">
<div class="cnt-tit"> <div class="cnt-tit">
<h3>{{coursewareInfo.courseName}}</h3> <h3>{{coursewareInfo.courseName}}</h3>
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
</div> </div>
</div> </div>
<div :class="{'video-detail-info':true,'video-detail-phone':coursewareInfo.teachers.length == 0}"> <div :class="{'video-detail-info':true,'video-detail-phone':coursewareInfo.teachers.length == 0}">
<div v-for="(index,item) in coursewareInfo.teachers" class="video-teacher"> <div v-for="(item,index) in coursewareInfo.teachers" class="video-teacher">
<a data-toggle="modal" data-target="{{{'#teacherInfo'+index}}}"><img <a data-toggle="modal" :data-target="'#teacherInfo'+index"><img
:src="item.avatar"></a> :src="item.avatar"></a>
<p><a href="javascript:;" data-toggle="modal" data-target="#myModal2">{{item.name}}</a></p> <p><a href="javascript:;" data-toggle="modal" data-target="#myModal2">{{item.name}}</a></p>
</div> </div>
...@@ -108,14 +108,14 @@ ...@@ -108,14 +108,14 @@
<div class="top-back-a"> <div class="top-back-a">
<a href="javascript:;" @click="showQrcode = false"><i class="icon-navigate_before"></i>返回支付渠道选择</a> <a href="javascript:;" @click="showQrcode = false"><i class="icon-navigate_before"></i>返回支付渠道选择</a>
</div> </div>
<div v-el:weixin-qrcode class="qrcode-img"> <div ref:weixinQrcode class="qrcode-img">
<span>正在加载</span> <span>正在加载</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div v-for="(index,item) in coursewareInfo.teachers" class="modal fade" id="{{{'teacherInfo'+index}}}" tabindex="-1" <div v-for="(index,item) in coursewareInfo.teachers" class="modal fade" :id="'teacherInfo'+index" tabindex="-1"
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
<div class="teacher-info text-center"> <div class="teacher-info text-center">
<img :src="item.avatar"> <img :src="item.avatar">
<h3>{{item.name}}</h3> <h3>{{item.name}}</h3>
<p class="teacher-detail">{{{item.intro}}}</p> <p class="teacher-detail" v-html="item.intro"></p>
</div> </div>
</div> </div>
</div> </div>
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
$.getJSON(url, function (response) { $.getJSON(url, function (response) {
if (response.status !== false) { if (response.status !== false) {
var imgUrl = __BASE_URL__ + 'home/get-qrcode?number=' + response.data.number; var imgUrl = __BASE_URL__ + 'home/get-qrcode?number=' + response.data.number;
$(self.$els.weixinQrcode).html('<img src="' + imgUrl + '"/> <p>请使用微信扫一扫付款</p>'); $(self.$refs.weixinQrcode).html('<img src="' + imgUrl + '"/> <p>请使用微信扫一扫付款</p>');
//添加监听 //添加监听
clearInterval(self.weixinCheckHandler); clearInterval(self.weixinCheckHandler);
self.weixinCheckHandler = setInterval(function () { self.weixinCheckHandler = setInterval(function () {
...@@ -313,21 +313,25 @@ ...@@ -313,21 +313,25 @@
components: { components: {
myvideo: myvideo myvideo: myvideo
}, },
ready(){ mounted(){
var self = this; var self = this;
this.isMobile = this.coursewareInfo.isMobile;
this.isWeixin = Utils.isWeixin(); this.$nextTick(function(){
//判断是否要显示支付信息 self.isMobile = self.coursewareInfo.isMobile;
var pay = getQueryString('pay'); self.isWeixin = Utils.isWeixin();
if (pay == 1 && !this.coursewareInfo.isShop) { //判断是否要显示支付信息
if(this.isMobile == false && this.isWeixin == false){ var pay = getQueryString('pay');
$('#web-pay').trigger('click'); if (pay == 1 && !self.coursewareInfo.isShop) {
}else if(this.isMobile == true && this.isWeixin == false){ if(self.isMobile == false && self.isWeixin == false){
this.mobileAliPay(this.coursewareInfo.course_id); $('#web-pay').trigger('click');
}else if(this.isWeixin === true){ }else if(self.isMobile == true && self.isWeixin == false){
this.weixinJsPay(this.coursewareInfo.course_id); self.mobileAliPay(self.coursewareInfo.course_id);
}else if(self.isWeixin === true){
self.weixinJsPay(self.coursewareInfo.course_id);
}
} }
} });
} }
} }
......
...@@ -51,10 +51,10 @@ ...@@ -51,10 +51,10 @@
}, },
methods: { methods: {
pay(){ pay(){
this.$dispatch('pay-click'); this.$emit('payClick');
} }
}, },
ready(){ mounted(){
if (this.videoInfo.isShop) { if (this.videoInfo.isShop) {
this.showTips = false; this.showTips = false;
......
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