浏览代码

Merge branch 'master' of ssh://gogs.zfire.top:2222/zfire-front/recycle-mobile

linwenxin 1 年之前
父节点
当前提交
8b63a1d8ec

+ 1 - 1
src/components/zj-dialog/zj-dialog-deliver.vue

@@ -116,9 +116,9 @@
           logisticsType: this.type === 1 ? 'SELF' : 'DELIVERY',
           ...params
         }).then(res => {
-					uni.$emit('refreshMyIssueList');
 					this.$successToast('发货成功');
 					this.cancelDialog();
+					this.crossPage.$emit('reloadMyIssueListPage');
 				})
 			}
 		}

+ 10 - 4
src/pages/goods/detail.vue

@@ -22,7 +22,7 @@
         <view class="btns">
           <u-button type="warning" text="分享好友" class="share" open-type="share"></u-button>
           <u-button type="error" text="立即联系" class="contact" @click="toContact" v-if="!isMine"></u-button>
-          <u-button type="primary" text="立即购买" class="buy" @click="toBuy" v-if="!isMine && detail.amount && detail.status !== 4"></u-button>
+          <u-button type="primary" text="立即购买" class="buy" @click="toBuy" v-if="!isMine && detail.amount && detail.status === 1"></u-button>
         </view>
       </view>
 
@@ -223,7 +223,7 @@
       		this.loadStatus = 0;
 
           let actionList = [
-            {name: '已卖出', value: 1},
+            {name: '已转让', value: 1},
             {name: '上架', value: 2},
             {name: '下架', value: 3},
             {name: '重新上架', value: 4},
@@ -267,6 +267,9 @@
           this.detail.collectNum = res.data.collectNum;
           this.detail.isLike = res.data.isLike;
           this.detail.isCollect = res.data.isCollect;
+          this.crossPage.$emit('reloadHomePage');
+          this.crossPage.$emit('reloadGoodsListPage');
+          this.crossPage.$emit('reloadMyIssueListPage');
         })
       },
 
@@ -349,10 +352,10 @@
       },
 
       selectAction(e) {
-        // 已卖出/下架
+        // 已转让/下架
         if(~[1,2,3].indexOf(e.value)) {
           const statusMap = {
-            1: 4, // 已卖出
+            1: 2, // 已转让
             2: 1, // 上架
             3: 0, // 下架
           }
@@ -365,6 +368,9 @@
             }).then(res => {
               this.$successToast();
               this.getDetail();
+              this.crossPage.$emit('reloadHomePage');
+              this.crossPage.$emit('reloadGoodsListPage');
+              this.crossPage.$emit('reloadMyIssueListPage');
             })
           }).catch(() => {})
         }

+ 9 - 1
src/pages/goods/list.vue

@@ -109,11 +109,19 @@
       categoryId,
       keyword
     }) {
+      this.crossPage.$on('reloadGoodsListPage', () => {
+        this.refreshList();
+      })
+
       this.categoryId = categoryId;
       this.keyword = keyword;
       await this.getCategory();
       await this.getList();
     },
+    
+    onUnload() {
+      this.crossPage.$off('reloadGoodsListPage');
+    },
 
     methods: {
       async getCategory() {
@@ -236,4 +244,4 @@
       @include zj-card;
     }
   }
-</style>
+</style>

+ 8 - 0
src/pages/index/index.vue

@@ -127,6 +127,10 @@
     },
 
     async onLoad() {
+      this.crossPage.$on('reloadHomePage', () => {
+        this.refreshList();
+      })
+
       await this.getBanner();
       await this.getCategory();
       await this.getList();
@@ -134,6 +138,10 @@
       this.lat = lo.latitude;
       this.lng = lo.longitude;
     },
+    
+    onUnload() {
+      this.crossPage.$off('reloadHomePage');
+    },
 
     methods: {
       async getBanner() {

+ 1 - 0
src/pages/mine/myBuy/detail.vue

@@ -156,6 +156,7 @@
           }).then(res => {
             this.$successToast();
             this.getDetail();
+            this.crossPage.$emit('reloadMyBuyListPage');
           })
         }).catch(() => {})
       },

+ 8 - 0
src/pages/mine/myBuy/list.vue

@@ -143,9 +143,17 @@
     async onLoad({
       tab
     }) {
+      this.crossPage.$on('reloadMyBuyListPage', () => {
+        this.refreshList();
+      })
+      
       this.tabCurrent = tab ? Number(tab) : 0;
       await this.getList();
     },
+    
+    onUnload() {
+      this.crossPage.$off('reloadMyBuyListPage');
+    },
 
     methods: {
       //获取列表数据

+ 8 - 8
src/pages/mine/myIssue/list.vue

@@ -46,7 +46,7 @@
             </view>
 
             <view class="right-btn" @tap.stop>
-              <block v-if="item.status === 4 && item.sendStatus === 'NO'">
+              <block v-if="item.status === 4 && item.sendStatus === 'NO' && (item.orderInfo && item.orderInfo.status === 'SEND')">
                 <u-button text="确认发货" shape="circle" @click="openDeliver(item.id)"></u-button>
               </block>
             </view>
@@ -87,7 +87,7 @@
         }
         return MAP[val];
       },
-      
+
       orderStatusFilter(val) {
         const MAP = {
           WAIT: '待支付',
@@ -135,14 +135,14 @@
     }) {
       this.tabCurrent = tab ? Number(tab) : 0;
       await this.getList();
-
-      uni.$on('refreshMyIssueList', () => {
-        this.refreshLish();
+      
+      this.crossPage.$on('reloadMyIssueListPage', () => {
+        this.refreshList();
       })
     },
 
-    onUnload() {
-      uni.$off('refreshMyIssueList');
+    onUnload() {
+      this.crossPage.$off('reloadMyIssueListPage');
     },
 
     methods: {
@@ -235,4 +235,4 @@
   .header-container {
     background: #ffffff;
   }
-</style>
+</style>