Browse Source

feat: xiugai

linwenxin 1 year ago
parent
commit
8580f6602d

+ 35 - 8
src/common/utils/navPag.js

@@ -1,17 +1,20 @@
 // #ifdef H5
 import wx from 'weixin-js-sdk'
 // #endif
+import store from '@/store/index.js'
 import {
   isWeixin
 } from "./common.js"
-import store from '@/store/index.js'
+import {
+  delayPerform
+} from "js-perform-lock";
 
 import md5 from "md5"
 
-export function webViewHref(url, pam = {}) {
-
+export function webViewHref(url, pam = {}, crossPagePam = {}) {
   var defaultPam = {
     ...pam,
+    ...crossPagePam,
     "x-token": store.state.user.token,
     openId: store.state.user.openId,
     userId: store.state.user.userId,
@@ -29,7 +32,6 @@ export function webViewHref(url, pam = {}) {
   } else {
     return process.env.VUE_APP_HREF + url + `${pamstr?"?"+pamstr:""}`
   }
-
 }
 
 export const navToPage = (function() {
@@ -110,6 +112,23 @@ export const navToPage = (function() {
 export const crossPage = (function() {
   var funs = {}
   var tiemIdIs = {}
+  var datacd = []
+
+  // #ifndef H5
+  var delaydeparture = (new delayPerform(250)).refactor(function() {
+    var data = {}
+    datacd.map(function([name, val]) {
+      data[name] = val
+    })
+    uni.setStorageSync("$crossPageTs", JSON.stringify(data));
+    store.commit("user/setcrossPagePam", (new Date().getTime()));
+    setTimeout(function() {
+      uni.removeStorageSync("$crossPageTs")
+    }, 350)
+    datacd = []
+  });
+  // #endif
+
   var funco = {
     $emit(name, data) {
       if (funs[name]) {
@@ -117,16 +136,18 @@ export const crossPage = (function() {
           funs[name][key](data)
         })
       }
+
       // #ifndef H5
-      
+      datacd.push([name, data])
+      delaydeparture()
       // #endif
-      
+
       // #ifdef H5
       var postMessage = (window.uniWebview && window.uniWebview.postMessage) || (window.postMessage)
       if (postMessage) {
         postMessage({
           data: {
-            type: "crossPage_ts",
+            type: "crossPageTs",
             name,
             data
           }
@@ -156,22 +177,27 @@ export const crossPage = (function() {
       }
     },
 
+    // #ifndef H5
     $listener(e) {
       e.detail.data.map(({
         type,
         name,
         data
       }) => {
-        if (type == "crossPage_ts") {
+        if (type == "crossPageTs") {
           if (funs[name]) {
             Object.keys(funs[name]).map(key => {
               funs[name][key](data)
             })
           }
+          datacd.push([name, data])
+          delaydeparture()
         }
       })
     },
+    // #endif
   };
+
   // #ifdef H5
   (function tiemID() {
     Object.keys(funs).map(name => {
@@ -187,5 +213,6 @@ export const crossPage = (function() {
     setTimeout(tiemID, 200)
   })()
   // #endif
+
   return funco
 })()

+ 14 - 1
src/mixins/index.js

@@ -82,6 +82,19 @@ export default {
       crossPage: crossPage,
     }
   },
+  computed: {
+    crossPagePam() {
+      var num = this.$store.state.user.crossPagePam || 0
+      var data = uni.getStorageSync("$crossPageTs")
+      if (data) {
+        return {
+          $crossPageTs: data,
+          timestamp: num
+        }
+      }
+      return {}
+    }
+  },
   onLoad() {
     // #ifdef MP-WEIXIN
     routerBeforeEach()
@@ -98,4 +111,4 @@ export default {
   methods: {
     webViewHref: webViewHref,
   }
-}
+}

+ 54 - 55
src/pages/goods/list.vue

@@ -1,35 +1,16 @@
 <template>
   <!-- #ifdef H5 -->
-  <zj-page-layout
-  	:hasFooter="false"
-  	:isScroll="true"
-  	:refresherTriggered="refresherTriggered"
-  	@refresherrefresh="refresherrefresh"
-  	@scrolltolower="scrolltolower">
+  <zj-page-layout :hasFooter="false" :isScroll="true" :refresherTriggered="refresherTriggered"
+    @refresherrefresh="refresherrefresh" @scrolltolower="scrolltolower">
     <template slot="header">
       <view class="header-container">
-        <u-tabs
-          :list="categoryList"
-          :current="categoryCurrent"
-          @click="clickCategory"
-          keyName="categoryName"
-          :scrollable="categoryList.length === 4 ? false : true"
-          lineColor="#01C30B">
+        <u-tabs :list="categoryList" :current="categoryCurrent" @click="clickCategory" keyName="categoryName"
+          :scrollable="categoryList.length === 4 ? false : true" lineColor="#01C30B">
         </u-tabs>
-        <u-search
-          placeholder="输入商品名称搜索"
-          :showAction="false"
-          clearabled
-          v-model="keyword"
-          @search="refreshList"
+        <u-search placeholder="输入商品名称搜索" :showAction="false" clearabled v-model="keyword" @search="refreshList"
           @clear="refreshList">
         </u-search>
-        <u-tabs
-          :list="tabList"
-          :current="tabCurrent"
-          @click="clickTab"
-          :scrollable="false"
-          lineColor="#01C30B">
+        <u-tabs :list="tabList" :current="tabCurrent" @click="clickTab" :scrollable="false" lineColor="#01C30B">
         </u-tabs>
       </view>
     </template>
@@ -76,7 +57,7 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/goods/list', pam)"  @message="crossPage.$listener"></web-view>
+  <web-view :src="webViewHref('/pages/goods/list', pam,crossPagePam)" @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
@@ -88,11 +69,22 @@
         imgUrl: this.$imageUrl,
         categoryList: [],
         categoryId: '',
-        tabList: [
-          {name: '默认顺序', value: 0},
-          {name: '在售商品', value: 1},
-          {name: '离我最近', value: 2},
-          {name: '人气最高', value: 3},
+        tabList: [{
+            name: '默认顺序',
+            value: 0
+          },
+          {
+            name: '在售商品',
+            value: 1
+          },
+          {
+            name: '离我最近',
+            value: 2
+          },
+          {
+            name: '人气最高',
+            value: 3
+          },
         ],
         tabCurrent: 0,
         keyword: '',
@@ -103,17 +95,20 @@
       }
     },
 
-    computed:{
-    	categoryCurrent() {
-        if(this.categoryId) {
+    computed: {
+      categoryCurrent() {
+        if (this.categoryId) {
           return this.categoryList.map(item => item.categoryId).indexOf(this.categoryId)
-        }else {
+        } else {
           return 0
         }
-    	}
+      }
     },
 
-    async onLoad({categoryId, keyword}) {
+    async onLoad({
+      categoryId,
+      keyword
+    }) {
       this.categoryId = categoryId;
       this.keyword = keyword;
       await this.getCategory();
@@ -124,11 +119,11 @@
       async getCategory() {
         return new Promise((resolve, reject) => {
           this.$api.get('/goods/category/list')
-          .then(res => {
-            this.categoryList = res.data || [];
-          }).finally(res => {
-            resolve(1);
-          })
+            .then(res => {
+              this.categoryList = res.data || [];
+            }).finally(res => {
+              resolve(1);
+            })
         })
       },
 
@@ -137,7 +132,8 @@
         let params = {};
         if (this.tabCurrent === 0) {
           params.status = '1,2,4';
-        }if (this.tabCurrent === 1) {
+        }
+        if (this.tabCurrent === 1) {
           params.status = '1';
         } else if (this.tabCurrent === 2) {
           params.status = '1,2,4';
@@ -224,17 +220,20 @@
 </script>
 
 <style lang="scss" scoped>
-.header-container {
-  background: #ffffff;
-  padding: 0 30rpx;
-  ::v-deep .u-search {
-    margin-top: 20rpx !important;
+  .header-container {
+    background: #ffffff;
+    padding: 0 30rpx;
+
+    ::v-deep .u-search {
+      margin-top: 20rpx !important;
+    }
   }
-}
-.common-goods-list {
-  padding: 0 30rpx;
-  .item {
-    @include zj-card;
+
+  .common-goods-list {
+    padding: 0 30rpx;
+
+    .item {
+      @include zj-card;
+    }
   }
-}
-</style>
+</style>

+ 24 - 21
src/pages/index/index.vue

@@ -20,7 +20,8 @@
         </view>
 
         <view class="category-container card mt30">
-          <view class="item" :class="categoryList.length > 4 ? 'max':''" v-for="(item, index) in categoryList" :key="index" @tap="toGoodsList(item.categoryId)">
+          <view class="item" :class="categoryList.length > 4 ? 'max':''" v-for="(item, index) in categoryList"
+            :key="index" @tap="toGoodsList(item.categoryId)">
             <image :src="imageUrl + item.imgUrl"></image>
             <view class="name">{{item.categoryName}}</view>
           </view>
@@ -78,7 +79,7 @@
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/index/index', pam)"  @message="crossPage.$listener"></web-view>
+  <web-view :src="webViewHref('/pages/index/index', pam,crossPagePam)" @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
@@ -177,7 +178,8 @@
         let params = {};
         if (this.tabCurrent === 0) {
           params.status = '1,2,4';
-        }if (this.tabCurrent === 1) {
+        }
+        if (this.tabCurrent === 1) {
           params.status = '1';
         } else if (this.tabCurrent === 2) {
           params.status = '1,2,4';
@@ -267,23 +269,23 @@
     },
 
     onShareAppMessage(options) {
-    	if (options && options.from == 'button') {
-    		// 来自页面内的转发按钮
-    	} else {
-    		// 点击微信右上角的分享按钮
-    	}
-    	return {
-    		title: '分享小程序',
-    		path: '/pages/index/index',
-    		query: {
-    			// id: this.goodsId,
-    		},
-    		success: function(res) {
-    			if(res.errMsg == 'shareAppMessage:ok'){
-    				this.$successToast('分享完成');
-    			}
-    		}
-    	}
+      if (options && options.from == 'button') {
+        // 来自页面内的转发按钮
+      } else {
+        // 点击微信右上角的分享按钮
+      }
+      return {
+        title: '分享小程序',
+        path: '/pages/index/index',
+        query: {
+          // id: this.goodsId,
+        },
+        success: function(res) {
+          if (res.errMsg == 'shareAppMessage:ok') {
+            this.$successToast('分享完成');
+          }
+        }
+      }
     },
   }
   // #endif
@@ -334,6 +336,7 @@
       align-items: center;
       flex-direction: column;
       flex-shrink: 0;
+
       &.max {
         width: 22%;
       }
@@ -349,4 +352,4 @@
       }
     }
   }
-</style>
+</style>

+ 361 - 382
src/pages/issue/index.vue

@@ -26,13 +26,8 @@
         </u-form-item>
         <u-form-item labelPosition="left" required label="商品分类" prop="categoryId" borderBottom ref="item1">
           <u-radio-group v-model="form.categoryId" placement="column">
-            <u-radio
-              v-for="(v, i) in categoryList"
-              :key="i"
-              :customStyle="{ marginBottom: '8px' }"
-              :label="v.categoryName"
-              :name="v.categoryId"
-            >
+            <u-radio v-for="(v, i) in categoryList" :key="i" :customStyle="{ marginBottom: '8px' }"
+              :label="v.categoryName" :name="v.categoryId">
             </u-radio>
           </u-radio-group>
         </u-form-item>
@@ -50,25 +45,15 @@
           <u--input v-model="form.num" inputAlign="right" placeholder="请输入" border="none"></u--input>
         </u-form-item>
         <u-form-item label="商品品牌" labelPosition="left" prop="brand" borderBottom ref="item1">
-          <u--input
-            v-model="form.brand"
-            inputAlign="right"
-            placeholder="请输入(如格力、美的)"
-            border="none"
-          ></u--input>
+          <u--input v-model="form.brand" inputAlign="right" placeholder="请输入(如格力、美的)" border="none"></u--input>
         </u-form-item>
         <u-form-item label="功率(W)" labelPosition="left" prop="power" borderBottom ref="item1">
           <u--input v-model="form.power" inputAlign="right" placeholder="请输入" border="none"></u--input>
         </u-form-item>
         <u-form-item labelPosition="left" label="能效标识" prop="energy" borderBottom ref="item1">
           <u-radio-group v-model="form.energy" placement="column">
-            <u-radio
-              v-for="(v, i) in dictList"
-              :key="i"
-              :customStyle="{ marginBottom: '8px' }"
-              :label="v.dictValue"
-              :name="v.dictValue"
-            >
+            <u-radio v-for="(v, i) in dictList" :key="i" :customStyle="{ marginBottom: '8px' }" :label="v.dictValue"
+              :name="v.dictValue">
             </u-radio>
           </u-radio-group>
         </u-form-item>
@@ -87,409 +72,403 @@
         <u-button :disabled="disabled" @click="submin" text="发布" color="#5298ff" shape="circle"></u-button>
       </view>
     </view>
-    <u-datetime-picker
-      @cancel="handleCancelTime"
-      @confirm="handleConfirmTime"
-      :show="showTime"
-      v-model="time"
-      mode="year-month"
-    ></u-datetime-picker>
+    <u-datetime-picker @cancel="handleCancelTime" @confirm="handleConfirmTime" :show="showTime" v-model="time"
+      mode="year-month"></u-datetime-picker>
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
   <view>
-    <web-view v-if="isShow" :src="webViewHref('/pages/issue/index', pam)"  @message="crossPage.$listener"></web-view>
+    <web-view v-if="isShow" :src="webViewHref('/pages/issue/index', pam,crossPagePam)"
+      @message="crossPage.$listener"></web-view>
   </view>
   <!-- #endif -->
 </template>
 
 <script>
-import zjUpload from '@/components/zj-upload/index.vue'
-export default {
-  // #ifndef H5
-  data(){
-    return {
-      isShow:false,
-      pam:{},
-      init:true
-    }
-  },
+  import zjUpload from '@/components/zj-upload/index.vue'
+  export default {
+    // #ifndef H5
+    data() {
+      return {
+        isShow: false,
+        pam: {},
+        init: true
+      }
+    },
 
-  onShow(){
-    this.pam = uni.getStorageSync('issuePageParam')
-    uni.removeStorageSync('issuePageParam');
+    onShow() {
+      this.pam = uni.getStorageSync('issuePageParam')
+      uni.removeStorageSync('issuePageParam');
+
+      if (this.pam.isLoad || this.init) {
+        this.init = false
+        delete this.pam.isLoad
+        this.isShow = false
+        this.$nextTick(() => {
+          this.isShow = true
+        })
+      }
 
-    if(this.pam.isLoad || this.init){
-      this.init=false
-      delete this.pam.isLoad
-      this.isShow = false
-      this.$nextTick(()=>{
-        this.isShow = true
-      })
     }
-      
-  }
-  // #endif
+    // #endif
 
 
-  // #ifdef H5
-  components: { zjUpload },
-  data() {
-    return {
-      disabled: false,
-      showTime: false,
-      show: true,
-      form: {
-        title: '',
-        content: '',
-        categoryName: '',
-        categoryId: '',
-        lng: '',
-        lat: '',
-        address: '',
-        amount: '',
-        num: '',
-        brand: '',
-        power: '',
-        energy: '',
-        province: '',
-        city: '',
-        area: '',
-        street: '',
-        goodsCreateTime: ''
-      },
-      rules: {
-        title: [
-          {
-            required: true,
-            message: '必传',
-            trigger: ['change', 'blur']
-          }
-        ],
-        content: [
-          {
+    // #ifdef H5
+    components: {
+      zjUpload
+    },
+    data() {
+      return {
+        disabled: false,
+        showTime: false,
+        show: true,
+        form: {
+          title: '',
+          content: '',
+          categoryName: '',
+          categoryId: '',
+          lng: '',
+          lat: '',
+          address: '',
+          amount: '',
+          num: '',
+          brand: '',
+          power: '',
+          energy: '',
+          province: '',
+          city: '',
+          area: '',
+          street: '',
+          goodsCreateTime: ''
+        },
+        rules: {
+          title: [{
             required: true,
             message: '必传',
             trigger: ['change', 'blur']
-          }
-        ],
-        categoryId: [
-          {
+          }],
+          content: [{
             required: true,
             message: '必传',
             trigger: ['change', 'blur']
-          }
-        ],
-        address: [
-          {
+          }],
+          categoryId: [{
             required: true,
             message: '必传',
             trigger: ['change', 'blur']
-          }
-        ],
-        amount: [
-          {
+          }],
+          address: [{
             required: true,
             message: '必传',
             trigger: ['change', 'blur']
-          },
-          {
-            pattern: /^\d+\.?\d*$/g,
-            // 正则检验前先将值转为字符串
-            transform(value) {
-              return String(value)
+          }],
+          amount: [{
+              required: true,
+              message: '必传',
+              trigger: ['change', 'blur']
             },
-            message: '格式不正确',
-            trigger: ['change', 'blur']
-          }
-        ],
-        num: [
-          {
-            required: true,
-            message: '必传',
-            trigger: ['change', 'blur']
-          },
-          {
-            pattern: /^\d+$/g,
-            // 正则检验前先将值转为字符串
-            transform(value) {
-              return String(value)
+            {
+              pattern: /^\d+\.?\d*$/g,
+              // 正则检验前先将值转为字符串
+              transform(value) {
+                return String(value)
+              },
+              message: '格式不正确',
+              trigger: ['change', 'blur']
+            }
+          ],
+          num: [{
+              required: true,
+              message: '必传',
+              trigger: ['change', 'blur']
             },
-            message: '格式不正确',
-            trigger: ['change', 'blur']
-          }
-        ]
-      },
-      time: Number(new Date()),
-      categoryList: [],
-      dictList: [],
-      fileList: [],
-      fileurl: [],
-      content: '',
-      type: '',
-      goodsId: ''
-    }
-  },
-  onReady() {
-    //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
-    // this.$refs.form.setRules(this.rules)
-  },
-  onLoad({ type, goodsId }) {
-    console.log(type, goodsId)
-    this.type = type
-    this.goodsId = goodsId
-    if (goodsId) {
-      this.show = false
-      this.getDetail()
-    }
-  },
-  onShow() {
-    // const value = uni.getStorageSync('issuePageParam')
-    // if (value) {
-    //   this.type = value.type
-    //   this.goodsId = value.goodsId
-    //   this.show = false
-    //   this.getDetail()
-    //   uni.removeStorageSync('issuePageParam');
-    // }
-    this.getConfig()
-    this.getList()
-    this.getDictList()
-  },
-  watch: {
-    'form.address': {
-      handler(nl) {
-        this.$refs.form.clearValidate('address')
+            {
+              pattern: /^\d+$/g,
+              // 正则检验前先将值转为字符串
+              transform(value) {
+                return String(value)
+              },
+              message: '格式不正确',
+              trigger: ['change', 'blur']
+            }
+          ]
+        },
+        time: Number(new Date()),
+        categoryList: [],
+        dictList: [],
+        fileList: [],
+        fileurl: [],
+        content: '',
+        type: '',
+        goodsId: ''
       }
-    }
-  },
-  methods: {
-    //
-    getDetail() {
-      this.$api
-        .postJson('/goods/detail', {
-          id: this.goodsId
-        })
-        .then(res => {
-          console.log(res)
-          this.form = {
-            title: res.data.title,
-            content: res.data.content,
-            categoryName: res.data.categoryName,
-            categoryId: res.data.categoryId,
-            lng: res.data.lng,
-            lat: res.data.lat,
-            address: res.data.address,
-            amount: String(res.data.amount),
-            num: String(res.data.num),
-            brand: res.data.brand,
-            power: res.data.power,
-            energy: res.data.energy,
-            province: res.data.province,
-            city: res.data.city,
-            area: res.data.area,
-            street: res.data.street,
-            goodsCreateTime: res.data.goodsCreateTime
-          }
-          this.fileList = res.data.goodsFiles.map(v => v.imgUrl)
-          this.fileurl = []
-          res.data.goodsFiles.forEach(v => {
-            this.fileurl.push({
-              imgUrl: v.imgUrl
-            })
-          })
-        })
-        .catch(() => {})
     },
-    getConfig() {
-      this.$api
-        .get('/app/config/detail-by-type', {
-          configType: '4'
-        })
-        .then(res => {
-          this.content = res.data.content
-        })
-        .catch(() => {})
+    onReady() {
+      //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+      // this.$refs.form.setRules(this.rules)
     },
-    getFiles(value) {
-      this.fileurl = []
-      value.forEach(v => {
-        this.fileurl.push({
-          imgUrl: v
-        })
-      })
+    onLoad({
+      type,
+      goodsId
+    }) {
+      console.log(type, goodsId)
+      this.type = type
+      this.goodsId = goodsId
+      if (goodsId) {
+        this.show = false
+        this.getDetail()
+      }
+    },
+    onShow() {
+      // const value = uni.getStorageSync('issuePageParam')
+      // if (value) {
+      //   this.type = value.type
+      //   this.goodsId = value.goodsId
+      //   this.show = false
+      //   this.getDetail()
+      //   uni.removeStorageSync('issuePageParam');
+      // }
+      this.getConfig()
+      this.getList()
+      this.getDictList()
+    },
+    watch: {
+      'form.address': {
+        handler(nl) {
+          this.$refs.form.clearValidate('address')
+        }
+      }
     },
-    submin() {
-      this.$refs.form
-        .validate()
-        .then(valid => {
-          if (valid) {
-            this.disabled = true
-            this.form.categoryName =
-              this.categoryList.find(v => v.categoryId === this.form.categoryId)?.categoryName ?? ''
-            let params = {
-              ...this.form,
-              goodsFiles: this.fileurl
+    methods: {
+      //
+      getDetail() {
+        this.$api
+          .postJson('/goods/detail', {
+            id: this.goodsId
+          })
+          .then(res => {
+            console.log(res)
+            this.form = {
+              title: res.data.title,
+              content: res.data.content,
+              categoryName: res.data.categoryName,
+              categoryId: res.data.categoryId,
+              lng: res.data.lng,
+              lat: res.data.lat,
+              address: res.data.address,
+              amount: String(res.data.amount),
+              num: String(res.data.num),
+              brand: res.data.brand,
+              power: res.data.power,
+              energy: res.data.energy,
+              province: res.data.province,
+              city: res.data.city,
+              area: res.data.area,
+              street: res.data.street,
+              goodsCreateTime: res.data.goodsCreateTime
             }
-            this.$toast('正在发布中,请稍后')
-            setTimeout(() => {
-              let path = '/goods/add'
-              if (this.goodsId && this.type == 1) {
-                path = '/goods/updateUp'
-                params.id = this.goodsId
-              }
-              if (this.goodsId && this.type == 2) {
-                path = '/goods/update'
-                params.id = this.goodsId
+            this.fileList = res.data.goodsFiles.map(v => v.imgUrl)
+            this.fileurl = []
+            res.data.goodsFiles.forEach(v => {
+              this.fileurl.push({
+                imgUrl: v.imgUrl
+              })
+            })
+          })
+          .catch(() => {})
+      },
+      getConfig() {
+        this.$api
+          .get('/app/config/detail-by-type', {
+            configType: '4'
+          })
+          .then(res => {
+            this.content = res.data.content
+          })
+          .catch(() => {})
+      },
+      getFiles(value) {
+        this.fileurl = []
+        value.forEach(v => {
+          this.fileurl.push({
+            imgUrl: v
+          })
+        })
+      },
+      submin() {
+        this.$refs.form
+          .validate()
+          .then(valid => {
+            if (valid) {
+              this.disabled = true
+              this.form.categoryName =
+                this.categoryList.find(v => v.categoryId === this.form.categoryId)?.categoryName ?? ''
+              let params = {
+                ...this.form,
+                goodsFiles: this.fileurl
               }
-              this.$api
-                .post(path, params)
-                .then(res => {
-                  this.form = {
-                    title: '',
-                    content: '',
-                    categoryName: '',
-                    categoryId: '',
-                    lng: '',
-                    lat: '',
-                    address: '',
-                    amount: '',
-                    num: '',
-                    brand: '',
-                    power: '',
-                    province: '',
-                    city: '',
-                    area: '',
-                    street: '',
-                    energy: '',
-                    goodsCreateTime: ''
-                  }
-                  this.$refs.form.clearValidate()
-                  this.disabled = false
-                  this.show = true
-                  this.$navToPage(
-                    {
-                      url: '/pages/index/index'
-                    },
-                    'switchTab'
-                  )
-                })
-                .catch(err => {
+              this.$toast('正在发布中,请稍后')
+              setTimeout(() => {
+                let path = '/goods/add'
+                if (this.goodsId && this.type == 1) {
+                  path = '/goods/updateUp'
+                  params.id = this.goodsId
+                }
+                if (this.goodsId && this.type == 2) {
+                  path = '/goods/update'
+                  params.id = this.goodsId
+                }
+                this.$api
+                  .post(path, params)
+                  .then(res => {
+                    this.form = {
+                      title: '',
+                      content: '',
+                      categoryName: '',
+                      categoryId: '',
+                      lng: '',
+                      lat: '',
+                      address: '',
+                      amount: '',
+                      num: '',
+                      brand: '',
+                      power: '',
+                      province: '',
+                      city: '',
+                      area: '',
+                      street: '',
+                      energy: '',
+                      goodsCreateTime: ''
+                    }
+                    this.$refs.form.clearValidate()
                     this.disabled = false
-                  // this.$toast(err)
-                })
-            }, 1000)
-          }
-        })
-        .catch(err => {
-          this.$toast('缺少必要参数,请检查')
-        })
+                    this.show = true
+                    this.$navToPage({
+                        url: '/pages/index/index'
+                      },
+                      'switchTab'
+                    )
+                  })
+                  .catch(err => {
+                    this.disabled = false
+                    // this.$toast(err)
+                  })
+              }, 1000)
+            }
+          })
+          .catch(err => {
+            this.$toast('缺少必要参数,请检查')
+          })
 
-      return
-    },
-    //获取商品分类数据
-    async getList() {
-      this.$api
-        .get('/goods/category/list')
-        .then(res => {
-          this.categoryList = res.data
-        })
-        .catch(() => {})
-    },
-    //获取能效数据
-    async getDictList() {
-      this.$api
-        .get('/goods/dict', {
-          dictCode: '能效'
-        })
-        .then(res => {
-          this.dictList = res.data
+        return
+      },
+      //获取商品分类数据
+      async getList() {
+        this.$api
+          .get('/goods/category/list')
+          .then(res => {
+            this.categoryList = res.data
+          })
+          .catch(() => {})
+      },
+      //获取能效数据
+      async getDictList() {
+        this.$api
+          .get('/goods/dict', {
+            dictCode: '能效'
+          })
+          .then(res => {
+            this.dictList = res.data
+          })
+          .catch(() => {})
+      },
+      handleDW() {
+        uni.chooseLocation({
+          success: res => {
+            this.form.lng = res.longitude
+            this.form.lat = res.latitude
+            this.form.address = res.address
+            this.$api
+              .post(`/lbs/amap/region/query?lng=${res.longitude}&lat=${res.latitude}`)
+              .then(res => {
+                console.log(res)
+                this.form.province = res.data.provinceName
+                this.form.city = res.data.cityName
+                this.form.area = res.data.areaName
+                this.form.street = res.data.name
+              })
+              .catch(() => {})
+          }
         })
-        .catch(() => {})
-    },
-    handleDW() {
-      uni.chooseLocation({
-        success: res => {
-          this.form.lng = res.longitude
-          this.form.lat = res.latitude
-          this.form.address = res.address
-          this.$api
-            .post(`/lbs/amap/region/query?lng=${res.longitude}&lat=${res.latitude}`)
-            .then(res => {
-              console.log(res)
-              this.form.province = res.data.provinceName
-              this.form.city = res.data.cityName
-              this.form.area = res.data.areaName
-              this.form.street = res.data.name
-            })
-            .catch(() => {})
-        }
-      })
-    },
-    handleConfirmTime(value) {
-      const date = new Date(value.value) // JavaScript的Date对象使用的是毫秒时间戳,因此需要将Unix时间戳乘以1000
-      const year = date.getFullYear()
-      const month = String(date.getMonth() + 1).padStart(2, '0') // getMonth()返回的月份是从0开始的,因此需要加1,然后使用padStart()添加前导零
-      const day = String(date.getDate()).padStart(2, '0')
-      const hours = String(date.getHours()).padStart(2, '0')
-      const minutes = String(date.getMinutes()).padStart(2, '0')
-      const seconds = String(date.getSeconds()).padStart(2, '0')
+      },
+      handleConfirmTime(value) {
+        const date = new Date(value.value) // JavaScript的Date对象使用的是毫秒时间戳,因此需要将Unix时间戳乘以1000
+        const year = date.getFullYear()
+        const month = String(date.getMonth() + 1).padStart(2, '0') // getMonth()返回的月份是从0开始的,因此需要加1,然后使用padStart()添加前导零
+        const day = String(date.getDate()).padStart(2, '0')
+        const hours = String(date.getHours()).padStart(2, '0')
+        const minutes = String(date.getMinutes()).padStart(2, '0')
+        const seconds = String(date.getSeconds()).padStart(2, '0')
 
-      let res = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
-      let res2 = `${year}-${month}`
-      this.form.goodsCreateTime = res
-      this.time = res2
-      this.showTime = false
-    },
-    handleCancelTime() {
-      this.showTime = false
-    },
-    handleTime() {
-      this.showTime = true
-    },
-    handleAgree() {
-      this.show = false
+        let res = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+        let res2 = `${year}-${month}`
+        this.form.goodsCreateTime = res
+        this.time = res2
+        this.showTime = false
+      },
+      handleCancelTime() {
+        this.showTime = false
+      },
+      handleTime() {
+        this.showTime = true
+      },
+      handleAgree() {
+        this.show = false
+      }
     }
+    // #endif
   }
-  // #endif
-}
 </script>
 
 <style lang="scss" scoped>
-.contentXZ {
-  padding: 20px;
-}
-.pop {
-  overflow: auto;
-  //   padding: 0 20rpx;
-  /* #ifdef H5 */
-  // height: calc(100vh - 44px);
-  height: 100vh;
-  /* #endif */
-  /* #ifndef H5 */
-  height: 100vh;
-  /* #endif */
-}
+  .contentXZ {
+    padding: 20px;
+  }
+
+  .pop {
+    overflow: auto;
+    //   padding: 0 20rpx;
+    /* #ifdef H5 */
+    // height: calc(100vh - 44px);
+    height: 100vh;
+    /* #endif */
+    /* #ifndef H5 */
+    height: 100vh;
+    /* #endif */
+  }
+
+  .content {
+    padding: 0 40rpx;
+    margin: 20rpx 0;
+    //   height: calc(100vh - 44px);
+    background-color: #fff;
+  }
 
-.content {
-  padding: 0 40rpx;
-  margin: 20rpx 0;
-  //   height: calc(100vh - 44px);
-  background-color: #fff;
-}
-.bottom-container {
-  position: fixed;
-  bottom: 0;
-  width: 100%;
-  background-color: #f1f1f1;
-  padding: 18px 0;
-}
-.letText {
-  width: 100%;
-  display: flex;
-  justify-content: flex-end;
-}
-::v-deep .u-radio-label--undefined {
-  justify-content: flex-end;
-}
-</style>
+  .bottom-container {
+    position: fixed;
+    bottom: 0;
+    width: 100%;
+    background-color: #f1f1f1;
+    padding: 18px 0;
+  }
+
+  .letText {
+    width: 100%;
+    display: flex;
+    justify-content: flex-end;
+  }
+
+  ::v-deep .u-radio-label--undefined {
+    justify-content: flex-end;
+  }
+</style>

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

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

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

@@ -110,7 +110,7 @@
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/message/msgView',pam)"  @message="crossPage.$listener"></web-view>
+  <web-view :src="webViewHref('/pages/message/msgView',pam,crossPagePam)" @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
@@ -133,6 +133,10 @@
     },
     onLoad(pam) {
       this.pam = pam
+      this.crossPage.$emit("aaaaa", {
+        a: 1,
+        n: 0
+      })
     },
     onShow() {
       // #ifdef H5

+ 151 - 135
src/pages/mine/myBuy/detail.vue

@@ -1,23 +1,16 @@
 <template>
   <!-- #ifdef H5 -->
   <view>
-    <Loading
-    	:type="3"
-    	:loadStatus="loadStatus"
-    	:showText="errorText"
-    />
-    <zj-page-layout
-      v-if="detail"
-    	:hasFooter="true"
-    	:isScroll="true"
-    	:refresherTriggered="refresherTriggered"
-    	@refresherrefresh="refresherrefresh">
+    <Loading :type="3" :loadStatus="loadStatus" :showText="errorText" />
+    <zj-page-layout v-if="detail" :hasFooter="true" :isScroll="true" :refresherTriggered="refresherTriggered"
+      @refresherrefresh="refresherrefresh">
 
       <view class="address-container">
         <view class="icon"><text class="iconfont icon-dingwei1"></text></view>
         <view class="hasdata">
           <view class="name">{{detail.userName}}<text>{{detail.phone}}</text></view>
-          <view class="address ellipsis-2">{{detail.province}}{{detail.city}}{{detail.area}}{{detail.street}}{{detail.address}}</view>
+          <view class="address ellipsis-2">
+            {{detail.province}}{{detail.city}}{{detail.area}}{{detail.street}}{{detail.address}}</view>
         </view>
       </view>
 
@@ -72,7 +65,8 @@
         <view class="bottom-container">
           <block v-if="detail.status == 'WAIT'">
             <u-button text="取消订单" shape="circle" @click="cancelOrder(detail.orderId)"></u-button>
-            <u-button text="去支付" shape="circle" type="primary" plain @tap="toPay(detail.goodsId, detail.orderId)"></u-button>
+            <u-button text="去支付" shape="circle" type="primary" plain
+              @tap="toPay(detail.goodsId, detail.orderId)"></u-button>
           </block>
 
           <block v-if="detail.status == 'WAIT_SEND'">
@@ -97,7 +91,7 @@
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/mine/myBuy/detail', pam)"  @message="crossPage.$listener"></web-view>
+  <web-view :src="webViewHref('/pages/mine/myBuy/detail', pam,crossPagePam)" @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
@@ -119,12 +113,14 @@
         detail: null,
         imageUrl: this.$imageUrl,
         loadStatus: 0,
-				errorText: '',
+        errorText: '',
         refresherTriggered: false,
       }
     },
 
-    onLoad({orderId}) {
+    onLoad({
+      orderId
+    }) {
       this.orderId = orderId;
       this.getDetail();
     },
@@ -134,14 +130,14 @@
         this.$api.postJson('/orderPay/detail', {
           orderId: this.orderId
         }).then(res => {
-					this.detail = res.data;
-					this.loadStatus = 0;
-				}).catch(res => {
-					this.errorText = res.message;
-					this.loadStatus = 2;
-				}).finally(res => {
-					this.refresherTriggered = false;
-				})
+          this.detail = res.data;
+          this.loadStatus = 0;
+        }).catch(res => {
+          this.errorText = res.message;
+          this.loadStatus = 2;
+        }).finally(res => {
+          this.refresherTriggered = false;
+        })
       },
 
       refresherrefresh() {
@@ -225,137 +221,157 @@
 </script>
 
 <style lang="scss" scoped>
-.address-container {
-  background: #FFFFFF;
-  display: flex;
-  align-items: center;
-  height: 150rpx;
-  padding: 0 20rpx;
-  margin-top: 30rpx;
-  .icon {
-    width: 52rpx;
-    height: 52rpx;
-    border-radius: 50%;
-    background: $theme-color;
+  .address-container {
+    background: #FFFFFF;
     display: flex;
-    flex-shrink: 0;
-    justify-content: center;
     align-items: center;
-    margin-right: 20rpx;
-    .iconfont {
-      font-size: 36rpx;
-      color: #ffffff;
+    height: 150rpx;
+    padding: 0 20rpx;
+    margin-top: 30rpx;
+
+    .icon {
+      width: 52rpx;
+      height: 52rpx;
+      border-radius: 50%;
+      background: $theme-color;
+      display: flex;
+      flex-shrink: 0;
+      justify-content: center;
+      align-items: center;
+      margin-right: 20rpx;
+
+      .iconfont {
+        font-size: 36rpx;
+        color: #ffffff;
+      }
     }
-  }
-  .hasdata {
-    .name {
-      font-size: 32rpx;
-      color: #333333;
-      text {
-        color: #999999;
+
+    .hasdata {
+      .name {
+        font-size: 32rpx;
+        color: #333333;
+
+        text {
+          color: #999999;
+          font-size: 28rpx;
+          margin-left: 16rpx;
+        }
+      }
+
+      .address {
         font-size: 28rpx;
-        margin-left: 16rpx;
+        color: #666666;
+        line-height: 34rpx;
+        margin-top: 10rpx;
       }
     }
-    .address {
-      font-size: 28rpx;
-      color: #666666;
-      line-height: 34rpx;
-      margin-top: 10rpx;
-    }
-  }
-}
-
-.goods-container {
-  background: #ffffff;
-  margin-top: 30rpx;
-  padding: 30rpx 30rpx 0;
-  .title {
-    font-weight: 500;
   }
-  .goods {
-    display: flex;
-    padding: 30rpx 0;
-    image {
-      width: 120rpx;
-      height: 120rpx;
+
+  .goods-container {
+    background: #ffffff;
+    margin-top: 30rpx;
+    padding: 30rpx 30rpx 0;
+
+    .title {
+      font-weight: 500;
     }
-    .main {
-      flex: 1;
-      margin-left: 20rpx;
-      .name {
-        font-size: 32rpx;
-        text {
+
+    .goods {
+      display: flex;
+      padding: 30rpx 0;
+
+      image {
+        width: 120rpx;
+        height: 120rpx;
+      }
+
+      .main {
+        flex: 1;
+        margin-left: 20rpx;
+
+        .name {
+          font-size: 32rpx;
+
+          text {
+            font-size: 28rpx;
+            color: $sec-font;
+            margin-left: 12rpx;
+          }
+        }
+
+        .des {
+          margin-top: 12rpx;
           font-size: 28rpx;
-          color: $sec-font;
-          margin-left: 12rpx;
+          color: $reg-font;
+        }
+
+        .price {
+          margin-top: 12rpx;
+          color: $assist-color;
+          font-weight: 500;
+          font-size: 32rpx;
         }
       }
-      .des {
-        margin-top: 12rpx;
+    }
+
+    .total {
+      border-top: 1px solid #eaeaea;
+      height: 80rpx;
+      display: flex;
+      align-items: center;
+      justify-content: end;
+      font-size: 28rpx;
+
+      text {
+        margin-left: 12rpx;
+        color: $assist-color;
+      }
+    }
+  }
+
+  .order-container {
+    background: #ffffff;
+    margin-top: 30rpx;
+    padding: 30rpx;
+
+    .title {
+      font-weight: 500;
+      margin-bottom: 20rpx;
+    }
+
+    .row {
+      display: flex;
+      align-items: center;
+      margin-top: 20rpx;
+
+      .label {
+        font-size: 28rpx;
+        color: $sec-font;
+        margin-right: 20rpx;
+      }
+
+      .value {
         font-size: 28rpx;
-        color: $reg-font;
       }
+
       .price {
-        margin-top: 12rpx;
         color: $assist-color;
         font-weight: 500;
-        font-size: 32rpx;
       }
     }
   }
-  .total {
-    border-top: 1px solid #eaeaea;
-    height: 80rpx;
-    display: flex;
-    align-items: center;
-    justify-content: end;
-    font-size: 28rpx;
-    text {
-      margin-left: 12rpx;
-      color: $assist-color;
-    }
-  }
-}
-
-.order-container {
-  background: #ffffff;
-  margin-top: 30rpx;
-  padding: 30rpx;
-  .title {
-    font-weight: 500;
-    margin-bottom: 20rpx;
-  }
-  .row {
+
+  .bottom-container {
+    padding: 20rpx 30rpx;
     display: flex;
     align-items: center;
-    margin-top: 20rpx;
-    .label {
-      font-size: 28rpx;
-      color: $sec-font;
-      margin-right: 20rpx;
-    }
-    .value {
-      font-size: 28rpx;
-    }
-    .price {
-      color: $assist-color;
-      font-weight: 500;
+    justify-content: flex-end;
+
+    .u-button {
+      width: auto;
+      height: 60rpx;
+      margin: 0;
+      margin-left: 20rpx;
     }
   }
-}
-
-.bottom-container {
-  padding: 20rpx 30rpx;
-  display: flex;
-  align-items: center;
-  justify-content: flex-end;
-  .u-button {
-    width: auto;
-    height: 60rpx;
-    margin: 0;
-    margin-left: 20rpx;
-  }
-}
-
-</style>
+</style>

+ 52 - 45
src/pages/mine/myBuy/list.vue

@@ -1,26 +1,15 @@
 <template>
   <!-- #ifdef H5 -->
-  <zj-page-layout
-  	:hasFooter="false"
-  	:isScroll="true"
-  	:refresherTriggered="refresherTriggered"
-  	@refresherrefresh="refresherrefresh"
-  	@scrolltolower="scrolltolower">
+  <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="{
+        <u-tabs :scrollable="false" :list="tabList" :current="tabCurrent" @click="clickTab" lineColor="#01C30B"
+          :activeStyle="{
         		color: '#01C30B'
-        	}"
-        	:inactiveStyle="{
+        	}" :inactiveStyle="{
         		color: '#666666'
-        	}"
-        	itemStyle="padding-left: 0; padding-right: 0; height: 88rpx;">
+        	}" itemStyle="padding-left: 0; padding-right: 0; height: 88rpx;">
         </u-tabs>
       </view>
     </template>
@@ -61,7 +50,8 @@
 
             <block v-if="item.status == 'WAIT'">
               <u-button text="取消订单" shape="circle" @click="cancelOrder(item.orderId)"></u-button>
-              <u-button text="去支付" shape="circle" type="primary" plain @tap="toPay(item.goodsId, item.orderId)"></u-button>
+              <u-button text="去支付" shape="circle" type="primary" plain
+                @tap="toPay(item.goodsId, item.orderId)"></u-button>
             </block>
 
             <block v-if="~['SEND', 'COMPLETE'].indexOf(item.status)">
@@ -90,7 +80,7 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref(`/pages/mine/myBuy/list`, pam)"  @message="crossPage.$listener"></web-view>
+  <web-view :src="webViewHref(`/pages/mine/myBuy/list`, pam,crossPagePam)" @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
@@ -117,13 +107,30 @@
     data() {
       return {
         imageUrl: this.$imageUrl,
-        tabList: [
-          {name: '全部', value: 0},
-          {name: '待付款', value: 1},
-          {name: '待发货', value: 2},
-          {name: '待收货', value: 3},
-          {name: '已收货', value: 4},
-          {name: '售后中', value: 5},
+        tabList: [{
+            name: '全部',
+            value: 0
+          },
+          {
+            name: '待付款',
+            value: 1
+          },
+          {
+            name: '待发货',
+            value: 2
+          },
+          {
+            name: '待收货',
+            value: 3
+          },
+          {
+            name: '已收货',
+            value: 4
+          },
+          {
+            name: '售后中',
+            value: 5
+          },
         ],
         tabCurrent: 0,
         dataList: [],
@@ -133,7 +140,9 @@
       }
     },
 
-    async onLoad({tab}) {
+    async onLoad({
+      tab
+    }) {
       this.tabCurrent = tab ? Number(tab) : 0;
       await this.getList();
     },
@@ -164,29 +173,29 @@
         }).then(res => {
           this.loadStatus = 0;
           let list = res.data.records;
-          if(list.length < 10){
-          	this.loadStatus = 2;
+          if (list.length < 10) {
+            this.loadStatus = 2;
           }
           this.dataList = this.dataList.concat(list);
         }).catch(() => {
-      		this.loadStatus = 2;
-      	}).finally(res => {
-      		this.refresherTriggered = false;
-      	})
+          this.loadStatus = 2;
+        }).finally(res => {
+          this.refresherTriggered = false;
+        })
       },
 
       // 滚动到底部
       scrolltolower(e) {
-      	if (this.loadStatus === 0) {
-      		this.pageNum++;
-      		this.getList();
-      	}
+        if (this.loadStatus === 0) {
+          this.pageNum++;
+          this.getList();
+        }
       },
 
       // 触发下拉刷新
       refresherrefresh(e) {
-      	this.refresherTriggered = true;
-      	this.refreshLish();
+        this.refresherTriggered = true;
+        this.refreshLish();
       },
 
       refreshLish() {
@@ -284,9 +293,7 @@
 </script>
 
 <style lang="scss" scoped>
-.header-container {
-  background: #ffffff;
-}
-
-
-</style>
+  .header-container {
+    background: #ffffff;
+  }
+</style>

+ 189 - 185
src/pages/mine/myBuy/return.vue

@@ -1,11 +1,7 @@
 <template>
   <!-- #ifdef H5 -->
-  <zj-page-layout
-    :hasFooter="true"
-    :isScroll="true"
-    :refresherTriggered="refresherTriggered"
-    @refresherrefresh="refresherrefresh"
-  >
+  <zj-page-layout :hasFooter="true" :isScroll="true" :refresherTriggered="refresherTriggered"
+    @refresherrefresh="refresherrefresh">
     <view class="goods-container">
       <view class="title">商品信息</view>
       <view class="goods">
@@ -13,15 +9,10 @@
         <view class="main">
           <view class="name">{{ form.goodsTitle }}</view>
           <view class="des">{{ form.goods.content }}</view>
-          <view class="price"
-            ><text>¥{{ form.goodsAmount }}</text
-            >x{{ form.num }}</view
-          >
+          <view class="price"><text>¥{{ form.goodsAmount }}</text>x{{ form.num }}</view>
         </view>
       </view>
-      <view class="total"
-        >订单总金额<text>¥{{ form.price }}</text></view
-      >
+      <view class="total">订单总金额<text>¥{{ form.price }}</text></view>
     </view>
 
     <view class="form-container">
@@ -34,12 +25,8 @@
       </view>
       <view class="content">
         <view class="label"><text style="color: red">*</text>退货原因</view>
-        <u--textarea
-          style="backgroundcolor: #fff"
-          :disabled="showDisable"
-          v-model="formdata.applyNote"
-          placeholder="请输入内容"
-        ></u--textarea>
+        <u--textarea style="backgroundcolor: #fff" :disabled="showDisable" v-model="formdata.applyNote"
+          placeholder="请输入内容"></u--textarea>
       </view>
       <view class="content">
         <view class="label">上传图片(最多9张)</view>
@@ -81,198 +68,215 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref(`/pages/mine/myBuy/return`, pam)"  @message="crossPage.$listener"></web-view>
+  <web-view :src="webViewHref(`/pages/mine/myBuy/return`, pam,crossPagePam)" @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
 <script>
-import zjUpload from '@/components/zj-upload/index.vue'
-import { tr } from '@dcloudio/vue-cli-plugin-uni/packages/postcss/tags'
-export default {
-  // #ifndef H5
-  data() {
-    return {
-      pam: {}
-    }
-  },
+  import zjUpload from '@/components/zj-upload/index.vue'
+  import {
+    tr
+  } from '@dcloudio/vue-cli-plugin-uni/packages/postcss/tags'
+  export default {
+    // #ifndef H5
+    data() {
+      return {
+        pam: {}
+      }
+    },
 
-  onLoad(pam) {
-    this.pam = pam
-  },
-  // #endif
-  // #ifdef H5
-  components: {
-    zjUpload
-  },
-  data() {
-    return {
-      disabled: false,
-      type: 1,
-      content: '',
-      refresherTriggered: false,
-      form: {
-        goods: {}
-      },
-      formdata: {
-        applyType: 'REFUND',
-        applyNote: ''
-      },
-      showDisable: false,
-      fileList: [],
-      fileurl: [],
-      orderId: ''
-    }
-  },
-  onLoad({ orderId }) {
-    this.orderId = orderId
-  },
-  onShow() {
-    this.getDetail()
-  },
-  methods: {
-    back() {
-      uni.navigateBack()
+    onLoad(pam) {
+      this.pam = pam
     },
-    getFiles(value) {
-      this.fileurl = value
+    // #endif
+    // #ifdef H5
+    components: {
+      zjUpload
     },
-    //
-    apply() {
-      if (!this.formdata.applyNote) {
-        this.$toast('缺少必要参数,请检查')
-        return
+    data() {
+      return {
+        disabled: false,
+        type: 1,
+        content: '',
+        refresherTriggered: false,
+        form: {
+          goods: {}
+        },
+        formdata: {
+          applyType: 'REFUND',
+          applyNote: ''
+        },
+        showDisable: false,
+        fileList: [],
+        fileurl: [],
+        orderId: ''
       }
-      this.disabled = true
-      let params = {
-        ...this.formdata,
-        orderId: this.orderId,
-        refundFile: this.fileurl.toString()
-      }
-      this.$toast('正在申请售后中...')
-      setTimeout(() => {
+    },
+    onLoad({
+      orderId
+    }) {
+      this.orderId = orderId
+    },
+    onShow() {
+      this.getDetail()
+    },
+    methods: {
+      back() {
+        uni.navigateBack()
+      },
+      getFiles(value) {
+        this.fileurl = value
+      },
+      //
+      apply() {
+        if (!this.formdata.applyNote) {
+          this.$toast('缺少必要参数,请检查')
+          return
+        }
+        this.disabled = true
+        let params = {
+          ...this.formdata,
+          orderId: this.orderId,
+          refundFile: this.fileurl.toString()
+        }
+        this.$toast('正在申请售后中...')
+        setTimeout(() => {
+          this.$api
+            .postJson('/refundOrder/apply', params)
+            .then(res => {
+              this.disabled = false
+              this.$navToPage({
+                  url: '/pages/mine/myBuy/list'
+                },
+                'redirectTo'
+              )
+            })
+            .catch(err => {
+              this.disabled = false
+            })
+        }, 1000)
+      },
+      //
+      getDetail() {
         this.$api
-          .postJson('/refundOrder/apply', params)
+          .postJson('/refundOrder/detail', {
+            orderId: this.orderId
+          })
           .then(res => {
-            this.disabled = false
-            this.$navToPage(
-              {
-                url: '/pages/mine/myBuy/list'
-              },
-              'redirectTo'
-            )
+            this.form = res.data
+            this.fileList = res.data.orderRefundFileList.map(v => v.imgUrl)
+            if (['AFTER_WAIT', 'REFUND', 'NO_REFUND'].indexOf(res.data.status) !== -1) {
+              this.showDisable = true
+            }
           })
-          .catch(err => {
-            this.disabled = false
+          .catch(err => {})
+          .finally(() => {
+            this.refresherTriggered = false
           })
-      }, 1000)
-    },
-    //
-    getDetail() {
-      this.$api
-        .postJson('/refundOrder/detail', {
-          orderId: this.orderId
-        })
-        .then(res => {
-          this.form = res.data
-          this.fileList = res.data.orderRefundFileList.map(v => v.imgUrl)
-          if (['AFTER_WAIT', 'REFUND', 'NO_REFUND'].indexOf(res.data.status) !== -1) {
-            this.showDisable = true
-          }
-        })
-        .catch(err => {
-        })
-        .finally(() => {
-          this.refresherTriggered = false
-        })
-    },
-    refresherrefresh() {
-      this.refresherTriggered = true
-      this.getDetail()
+      },
+      refresherrefresh() {
+        this.refresherTriggered = true
+        this.getDetail()
+      }
     }
+    // #endif
   }
-  // #endif
-}
 </script>
 
 <style lang="scss" scoped>
-.goods-container {
-  background: #ffffff;
-  margin-top: 30rpx;
-  padding: 30rpx 30rpx 0;
-  .title {
-    font-weight: 500;
-  }
-  .goods {
-    display: flex;
-    padding: 30rpx 0;
-    image {
-      width: 120rpx;
-      height: 120rpx;
+  .goods-container {
+    background: #ffffff;
+    margin-top: 30rpx;
+    padding: 30rpx 30rpx 0;
+
+    .title {
+      font-weight: 500;
     }
-    .main {
-      flex: 1;
-      margin-left: 20rpx;
-      .name {
-        font-size: 32rpx;
-      }
-      .des {
-        margin-top: 12rpx;
-        font-size: 28rpx;
-        color: $reg-font;
+
+    .goods {
+      display: flex;
+      padding: 30rpx 0;
+
+      image {
+        width: 120rpx;
+        height: 120rpx;
       }
-      .price {
-        margin-top: 12rpx;
-        text {
-          color: $assist-color;
-          font-weight: 500;
+
+      .main {
+        flex: 1;
+        margin-left: 20rpx;
+
+        .name {
           font-size: 32rpx;
-          margin-right: 12rpx;
+        }
+
+        .des {
+          margin-top: 12rpx;
+          font-size: 28rpx;
+          color: $reg-font;
+        }
+
+        .price {
+          margin-top: 12rpx;
+
+          text {
+            color: $assist-color;
+            font-weight: 500;
+            font-size: 32rpx;
+            margin-right: 12rpx;
+          }
         }
       }
     }
-  }
-  .total {
-    border-top: 1px solid #eaeaea;
-    height: 80rpx;
-    display: flex;
-    align-items: center;
-    justify-content: end;
-    font-size: 28rpx;
-    text {
-      margin-left: 12rpx;
-      color: $assist-color;
+
+    .total {
+      border-top: 1px solid #eaeaea;
+      height: 80rpx;
+      display: flex;
+      align-items: center;
+      justify-content: end;
+      font-size: 28rpx;
+
+      text {
+        margin-left: 12rpx;
+        color: $assist-color;
+      }
     }
   }
-}
 
-.form-container {
-  background: #ffffff;
-  margin-top: 30rpx;
-  padding: 30rpx;
-  .title {
-    font-weight: 500;
-  }
-  .label {
-    color: $sec-font;
-    flex-shrink: 0;
-    margin-right: 30rpx;
-  }
-  .radio {
-    display: flex;
-    align-items: center;
-    margin-top: 30rpx;
-  }
-  .content {
-    display: flex;
-    margin-top: 30rpx;
-  }
-  .row {
-    display: flex;
+  .form-container {
+    background: #ffffff;
     margin-top: 30rpx;
+    padding: 30rpx;
+
+    .title {
+      font-weight: 500;
+    }
+
+    .label {
+      color: $sec-font;
+      flex-shrink: 0;
+      margin-right: 30rpx;
+    }
+
+    .radio {
+      display: flex;
+      align-items: center;
+      margin-top: 30rpx;
+    }
+
+    .content {
+      display: flex;
+      margin-top: 30rpx;
+    }
+
+    .row {
+      display: flex;
+      margin-top: 30rpx;
+    }
   }
-}
 
-.bottom-container {
-  padding: 20rpx 30rpx;
-}
-</style>
+  .bottom-container {
+    padding: 20rpx 30rpx;
+  }
+</style>

+ 17 - 21
src/pages/mine/myCollection.vue

@@ -1,11 +1,7 @@
 <template>
   <!-- #ifdef H5 -->
-  <zj-page-layout
-  	:hasFooter="false"
-  	:isScroll="true"
-  	:refresherTriggered="refresherTriggered"
-  	@refresherrefresh="refresherrefresh"
-  	@scrolltolower="scrolltolower">
+  <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">
@@ -34,7 +30,7 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/mine/myCollection')"  @message="crossPage.$listener"></web-view>
+  <web-view :src="webViewHref('/pages/mine/myCollection',crossPagePam)" @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
@@ -46,7 +42,7 @@
         imgUrl: this.$imageUrl,
         dataList: [],
         pageNum: 1,
-				loadStatus: 0,
+        loadStatus: 0,
         refresherTriggered: false,
       }
     },
@@ -66,29 +62,29 @@
         }).then(res => {
           this.loadStatus = 0;
           let list = res.data.records;
-          if(list.length < 10){
-          	this.loadStatus = 2;
+          if (list.length < 10) {
+            this.loadStatus = 2;
           }
           this.dataList = this.dataList.concat(list);
         }).catch(() => {
-					this.loadStatus = 2;
-				}).finally(res => {
-					this.refresherTriggered = false;
-				})
+          this.loadStatus = 2;
+        }).finally(res => {
+          this.refresherTriggered = false;
+        })
       },
 
       // 滚动到底部
       scrolltolower(e) {
-      	if (this.loadStatus === 0) {
-      		this.pageNum++;
-      		this.getList();
-      	}
+        if (this.loadStatus === 0) {
+          this.pageNum++;
+          this.getList();
+        }
       },
 
       // 触发下拉刷新
       refresherrefresh(e) {
-      	this.refresherTriggered = true;
-      	this.refreshList();
+        this.refresherTriggered = true;
+        this.refreshList();
       },
 
       refreshList() {
@@ -128,4 +124,4 @@
 
 <style lang="scss" scoped>
 
-</style>
+</style>

+ 98 - 89
src/pages/mine/myEarnings/detail.vue

@@ -1,16 +1,8 @@
 <template>
   <!-- #ifdef H5 -->
   <view>
-    <Loading
-    	:type="3"
-    	:loadStatus="loadStatus"
-    	:showText="errorText"
-    />
-    <zj-page-layout
-      v-if="detail"
-      :hasFooter="false"
-      :isScroll="true"
-      :refresherTriggered="refresherTriggered"
+    <Loading :type="3" :loadStatus="loadStatus" :showText="errorText" />
+    <zj-page-layout v-if="detail" :hasFooter="false" :isScroll="true" :refresherTriggered="refresherTriggered"
       @refresherrefresh="refresherrefresh">
 
       <view class="goods-container">
@@ -68,7 +60,8 @@
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/mine/myEarnings/detail', pam)"  @message="crossPage.$listener"></web-view>
+  <web-view :src="webViewHref('/pages/mine/myEarnings/detail', pam,crossPagePam)"
+    @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
@@ -90,12 +83,14 @@
         detail: null,
         imageUrl: this.$imageUrl,
         loadStatus: 0,
-  			errorText: '',
+        errorText: '',
         refresherTriggered: false,
       }
     },
 
-    onLoad({id}) {
+    onLoad({
+      id
+    }) {
       this.id = id;
       this.getDetail();
     },
@@ -105,14 +100,14 @@
         this.$api.postJson('/orderPay/detail', {
           orderId: this.id
         }).then(res => {
-  				this.detail = res.data;
-  				this.loadStatus = 0;
-  			}).catch(res => {
-  				this.errorText = res.message;
-  				this.loadStatus = 2;
-  			}).finally(res => {
-  				this.refresherTriggered = false;
-  			})
+          this.detail = res.data;
+          this.loadStatus = 0;
+        }).catch(res => {
+          this.errorText = res.message;
+          this.loadStatus = 2;
+        }).finally(res => {
+          this.refresherTriggered = false;
+        })
       },
 
       refresherrefresh() {
@@ -138,83 +133,97 @@
 </script>
 
 <style lang="scss" scoped>
-.goods-container {
-  background: #ffffff;
-  margin-top: 30rpx;
-  padding: 30rpx 30rpx 0;
-  .title {
-    font-weight: 500;
-  }
-  .goods {
-    display: flex;
-    padding: 30rpx 0;
-    image {
-      width: 120rpx;
-      height: 120rpx;
+  .goods-container {
+    background: #ffffff;
+    margin-top: 30rpx;
+    padding: 30rpx 30rpx 0;
+
+    .title {
+      font-weight: 500;
     }
-    .main {
-      flex: 1;
-      margin-left: 20rpx;
-      .name {
-        font-size: 32rpx;
-        text {
+
+    .goods {
+      display: flex;
+      padding: 30rpx 0;
+
+      image {
+        width: 120rpx;
+        height: 120rpx;
+      }
+
+      .main {
+        flex: 1;
+        margin-left: 20rpx;
+
+        .name {
+          font-size: 32rpx;
+
+          text {
+            font-size: 28rpx;
+            color: $sec-font;
+            margin-left: 12rpx;
+          }
+        }
+
+        .des {
+          margin-top: 12rpx;
           font-size: 28rpx;
-          color: $sec-font;
-          margin-left: 12rpx;
+          color: $reg-font;
         }
+
+        .price {
+          margin-top: 12rpx;
+          color: $assist-color;
+          font-weight: 500;
+          font-size: 32rpx;
+        }
+      }
+    }
+
+    .total {
+      border-top: 1px solid #eaeaea;
+      height: 80rpx;
+      display: flex;
+      align-items: center;
+      justify-content: end;
+      font-size: 28rpx;
+
+      text {
+        margin-left: 12rpx;
+        color: $assist-color;
+      }
+    }
+  }
+
+  .order-container {
+    background: #ffffff;
+    margin-top: 30rpx;
+    padding: 30rpx;
+
+    .title {
+      font-weight: 500;
+      margin-bottom: 20rpx;
+    }
+
+    .row {
+      display: flex;
+      align-items: center;
+      margin-top: 20rpx;
+
+      .label {
+        font-size: 28rpx;
+        color: $sec-font;
+        margin-right: 20rpx;
       }
-      .des {
-        margin-top: 12rpx;
+
+      .value {
         font-size: 28rpx;
-        color: $reg-font;
       }
+
       .price {
-        margin-top: 12rpx;
         color: $assist-color;
         font-weight: 500;
-        font-size: 32rpx;
       }
     }
   }
-  .total {
-    border-top: 1px solid #eaeaea;
-    height: 80rpx;
-    display: flex;
-    align-items: center;
-    justify-content: end;
-    font-size: 28rpx;
-    text {
-      margin-left: 12rpx;
-      color: $assist-color;
-    }
-  }
-}
-
-.order-container {
-  background: #ffffff;
-  margin-top: 30rpx;
-  padding: 30rpx;
-  .title {
-    font-weight: 500;
-    margin-bottom: 20rpx;
-  }
-  .row {
-    display: flex;
-    align-items: center;
-    margin-top: 20rpx;
-    .label {
-      font-size: 28rpx;
-      color: $sec-font;
-      margin-right: 20rpx;
-    }
-    .value {
-      font-size: 28rpx;
-    }
-    .price {
-      color: $assist-color;
-      font-weight: 500;
-    }
-  }
-}
-
-</style>
+</style>

+ 93 - 79
src/pages/mine/myEarnings/list.vue

@@ -1,11 +1,7 @@
 <template>
   <!-- #ifdef H5 -->
-  <zj-page-layout
-  	:hasFooter="false"
-  	:isScroll="true"
-  	:refresherTriggered="refresherTriggered"
-  	@refresherrefresh="refresherrefresh"
-  	@scrolltolower="scrolltolower">
+  <zj-page-layout :hasFooter="false" :isScroll="true" :refresherTriggered="refresherTriggered"
+    @refresherrefresh="refresherrefresh" @scrolltolower="scrolltolower">
     <view class="total-container">
       <view class="top">
         <view class="num">¥{{count.total || 0}}</view>
@@ -41,7 +37,8 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/mine/myEarnings/list', pam)"  @message="crossPage.$listener"></web-view>
+  <web-view :src="webViewHref('/pages/mine/myEarnings/list', pam,crossPagePam)"
+    @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
@@ -82,7 +79,7 @@
           this.$api.get('/likeOrCollect/countLikeCollect', {
             userId: this.$store.state.user.userId,
           }).then(res => {
-            if(!res.data) return false;
+            if (!res.data) return false;
             this.count = res.data;
           }).finally(res => {
             resolve(1);
@@ -103,31 +100,31 @@
         }).then(res => {
           this.loadStatus = 0;
           let list = res.data.records;
-          if(list.length < 10){
-          	this.loadStatus = 2;
+          if (list.length < 10) {
+            this.loadStatus = 2;
           }
           this.dataList = this.dataList.concat(list);
         }).catch(() => {
-					this.loadStatus = 2;
-				})
+          this.loadStatus = 2;
+        })
       },
 
       // 滚动到底部
       scrolltolower(e) {
-      	if (this.loadStatus === 0) {
-      		this.pageNum++;
-      		this.getList();
-      	}
+        if (this.loadStatus === 0) {
+          this.pageNum++;
+          this.getList();
+        }
       },
 
       // 触发下拉刷新
       async refresherrefresh(e) {
-      	this.refresherTriggered = true;
-      	this.dataList = [];
-      	this.pageNum = 1;
-      	await this.getList();
+        this.refresherTriggered = true;
+        this.dataList = [];
+        this.pageNum = 1;
+        await this.getList();
         await this.getStats();
-      	this.refresherTriggered = false;
+        this.refresherTriggered = false;
       },
 
       toDetail(id) {
@@ -146,7 +143,7 @@
         pam: {},
       }
     },
-  
+
     onLoad(pam) {
       this.pam = pam;
     },
@@ -155,83 +152,100 @@
 </script>
 
 <style lang="scss" scoped>
-.total-container {
-  background: #ffffff;
-  margin-top: 30rpx;
-  .top {
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    padding: 30rpx 0;
-    .num {
-      font-size: 36rpx;
-      color: $assist-color;
-      font-weight: 500;
-    }
-    .text {
-      font-size: 28rpx;
-      margin-top: 12rpx;
-    }
-  }
-  .bottom {
-    display: flex;
-    border-top: 1px solid #eaeaea;
-    .item {
-      flex: 1;
+  .total-container {
+    background: #ffffff;
+    margin-top: 30rpx;
+
+    .top {
       display: flex;
       flex-direction: column;
       align-items: center;
       padding: 30rpx 0;
-      &:first-child {
-        border-right: 1px solid #eaeaea;
-      }
+
       .num {
         font-size: 36rpx;
         color: $assist-color;
         font-weight: 500;
       }
+
       .text {
         font-size: 28rpx;
         margin-top: 12rpx;
       }
     }
-  }
-}
-.list-container {
-  margin-top: 40rpx;
-  .title {
-    color: $sec-font;
-    font-size: 28rpx;
-    padding-left: 30rpx;
-  }
-  .item {
-    background: #ffffff;
-    display: flex;
-    padding: 20rpx 30rpx;
-    margin-top: 20rpx;
-    .left {
-      flex: 1;
-      .row {
-        font-size: 28rpx;
-        margin-top: 12rpx;
+
+    .bottom {
+      display: flex;
+      border-top: 1px solid #eaeaea;
+
+      .item {
+        flex: 1;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        padding: 30rpx 0;
+
         &:first-child {
-          margin-top: 0;
+          border-right: 1px solid #eaeaea;
+        }
+
+        .num {
+          font-size: 36rpx;
+          color: $assist-color;
+          font-weight: 500;
+        }
+
+        .text {
+          font-size: 28rpx;
+          margin-top: 12rpx;
         }
       }
     }
-    .right {
+  }
+
+  .list-container {
+    margin-top: 40rpx;
+
+    .title {
+      color: $sec-font;
+      font-size: 28rpx;
+      padding-left: 30rpx;
+    }
+
+    .item {
+      background: #ffffff;
       display: flex;
-      flex-direction: column;
-      justify-content: space-between;
-      align-items: flex-end;
-      .status {
-        color: $minor-color;
+      padding: 20rpx 30rpx;
+      margin-top: 20rpx;
+
+      .left {
+        flex: 1;
+
+        .row {
+          font-size: 28rpx;
+          margin-top: 12rpx;
+
+          &:first-child {
+            margin-top: 0;
+          }
+        }
       }
-      .price {
-        font-weight: 500;
+
+      .right {
+        display: flex;
+        flex-direction: column;
+        justify-content: space-between;
+        align-items: flex-end;
+
+        .status {
+          color: $minor-color;
+        }
+
+        .price {
+          font-weight: 500;
+        }
       }
-    }
 
+    }
   }
-}
-</style>
+</style>

+ 45 - 48
src/pages/mine/myIssue/list.vue

@@ -1,27 +1,16 @@
 <template>
   <!-- #ifdef H5 -->
   <view>
-    <zj-page-layout
-      :hasFooter="false"
-      :isScroll="true"
-      :refresherTriggered="refresherTriggered"
-      @refresherrefresh="refresherrefresh"
-      @scrolltolower="scrolltolower">
+    <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"
+          <u-tabs :scrollable="false" :list="tabList" :current="tabCurrent" @click="clickTab" lineColor="#01C30B"
             :activeStyle="{
               color: '#01C30B'
-            }"
-            :inactiveStyle="{
+            }" :inactiveStyle="{
               color: '#666666'
-            }"
-            itemStyle="padding-left: 0; padding-right: 0; height: 88rpx;">
+            }" itemStyle="padding-left: 0; padding-right: 0; height: 88rpx;">
           </u-tabs>
         </view>
       </template>
@@ -46,12 +35,15 @@
           </view>
           <view class="bottom">
             <view class="left-buyer" v-if="item.status === 4 && item.orderInfo">
-              <image :src="item.orderInfo.buyerUserPic ? (imageUrl + item.orderInfo.buyerUserPic) : require('@/static/common/logo.png')"></image>
+              <image
+                :src="item.orderInfo.buyerUserPic ? (imageUrl + item.orderInfo.buyerUserPic) : require('@/static/common/logo.png')">
+              </image>
               <view class="name">{{item.orderInfo.buyerUserName}}</view>
               <view class="text">买到了</view>
             </view>
-            <view class="left-location" v-else><text class="iconfont icon-dingwei"></text>{{item.city}} {{item.area}}</view>
-            
+            <view class="left-location" v-else><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>
@@ -65,21 +57,18 @@
 
     </zj-page-layout>
 
-    <zj-dialog-deliver
-      ref="deliverDialog"
-      :isShow="isShowDeliverDialog"
-      @close="isShowDeliverDialog = false">
+    <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>
+  <web-view :src="webViewHref(`/pages/mine/myIssue/list`, pam,crossPagePam)" @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
 <script>
   // #ifdef H5
-	import zjDialogDeliver from '@/components/zj-dialog/zj-dialog-deliver.vue';
+  import zjDialogDeliver from '@/components/zj-dialog/zj-dialog-deliver.vue';
 
   export default {
     components: {
@@ -102,10 +91,18 @@
     data() {
       return {
         imageUrl: this.$imageUrl,
-        tabList: [
-          {name: '我发布的', value: 0},
-          {name: '已卖出', value: 1},
-          {name: '已下架', value: 2},
+        tabList: [{
+            name: '我发布的',
+            value: 0
+          },
+          {
+            name: '已卖出',
+            value: 1
+          },
+          {
+            name: '已下架',
+            value: 2
+          },
         ],
         tabCurrent: 0,
         dataList: [],
@@ -117,7 +114,9 @@
       }
     },
 
-    async onLoad({tab}) {
+    async onLoad({
+      tab
+    }) {
       this.tabCurrent = tab ? Number(tab) : 0;
       await this.getList();
 
@@ -146,29 +145,29 @@
         }).then(res => {
           this.loadStatus = 0;
           let list = res.data.records;
-          if(list.length < 10){
-          	this.loadStatus = 2;
+          if (list.length < 10) {
+            this.loadStatus = 2;
           }
           this.dataList = this.dataList.concat(list);
         }).catch(() => {
-					this.loadStatus = 2;
-				}).finally(res => {
-					this.refresherTriggered = false;
-				})
+          this.loadStatus = 2;
+        }).finally(res => {
+          this.refresherTriggered = false;
+        })
       },
 
       // 滚动到底部
       scrolltolower(e) {
-      	if (this.loadStatus === 0) {
-      		this.pageNum++;
-      		this.getList();
-      	}
+        if (this.loadStatus === 0) {
+          this.pageNum++;
+          this.getList();
+        }
       },
 
       // 触发下拉刷新
       refresherrefresh(e) {
-      	this.refresherTriggered = true;
-      	this.refreshLish();
+        this.refresherTriggered = true;
+        this.refreshLish();
       },
 
       refreshLish() {
@@ -217,9 +216,7 @@
 </script>
 
 <style lang="scss" scoped>
-.header-container {
-  background: #ffffff;
-}
-
-
-</style>
+  .header-container {
+    background: #ffffff;
+  }
+</style>

+ 17 - 21
src/pages/mine/myLike.vue

@@ -1,11 +1,7 @@
 <template>
   <!-- #ifdef H5 -->
-  <zj-page-layout
-  	:hasFooter="false"
-  	:isScroll="true"
-  	:refresherTriggered="refresherTriggered"
-  	@refresherrefresh="refresherrefresh"
-  	@scrolltolower="scrolltolower">
+  <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">
@@ -34,7 +30,7 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/mine/myLike')"  @message="crossPage.$listener"></web-view>
+  <web-view :src="webViewHref('/pages/mine/myLike',crossPagePam)" @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
@@ -46,7 +42,7 @@
         imgUrl: this.$imageUrl,
         dataList: [],
         pageNum: 1,
-				loadStatus: 0,
+        loadStatus: 0,
         refresherTriggered: false,
       }
     },
@@ -66,29 +62,29 @@
         }).then(res => {
           this.loadStatus = 0;
           let list = res.data.records;
-          if(list.length < 10){
-          	this.loadStatus = 2;
+          if (list.length < 10) {
+            this.loadStatus = 2;
           }
           this.dataList = this.dataList.concat(list);
         }).catch(() => {
-					this.loadStatus = 2;
-				}).finally(res => {
-					this.refresherTriggered = false;
-				})
+          this.loadStatus = 2;
+        }).finally(res => {
+          this.refresherTriggered = false;
+        })
       },
 
       // 滚动到底部
       scrolltolower(e) {
-      	if (this.loadStatus === 0) {
-      		this.pageNum++;
-      		this.getList();
-      	}
+        if (this.loadStatus === 0) {
+          this.pageNum++;
+          this.getList();
+        }
       },
 
       // 触发下拉刷新
       refresherrefresh(e) {
-      	this.refresherTriggered = true;
-      	this.refreshList();
+        this.refresherTriggered = true;
+        this.refreshList();
       },
 
       refreshList() {
@@ -128,4 +124,4 @@
 
 <style lang="scss" scoped>
 
-</style>
+</style>

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

@@ -1,59 +1,58 @@
 <template>
   <!-- #ifdef H5 -->
-  <zj-page-layout
-  	:bgColor="'#FFFFFF'"
-  	:hasFooter="false"
-  	:isScroll="false">
-  	<view class="content">
-  		<u-parse :content="content" :tagStyle="style"></u-parse>
-  	</view>
+  <zj-page-layout :bgColor="'#FFFFFF'" :hasFooter="false" :isScroll="false">
+    <view class="content">
+      <u-parse :content="content" :tagStyle="style"></u-parse>
+    </view>
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref(`/pages/mine/parse`, pam)"  @message="crossPage.$listener"></web-view>
+  <web-view :src="webViewHref(`/pages/mine/parse`, pam,crossPagePam)" @message="crossPage.$listener"></web-view>
   <!-- #endif -->
 </template>
 
 <script>
   // #ifdef H5
-	export default {
-		data() {
-			return {
-				type: 1,
-				content: '',
-				style: {
-					p: 'font-size: 32rpx; line-height: 52rpx;',
-				}
-			}
-		},
-		onLoad({type}) {
-			this.type = type;
-      if(type == 1) {
+  export default {
+    data() {
+      return {
+        type: 1,
+        content: '',
+        style: {
+          p: 'font-size: 32rpx; line-height: 52rpx;',
+        }
+      }
+    },
+    onLoad({
+      type
+    }) {
+      this.type = type;
+      if (type == 1) {
         uni.setNavigationBarTitle({
-          title: '防骗指南'
+          title: '防骗指南'
         })
-      }else if(type == 2) {
+      } else if (type == 2) {
         uni.setNavigationBarTitle({
-          title: '隐私政策'
+          title: '隐私政策'
         })
-      }else if(type == 3) {
+      } else if (type == 3) {
         uni.setNavigationBarTitle({
-          title: '用户协议'
+          title: '用户协议'
         })
       }
 
-			this.getDetail();
-		},
-		methods: {
-			getDetail() {
-				this.$api.get('/app/config/detail-by-type', {
+      this.getDetail();
+    },
+    methods: {
+      getDetail() {
+        this.$api.get('/app/config/detail-by-type', {
           configType: this.type
         }).then(res => {
-					this.content = res.data ? res.data.content : '';
-				})
-			},
-		},
-	}
+          this.content = res.data ? res.data.content : '';
+        })
+      },
+    },
+  }
 
   // #endif
   // #ifndef H5
@@ -71,10 +70,11 @@
 </script>
 
 <style lang="scss" scoped>
-	.content {
+  .content {
     padding: 0 30rpx 30rpx;
-		image {
-			width: 100%;
-		}
-	}
-</style>
+
+    image {
+      width: 100%;
+    }
+  }
+</style>

+ 1 - 0
src/store/getters.js

@@ -4,6 +4,7 @@ const getters = {
   name: state => state.user.name,
   avatar: state => state.user.avatar,
   userId: state => state.user.userId,
+  crossPagePam: state => state.user.crossPagePam,
 }
 
 

+ 2 - 1
src/store/modules/user/actions.js

@@ -34,8 +34,9 @@ export default {
       commit("set_name", "")
       commit("set_avatar", "")
       commit("set_userId", "")
+      commit("setcrossPagePam", 0)
       resolve()
     })
   },
 
-}
+}

+ 1 - 0
src/store/modules/user/index.js

@@ -51,6 +51,7 @@ const state = {
   name: uni.getStorageSync('recycle_mobile_name') || '',
   avatar: uni.getStorageSync('recycle_mobile_avatar') || '',
   userId: uni.getStorageSync('recycle_mobile_userId') || '',
+  crossPagePam: ""
 }
 export default {
   namespaced: true,

+ 4 - 1
src/store/modules/user/mutations.js

@@ -45,4 +45,7 @@ export default {
     }
   },
 
-}
+  setcrossPagePam:(state, crossPagePam) => {
+    state.crossPagePam = crossPagePam
+  },
+}