main
Wkang921 2 years ago
parent 379b369e1c
commit f0ba491683

@ -154,6 +154,8 @@ Page({
}, },
// 注入晶石 // 注入晶石
btnInject(){ btnInject(){
// 判断是否有能量
if (this.data.userInfo.crystallineEnergy) {
this.setData({ this.setData({
showInject:!this.data.showInject, showInject:!this.data.showInject,
showInEnergy:!this.data.showInEnergy showInEnergy:!this.data.showInEnergy
@ -168,6 +170,14 @@ Page({
}) })
this.getUserInfo() this.getUserInfo()
},2000) },2000)
}else{
this.setData({showInject: false})
Toast({
context: this,
selector: '#t-toast',
message: '能量不足',
});
}
}, },
// 关闭注入弹层 // 关闭注入弹层
closeEnergy(){this.setData({showScsEnergy:false})}, closeEnergy(){this.setData({showScsEnergy:false})},

@ -252,9 +252,9 @@
</view> </view>
</view> </view>
<!-- 能量注入 --> <!-- 能量注入 -->
<t-toast id="t-toast" />
<view class="pray" wx:if="{{showInject}}"> <view class="pray" wx:if="{{showInject}}">
<view class="dialog"> <view class="dialog">
<t-toast id="t-toast" />
<view class="dialog-text"> <view class="dialog-text">
<view>你要将能量注入到晶石吗?</view> <view>你要将能量注入到晶石吗?</view>
<view>晶石将开启守护计时</view> <view>晶石将开启守护计时</view>

@ -18,12 +18,12 @@ Page({
'https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/me/tx2.png', 'https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/me/tx2.png',
'https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/me/tx3.png', 'https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/me/tx3.png',
], ],
sexs:[{label:'男生',value:'male'},{label:'女生',value:'female'}], sexs:[{label:'男生',value:'male'},{label:'女生',value:'female'}],
sexVisible:false, sexVisible:false,
note:'', note:'',
cVisible:false, cVisible:false,
userInfo:{} userInfo:{},
endDate:new Date().getTime()
}, },
changeAvatar(e){ changeAvatar(e){
req.patchRequest('/api/user/curt',{avatar:e.target.dataset.img}).then((res)=>{ req.patchRequest('/api/user/curt',{avatar:e.target.dataset.img}).then((res)=>{
@ -58,7 +58,9 @@ Page({
console.log('11111') console.log('11111')
}, },
changeDate(e) {/**修改日期 */ changeDate(e) {/**修改日期 */
console.log(e);
const { value } = e.detail; const { value } = e.detail;
console.log(value);
const format = (val) => { const format = (val) => {
const date = new Date(val); const date = new Date(val);
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`; return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
@ -67,7 +69,8 @@ Page({
this.setData({ this.setData({
note: format(value), note: format(value),
}); });
req.patchRequest('/api/user/curt',{date:format(value)}).then((res)=>{ req.patchRequest('/api/user/curt',{birthday:format(value)}).then((res)=>{
console.log(res);
if(res.data.code==200){ if(res.data.code==200){
this.setData({userInfo:res.data.data}) this.setData({userInfo:res.data.data})
wx.showToast({ wx.showToast({
@ -75,6 +78,7 @@ Page({
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) })
this.getUserInfo()
} }
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
@ -85,8 +89,7 @@ Page({
console.log('修改性别') console.log('修改性别')
}, },
doChangeName1(e){ doChangeName1(e){
console.log(e) if (e.detail.value !== this.data.userInfo.nick) {
console.log(e.detail.value)
req.patchRequest('/api/user/curt',{nick:e.detail.value}).then((res)=>{ req.patchRequest('/api/user/curt',{nick:e.detail.value}).then((res)=>{
if(res.data.code==200){ if(res.data.code==200){
this.setData({userInfo:res.data.data}) this.setData({userInfo:res.data.data})
@ -99,6 +102,7 @@ Page({
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
}) })
}
}, },
getUserInfo(){ getUserInfo(){
req.getRequest('/api/user/curt',{}).then((res)=>{ req.getRequest('/api/user/curt',{}).then((res)=>{

@ -3,6 +3,7 @@
"t-input": "tdesign-miniprogram/input/input", "t-input": "tdesign-miniprogram/input/input",
"t-calendar": "tdesign-miniprogram/calendar/calendar", "t-calendar": "tdesign-miniprogram/calendar/calendar",
"t-picker": "tdesign-miniprogram/picker/picker", "t-picker": "tdesign-miniprogram/picker/picker",
"t-picker-item": "tdesign-miniprogram/picker-item/picker-item" "t-picker-item": "tdesign-miniprogram/picker-item/picker-item",
"t-date-time-picker": "tdesign-miniprogram/date-time-picker/date-time-picker"
} }
} }

@ -1,25 +1,56 @@
<!--pages/home/me/grzl/grzl.wxml--> <view class="xgzl-container">
<!--返回图标--> <!-- 头部返回 -->
<view class="xgzl-header">
<view class="reback" bindtap="go2Reback"></view> <view class="reback" bindtap="go2Reback"></view>
<view class="title">修改资料</view> <view class="title">修改资料</view>
</view>
<!-- 头像 -->
<view class="xgzl-img">
<view class="cameralogo"><view class="cameralogo-img"></view></view>
<image class="avatar1" src="{{userInfo.avatar}}"></image> <image class="avatar1" src="{{userInfo.avatar}}"></image>
<view class="cameralogo"></view> <input focus="doChangeName1" class="nickname" name="nick" placeholder="昵称不能为空" maxlength="7" value="{{userInfo.nick}}" bindblur="doChangeName1"></input>
</view>
<view class="yhtx"></view>
<form bindsubmit="go2UpdateUserInfo"> <!-- 精灵头像 -->
<view class="xgzl-sculpture">
<view class="jltxtxt">精灵头像</view>
<view class="txcheck-box">
<view class="txcheck">
<view wx:for="{{avatars}}" class="itemxx"><image class="iii" src="{{item}}" data-img="{{item}}" bindtap="changeAvatar"></image></view>
</view>
</view>
</view>
</form> <!-- <form bindsubmit="go2UpdateUserInfo"></form> -->
<t-input focus="doChangeName1" class="nickname" name="nick" placeholder="昵称不能为空" maxlength="7" value="{{userInfo.nick}}" bindblur="doChangeName1" ></t-input>
<!-- 数据表单 -->
<view class="xgzl-data">
<view class="data-item">
<view class="xbwz">性别</view> <view class="xbwz">性别</view>
<view class="xzwz">星座</view>
<view class="srwz">生日</view>
<view class="jltxtxt">精灵头像</view>
<view class="xbtxt" bindtap="changeSex">{{userInfo.spriteType=='male'?'男生':'女生'}}</view> <view class="xbtxt" bindtap="changeSex">{{userInfo.spriteType=='male'?'男生':'女生'}}</view>
<view class="ssxz">{{userInfo.horoscope.name}}</view> </view>
<view class="srtxt" bindtap="handleCalendar">{{userInfo.horoscope.date}}</view><!--生日--> <view class="data-item">
<t-calendar visible="{{cVisible}}" bind:confirm="changeDate" /> <view class="srwz">生日</view>
<view class="srtxt" bindtap="handleCalendar">{{userInfo.birthday}}</view>
</view>
<view class="data-item">
<view class="xzwz">星座</view>
<view class="ssxz">{{userInfo.birthdayConstellation}}</view>
</view>
</view>
<!-- <t-calendar visible="{{cVisible}}" bind:confirm="changeDate" minDate="{{minDate}}" maxDate="{{maxDate}}"/> -->
<t-date-time-picker
title="选择日期"
visible="{{cVisible}}"
mode="date"
format="YYYY-MM-DD"
value="{{userInfo.birthday}}"
bind:confirm="changeDate"
start="1980-1-1"
end="{{endDate}}"
/>
<t-picker <t-picker
visible="{{sexVisible}}" visible="{{sexVisible}}"
@ -28,13 +59,9 @@
title="选择性别" title="选择性别"
cancelBtn="取消" cancelBtn="取消"
confirmBtn="确认" confirmBtn="确认"
bindchange="onPickerChange" bind:confirm="onColumnChange"
bindpick="onColumnChange"
bindcancel="onPickerCancel"
> >
<t-picker-item options="{{sexs}}" /> <t-picker-item options="{{sexs}}" />
</t-picker> </t-picker>
<view class="txcheck" >
<view wx:for="{{avatars}}" class="itemxx"><image class="iii" src="{{item}}" data-img="{{item}}" bindtap="changeAvatar"></image></view>
</view> </view>

@ -1,185 +1,187 @@
/* pages/home/me/grzl/grzl.wxss */ /* pages/home/me/grzl/grzl.wxss */
.reback{ .xgzl-container {
position: absolute; position: absolute;
margin-left: 20rpx; width: 100%;
margin-top:108rpx; height: 100%;
padding-top: 88rpx;
box-sizing: border-box;
}
.xgzl-header {
width: 100%;
display: flex;
}
.reback{
width:48rpx; width:48rpx;
height:48rpx; height:48rpx;
background-repeat: no-repeat; margin-left: 20rpx;
background-size:100% 100%; background-size:100% 100%;
background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/me/reback.png); background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/me/reback.png);
} }
.title{ .title{
position: absolute;
left: 278rpx;
top: 108rpx;
width: 196rpx; width: 196rpx;
height: 48rpx; height: 48rpx;
margin-left: 210rpx;
display: flex;
align-items: center;
justify-content: center;
color: rgba(108, 108, 108, 1); color: rgba(108, 108, 108, 1);
font-size: 32rpx; font-size: 32rpx;
text-align: center;
font-family: SourceHanSansSC-regular;
} }
.yhtx{ .xgzl-img {
position: absolute; position: relative;
left: 74px; width: 100%;
top: 109px; height: 224rpx;
width: 140rpx; display: flex;
height: 140rpx; align-items: center;
border-radius: 74rpx; justify-content: center;
border: 3px solid rgba(161, 134, 81, 1);
} }
.avatar1{ .avatar1{
position: absolute;
left: 77px;
top: 112px;
width: 140rpx; width: 140rpx;
height: 140rpx; height: 140rpx;
margin: 0 64rpx 0 148rpx;
border-radius: 74rpx; border-radius: 74rpx;
border: 6rpx solid #A18651;
}
.nickname{
border: 1px solid #ffffff;
/* color: rgba(108, 108, 108, 1);
font-size: 36rpx;
text-align: left;
padding: 0 !important;
border: none !important;
background-color: rgba(108, 108, 108, 0) !important; */
}
.xgzl-sculpture {
width: 100%;
padding-left: 50rpx;
box-sizing: border-box;
}
.jltxtxt{
color: rgba(154, 154, 154, 1);
font-size: 28rpx;
} }
.cameralogo{ .cameralogo{
position: absolute; position: absolute;
left: 128px; top: 144rpx;
top: 162px; left: 296rpx;
width: 13px; width: 38rpx;
height: 13px; height: 38rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background-color: #4F4F4F;
}
.cameralogo-img {
width: 26rpx;
height: 26rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size:100% 100%; background-size:100% 100%;
background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/me/camera.png); background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/me/camera.png);
} }
.nickname{
z-index: 999; .txcheck-box {
position: absolute; width: 100%;
left: 176px; height: 164rpx;
top: 131px; overflow-x: scroll;
width: 126px; overflow: hidden;
height: 27px; }
color: rgba(108, 108, 108, 1);
font-size: 18px; .txcheck{
text-align: left; width: 844rpx;
font-family: SourceHanSansSC-medium; height: 164rpx;
text-align: center;
overflow: auto;
display: flex;
align-items: center;
}
.itemxx{
width: 100rpx;
height: 100rpx;
margin-right: 32rpx;
}
.xgzl-data {
width: 100%;
}
.data-item {
width: 100%;
height: 80rpx;
padding: 0 64rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
} }
.xzwz{ .xzwz{
position: absolute; width: 64rpx;
left: 32px; height: 48rpx;
top: 436px;
width: 32px;
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;
} }
.srwz{ .srwz{
position: absolute; width: 64rpx;
left: 32px; height: 48rpx;
top: 380px;
width: 32px;
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;
} }
.xbwz{ .xbwz{
position: absolute; width: 64rpx;
left: 32px; height: 48rpx;
top: 324px;
width: 32px;
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; font-family: SourceHanSansSC-regular;
} }
.ssxz{ .ssxz{
position: absolute; width: 104rpx;
left: 291px; height: 48rpx;
top: 436px;
width: 52px;
height: 24px;
color: rgba(154, 154, 154, 1);
font-size: 16px;
text-align: right;
font-family: SourceHanSansSC-regular;
}
.rlt{
position: absolute;
left: 260px;
top: 380px;
width: 83px;
height: 24px;
color: rgba(154, 154, 154, 1); color: rgba(154, 154, 154, 1);
font-size: 16px; font-size: 32rpx;
text-align: right; text-align: right;
font-family: SourceHanSansSC-regular; font-family: SourceHanSansSC-regular;
} }
.srtxt{ .srtxt{
position: absolute;
left: 500rpx;
top: 380px;
width: 200rpx; width: 200rpx;
height: 24px; height: 48rpx;
color: rgba(154, 154, 154, 1); color: rgba(154, 154, 154, 1);
font-size: 16px; font-size: 32rpx;
text-align: right; text-align: right;
font-family: SourceHanSansSC-regular; font-family: SourceHanSansSC-regular;
} }
.xbtxt{ .xbtxt{
position: absolute; width: 64rpx;
left: 311px; height: 48rpx;
top: 324px;
width: 32px;
height: 24px;
color: rgba(154, 154, 154, 1); color: rgba(154, 154, 154, 1);
font-size: 16px; font-size: 32rpx;
text-align: right; text-align: right;
font-family: SourceHanSansSC-regular; font-family: SourceHanSansSC-regular;
} }
.jltxtxt{
position: absolute;
left: 25px;
top: 200px;
width: 56px;
height: 21px;
color: rgba(154, 154, 154, 1);
font-size: 14px;
text-align: left;
font-family: SourceHanSansSC-regular;
}
.txcheck{
position: absolute;
left: 0px;
top: 221px;
width: 422px;
height: 82px;
text-align: center;
overflow: auto;
display: flex;
}
.itemxx{
margin-left: 21px;
margin-top: 32rpx;
width: 50px;
height: 50px;
display: flex;
}
.iii{ .iii{
width: 50px; width: 100rpx;
height: 50px; height: 100rpx;
border-radius: 50rpx; border-radius: 50rpx;
} }

@ -536,14 +536,14 @@ font-family: SourceHanSansSC-regular;
padding-top: 110rpx ; padding-top: 110rpx ;
box-sizing: border-box; box-sizing: border-box;
background-size: contain; background-size: contain;
background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/%E7%BB%91%E5%AE%9A%E6%83%85%E4%BE%A3%E8%83%8C%E6%99%AF.png?q-sign-algorithm=sha1&q-ak=AKIDBoSyA3WoZy_K5pulXw4YwFFHSwjFqxnletbnHqQeqsRjs6Z9txpRYnJsTOBkTuB-&q-sign-time=1686277836;1686281436&q-key-time=1686277836;1686281436&q-header-list=host&q-url-param-list=ci-process&q-signature=690b486d55a1508bbd0fa788fc514205f8e093ae&x-cos-security-token=fOK1T4qo16Mru7W3aQJ2E9sScf0A7RGad630a09d5896cabd06bbc21068eb367b0Y1MqoJbaHndptGx2BSuYBj716Nh9KM5pliR7tTMw41pxbQkpuvQEJzIMJB81Gn2J8YczG8Xp2c8TawHArzH0tWHlefZqUS4htBd2RgoMX7sRqgMQrzWKqSqtQvCClDVjhFU8HaCDxGOe5WHMFrig91Hzv-y0eBh9tQ1ZshhS9zluBgjfnv9DvY68t4xdRRuT2lvuZodggzQgdI70Dn2Gw&ci-process=originImage); background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/%E7%BB%91%E5%AE%9A%E6%83%85%E4%BE%A3%E8%83%8C%E6%99%AF.png);
} }
.openSend-main-img { .openSend-main-img {
width: 404rpx; width: 404rpx;
height: 404rpx; height: 404rpx;
margin: 0 auto; margin: 0 auto;
background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/%E9%92%BB%E7%9F%B3.png?q-sign-algorithm=sha1&q-ak=AKIDst1-IkRWRN-vG6c40Q-UlDDwO_XkhhbYojH9k0I_aHwwWrsDpGsgzp8wq1qqVreA&q-sign-time=1686278212;1686281812&q-key-time=1686278212;1686281812&q-header-list=host&q-url-param-list=ci-process&q-signature=0faf4873a6d53f31c4546212b03c34facea0ad7e&x-cos-security-token=fOK1T4qo16Mru7W3aQJ2E9sScf0A7RGae2bdb94cb7cb0f1587a5681379bd60560Y1MqoJbaHndptGx2BSuYK3CIkr19FgIPMfB-yHA0KDAkpcfsga1JeNj2wEobNz87tC3goLmUbIap-_7G6k8LvI24RUR2sayPV97z2zxAuQuMMiHcziszgQTR1R1nFpF5pAqP7Wxz65QQwX-sCy_eX1AEXfpFmxzDtq1BKIHIu73jhFZ1bAbMfFpLYxNnVZDm2gcmuV8hhQM6lC5xAcVcA&ci-process=originImage); background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/%E9%92%BB%E7%9F%B3.png);
background-size: contain; background-size: contain;
} }

@ -31,6 +31,7 @@ Page({
btn1:true, btn1:true,
btn2:false, btn2:false,
btn3:false, btn3:false,
btn4:false,
showSoundImg:true showSoundImg:true
}, },
writeLetters(){ writeLetters(){
@ -41,6 +42,15 @@ Page({
Preview: false Preview: false
}) })
}, },
leavetext(){
console.log('离开了');
if (this.data.img !== '' || this.data.duration !== '') {
this.setData({
showImg: true,
showLtqp: true
})
}
},
already(){ already(){
console.log('确定寄出'); console.log('确定寄出');
this.setData({showAlready:true}) this.setData({showAlready:true})
@ -86,7 +96,11 @@ Page({
}, },
ClearYl(){ ClearYl(){
console.log('清除语音'); console.log('清除语音');
// this.setData({showLtqp:false}) this.setData({showLtqp:false})
const list = this.data.messageList.filter(item => {
item.type !== 'audio'
})
this.setData({messageList: list})
}, },
goBack(){ goBack(){
console.log('返回'); console.log('返回');
@ -141,14 +155,15 @@ Page({
}) })
// 判断语音条数大于3条 // 判断语音条数大于3条
if(audio.length >= 3){ if(audio.length >= 3){
this.setData({showSoundMore:true}) this.setData({showSoundMore:true, showSoundImg:true})
}else { }else {
list.push({ list.push({
type: 'audio', type: 'audio',
resourceId: data.data.id, resourceId: data.data.id,
}) })
this.setData({ this.setData({
messageList: list messageList: list,
showSoundImg: true
}) })
} }
console.log(this.data.messageList); console.log(this.data.messageList);
@ -168,25 +183,6 @@ Page({
console.log(this.data.messageList); console.log(this.data.messageList);
} }
}), }),
// success: async res => {
// let data = JSON.parse(res.data);
// console.log(data, '111111');
// if (data.code == 200) {
// this.setData({imgUrl:data.data.abUrl})
// console.log('打印1111')
// console.log(this.data.imgUrl)
// res.data = JSON.parse(res.data);
// console.log(res.data);
// if (res.data.code == 1) {
// console.log(res.data.data.url);
// this.img = this.baseUrl + res.data.data.url;
// 图片路径
// this.userinfo.avatar = res.data.data.url;
// let n = await this.$api.upload({ file: res.data.fullurl });
// console.log(n, '上传后');
// }
// }
// },
fail(res) { fail(res) {
console.log('上传失败'); console.log('上传失败');
} }
@ -197,7 +193,20 @@ Page({
this.setData({showSound:true}) this.setData({showSound:true})
}, },
closeSound(){ closeSound(){
this.setData({showSound:false}) console.log('退出');
this.setData({
showSound:false,
btn1: true,
btn2: false,
btn3: false,
btn4: false,
soundTime: '00:00:00',
showSoundImg: true,
minute:0,
second:0,
millisecond:0
})
clearInterval(this.data.timeOut)
}, },
startSound(){ startSound(){
console.log('开始录音'); console.log('开始录音');
@ -242,32 +251,44 @@ Page({
this.setData({soundTime: time}) this.setData({soundTime: time})
}, },
endSound(){ endSound(){
console.log('暂停录音'); console.log('结束录音');
wx.getRecorderManager().pause() wx.getRecorderManager().stop()
wx.getRecorderManager().onStop((res) => {
console.log(res);
const innerAudioContext = wx.createInnerAudioContext()
innerAudioContext.src = res.tempFilePath
this.setData({
innerAudioContext: innerAudioContext,
videoSrc:res.tempFilePath
})
})
clearInterval(this.data.timeOut) clearInterval(this.data.timeOut)
this.setData({btn2:false, btn3:true, showSoundImg:true}) this.setData({btn2:false, btn3:true, showSoundImg:true})
}, },
playVoice(){ playVoice(){
console.log('继续录音'); console.log('播放录音');
wx.getRecorderManager().resume() this.data.innerAudioContext.play()
this.data.timeOut = setInterval(this.counter,50) this.setData({btn3: false ,btn4: true})
this.setData({btn2:true, btn3:false, showSoundImg:false}) },
stopVoice(){
console.log('停止播放录音');
this.data.innerAudioContext.stop()
this.setData({btn3: true ,btn4: false})
}, },
addSound(){ addSound(){
console.log('添加录音'); console.log('添加录音');
console.log(this.data.soundTime); console.log(this.data.soundTime);
this.setData({duration: this.data.soundTime}) this.setData({duration: this.data.soundTime})
wx.getRecorderManager().stop() // 上传语音
this.uploadFile(this.data.videoSrc,'audio')
clearInterval(this.data.timeOut) clearInterval(this.data.timeOut)
// 监听结束录音
wx.getRecorderManager().onStop((res) => {
console.log(res);
this.uploadFile(res.tempFilePath,'audio')
})
this.setData({ this.setData({
btn1:true, btn1:true,
btn2:false, btn2:false,
btn3:false, btn3:false,
btn4:false,
showLtqp: true, showLtqp: true,
minute:0, minute:0,
second:0, second:0,
@ -275,16 +296,6 @@ Page({
soundTime:'00:00:00' soundTime:'00:00:00'
}) })
}, },
// delSound(){
// console.log('不添加该条语音');
// this.setData({
// sound:'',
// btn1:true,
// btn2:false,
// btn3:false,
// soundTime:'00:00:00'
// })
// },
logout(){ logout(){
req.deleteRequest('/api/user/logout',{}).then((res)=>{ req.deleteRequest('/api/user/logout',{}).then((res)=>{
if(res.data.code===200){ if(res.data.code===200){
@ -296,20 +307,17 @@ Page({
}) })
} }
}) })
// wx.showToast({
// title: 'ok了',
// })
},
modify(){
this.setData({showAlready: false, showSend: false})
}, },
getLetter(){ getLetter(){
console.log('获取当前用户信札内容'); console.log('获取当前用户信札内容');
req.getRequest('/api/user/curt/letter',{}).then(res => { req.getRequest('/api/user/curt/letter',{}).then(res => {
console.log(res); console.log(res);
// res.data.data.messageList.forEach(item => {
// if(item.type === 'text'){
// this.setData({content: item.content})
// }
// })
// this.setData({
// to: res.data.data.to,
// from: res.data.data.from,
// })
}) })
}, },
/** /**

@ -18,7 +18,7 @@
</view> </view>
</view> </view>
<view class="xinfo-main" bindtap="writeLetters"> <view class="xinfo-main" bindtap="writeLetters">
<t-textarea model:value="{{content}}" maxlength="300" placeholder="信件正文" /> <t-textarea bindblur="leavetext" model:value="{{content}}" maxlength="300" placeholder="信件正文" />
</view> </view>
<view class="{{Preview ? 'xinfo-ltqp-yl' : 'xinfo-ltqp'}}" wx:if="{{showLtqp}}"> <view class="{{Preview ? 'xinfo-ltqp-yl' : 'xinfo-ltqp'}}" wx:if="{{showLtqp}}">
<image src="https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/ltqp.png"></image> <image src="https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/ltqp.png"></image>
@ -67,10 +67,13 @@
<view class="btn-being"></view> <view class="btn-being"></view>
</view> </view>
<view class="btn1" wx:if="{{btn2}}" bindtap="endSound"> <view class="btn1" wx:if="{{btn2}}" bindtap="endSound">
<view class="btn-over"></view> <view class="btn-have"></view>
</view> </view>
<view class="btn1" wx:if="{{btn3}}" bindtap="playVoice"> <view class="btn1" wx:if="{{btn3}}" bindtap="playVoice">
<view class="btn-audition"></view> <view class="btn-over"></view>
</view>
<view class="btn1" wx:if="{{btn4}}" bindtap="stopVoice">
<view class="btn-video"></view>
</view> </view>
</view> </view>
</view> </view>
@ -107,7 +110,7 @@
<view class="already-text2">点击OK回到未激活初始页面</view> <view class="already-text2">点击OK回到未激活初始页面</view>
<view class="already-text2">如果误打开信件,需要再次寄出哦!</view> <view class="already-text2">如果误打开信件,需要再次寄出哦!</view>
<view class="already-btn"> <view class="already-btn">
<view class="btn">修改</view> <view class="btn" bindtap="modify">修改</view>
<view class="btn" bindtap="logout">OK</view> <view class="btn" bindtap="logout">OK</view>
</view> </view>
</view> </view>

@ -423,9 +423,9 @@
} }
.btn-being { .btn-being {
width: 60rpx; width: 90rpx;
height: 60rpx; height: 90rpx;
border-radius: 5px; border-radius: 50%;
background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%);
} }
@ -436,13 +436,21 @@
background-size: contain; background-size: contain;
} }
.btn-audition { .btn-video {
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/semiDesign-semi-icons-pause%20Copy%401x.png); background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/semiDesign-semi-icons-pause%20Copy%401x.png);
background-size: contain; background-size: contain;
} }
.btn-have {
width: 60rpx;
height: 60rpx;
border-radius: 10rpx;
background-color: #F8632A;
background-size: contain;
}
.taost-box-text { .taost-box-text {
width: 100%; width: 100%;
display: flex; display: flex;
@ -561,4 +569,5 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
color: #fff; color: #fff;
z-index: 999;
} }

@ -31,6 +31,7 @@ Page({
btn1:true, btn1:true,
btn2:false, btn2:false,
btn3:false, btn3:false,
btn4:false,
showSoundImg:true showSoundImg:true
}, },
writeLetters(){ writeLetters(){
@ -95,7 +96,11 @@ Page({
}, },
ClearYl(){ ClearYl(){
console.log('清除语音'); console.log('清除语音');
// this.setData({showLtqp:false}) this.setData({showLtqp:false})
const list = this.data.messageList.filter(item => {
item.type !== 'audio'
})
this.setData({messageList: list})
}, },
goBack(){ goBack(){
console.log('返回'); console.log('返回');
@ -178,25 +183,6 @@ Page({
console.log(this.data.messageList); console.log(this.data.messageList);
} }
}), }),
// success: async res => {
// let data = JSON.parse(res.data);
// console.log(data, '111111');
// if (data.code == 200) {
// this.setData({imgUrl:data.data.abUrl})
// console.log('打印1111')
// console.log(this.data.imgUrl)
// res.data = JSON.parse(res.data);
// console.log(res.data);
// if (res.data.code == 1) {
// console.log(res.data.data.url);
// this.img = this.baseUrl + res.data.data.url;
// 图片路径
// this.userinfo.avatar = res.data.data.url;
// let n = await this.$api.upload({ file: res.data.fullurl });
// console.log(n, '上传后');
// }
// }
// },
fail(res) { fail(res) {
console.log('上传失败'); console.log('上传失败');
} }
@ -207,7 +193,20 @@ Page({
this.setData({showSound:true}) this.setData({showSound:true})
}, },
closeSound(){ closeSound(){
this.setData({showSound:false}) console.log('退出');
this.setData({
showSound:false,
btn1: true,
btn2: false,
btn3: false,
btn4: false,
soundTime: '00:00:00',
showSoundImg: true,
minute:0,
second:0,
millisecond:0
})
clearInterval(this.data.timeOut)
}, },
startSound(){ startSound(){
console.log('开始录音'); console.log('开始录音');
@ -252,32 +251,44 @@ Page({
this.setData({soundTime: time}) this.setData({soundTime: time})
}, },
endSound(){ endSound(){
console.log('暂停录音'); console.log('结束录音');
wx.getRecorderManager().pause() wx.getRecorderManager().stop()
wx.getRecorderManager().onStop((res) => {
console.log(res);
const innerAudioContext = wx.createInnerAudioContext()
innerAudioContext.src = res.tempFilePath
this.setData({
innerAudioContext: innerAudioContext,
videoSrc:res.tempFilePath
})
})
clearInterval(this.data.timeOut) clearInterval(this.data.timeOut)
this.setData({btn2:false, btn3:true, showSoundImg:true}) this.setData({btn2:false, btn3:true, showSoundImg:true})
}, },
playVoice(){ playVoice(){
console.log('继续录音'); console.log('播放录音');
wx.getRecorderManager().resume() this.data.innerAudioContext.play()
this.data.timeOut = setInterval(this.counter,50) this.setData({btn3: false ,btn4: true})
this.setData({btn2:true, btn3:false, showSoundImg:false}) },
stopVoice(){
console.log('停止播放录音');
this.data.innerAudioContext.stop()
this.setData({btn3: true ,btn4: false})
}, },
addSound(){ addSound(){
console.log('添加录音'); console.log('添加录音');
console.log(this.data.soundTime); console.log(this.data.soundTime);
this.setData({duration: this.data.soundTime}) this.setData({duration: this.data.soundTime})
wx.getRecorderManager().stop() // 上传语音
this.uploadFile(this.data.videoSrc,'audio')
clearInterval(this.data.timeOut) clearInterval(this.data.timeOut)
// 监听结束录音
wx.getRecorderManager().onStop((res) => {
console.log(res);
this.uploadFile(res.tempFilePath,'audio')
})
this.setData({ this.setData({
btn1:true, btn1:true,
btn2:false, btn2:false,
btn3:false, btn3:false,
btn4:false,
showLtqp: true, showLtqp: true,
minute:0, minute:0,
second:0, second:0,
@ -285,16 +296,6 @@ Page({
soundTime:'00:00:00' soundTime:'00:00:00'
}) })
}, },
// delSound(){
// console.log('不添加该条语音');
// this.setData({
// sound:'',
// btn1:true,
// btn2:false,
// btn3:false,
// soundTime:'00:00:00'
// })
// },
logout(){ logout(){
req.deleteRequest('/api/user/logout',{}).then((res)=>{ req.deleteRequest('/api/user/logout',{}).then((res)=>{
if(res.data.code===200){ if(res.data.code===200){
@ -317,15 +318,6 @@ Page({
console.log('获取当前用户信札内容'); console.log('获取当前用户信札内容');
req.getRequest('/api/user/curt/letter',{}).then(res => { req.getRequest('/api/user/curt/letter',{}).then(res => {
console.log(res); console.log(res);
// res.data.data.messageList.forEach(item => {
// if(item.type === 'text'){
// this.setData({content: item.content})
// }
// })
// this.setData({
// to: res.data.data.to,
// from: res.data.data.from,
// })
}) })
}, },
/** /**

@ -67,10 +67,13 @@
<view class="btn-being"></view> <view class="btn-being"></view>
</view> </view>
<view class="btn1" wx:if="{{btn2}}" bindtap="endSound"> <view class="btn1" wx:if="{{btn2}}" bindtap="endSound">
<view class="btn-over"></view> <view class="btn-have"></view>
</view> </view>
<view class="btn1" wx:if="{{btn3}}" bindtap="playVoice"> <view class="btn1" wx:if="{{btn3}}" bindtap="playVoice">
<view class="btn-audition"></view> <view class="btn-over"></view>
</view>
<view class="btn1" wx:if="{{btn4}}" bindtap="stopVoice">
<view class="btn-video"></view>
</view> </view>
</view> </view>
</view> </view>

@ -423,9 +423,9 @@
} }
.btn-being { .btn-being {
width: 60rpx; width: 90rpx;
height: 60rpx; height: 90rpx;
border-radius: 5px; border-radius: 50%;
background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%);
} }
@ -436,13 +436,21 @@
background-size: contain; background-size: contain;
} }
.btn-audition { .btn-video {
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/semiDesign-semi-icons-pause%20Copy%401x.png); background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/semiDesign-semi-icons-pause%20Copy%401x.png);
background-size: contain; background-size: contain;
} }
.btn-have {
width: 60rpx;
height: 60rpx;
border-radius: 10rpx;
background-color: #F8632A;
background-size: contain;
}
.taost-box-text { .taost-box-text {
width: 100%; width: 100%;
display: flex; display: flex;

@ -17,7 +17,7 @@
<view class="nlj" wx:if="{{xyNfc}}">能量 +{{userInfo.pendantEnergy}}%</view> <view class="nlj" wx:if="{{xyNfc}}">能量 +{{userInfo.pendantEnergy}}%</view>
<view class="xyj">银币 +{{userInfo.silverCoin}}枚</view> <view class="xyj">银币 +{{userInfo.silverCoin}}枚</view>
<t-image class="xzy" src="{{xzInfo[userInfo.horoscope.name].avatar}}"></t-image> <image class="xzy" src="{{xzInfo[userInfo.horoscope.name].avatar}}"></image>
<view class="ttpopup" wx:if="{{visible}}"> <view class="ttpopup" wx:if="{{visible}}">
<view class="ztys">{{userInfo.horoscope.summary}}</view> <view class="ztys">{{userInfo.horoscope.summary}}</view>

@ -31,7 +31,8 @@ Page({
xyInfo:{}, xyInfo:{},
showXyz:false, //显示许愿中弹层 showXyz:false, //显示许愿中弹层
showDetail:false, //许愿成功回显弹层 showDetail:false, //许愿成功回显弹层
shareVisible:false //显示分享页面 shareVisible:false, //显示分享页面
showToast:false //显示提示弹层
}, },
handleAdd(e){/**添加图片 */ handleAdd(e){/**添加图片 */
const { fileList } = this.data; const { fileList } = this.data;
@ -98,12 +99,16 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: '/pages/home/xyc/tdyw/tdyw' url: '/pages/home/xyc/tdyw/tdyw'
}) })
}, },
doXzTime(){ doXzTime(){
this.setData({ cvisible: true }); this.setData({ cvisible: true });
console.log('执行选择时间') console.log('执行选择时间')
}, },
// 显示提示
showToast(){
console.log('11');
this.setData({showToast: !this.data.showToast})
},
handleConfirm(e) { handleConfirm(e) {
console.log(e,'111'); console.log(e,'111');
const { value } = e.detail; const { value } = e.detail;
@ -122,14 +127,6 @@ Page({
onClose({ detail }) { onClose({ detail }) {
console.log(detail.trigger); console.log(detail.trigger);
}, },
showMultiText() {
Toast({
context: this,
selector: '#t-toast',
message: '投枚银币许个愿吧\n守护精灵将会祝福你的愿望',
dataduration:10
});
},
doXyPop(){/**弹出许愿弹窗 */ doXyPop(){/**弹出许愿弹窗 */
console.log('执行力。。。。。') console.log('执行力。。。。。')
this.setData({visible:true}) this.setData({visible:true})

@ -9,11 +9,11 @@
<view class="qlxybtn22" wx:if="{{userInfo.loverId}}" bindtap="go2MyYw">我的愿望<view class="xyctoast">{{wishes.length}}</view></view> <view class="qlxybtn22" wx:if="{{userInfo.loverId}}" bindtap="go2MyYw">我的愿望<view class="xyctoast">{{wishes.length}}</view></view>
<view class="bgt3" ></view> <view class="bgt3" ></view>
<view class="bgt2" ></view> <view class="bgt2" ></view>
<view class="bgt1" ></view> <view class="bgt1" bindtap="showToast"></view>
<view class="xyk" ></view> <view class="xyk" ></view>
<view class="xybtn" bindtap="doXyPop"></view> <view class="xybtn" bindtap="doXyPop"></view>
<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">
<view class="ttop1"> <view class="ttop1">
@ -45,7 +45,7 @@
<t-calendar visible="{{cvisible}}" bind:confirm="handleConfirm" bind:close="onClose" min-date="{{minDate}}"/> <t-calendar visible="{{cvisible}}" bind:confirm="handleConfirm" bind:close="onClose" min-date="{{minDate}}"/>
<!-- 提示 --> <!-- 提示 -->
<view class="xyc-toast"> <view class="xyc-toast" wx:if="{{showToast}}">
投枚银币许个愿吧!守护精灵将会祝福你的愿望! 投枚银币许个愿吧!守护精灵将会祝福你的愿望!
</view> </view>

@ -376,15 +376,14 @@ font-family: SourceHanSansSC-medium;
right: 180rpx; right: 180rpx;
width: 310rpx; width: 310rpx;
height: 180rpx; height: 180rpx;
padding: 12px; padding: 24rpx;
box-sizing: border-box; box-sizing: border-box;
color: #6c6c6c; color: #6c6c6c;
line-height: 20px;
opacity: 0.9; opacity: 0.9;
border-radius: 15px; border-radius: 30rpx;
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
font-size: 14px; font-size: 28rpx;
box-shadow: 1px 2px 6px 0px rgba(0, 0, 0, 0.4); box-shadow: 2rpx 4rpx 12rpx 0px rgba(0, 0, 0, 0.4);
} }
/* 许愿进行中 */ /* 许愿进行中 */

@ -1,14 +1,17 @@
<!--pages/index/index.wxml--> <!--pages/index/index.wxml-->
<view class="bd">
<view class="bg"> <view class="bg">
<view class="quest"></view><!--问题图标--> <!-- <view class="quest"></view>问题图标 -->
<view class="alb"></view><!--阿拉伯文字图标--> <view class="alb"></view><!--阿拉伯文字图标-->
<view class="qr"></view><!--扫码图标--> <view class="qr">
<view class="js" bindtap="scanCodeEvent" ></view><!--晶石图片--> <view class="js" bindtap="scanCodeEvent" ></view><!--晶石图片-->
<view class="yw"></view><!--下方黄色小卡图--> </view><!--扫码图标-->
<view class="yw">
<view class="shadow"></view>
</view><!--下方黄色小卡图-->
<view class="jstext"></view><!--晶石文字--> <view class="jstext"></view><!--晶石文字-->
<view class="yx"> <view class="yx" bindtap="go2Get">获取晶石</view><!--圆形图片-->
<view class="hqjs" bindtap="go2Get"><text>获取晶石</text></view> </view>
</view><!--圆形图片-->
</view> </view>
<t-toast id="t-toast" /> <t-toast id="t-toast" />

@ -1,19 +1,25 @@
/* pages/index/index.wxss */ /* pages/index/index.wxss */
.bg{ .bd {
position: absolute; position: absolute;
width: 750rpx; width: 100%;
height: 1419rpx; height: 100%;
padding: 88rpx 40rpx 0 40rpx;
box-sizing: border-box;
}
.bg{
width: 100%;
height: 100%;
box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: 112.67rpx; align-items: center;
margin-left: 37.33rpx;
background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xy/bkg.png); background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xy/bkg.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 675.34rpx 100%; background-size: contain;
} }
.quest{ .quest{
position: absolute;
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
display: flex; display: flex;
@ -24,89 +30,68 @@
} }
.alb{ .alb{
position: absolute;
width: 432rpx; width: 432rpx;
height: 192.67rpx; height: 192rpx;
display: flex; margin-top: 258rpx;
flex-direction: column;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size:100% 100%; background-size:100% 100%;
margin-top:234.67rpx;
margin-left: 121.67rpx;
background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/alb.png); background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/alb.png);
} }
.qr{ .qr{
position: absolute; width: 152rpx;
width: 150.67rpx; height: 152rpx;
height: 150.67rpx; margin-top: 100rpx;
display: flex; display: flex;
flex-direction: column; align-items: center;
background-repeat: no-repeat; justify-content: center;
background-size:100% 100%; background-size:100% 100%;
margin-top:540.67rpx;
margin-left: 262.33rpx;
background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/qr.png); background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/qr.png);
} }
.js{ .js{
position: absolute; width: 114rpx;
width: 115.33rpx; height: 172rpx;
height: 173.33rpx;
display: flex;
flex-direction: column;
background-repeat: no-repeat;
background-size:100% 100%; background-size:100% 100%;
margin-top:535.33rpx;
margin-left: 280rpx;
background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/js.png); background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/js.png);
} }
.yw{ .yw{
position: absolute; width: 400rpx;
width: 399.33rpx; height: 54rpx;
height: 53.33rpx; margin-top: 24rpx;
display: flex; display: flex;
flex-direction: column; align-items: center;
background-repeat: no-repeat; justify-content: center;
background-size:100% 100%; background-size:100% 100%;
margin-top:718rpx;
margin-left: 138rpx;
background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/yw.png); background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/yw.png);
} }
.shadow {
width: 150rpx;
height: 62rpx;
background-size:100% 100%;
background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/xy/shadow.png);
}
.jstext{ .jstext{
position: absolute; width: 400rpx;
width: 399.33rpx; height: 242rpx;
height: 216rpx; margin-top: 118rpx;
display: flex;
flex-direction: column;
background-repeat: no-repeat;
background-size:100% 100%; background-size:100% 100%;
margin-top:891.33rpx;
margin-left: 138rpx;
background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/jstext.png); background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/jstext.png);
} }
.yx{ .yx{
position: absolute; width: 248rpx;
width: 272rpx; height: 142rpx;
height: 170.67rpx; margin-top: 24rpx;
display: flex; display: flex;
flex-direction: column; align-items: center;
background-repeat: no-repeat; justify-content: center;
background-size:100% 100%;
margin-top:1158rpx;
margin-left: 201.67rpx;
background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/yx.png);
}
.hqjs{
width: 272rpx;
text-align: center;
height: 170.67rpx;
line-height: 170.67rpx;
color: cornsilk; color: cornsilk;
font-size: 40rpx; font-size: 40rpx;
font-weight: bold; font-weight: bold;
background-size:100% 100%;
background-image: url(https://gitee.com/lsltsl/zodiac-elf/raw/master/xzjl/index/yx.png);
} }

@ -1,9 +1,5 @@
{ {
"description": "项目配置文件", "description": "项目配置文件",
"packOptions": {
"ignore": [],
"include": []
},
"setting": { "setting": {
"bundle": false, "bundle": false,
"userConfirmedBundleSwitch": false, "userConfirmedBundleSwitch": false,
@ -24,8 +20,6 @@
"nodeModules": false, "nodeModules": false,
"enhance": true, "enhance": true,
"useMultiFrameRuntime": true, "useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"packNpmManually": false, "packNpmManually": false,
"enableEngineNative": false, "enableEngineNative": false,
@ -43,12 +37,15 @@
"ignoreUploadUnusedFiles": false "ignoreUploadUnusedFiles": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.19.4",
"appid": "wxa0d7db44777041f7",
"projectname": "miniprogram-92",
"condition": {}, "condition": {},
"editorSetting": { "editorSetting": {
"tabIndent": "insertSpaces", "tabIndent": "insertSpaces",
"tabSize": 4 "tabSize": 4
} },
"libVersion": "2.19.4",
"packOptions": {
"ignore": [],
"include": []
},
"appid": "wxa0d7db44777041f7"
} }

@ -5,5 +5,17 @@
"compileHotReLoad": true, "compileHotReLoad": true,
"urlCheck": false "urlCheck": false
}, },
"condition": {} "condition": {
"miniprogram": {
"list": [
{
"name": "",
"pathName": "pages/home/me/grzl/grzl",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
}
} }
Loading…
Cancel
Save