dengjie commit : 我的页面部分接口

This commit is contained in:
clay
2023-01-05 21:57:51 +08:00
parent 2417d8fe28
commit 458f5a2562
17 changed files with 341 additions and 371 deletions

View File

@@ -3,16 +3,15 @@
<view :key="index">
<u-image :src="imgUrl+detailList.cover" width="750rpx" height="530rpx">
</u-image>
<view class="collect">
<view class="collect" @click="starTap">
<view class="star">
<u-image v-if="showStar==false" src="/static/detail/xp_icon_wstar.png" width="28rpx" height="28rpx"
@click="starTap">
<u-image v-if="detailList.type==0" src="/static/detail/xp_icon_wstar.png" width="28rpx"
height="28rpx">
</u-image>
<u-image v-if="showStar==true" src="/static/detail/xp_icon_star.png" width="28rpx" height="28rpx"
@click="starTap">
<u-image v-if="detailList.type==1" 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>
@@ -32,20 +31,20 @@
<view>
<text class="tagOne" v-for="item in detailList.tags" :key="item.id">{{item}}</text>
</view>
<view v-if="isThumb==false" class="heart">
<u-image v-if="showHeart==false" src="/static/detail/xp_icon_heart.png" width="34rpx"
height="32rpx" @click="heartTap">
</u-image>
<u-image v-if="showHeart==true" src="/static/detail/xp_icon_ysc.png" width="34rpx"
height="32rpx" @click="heartTap">
</u-image>
<text class="thumb">点赞</text>
</view>
<view v-if="isThumb==true" class="heart">
<u-image src="/static/detail/xp_icon_ysc.png" width="34rpx" height="32rpx" @click="heartTap">
<view v-if="detailList.thumb" class="heart">
<u-image src="/static/detail/xp_icon_ysc.png" width="34rpx" height="32rpx">
</u-image>
<text class="thumb">{{detailList.thumb}}</text>
</view>
<view v-else class="heart" @click="heartTap">
<u-image v-if="showHeart==false" src="/static/detail/xp_icon_heart.png" width="34rpx"
height="32rpx">
</u-image>
<u-image v-if="showHeart==true" src="/static/detail/xp_icon_ysc.png" width="34rpx"
height="32rpx">
</u-image>
<text class="thumb">点赞</text>
</view>
</view>
</view>
@@ -71,9 +70,7 @@
id: '',
imgUrl: '',
tagsArray: [],
showStar: false,
showHeart: false,
isThumb: false,
detailList: []
}
},
@@ -86,7 +83,7 @@
//获取详情信息
getProductDetail() {
this.$apiServe.getProductDetail(this.id).then(res => {
// console.log('详情页', res.data.data)
console.log('详情页', res.data.data)
if (res.data.data.thumb) {
this.isThumb = true
}
@@ -100,7 +97,12 @@
},
//收藏按钮
starTap() {
this.showStar = !this.showStar
this.detailList.type = !this.detailList.type
// this.$apiServe.collect(this.id).then(res => {
// console.log('收藏成功', res.data)
// this.detailList.type = 1
// }).finally(_ => {})
},
//点赞按钮
heartTap() {

View File

@@ -78,7 +78,6 @@
this.getToken()
this.imgUrl = uni.getStorageSync('img_url')
},
methods: {
getToken() {
var that = this
@@ -89,15 +88,14 @@
const {
code
} = event
console.log("登录code", code);
let fromData = {
code: code
}
that.$apiServe.login({
code: code
}).then(res => {
console.log('登录code换取的用户', res.data.data);
uni.setStorageSync('token', res.data.data.token);
var data = res.data.data
// console.log('登录code换取的信息', data);
uni.setStorageSync('token', data.token);
uni.setStorageSync('avatar', data.avatar);
uni.setStorageSync('nickname', data.nickname);
})
},
fail: function(err) {

View File

@@ -24,27 +24,29 @@
</u-cell-group>
<u-modal :show="showM" showCancelButton closeOnClickOverlay confirmText="是" cancelText="否"
@confirm="confirm" @cancel="cancel" @close="close">
<rich-text :nodes="content"></rich-text>
<view>
<text>{{phone}}</text>
<text>是否拨打客服电话</text>
</view>
</u-modal>
</view>
</view>
</template>
<script>
import loginVue from './login/login.vue'
export default {
data() {
return {
showM: false,
content: `138 1222 222<br>
是否拨打客服电话`,
phone: '138 1222 222',
}
},
methods: {
//跳转到绑定公司页面
bindCompany() {
uni.navigateTo({
url: '../../packageMy/bindCompony/bindCompony'
url: '../../packageMy/bindCompany/bindCompany'
})
},
//跳转到会员中心页面
@@ -56,14 +58,13 @@
//跳转到浏览记录页面
toBrowseHistory() {
uni.navigateTo({
url: '../../packageMy/browseHistory/browseHistory?id=' + 1
url: '../../packageMy/browseHistory/browseHistory'
})
},
//跳转到我的收藏页面
toMyCollect() {
uni.navigateTo({
url: '../../packageMy/browseHistory/browseHistory?id=' + 2
url: '../../packageMy/myCollection/myCollection'
})
},
//跳转到我的发布页面
@@ -72,7 +73,6 @@
url: '../../packageMy/myRelease/myRelease'
})
},
// 联系客服模态框
showModal() {
this.showM = true
@@ -139,36 +139,10 @@
color: #CCCCCC !important;
}
.u-modal {
width: 472rpx !important;
}
.u-modal__button-group__wrapper--cancel {
background: #D8D8D8;
.u-modal__button-group__wrapper__text {
color: #fff !important;
}
}
.u-modal__content {
padding: 43rpx 104rpx !important;
text-indent: 25rpx;
}
.u-modal__content__text {
font-size: 32rpx !important;
font-weight: 400;
color: #252421 !important;
}
.u-modal__button-group__wrapper--confirm {
background: #0EBB5B;
.u-modal__button-group__wrapper__text {
color: #fff !important;
}
}
</style>