Mike před 9 roky
rodič
revize
ccda1cc062

+ 53 - 53
wl/config.xml

xqd xqd
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <widget id="com.uhisport.football" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
   <name>掌上物流网</name>
   <description>
@@ -7,62 +7,62 @@
   <author email="you@example.com" href="http://example.com.com/">
       Your Name Here
     </author>
-  <content src="index.html" />
+  <content src="index.html"/>
   <platform name="android">
-    <icon density="ldpi" src="resources/android/icon/icon.png" />
-    <icon density="mdpi" src="resources/android/icon/icon.png" />
-    <icon density="hdpi" src="resources/android/icon/icon.png" />
-    <icon density="xhdpi" src="resources/android/icon/icon.png" />
+    <icon density="ldpi" src="resources/android/icon/icon.png"/>
+    <icon density="mdpi" src="resources/android/icon/icon.png"/>
+    <icon density="hdpi" src="resources/android/icon/icon.png"/>
+    <icon density="xhdpi" src="resources/android/icon/icon.png"/>
   </platform>
   <platform name="ios">
-    <icon height="180" src="resources/android/icon/icon.png" width="180" />
-    <icon height="60" src="resources/android/icon/icon.png" width="60" />
-    <icon height="120" src="resources/android/icon/icon.png" width="120" />
-    <icon height="76" src="resources/android/icon/icon.png" width="76" />
-    <icon height="152" src="resources/android/icon/icon.png" width="152" />
-    <icon height="40" src="resources/android/icon/icon.png" width="40" />
-    <icon height="80" src="resources/android/icon/icon.png" width="80" />
-    <icon height="57" src="resources/android/icon/icon.png" width="57" />
-    <icon height="114" src="resources/android/icon/icon.png" width="114" />
-    <icon height="72" src="resources/android/icon/icon.png" width="72" />
-    <icon height="144" src="resources/android/icon/icon.png" width="144" />
-    <icon height="29" src="resources/android/icon/icon.png" width="29" />
-    <icon height="58" src="resources/android/icon/icon.png" width="58" />
-    <icon height="50" src="resources/android/icon/icon.png" width="50" />
-    <icon height="100" src="resources/android/icon/icon.png" width="100" />
+    <icon height="180" src="resources/android/icon/icon.png" width="180"/>
+    <icon height="60" src="resources/android/icon/icon.png" width="60"/>
+    <icon height="120" src="resources/android/icon/icon.png" width="120"/>
+    <icon height="76" src="resources/android/icon/icon.png" width="76"/>
+    <icon height="152" src="resources/android/icon/icon.png" width="152"/>
+    <icon height="40" src="resources/android/icon/icon.png" width="40"/>
+    <icon height="80" src="resources/android/icon/icon.png" width="80"/>
+    <icon height="57" src="resources/android/icon/icon.png" width="57"/>
+    <icon height="114" src="resources/android/icon/icon.png" width="114"/>
+    <icon height="72" src="resources/android/icon/icon.png" width="72"/>
+    <icon height="144" src="resources/android/icon/icon.png" width="144"/>
+    <icon height="29" src="resources/android/icon/icon.png" width="29"/>
+    <icon height="58" src="resources/android/icon/icon.png" width="58"/>
+    <icon height="50" src="resources/android/icon/icon.png" width="50"/>
+    <icon height="100" src="resources/android/icon/icon.png" width="100"/>
   </platform>
-  <access origin="tel:*" launch-external="yes" />
-  <access origin="*" />
-  <allow-navigation href="*" />
-  <allow-intent href="*" />
-  <preference name="webviewbounce" value="false" />
-  <preference name="UIWebViewBounce" value="false" />
-  <preference name="DisallowOverscroll" value="true" />
-  <preference name="android-minSdkVersion" value="16" />
-  <preference name="BackupWebStorage" value="none" />
-  <preference name="KeepRunning" value="True" />
-  <preference name="ShowTitle" value="True" />
-  <preference name="InAppBrowserStorageEnabled" value="True" />
-  <preference name="SuppressesIncrementalRendering" value="True" />
-  <preference name="windows-target-version" value="10.0" />
+  <access origin="tel:*" launch-external="yes"/>
+  <access origin="*"/>
+  <allow-navigation href="*"/>
+  <allow-intent href="*"/>
+  <preference name="webviewbounce" value="false"/>
+  <preference name="UIWebViewBounce" value="false"/>
+  <preference name="DisallowOverscroll" value="true"/>
+  <preference name="android-minSdkVersion" value="16"/>
+  <preference name="BackupWebStorage" value="none"/>
+  <preference name="KeepRunning" value="True"/>
+  <preference name="ShowTitle" value="True"/>
+  <preference name="InAppBrowserStorageEnabled" value="True"/>
+  <preference name="SuppressesIncrementalRendering" value="True"/>
+  <preference name="windows-target-version" value="10.0"/>
+  <preference name="KeepRunning" value="True"/>
+  <preference name="ShowTitle" value="True"/>
+  <preference name="InAppBrowserStorageEnabled" value="True"/>
+  <preference name="SuppressesIncrementalRendering" value="True"/>
+  <preference name="windows-target-version" value="10.0"/>
   <feature name="StatusBar">
-    <param name="ios-package" onload="true" value="CDVStatusBar" />
+    <param name="ios-package" onload="true" value="CDVStatusBar"/>
   </feature>
-  <preference name="KeepRunning" value="True" />
-  <preference name="ShowTitle" value="True" />
-  <preference name="InAppBrowserStorageEnabled" value="True" />
-  <preference name="SuppressesIncrementalRendering" value="True" />
-  <preference name="windows-target-version" value="10.0" />
-  <plugin name="cordova-plugin-device" spec="~1.1.1" />
-  <plugin name="cordova-plugin-console" spec="~1.0.2" />
-  <plugin name="cordova-plugin-whitelist" spec="~1.2.1" />
-  <plugin name="cordova-plugin-statusbar" spec="~2.1.0" />
-  <plugin name="ionic-plugin-keyboard" spec="~1.0.8" />
-  <plugin name="cordova-plugin-camera" version="2.2.0" />
-  <plugin name="cordova-plugin-compat" version="1.0.0" />
-  <plugin name="cordova-plugin-alipay" version="1.0.0" />
-  <plugin name="cordova-plugin-appversion" version="1.0.0" />
-  <plugin name="cordova-plugin-file" version="4.2.0" />
-  <plugin name="cordova-plugin-file-transfer" version="1.5.1" />
-  <plugin name="cordova-plugin-actionsheet" version="2.2.2" />
+  <plugin name="cordova-plugin-device" spec="~1.1.1"/>
+  <plugin name="cordova-plugin-console" spec="~1.0.2"/>
+  <plugin name="cordova-plugin-whitelist" spec="~1.2.1"/>
+  <plugin name="cordova-plugin-statusbar" spec="~2.1.0"/>
+  <plugin name="ionic-plugin-keyboard" spec="~1.0.8"/>
+  <plugin name="cordova-plugin-camera" version="2.2.0"/>
+  <plugin name="cordova-plugin-compat" version="1.0.0"/>
+  <plugin name="cordova-plugin-alipay" version="1.0.0"/>
+  <plugin name="cordova-plugin-appversion" version="1.0.0"/>
+  <plugin name="cordova-plugin-file" version="4.2.0"/>
+  <plugin name="cordova-plugin-file-transfer" version="1.5.1"/>
+  <plugin name="cordova-plugin-actionsheet" version="2.2.2"/>
 </widget>

+ 1 - 0
wl/package.json

xqd
@@ -22,6 +22,7 @@
     "ionic-plugin-keyboard"
   ],
   "cordovaPlatforms": [
+    "android",
     "ios"
   ]
 }

binární
wl/platforms/android/.gradle/2.2.1/taskArtifacts/cache.properties.lock


binární
wl/platforms/android/.gradle/2.2.1/taskArtifacts/fileSnapshots.bin


binární
wl/platforms/android/.gradle/2.2.1/taskArtifacts/taskArtifacts.bin


+ 4 - 2
wl/platforms/android/AndroidManifest.xml

xqd
@@ -2,14 +2,16 @@
 <manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="com.uhisport.football" xmlns:android="http://schemas.android.com/apk/res/android">
     <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
     <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
     <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true">
-        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
+        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
             <intent-filter android:label="@string/launcher_name">
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
     </application>
-    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />
+    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 </manifest>

+ 4 - 2
wl/platforms/android/assets/www/js/controllers/my.js

xqd
@@ -1,9 +1,11 @@
 (function (app) {
-    app.controller('myCtrl', ["$scope", "$state", 'userService', 'msg', function ($scope, $state, userService,msg) {
+    app.controller('myCtrl', ["$scope", "$state", 'userService', 'msg','config', function ($scope, $state, userService,msg,config) {
         $scope.user = {};
         userService.getUser().then(function (result) {
             $scope.user = result.data.data;
-             
+            if($scope.user.avatar){
+                $scope.user.avatar = config.server +'/upload/avatar/'+ $scope.user.avatar
+            }
         }, function (erro) {
             msg.error(erro.data.message);
         });

+ 4 - 4
wl/platforms/android/res/xml/config.xml

xqd xqd
@@ -1,8 +1,8 @@
 <?xml version='1.0' encoding='utf-8'?>
 <widget id="com.uhisport.football" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
     <preference name="loglevel" value="DEBUG" />
-    <feature name="RareloopAppVersion">
-        <param name="android-package" value="com.rareloop.cordova.appversion.RareloopAppVersion" />
+    <feature name="ActionSheet">
+        <param name="android-package" value="nl.xservices.plugins.actionsheet.ActionSheet" />
     </feature>
     <feature name="Camera">
         <param name="android-package" value="org.apache.cordova.camera.CameraLauncher" />
@@ -29,8 +29,8 @@
         <param name="android-package" value="io.ionic.keyboard.IonicKeyboard" />
         <param name="onload" value="true" />
     </feature>
-    <feature name="ActionSheet">
-        <param name="android-package" value="nl.xservices.plugins.actionsheet.ActionSheet" />
+    <feature name="RareloopAppVersion">
+        <param name="android-package" value="com.rareloop.cordova.appversion.RareloopAppVersion" />
     </feature>
     <icon density="ldpi" src="resources/android/icon/icon.png" />
     <icon density="mdpi" src="resources/android/icon/icon.png" />

+ 2 - 1
wl/platforms/platforms.json

xqd
@@ -1,3 +1,4 @@
 {
-    "android": "5.1.1"
+    "android": "4.1.1",
+    "ios": "3.9.2"
 }

+ 7 - 8
wl/plugins/android.json

xqd xqd
@@ -7,12 +7,18 @@
         "files": {}
     },
     "installed_plugins": {
+        "cordova-plugin-actionsheet": {
+            "PACKAGE_NAME": "com.uhisport.football"
+        },
         "cordova-plugin-appversion": {
             "PACKAGE_NAME": "com.uhisport.football"
         },
         "cordova-plugin-camera": {
             "PACKAGE_NAME": "com.uhisport.football"
         },
+        "cordova-plugin-compat": {
+            "PACKAGE_NAME": "com.uhisport.football"
+        },
         "cordova-plugin-console": {
             "PACKAGE_NAME": "com.uhisport.football"
         },
@@ -33,14 +39,7 @@
         },
         "ionic-plugin-keyboard": {
             "PACKAGE_NAME": "com.uhisport.football"
-        },
-        "cordova-plugin-actionsheet": {
-            "PACKAGE_NAME": "com.uhisport.football"
         }
     },
-    "dependent_plugins": {
-        "cordova-plugin-compat": {
-            "PACKAGE_NAME": "com.uhisport.football"
-        }
-    }
+    "dependent_plugins": {}
 }

+ 13 - 8
wl/plugins/ios.json

xqd xqd xqd
@@ -7,6 +7,12 @@
         "files": {}
     },
     "installed_plugins": {
+        "cordova-plugin-actionsheet": {
+            "PACKAGE_NAME": "com.uhisport.football"
+        },
+        "cordova-plugin-appversion": {
+            "PACKAGE_NAME": "com.uhisport.football"
+        },
         "cordova-plugin-camera": {
             "PACKAGE_NAME": "com.uhisport.football"
         },
@@ -19,6 +25,12 @@
         "cordova-plugin-device": {
             "PACKAGE_NAME": "com.uhisport.football"
         },
+        "cordova-plugin-file": {
+            "PACKAGE_NAME": "com.uhisport.football"
+        },
+        "cordova-plugin-file-transfer": {
+            "PACKAGE_NAME": "com.uhisport.football"
+        },
         "cordova-plugin-statusbar": {
             "PACKAGE_NAME": "com.uhisport.football"
         },
@@ -27,14 +39,7 @@
         },
         "ionic-plugin-keyboard": {
             "PACKAGE_NAME": "com.uhisport.football"
-        },
-        "cordova-plugin-file-transfer": {
-            "PACKAGE_NAME": "com.uhisport.football"
         }
     },
-    "dependent_plugins": {
-        "cordova-plugin-file": {
-            "PACKAGE_NAME": "com.uhisport.football"
-        }
-    }
+    "dependent_plugins": {}
 }

+ 0 - 0
wl/www/img/photo_default_orange.jpg → wl/www/img/demo/photo_default_orange.jpg


+ 0 - 0
wl/www/img/photo_default_turquoise.jpg → wl/www/img/demo/photo_default_turquoise.jpg


+ 2 - 2
wl/www/js/config/config.js

xqd
@@ -2,8 +2,8 @@
     //全局配置 
     app.constant("config", {
         //server: (!!window.cordova) ? "http://w2.9026.com/" : location.origin, //服务端,
-        server: "http://120.25.204.211/"
-        // server: "http://wl.youawan.com/"
+        // server: "http://120.25.204.211/"
+        server: "http://wl.youawan.com/"
        // server: 'http://localhost:8094/'
     });
 })(angular.module('app'));

+ 1 - 1
wl/www/js/controllers/car.js

xqd
@@ -32,7 +32,7 @@
                     $scope.$broadcast('scroll.infiniteScrollComplete');
                 }
             }, function (erro) {
-                msg.error(erro.data.message);
+                // msg.error(erro.data.message);
             });
         }
         $scope.toggleRight = function () {

+ 1 - 1
wl/www/js/controllers/goods.js

xqd
@@ -33,7 +33,7 @@
                     $scope.$broadcast('scroll.infiniteScrollComplete');
                 }
             }, function (erro) {
-                msg.error(erro.data.message);
+                // msg.error(erro.data);
             });
         }
         $scope.toggleRight = function () {

+ 2 - 2
wl/www/js/controllers/home.js

xqd
@@ -8,13 +8,13 @@
         goodsService.listGoods({ type: 1, pageIndex: 1 }).then(function (result) {
             $scope.goods = result.data.data;
         }, function (erro) {
-            msg.error(erro.data.message);
+            // msg.error(erro.data.message);
         });
         $scope.cars = [];
         carService.listCars({ type: 2, pageIndex: 1 }).then(function (result) {
             $scope.cars = result.data.data;
         }, function (erro) {
-            msg.error(erro.data.message);
+            // msg.error(erro.data.message);
         });
         $scope.detail = function (item) {
             if ($scope.vm.showIndex == 1) //货源

+ 11 - 5
wl/www/js/controllers/my.js

xqd xqd xqd xqd xqd
@@ -1,9 +1,9 @@
 (function (app) {
-    app.controller('myCtrl', ["$scope", "$state", 'userService', 'msg', function ($scope, $state, userService,msg) {
+    app.controller('myCtrl', ["$scope", "$state", 'userService', 'msg','config', function ($scope, $state, userService,msg,config) {
         $scope.user = {};
+        $scope.host = config.server +'/upload/avatar/';
         userService.getUser().then(function (result) {
-            $scope.user = result.data.data;
-             
+            $scope.user = result.data.data; 
         }, function (erro) {
             msg.error(erro.data.message);
         });
@@ -74,12 +74,13 @@
         }
     }]);
     
-    app.controller('myProfileCtrl', ['$scope', '$ionicActionSheet', '$ionicPopup', '$timeout', 'userService', 'msg', 'util', 'data', 'camera', function ($scope, $ionicActionSheet, $ionicPopup, $timeout, userService, msg, util, data, camera) {
+    app.controller('myProfileCtrl', ['$scope', '$ionicActionSheet', '$ionicPopup', '$timeout', 'userService', 'msg', 'util', 'data', 'camera','config', function ($scope, $ionicActionSheet, $ionicPopup, $timeout, userService, msg, util, data, camera,config) {
         $scope.user = data.getObject('user');
         $scope.genderOpt = [
               { name: "男", value: 1 },
               { name: "女", value: 0 }
         ];
+        $scope.host = config.server +'/upload/avatar/';
      
         $scope.setAvator = function () {
             camera.chooseImage().then(function (imageUri) {
@@ -96,8 +97,10 @@
                 uploadOptions.headers = { "Authorization": token };
                 var ft = new FileTransfer();
                 ft.upload(imageUri, encodeURI(config.server + "api/user"), function (sucess) {
+                    console.log('上传成功'+JSON.stringify(sucess));
                      //alert('上传成功'+JSON.stringify(sucess));
                 }, function (fail) {
+                    console.log('上传失败'+JSON.stringify(fail));
                       //alert('上传失败'+JSON.stringify(fail));
                 }, uploadOptions);
             }, function (erro) {
@@ -220,7 +223,8 @@
             }
          
         }
-        //上传图片
+        //上传图片 
+        $scope.host = config.server +'/upload/photo/';
         $scope.setPhoto = function () {
             camera.chooseImage().then(function (imageUri) {
                 $timeout(function () {
@@ -236,8 +240,10 @@
                 uploadOptions.headers = { "Authorization": token };
                 var ft = new FileTransfer();
                 ft.upload(imageUri, encodeURI(config.server + "api/trucks"), function (sucess) {
+                    console.log('上传成功'+JSON.stringify(sucess));
                     //alert('上传成功'+JSON.stringify(sucess));
                 }, function (fail) {
+                    console.log('上传失败'+JSON.stringify(fail));
                     //alert('上传失败'+JSON.stringify(fail));
                 }, uploadOptions);
             }, function (erro) {

+ 1 - 1
wl/www/js/filters/filter.js

xqd
@@ -26,7 +26,7 @@
     module.filter('avator', function () {
         return function (input) {
             if (!input || input.length === 0) {
-                return "img/photo_default_turquoise.jpg";
+                return "img/demo/photo_default_turquoise.jpg";
             }
             return input;
         };

+ 1 - 1
wl/www/js/services/userservice.js

xqd
@@ -17,7 +17,7 @@
             update:function (model) {
                 return $http({
                     url: config.server + 'api/user',
-                    method: "post",
+                    method: "put",
                     data: model
                 })
             },

+ 1 - 1
wl/www/templates/my/index.html

xqd
@@ -2,7 +2,7 @@
     <ion-content class="app-content app-user-content">
         <div class="user-box">
             <a  class="user-photo">
-              <img ng-src="{{user.avatar | avator}}"  />
+              <img ng-src="{{host}}{{user.avatar | avator}}"  />
             </a>
             <div class="user-info" ng-click="toProfile()">
                 <a >  <p><span>{{user.nick_name}}</span></p>  </a>

+ 1 - 1
wl/www/templates/my/profile.html

xqd
@@ -5,7 +5,7 @@
                 完善个人信息
             </div>
             <a class="item item-avatar-right item-arrow-no" ng-click="setAvator()">
-                <img ng-src="{{user.avatar | avator}}" />
+                <img ng-src="{{host + user.avatar | avator}}" />
                 <h2>头像</h2>
                 <p style="font-size:12px">点击上传</p>
             </a>

+ 1 - 1
wl/www/templates/my/truck-add.html

xqd
@@ -5,7 +5,7 @@
                 您的车辆
             </div>
             <a class="item item-avatar-right item-arrow-no" ng-click="setPhoto()">
-                <img ng-src="{{vm.photo | truckPhoto}}" />
+                <img ng-src="{{host}}{{vm.photo | truckPhoto}}" />
                 <h2>上传照片</h2>
                 <p>车头45度左右,车牌清晰</p>
             </a>