Commit 02ad470b authored by xiabin's avatar xiabin

修改支付的回调

parent 11252da2
<?php
/**
* Created by PhpStorm.
* User: xiabin
* Date: 2016/10/27
* Time: 上午11:52
*/
namespace console\controllers;
use yii\console\Controller;
class TestController extends Controller
{
public function actionIndex(){
$t=mktime();
set_time_limit(1000);
$myFile="./insert.sql";
$fhandler=fopen($myFile,'wb');
if($fhandler){
$sql="268\t2\t'0,262,268,'\t0\t '2342'\t'423423'\t'123123'\t'23423423'\t'2012-01-09 09:55:43'\t'upload/product/20111205153432_53211.jpg'\t'upload/product/thumb_20111205153432_53211.jpg'\tNULL\tNULL\t38\t'件'\t''\t123\t123\t0";
$i=0;
while($i<10)//1,000,000
{
$i++;
fwrite($fhandler,$sql."\r\n");
}
echo"写入成功,耗时:",mktime()-$t;
}
}
}
\ No newline at end of file
...@@ -13,11 +13,13 @@ ...@@ -13,11 +13,13 @@
<a href="javascript:;" class="qzone post-icons bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a> <a href="javascript:;" class="qzone post-icons bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
</div> </div>
</div> </div>
<myvideo v-if="!coursewareInfo.isPreview" :preview-url="coursewareInfo.previewUrl" :video-url="coursewareInfo.videoUrl"></myvideo> <myvideo v-if="!coursewareInfo.isPreview" :preview-url="coursewareInfo.previewUrl"
:video-url="coursewareInfo.videoUrl"></myvideo>
<div v-else class="video-main"> <div v-else class="video-main">
<div class="video-empty" style="height:500px; width: 100%; background-color: #444; color: #fff; text-align: center;"> <div class="video-empty"
style="height:500px; width: 100%; background-color: #444; color: #fff; text-align: center;">
<i class="icon-clock"></i> <i class="icon-clock"></i>
<p>课程审核中,审核通过后大家才可以看到您的课程 <br /> <p>课程审核中,审核通过后大家才可以看到您的课程 <br/>
审核结果将以短信形式通知您</p> 审核结果将以短信形式通知您</p>
</div> </div>
</div> </div>
...@@ -37,13 +39,13 @@ ...@@ -37,13 +39,13 @@
</p> </p>
<p v-else class="mb-right"> <p v-else class="mb-right">
<a href="javascript:;"><i class="icon-comment-empty"></i>{{coursewareInfo.comment_count}}</a> <a href="javascript:;"><i class="icon-comment-empty"></i>{{coursewareInfo.comment_count}}</a>
<a href="javascript:;"><i <a href="javascript:;"><i
:class="{'icon-fav-full':coursewareInfo.isFavorite,'icon-fav-empty':!coursewareInfo.isFavorite}"></i>{{coursewareInfo.favorite_count}}</a> :class="{'icon-fav-full':coursewareInfo.isFavorite,'icon-fav-empty':!coursewareInfo.isFavorite}"></i>{{coursewareInfo.favorite_count}}</a>
<a href="javascript:;"><i <a href="javascript:;"><i
:class="{'icon-zan-full':coursewareInfo.isSupport,'icon-zan-empty':!coursewareInfo.isSupport}"></i>{{coursewareInfo.support_count}}</a> :class="{'icon-zan-full':coursewareInfo.isSupport,'icon-zan-empty':!coursewareInfo.isSupport}"></i>{{coursewareInfo.support_count}}</a>
</p> </p>
<button v-if="coursewareInfo.isPreview" class="btn btn-danger m-l-20 mb-left">购买 <button v-if="coursewareInfo.isPreview" class="btn btn-danger m-l-20 mb-left">购买
¥{{coursewareInfo.price}} ¥{{coursewareInfo.price}}
</button> </button>
<template v-else> <template v-else>
...@@ -55,7 +57,8 @@ ...@@ -55,7 +57,8 @@
data-toggle="modal" disabled="disabled">已购买 data-toggle="modal" disabled="disabled">已购买
</button> </button>
<template v-else> <template v-else>
<button v-if="isMobile === false && isWeixin === false" class="btn btn-danger m-l-20 mb-left" <button id="web-pay" v-if="isMobile === false && isWeixin === false"
class="btn btn-danger m-l-20 mb-left"
data-toggle="modal" data-toggle="modal"
data-target="#pay">购买 ¥{{coursewareInfo.price}} data-target="#pay">购买 ¥{{coursewareInfo.price}}
</button> </button>
...@@ -189,14 +192,14 @@ ...@@ -189,14 +192,14 @@
}, },
mobileAliPay(courseId){ mobileAliPay(courseId){
var url = __BASE_URL__ + 'home/pay?courseId=' + courseId; var url = __BASE_URL__ + 'home/pay?courseId=' + courseId;
window.location.href = url; window.location.href = url;
}, },
weixinJsPay(courseId){ weixinJsPay(courseId){
var url = __BASE_URL__ + 'weixin-js-pay/index?courseId=' + courseId; var url = __BASE_URL__ + 'weixin-js-pay/index?courseId=' + courseId;
window.location.href = url; window.location.href = url;
}, },
login(){ login(){
var returnUrl = __BASE_URL__ + 'home/video?courseId=' + this.coursewareInfo.course_id; var returnUrl = __BASE_URL__ + 'home/video?courseId=' + this.coursewareInfo.course_id + '&pay=1';
var url = __BASE_URL__ + 'site/set-return-url?url=' + returnUrl; var url = __BASE_URL__ + 'site/set-return-url?url=' + returnUrl;
$.getJSON(url, function () { $.getJSON(url, function () {
window.location.href = __BASE_URL__ + 'site/login'; window.location.href = __BASE_URL__ + 'site/login';
...@@ -251,22 +254,37 @@ ...@@ -251,22 +254,37 @@
} }
}, },
components: { components: {
myvideo:myvideo myvideo: myvideo
}, },
ready(){ ready(){
var self = this; var self = this;
this.isMobile = this.coursewareInfo.isMobile; this.isMobile = this.coursewareInfo.isMobile;
this.isWeixin = Utils.isWeixin(); this.isWeixin = Utils.isWeixin();
//判断是否要显示支付信息
var pay = getQueryString('pay');
if (pay == 1 && !this.coursewareInfo.isShop) {
if(this.isMobile == false && this.isWeixin == false){
$('#web-pay').trigger('click');
}else if(this.isMobile == true && this.isWeixin == false){
this.mobileAliPay(this.coursewareInfo.course_id);
}else if(this.isWeixin === true){
this.weixinJsPay(this.coursewareInfo.course_id);
}
}
} }
} }
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
var context = "";
if (r != null)
context = r[2];
reg = null;
r = null;
return context == null || context == "" || context == "undefined" ? "" : context;
}
</script> </script>
......
...@@ -36,11 +36,11 @@ ...@@ -36,11 +36,11 @@
"poster": self.previewUrl "poster": self.previewUrl
}).ready(function () { }).ready(function () {
$('#my-video-play').css('width', '100%'); $('#my-video-play').css('width', '100%');
var wVideo = $('.video-detail-info').width(); var wVideo = $('#my-video-play').width();
var hVideo = wVideo * rate; var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo); $('#my-video-play').css('height', hVideo);
window.onresize = function () { window.onresize = function () {
var wVideo = $('.video-detail-info').width(); var wVideo = $('#my-video-play').width();
var hVideo = wVideo * rate; var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo); $('#my-video-play').css('height', hVideo);
}; };
......
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