|
@@ -467,20 +467,55 @@
|
|
$scope.showWithdraw = false;
|
|
$scope.showWithdraw = false;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ userService.isTest().then(function(res){
|
|
|
|
+ if(res.data.data){
|
|
|
|
+ Wechat.auth(scope, state, function (response) {
|
|
|
|
+ // var response={code:1231};
|
|
|
|
+ if(response.code){
|
|
|
|
+ msg.loading('登录中...');
|
|
|
|
+ userService.wechat_login(response.code).then(function(result){
|
|
|
|
+ msg.hide();
|
|
|
|
+ if(result.data.data.user){
|
|
|
|
+ storage.setObject('user', result.data.data.user);
|
|
|
|
+ storage.set('token', result.data.data.token);
|
|
|
|
+ $http.defaults.headers.common["Authorization"] = 'Bearer ' + result.data.data.token;
|
|
|
|
+ $scope.user=storage.getObject('user');
|
|
|
|
+ $state.go('app.home');
|
|
|
|
+ if(localStorage['jpush']){
|
|
|
|
+ console.log("jpush: " + localStorage['jpush']);
|
|
|
|
+ userService.jpush({ jpush: localStorage['jpush']}).then(function (result) {}, function (error) {});
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ $state.go("loginAccount",{wechat:result.data.data.openid})
|
|
|
|
+ }
|
|
|
|
+ },function(error){
|
|
|
|
+ console.log("loginbywx Failed: " + JSON.stringify(error));
|
|
|
|
+ $state.go("loginAccount");
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }, function (error) {
|
|
|
|
+ console.log("Failed: " + JSON.stringify(error));
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ $state.go("loginAccount",{wechat:'orrk51inhmfmQRXA8VvGEQfow3Es'});
|
|
|
|
+ }
|
|
|
|
+ })
|
|
if($scope.ios.isIOS){
|
|
if($scope.ios.isIOS){
|
|
var productIds = ['apple10001','apple102','apple103','apple104']; // <- Add your product Ids here
|
|
var productIds = ['apple10001','apple102','apple103','apple104']; // <- Add your product Ids here
|
|
msg.loading();
|
|
msg.loading();
|
|
- inAppPurchase
|
|
|
|
- .getProducts(productIds)
|
|
|
|
- .then(function (products) {
|
|
|
|
- msg.hide();
|
|
|
|
- $scope.products = products;
|
|
|
|
- console.log('products:'+JSON.stringify(products));
|
|
|
|
- })
|
|
|
|
- .catch(function (err) {
|
|
|
|
|
|
+ // inAppPurchase
|
|
|
|
+ // .getProducts(productIds)
|
|
|
|
+ // .then(function (products) {
|
|
|
|
+ // msg.hide();
|
|
|
|
+ // $scope.products = products;
|
|
|
|
+ // console.log('products:'+JSON.stringify(products));
|
|
|
|
+ // })
|
|
|
|
+ // .catch(function (err) {
|
|
msg.hide();
|
|
msg.hide();
|
|
- console.log(err);
|
|
|
|
- });
|
|
|
|
|
|
+ // console.log(err);
|
|
|
|
+ // });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
$scope.payExplain = function(){
|
|
$scope.payExplain = function(){
|
|
@@ -870,7 +905,7 @@
|
|
// var file = config.imgServer+response.data.file;
|
|
// var file = config.imgServer+response.data.file;
|
|
// $scope.video.file = response.data.file;
|
|
// $scope.video.file = response.data.file;
|
|
$scope.video.server = response.data.file;
|
|
$scope.video.server = response.data.file;
|
|
- var file = config.imgServer+response.data.file;
|
|
|
|
|
|
+ var file = response.data.file;
|
|
$scope.video.isOK = true;
|
|
$scope.video.isOK = true;
|
|
$scope.video.file = file;
|
|
$scope.video.file = file;
|
|
$scope.video.vpic = config.server+'upload/vpic/'+response.data.file+'.jpg';
|
|
$scope.video.vpic = config.server+'upload/vpic/'+response.data.file+'.jpg';
|