| xqd
@@ -1,6 +1,6 @@
|
|
|
(function (app) {
|
|
|
- app.controller('addCtrl', ["$scope", "$state", "dreamService", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate","$ionicHistory", "common", "config"
|
|
|
- , function ($scope, $state, dreamService, msg, $ionicTabsDelegate, $ionicNavBarDelegate,$ionicHistory, common, config) {
|
|
|
+ app.controller('addCtrl', ["$scope", "$state", "dreamService", "msg", "$ionicTabsDelegate", '$ionicModal',"$ionicNavBarDelegate","$ionicHistory", "common", "config"
|
|
|
+ , function ($scope, $state, dreamService, msg, $ionicTabsDelegate,$ionicModal, $ionicNavBarDelegate,$ionicHistory, common, config) {
|
|
|
|
|
|
$scope.addpict = function () {
|
|
|
common.chooseImage().then(function (img) {
|
| xqd
@@ -51,25 +51,30 @@
|
|
|
})
|
|
|
};
|
|
|
$scope.add = function () {
|
|
|
- var data = {
|
|
|
- // pics:['http://img0.imgtn.bdimg.com/it/u=2398075737,160631337&fm=214&gp=0.jpg'],
|
|
|
- pics: $scope.imgs,
|
|
|
- video: $scope.video.server,
|
|
|
- name: $scope.vm.name,
|
|
|
- about: $scope.vm.about,
|
|
|
- days: 21, //默认21
|
|
|
- coin: $scope.vm.coin
|
|
|
- };
|
|
|
- //msg.loading('保存中...');
|
|
|
- msg.loading();
|
|
|
- dreamService.addDream(data).then(function (result) {
|
|
|
- msg.hide();
|
|
|
- msg.text("梦想发布成功");
|
|
|
- $state.go('app.home');
|
|
|
- }, function (error) {
|
|
|
- msg.hide();
|
|
|
- msg.error(error.data.message);
|
|
|
- });
|
|
|
+ if(document.getElementById('read').checked){
|
|
|
+ var data = {
|
|
|
+ // pics:['http://img0.imgtn.bdimg.com/it/u=2398075737,160631337&fm=214&gp=0.jpg'],
|
|
|
+ pics: $scope.imgs,
|
|
|
+ video: $scope.video.server,
|
|
|
+ name: $scope.vm.name,
|
|
|
+ about: $scope.vm.about,
|
|
|
+ days: 21, //默认21
|
|
|
+ coin: $scope.vm.coin
|
|
|
+ };
|
|
|
+ //msg.loading('保存中...');
|
|
|
+ msg.loading();
|
|
|
+ dreamService.addDream(data).then(function (result) {
|
|
|
+ msg.hide();
|
|
|
+ msg.text("梦想发布成功");
|
|
|
+ $state.go('app.home');
|
|
|
+ }, function (error) {
|
|
|
+ msg.hide();
|
|
|
+ msg.error(error.data.message);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ msg.error('请同意用户隐私条款');
|
|
|
+ }
|
|
|
};
|
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
|
$scope.imgs=[];
|
| xqd
@@ -81,6 +86,21 @@
|
|
|
};
|
|
|
$ionicTabsDelegate.showBar(false);
|
|
|
});
|
|
|
+
|
|
|
+ // 隐私条款
|
|
|
+ $ionicModal.fromTemplateUrl('readClause.html', {
|
|
|
+ scope: $scope,
|
|
|
+ animation: 'slide-in-up'
|
|
|
+ }).then(function(modal) {
|
|
|
+ $scope.readClauseModal = modal;
|
|
|
+ });
|
|
|
+ $scope.readClause = function($event){
|
|
|
+ $event.stopPropagation();
|
|
|
+ $scope.readClauseModal.show();
|
|
|
+ }
|
|
|
+ $scope.closeClause = function() {
|
|
|
+ $scope.readClauseModal.hide();
|
|
|
+ };
|
|
|
}]);
|
|
|
|
|
|
app.controller('addExplainCtrl', ["$scope","$ionicTabsDelegate", "$state", "dreamService", "msg","storage"
|