ソースを参照

fix:修复bug

jinx 4 年 前
コミット
52b145e255

+ 3 - 1
component/roomItem/roomItem.wxml

@@ -39,7 +39,9 @@
 
 					<view class="tj_listItemPrice">
 							<text class="unitPrice">平均{{room.averagePrice}}元/平</text>
-							<text class="totalPrice">{{room.retailPrice}}万</text>
+							<text class="totalPrice" wx:if="{{room.type==2}}">{{room.retailPrice}}元/月</text>
+							<text class="totalPrice" wx:else>{{room.retailPrice}}万</text>
+
 
 					</view>
 				</view>

+ 19 - 10
component/storeItem/storeItem.js

@@ -4,27 +4,36 @@ Component({
    * 组件的属性列表
    */
   properties: {
-    store: Object
+    store: Object,
   },
 
   /**
    * 组件的初始数据
    */
   data: {
-
+      storeItem:null
+  },
+  attached(){
+    this.setData({
+      storeItem:this.data.store
+    })
+    if(this.data.storeItem.pvTotalNum>=10000){
+      this.setData({
+        'storeItem.pvTotalNum':(this.data.storeItem.pvTotalNum/10000).toFixed(1)+'w'
+      })
+    }
   },
-
   /**
    * 组件的方法列表
    */
   methods: {
     gotoWV(e) {
       let {
-       id
-     } = e.currentTarget.dataset
-     console.log(id)
-     this.triggerEvent('gotoWV',id)
-    
-   }
+        id
+      } = e.currentTarget.dataset
+      console.log(id)
+      this.triggerEvent('gotoWV', id)
+
+    }
   }
-})
+})

+ 5 - 4
component/storeItem/storeItem.wxml

@@ -1,13 +1,14 @@
 <!--component/storeItem/storeItem.wxml-->
-<view class="storeBox" data-id="{{store.id}}" bindtap="gotoWV">
+<view class="storeBox" data-id="{{storeItem.id}}" bindtap="gotoWV">
   <view class="storeCover">
     <image mode="aspectFill"
-      src="{{store.appListPicUrl}}"></image>
+      src="{{storeItem.appListPicUrl}}"></image>
   </view>
   <view class="storeTitle">
-    {{store.name}}
+    {{storeItem.name}}
   </view>
+
   <view class="storeView">
-    6.8w 人浏览过
+    {{storeItem.pvTotalNum}} 人浏览过
   </view>
 </view>

+ 8 - 13
pages/index/index.js

@@ -60,16 +60,7 @@ Router({
     ],
     middleList: {},
     middleEmptyLength: 0,
-    // middleList: [{
-    //   url: 'https://m4.publicimg.browser.qq.com/publicimg/pcqb/ewtab_yunying/477_266_datu_20210802.jpg',
-    //   title: '华发水岸1'
-    // }, {
-    //   url: 'https://m4.publicimg.browser.qq.com/publicimg/pcqb/ewtab_yunying/477_266_datu_20210802.jpg',
-    //   title: '华发水岸1'
-    // }, {
-    //   url: 'https://m4.publicimg.browser.qq.com/publicimg/pcqb/ewtab_yunying/477_266_datu_20210802.jpg',
-    //   title: '华发水岸1'
-    // }, ],
+   
     roomTabList: [{
         type: 0,
         title: '新房'
@@ -118,6 +109,7 @@ Router({
     })
   },
   onPullDownRefresh() {
+  
     this.setData({
       roomList: [],
       'fetcherData.page': 1,
@@ -168,6 +160,9 @@ Router({
         this.setData({
           loading: true
         })
+        wx.showLoading({
+          title: '加载中...',
+        })
         util.request(api.BrandList, this.data.fetcherData).then((res) => {
           this.setData({
             loading: false
@@ -261,16 +256,16 @@ Router({
   },
 
   onShow: function (options) {
-    
-
     // 页面显示
     let city = app.globalData.city
     if (city != this.data.city) {
       this.setData({
         'city': app.globalData.city,
+        'fetcherData.page':1,
         middleEmptyLength: 0,
         hasData:true,
-        loading:false
+        loading:false,
+        roomList:[]
       })
       this.getRoomList()
       for (let i = 0; i < this.data.middleTabList.length; i++) {

+ 3 - 1
pages/sence/sence.js

@@ -52,7 +52,9 @@ Page({
         this.setData({
           loading: true
         })
-
+        wx.showLoading({
+          title: '加载中...',
+        })
         util.request(api.BrandList, this.data.fetcherData).then((res) => {
           this.setData({
             loading: false

+ 3 - 0
pages/store/store.js

@@ -39,6 +39,9 @@ Page({
         this.setData({
           loading:true
         })
+        wx.showLoading({
+          title: '加载中...',
+        })
         util.request(api.BrandList, this.data.fetcherData).then((res) => {
           this.setData({
             loading:false