baimeng 9 năm trước cách đây
mục cha
commit
68f00fd931

+ 2 - 0
wl/www/js/controllers/my.js

xqd xqd
@@ -270,6 +270,7 @@
                 var more = (result.data.data.length >= $scope.filter.pageSize);
                 $scope.filter.hasMore = more;
                 $scope.items = $scope.items.concat(result.data.data);
+                 
                 if (init) {
                     $scope.$broadcast('scroll.refreshComplete');
                 } else {
@@ -306,6 +307,7 @@
                 var more = (result.data.data.length >= $scope.filter.pageSize);
                 $scope.filter.hasMore = more;
                 $scope.items = $scope.items.concat(result.data.data);
+                debugger;
                 if (init) {
                     $scope.$broadcast('scroll.refreshComplete');
                 } else {

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

xqd
@@ -11,7 +11,7 @@
             },
             //车源列表
             listCars: function (model) {
-                var condition = util.format("?include=user&type={0}&begin_address={1}&end_address={2}&midway_address={3}&page={4}"
+                var condition = util.format("?include=user,truck&type={0}&begin_address={1}&end_address={2}&midway_address={3}&page={4}"
                   , model.type, model.begin_address ? model.begin_address : '', model.end_address ? model.end_address : '', model.midway_address ? model.midway_address : '', model.pageIndex);
                 return $http({
                     url: config.server + 'api/messages/search' + condition,

+ 2 - 2
wl/www/js/services/myservice.js

xqd
@@ -28,9 +28,9 @@
                     method: "get"
                 })
             },
-            listOrders: function () {
+            listOrders: function (filter) {
                 return $http({
-                    url: config.server + 'api/user/orders',
+                    url: config.server + 'api/user/orders?include=message&page=' + filter.page,
                     method: "get"
                 })
             }

+ 5 - 1
wl/www/templates/car/detail.html

xqd xqd
@@ -1,4 +1,4 @@
-<ion-view view-title="源信息">
+<ion-view view-title="源信息">
     <ion-content>
         <div class="list">
             <div class="list card">
@@ -12,6 +12,10 @@
                     <p>出发地:{{vm.begin_address | fullAddress}}</p>
                     <p>途经:{{vm.midway_address | fullAddress}}</p>
                     <p>目的地:{{vm.end_address | fullAddress}}</p>
+                    <p>车名:{{vm.truck.data.name}}</p>
+                    <p>车类型:{{vm.truck.data.type}}</p>
+                    <p>车牌:{{vm.truck.data.truck_no}}</p>
+                    <p>载重:{{vm.truck.data.load_weight}}</p>
                     <p>
                         {{vm.detail}}
                     </p>

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

xqd
@@ -62,7 +62,7 @@
         </div>
         <div class="list" ng-if="vm.showIndex==2">
             <a class="item item-thumbnail-left" ng-repeat="item in cars" ng-click="detail(item)">
-                <img src="img/demo/defaultcar.png" />
+                <img ng-src="{{item.truck.data.photo | truckPhoto}}" />
                 <h2 style="white-space:normal">【{{item.begin_address | shortAddress}}】-【{{item.end_address | shortAddress}}】<span style="color:gray;">({{item.title}})</span></h2>
                 <p><span style="float:left"><b style="color:orangered">¥{{item.price}}</b><em style="padding-left:3px;font-size:0.75em">起</em></span></p>
                 <p><span style="float:left">联系人:{{item.contact_name}}</span> <span style="float:right">电话:{{item.contact_phone}}</span></p>

+ 11 - 6
wl/www/templates/my/message-detail.html

xqd
@@ -3,17 +3,22 @@
         <div class="list">
             <div class="list card">
                 <div class="item item-avatar">
-                    <img src="img/photo_default_turquoise.jpg" />
-                    <h2>{{vm.contact_name}}、{{vm.contact_phone}}</h2>
-                    <p>价格:<b style="color:red">¥{{vm.begin_address}}</b></p>
+                    <img ng-src="{{user.data.avatar | avator}}" />
+                    <h2 style="white-space:normal">【{{vm.begin_address | shortAddress}}】-【{{vm.end_address | shortAddress}}】的货源信息</h2>
+                    <p>价格:<b style="color:red">¥{{vm.price}}</b></p>
                 </div>
                 <div class="item item-body">
-                    <p style="font-weight:bold">从{{vm.begin_address}}到{{vm.end_address}},途径{{vm.midway_address}}</p>
+                    <p>出发地:{{vm.begin_address | fullAddress}}</p>
+                    <p>途经:{{vm.midway_address | fullAddress}}</p>
+                    <p>目的地:{{vm.end_address | fullAddress}}</p>
+                    <p>货物名称:{{vm.title}}</p>
+                    <p>联系人:{{vm.contact_name}}</p>
+                    <p>联系电话:{{vm.contact_phone}}</p>
                     <p>
                         {{vm.detail}}
                     </p>
-                    <p>
-                        {{vm.created_at}}
+                    <p style="color:red">
+                        有效期:{{vm.created_at}}
                     </p>
                 </div>
             </div>

+ 17 - 4
wl/www/templates/my/message.html

xqd
@@ -3,10 +3,23 @@
         <!--下拉刷新-->
         <ion-refresher pulling-text="下拉刷新" on-refresh="load(true)">
         </ion-refresher>
-        <div class="list">
-            <a class="item" ng-repeat="item in items" ng-click="detail(item)">
-                标题{{item.title}},时间{{item.created_at}}
-            </a>
+        <div class="list" >
+            <div ng-repeat="item in items">
+                <a class="item" ng-if="item.type==1" ng-click="detail(item)">
+                    <h2>【{{item.begin_address | shortAddress}}】-【{{item.end_address | shortAddress}}】</h2>
+                    <p>
+                        <span style="float:left"><b style="color:orangered">¥{{item.price}}</b><em style="padding-left:3px;font-size:0.75em">起</em></span>
+                        <span style="float:right">途经:{{item.midway_address | shortAddress}}</span>
+                    </p>
+                    <p><span style="float:left">联系人:{{item.contact_name}}</span> <span style="float:right">电话:{{item.contact_phone}}</span></p>
+                </a>
+                <a class="item item-thumbnail-left" ng-if="item.type==2" ng-click="detail(item)">
+                    <img ng-src="{{item.truck.data.photo | truckPhoto}}" />
+                    <h2 style="white-space:normal">【{{item.begin_address | shortAddress}}】-【{{item.end_address | shortAddress}}】<span style="color:gray;">({{item.title}})</span></h2>
+                    <p><span style="float:left"><b style="color:orangered">¥{{item.price}}</b><em style="padding-left:3px;font-size:0.75em">起</em></span></p>
+                    <p><span style="float:left">联系人:{{item.contact_name}}</span> <span style="float:right">电话:{{item.contact_phone}}</span></p>
+                </a>
+            </div>
         </div>
         <!--上拉更多-->
         <ion-infinite-scroll ng-if="filter.hasMore" on-infinite="load(false)" distance="10%"></ion-infinite-scroll>