linwenxin hai 1 ano
pai
achega
6918f03dca

+ 79 - 39
src/common/utils/navPag.js

@@ -107,45 +107,85 @@ export const navToPage = (function() {
   }
 })()
 
-// export const crossPage = (function() {
-//   var funs = {}
-//   var funco = {
-//     $emit(name, data) {
-//       if (funs[name]) {
-//         Object.keys(funs[name]).map(key => {
-//           funs[name][key](data)
-//         })
-//       }
-//       uni.setStorageSync(name, data);
-//     },
+export const crossPage = (function() {
+  var funs = {}
+  var tiemIdIs = {}
+  var funco = {
+    $emit(name, data) {
+      if (funs[name]) {
+        Object.keys(funs[name]).map(key => {
+          funs[name][key](data)
+        })
+      }
+      // #ifndef H5
+      
+      // #endif
+      
+      // #ifdef H5
+      var postMessage = (window.uniWebview && window.uniWebview.postMessage) || (window.postMessage)
+      if (postMessage) {
+        postMessage({
+          data: {
+            type: "crossPage_ts",
+            name,
+            data
+          }
+        })
+      }
+      if (tiemIdIs[name]) {
+        clearTimeout(tiemIdIs[name])
+      }
+      uni.setStorageSync(name, data);
+      tiemIdIs[name] = setTimeout(function() {
+        uni.removeStorageSync(name)
+      }, 350)
+      // #endif
+    },
 
-//     $on(name, fun) {
-//       if (!funs[name]) {
-//         funs[name] = {}
-//       }
-//       funs[name][md5(fun.toString())] = fun
-//     },
+    $on(name, fun) {
+      if (!funs[name]) {
+        funs[name] = {}
+      }
+      funs[name][md5(fun.toString())] = fun
+    },
 
-//     $off(name, fun) {
-//       var skey = md5(fun.toString())
-//       if (funs[name] && funs[name][skey]) {
-//         delete funs[name][skey]
-//       }
-//     }
-//   }
-//   (function tiemID(){
-//     Object.keys(funs).map(name=>{
-//       var data = uni.getStorageSync(name);
-//       if (funs[name]) {
-//         Object.keys(funs[name]).map(key => {
-//           funs[name][key](data)
-//         })
-//       }
-//     })
-    
+    $off(name, fun) {
+      var skey = md5(fun.toString())
+      if (funs[name] && funs[name][skey]) {
+        delete funs[name][skey]
+      }
+    },
 
-
-//     setTimeout(tiemID,300)
-//   })()
-//   return funco
-// })()
+    $listener(e) {
+      e.detail.data.map(({
+        type,
+        name,
+        data
+      }) => {
+        if (type == "crossPage_ts") {
+          if (funs[name]) {
+            Object.keys(funs[name]).map(key => {
+              funs[name][key](data)
+            })
+          }
+        }
+      })
+    },
+  };
+  // #ifdef H5
+  (function tiemID() {
+    Object.keys(funs).map(name => {
+      if (funs[name]) {
+        var data = uni.getStorageSync(name);
+        if (data) {
+          Object.keys(funs[name]).map(key => {
+            funs[name][key](data)
+          })
+        }
+      }
+    })
+    setTimeout(tiemID, 200)
+  })()
+  // #endif
+  return funco
+})()

+ 8 - 2
src/mixins/index.js

@@ -3,7 +3,8 @@ import {
 } from '@/common/utils/common';
 import {
   webViewHref,
-  navToPage
+  navToPage,
+  crossPage
 } from '@/common/utils/navPag';
 import {
   firstPerform
@@ -76,6 +77,11 @@ function loadStyleString(css) {
 
 // 存放页面公用数据、方法...
 export default {
+  data() {
+    return {
+      crossPage: crossPage,
+    }
+  },
   onLoad() {
     // #ifdef MP-WEIXIN
     routerBeforeEach()
@@ -92,4 +98,4 @@ export default {
   methods: {
     webViewHref: webViewHref,
   }
-}
+}

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

@@ -76,7 +76,7 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/goods/list', pam)"></web-view>
+  <web-view :src="webViewHref('/pages/goods/list', pam)"  @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 

+ 1 - 1
src/pages/index/index.vue

@@ -78,7 +78,7 @@
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/index/index', pam)"></web-view>
+  <web-view :src="webViewHref('/pages/index/index', pam)"  @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 

+ 1 - 1
src/pages/issue/index.vue

@@ -98,7 +98,7 @@
   <!-- #endif -->
   <!-- #ifndef H5 -->
   <view>
-    <web-view v-if="isShow" :src="webViewHref('/pages/issue/index', pam)"></web-view>
+    <web-view v-if="isShow" :src="webViewHref('/pages/issue/index', pam)"  @message="crossPage.$listener"></web-view>
   </view>
   <!-- #endif -->
 </template>

+ 1 - 1
src/pages/message/index.vue

@@ -40,7 +40,7 @@
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/message/index')"></web-view>
+  <web-view :src="webViewHref('/pages/message/index')"  @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 

+ 1 - 1
src/pages/message/msgView.vue

@@ -110,7 +110,7 @@
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/message/msgView',pam)"></web-view>
+  <web-view :src="webViewHref('/pages/message/msgView',pam)"  @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 

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

@@ -74,7 +74,7 @@
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/mine/myBuy/detail', pam)"></web-view>
+  <web-view :src="webViewHref('/pages/mine/myBuy/detail', pam)"  @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 

+ 1 - 1
src/pages/mine/myBuy/list.vue

@@ -83,7 +83,7 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref(`/pages/mine/myBuy/list`, pam)"></web-view>
+  <web-view :src="webViewHref(`/pages/mine/myBuy/list`, pam)"  @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 

+ 1 - 1
src/pages/mine/myBuy/return.vue

@@ -81,7 +81,7 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref(`/pages/mine/myBuy/return`, pam)"></web-view>
+  <web-view :src="webViewHref(`/pages/mine/myBuy/return`, pam)"  @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 

+ 130 - 130
src/pages/mine/myCollection.vue

@@ -1,131 +1,131 @@
-<template>
-  <!-- #ifdef H5 -->
-  <zj-page-layout
-  	:hasFooter="false"
-  	:isScroll="true"
-  	:refresherTriggered="refresherTriggered"
-  	@refresherrefresh="refresherrefresh"
-  	@scrolltolower="scrolltolower">
-    <view class="common-goods-list">
-      <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item.id)">
-        <view class="top">
-          <image src="@/static/common/logo.png"></image>
-          <view class="user">
-            <view class="name">{{item.userName}}</view>
-            <view class="time">{{item.createTime | timeFilter}}</view>
-          </view>
-          <view class="price">{{item.amount | priceFilter2}}</view>
-        </view>
-        <view class="title">{{item.title}}</view>
-        <view class="des">{{item.content}}</view>
-        <view class="imgs">
-          <image :src="imgUrl + it.imgUrl" v-for="(it, idx) in item.goodsFiles" :key="idx" mode="aspectFill"></image>
-        </view>
-        <view class="bottom">
-          <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.city}} {{item.area}}</view>
-          <view class="right-btn" @tap.stop>
-            <u-button text="取消收藏" shape="circle" @click="handelCancel(item.id)"></u-button>
-          </view>
-        </view>
-      </view>
-    </view>
-
-    <Loading :loadStatus="loadStatus" :dataList="dataList" />
-  </zj-page-layout>
-  <!-- #endif -->
-  <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/mine/myCollection')"></web-view>
-  <!-- #endif -->
-</template>
-
-<script>
-  // #ifdef H5
-  export default {
-    data() {
-      return {
-        imgUrl: this.$imageUrl,
-        dataList: [],
+<template>
+  <!-- #ifdef H5 -->
+  <zj-page-layout
+  	:hasFooter="false"
+  	:isScroll="true"
+  	:refresherTriggered="refresherTriggered"
+  	@refresherrefresh="refresherrefresh"
+  	@scrolltolower="scrolltolower">
+    <view class="common-goods-list">
+      <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item.id)">
+        <view class="top">
+          <image src="@/static/common/logo.png"></image>
+          <view class="user">
+            <view class="name">{{item.userName}}</view>
+            <view class="time">{{item.createTime | timeFilter}}</view>
+          </view>
+          <view class="price">{{item.amount | priceFilter2}}</view>
+        </view>
+        <view class="title">{{item.title}}</view>
+        <view class="des">{{item.content}}</view>
+        <view class="imgs">
+          <image :src="imgUrl + it.imgUrl" v-for="(it, idx) in item.goodsFiles" :key="idx" mode="aspectFill"></image>
+        </view>
+        <view class="bottom">
+          <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.city}} {{item.area}}</view>
+          <view class="right-btn" @tap.stop>
+            <u-button text="取消收藏" shape="circle" @click="handelCancel(item.id)"></u-button>
+          </view>
+        </view>
+      </view>
+    </view>
+
+    <Loading :loadStatus="loadStatus" :dataList="dataList" />
+  </zj-page-layout>
+  <!-- #endif -->
+  <!-- #ifndef H5 -->
+  <web-view :src="webViewHref('/pages/mine/myCollection')"  @message="crossPage.$listener"></web-view>
+  <!-- #endif -->
+</template>
+
+<script>
+  // #ifdef H5
+  export default {
+    data() {
+      return {
+        imgUrl: this.$imageUrl,
+        dataList: [],
         pageNum: 1,
-				loadStatus: 0,
-        refresherTriggered: false,
-      }
-    },
-
-    async onLoad() {
-      await this.getList()
-    },
-
-    methods: {
-      //获取列表数据
-      async getList() {
-        this.$api.get('/likeOrCollect/list', {
-          userId: this.$store.state.user.userId,
-          type: 2,
-          pageNum: this.pageNum,
-          pageSize: 10,
-        }).then(res => {
-          this.loadStatus = 0;
-          let list = res.data.records;
-          if(list.length < 10){
-          	this.loadStatus = 2;
-          }
-          this.dataList = this.dataList.concat(list);
-        }).catch(() => {
-					this.loadStatus = 2;
-				}).finally(res => {
-					this.refresherTriggered = false;
-				})
-      },
-
-      // 滚动到底部
-      scrolltolower(e) {
-      	if (this.loadStatus === 0) {
-      		this.pageNum++;
-      		this.getList();
-      	}
-      },
-
-      // 触发下拉刷新
-      refresherrefresh(e) {
-      	this.refresherTriggered = true;
-      	this.refreshList();
-      },
-
-      refreshList() {
-        this.dataList = [];
-        this.pageNum = 1;
-        this.getList();
-      },
-
-      toDetail(id) {
-        this.$navToPage({
-          url: `/pages/goods/detail?id=${id}`
-        })
-      },
-
-      handelCancel(id) {
-        this.$modal({
-          content: '确定要取消收藏吗?'
-        }).then(() => {
-          this.$api.postJson('/likeOrCollect/likeOrCollect', {
-            userId: this.$store.state.user.userId,
-            goodsId: id,
-            type: 2,
-            operate: 'NO'
-          }).then(res => {
-            this.refreshList();
-          })
-        }).catch(() => {})
-      },
-
-    }
-  }
-  // #endif
-  // #ifndef H5
-
-  // #endif
-</script>
-
-<style lang="scss" scoped>
-
-</style>
+				loadStatus: 0,
+        refresherTriggered: false,
+      }
+    },
+
+    async onLoad() {
+      await this.getList()
+    },
+
+    methods: {
+      //获取列表数据
+      async getList() {
+        this.$api.get('/likeOrCollect/list', {
+          userId: this.$store.state.user.userId,
+          type: 2,
+          pageNum: this.pageNum,
+          pageSize: 10,
+        }).then(res => {
+          this.loadStatus = 0;
+          let list = res.data.records;
+          if(list.length < 10){
+          	this.loadStatus = 2;
+          }
+          this.dataList = this.dataList.concat(list);
+        }).catch(() => {
+					this.loadStatus = 2;
+				}).finally(res => {
+					this.refresherTriggered = false;
+				})
+      },
+
+      // 滚动到底部
+      scrolltolower(e) {
+      	if (this.loadStatus === 0) {
+      		this.pageNum++;
+      		this.getList();
+      	}
+      },
+
+      // 触发下拉刷新
+      refresherrefresh(e) {
+      	this.refresherTriggered = true;
+      	this.refreshList();
+      },
+
+      refreshList() {
+        this.dataList = [];
+        this.pageNum = 1;
+        this.getList();
+      },
+
+      toDetail(id) {
+        this.$navToPage({
+          url: `/pages/goods/detail?id=${id}`
+        })
+      },
+
+      handelCancel(id) {
+        this.$modal({
+          content: '确定要取消收藏吗?'
+        }).then(() => {
+          this.$api.postJson('/likeOrCollect/likeOrCollect', {
+            userId: this.$store.state.user.userId,
+            goodsId: id,
+            type: 2,
+            operate: 'NO'
+          }).then(res => {
+            this.refreshList();
+          })
+        }).catch(() => {})
+      },
+
+    }
+  }
+  // #endif
+  // #ifndef H5
+
+  // #endif
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 1 - 1
src/pages/mine/myEarnings/detail.vue

@@ -42,7 +42,7 @@
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/mine/myEarnings/detail', pam)"></web-view>
+  <web-view :src="webViewHref('/pages/mine/myEarnings/detail', pam)"  @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 

+ 1 - 1
src/pages/mine/myEarnings/list.vue

@@ -41,7 +41,7 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/mine/myEarnings/list', pam)"></web-view>
+  <web-view :src="webViewHref('/pages/mine/myEarnings/list', pam)"  @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 

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

@@ -1,219 +1,219 @@
-<template>
-  <!-- #ifdef H5 -->
-  <view>
-    <zj-page-layout
-      :hasFooter="false"
-      :isScroll="true"
-      :refresherTriggered="refresherTriggered"
-      @refresherrefresh="refresherrefresh"
-      @scrolltolower="scrolltolower">
-      <template slot="header">
-        <view class="header-container">
-          <u-tabs
-            :scrollable="false"
-            :list="tabList"
-            :current="tabCurrent"
-            @click="clickTab"
-            lineColor="#01C30B"
-            :activeStyle="{
-              color: '#01C30B'
-            }"
-            :inactiveStyle="{
-              color: '#666666'
-            }"
-            itemStyle="padding-left: 0; padding-right: 0; height: 88rpx;">
-          </u-tabs>
-        </view>
-      </template>
-
-      <view class="common-order-list">
-        <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item.id)">
-          <view class="top">
-            <image :src="item.userPic ? (imageUrl + item.userPic) : require('@/static/common/logo.png')"></image>
-            <view class="user">
-              <view class="name">{{item.userName}}</view>
-              <view class="time">{{item.createTime | timeFilter}}发布</view>
-            </view>
-            <view class="status">{{item.status | statusFilter}}</view>
-          </view>
-          <view class="goods">
-            <image :src="imageUrl + item.goodsPicUrl" mode="aspectFill"></image>
-            <view class="main">
-              <view class="name">{{item.title}}<text>×{{item.num}}</text></view>
-              <view class="des">{{item.content}}</view>
-              <view class="price">{{item.amount | priceFilter2}}</view>
-            </view>
-          </view>
-          <view class="bottom">
-            <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.city}} {{item.area}}</view>
-            <view class="right-btn" @tap.stop>
-              <block v-if="item.status === 4 && item.sendStatus === 'NO'">
-                <u-button text="确认发货" shape="circle" @click="openDeliver(item.id)"></u-button>
-              </block>
-            </view>
-          </view>
-        </view>
-      </view>
-
-      <Loading :loadStatus="loadStatus" :dataList="dataList" />
-
-    </zj-page-layout>
-
-    <zj-dialog-deliver
-      ref="deliverDialog"
-      :isShow="isShowDeliverDialog"
-      @close="isShowDeliverDialog = false">
-    </zj-dialog-deliver>
-  </view>
-  <!-- #endif -->
-  <!-- #ifndef H5 -->
-  <web-view :src="webViewHref(`/pages/mine/myIssue/list`, pam)"></web-view>
-  <!-- #endif -->
-</template>
-
-<script>
+<template>
+  <!-- #ifdef H5 -->
+  <view>
+    <zj-page-layout
+      :hasFooter="false"
+      :isScroll="true"
+      :refresherTriggered="refresherTriggered"
+      @refresherrefresh="refresherrefresh"
+      @scrolltolower="scrolltolower">
+      <template slot="header">
+        <view class="header-container">
+          <u-tabs
+            :scrollable="false"
+            :list="tabList"
+            :current="tabCurrent"
+            @click="clickTab"
+            lineColor="#01C30B"
+            :activeStyle="{
+              color: '#01C30B'
+            }"
+            :inactiveStyle="{
+              color: '#666666'
+            }"
+            itemStyle="padding-left: 0; padding-right: 0; height: 88rpx;">
+          </u-tabs>
+        </view>
+      </template>
+
+      <view class="common-order-list">
+        <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item.id)">
+          <view class="top">
+            <image :src="item.userPic ? (imageUrl + item.userPic) : require('@/static/common/logo.png')"></image>
+            <view class="user">
+              <view class="name">{{item.userName}}</view>
+              <view class="time">{{item.createTime | timeFilter}}发布</view>
+            </view>
+            <view class="status">{{item.status | statusFilter}}</view>
+          </view>
+          <view class="goods">
+            <image :src="imageUrl + item.goodsPicUrl" mode="aspectFill"></image>
+            <view class="main">
+              <view class="name">{{item.title}}<text>×{{item.num}}</text></view>
+              <view class="des">{{item.content}}</view>
+              <view class="price">{{item.amount | priceFilter2}}</view>
+            </view>
+          </view>
+          <view class="bottom">
+            <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.city}} {{item.area}}</view>
+            <view class="right-btn" @tap.stop>
+              <block v-if="item.status === 4 && item.sendStatus === 'NO'">
+                <u-button text="确认发货" shape="circle" @click="openDeliver(item.id)"></u-button>
+              </block>
+            </view>
+          </view>
+        </view>
+      </view>
+
+      <Loading :loadStatus="loadStatus" :dataList="dataList" />
+
+    </zj-page-layout>
+
+    <zj-dialog-deliver
+      ref="deliverDialog"
+      :isShow="isShowDeliverDialog"
+      @close="isShowDeliverDialog = false">
+    </zj-dialog-deliver>
+  </view>
+  <!-- #endif -->
+  <!-- #ifndef H5 -->
+  <web-view :src="webViewHref(`/pages/mine/myIssue/list`, pam)"  @message="crossPage.$listener"></web-view>
+  <!-- #endif -->
+</template>
+
+<script>
   // #ifdef H5
-	import zjDialogDeliver from '@/components/zj-dialog/zj-dialog-deliver.vue';
-
-  export default {
-    components: {
-      zjDialogDeliver
-    },
-
-    filters: {
-      statusFilter(val) {
-        const MAP = {
-          1: '上架中',
-          2: '已转让',
-          0: '已下架',
-          3: '已冻结',
-          4: '已卖出',
-        }
-        return MAP[val];
-      }
-    },
-
-    data() {
-      return {
-        imageUrl: this.$imageUrl,
-        tabList: [
-          {name: '我发布的', value: 0},
-          {name: '已卖出', value: 1},
-          {name: '已下架', value: 2},
-        ],
-        tabCurrent: 0,
-        dataList: [],
-        pageNum: 1,
-        loadStatus: 0,
-        refresherTriggered: false,
-
-        isShowDeliverDialog: false,
-      }
-    },
-
-    async onLoad({tab}) {
-      this.tabCurrent = tab ? Number(tab) : 0;
-      await this.getList();
-
-      uni.$on('refreshMyIssueList', () => {
-        this.refreshLish();
-      })
-    },
-
-    onUnload() {
-      uni.$off('refreshMyIssueList');
-    },
-
-    methods: {
-      //获取列表数据
-      async getList() {
-        const statusMap = {
-          0: '',
-          1: 4,
-          2: 0
-        }
-        this.$api.get('/goods/list', {
-          pageNum: this.pageNum,
-          pageSize: 10,
-          status: statusMap[this.tabCurrent],
-          userId: this.$store.state.user.userId
-        }).then(res => {
-          this.loadStatus = 0;
-          let list = res.data.records;
-          if(list.length < 10){
-          	this.loadStatus = 2;
-          }
-          this.dataList = this.dataList.concat(list);
-        }).catch(() => {
-					this.loadStatus = 2;
-				}).finally(res => {
-					this.refresherTriggered = false;
-				})
-      },
-
-      // 滚动到底部
-      scrolltolower(e) {
-      	if (this.loadStatus === 0) {
-      		this.pageNum++;
-      		this.getList();
-      	}
-      },
-
-      // 触发下拉刷新
-      refresherrefresh(e) {
-      	this.refresherTriggered = true;
-      	this.refreshLish();
-      },
-
-      refreshLish() {
-        this.dataList = [];
-        this.pageNum = 1;
-        this.getList();
-      },
-
-      clickTab(item) {
-        this.tabCurrent = item.value;
-        this.refreshLish();
-      },
-
-      toDetail(id) {
-        this.$navToPage({
-          url: `/pages/goods/detail?id=${id}`
-        })
-      },
-
-      openDeliver(id) {
-        this.$refs.deliverDialog.setValue(id);
-        this.isShowDeliverDialog = true;
-      }
-
-    }
-  }
-  // #endif
-  // #ifndef H5
-  import zjDialogDeliver from '@/components/zj-dialog/zj-dialog-deliver.vue';
-
-  export default {
-    components: {
-      zjDialogDeliver
-    },
-    data() {
-      return {
-        pam: {},
-      }
-    },
-
-    onLoad(pam) {
-      this.pam = pam;
-    },
-  }
-  // #endif
-</script>
-
-<style lang="scss" scoped>
-.header-container {
-  background: #ffffff;
-}
-
-
-</style>
+	import zjDialogDeliver from '@/components/zj-dialog/zj-dialog-deliver.vue';
+
+  export default {
+    components: {
+      zjDialogDeliver
+    },
+
+    filters: {
+      statusFilter(val) {
+        const MAP = {
+          1: '上架中',
+          2: '已转让',
+          0: '已下架',
+          3: '已冻结',
+          4: '已卖出',
+        }
+        return MAP[val];
+      }
+    },
+
+    data() {
+      return {
+        imageUrl: this.$imageUrl,
+        tabList: [
+          {name: '我发布的', value: 0},
+          {name: '已卖出', value: 1},
+          {name: '已下架', value: 2},
+        ],
+        tabCurrent: 0,
+        dataList: [],
+        pageNum: 1,
+        loadStatus: 0,
+        refresherTriggered: false,
+
+        isShowDeliverDialog: false,
+      }
+    },
+
+    async onLoad({tab}) {
+      this.tabCurrent = tab ? Number(tab) : 0;
+      await this.getList();
+
+      uni.$on('refreshMyIssueList', () => {
+        this.refreshLish();
+      })
+    },
+
+    onUnload() {
+      uni.$off('refreshMyIssueList');
+    },
+
+    methods: {
+      //获取列表数据
+      async getList() {
+        const statusMap = {
+          0: '',
+          1: 4,
+          2: 0
+        }
+        this.$api.get('/goods/list', {
+          pageNum: this.pageNum,
+          pageSize: 10,
+          status: statusMap[this.tabCurrent],
+          userId: this.$store.state.user.userId
+        }).then(res => {
+          this.loadStatus = 0;
+          let list = res.data.records;
+          if(list.length < 10){
+          	this.loadStatus = 2;
+          }
+          this.dataList = this.dataList.concat(list);
+        }).catch(() => {
+					this.loadStatus = 2;
+				}).finally(res => {
+					this.refresherTriggered = false;
+				})
+      },
+
+      // 滚动到底部
+      scrolltolower(e) {
+      	if (this.loadStatus === 0) {
+      		this.pageNum++;
+      		this.getList();
+      	}
+      },
+
+      // 触发下拉刷新
+      refresherrefresh(e) {
+      	this.refresherTriggered = true;
+      	this.refreshLish();
+      },
+
+      refreshLish() {
+        this.dataList = [];
+        this.pageNum = 1;
+        this.getList();
+      },
+
+      clickTab(item) {
+        this.tabCurrent = item.value;
+        this.refreshLish();
+      },
+
+      toDetail(id) {
+        this.$navToPage({
+          url: `/pages/goods/detail?id=${id}`
+        })
+      },
+
+      openDeliver(id) {
+        this.$refs.deliverDialog.setValue(id);
+        this.isShowDeliverDialog = true;
+      }
+
+    }
+  }
+  // #endif
+  // #ifndef H5
+  import zjDialogDeliver from '@/components/zj-dialog/zj-dialog-deliver.vue';
+
+  export default {
+    components: {
+      zjDialogDeliver
+    },
+    data() {
+      return {
+        pam: {},
+      }
+    },
+
+    onLoad(pam) {
+      this.pam = pam;
+    },
+  }
+  // #endif
+</script>
+
+<style lang="scss" scoped>
+.header-container {
+  background: #ffffff;
+}
+
+
+</style>

+ 130 - 130
src/pages/mine/myLike.vue

@@ -1,131 +1,131 @@
-<template>
-  <!-- #ifdef H5 -->
-  <zj-page-layout
-  	:hasFooter="false"
-  	:isScroll="true"
-  	:refresherTriggered="refresherTriggered"
-  	@refresherrefresh="refresherrefresh"
-  	@scrolltolower="scrolltolower">
-    <view class="common-goods-list">
-      <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item.id)">
-        <view class="top">
-          <image src="@/static/common/logo.png"></image>
-          <view class="user">
-            <view class="name">{{item.userName}}</view>
-            <view class="time">{{item.createTime | timeFilter}}</view>
-          </view>
-          <view class="price">{{item.amount | priceFilter2}}</view>
-        </view>
-        <view class="title">{{item.title}}</view>
-        <view class="des">{{item.content}}</view>
-        <view class="imgs">
-          <image :src="imgUrl + it.imgUrl" v-for="(it, idx) in item.goodsFiles" :key="idx" mode="aspectFill"></image>
-        </view>
-        <view class="bottom">
-          <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.city}} {{item.area}}</view>
-          <view class="right-btn" @tap.stop>
-            <u-button text="取消点赞" shape="circle" @click="handelCancel(item.id)"></u-button>
-          </view>
-        </view>
-      </view>
-    </view>
-
-    <Loading :loadStatus="loadStatus" :dataList="dataList" />
-  </zj-page-layout>
-  <!-- #endif -->
-  <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/mine/myLike')"></web-view>
-  <!-- #endif -->
-</template>
-
-<script>
-  // #ifdef H5
-  export default {
-    data() {
-      return {
-        imgUrl: this.$imageUrl,
-        dataList: [],
+<template>
+  <!-- #ifdef H5 -->
+  <zj-page-layout
+  	:hasFooter="false"
+  	:isScroll="true"
+  	:refresherTriggered="refresherTriggered"
+  	@refresherrefresh="refresherrefresh"
+  	@scrolltolower="scrolltolower">
+    <view class="common-goods-list">
+      <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item.id)">
+        <view class="top">
+          <image src="@/static/common/logo.png"></image>
+          <view class="user">
+            <view class="name">{{item.userName}}</view>
+            <view class="time">{{item.createTime | timeFilter}}</view>
+          </view>
+          <view class="price">{{item.amount | priceFilter2}}</view>
+        </view>
+        <view class="title">{{item.title}}</view>
+        <view class="des">{{item.content}}</view>
+        <view class="imgs">
+          <image :src="imgUrl + it.imgUrl" v-for="(it, idx) in item.goodsFiles" :key="idx" mode="aspectFill"></image>
+        </view>
+        <view class="bottom">
+          <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.city}} {{item.area}}</view>
+          <view class="right-btn" @tap.stop>
+            <u-button text="取消点赞" shape="circle" @click="handelCancel(item.id)"></u-button>
+          </view>
+        </view>
+      </view>
+    </view>
+
+    <Loading :loadStatus="loadStatus" :dataList="dataList" />
+  </zj-page-layout>
+  <!-- #endif -->
+  <!-- #ifndef H5 -->
+  <web-view :src="webViewHref('/pages/mine/myLike')"  @message="crossPage.$listener"></web-view>
+  <!-- #endif -->
+</template>
+
+<script>
+  // #ifdef H5
+  export default {
+    data() {
+      return {
+        imgUrl: this.$imageUrl,
+        dataList: [],
         pageNum: 1,
-				loadStatus: 0,
-        refresherTriggered: false,
-      }
-    },
-
-    async onLoad() {
-      await this.getList()
-    },
-
-    methods: {
-      //获取列表数据
-      async getList() {
-        this.$api.get('/likeOrCollect/list', {
-          userId: this.$store.state.user.userId,
-          type: 1,
-          pageNum: this.pageNum,
-          pageSize: 10,
-        }).then(res => {
-          this.loadStatus = 0;
-          let list = res.data.records;
-          if(list.length < 10){
-          	this.loadStatus = 2;
-          }
-          this.dataList = this.dataList.concat(list);
-        }).catch(() => {
-					this.loadStatus = 2;
-				}).finally(res => {
-					this.refresherTriggered = false;
-				})
-      },
-
-      // 滚动到底部
-      scrolltolower(e) {
-      	if (this.loadStatus === 0) {
-      		this.pageNum++;
-      		this.getList();
-      	}
-      },
-
-      // 触发下拉刷新
-      refresherrefresh(e) {
-      	this.refresherTriggered = true;
-      	this.refreshList();
-      },
-
-      refreshList() {
-        this.dataList = [];
-        this.pageNum = 1;
-        this.getList();
-      },
-
-      toDetail(id) {
-        this.$navToPage({
-          url: `/pages/goods/detail?id=${id}`
-        })
-      },
-
-      handelCancel(id) {
-        this.$modal({
-          content: '确定要取消点赞吗?'
-        }).then(() => {
-          this.$api.postJson('/likeOrCollect/likeOrCollect', {
-            userId: this.$store.state.user.userId,
-            goodsId: id,
-            type: 1,
-            operate: 'NO'
-          }).then(res => {
-            this.refreshList();
-          })
-        }).catch(() => {})
-      },
-
-    }
-  }
-  // #endif
-  // #ifndef H5
-
-  // #endif
-</script>
-
-<style lang="scss" scoped>
-
-</style>
+				loadStatus: 0,
+        refresherTriggered: false,
+      }
+    },
+
+    async onLoad() {
+      await this.getList()
+    },
+
+    methods: {
+      //获取列表数据
+      async getList() {
+        this.$api.get('/likeOrCollect/list', {
+          userId: this.$store.state.user.userId,
+          type: 1,
+          pageNum: this.pageNum,
+          pageSize: 10,
+        }).then(res => {
+          this.loadStatus = 0;
+          let list = res.data.records;
+          if(list.length < 10){
+          	this.loadStatus = 2;
+          }
+          this.dataList = this.dataList.concat(list);
+        }).catch(() => {
+					this.loadStatus = 2;
+				}).finally(res => {
+					this.refresherTriggered = false;
+				})
+      },
+
+      // 滚动到底部
+      scrolltolower(e) {
+      	if (this.loadStatus === 0) {
+      		this.pageNum++;
+      		this.getList();
+      	}
+      },
+
+      // 触发下拉刷新
+      refresherrefresh(e) {
+      	this.refresherTriggered = true;
+      	this.refreshList();
+      },
+
+      refreshList() {
+        this.dataList = [];
+        this.pageNum = 1;
+        this.getList();
+      },
+
+      toDetail(id) {
+        this.$navToPage({
+          url: `/pages/goods/detail?id=${id}`
+        })
+      },
+
+      handelCancel(id) {
+        this.$modal({
+          content: '确定要取消点赞吗?'
+        }).then(() => {
+          this.$api.postJson('/likeOrCollect/likeOrCollect', {
+            userId: this.$store.state.user.userId,
+            goodsId: id,
+            type: 1,
+            operate: 'NO'
+          }).then(res => {
+            this.refreshList();
+          })
+        }).catch(() => {})
+      },
+
+    }
+  }
+  // #endif
+  // #ifndef H5
+
+  // #endif
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 1 - 1
src/pages/mine/parse.vue

@@ -10,7 +10,7 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref(`/pages/mine/parse`, pam)"></web-view>
+  <web-view :src="webViewHref(`/pages/mine/parse`, pam)"  @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>