dengjie commit : 修改部分存在问题
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
<view>
|
||||
<view class="products_box">
|
||||
<u-grid :border="false" col="2">
|
||||
<u-grid-item v-for="(item,index) in productList" :key="index" @click="toDetailPage(item)">
|
||||
<u-grid-item v-for="(item,index) in productList" :key="index">
|
||||
<u-image src="/static/products/sy_bb.png" width="354rpx" height="539rpx" :lazy-load="true">
|
||||
</u-image>
|
||||
<view class="bgContent">
|
||||
<view class="bgContent" @click="toDetailPage(item)">
|
||||
<view>
|
||||
<u-image :src="imgUrl+item.cover" width="346rpx" height="320rpx" :lazy-load="true"
|
||||
@click="toDetailPage()">
|
||||
@@ -41,7 +41,6 @@
|
||||
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
|
||||
v-if="type==2&&productList.length==0">
|
||||
暂无更多浏览记录</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -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=="
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -14,11 +14,6 @@
|
||||
<view class="xwD_content">
|
||||
<u-parse :content="detailList.content" @preview="preview" @navigate="navigate"></u-parse>
|
||||
</view>
|
||||
<view style="margin:0 20rpx;">
|
||||
<u-overlay :show="!isLoad">
|
||||
<login @success="reOnLoad()" @fail="failToLoad()"></login>
|
||||
</u-overlay>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -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('登录失败请重试')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,19 +3,22 @@
|
||||
<view :key="index">
|
||||
<u-image :src="imgUrl+detailList.cover" width="750rpx" height="530rpx">
|
||||
</u-image>
|
||||
<view class="collect" @click="starTap">
|
||||
<view class="collect" v-if="detailList.is_fav==0||!detailList.is_fav" @click="starTap">
|
||||
<view class="star">
|
||||
<u-image v-if="detailList.is_fav==0||!detailList.is_fav" src="/static/detail/xp_icon_wstar.png"
|
||||
width="28rpx" height="28rpx">
|
||||
</u-image>
|
||||
<u-image v-if="detailList.is_fav==1" src="/static/detail/xp_icon_star.png" width="28rpx"
|
||||
height="28rpx">
|
||||
<u-image src="/static/detail/xp_icon_wstar.png" width="28rpx" height="28rpx">
|
||||
</u-image>
|
||||
</view>
|
||||
<u-image src="/static/detail/xiangqing_icon_shoucang.png" width="119rpx" height="48rpx">
|
||||
</u-image>
|
||||
</view>
|
||||
<view class="collect" v-if="detailList.is_fav==1" @click="cancelStarTap(detailList.id)">
|
||||
<view class="star">
|
||||
<u-image src="/static/detail/xp_icon_star.png" width="28rpx" height="28rpx">
|
||||
</u-image>
|
||||
</view>
|
||||
<u-image src="/static/detail/xiangqing_icon_shoucang.png" width="119rpx" height="48rpx">
|
||||
</u-image>
|
||||
</view>
|
||||
|
||||
<view class="content">
|
||||
<view class="title_box">
|
||||
<text class="title">{{detailList.name}}</text>
|
||||
@@ -55,6 +58,10 @@
|
||||
<text>{{detailList.pub_time}}</text>
|
||||
</view>
|
||||
<u-parse :content="detailList.desc" @preview="preview" @navigate="navigate"></u-parse>
|
||||
<view class="footer">
|
||||
<u-icon name="kefu-ermai" color="#fff" size="30rpx"></u-icon>
|
||||
<text>联系客服</text>
|
||||
</view>
|
||||
<view style="margin:0 20rpx;">
|
||||
<u-overlay :show="!isLoad">
|
||||
<login @success="reOnLoad()" @fail="failToLoad()"></login>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 认证厂家 -->
|
||||
<view>
|
||||
<view v-if="token">
|
||||
<view class="subtitle">
|
||||
<u--image src="/static/report/hy_icon_cjx.png" width="24rpx" height="24rpx" :lazy-load="true">
|
||||
</u--image>
|
||||
@@ -40,13 +40,24 @@
|
||||
</view>
|
||||
<certifiedCj></certifiedCj>
|
||||
</view>
|
||||
<view style="margin:0 20rpx;">
|
||||
<u-overlay :show="!isLoad">
|
||||
<login @success="reOnLoad()" @fail="failToLoad()"></login>
|
||||
</u-overlay>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import login from 'pages/my/login/login'
|
||||
export default {
|
||||
components: {
|
||||
login
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isLoad: true,
|
||||
token: '',
|
||||
classifyList: [{
|
||||
src: '/static/report/hy_icon_xw.png',
|
||||
title: '行业新闻'
|
||||
@@ -60,9 +71,11 @@
|
||||
title: '认证厂家'
|
||||
},
|
||||
],
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.token = uni.getStorageSync('loginToken')
|
||||
},
|
||||
methods: {
|
||||
//点击一级分类
|
||||
click(listIndex) {
|
||||
@@ -76,12 +89,33 @@
|
||||
url: '../../packageReport/newProductRelease/newProductRelease'
|
||||
})
|
||||
} else if (listIndex == 2) {
|
||||
if (uni.getStorageSync('loginToken')) {
|
||||
uni.navigateTo({
|
||||
url: '../../packageReport/certifiedCj/certifiedCj'
|
||||
})
|
||||
} else {
|
||||
this.isLoad = false
|
||||
}
|
||||
}
|
||||
},
|
||||
reOnLoad() {
|
||||
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
||||
this.$toast.warn('登录失败请重试')
|
||||
this.isLoad = false
|
||||
return
|
||||
}
|
||||
this.isLoad = true
|
||||
if (this.isLoad) {
|
||||
uni.navigateTo({
|
||||
url: '../../packageReport/certifiedCj/certifiedCj'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
failToLoad() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/report/report'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user