From 6a1e71ce8a425b1f959e02e4d9090c550ae58629 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com>
Date: Mon, 27 Feb 2023 09:54:21 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B0=8F=E7=A8=8B=E5=BA=8Fbu?=
=?UTF-8?q?g?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/productsByTime/productsByTime.vue | 1 -
packageMy/memberCenter/memberCenter.vue | 39 ++++----
packageMy/myRelease/myRelease.vue | 31 ++++++-
packageReport/certifiedCj/certifiedCj.vue | 20 +++--
packageReport/newsList/newsList.vue | 19 ++--
pages.json | 6 +-
pages/ideasAndNeeds/ideasAndNeeds.vue | 93 +++++++++++---------
pages/index/index.vue | 3 -
8 files changed, 127 insertions(+), 85 deletions(-)
diff --git a/components/productsByTime/productsByTime.vue b/components/productsByTime/productsByTime.vue
index 60d69f4..4f66a44 100644
--- a/components/productsByTime/productsByTime.vue
+++ b/components/productsByTime/productsByTime.vue
@@ -62,7 +62,6 @@
let tags = res.data.data
if (tags) {
for (const item of tags) {
- console.log('item.cover', item.cover);
let tag = item.tags
this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]
diff --git a/packageMy/memberCenter/memberCenter.vue b/packageMy/memberCenter/memberCenter.vue
index 42078e7..02454ad 100644
--- a/packageMy/memberCenter/memberCenter.vue
+++ b/packageMy/memberCenter/memberCenter.vue
@@ -52,25 +52,28 @@
},
methods: {
handleSureClick() {
- let name = this.$refs.nameAndphone.model.userInfo.name
- let phone = this.$refs.nameAndphone.model.userInfo.phone
- if (!/^1[3456789]\d{9}$/.test(phone)) {
- this.$toast.warn('请输入正确的手机号')
- return false
- }
- this.$apiServe.bindComponyAndUpdate({
- uid: 1,
- type: 2,
- companyName: name,
- companyPhone: phone
- }).then(res => {
- console.log('升级VIP', res.data);
- if (res.data.code == 20003) {
- this.showM = true
- } else if (res.data.code == 20005) {
- this.$toast.warn('请完善数据')
+ if (this.btnDisabled == false) {
+ let name = this.$refs.nameAndphone.model.userInfo.name
+ let phone = this.$refs.nameAndphone.model.userInfo.phone
+ if (!/^1[3456789]\d{9}$/.test(phone)) {
+ this.$toast.warn('请输入正确的手机号')
+ return false
}
- }).finally(_ => {})
+ this.$apiServe.bindComponyAndUpdate({
+ uid: 1,
+ type: 2,
+ companyName: name,
+ companyPhone: phone
+ }).then(res => {
+ console.log('升级VIP', res.data);
+ if (res.data.code == 20003) {
+ this.showM = true
+ } else if (res.data.code == 20005) {
+ this.$toast.warn('请完善数据')
+ }
+ }).finally(_ => {})
+
+ }
},
confirm() {
uni.reLaunch({
diff --git a/packageMy/myRelease/myRelease.vue b/packageMy/myRelease/myRelease.vue
index d3b1636..2aa3869 100644
--- a/packageMy/myRelease/myRelease.vue
+++ b/packageMy/myRelease/myRelease.vue
@@ -15,11 +15,15 @@
{{item.pub_time}}
-
+
+
+ 查看
+
+
修改
-
+
删除
@@ -38,11 +42,15 @@
{{item.pub_time}}
-
+
+
+ 查看
+
+
修改
-
+
删除
@@ -95,6 +103,7 @@
getIdeasAndNeeds() {
this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
let data = res.data.data
+ console.log('创意需求发布数据', res.data);
for (const item of data) {
item.pub_time = dateFormatXwDetail(item.pub_time)
item.update_time = dateFormatXwDetail(item.update_time)
@@ -123,6 +132,20 @@
}
this.getIdeasAndNeeds()
},
+ //查看需求发布或创意发布
+ viewIdeasOrNeeds(item) {
+ const tabCurrent = this.tabCurrent
+ uni.removeStorage({ //删除Storage
+ key: 'update_item',
+ success: () => {
+ uni.setStorageSync('update_item', item);
+ uni.reLaunch({
+ url: '/pages/ideasAndNeeds/ideasAndNeeds?item=update_item' + '&index=' +
+ tabCurrent + '&view=' + 11
+ })
+ }
+ })
+ },
//修改我的需求
editIdeasAndNeeds(item) {
const tabCurrent = this.tabCurrent
diff --git a/packageReport/certifiedCj/certifiedCj.vue b/packageReport/certifiedCj/certifiedCj.vue
index 0753f72..8acf369 100644
--- a/packageReport/certifiedCj/certifiedCj.vue
+++ b/packageReport/certifiedCj/certifiedCj.vue
@@ -15,7 +15,7 @@
- 已经到底啦!
+ 已经到底啦!
@@ -23,11 +23,11 @@
export default {
data() {
return {
- cjsShow: true,
+ cjsShow: '',
cjsList: [],
imgUrl: '',
pageNum: 1, // 当前页
- pageSize: 4, // 每页条数
+ pageSize: 12, // 每页条数
}
},
onLoad() {
@@ -35,8 +35,11 @@
this.getCertifiedCj()
},
onReachBottom() {
- this.pageNum++
- this.getCertifiedCj()
+ console.log('触底下拉');
+ if (this.cjsShow !== 0) {
+ this.pageNum++
+ this.getCertifiedCj()
+ }
},
methods: {
// 获取认证厂家列表
@@ -45,7 +48,12 @@
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
- // console.log('认证厂家', res)
+ console.log('认证厂家', res)
+ let cjsData = res.data.data
+ for (const item of cjsData) {
+ this.cjsShow = item.length
+ console.log('this.cjsShow', this.cjsShow);
+ }
this.cjsList = [...this.cjsList, ...res.data.data]
}).finally(_ => {})
},
diff --git a/packageReport/newsList/newsList.vue b/packageReport/newsList/newsList.vue
index 3f058c2..22c0722 100644
--- a/packageReport/newsList/newsList.vue
+++ b/packageReport/newsList/newsList.vue
@@ -17,7 +17,7 @@
- 已经到底啦!
+ 已经到底啦!
@@ -28,20 +28,23 @@
export default {
data() {
return {
- newsShow: true,
+ newsShow: '',
imgUrl: '',
newsList: [],
pageNum: 1, // 当前页
- pageSize: 4, // 每页条数
+ pageSize: 12, // 每页条数
}
},
onLoad() {
- this.imgUrl = uni.getStorageSync('img_url')
+ this.imgUrl = uni.getStorageSync('img_url')
this.getNews()
},
onReachBottom() {
- this.pageNum++
- this.getNews()
+ console.log('触底下拉');
+ if (this.newsShow !== 0) {
+ this.pageNum++
+ this.getNews()
+ }
},
methods: {
getNews() {
@@ -49,10 +52,12 @@
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
- // console.log('行业新闻', res.data.data)
+ console.log('行业新闻', res.data)
let newsData = res.data.data
for (const item of newsData) {
item.pub_time_str = dateFormat(item.pub_time_str)
+ this.newsShow = item.length
+ console.log('this.newsShow', this.newsShow);
}
this.newsList = [...this.newsList, ...newsData]
}).finally(_ => {})
diff --git a/pages.json b/pages.json
index 44b9936..11124bf 100644
--- a/pages.json
+++ b/pages.json
@@ -160,7 +160,7 @@
"navigationBarTitleText": "行内新闻",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
- "enablePullDownRefresh": false
+ "enablePullDownRefresh": true
}
}, {
"path": "certifiedCj/certifiedCj",
@@ -168,7 +168,7 @@
"navigationBarTitleText": "认证厂家",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
- "enablePullDownRefresh": false
+ "enablePullDownRefresh": true
}
}, {
"path": "newsDetail/newsDetail",
@@ -193,7 +193,7 @@
"navigationBarTitleText": "新品发布",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64",
- "enablePullDownRefresh": false
+ "enablePullDownRefresh": true
}
}
diff --git a/pages/ideasAndNeeds/ideasAndNeeds.vue b/pages/ideasAndNeeds/ideasAndNeeds.vue
index 911144f..f06ab2e 100644
--- a/pages/ideasAndNeeds/ideasAndNeeds.vue
+++ b/pages/ideasAndNeeds/ideasAndNeeds.vue
@@ -87,7 +87,7 @@
-->
-
+
0) {
- this.fileList1.map(item => {
- const url = item.url
- temp.push(url.replace(this.imgUrl + '/', ''))
- })
- }
- this.needsPublishForm.images = temp.join(';')
- const data = {
- type: null,
- name: null,
- pname: null,
- area_code: null,
- area_name: null,
- images: null,
- mobile: null,
- class: null,
- product: null,
- loc: null,
- desc: null,
- pub_time: null,
- ...this.needsPublishForm
- }
- apiService.submitIdeasAndNeeds(data).then(res => {
- this.$toast.success('提交成功')
- if (res.data.code == 1) {
- uni.navigateTo({
- url: '../../packageMy/myRelease/myRelease?index=' + (this.tabCurrent + 1)
+ if (this.btnDisabled == false) {
+
+ if (!/^1[3456789]\d{9}$/.test(this.needsPublishForm.mobile)) {
+ this.$toast.warn('请输入正确的手机号')
+ return false
+ }
+ this.needsPublishForm.type = Number(this.tabCurrent + 1)
+ this.needsPublishForm.pub_time = this.needsPublishForm.pub_time ? this.needsPublishForm.pub_time :
+ Math.round(new Date().getTime() / 1000)
+ const temp = []
+ if (this.fileList1.length > 0) {
+ this.fileList1.map(item => {
+ const url = item.url
+ temp.push(url.replace(this.imgUrl + '/', ''))
})
}
- this.tabCurrent = 0
- this.fileList1 = []
- this.needsPublishForm = {}
- // this.$toast.success(res.data.msg)
- }).catch(error => {
- this.$toast.warn(error)
- })
+ this.needsPublishForm.images = temp.join(';')
+ const data = {
+ type: null,
+ name: null,
+ pname: null,
+ area_code: null,
+ area_name: null,
+ images: null,
+ mobile: null,
+ class: null,
+ product: null,
+ loc: null,
+ desc: null,
+ pub_time: null,
+ ...this.needsPublishForm
+ }
+ apiService.submitIdeasAndNeeds(data).then(res => {
+ this.$toast.success('提交成功')
+ if (res.data.code == 1) {
+ 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)
+ })
+ }
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 0cd0756..4978589 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -141,7 +141,6 @@
getBanner() {
this.$apiServe.getBanner().then(res => {
let banner = res.data.data
- console.log('轮播图', res.data);
if (banner) {
for (const item of banner) {
item.img = this.imgUrl + item.img
@@ -172,9 +171,7 @@
//获取图片url
getImgUrl() {
this.$apiServe.getImgUrl().then(res => {
- console.log('图片url', res.data);
res.data.data.img_url = res.data.data.img_url + '/'
- console.log('res.data.data.img_url', res.data.data.img_url);
try {
uni.setStorageSync('img_url', res.data.data.img_url);
this.initStart = true