From 7b7a0126d2a7da21955eea1f332796010b6eb3a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Dchenxuelian=E2=80=9C?= <“chenxuelian@cjiedata.com”> Date: Wed, 1 Feb 2023 21:56:58 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/uni-searchbar.vue | 17 +++++++++++++---- packageMy/myRelease/myRelease.vue | 9 ++++++++- .../goods-category-search/category-index.vue | 4 ++-- pages/ideasAndNeeds/ideasAndNeeds.vue | 19 +++++++++++++++++++ 4 files changed, 42 insertions(+), 7 deletions(-) diff --git a/components/uni-searchbar.vue b/components/uni-searchbar.vue index 7b37d01..f605fd7 100644 --- a/components/uni-searchbar.vue +++ b/components/uni-searchbar.vue @@ -12,7 +12,10 @@ :focus="true" placeholder="搜索优质产品" prefixIcon="search" - :border="false" style="background-color: #fff;border: none;"/> + :border="false" + style="background-color: #fff;border: none;" + confirm-type="go" + @confirm="goSearch(queryParamF)"/> 搜索优质商品 @@ -49,19 +52,25 @@ }, data() { return { - queryParamF: null + queryParamF: '' } }, watch: { queryParam: { handler(val) { - this.queryParamF = this.queryParam + this.queryParamF = this.queryParam || '' }, immediate: true } }, methods: { - goSearch() { + goSearch(value) { + console.log('---enter') + console.log(value) + console.log(this.queryParamF) + if(!this.queryParamF && value) { + this.queryParamF = value + } if(this.readOnly) { this.$emit('navigate') return diff --git a/packageMy/myRelease/myRelease.vue b/packageMy/myRelease/myRelease.vue index 157bfc4..55949ca 100644 --- a/packageMy/myRelease/myRelease.vue +++ b/packageMy/myRelease/myRelease.vue @@ -77,7 +77,14 @@ ideasList: [] } }, - onLoad() { + onLoad(options) { + console.log(options) + if(options && options.index) { + console.log(options) + options.index = options.index - 1 + this.tabChange(options) + return + } this.getIdeasAndNeeds() }, methods: { diff --git a/packageSearch/goods-category-search/category-index.vue b/packageSearch/goods-category-search/category-index.vue index e558059..fd096fc 100644 --- a/packageSearch/goods-category-search/category-index.vue +++ b/packageSearch/goods-category-search/category-index.vue @@ -16,7 +16,7 @@ - + {{item.name}} @@ -392,7 +392,7 @@ this.goodsParam.pageNum++ this.getGoodsList(false) } else { - this.$toast.warn('没有更多数据了') + this.$toast.warn('暂无数据') } setTimeout(() => { uni.hideLoading() diff --git a/pages/ideasAndNeeds/ideasAndNeeds.vue b/pages/ideasAndNeeds/ideasAndNeeds.vue index 7c7df9e..d8d92b9 100644 --- a/pages/ideasAndNeeds/ideasAndNeeds.vue +++ b/pages/ideasAndNeeds/ideasAndNeeds.vue @@ -403,6 +403,14 @@ apiService.submitIdeasAndNeeds(data).then(res => { this.$toast.success('提交成功') console.log('esf=', res); + if(this.needsPublishForm.id) { + uni.navigateTo({ + url: '../../packageMy/myRelease/myRelease?index=' + (this.tabCurrent + 1) + }) + } + this.tabCurrent = 0 + this.fileList1 = [] + this.needsPublishForm = {} // this.$toast.success(res.data.msg) }).catch(error => { this.$toast.warn(error) @@ -425,6 +433,17 @@ failToLoad() { console.log('----------------false') this.$toast.warn('登录失败请重试') + uni.navigateTo({ + url: '/pages/index/index' + }) + // uni.navigateBack({ + // success: () => { + // let page = getCurrentPages().pop(); + // if (page) { + // page.onLoad(page.options);//执行上个页面的方法 + // }; + // } + // }) } }