123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- angular.module('push')
- .controller('buildResourceInitCtrl', function ($scope, $ionicActionSheet, ModelService, $stateParams, UtilService) {
- if($scope.app){
- $scope.setStatusBar(0);
- }
- $scope.addListBack = function () {
- $scope.goback();
- };
- //有无知识产权:0:有 1:无
- $scope.typenam = ["未选择","能源", "新材料"];
- var listindex;
- if (UtilService.isDefined($stateParams.theme)) {
- $scope.temptheme = $stateParams.theme;
- $scope.index = $stateParams.theme.type +1;
- listindex = $stateParams.index;
- } else {
- $scope.temptheme = {title: "", type: 0, content: ""};
- $scope.index = 0;
- }
- /*有无知识产权*/
- $scope.show1= function () {
- $ionicActionSheet.show({
- buttons: [
- {text: '<a class="action-sheet-push">能源</a>'},
- {text: '<a class="action-sheet-push">新材料</a>'}
- ],
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.index = 2 - index;
- $scope.temptheme.type = 2 - index ;
- return true;
- }
- });
- };
- //有无知识产权:0:有 1:无
- $scope.typename2 = ["未选择","有", "无"];
- var listindex;
- if (UtilService.isDefined($stateParams.theme)) {
- $scope.temptheme2 = $stateParams.theme;
- $scope.index = $stateParams.theme.type +1;
- listindex = $stateParams.index;
- } else {
- $scope.temptheme2 = {title: "", type: 0, content: ""};
- $scope.index = 0;
- }
- /*有无知识产权*/
- $scope.show2= function () {
- $ionicActionSheet.show({
- buttons: [
- {text: '<a class="action-sheet-push">有</a>'},
- {text: '<a class="action-sheet-push">无</a>'}
- ],
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.index = 2 - index;
- $scope.temptheme2.type = 2 - index ;
- return true;
- }
- });
- };
- //研发进度:0:正在研发 1:已有小样 2:通过小试 3:通过中试 4:可以量产
- $scope.typename3 = ["未选择","正在研发", "已有小样" ,"通过小试","通过中试" ,"可以量产"];
- var listindex;
- if (UtilService.isDefined($stateParams.theme)) {
- $scope.temptheme3 = $stateParams.theme;
- $scope.index = $stateParams.theme.type +1;
- listindex = $stateParams.index;
- } else {
- $scope.temptheme3 = {title: "", type:1, content: ""};
- $scope.index = 0;
- }
- /*研发进度*/
- $scope.show3= function () {
- $ionicActionSheet.show({
- buttons: [
- {text: '<a class="action-sheet-push">正在研发</a>'},
- {text: '<a class="action-sheet-push">已有小样</a>'},
- {text: '<a class="action-sheet-push">通过小试</a>'},
- {text: '<a class="action-sheet-push">通过中试</a>'},
- {text: '<a class="action-sheet-push">可以量产</a>'}
- ],
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.index = 5 - index;
- $scope.temptheme3.type = 5 - index;
- return true;
- }
- });
- };
- //合作模式:0:委托开发 1:合作研发 2:成果转让 3:技术入股 4:技术咨询 5:其他
- $scope.typename4 = ["未选择","委托开发", "合作研发" ,"成果转让","技术入股" ,"技术咨询","其他"];
- var listindex;
- if (UtilService.isDefined($stateParams.theme)) {
- $scope.temptheme4 = $stateParams.theme;
- $scope.index = $stateParams.theme.type +1;
- listindex = $stateParams.index;
- } else {
- $scope.temptheme4 = {title: "", type:1, content: ""};
- $scope.index = 0;
- }
- /*合作模式*/
- $scope.show4= function () {
- $ionicActionSheet.show({
- buttons: [
- {text: '<a class="action-sheet-push">委托开发</a>'},
- {text: '<a class="action-sheet-push">合作研发</a>'},
- {text: '<a class="action-sheet-push">成果转让</a>'},
- {text: '<a class="action-sheet-push">技术入股</a>'},
- {text: '<a class="action-sheet-push">技术咨询</a>'},
- {text: '<a class="action-sheet-push">其他</a>'}
- ],
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.index =6 - index;
- $scope.temptheme4.type =6 - index;
- return true;
- }
- });
- };
- /*选取照片*/
- $scope.showPicture = function () {
- $ionicActionSheet.show({
- buttons: [
- {text: '<a class="action-sheet-push">拍照</a>'},
- {text: '<a class="action-sheet-push">从相册中添加</a>'}
- ],
- cancelText: '取消',
- buttonClicked: function (index) {
- if (index == 0) {
- $scope.openCamera = function () {
- if ($scope.images.length >= 18) {
- UtilService.showMess("最多选取18张图片");
- return;
- }
- UtilService.getPicture(1).then(function (results) {
- $scope.images.push(results);
- $scope.totalImglength = 600 * $scope.images.length;
- $ionicScrollDelegate.$getByHandle("scrollimage").resize();
- }, function (err) {
- });
- };
- } else if (index == 1) {
- getPictures();
- }
- return true;
- }
- });
- };
- var getPictures = function () {
- if (device.platform == "Android") {
- verifyStorage();
- } else {
- getPic();
- }
- };
- $scope.settingsList = [
- { text: "置顶", checked: true }
- ];
- });
|