LAPTOP-FO2T5SIU\35838 před 10 měsíci
rodič
revize
1dad8c5057

+ 14 - 0
js_sdk/http.js

@@ -976,3 +976,17 @@ export function parkRoomSlateAdd(e) {
         '/wx/ParkRoomSlateController/add', e, {}
     )
 }
+
+// 我的预定
+export function parkRoomSlateList(e) {
+    return $http.post(
+        '/wx/ParkRoomSlateController/listAll', e, {}
+    )
+}
+
+// 删除房源预定
+export function parkRoomSlateRemove(e) {
+    return $http.post(
+        '/wx/ParkRoomSlateController/remove', e, {}
+    )
+}

+ 7 - 2
pages/subPackages/housingResources/addPredetermine.vue

@@ -61,7 +61,7 @@
         <div class="boardItem">{{ roomInfo.roomNo }}</div>
       </div>
     </div>
-    <button class="toYy">提交预定</button>
+    <button @tap="submit()" class="toYy">提交预定</button>
   </div>
 </template>
 
@@ -101,13 +101,18 @@ export default {
     submit(){
       this.form.projectName = this.companyName
       this.form.companyId = getUserLocalStorageInfo().userId
+      this.form.createdBy = getUserLocalStorageInfo().userId
+      this.form.userId = getUserLocalStorageInfo().userId
+      this.form.roomIds= this.roomId
       parkRoomSlateAdd(this.form).then((res) => {
         if(res.code == '200'){
           this.$showToast("填报成功");
           uni.navigateBack({});
+        }else {
+          this.$showToast(res.msg);
         }
       }).catch(err=>{
-        this.$showToast(err);
+
       })
     }
   }

+ 42 - 10
pages/subPackages/housingResources/components/myReservation.vue

@@ -1,28 +1,60 @@
 <template>
   <div class="myReservation">
     <div class="historyItem" v-for="item in historyList">
-      <div class="tags" :class="item.tag==='待招商确认'?'dqrTag':'yslTag'">{{item.tag}}</div>
-      <div class="historyItemTitle">XXXXX园区  楼盘  楼栋地块  出租单元号</div>
-      <div class="historyItemInfo">预定时间:2024-05-26  13:16</div>
-      <div class="historyItemInfo">企业联系人:江一筒</div>
-      <div class="historyItemInfo">联系电话:A栋一楼</div>
+      <div class="tags" :class="item.slateStatusStr==='待招商确认'?'dqrTag':'yslTag'">{{item.slateStatusStr}}</div>
+      <div class="historyItemTitle">{{ item.groupName + item.floorDiscName + item.buildName + item.roomNo }}</div>
+      <div class="historyItemInfo">预定时间:{{item.time}}</div>
+      <div class="historyItemInfo">企业联系人:{{item.projectManager}}</div>
+      <div class="historyItemInfo">联系电话:{{ item.managerPhone }}</div>
       <div class="historyItemBottom">
-        <button class="btn" :class="item.tag==='招商已受理'?'yslBtn':''">删除</button>
-        <button class="btn zcBtn" :class="item.tag==='招商已受理'?'yslBtn':''">编辑</button>
+        <button class="btn" :class="item.slateStatusStr==='招商已受理'?'yslBtn':''" @click="remove(item)">删除</button>
+        <button class="btn zcBtn" :class="item.slateStatusStr==='招商已受理'?'yslBtn':''">编辑</button>
       </div>
     </div>
   </div>
 </template>
 
 <script>
+import { getByCodes, parkRoomSlateList, getUserLocalStorageInfo } from "@/js_sdk/http";
+
 export default {
   name: "myReservation",
+  created() {
+    this.getData()
+  },
   data(){
     return{
       historyList:[
-        {tag:'待招商确认'},
-        {tag:'招商已受理'},
-      ]
+        {slateStatusStr:'待招商确认'},
+        {slateStatusStr:'招商已受理'},
+      ],
+      getUserLocalStorageInfo: getUserLocalStorageInfo(),
+    }
+  },
+  methods: {
+    getData(){
+      this.historyList = []
+      const data = {
+        createdAt: getUserLocalStorageInfo().userId
+      }
+      parkRoomSlateList(data).then(res=>{
+        if(res.code == '200'){
+          res.data.forEach(item=>{
+            const json = this.getItemJson(item)
+            this.historyList.push(json)
+          })
+
+        }else {
+          this.$showToast(res.msg);
+        }
+      })
+    },
+    getItemJson(item){
+      item.time = item.createdAt == null ? item.updatedAt : item.createdAt
+      return item
+    },
+    remove(item){
+
     }
   }
 }

+ 11 - 3
pages/subPackages/housingResources/index.vue

@@ -2,10 +2,10 @@
     <div class="housingResources">
       <van-tabs :active="active" @change="onChange">
         <van-tab title="房源查询" :name="0">
-           <houseList />
+           <houseList ref="houseList" />
         </van-tab>
         <van-tab title="我的预定" :name="1">
-          <myReservation />
+          <myReservation ref="myReservation"/>
         </van-tab>
       </van-tabs>
     </div>
@@ -20,14 +20,22 @@ export default {
     houseList,
     myReservation
   },
+  onPullDownRefresh: function () {
+    this.getData()
+  },
   data(){
     return{
       active:0
     }
   },
   methods:{
-    onChange(){
+    onChange(e){
       this.active = e.detail.name;
+    },
+    getData(){
+      if(this.active === 1){
+        this.$refs.myReservation.getData();
+      }
     }
   }
 }