main^2
Wkang921 2 years ago
parent db770dea42
commit 043b24bd21

BIN
.DS_Store vendored

Binary file not shown.

@ -11,7 +11,8 @@ Page({
userInfo:{}, userInfo:{},
xyNfc:true, xyNfc:true,
xyInfo:{}, xyInfo:{},
visible:false visible:false,
showEnergy:true
}, },
/** /**
@ -35,9 +36,7 @@ Page({
req.getRequest('/api/user/curt',{}).then((res)=>{ req.getRequest('/api/user/curt',{}).then((res)=>{
if(res.data.code==200){ if(res.data.code==200){
this.setData({userInfo:res.data.data}) this.setData({userInfo:res.data.data})
} this.isFirst()
if(res.data.data.horoscope){
this.setData({visible: true})
} }
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
@ -46,7 +45,51 @@ Page({
}, },
// 关闭运势提示 // 关闭运势提示
closeYs(){ closeYs(){
this.setData({visible: !this.data.visible}) this.setData({visible: !this.data.visible, showEnergy: true})
if (this.data.visible) {
const time = setTimeout(() => {
this.setData({showEnergy: false})
}, 1000);
this.setData({time : time})
}
if (!this.data.visible) {
clearTimeout(this.data.time)
}
},
// 判断是否第一次登入
isFirst(){
const isFirst = wx.getStorageSync('isFirst')
if (isFirst) {
this.setData({
showIsFirst: true,
visible: false
})
}else {
if (this.data.userInfo.horoscope) {
this.setData({visible: true, showIsFirst: false})
setTimeout(() => {
this.setData({showEnergy: false})
}, 3000);
}
}
},
// 关闭第一次登入弹层
closeFirst(){
console.log('关闭弹层');
this.setData({showIsFirst: false})
},
childTap() {
console.log('子盒子被点击');
},
// 提升运势
upImprove(){
const mac = wx.getStorageSync('mac-key')
req.patchRequest('/api/user/curt/horoscope/improve',{mac: mac}).then(res => {
console.log(res);
})
}, },
/** /**
@ -60,6 +103,7 @@ Page({
*/ */
onShow() { onShow() {
this.initXy() this.initXy()
this.upImprove()
}, },
/** /**

@ -7,15 +7,19 @@
<view class="gold3" bindtap="ToastDialog"></view> <view class="gold3" bindtap="ToastDialog"></view>
</view> </view>
<view class="book"></view> <view class="book"></view>
<view class="star"></view> <view class="star" bindtap="closeYs"></view>
<view class="xyszy">{{userInfo.horoscope.number}}</view> <view class="xyszy">{{userInfo.horoscope.number}}</view>
<view class="xyysy">{{userInfo.horoscope.color}}</view> <view class="xyysy">{{userInfo.horoscope.color}}</view>
<view class="text1">幸运数字</view> <view class="text1">幸运数字</view>
<view class="text2">{{userInfo.horoscope.name}}</view> <view class="text2">{{userInfo.horoscope.name}}</view>
<view class="text3">幸运颜色</view> <view class="text3">幸运颜色</view>
<view class="nlj" wx:if="{{xyNfc}}">能量 +{{userInfo.pendantEnergy}}%</view>
<view class="xyj">银币 +{{userInfo.silverCoin}}枚</view> <view class="showEnergy {{showEnergy ? '' : 'hide'}}">
<view class=" nlj " wx:if="{{xyNfc}}">能量 + 10%</view>
<view class="xyj ">银币 + 0.1枚</view>
</view>
<image class="xzy" src="{{xzInfo[userInfo.horoscope.name].avatar}}"></image> <image class="xzy" src="{{xzInfo[userInfo.horoscope.name].avatar}}"></image>
@ -26,3 +30,15 @@
<view class="raqzs">爱情指数<t-rate value="{{userInfo.horoscope.love / 20}}" icon="{{ ['star-filled', 'star'] }}" color="#FCFC32" /></view> <view class="raqzs">爱情指数<t-rate value="{{userInfo.horoscope.love / 20}}" icon="{{ ['star-filled', 'star'] }}" color="#FCFC32" /></view>
<view class="rcyzs">财运指数<t-rate value="{{userInfo.horoscope.money / 20}}" icon="{{ ['star-filled', 'star'] }}" color="#FCFC32" /></view> <view class="rcyzs">财运指数<t-rate value="{{userInfo.horoscope.money / 20}}" icon="{{ ['star-filled', 'star'] }}" color="#FCFC32" /></view>
</view> </view>
<!-- 第一次登入欢迎页面 -->
<view class="isFirst" bindtap="closeFirst" wx:if="{{showIsFirst}}">
<view class="isFirst-img" catchtap="childTap"></view>
<view class="isFirst-box" catchtap="childTap">
<view>Hi~</view>
<view>我是你的星座守护精灵</view>
<view>从今以后,就让我来守护你吧!</view>
<view>之后可以在精灵页面找到我</view>
<view>还可以跟我对话哦~</view>
</view>
</view>

@ -145,7 +145,6 @@
background-size:100% 100%; background-size:100% 100%;
margin-top:1232rpx; margin-top:1232rpx;
margin-left:316.67rpx; margin-left:316.67rpx;
background-image: url(https://wish-assets.windymuse.com.cn/xy/byz.png);
} }
.xyysy{ .xyysy{
@ -301,6 +300,15 @@
font-size: 27rpx; font-size: 27rpx;
} }
.showEnergy {
transition: all 0.5s;
opacity: 1;
}
.hide {
opacity: 0;
}
.xyj{ .xyj{
position: absolute; position: absolute;
width: 240rpx; width: 240rpx;
@ -317,3 +325,39 @@
text-align: center; text-align: center;
font-size: 27rpx; font-size: 27rpx;
} }
.isFirst {
position: absolute;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
background-color: rgba(255, 255, 255, 0.7);
}
.isFirst-img {
width: 328rpx;
height: 774rpx;
margin-top: 290rpx;
background-size: contain;
background-image: url(https://ydxxkj-wish.oss-cn-hangzhou.aliyuncs.com/xy/isFistImg.png);
}
.isFirst-box {
position: absolute;
top: 600rpx;
width: 514rpx;
height: 300rpx;
padding: 40rpx 66rpx;
box-sizing: border-box;
border-radius: 30rpx;
opacity: 0.9;
background-color: rgba(255, 255, 255, 1);
color: rgba(108, 108, 108, 1);
font-size: 28rpx;
box-shadow: 2rpx 4rpx 12rpx 0px rgba(0, 0, 0, 0.4);
}
.isFirst-box view {
margin-bottom: 6rpx;
}

@ -15,13 +15,16 @@
<!-- <view class="ppop" bindtap="showMultiText"></view> --> <!-- <view class="ppop" bindtap="showMultiText"></view> -->
<t-popup class="txypop" visible="{{visible}}" placement="center"> <t-popup class="txypop" visible="{{visible}}" placement="center" show-overlay="{{false}}">
<view class="ttop1"> <view class="ttop1">
<view class="ttop1-item">
<view class="xynr">许愿内容</view> <view class="xynr">许愿内容</view>
<view class="qwsj">期望时间</view>
<view class="xylj">许愿链接</view>
<view class="xytp">许愿图片</view>
<t-textarea class="xynrf" model:value="{{xyContent}}" t-class="external-class" placeholder="内容限制30个字" /> <t-textarea class="xynrf" model:value="{{xyContent}}" t-class="external-class" placeholder="内容限制30个字" />
</view>
<view class="ttop1-item">
<view class="qwsj">期望时间</view>
<t-input <t-input
class="qwsjt" class="qwsjt"
placeholder="请选择到期时间" placeholder="请选择到期时间"
@ -30,26 +33,34 @@
disabled disabled
suffixIcon="{{ 'chevron-down'}}" suffixIcon="{{ 'chevron-down'}}"
/> />
</view>
<view class="ttop1-item">
<view class="xylj">许愿链接</view>
<t-input <t-input
class="xyljt" class="xyljt"
placeholder="愿望链接(可不填)" placeholder="愿望链接(可不填)"
model:value="{{xyLink}}" model:value="{{xyLink}}"
/> />
</view>
<view > <view class="ttop1-item">
<view class="xytp">许愿图片</view>
<t-upload class="xytpt" <t-upload class="xytpt"
mediaType="{{['video','image']}}" mediaType="{{['video','image']}}"
max="{{1}}" max="{{1}}"
files="{{fileList}}" files="{{fileList}}"
bind:add="handleAdd" bind:add="handleAdd"
bind:remove="handleRemove" bind:remove="handleRemove"
gutter="130 * 130"
> >
</t-upload> </t-upload>
</view>
<view class="ttop1-btn">
<view class="btn" bindtap="doCancelXy">取消</view>
<view data-fs="{{form}}" data-note="{{note}}" class="btn" bindtap="doFinishXy">完成</view>
</view>
</view>
<view class="qx" bindtap="doCancelXy">取消</view>
<view data-fs="{{form}}" data-note="{{note}}" class="wc" bindtap="doFinishXy">完成</view>
</view> </view>
</t-popup> </t-popup>

@ -191,126 +191,81 @@
.txypop{ .txypop{
margin-top: 50rpx; margin-top: 50rpx;
width: 710rpx; width: 100%;
height:1300rpx; height: 100%;
border-radius: 30rpx!important; display: flex;
justify-content: center;
} }
.ttop1{ .ttop1{
margin-left: 30rpx; width: 744rpx;
width: 650rpx; height: 1296rpx;
height:1240rpx; margin-top: 130rpx;
margin-top:30rpx; padding-top: 230rpx;
background-repeat: no-repeat; box-sizing: border-box;
background-size:100% 100%; display: flex;
background-image: url(https://wish-assets.windymuse.com.cn/xy/xybjta.png); align-items: center;
flex-direction: column;
background: url(https://wish-assets.windymuse.com.cn/xy/xybjta.png) no-repeat;
background-size: cover;
}
.ttop1-item {
width: 574rpx;
margin-bottom: 42rpx;
display: flex;
align-items: center;
}
.ttop1-item .t-input {
flex: none;
} }
.xynr{ .xynr{
position: absolute; height: 100%;
left: 92rpx; margin-right: 56rpx;
top: 230rpx; color: #6c6c6c;
width: 72px; font-size: 32rpx;
height: 24px;
color: rgba(108, 108, 108, 1);
font-size: 16px;
text-align: left; text-align: left;
font-family: SourceHanSansSC-regular; }
.xynrf{
width: 392rpx;
height: 180rpx;
padding: 12rpx !important;
border-radius: 20rpx;
color: #888888;
font-size: 28rpx;
text-align: left;
border: 1px solid rgba(187, 187, 187, 1);
} }
.qwsj{ .qwsj{
position: absolute; margin-right: 56rpx;
left: 92rpx;
top: 468rpx;
width: 72px;
height: 24px;
color: rgba(108, 108, 108, 1); color: rgba(108, 108, 108, 1);
font-size: 16px; font-size: 32rpx;
text-align: left; text-align: left;
font-family: SourceHanSansSC-regular;
} }
.xylj{ .xylj{
position: absolute; margin-right: 56rpx;
left: 92rpx; color: rgba(108, 108, 108, 1);
top: 588rpx; font-size: 32rpx;
width: 72px; text-align: left;
height: 24px;
color: rgba(108, 108, 108, 1);
font-size: 16px;
text-align: left;
font-family: SourceHanSansSC-regular;
} }
.xytp{ .xytp{
position: absolute; margin-right: 56rpx;
left: 92rpx; height: 100%;
top: 692rpx; color: rgba(108, 108, 108, 1);
width: 72px; font-size: 32rpx;
height: 24px;
color: rgba(108, 108, 108, 1);
font-size: 16px;
text-align: left;
font-family: SourceHanSansSC-regular;
}
.qx{
position: absolute;
left: 92rpx;
top: 994rpx;
width: 105px;
height: 35px;
line-height: 35px;
border-radius: 10px;
background: linear-gradient(233.49deg, rgba(248,99,42,1) 10.48%,rgba(249,135,89,1) 89.2%);
text-align: center;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
border: 3px solid rgba(255, 255, 255, 1);
color: rgba(255, 255, 255, 1);
font-size: 14px;
text-align: center;
font-family: SourceHanSansSC-medium;
}
.wc{
position: absolute;
left: 414rpx;
top: 994rpx;
width: 105px;
height: 35px;
line-height: 35px;
border-radius: 10px;
background: linear-gradient(233.49deg, rgba(248,99,42,1) 10.48%,rgba(249,135,89,1) 89.2%);
text-align: center;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
border: 3px solid rgba(255, 255, 255, 1);
color: rgba(255, 255, 255, 1);
font-size: 14px;
text-align: center;
font-family: SourceHanSansSC-medium;
}
.xynrf{
position: absolute;
left: 250rpx;
top: 230rpx;
width: 350rpx;
height: 180rpx;
line-height: 40rpx;
border-radius: 20rpx;
color: rgba(136, 136, 136, 1);
font-size: 28rpx;
text-align: left; text-align: left;
border: 1px solid rgba(187, 187, 187, 1);
} }
.xyljt{ .xyljt{
position: absolute;
left: 218rpx;
top: 490rpx;
padding: 0 0 0 20rpx !important; padding: 0 0 0 20rpx !important;
box-sizing: border-box; box-sizing: border-box;
width: 350rpx!important; width: 392rpx!important;
height: 80rpx!important; height: 80rpx!important;
line-height: 80rpx!important; line-height: 80rpx!important;
border-radius: 20rpx; border-radius: 20rpx;
@ -323,12 +278,9 @@ font-family: SourceHanSansSC-medium;
} }
.qwsjt{ .qwsjt{
position: absolute;
left: 220rpx;
top: 448rpx;
padding: 0 20rpx !important; padding: 0 20rpx !important;
box-sizing: border-box; box-sizing: border-box;
width: 350rpx!important; width: 392rpx!important;
height: 80rpx!important; height: 80rpx!important;
border-radius: 20rpx; border-radius: 20rpx;
color: rgba(136, 136, 136, 1); color: rgba(136, 136, 136, 1);
@ -336,20 +288,57 @@ font-family: SourceHanSansSC-medium;
border: 1px solid rgba(187, 187, 187, 1); border: 1px solid rgba(187, 187, 187, 1);
} }
.xytpt{ .t-grid-item {
position: absolute; width: 100% !important;
width:600rpx; }
/* .xytpt{ */
/* position: absolute; */
/* width:600rpx;
height:600rpx; height:600rpx;
margin-top:530rpx; margin-top:530rpx;
margin-left: 210rpx!important; margin-left: 210rpx!important; */
} /* width: 130rpx;
height: 130rpx; */
/* } */
.t-upload__add-icon { .t-upload__add-icon {
background-color: #FFFFFF !important; background-color: #FFFFFF !important;
} }
.t-grid { .t-icon-add {
font-size: 120rpx;
color: rgba(234, 234, 234, 1);
}
.t-upload {
border: 1px solid rgba(234, 234, 234, 1);
}
/* .t-grid {
background-color: transparent!important; background-color: transparent!important;
} */
.ttop1-btn {
width: 540rpx;
margin-top: 160rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.ttop1-btn .btn{
width: 210rpx;
height: 70rpx;
border-radius: 10px;
background: linear-gradient(233.49deg, rgba(248,99,42,1) 10.48%,rgba(249,135,89,1) 89.2%);
box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4);
border: 6rpx solid rgba(255, 255, 255, 1);
color: rgba(255, 255, 255, 1);
font-size: 28rpx;
display: flex;
justify-content: center;
align-items: center;
} }
.ppop{ .ppop{

@ -101,7 +101,6 @@ Page({
var DEV_CODE = code var DEV_CODE = code
var PUBLIC_KEY = "" var PUBLIC_KEY = ""
req.getRequest('/api/dict/value/login-public-key',{}).then((res)=>{ req.getRequest('/api/dict/value/login-public-key',{}).then((res)=>{
console.log(res,'11111111');
if(res.data.code==200){//获取公钥成功 if(res.data.code==200){//获取公钥成功
PUBLIC_KEY = res.data.data PUBLIC_KEY = res.data.data
// 实例化rsa // 实例化rsa
@ -110,10 +109,13 @@ Page({
rsa.setPublicKey(PUBLIC_KEY) rsa.setPublicKey(PUBLIC_KEY)
// 加密 // 加密
const mac = rsa.encryptLong(DEV_CODE) const mac = rsa.encryptLong(DEV_CODE)
wx.setStorageSync('mac-key', mac)
// 此处执行登录获取token操作 // 此处执行登录获取token操作
req.postRequest('/api/user/login',{'mac':mac}).then((res)=>{ req.postRequest('/api/user/login',{'mac':mac}).then((res)=>{
console.log(res);
if(res.data.code==200){ if(res.data.code==200){
wx.setStorageSync('token', res.data.data) wx.setStorageSync('token', res.data.data.token)
wx.setStorageSync('isFirst', res.data.data.isFirst)
// 设置当前设备码 // 设置当前设备码
wx.setStorageSync('code', DEV_CODE) wx.setStorageSync('code', DEV_CODE)
// 设置为初次识别NFC // 设置为初次识别NFC
@ -150,7 +152,6 @@ Page({
header: {'Authorization': wx.getStorageSync('token')}, header: {'Authorization': wx.getStorageSync('token')},
method: 'GET', method: 'GET',
success: res => { success: res => {
console.log(res.data.data.letterStatus);
const letterStatus = res.data.data.letterStatus const letterStatus = res.data.data.letterStatus
// 这里可以判断是否有未读信札 // 这里可以判断是否有未读信札
if (letterStatus === 'sending') { if (letterStatus === 'sending') {

@ -3,13 +3,15 @@
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 88rpx 40rpx 0 40rpx; display: flex;
justify-content: center;
box-sizing: border-box; box-sizing: border-box;
} }
.bg{ .bg{
width: 100%; width: 674rpx;
height: 100%; height: 1418rpx;
margin-top: 114rpx;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -32,7 +34,7 @@
.alb{ .alb{
width: 432rpx; width: 432rpx;
height: 192rpx; height: 192rpx;
margin-top: 258rpx; margin-top: 240rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size:100% 100%; background-size:100% 100%;
background-image: url(https://wish-assets.windymuse.com.cn/xy/alb.png); background-image: url(https://wish-assets.windymuse.com.cn/xy/alb.png);
@ -41,7 +43,7 @@
.qr{ .qr{
width: 152rpx; width: 152rpx;
height: 152rpx; height: 152rpx;
margin-top: 100rpx; margin-top: 120rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -77,7 +79,7 @@
.jstext{ .jstext{
width: 400rpx; width: 400rpx;
height: 242rpx; height: 242rpx;
margin-top: 118rpx; margin-top: 120rpx;
background-size:100% 100%; background-size:100% 100%;
background-image: url(https://wish-assets.windymuse.com.cn/xy/jstext.png); background-image: url(https://wish-assets.windymuse.com.cn/xy/jstext.png);
} }
@ -85,7 +87,7 @@
.yx{ .yx{
width: 248rpx; width: 248rpx;
height: 142rpx; height: 142rpx;
margin-top: 24rpx; margin-top: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

Loading…
Cancel
Save