Browse Source

feature-tiktok-1.0:解决绘画兑换次数BUG;进入绘画页面不提示登录的BUG

feature-1.0
‘‘ 3 years ago
parent
commit
03157b6c43
  1. 34
      pages/ai/paint/paint.vue
  2. 2
      pages/atlas/hotSearch.vue
  3. 43
      pages/userInfo/userInfo.vue
  4. 3
      utils/request.js

34
pages/ai/paint/paint.vue

@ -165,23 +165,23 @@
let token = uni.getStorageSync('token');
if((Object.keys(that.userInfo).length==0) && (Object.keys(token).length==0)){
console.error('尚未登录!');
// uni.showModal({
// title:'',
// content:'!',
// success(res) {
// if (res.confirm) {
// //
// uni.switchTab({
// url: '/pages/userInfo/userInfo'
// });
// }else if(res.cancel){
// uni.showToast({
// title:'!',
// duration: 2000
// });
// }
// }
// });
uni.showModal({
title:'提示',
content:'您还没有登录!点击确定跳转登录界面以体验服务',
success(res) {
if (res.confirm) {
//
uni.switchTab({
url: '/pages/userInfo/userInfo'
});
}else if(res.cancel){
uni.showToast({
title:'登录获取更好的服务体验哟!',
duration: 2000
});
}
}
});
}
},
//

2
pages/atlas/hotSearch.vue

@ -164,7 +164,7 @@
}else{
uni.showModal({
title: '提示',
content: '这是一个模态弹窗!',
content: '抱歉没有找到想要的图片。不如试试意境绘画!',
success(res){
if(res.confirm){
uni.switchTab({

43
pages/userInfo/userInfo.vue

@ -223,27 +223,30 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
placeholderText:'请输入兑换cdk',
success(response) {
console.log('response',response);
//使cdk
const data = {
cdk: response.content,
userId: that.userInfo.id,
source: '1',
appType: '0'
}
useCdk(data).then(res =>{
console.log('res',res);
if(res.data.code != 200){
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}else{
uni.showToast({
title: '兑换成功!',
icon: 'none'
})
if(response.confirm){
//
//使cdk
const data = {
cdk: response.content,
userId: that.userInfo.id,
source: '1',
appType: '0'
}
})
useCdk(data).then(res =>{
console.log('res',res);
if(res.data.code != 200){
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}else{
uni.showToast({
title: '兑换成功!',
icon: 'none'
})
}
});
}
},
fail(res) {
uni.showToast({

3
utils/request.js

@ -146,6 +146,9 @@ service.interceptors.response.use(res => {
content:'您还没有登录!点击确定跳转登录界面以体验服务',
success(res) {
if (res.confirm) {
//清理缓存,解决一进入页面未登录但有头像的情况
uni.clearStorage();
uni.clearStorageSync();
//跳转登录界面
uni.switchTab({
url: '/pages/userInfo/userInfo'

Loading…
Cancel
Save