@@ -38,12 +38,14 @@ App({ | |||||
}).then(res => { | }).then(res => { | ||||
console.log(res, 'loginSuccess'); | console.log(res, 'loginSuccess'); | ||||
// 存储数据 | // 存储数据 | ||||
request.setHead(res.data.token, res.data.tenantId) | |||||
wx.setStorageSync('sessionKey', res.data.sessionKey) | |||||
wx.setStorageSync('openId', res.data.openId) | wx.setStorageSync('openId', res.data.openId) | ||||
wx.setStorageSync('token', res.data.token) | |||||
checkUserInfo() | |||||
if (res.data.sessionKey) { | |||||
wx.setStorageSync('sessionKey', res.data.sessionKey) | |||||
} | |||||
if (res.data.token) { | |||||
wx.setStorageSync('token', res.data.token) | |||||
request.setHead(res.data.token) | |||||
} | |||||
}).catch(err => { | }).catch(err => { | ||||
console.log(err); | console.log(err); | ||||
wx.showToast({ | wx.showToast({ | ||||
@@ -52,37 +54,5 @@ App({ | |||||
}) | }) | ||||
}) | }) | ||||
} | } | ||||
/** | |||||
* @description 检查用户信息 | |||||
* @returns userInfo | |||||
*/ | |||||
const checkUserInfo = () => { | |||||
const that = this | |||||
request.get({ | |||||
url: '/api/user/userinfo' | |||||
}).then(res => { | |||||
console.log(res, 'userinfo'); | |||||
res.data.createDate = res.data.createDate ? timestampToTime(res.data.createDate, 'YYYY-MM-DD hh:mm:ss') : '' | |||||
res.data.updateDate = res.data.updateDate ? timestampToTime(res.data.updateDate, 'YYYY-MM-DD hh:mm:ss') : '' | |||||
res.data.validStartTime = res.data.validStartTime ? timestampToTime(res.data.validStartTime, 'YYYY-MM-DD hh:mm:ss') : '' | |||||
res.data.validEndTime = res.data.validEndTime ? timestampToTime(res.data.validEndTime, 'YYYY-MM-DD hh:mm:ss') : '' | |||||
res.data.coverPhone = res.data.phone ? (res.data.phone.slice(0, 3) + `****` + res.data.phone.slice(7)) : '' | |||||
const userInfo = res.data | |||||
that.globalData.userInfo = userInfo | |||||
// 请求完成后的回调,在index.js中调用防止异步 | |||||
that.userInfoCallback(res) | |||||
wx.setStorageSync('promotContentCount', res.data.promotContentCount) | |||||
that.globalData.promotContentCount = res.data.promotContentCount | |||||
wx.setStorageSync('completionContentCount', res.data.completionContentCount) | |||||
that.globalData.completionContentCount = res.data.completionContentCount | |||||
}).catch(err => { | |||||
console.log(err, 'err'); | |||||
}) | |||||
} | |||||
}, | }, | ||||
}) | }) |
@@ -10,7 +10,6 @@ | |||||
"navigationBarTextStyle": "black" | "navigationBarTextStyle": "black" | ||||
}, | }, | ||||
"plugins": {}, | "plugins": {}, | ||||
"style": "v2", | |||||
"sitemapLocation": "sitemap.json", | "sitemapLocation": "sitemap.json", | ||||
"usingComponents": { | "usingComponents": { | ||||
"VanNoticeBar": "@vant/weapp/notice-bar/index", | "VanNoticeBar": "@vant/weapp/notice-bar/index", | ||||
@@ -19,5 +18,6 @@ | |||||
"VanIcon": "@vant/weapp/icon/index", | "VanIcon": "@vant/weapp/icon/index", | ||||
"VanEmpty": "@vant/weapp/empty/index", | "VanEmpty": "@vant/weapp/empty/index", | ||||
"van-toast": "@vant/weapp/toast/index" | "van-toast": "@vant/weapp/toast/index" | ||||
} | |||||
}, | |||||
"__usePrivacyCheck__": false | |||||
} | } |
@@ -1,9 +1,12 @@ | |||||
const app = getApp() | const app = getApp() | ||||
import request from '../../utils/request' | import request from '../../utils/request' | ||||
import { timestampToTime } from '../../utils/util' | import { timestampToTime } from '../../utils/util' | ||||
import Dialog from '@vant/weapp/dialog/dialog'; | |||||
Page({ | Page({ | ||||
data: { | data: { | ||||
isLogin: true, | |||||
itemList: [1, 1, 1, 1, 1, 1], | |||||
showPrivacy: false | showPrivacy: false | ||||
}, | }, | ||||
// 事件处理函数 | // 事件处理函数 | ||||
@@ -119,16 +122,29 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
showMore() { | |||||
Dialog.confirm({ | |||||
title: '删除作品', | |||||
message: '确定要删除这个作品吗?', | |||||
}) | |||||
.then(() => { | |||||
// on confirm | |||||
}) | |||||
.catch(() => { | |||||
// on cancel | |||||
}); | |||||
}, | |||||
onShareAppMessage() { | onShareAppMessage() { | ||||
const promise = new Promise(resolve => { | const promise = new Promise(resolve => { | ||||
setTimeout(() => { | setTimeout(() => { | ||||
resolve({ | resolve({ | ||||
title: '小闲聊' | |||||
title: '智像小相册' | |||||
}) | }) | ||||
}, 500) | }, 500) | ||||
}) | }) | ||||
return { | return { | ||||
title: '小闲聊', | |||||
title: '智像小相册', | |||||
promise | promise | ||||
} | } | ||||
}, | }, | ||||
@@ -136,12 +152,12 @@ Page({ | |||||
const promise = new Promise(resolve => { | const promise = new Promise(resolve => { | ||||
setTimeout(() => { | setTimeout(() => { | ||||
resolve({ | resolve({ | ||||
title: '小闲聊' | |||||
title: '智像小相册' | |||||
}) | }) | ||||
}, 500) | }, 500) | ||||
}) | }) | ||||
return { | return { | ||||
title: '小闲聊', | |||||
title: '智像小相册', | |||||
promise | promise | ||||
} | } | ||||
} | } | ||||
@@ -1,4 +1,8 @@ | |||||
{ | { | ||||
"navigationBarTitleText": "首页", | |||||
"usingComponents": {} | |||||
"navigationBarTitleText": "我的作品", | |||||
"navigationBarBackgroundColor": "#333333", | |||||
"navigationBarTextStyle": "white", | |||||
"usingComponents": { | |||||
"van-dialog": "@vant/weapp/dialog/index" | |||||
} | |||||
} | } |
@@ -1,167 +1,118 @@ | |||||
.content { | |||||
page { | |||||
background-color: #333333; | |||||
} | |||||
.pages { | |||||
padding: 0 0 25rpx 0; | padding: 0 0 25rpx 0; | ||||
.logo { | |||||
position: relative; | |||||
width: 500rpx; | |||||
height: 120rpx; | |||||
line-height: 120rpx; | |||||
text-align: center; | |||||
color: #838383; | |||||
font-size: 50rpx; | |||||
font-weight: 600; | |||||
margin: auto; | |||||
border-bottom: 1px solid #000; | |||||
transition: all 0.3s; | |||||
&.active { | |||||
color: aqua; | |||||
.glass { | |||||
position: fixed; | |||||
width: 100vw; | |||||
height: 100vh; | |||||
z-index: -9; | |||||
image { | |||||
width: 100vw; | |||||
height: 100vh; | |||||
filter: blur(20rpx); | |||||
} | } | ||||
} | |||||
.tinyChatICon { | |||||
position: absolute; | |||||
top: 15rpx; | |||||
left: 30rpx; | |||||
width: 60rpx; | |||||
text-align: center; | |||||
transition: all 0.3s; | |||||
&.active { | |||||
transform: scale(1.05); | |||||
} | |||||
.content { | |||||
position: fixed; | |||||
width: 100vw; | |||||
height: 100vh; | |||||
background-color: #333333a6; | |||||
padding-top: 60rpx; | |||||
z-index: -8; | |||||
.avatar { | |||||
width: 220rpx; | |||||
height: 220rpx; | |||||
border-radius: 25%; | |||||
overflow: hidden; | |||||
margin: auto; | |||||
image { | image { | ||||
width: 100%; | width: 100%; | ||||
height: 100%; | |||||
} | } | ||||
} | } | ||||
} | |||||
.introduction { | |||||
position: relative; | |||||
width: 600rpx; | |||||
margin: 50rpx auto; | |||||
padding: 0 20rpx; | |||||
border: 1px dashed #747474; | |||||
border-radius: 60rpx; | |||||
.title { | |||||
.nickname { | |||||
font-size: 32rpx; | |||||
margin-top: 25rpx; | |||||
color: #ffffff; | |||||
text-align: center; | text-align: center; | ||||
font-size: 45rpx; | |||||
color: #585858; | |||||
margin-bottom: 10rpx; | |||||
margin-top: 20rpx; | |||||
} | } | ||||
.contain { | |||||
width: 500rpx; | |||||
font-size: 30rpx; | |||||
color: #585858; | |||||
text-indent: 1cm; | |||||
margin: 0 auto; | |||||
padding: 20rpx; | |||||
font-family: Verdana, Geneva, Tahoma, sans-serif; | |||||
} | |||||
.notice { | |||||
text-indent: 44rpx; | |||||
font-size: 22rpx; | |||||
color: #929292; | |||||
padding: 0 50rpx; | |||||
margin-top: 35rpx; | |||||
.tab { | |||||
width: 200rpx; | |||||
height: 70rpx; | |||||
line-height: 70rpx; | |||||
text-align: center; | |||||
color: #ffffff; | |||||
background-color: #ff4f00; | |||||
margin: 50rpx auto; | |||||
border-radius: 15rpx; | |||||
} | } | ||||
.switch { | |||||
position: absolute; | |||||
width: 100rpx; | |||||
height: 100rpx; | |||||
border-radius: 50% 50%; | |||||
&.topLeft { | |||||
top: 0; | |||||
left: 0; | |||||
transform: translate(-50%, -50%); | |||||
} | |||||
&.topRight { | |||||
top: 0; | |||||
right: 0; | |||||
transform: translate(50%, -50%); | |||||
} | |||||
.scrollView { | |||||
width: 100%; | |||||
height: 900rpx; | |||||
z-index: 1; | |||||
&.bottomLeft { | |||||
bottom: 0; | |||||
left: 0; | |||||
transform: translate(-50%, 50%); | |||||
} | |||||
.item { | |||||
width: 92%; | |||||
height: 280rpx; | |||||
// background-color: grey; | |||||
margin: 30rpx auto; | |||||
&.bottomRight { | |||||
bottom: 0; | |||||
right: 0; | |||||
transform: translate(50%, 50%); | |||||
} | |||||
} | |||||
.top { | |||||
display: flex; | |||||
justify-content: space-between; | |||||
.modelName { | |||||
font-size: 32rpx; | |||||
color: #ffffff; | |||||
} | |||||
} | |||||
.date { | |||||
color: #ffffff; | |||||
} | |||||
.buttons { | |||||
font-size: 25rpx; | |||||
.more { | |||||
position: relative; | |||||
left: 20rpx; | |||||
width: 40rpx; | |||||
height: 40rpx; | |||||
.userProtocolModel { | |||||
text-align: center; | |||||
margin-bottom: 30rpx; | |||||
.textInside { | |||||
position: relative; | |||||
width: 550rpx; | |||||
margin: auto; | |||||
.agreeButton { | |||||
position: absolute; | |||||
left: 0rpx; | |||||
width: 30rpx; | |||||
height: 30rpx; | |||||
line-height: 35rpx; | |||||
border: 1px solid #464646; | |||||
border-radius: 50% 50%; | |||||
color: #ffffff; | |||||
text-align: center; | |||||
&.active { | |||||
border: 1px solid #07c160; | |||||
background-color: #07c160; | |||||
image { | |||||
width: 12rpx; | |||||
} | |||||
} | } | ||||
} | } | ||||
.userProtocol { | |||||
text-align: center; | |||||
color: #929292; | |||||
text-decoration: underline; | |||||
margin-bottom: 15rpx; | |||||
.photoList { | |||||
display: flex; | |||||
justify-content: space-between; | |||||
margin-top: 20rpx; | |||||
image { | |||||
width: 150rpx; | |||||
border-radius: 10%; | |||||
} | |||||
} | } | ||||
} | } | ||||
} | |||||
.getPhoneNumberBtn { | |||||
display: none; | |||||
} | |||||
.userPhone { | |||||
text-align: center; | |||||
margin-bottom: 15rpx; | |||||
color: #929292; | |||||
} | } | ||||
.payHistory { | |||||
.goLogin { | |||||
font-size: 32rpx; | |||||
text-align: center; | text-align: center; | ||||
color: #929292; | |||||
font-weight: 600; | |||||
color: #ff4f00; | |||||
text-decoration: underline; | text-decoration: underline; | ||||
margin-bottom: 15rpx; | |||||
} | |||||
button { | |||||
border-radius: 30rpx; | |||||
margin-top: 40rpx; | |||||
} | } | ||||
} | } | ||||
@@ -172,6 +123,7 @@ | |||||
width: 100%; | width: 100%; | ||||
height: 100%; | height: 100%; | ||||
background-color: #00000059; | background-color: #00000059; | ||||
z-index: -999; | |||||
.showPrivacy { | .showPrivacy { | ||||
position: fixed; | position: fixed; | ||||
@@ -1,5 +1,44 @@ | |||||
<!--index.wxml--> | <!--index.wxml--> | ||||
<view class="content"> | |||||
<view class="pages"> | |||||
<view class="glass"> | |||||
<image src="../../asset/image/homeImg.jpg" mode="scaleToFill" /> | |||||
</view> | |||||
<view class="content"> | |||||
<block bindtap="getUserProfile"> | |||||
<view class="avatar"> | |||||
<image src="../../asset/icon/logo-5.png" mode="" /> | |||||
</view> | |||||
<view wx:if="{{ isLogin }}" class="nickname">微信用户</view> | |||||
</block> | |||||
<block wx:if="{{ isLogin }}"> | |||||
<view class="tab">我的写真</view> | |||||
<scroll-view class="scrollView" type="list" scroll-y scroll-with-animatio> | |||||
<view wx:for="{{itemList}}" class="item"> | |||||
<view class="top"> | |||||
<view class="modelName">name</view> | |||||
<view class="date">2023-10-1 12:43:14</view> | |||||
<view class="more" bindtap="showMore"> | |||||
<image src="../../asset/icon/more.png" mode="widthFix" /> | |||||
</view> | |||||
</view> | |||||
<view class="photoList"> | |||||
<image wx:for="{{[1,1,1,1]}}" src="../../asset/image/test.png" mode="widthFix" /> | |||||
</view> | |||||
</view> | |||||
</scroll-view> | |||||
</block> | |||||
<block wx:if="{{ !isLogin }}"> | |||||
<view class="goLogin">登录即可体验全部功能哦</view> | |||||
</block> | |||||
</view> | |||||
<van-dialog id="van-dialog" /> | |||||
<view class="outSide" wx:if="{{showPrivacy}}" bindtap="clickPrivacy"> | <view class="outSide" wx:if="{{showPrivacy}}" bindtap="clickPrivacy"> | ||||
<view class="showPrivacy"> | <view class="showPrivacy"> | ||||
<view class="title">隐私协议更新</view> | <view class="title">隐私协议更新</view> | ||||
@@ -26,7 +26,8 @@ | |||||
"miniprogramNpmDistDir": "./miniprogram/" | "miniprogramNpmDistDir": "./miniprogram/" | ||||
} | } | ||||
], | ], | ||||
"minified": true | |||||
"minified": true, | |||||
"ignoreUploadUnusedFiles": true | |||||
}, | }, | ||||
"simulatorType": "wechat", | "simulatorType": "wechat", | ||||
"simulatorPluginLibVersion": {}, | "simulatorPluginLibVersion": {}, | ||||