Bladeren bron

feat:发布

chenqilong 1 jaar geleden
bovenliggende
commit
eab7bc3672
2 gewijzigde bestanden met toevoegingen van 40 en 18 verwijderingen
  1. 1 1
      src/pages/goods/detail.vue
  2. 39 17
      src/pages/issue/index.vue

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

@@ -139,7 +139,7 @@
 </template>
 
 <script>
-	import zjDialogBox from "@/components/zj-dialog/zj-dialog-box.vue";
+	import zjDialogBox from "@/components/zj-dialog/zj-dialog-box.vue";
 	import zjDialogRemark from '@/components/zj-dialog/zj-dialog-remark.vue';
   import zjUpload from '@/components/zj-upload/index.vue'
 

+ 39 - 17
src/pages/issue/index.vue

@@ -97,13 +97,34 @@
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/issue/index')"></web-view>
+  <view>
+    <web-view v-if="isShow" :src="webViewHref('/pages/issue/index', pam)"></web-view>
+  </view>
   <!-- #endif -->
 </template>
 
 <script>
 import zjUpload from '@/components/zj-upload/index.vue'
 export default {
+  // #ifndef H5
+  data(){
+    return {
+      isShow:false,
+      pam:{}
+    }
+  },
+
+  onShow(){
+    this.pam = uni.getStorageSync('issuePageParam')
+    uni.removeStorageSync('issuePageParam');
+      this.isShow = false
+        this.$nextTick(()=>{
+          this.isShow = true
+        })
+  }
+  // #endif
+
+
   // #ifdef H5
   components: { zjUpload },
   data() {
@@ -207,23 +228,23 @@ export default {
     // 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
+    console.log(type, goodsId)
+    this.type = type
+    this.goodsId = goodsId
+    if (goodsId) {
       this.show = false
       this.getDetail()
-      uni.removeStorageSync('issuePageParam');
     }
+  },
+  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()
@@ -303,7 +324,7 @@ export default {
               ...this.form,
               goodsFiles: this.fileurl
             }
-            this.$toast('发布成功')
+            this.$toast('正在发布中,请稍后')
             setTimeout(() => {
               let path = '/goods/add'
               if (this.goodsId && this.type == 1) {
@@ -347,7 +368,8 @@ export default {
                   )
                 })
                 .catch(err => {
-                  this.$toast(err)
+                    this.disabled = false
+                  // this.$toast(err)
                 })
             }, 1000)
           }