From d76675a66a8bcb3b4003c5573c8ca8a97bac8a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Fri, 3 Feb 2023 01:00:26 +0800 Subject: [PATCH 01/31] =?UTF-8?q?dengjie=20commit=20=EF=BC=9A=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=83=A8=E5=88=86=E5=AD=98=E5=9C=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/productsBtn/productsBtn.vue | 13 +-- package-lock.json | 2 +- packageMy/bindCompany/bindCompany.vue | 11 ++- packageMy/memberCenter/memberCenter.vue | 10 +- .../certifiedCjDetail/certifiedCjDetail.vue | 13 ++- packageReport/newsDetail/newsDetail.vue | 35 +------ .../detail/productsDetail/productsDetail.vue | 94 +++++++++++++------ pages/my/my.vue | 13 +-- pages/report/report.vue | 40 +++++++- 9 files changed, 135 insertions(+), 96 deletions(-) diff --git a/components/productsBtn/productsBtn.vue b/components/productsBtn/productsBtn.vue index 4a37ac8..3b27092 100644 --- a/components/productsBtn/productsBtn.vue +++ b/components/productsBtn/productsBtn.vue @@ -2,10 +2,10 @@ - + - + @@ -41,7 +41,6 @@ 暂无更多浏览记录 - @@ -57,9 +56,7 @@ imgUrl: '', tagsArray: [], productList: [], - // showM: false, - content: '您确定移除吗?', - productList: [] + content: '您确定移除吗?' } }, props: { @@ -83,8 +80,8 @@ item.tags = this.tagsArray[0] item.create_time = dateFormatHistory(item.create_time) } - console.log('获取历史记录', data); this.productList = data + console.log('获取历史记录', this.productList); }).finally(_ => { }) @@ -132,7 +129,7 @@ //点击图片跳转到详情页 toDetailPage(item) { uni.navigateTo({ - url: '/pages/detail/productsDetail/productsDetail?id=' + item.id + url: '/pages/detail/productsDetail/productsDetail?id=' + item.product_id }) } } diff --git a/package-lock.json b/package-lock.json index b23d8bd..acc031c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,7 +4,7 @@ "dependencies": { "uview-ui": { "version": "2.0.35", - "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.35.tgz", + "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.35.tgz", "integrity": "sha512-OfMttN3XkHvQosXfd8bjz8ASTvypPoGzBWmQZBJ871bYMCA7t2bDFPlzjbxUj/5ykAjKnZ8zMUapSwSisVt99g==" } } diff --git a/packageMy/bindCompany/bindCompany.vue b/packageMy/bindCompany/bindCompany.vue index c74d996..5384b85 100644 --- a/packageMy/bindCompany/bindCompany.vue +++ b/packageMy/bindCompany/bindCompany.vue @@ -24,6 +24,10 @@ 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: 1, @@ -39,10 +43,9 @@ }).finally(_ => {}) }, confirm() { - this.showM = false - // uni.switchTab({ - // url: '/pages/my/my' - // }) + uni.reLaunch({ + url: '/pages/my/my' + }) } } } diff --git a/packageMy/memberCenter/memberCenter.vue b/packageMy/memberCenter/memberCenter.vue index 34ee662..e03225b 100644 --- a/packageMy/memberCenter/memberCenter.vue +++ b/packageMy/memberCenter/memberCenter.vue @@ -42,6 +42,10 @@ 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, @@ -57,9 +61,11 @@ }).finally(_ => {}) }, confirm() { - this.showM = false + uni.reLaunch({ + url: '/pages/my/my' + }) if (this.needAsk == 1) { - uni.switchTab({ + uni.reLaunch({ url: '/pages/index/index' }) } diff --git a/packageReport/certifiedCjDetail/certifiedCjDetail.vue b/packageReport/certifiedCjDetail/certifiedCjDetail.vue index 2e26956..b633aff 100644 --- a/packageReport/certifiedCjDetail/certifiedCjDetail.vue +++ b/packageReport/certifiedCjDetail/certifiedCjDetail.vue @@ -53,9 +53,6 @@ this.imgUrl = uni.getStorageSync('img_url') if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { this.isLoad = false - // uni.navigateTo({ - // url: '../../pages/my/login/login' - // }) return } this.isLoad = true @@ -78,16 +75,15 @@ if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { this.$toast.warn('登录失败请重试') this.isLoad = false - // uni.navigateTo({ - // url: '../../pages/my/login/login' - // }) return } this.isLoad = true this.getCertifiedCjDetail() }, failToLoad() { - this.$toast.warn('登录失败请重试') + uni.reLaunch({ + url: '/pages/index/index' + }) } } } @@ -160,6 +156,9 @@ } .footer { + position: absolute; + bottom: 0; + width: 100%; height: 100rpx; background: #0EBB5B; display: flex; diff --git a/packageReport/newsDetail/newsDetail.vue b/packageReport/newsDetail/newsDetail.vue index 290298d..ddc3f51 100644 --- a/packageReport/newsDetail/newsDetail.vue +++ b/packageReport/newsDetail/newsDetail.vue @@ -14,11 +14,6 @@ - - - - - @@ -26,29 +21,16 @@ import { dateFormatXwDetail } from '../../utills/date.js' - import login from 'pages/my/login/login' export default { - components: { - login - }, data() { return { id: '', - detailList: [], - isLoad: true + detailList: [] } }, onLoad(option) { this.id = option.id this.getNewsDetail() - if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { - this.isLoad = false - // uni.navigateTo({ - // url: '../../pages/my/login/login' - // }) - return - } - this.isLoad = true }, methods: { //获取行业新闻详情 @@ -63,21 +45,6 @@ this.$toast.warn('没有更多详情了') } }).finally(_ => {}) - }, - reOnLoad() { - if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { - this.$toast.warn('登录失败请重试') - this.isLoad = false - // uni.navigateTo({ - // url: '../../pages/my/login/login' - // }) - return - } - this.isLoad = true - this.getNewsDetail() - }, - failToLoad() { - this.$toast.warn('登录失败请重试') } } } diff --git a/pages/detail/productsDetail/productsDetail.vue b/pages/detail/productsDetail/productsDetail.vue index 64bb127..252cad2 100644 --- a/pages/detail/productsDetail/productsDetail.vue +++ b/pages/detail/productsDetail/productsDetail.vue @@ -3,19 +3,22 @@ - + - - - + + + + + + + + + - {{detailList.name}} @@ -55,6 +58,10 @@ {{detailList.pub_time}} + + + 联系客服 + @@ -81,7 +88,6 @@ return { id: '', imgUrl: '', - tagsArray: [], showHeart: false, detailList: [], isLoad: true, @@ -116,30 +122,37 @@ if (res.data.data) { let detail = res.data.data detail.pub_time = dateFormatDetail(detail.pub_time) - let tag = detail.tags - this.tagsArray = tag.split(',') - detail.tags = this.tagsArray - this.detailList = res.data.data + detail.tags = detail.tags.split(',') + this.detailList = detail } else { this.$toast.warn('没有更多详情了') } }).finally(_ => {}) }, - //收藏按钮 + //点击star收藏 starTap() { - if (this.detailList.is_fav === 1) { - this.$toast.warn('已收藏') - } else if (this.detailList.is_fav === 0) { - this.$apiServe.collect(this.id).then(res => { - // console.log('收藏成功', res.data) - if (res.data.code == 1) { - this.detailList.is_fav = 1 - this.$toast.warn('收藏成功') - } else { - this.$toast.warn('收藏失败') - } - }).finally(_ => {}) - } + this.$apiServe.collect(this.id).then(res => { + // console.log('收藏成功', res.data) + if (res.data.code == 1) { + this.$toast.warn('收藏成功') + this.getProductDetail() + } else { + this.$toast.warn('收藏失败') + } + }).finally(_ => {}) + }, + //点击star取消收藏 + cancelStarTap(id) { + // console.log('this.detailList.id', id); + // this.$apiServe.deleteHistoryOrCollection(id).then(res => { + // console.log('取消收藏', res.data); + // // if (res.data.code == 1) { + // // this.$toast.warn('取消收藏') + // // this.getProductDetail() + // // } else { + // // this.$toast.warn('收藏失败') + // // } + // }).finally(_ => {}) }, //点赞按钮 heartTap() { @@ -167,7 +180,9 @@ this.getProductDetail() }, failToLoad() { - this.$toast.warn('登录失败请重试') + uni.reLaunch({ + url: '/pages/index/index' + }) }, confirm() { uni.navigateTo({ @@ -300,4 +315,29 @@ padding: 0 10rpx 0 6rpx; } } + + .footer { + position: absolute; + bottom: 0; + width: 100%; + height: 100rpx; + background: #0EBB5B; + display: flex; + flex-direction: column; + justify-content: center; + align-content: center; + text-align: center; + + .u-icon { + justify-content: center; + } + + text { + font-size: 20rpx; + font-family: MicrosoftYaHei-Bold, MicrosoftYaHei; + font-weight: bold; + color: #FFFFFF; + line-height: 26rpx; + } + } diff --git a/pages/my/my.vue b/pages/my/my.vue index 2c0cabc..319b525 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -54,9 +54,6 @@ this.$refs.myavatar.getUser() if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { this.isLoad = false - // uni.navigateTo({ - // url: '../../pages/my/login/login' - // }) return } this.isLoad = true @@ -119,9 +116,6 @@ if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { this.$toast.warn('登录失败请重试') this.isLoad = false - // uni.navigateTo({ - // url: '../../pages/my/login/login' - // }) return } this.isLoad = true @@ -130,10 +124,9 @@ } }, failToLoad() { - // uni.navigateBack({ - // url: '/pages/my/my' - // }) - this.$toast.warn('登录失败请重试') + uni.reLaunch({ + url: '/pages/index/index' + }) } } } diff --git a/pages/report/report.vue b/pages/report/report.vue index f97c93f..1938730 100644 --- a/pages/report/report.vue +++ b/pages/report/report.vue @@ -32,7 +32,7 @@ - + @@ -40,13 +40,24 @@ + + + + + diff --git a/packageReport/newProductRelease/newProductRelease.vue b/packageReport/newProductRelease/newProductRelease.vue index 9e313b1..c50a4a6 100644 --- a/packageReport/newProductRelease/newProductRelease.vue +++ b/packageReport/newProductRelease/newProductRelease.vue @@ -1,6 +1,9 @@ @@ -8,11 +11,22 @@ export default { data() { return { - + reachBottomLength: '' } }, + onReachBottom() { + this.$refs.productsByTime.pageNum++ + this.$refs.productsByTime.getProductsByTime() + }, + onLoad() { + this.$refs.productsByTime.pageSize = 2 + this.$refs.productsByTime.getProductsByTime() + }, methods: { - + //获取按上架时间排列的产品列表length + getTimeLength(e) { + this.reachBottomLength = e + } } } diff --git a/packageReport/newsList/newsList.vue b/packageReport/newsList/newsList.vue index da2f81b..4538176 100644 --- a/packageReport/newsList/newsList.vue +++ b/packageReport/newsList/newsList.vue @@ -1,22 +1,68 @@ diff --git a/service/request.js b/service/request.js index cfdfe8f..3956ffc 100644 --- a/service/request.js +++ b/service/request.js @@ -205,7 +205,7 @@ const toast = { } } const apiService = { - uploadImgUrl: serverHost + `/upload/image/`, + uploadImgUrl: serverHost + `/upload/image/`, imgUrl: serverHost, // login: data => { // data = Object.assign(data || {}, {}) @@ -243,10 +243,10 @@ const apiService = { }) }, // 获取行业新闻 - getNews() { - const url = `/news/nlists/?pageSize=50&pageNum=1` + getNews(data) { + const url = `/news/nlists` return new Promise((resolve, reject) => { - resolve(service.get(url)) + resolve(service.get(url, data)) }) }, // 获取行业新闻详情 @@ -257,10 +257,10 @@ const apiService = { }) }, // 获取认证厂家列表 - getCertifiedCj() { - const url = `/news/flists?pageSize=50&pageNum=1` + getCertifiedCj(data) { + const url = `/news/flists` return new Promise((resolve, reject) => { - resolve(service.get(url)) + resolve(service.get(url, data)) }) }, // 获取认证厂家详情 From 08ebc6574d3eeb2d8c302b350994c5354c08af6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Sat, 4 Feb 2023 19:03:41 +0800 Subject: [PATCH 05/31] =?UTF-8?q?dengjie=20=EF=BC=9A=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E7=82=B9=E8=B5=9E=E3=80=81=E6=94=B6=E8=97=8F=E3=80=81=E5=AE=A2?= =?UTF-8?q?=E6=9C=8D=E7=94=B5=E8=AF=9D=E7=AD=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/myAvatar/myAvatar.vue | 33 +++---- components/myForm/myForm.vue | 5 +- components/productsBtn/productsBtn.vue | 2 +- packageMy/changeAvatar/changeAvatar.vue | 6 +- packageMy/myRelease/myRelease.vue | 22 ++--- .../detail/productsDetail/productsDetail.vue | 97 ++++++++++++------- pages/index/index.vue | 20 ---- pages/my/my.vue | 29 ++++-- service/request.js | 14 +++ static/styles/myAvatar.scss | 2 +- 10 files changed, 128 insertions(+), 102 deletions(-) diff --git a/components/myAvatar/myAvatar.vue b/components/myAvatar/myAvatar.vue index 3e488e0..e454c4d 100644 --- a/components/myAvatar/myAvatar.vue +++ b/components/myAvatar/myAvatar.vue @@ -44,7 +44,7 @@ nickname: '用户', normal: '/static/my/wo_icon_pthy.png', VIP: '/static/my/wo_icon_vip.png', - isLoad: true, + isLoad: true }; }, created() { @@ -67,39 +67,34 @@ getUser() { this.$apiServe.getUser().then(res => { console.log('个人信息==', res.data); - if (res.data.msg == "登录超时,请重新登录") { - if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { - this.$toast.warn('登录失败请重试') - this.isLoad = false - // uni.navigateTo({ - // url: '../../pages/my/login/login' - // }) - return - } - } + // if (res.data.msg === "登录超时,请重新登录") { + // this.$toast.warn('登录超时,请重新登录') + // this.isLoad = false + // // uni.navigateTo({ + // // url: '/pages/my/login/login' + // // }) + // } var data = res.data.data - this.avatar = data.avatar + this.avatar = uni.getStorageSync('img_url') + data.avatar this.nickname = data.nickname this.member = data.member + uni.setStorageSync('com_name', data.com_name) + uni.setStorageSync('com_mobile', data.com_mobile) }).finally(_ => {}) }, reOnLoad() { if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { this.$toast.warn('登录失败请重试') this.isLoad = false - // uni.navigateTo({ - // url: '../../pages/my/login/login' - // }) return } this.isLoad = true this.$refs.myavatar.getUser() }, failToLoad() { - // uni.navigateBack({ - // url: '/pages/my/my' - // }) - this.$toast.warn('登录失败请重试') + uni.navigateBack({ + url: '/pages/index/index' + }) } } } diff --git a/components/myForm/myForm.vue b/components/myForm/myForm.vue index 9525f90..f29679c 100644 --- a/components/myForm/myForm.vue +++ b/components/myForm/myForm.vue @@ -28,7 +28,10 @@ }; }, created() { - + // if (uni.getStorageSync('com_mobile') && uni.getStorageSync('com_name')) { + // this.model.userInfo.name = uni.getStorageSync('com_name') + // this.model.userInfo.phone = uni.getStorageSync('com_mobile') + // } } } diff --git a/components/productsBtn/productsBtn.vue b/components/productsBtn/productsBtn.vue index 3b27092..4b531e3 100644 --- a/components/productsBtn/productsBtn.vue +++ b/components/productsBtn/productsBtn.vue @@ -74,6 +74,7 @@ getHistoryOrCollection() { this.$apiServe.getHistoryOrCollection(this.type).then(res => { let data = res.data.data + console.log('历史记录或收藏', data); for (const item of data) { let tag = item.tags this.tagsArray = tag.split(',') @@ -81,7 +82,6 @@ item.create_time = dateFormatHistory(item.create_time) } this.productList = data - console.log('获取历史记录', this.productList); }).finally(_ => { }) diff --git a/packageMy/changeAvatar/changeAvatar.vue b/packageMy/changeAvatar/changeAvatar.vue index f22e39a..a056931 100644 --- a/packageMy/changeAvatar/changeAvatar.vue +++ b/packageMy/changeAvatar/changeAvatar.vue @@ -40,9 +40,8 @@ //获取头像昵称 getUser() { this.$apiServe.getUser().then(res => { - console.log('头像昵称', res.data); var data = res.data.data - this.avatar = data.avatar + this.avatar = uni.getStorageSync('img_url') + data.avatar this.model.userInfo.name = data.nickname }).finally(_ => {}) }, @@ -58,10 +57,7 @@ 'Authorization': token }, success: (res) => { - console.log('上传头像', JSON.parse(res.data)); - // setTimeout(() => { resolve(JSON.parse(res.data).data.url) - // }, 1000) } }); }) diff --git a/packageMy/myRelease/myRelease.vue b/packageMy/myRelease/myRelease.vue index 55949ca..8fdea04 100644 --- a/packageMy/myRelease/myRelease.vue +++ b/packageMy/myRelease/myRelease.vue @@ -79,7 +79,7 @@ }, onLoad(options) { console.log(options) - if(options && options.index) { + if (options && options.index) { console.log(options) options.index = options.index - 1 this.tabChange(options) @@ -91,7 +91,6 @@ //获取创意发布 getIdeasAndNeeds() { this.$apiServe.getIdeasAndNeeds(this.type).then(res => { - console.log('获取创意发布&需求发布', res.data.data); let data = res.data.data for (const item of data) { item.pub_time = dateFormatXwDetail(item.pub_time) @@ -123,15 +122,16 @@ }, //修改我的需求 editIdeasAndNeeds(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 - }) - } + 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 + }) + } }) }, //二次确认删除我的需求或创意 diff --git a/pages/detail/productsDetail/productsDetail.vue b/pages/detail/productsDetail/productsDetail.vue index 976af68..b2f8c61 100644 --- a/pages/detail/productsDetail/productsDetail.vue +++ b/pages/detail/productsDetail/productsDetail.vue @@ -11,7 +11,7 @@ - + @@ -34,19 +34,33 @@ {{item}} + - + + - {{detailList.thumb}}赞 + + + + {{detailList.thumb}} 赞 - - - - - - 点赞 + + + + + + 点赞 + + + + + + {{detailList.thumb}} 赞 + @@ -75,7 +89,7 @@ + confirmText="升级VIP" @confirm="confirm" @cancel="cancel" confirmColor="#0EBB5B"> @@ -110,9 +124,6 @@ this.imgUrl = uni.getStorageSync('img_url') if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { this.isLoad = false - // uni.navigateTo({ - // url: '../../pages/my/login/login' - // }) return } this.isLoad = true @@ -121,10 +132,7 @@ //获取详情信息 getProductDetail() { this.$apiServe.getProductDetail(this.id).then(res => { - console.log('产品详情页', res.data) - if (res.data.data.thumb) { - this.isThumb = true - } + console.log('产品详情', res.data); if (res.data.msg == "没有权限访问" && uni.getStorageSync('loginToken')) { this.showM = true } @@ -132,16 +140,21 @@ let detail = res.data.data detail.pub_time = dateFormatDetail(detail.pub_time) detail.tags = detail.tags.split(',') + if (detail.is_thumb == 1) { + detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount) + } else { + detail.thumb = parseInt(detail.thumb) - parseInt(detail.thumbcount) + } this.detailList = detail - } else { - this.$toast.warn('没有更多详情了') } + // else { + // this.$toast.warn('没有更多详情了') + // } }).finally(_ => {}) }, //点击star收藏 starTap() { this.$apiServe.collect(this.id).then(res => { - // console.log('收藏成功', res.data) if (res.data.code == 1) { this.$toast.warn('收藏成功') this.getProductDetail() @@ -151,31 +164,38 @@ }).finally(_ => {}) }, //点击star取消收藏 - cancelStarTap(id) { - // console.log('this.detailList.id', id); - // this.$apiServe.deleteHistoryOrCollection(id).then(res => { - // console.log('取消收藏', res.data); - // // if (res.data.code == 1) { - // // this.$toast.warn('取消收藏') - // // this.getProductDetail() - // // } else { - // // this.$toast.warn('收藏失败') - // // } - // }).finally(_ => {}) + cancelStarTap(fav_id) { + this.$apiServe.deleteHistoryOrCollection(fav_id).then(res => { + if (res.data.code == 1) { + this.$toast.warn('取消收藏') + this.getProductDetail() + } else { + this.$toast.warn('取消收藏失败') + } + }).finally(_ => {}) }, //点赞按钮 heartTap() { - // this.showHeart = !this.showHeart this.$apiServe.thumb(this.id).then(res => { - console.log('点赞成功', res.data) if (res.data.code == 1) { - this.showHeart = 1 + this.getProductDetail() this.$toast.warn('点赞成功') } else { this.$toast.warn('点赞失败') } }).finally(_ => {}) }, + //取消点赞 + cancelHeartTap(thumb_id) { + this.$apiServe.cancelThumb(thumb_id).then(res => { + if (res.data.code == 1) { + this.getProductDetail() + this.$toast.warn('取消点赞') + } else { + this.$toast.warn('取消点赞失败') + } + }).finally(_ => {}) + }, reOnLoad() { if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { this.$toast.warn('登录失败请重试') @@ -198,6 +218,11 @@ url: '../../../packageMy/memberCenter/memberCenter?ask=' + 1 }) }, + cancel() { + uni.reLaunch({ + url: '/pages/index/index' + }) + }, // 联系客服模态框 showModal() { this.showCall = true diff --git a/pages/index/index.vue b/pages/index/index.vue index 7672fa0..1dfb68d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -76,32 +76,12 @@ } }, onLoad() { - // this.login() this.getCategories() this.getBanner() this.getImgUrl() this.imgUrl = uni.getStorageSync('img_url') }, methods: { - // login() { - // var that = this - // uni.login({ - // "provider": "weixin", - // "onlyAuthorize": true, // 微信登录仅请求授权认证 - // success: function(event) { - // const { - // code - // } = event - // that.$apiServe.login({ - // code: code - // }).then(res => { - // var data = res.data.data - // // console.log('登录code换取的信息', data); - // uni.setStorageSync('token', data.token); - // }) - // }, - // }) - // }, //获取按上架时间排列的产品列表length getTimeLength(e) { this.reachBottomLength = e diff --git a/pages/my/my.vue b/pages/my/my.vue index 319b525..51e964b 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -7,7 +7,10 @@ - + + + @confirm="confirm" @cancel="cancel"> - {{phone}} + {{mobile}} 是否拨打客服电话 @@ -46,8 +49,9 @@ data() { return { showM: false, - phone: '138 1222 222', + mobile: '', isLoad: true, + is_bind: false } }, onTabItemTap() { @@ -58,7 +62,19 @@ } this.isLoad = true }, + onLoad() { + if (uni.getStorageSync('com_mobile')) { + this.is_bind = true + } + this.getCsTel() + }, methods: { + //获取客服电话 + getCsTel() { + this.$apiServe.getCsTel().then(res => { + this.mobile = res.data.data.cs_tel + }).finally(_ => {}) + }, //跳转到绑定公司页面 bindCompany() { uni.navigateTo({ @@ -95,7 +111,7 @@ }, confirm() { this.showM = false - let phone = '‭1381222222‬' + let phone = '' uni.makePhoneCall({ phoneNumber: phone, success: function() { @@ -109,9 +125,6 @@ cancel() { this.showM = false }, - close() { - this.showM = false - }, reOnLoad() { if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { this.$toast.warn('登录失败请重试') diff --git a/service/request.js b/service/request.js index 3956ffc..f5e760a 100644 --- a/service/request.js +++ b/service/request.js @@ -319,6 +319,13 @@ const apiService = { resolve(service.post(url, pid)) }) }, + //取消(清除)点赞 + cancelThumb(id) { + const url = `/center/thumbcls/?id=${id}` + return new Promise((resolve, reject) => { + resolve(service.post(url, id)) + }) + }, //获取个人信息 getUser() { const url = `/center/userinfo` @@ -333,6 +340,13 @@ const apiService = { resolve(service.post(url, data)) }) }, + // 获取客服电话 + getCsTel() { + const url = `/center/cfg?key=cs_tel` + return new Promise((resolve, reject) => { + resolve(service.get(url)) + }) + }, // 获取首页分类Tag getTags(data) { const url = `/home/tags` diff --git a/static/styles/myAvatar.scss b/static/styles/myAvatar.scss index 96e4b43..0a82fd0 100644 --- a/static/styles/myAvatar.scss +++ b/static/styles/myAvatar.scss @@ -16,7 +16,7 @@ } .my_avatar { - margin-top: -200rpx; + margin-top: -184rpx; display: flex; flex-direction: column; align-items: center; From 4b40658fb509cd1266bcbd26d9088b9fc1929433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Sat, 4 Feb 2023 20:01:53 +0800 Subject: [PATCH 06/31] =?UTF-8?q?dengjie=20=EF=BC=9B=E6=8B=A8=E6=89=93?= =?UTF-8?q?=E7=94=B5=E8=AF=9D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/myAvatar/myAvatar.vue | 21 ++++++++----------- .../certifiedCjDetail/certifiedCjDetail.vue | 19 ++++++++++++++--- .../detail/productsDetail/productsDetail.vue | 19 ++++++++++++++--- pages/my/login/login.vue | 17 +++++++++++++-- pages/my/my.vue | 3 ++- static/styles/myAvatar.scss | 3 +-- 6 files changed, 59 insertions(+), 23 deletions(-) diff --git a/components/myAvatar/myAvatar.vue b/components/myAvatar/myAvatar.vue index e454c4d..2030b29 100644 --- a/components/myAvatar/myAvatar.vue +++ b/components/myAvatar/myAvatar.vue @@ -10,14 +10,14 @@ - {{nickname}} + {{nickname}} - + @@ -44,7 +44,8 @@ nickname: '用户', normal: '/static/my/wo_icon_pthy.png', VIP: '/static/my/wo_icon_vip.png', - isLoad: true + isLoad: true, + timoutText: 1 }; }, created() { @@ -66,14 +67,10 @@ //获取头像昵称和普通会员和VIP会员 getUser() { this.$apiServe.getUser().then(res => { - console.log('个人信息==', res.data); - // if (res.data.msg === "登录超时,请重新登录") { - // this.$toast.warn('登录超时,请重新登录') - // this.isLoad = false - // // uni.navigateTo({ - // // url: '/pages/my/login/login' - // // }) - // } + // console.log('个人信息==', res.data); + if (res.data.msg === "登录超时,请重新登录") { + this.isLoad = false + } var data = res.data.data this.avatar = uni.getStorageSync('img_url') + data.avatar this.nickname = data.nickname @@ -89,7 +86,7 @@ return } this.isLoad = true - this.$refs.myavatar.getUser() + this.getUser() }, failToLoad() { uni.navigateBack({ diff --git a/packageReport/certifiedCjDetail/certifiedCjDetail.vue b/packageReport/certifiedCjDetail/certifiedCjDetail.vue index 2466bb7..9402ad6 100644 --- a/packageReport/certifiedCjDetail/certifiedCjDetail.vue +++ b/packageReport/certifiedCjDetail/certifiedCjDetail.vue @@ -28,7 +28,7 @@ - {{phone}} + {{mobile}} 是否拨打客服电话 @@ -53,12 +53,13 @@ imgUrl: '', isLoad: true, showCall: false, - phone: '138 1222 222', + mobile: '', } }, onLoad(option) { this.id = option.id this.getCertifiedCjDetail() + this.getCsTel() this.imgUrl = uni.getStorageSync('img_url') if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { this.isLoad = false @@ -67,6 +68,12 @@ this.isLoad = true }, methods: { + //获取客服电话 + getCsTel() { + this.$apiServe.getCsTel().then(res => { + this.mobile = res.data.data.cs_tel + }).finally(_ => {}) + }, //获取认证厂家详情 getCertifiedCjDetail() { this.$apiServe.getCertifiedCjDetail(this.id).then(res => { @@ -100,7 +107,8 @@ }, confirmCall() { this.showCall = false - let phone = '‭1381222222‬' + let phone = this.mobile + phone = phone.toString() uni.makePhoneCall({ phoneNumber: phone, success: function() { @@ -119,6 +127,11 @@ diff --git a/packageMy/bindCompany/bindCompany.vue b/packageMy/bindCompany/bindCompany.vue index 5384b85..ca58d82 100644 --- a/packageMy/bindCompany/bindCompany.vue +++ b/packageMy/bindCompany/bindCompany.vue @@ -21,32 +21,32 @@ } }, 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: 1, - companyName: name, - companyPhone: phone - }).then(res => { - console.log('绑定公司', res.data); - if (res.data.code == 20003) { - this.showM = true - } else if (res.data.code == 20005) { - this.$toast.warn('请完善数据') - } - }).finally(_ => {}) - }, - confirm() { - uni.reLaunch({ - url: '/pages/my/my' - }) - } + // 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: 1, + // // companyName: name, + // // companyPhone: phone + // // }).then(res => { + // // console.log('绑定公司', res.data); + // // if (res.data.code == 20003) { + // // this.showM = true + // // } else if (res.data.code == 20005) { + // // this.$toast.warn('请完善数据') + // // } + // // }).finally(_ => {}) + // }, + // confirm() { + // uni.reLaunch({ + // url: '/pages/my/my' + // }) + // } } } diff --git a/packageMy/memberCenter/memberCenter.vue b/packageMy/memberCenter/memberCenter.vue index f146f9a..7028ea0 100644 --- a/packageMy/memberCenter/memberCenter.vue +++ b/packageMy/memberCenter/memberCenter.vue @@ -49,6 +49,11 @@ if (option.ask == 1) { this.needAsk = option.ask } + if (uni.getStorageSync('com_name') && uni.getStorageSync('com_mobile')) { + this.$refs.nameAndphone.model.userInfo.name = uni.getStorageSync('com_name') + this.$refs.nameAndphone.model.userInfo.phone = uni.getStorageSync('com_mobile') + this.$refs.nameAndphone.disabled = true + } }, methods: { handleSureClick() { @@ -69,7 +74,7 @@ if (name && phone) { console.log('数据已完善'); this.$apiServe.bindComponyAndUpdate({ - uid: 1, + uid: uni.getStorageSync('user_id'), type: 2, companyName: name, companyPhone: phone diff --git a/packageMy/myRelease/myRelease.vue b/packageMy/myRelease/myRelease.vue index 2aa3869..9818231 100644 --- a/packageMy/myRelease/myRelease.vue +++ b/packageMy/myRelease/myRelease.vue @@ -12,7 +12,7 @@ {{item.update_time}} - {{item.pub_time}} + {{item.update_time}} @@ -39,7 +39,7 @@ {{item.update_time}} - {{item.pub_time}} + {{item.update_time}} diff --git a/pages/detail/productsDetail/productsDetail.vue b/pages/detail/productsDetail/productsDetail.vue index 2f29982..acd673b 100644 --- a/pages/detail/productsDetail/productsDetail.vue +++ b/pages/detail/productsDetail/productsDetail.vue @@ -155,22 +155,13 @@ this.showUpdating = true } - if (detail) { detail.pub_time = dateFormatDetail(detail.pub_time) if (detail.tags) { detail.tags = detail.tags.split(',') } //点赞数 - if (detail.thumbcount !== 0 && detail.is_thumb == 0) { - detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount) - } else { - if (detail.is_thumb == 1) { - detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount) - } else { - detail.thumb = parseInt(detail.thumb) - parseInt(detail.thumbcount) - } - } + detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount) this.detailList = detail } }).finally(_ => {}) diff --git a/pages/ideasAndNeeds/ideasAndNeeds.vue b/pages/ideasAndNeeds/ideasAndNeeds.vue index f06ab2e..312e6c8 100644 --- a/pages/ideasAndNeeds/ideasAndNeeds.vue +++ b/pages/ideasAndNeeds/ideasAndNeeds.vue @@ -9,10 +9,10 @@ + placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff" /> - + {{needsPublishForm.area_name}} 请选择所在城市 @@ -26,39 +26,46 @@ + placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff" /> - + {{needsPublishForm.class}} 请选择分类 + @cancel="showCategoryPicker = false" @confirm="getCategoryValue"> + - + {{needsPublishForm.product}} 请选择产品类型 + @cancel="showProductPicker = false" @confirm="getProductValue"> + - + {{needsPublishForm.loc}} 请选择产品定位 + @cancel="showPositionPicker = false" @confirm="getPositionValue"> + + :maxlength="120" placeholder-style="color:#CCCCCC" :disabled="btnDisabled" + disabledColor="#ffffff"> @@ -66,7 +73,7 @@ + name="1" multiple :maxCount="10" :disabled="btnDisabled"> @@ -74,7 +81,7 @@ + placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff"> + - 新品发布 + 企业需求 @@ -64,7 +64,7 @@ }, { src: '/static/report/hy_icon_fu.png', - title: '新品发布' + title: '企业需求' }, { src: '/static/report/hy_icon_cj.png', From 8b9d3f98b22ea51b7fc83d6e892ec28020e07f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Sun, 16 Apr 2023 21:29:34 +0800 Subject: [PATCH 31/31] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages.json b/pages.json index 393632f..90a66ad 100644 --- a/pages.json +++ b/pages.json @@ -213,13 +213,13 @@ }, { "pagePath": "pages/report/report", - "text": "行业报告", + "text": "行业&需求", "iconPath": "static/tabBar/sy_icon_hyh.png", "selectedIconPath": "static/tabBar/sy_icon_sy.png" }, { "pagePath": "pages/ideasAndNeeds/ideasAndNeeds", - "text": "创意&需求", + "text": "创需发布", "iconPath": "static/tabBar/sy_icon_cyh.png", "selectedIconPath": "static/tabBar/sy_icon_cy.png" },