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 @@ + + + + +