Merge pull request '修改小程序bug' (#98) from dengjie into dev

Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/98
This commit is contained in:
odjbin
2023-02-26 16:46:42 +00:00
8 changed files with 45 additions and 18 deletions

View File

@@ -71,13 +71,15 @@
this.isLoad = false this.isLoad = false
} }
var data = res.data.data var data = res.data.data
this.avatar = uni.getStorageSync('img_url') + data.avatar if (data) {
this.nickname = data.nickname this.avatar = uni.getStorageSync('img_url') + data.avatar
this.member = data.member this.nickname = data.nickname
uni.setStorageSync('member', data.member) this.member = data.member
uni.setStorageSync('agreement', data.agreement) uni.setStorageSync('member', data.member)
uni.setStorageSync('com_name', data.com_name) uni.setStorageSync('agreement', data.agreement)
uni.setStorageSync('com_mobile', data.com_mobile) uni.setStorageSync('com_name', data.com_name)
uni.setStorageSync('com_mobile', data.com_mobile)
}
}).finally(_ => {}) }).finally(_ => {})
}, },
reOnLoad() { reOnLoad() {

View File

@@ -64,6 +64,7 @@
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageNum pageNum: this.pageNum
}).then(res => { }).then(res => {
console.log('产品列表2', res.data);
let tags = res.data.data let tags = res.data.data
for (const item of tags) { for (const item of tags) {
let tag = item.tags let tag = item.tags

View File

@@ -58,9 +58,11 @@
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageNum pageNum: this.pageNum
}).then(res => { }).then(res => {
console.log('产品列表1', res.data);
let tags = res.data.data let tags = res.data.data
if (tags) { if (tags) {
for (const item of tags) { for (const item of tags) {
console.log('item.cover', item.cover);
let tag = item.tags let tag = item.tags
this.tagsArray = tag.split(',') this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0] item.tags = this.tagsArray[0]

View File

@@ -40,9 +40,12 @@
getUser() { getUser() {
this.$apiServe.getUser().then(res => { this.$apiServe.getUser().then(res => {
var data = res.data.data var data = res.data.data
this.avatar = uni.getStorageSync('img_url') + data.avatar console.log('头像昵称', res);
this.avatarUrl = '/' + data.avatar if (data) {
this.model.userInfo.name = data.nickname this.avatar = uni.getStorageSync('img_url') + data.avatar
this.avatarUrl = '/' + data.avatar
this.model.userInfo.name = data.nickname
}
}).finally(_ => {}) }).finally(_ => {})
}, },
updatePromise(filePath) { updatePromise(filePath) {

View File

@@ -14,6 +14,9 @@
<view class="xwD_content"> <view class="xwD_content">
<u-parse :content="detailList.content" @preview="preview" @navigate="navigate"></u-parse> <u-parse :content="detailList.content" @preview="preview" @navigate="navigate"></u-parse>
</view> </view>
<!-- <u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="content"></rich-text>
</u-modal> -->
</view> </view>
</template> </template>
@@ -25,7 +28,9 @@
data() { data() {
return { return {
id: '', id: '',
detailList: [] detailList: [],
// showM: false,
// content: `该新闻已下架!`,
} }
}, },
onLoad(option) { onLoad(option) {
@@ -36,15 +41,24 @@
//获取行业新闻详情 //获取行业新闻详情
getNewsDetail() { getNewsDetail() {
this.$apiServe.getNewsDetail(this.id).then(res => { this.$apiServe.getNewsDetail(this.id).then(res => {
console.log('新闻详情', res.data);
if (res.data.code == 0 || res.data.msg == "该新闻已下架!") {
this.$toast.warn('该新闻已下架!')
// this.showM = true
}
if (res.data.data) { if (res.data.data) {
let detail = res.data.data let detail = res.data.data
detail.pub_time = dateFormatXwDetail(detail.pub_time) detail.pub_time = dateFormatXwDetail(detail.pub_time)
this.detailList = res.data.data this.detailList = res.data.data
} else {
this.$toast.warn('没有更多详情了')
} }
}).finally(_ => {}) }).finally(_ => {})
} },
// confirm() {
// uni.reLaunch({
// url: '/pages/index/index'
// })
// }
} }
} }
</script> </script>

View File

@@ -59,7 +59,7 @@
<u-image src="/static/detail/xp_icon_ysc.png" width="34rpx" height="32rpx" <u-image src="/static/detail/xp_icon_ysc.png" width="34rpx" height="32rpx"
@click="cancelHeartTap(detailList.thumb_id)"> @click="cancelHeartTap(detailList.thumb_id)">
</u-image> </u-image>
<text class="thumb">{{detailList.thumb==NaN?1:detailList.thumb}} </text> <text class="thumb">{{detailList.thumb}} </text>
</view> </view>
</view> </view>
</view> </view>
@@ -139,7 +139,7 @@
//获取详情信息 //获取详情信息
getProductDetail() { getProductDetail() {
this.$apiServe.getProductDetail(this.id).then(res => { this.$apiServe.getProductDetail(this.id).then(res => {
console.log('产品详情mtype', res.data.data); console.log('产品详情', res.data.data);
let detail = res.data.data let detail = res.data.data
let dataCode = res.data.code let dataCode = res.data.code
//授权登录拦截 //授权登录拦截

View File

@@ -141,7 +141,7 @@
getBanner() { getBanner() {
this.$apiServe.getBanner().then(res => { this.$apiServe.getBanner().then(res => {
let banner = res.data.data let banner = res.data.data
console.log('轮播图', banner); console.log('轮播图', res.data);
if (banner) { if (banner) {
for (const item of banner) { for (const item of banner) {
item.img = this.imgUrl + item.img item.img = this.imgUrl + item.img
@@ -172,6 +172,9 @@
//获取图片url //获取图片url
getImgUrl() { getImgUrl() {
this.$apiServe.getImgUrl().then(res => { 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 { try {
uni.setStorageSync('img_url', res.data.data.img_url); uni.setStorageSync('img_url', res.data.data.img_url);
this.initStart = true this.initStart = true

View File

@@ -72,7 +72,9 @@
//获取客服电话 //获取客服电话
getCsTel() { getCsTel() {
this.$apiServe.getCsTel().then(res => { this.$apiServe.getCsTel().then(res => {
this.mobile = res.data.data.cs_tel if (res.data.data) {
this.mobile = res.data.data.cs_tel
}
}).finally(_ => {}) }).finally(_ => {})
}, },
//跳转到绑定公司页面 //跳转到绑定公司页面