Merge branch 'dev' into chenxuelian

This commit is contained in:
”chenxuelian“
2023-01-28 20:40:37 +08:00
8 changed files with 187 additions and 91 deletions

View File

@@ -5,10 +5,10 @@
</u-image>
<view class="collect" @click="starTap">
<view class="star">
<u-image v-if="detailList.type==0" src="/static/detail/xp_icon_wstar.png" width="28rpx"
<u-image v-if="detailList.is_fav==0" src="/static/detail/xp_icon_wstar.png" width="28rpx"
height="28rpx">
</u-image>
<u-image v-if="detailList.type==1" src="/static/detail/xp_icon_star.png" width="28rpx"
<u-image v-if="detailList.is_fav==1" src="/static/detail/xp_icon_star.png" width="28rpx"
height="28rpx">
</u-image>
</view>
@@ -100,6 +100,7 @@
methods: {
//获取详情信息
getProductDetail() {
console.log(this.id);
this.$apiServe.getProductDetail(this.id).then(res => {
console.log('产品详情页', res.data)
if (res.data.data.thumb) {
@@ -119,16 +120,15 @@
},
//收藏按钮
starTap() {
this.detailList.type = !this.detailList.type
// this.$apiServe.collect(this.id).then(res => {
// console.log('收藏成功', res.data)
// if (res.data.code == 1) {
// this.detailList.type = 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.detailList.is_fav = 1
this.$toast.warn('收藏成功')
} else {
this.$toast.warn('收藏失败')
}
}).finally(_ => {})
},
//点赞按钮
heartTap() {

View File

@@ -156,10 +156,13 @@
}
},
onLoad(options) {
console.log(options)
if (options.index == 1) {
//我的发布点击修改回显数据
let publishFormList = JSON.parse(options.item)
this.fileList1 = publishFormList.images
this.needsPublishForm = publishFormList
if (options.index == 0) {
this.tabCurrent = 0
} else if (options.index == 2) {
} else if (options.index == 1) {
this.tabCurrent = 1
}
if (!uni.getStorageSync('token') || uni.getStorageSync('token').length === 0) {

View File

@@ -76,12 +76,42 @@
}
},
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);
// // that.$toast.success('登录成功')
// // that.$emit('success')
// //登录完成后使用手机code换取手机号,调用/user/getMobileByMnp接口
// //接口详细链接 https://docs.apipost.cn/preview/468be606f65cae75/3f2f988ddf82dd8e
// // const codeData = {
// // code: e.detail.code
// // }
// // apiService.postMobileByMnp(codeData).then(res => {
// // console.log(res)
// // })
// })
// },
// })
// },
//获取按上架时间排列的产品列表length
getTimeLength(e) {
this.reachBottomLength = e

View File

@@ -5,8 +5,8 @@
</view>
<view style="padding-left: 30rpx;padding-right: 30rpx;display: flex;">
<u-button type="info" :plain="true" size="nomal" @click="$emit('fail')">取消</u-button>
<u-button open-type="getPhoneNumber" size="nomal" @getphonenumber="getphonenumber"
color='#12CA64'>登录</u-button>
<u-button open-type="getPhoneNumber" size="nomal" @getphonenumber="getphonenumber" color='#12CA64'>登录
</u-button>
</view>
</view>
</template>
@@ -101,13 +101,14 @@
/deep/.u-button {
width: 40% !important;
}
.login-content {
width: 100%;
position:absolute;
top:50%;
position: absolute;
top: 50%;
left: 50%;
padding: 50rpx 30rpx;
padding: 50rpx 30rpx;
background-color: #fff;
transform:translate(-50%,-50%);
transform: translate(-50%, -50%);
}
</style>