解决体验版弹出登录框

This commit is contained in:
dengjie
2023-01-28 22:33:37 +08:00
parent 5678815237
commit 1f6d21a1a0
14 changed files with 213 additions and 83 deletions

View File

@@ -87,8 +87,7 @@
this.id = option.id
this.getProductDetail()
this.imgUrl = uni.getStorageSync('img_url')
if (!uni.getStorageSync('token') || uni.getStorageSync('token').length === 0) {
console.log(uni.getStorageSync('token'))
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
@@ -100,9 +99,8 @@
methods: {
//获取详情信息
getProductDetail() {
console.log(this.id);
this.$apiServe.getProductDetail(this.id).then(res => {
console.log('产品详情页', res.data)
// console.log('产品详情页', res.data)
if (res.data.data.thumb) {
this.isThumb = true
}
@@ -121,7 +119,7 @@
//收藏按钮
starTap() {
this.$apiServe.collect(this.id).then(res => {
console.log('收藏成功', res.data)
// console.log('收藏成功', res.data)
if (res.data.code == 1) {
this.detailList.is_fav = 1
this.$toast.warn('收藏成功')
@@ -135,8 +133,7 @@
this.showHeart = !this.showHeart
},
reOnLoad() {
console.log('----------------true')
if (!uni.getStorageSync('token') || uni.getStorageSync('token').length === 0) {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
@@ -145,9 +142,9 @@
return
}
this.isLoad = true
this.getProductDetail()
},
failToLoad() {
console.log('----------------false')
this.$toast.warn('登录失败请重试')
}
}
@@ -170,10 +167,8 @@
right: 77rpx;
z-index: 99;
}
}
.content {
padding: 20rpx;
background-color: #fff;

View File

@@ -155,8 +155,8 @@
},
onTabItemTap() {
console.log('----onTabItemTap')
if (!uni.getStorageSync('token') || uni.getStorageSync('token').length === 0) {
console.log(uni.getStorageSync('token'))
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
console.log(uni.getStorageSync('loginToken'))
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
@@ -164,7 +164,7 @@
return
}
this.isLoad = true
this.token = uni.getStorageSync('token')
this.token = uni.getStorageSync('loginToken')
this.getFormData()
this.fileList1 = []
this.needsPublishForm = {}
@@ -238,7 +238,7 @@
getProductValue(data) {
this.showProductPicker = false
this.showCategoryPicker = false
this.needsPublishForm.product= data.value[0]
this.needsPublishForm.product = data.value[0]
// console.log(data)
// const obj = this.productPickerList.find(item => {
// return item.name === data.value[0]
@@ -368,9 +368,10 @@
return false
}
this.needsPublishForm.type = Number(this.tabCurrent + 1)
this.needsPublishForm.pub_time = this.needsPublishForm.pub_time ? this.needsPublishForm.pub_time : new Date().getTime()
this.needsPublishForm.pub_time = this.needsPublishForm.pub_time ? this.needsPublishForm.pub_time :
new Date().getTime()
const temp = []
if(this.fileList1.length > 0) {
if (this.fileList1.length > 0) {
this.fileList1.map(item => {
temp.push(item.url)
})
@@ -392,12 +393,14 @@
...this.needsPublishForm
}
apiService.submitIdeasAndNeeds(data).then(res => {
this.$toast.success(res.data.msg)
this.$toast.warn('发布成功')
console.log('esf=', res);
// this.$toast.success(res.data.msg)
})
},
reOnLoad() {
console.log('----------------true')
if (!uni.getStorageSync('token') || uni.getStorageSync('token').length === 0) {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
@@ -405,7 +408,7 @@
// })
return
}
this.token = uni.getStorageSync('token')
this.token = uni.getStorageSync('loginToken')
this.isLoad = true
this.getFormData()
},

View File

@@ -96,18 +96,8 @@
// 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)
// // })
// // console.log('登录code换取的信息', data);
// uni.setStorageSync('token', data.token);
// })
// },
// })

View File

@@ -38,7 +38,7 @@
}).then(res => {
var data = res.data.data
// console.log('登录code换取的信息', data);
uni.setStorageSync('token', data.token);
uni.setStorageSync('loginToken', data.token);
that.$toast.success('登录成功')
that.$emit('success')
//登录完成后使用手机code换取手机号,调用/user/getMobileByMnp接口