Jelajahi Sumber

feat:发布

chenqilong 1 tahun lalu
induk
melakukan
52a8aee109
2 mengubah file dengan 36 tambahan dan 28 penghapusan
  1. 17 6
      src/pages/goods/detail.vue
  2. 19 22
      src/pages/issue/index.vue

+ 17 - 6
src/pages/goods/detail.vue

@@ -135,7 +135,7 @@
         	height="100">
         </u--textarea>
         <view class="title">上传凭证</view>
-        <zj-upload key="cp" @getFiles="getFiles" :fileList="reportForm.fileList" :count="9" />
+        <zj-upload key="cp" @getFiles="getFiles" :fileList="aaa" :count="9" />
       </view>
     </zj-dialog-box>
   </view>
@@ -156,6 +156,7 @@
 
     data() {
       return {
+        aaa:[],
         id: null,
         detail: null,
         remarkList: [],
@@ -376,21 +377,31 @@
         }
         // 重新上架
         else if(e.value === 4) {
-          uni.setStorageSync('issuePageParam', {
+          // uni.setStorageSync('issuePageParam', {
+          //   goodsId: this.id,
+          //   type: 1,
+          //   isLoad:true
+          // });
+          this.crossPage.$emit("issuePageParam",{
             goodsId: this.id,
             type: 1,
             isLoad:true
-          });
+          })
           this.$navToPage({
             url: `/pages/issue/index`
           }, 'switchTab')
         }
         // 编辑
         else if(e.value === 5) {
-          uni.setStorageSync('issuePageParam', {
+          // uni.setStorageSync('issuePageParam', {
+          //   goodsId: this.id,
+          //   type: 2
+          // });
+           this.crossPage.$emit("issuePageParam",{
             goodsId: this.id,
-            type: 2
-          });
+            type: 2,
+            isLoad:true
+          })
           this.$navToPage({
             url: `/pages/issue/index`
           }, 'switchTab')

+ 19 - 22
src/pages/issue/index.vue

@@ -126,7 +126,9 @@ export default {
       init: true
     }
   },
-
+  onLoad(pam) {
+    this.pam = pam
+  },
   onShow() {
     this.pam = uni.getStorageSync('issuePageParam')
     uni.removeStorageSync('issuePageParam');
@@ -152,7 +154,7 @@ export default {
     return {
       disabled: false,
       showTime: false,
-      show: true,
+      show: false,
       form: {
         title: '',
         content: '',
@@ -238,27 +240,16 @@ export default {
     //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过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()
-    }
+  onLoad() {
+    this.crossPage.$on("issuePageParam",this.getParams)
+    setTimeout(()=>{
+      this.show = this.goodsId?false:true
+    },300)
+  },
+  unOnLoad(){
+    this.crossPage.$off("issuePageParam",this.getParams)
   },
   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()
@@ -271,6 +262,13 @@ export default {
     }
   },
   methods: {
+    getParams(value){
+     this.type = value.type
+     this.goodsId = value.goodsId
+     if (value.goodsId) {
+      this.getDetail()
+     }
+    },
     //
     getDetail() {
       this.$api
@@ -373,7 +371,6 @@ export default {
                   }
                   this.$refs.form.clearValidate()
                   this.disabled = false
-                  this.show = true
                   this.crossPage.$emit('reloadHomePage');
                   this.$navToPage({
                       url: '/pages/index/index'