Skip to content

Commit

Permalink
donate page
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Jin committed Jun 4, 2016
1 parent fbafffa commit 40cb793
Show file tree
Hide file tree
Showing 13 changed files with 1,097 additions and 5 deletions.
2 changes: 2 additions & 0 deletions demo1/imageshare/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
</author>
<content src="index.html" />
<access origin="*" />
<allow-navigation href="http://sissi.pingxx.com/*" />
<allow-navigation href="http://ks3.ksyun.com/*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
Expand Down
79 changes: 78 additions & 1 deletion demo1/imageshare/www/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,88 @@

/*秀场*/
.image-card {
margin-bottom: 40px;
margin:0 0 40px 0;
}

/*.publish-date {*/
/*font-size: 1rem;*/
/*text-decoration: none;*/
/*color: #374265;*/
/*}*/

#page3-list-item-container4, #page4-list-item-container1 {
padding: 0;
}

/* donate */
.pay-content {
width: 100%;
margin: auto;
padding: 14px;
height: auto;
overflow: hidden;
}
.text_amount {
display: block;
margin: 56px auto;
width: 300px;
}
.text_amount input[type="text"] {
width: 100%;
-webkit-transition: all 0.2s ease-out;
-moz-transition: all 0.2s ease-out;
-ms-transition: all 0.2s ease-out;
-o-transition: all 0.2s ease-out;
border-bottom: 1px solid #999999;
}
.text_amount input[type="text"]:focus {
-webkit-transition: all 0.2s ease-out;
-moz-transition: all 0.2s ease-out;
-ms-transition: all 0.2s ease-out;
-o-transition: all 0.2s ease-out;
border-bottom: 1px solid #000000;
}



.ch .up {
width: 20%;
min-width: 91px;
padding: 14px;
cursor: pointer;
margin-right: 20%;
display: block;
float: left;
text-align: center;
font-size: 16px;
-webkit-transition: all 0.2s ease-out;
-moz-transition: all 0.2s ease-out;
-ms-transition: all 0.2s ease-out;
-o-transition: all 0.2s ease-out;
}

.ch .up:hover {
-webkit-transition: all 0.2s ease-out;
-moz-transition: all 0.2s ease-out;
-ms-transition: all 0.2s ease-out;
-o-transition: all 0.2s ease-out;
color: #000000;
}


@media (max-width: 640px) {
.ch .up {
-webkit-transition: all 0.2s ease-out;
-moz-transition: all 0.2s ease-out;
-ms-transition: all 0.2s ease-out;
-o-transition: all 0.2s ease-out;
float: none;
display: inline-block;
width: 100%;
margin-bottom: 28px;
border: 1px solid #374265;
padding: 14px;
margin-right: 10%;
}

}
1 change: 1 addition & 0 deletions demo1/imageshare/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<ion-item id="side-menu21-list-item15" href="#" onclick="window.open('http://ks3.ksyun.com/doc/testtool/ready.html', '_system', 'location=yes'); return false;" class=" " data-componentid="list-item15">测试和工具</ion-item>
<ion-item id="side-menu21-list-item16" href="#" onclick="window.open('http://ks3.ksyun.com/doc/faq/index.html', '_system', 'location=yes'); return false;" class=" " data-componentid="list-item16">FAQ</ion-item>
<ion-item id="side-menu21-list-item17" ui-sref="login" menu-close="" class=" " data-componentid="list-item17">退出</ion-item>
<ion-item id="side-menu21-list-item18" ui-sref="pay" menu-close="" class=" " data-componentid="list-item18">donate</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
Expand Down
17 changes: 14 additions & 3 deletions demo1/imageshare/www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ var ks3app = angular.module('app', ['ionic', 'app.controllers', 'app.routes', 'a
//打开文档链接
$rootScope.open_outer_url = function (url) {
if (window.cordova && window.cordova.InAppBrowser) {
window.cordova.InAppBrowser.open(url, "_blank", 'location=no');
window.cordova.InAppBrowser.open(url, "_self", 'location=yes');
} else {
window.open(url, '_blank');
window.open(url, '_system');
}region
};

Expand Down Expand Up @@ -66,8 +66,19 @@ var ks3app = angular.module('app', ['ionic', 'app.controllers', 'app.routes', 'a
platformConfig[window.$sharesdk.PlatformID.QQPlatform] = qqConf;


//腾讯微博
var tencentWeiboConf = {};
tencentWeiboConf["app_key"] = "801307650";
tencentWeiboConf["app_secret"] = "ae36f4ee3946e1cbb98d6965b0b2ff5c";
tencentWeiboConf["redirect_uri"] = "http://www.sharesdk.cn";
platformConfig[$sharesdk.PlatformID.TencentWeibo] = tencentWeiboConf;

//Mail
var mailConf = {};
platformConfig[$sharesdk.PlatformID.Mail] = mailConf;

//2、初始化ShareSDK
window.$sharesdk.initSDKAndSetPlatfromConfig("1301300a2e8a8", platformConfig); //first param is appKey
window.$sharesdk.initSDKAndSetPlatfromConfig("iosv1101", platformConfig); //first param is appKey 1301300a2e8a8
}

ionic.Platform.ready(function(){
Expand Down
99 changes: 98 additions & 1 deletion demo1/imageshare/www/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ angular.module('app.controllers', [])
};

$sharesdk.showShareMenu(null, params, 100, 100, function (res) {
alert("platform = " + re.platform +"state = " + res.state + "\n shareInfo = " + res.shareInfo + "\n error = " + res.error);
console.log(JSON.stringify(res));
});

}
Expand Down Expand Up @@ -265,3 +265,100 @@ angular.module('app.controllers', [])
}

}])


.controller('payCtrl', function ($rootScope,$scope, CONSTANT) {
//初始化ping++
(function(){
var one_url='./lib/index.js';
var sea_url='./lib/sea.js';
var pingpp_one=function(){};

window.pingpp_one=new pingpp_one();

var e=document.createEvent('Event');
e.initEvent('pingpp_one_ready',true,true);

var use=function(){
seajs.use(one_url,function(index){
var t=index('./init');
var s=index('./success');

pingpp_one.prototype.init=function(opt,callback){
t.init(opt,callback);
};

pingpp_one.prototype.success=function(callback,continueCallback){
s.init(callback,continueCallback);
};

pingpp_one.prototype.resume=function(){
t.resume();
};

document.dispatchEvent(e);
});
};
if(!window.seajs){
var script=document.createElement('script');
script.type='text/javascript';
script.src=sea_url;
document.body.appendChild(script);
script.onload=function(){
use();
};
}
else{
use();
}
})();

$scope.charge = {};
$scope.pay = function() {
//var amount = document.getElementById('amount').value;
pingpp_one.init({
app_id: 'app_iLWzr9iHybvTWjXL', //该应用在 ping++ 的应用 ID
order_no: 'no1234567897', //订单在商户系统中的订单号
amount: $scope.charge.amount, //订单价格,单位:人民币 分
// 壹收款页面上需要展示的渠道,数组,数组顺序即页面展示出的渠道的顺序
// upmp_wap 渠道在微信内部无法使用,若用户未安装银联手机支付控件,则无法调起支付
channel: ['alipay_wap', 'wx_pub', 'upacp_wap', 'yeepay_wap', 'jdpay_wap', 'bfb_wap'],
charge_url: CONSTANT.serverHost + 'pay/createCharge', //商户服务端创建订单的 url
charge_param: {a: 1, b: 2}, //(可选,用户自定义参数,若存在自定义参数则壹收款会通过 POST 方法透传给 charge_url)
open_id: 'wx1234567895', //(可选,使用微信公众号支付时必须传入)
debug: true //(可选,debug 模式下会将 charge_url 的返回结果透传回来)
}, function (res) {
//debug 模式下获取 charge_url 的返回结果
if (res.debug && res.chargeUrlOutput) {
console.log(res.chargeUrlOutput);
}
if (!res.status) {
//处理错误
alert(res.msg);
}
else {
//debug 模式下调用 charge_url 后会暂停,可以调用 pingpp_one.resume 方法继续执行
if (res.debug && !res.wxSuccess) {
if (confirm('当前为 debug 模式,是否继续支付?')) {
pingpp_one.resume();
}
}
//若微信公众号渠道需要使用壹收款的支付成功页面,则在这里进行成功回调,
//调用 pingpp_one.success 方法,你也可以自己定义回调函数
//其他渠道的处理方法请见第 2 节
else pingpp_one.success(function (res) {
if (!res.status) {
alert(res.msg);
}
}, function () {
//这里处理支付成功页面点击“继续购物”按钮触发的方法,
//例如:若你需要点击“继续购物”按钮跳转到你的购买页,
//则在该方法内写入 window.location.href = "你的购买页面 url"
$rootScope.open_outer_url('http://ks3.ksyun.com/');
//window.location.href = 'http://ks3.ksyun.com/';//示例
});
}
});
};
})

5 changes: 5 additions & 0 deletions demo1/imageshare/www/js/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ angular.module('app.routes', [])
controller: 'loginCtrl'
})

.state('pay', {
url: '/pay',
templateUrl: 'templates/onepay.html',
controller: 'payCtrl'
})
$urlRouterProvider.otherwise('/login')


Expand Down
3 changes: 3 additions & 0 deletions demo1/imageshare/www/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ angular.module('app.services', [])
return $http({
method: 'get',
url: CONSTANT.dbHost,
params:{
'limit': 5
},
cache: false
}).then(function(res) {
deferral.resolve(res);
Expand Down
Loading

0 comments on commit 40cb793

Please sign in to comment.