main
Wkang921 2 years ago
parent 379b369e1c
commit f0ba491683

@ -154,20 +154,30 @@ Page({
},
// 注入晶石
btnInject(){
this.setData({
showInject:!this.data.showInject,
showInEnergy:!this.data.showInEnergy
})
req.patchRequest('/api/user/curt/inject-energy-to-pendant',{}).then((res)=>{
console.log('能量注入成功');
})
setTimeout(()=>{
// 判断是否有能量
if (this.data.userInfo.crystallineEnergy) {
this.setData({
showInEnergy:!this.data.showInEnergy,
showScsEnergy:true
showInject:!this.data.showInject,
showInEnergy:!this.data.showInEnergy
})
this.getUserInfo()
},2000)
req.patchRequest('/api/user/curt/inject-energy-to-pendant',{}).then((res)=>{
console.log('能量注入成功');
})
setTimeout(()=>{
this.setData({
showInEnergy:!this.data.showInEnergy,
showScsEnergy:true
})
this.getUserInfo()
},2000)
}else{
this.setData({showInject: false})
Toast({
context: this,
selector: '#t-toast',
message: '能量不足',
});
}
},
// 关闭注入弹层
closeEnergy(){this.setData({showScsEnergy:false})},

@ -252,9 +252,9 @@
</view>
</view>
<!-- 能量注入 -->
<t-toast id="t-toast" />
<view class="pray" wx:if="{{showInject}}">
<view class="dialog">
<t-toast id="t-toast" />
<view class="dialog-text">
<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/tx3.png',
],
sexs:[{label:'男生',value:'male'},{label:'女生',value:'female'}],
sexVisible:false,
note:'',
cVisible:false,
userInfo:{}
userInfo:{},
endDate:new Date().getTime()
},
changeAvatar(e){
req.patchRequest('/api/user/curt',{avatar:e.target.dataset.img}).then((res)=>{
@ -58,7 +58,9 @@ Page({
console.log('11111')
},
changeDate(e) {/**修改日期 */
console.log(e);
const { value } = e.detail;
console.log(value);
const format = (val) => {
const date = new Date(val);
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
@ -67,7 +69,8 @@ Page({
this.setData({
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){
this.setData({userInfo:res.data.data})
wx.showToast({
@ -75,6 +78,7 @@ Page({
icon: 'none',
duration: 1000
})
this.getUserInfo()
}
}).catch((err)=>{
console.log(err);
@ -85,20 +89,20 @@ Page({
console.log('修改性别')
},
doChangeName1(e){
console.log(e)
console.log(e.detail.value)
req.patchRequest('/api/user/curt',{nick:e.detail.value}).then((res)=>{
if(res.data.code==200){
this.setData({userInfo:res.data.data})
wx.showToast({
title:'修改成功',
icon: 'none',
duration: 1000
})
}
}).catch((err)=>{
console.log(err);
})
if (e.detail.value !== this.data.userInfo.nick) {
req.patchRequest('/api/user/curt',{nick:e.detail.value}).then((res)=>{
if(res.data.code==200){
this.setData({userInfo:res.data.data})
wx.showToast({
title:'修改成功',
icon: 'none',
duration: 1000
})
}
}).catch((err)=>{
console.log(err);
})
}
},
getUserInfo(){
req.getRequest('/api/user/curt',{}).then((res)=>{

@ -3,6 +3,7 @@
"t-input": "tdesign-miniprogram/input/input",
"t-calendar": "tdesign-miniprogram/calendar/calendar",
"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,40 +1,67 @@
<!--pages/home/me/grzl/grzl.wxml-->
<!--返回图标-->
<view class="reback" bindtap="go2Reback"></view>
<view class="title">修改资料</view>
<image class="avatar1" src="{{userInfo.avatar}}"></image>
<view class="cameralogo"></view>
<view class="xgzl-container">
<!-- 头部返回 -->
<view class="xgzl-header">
<view class="reback" bindtap="go2Reback"></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>
<input focus="doChangeName1" class="nickname" name="nick" placeholder="昵称不能为空" maxlength="7" value="{{userInfo.nick}}" bindblur="doChangeName1"></input>
</view>
<view class="yhtx"></view>
<!-- 精灵头像 -->
<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 bindsubmit="go2UpdateUserInfo">
<!-- <form bindsubmit="go2UpdateUserInfo"></form> -->
</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="xbtxt" bindtap="changeSex">{{userInfo.spriteType=='male'?'男生':'女生'}}</view>
</view>
<view class="data-item">
<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>
<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="ssxz">{{userInfo.horoscope.name}}</view>
<view class="srtxt" bindtap="handleCalendar">{{userInfo.horoscope.date}}</view><!--生日-->
<t-calendar visible="{{cVisible}}" bind:confirm="changeDate" />
<!-- <t-calendar visible="{{cVisible}}" bind:confirm="changeDate" minDate="{{minDate}}" maxDate="{{maxDate}}"/> -->
<t-picker
visible="{{sexVisible}}"
value="{{cityValue}}"
data-key="city"
title="选择性别"
cancelBtn="取消"
confirmBtn="确认"
bindchange="onPickerChange"
bindpick="onColumnChange"
bindcancel="onPickerCancel"
>
<t-picker-item options="{{sexs}}" />
</t-picker>
<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
visible="{{sexVisible}}"
value="{{cityValue}}"
data-key="city"
title="选择性别"
cancelBtn="取消"
confirmBtn="确认"
bind:confirm="onColumnChange"
>
<t-picker-item options="{{sexs}}" />
</t-picker>
<view class="txcheck" >
<view wx:for="{{avatars}}" class="itemxx"><image class="iii" src="{{item}}" data-img="{{item}}" bindtap="changeAvatar"></image></view>
</view>

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

@ -536,14 +536,14 @@ font-family: SourceHanSansSC-regular;
padding-top: 110rpx ;
box-sizing: border-box;
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 {
width: 404rpx;
height: 404rpx;
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;
}

@ -31,6 +31,7 @@ Page({
btn1:true,
btn2:false,
btn3:false,
btn4:false,
showSoundImg:true
},
writeLetters(){
@ -41,6 +42,15 @@ Page({
Preview: false
})
},
leavetext(){
console.log('离开了');
if (this.data.img !== '' || this.data.duration !== '') {
this.setData({
showImg: true,
showLtqp: true
})
}
},
already(){
console.log('确定寄出');
this.setData({showAlready:true})
@ -86,7 +96,11 @@ Page({
},
ClearYl(){
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(){
console.log('返回');
@ -141,14 +155,15 @@ Page({
})
// 判断语音条数大于3条
if(audio.length >= 3){
this.setData({showSoundMore:true})
this.setData({showSoundMore:true, showSoundImg:true})
}else {
list.push({
type: 'audio',
resourceId: data.data.id,
})
this.setData({
messageList: list
messageList: list,
showSoundImg: true
})
}
console.log(this.data.messageList);
@ -168,25 +183,6 @@ Page({
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) {
console.log('上传失败');
}
@ -197,7 +193,20 @@ Page({
this.setData({showSound:true})
},
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(){
console.log('开始录音');
@ -242,32 +251,44 @@ Page({
this.setData({soundTime: time})
},
endSound(){
console.log('暂停录音');
wx.getRecorderManager().pause()
console.log('结束录音');
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)
this.setData({btn2:false, btn3:true, showSoundImg:true})
},
playVoice(){
console.log('继续录音');
wx.getRecorderManager().resume()
this.data.timeOut = setInterval(this.counter,50)
this.setData({btn2:true, btn3:false, showSoundImg:false})
console.log('播放录音');
this.data.innerAudioContext.play()
this.setData({btn3: false ,btn4: true})
},
stopVoice(){
console.log('停止播放录音');
this.data.innerAudioContext.stop()
this.setData({btn3: true ,btn4: false})
},
addSound(){
console.log('添加录音');
console.log(this.data.soundTime);
this.setData({duration: this.data.soundTime})
wx.getRecorderManager().stop()
// 上传语音
this.uploadFile(this.data.videoSrc,'audio')
clearInterval(this.data.timeOut)
// 监听结束录音
wx.getRecorderManager().onStop((res) => {
console.log(res);
this.uploadFile(res.tempFilePath,'audio')
})
this.setData({
btn1:true,
btn2:false,
btn3:false,
btn4:false,
showLtqp: true,
minute:0,
second:0,
@ -275,16 +296,6 @@ Page({
soundTime:'00:00:00'
})
},
// delSound(){
// console.log('不添加该条语音');
// this.setData({
// sound:'',
// btn1:true,
// btn2:false,
// btn3:false,
// soundTime:'00:00:00'
// })
// },
logout(){
req.deleteRequest('/api/user/logout',{}).then((res)=>{
if(res.data.code===200){
@ -295,21 +306,18 @@ Page({
title:'寄出成功'
})
}
})
})
// wx.showToast({
// title: 'ok了',
// })
},
modify(){
this.setData({showAlready: false, showSend: false})
},
getLetter(){
console.log('获取当前用户信札内容');
req.getRequest('/api/user/curt/letter',{}).then(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 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 class="{{Preview ? 'xinfo-ltqp-yl' : 'xinfo-ltqp'}}" wx:if="{{showLtqp}}">
<image src="https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/ltqp.png"></image>
@ -67,10 +67,13 @@
<view class="btn-being"></view>
</view>
<view class="btn1" wx:if="{{btn2}}" bindtap="endSound">
<view class="btn-over"></view>
<view class="btn-have"></view>
</view>
<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>
@ -107,7 +110,7 @@
<view class="already-text2">点击OK回到未激活初始页面</view>
<view class="already-text2">如果误打开信件,需要再次寄出哦!</view>
<view class="already-btn">
<view class="btn">修改</view>
<view class="btn" bindtap="modify">修改</view>
<view class="btn" bindtap="logout">OK</view>
</view>
</view>

@ -423,9 +423,9 @@
}
.btn-being {
width: 60rpx;
height: 60rpx;
border-radius: 5px;
width: 90rpx;
height: 90rpx;
border-radius: 50%;
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;
}
.btn-audition {
.btn-video {
width: 60rpx;
height: 60rpx;
background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/semiDesign-semi-icons-pause%20Copy%401x.png);
background-size: contain;
}
.btn-have {
width: 60rpx;
height: 60rpx;
border-radius: 10rpx;
background-color: #F8632A;
background-size: contain;
}
.taost-box-text {
width: 100%;
display: flex;
@ -561,4 +569,5 @@
justify-content: center;
align-items: center;
color: #fff;
z-index: 999;
}

@ -31,6 +31,7 @@ Page({
btn1:true,
btn2:false,
btn3:false,
btn4:false,
showSoundImg:true
},
writeLetters(){
@ -95,7 +96,11 @@ Page({
},
ClearYl(){
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(){
console.log('返回');
@ -178,25 +183,6 @@ Page({
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) {
console.log('上传失败');
}
@ -207,7 +193,20 @@ Page({
this.setData({showSound:true})
},
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(){
console.log('开始录音');
@ -252,32 +251,44 @@ Page({
this.setData({soundTime: time})
},
endSound(){
console.log('暂停录音');
wx.getRecorderManager().pause()
console.log('结束录音');
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)
this.setData({btn2:false, btn3:true, showSoundImg:true})
},
playVoice(){
console.log('继续录音');
wx.getRecorderManager().resume()
this.data.timeOut = setInterval(this.counter,50)
this.setData({btn2:true, btn3:false, showSoundImg:false})
console.log('播放录音');
this.data.innerAudioContext.play()
this.setData({btn3: false ,btn4: true})
},
stopVoice(){
console.log('停止播放录音');
this.data.innerAudioContext.stop()
this.setData({btn3: true ,btn4: false})
},
addSound(){
console.log('添加录音');
console.log(this.data.soundTime);
this.setData({duration: this.data.soundTime})
wx.getRecorderManager().stop()
// 上传语音
this.uploadFile(this.data.videoSrc,'audio')
clearInterval(this.data.timeOut)
// 监听结束录音
wx.getRecorderManager().onStop((res) => {
console.log(res);
this.uploadFile(res.tempFilePath,'audio')
})
this.setData({
btn1:true,
btn2:false,
btn3:false,
btn4:false,
showLtqp: true,
minute:0,
second:0,
@ -285,16 +296,6 @@ Page({
soundTime:'00:00:00'
})
},
// delSound(){
// console.log('不添加该条语音');
// this.setData({
// sound:'',
// btn1:true,
// btn2:false,
// btn3:false,
// soundTime:'00:00:00'
// })
// },
logout(){
req.deleteRequest('/api/user/logout',{}).then((res)=>{
if(res.data.code===200){
@ -317,15 +318,6 @@ Page({
console.log('获取当前用户信札内容');
req.getRequest('/api/user/curt/letter',{}).then(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>
<view class="btn1" wx:if="{{btn2}}" bindtap="endSound">
<view class="btn-over"></view>
<view class="btn-have"></view>
</view>
<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>

@ -423,9 +423,9 @@
}
.btn-being {
width: 60rpx;
height: 60rpx;
border-radius: 5px;
width: 90rpx;
height: 90rpx;
border-radius: 50%;
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;
}
.btn-audition {
.btn-video {
width: 60rpx;
height: 60rpx;
background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/semiDesign-semi-icons-pause%20Copy%401x.png);
background-size: contain;
}
.btn-have {
width: 60rpx;
height: 60rpx;
border-radius: 10rpx;
background-color: #F8632A;
background-size: contain;
}
.taost-box-text {
width: 100%;
display: flex;

@ -17,7 +17,7 @@
<view class="nlj" wx:if="{{xyNfc}}">能量 +{{userInfo.pendantEnergy}}%</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="ztys">{{userInfo.horoscope.summary}}</view>

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

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

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

@ -1,19 +1,25 @@
/* pages/index/index.wxss */
.bd {
position: absolute;
width: 100%;
height: 100%;
padding: 88rpx 40rpx 0 40rpx;
box-sizing: border-box;
}
.bg{
position: absolute;
width: 750rpx;
height: 1419rpx;
width: 100%;
height: 100%;
box-sizing: border-box;
display: flex;
flex-direction: column;
margin-top: 112.67rpx;
margin-left: 37.33rpx;
align-items: center;
background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xy/bkg.png);
background-repeat: no-repeat;
background-size: 675.34rpx 100%;
background-size: contain;
}
.quest{
position: absolute;
width: 50rpx;
height: 50rpx;
display: flex;
@ -24,89 +30,68 @@
}
.alb{
position: absolute;
width: 432rpx;
height: 192.67rpx;
display: flex;
flex-direction: column;
height: 192rpx;
margin-top: 258rpx;
background-repeat: no-repeat;
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);
}
.qr{
position: absolute;
width: 150.67rpx;
height: 150.67rpx;
width: 152rpx;
height: 152rpx;
margin-top: 100rpx;
display: flex;
flex-direction: column;
background-repeat: no-repeat;
align-items: center;
justify-content: center;
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);
}
.js{
position: absolute;
width: 115.33rpx;
height: 173.33rpx;
display: flex;
flex-direction: column;
background-repeat: no-repeat;
width: 114rpx;
height: 172rpx;
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);
}
.yw{
position: absolute;
width: 399.33rpx;
height: 53.33rpx;
width: 400rpx;
height: 54rpx;
margin-top: 24rpx;
display: flex;
flex-direction: column;
background-repeat: no-repeat;
align-items: center;
justify-content: center;
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);
}
.shadow {
width: 150rpx;
height: 62rpx;
background-size:100% 100%;
background-image: url(https://wk921-1316969570.cos.ap-nanjing.myqcloud.com/xy/shadow.png);
}
.jstext{
position: absolute;
width: 399.33rpx;
height: 216rpx;
display: flex;
flex-direction: column;
background-repeat: no-repeat;
width: 400rpx;
height: 242rpx;
margin-top: 118rpx;
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);
}
.yx{
position: absolute;
width: 272rpx;
height: 170.67rpx;
width: 248rpx;
height: 142rpx;
margin-top: 24rpx;
display: flex;
flex-direction: column;
background-repeat: no-repeat;
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;
align-items: center;
justify-content: center;
color: cornsilk;
font-size: 40rpx;
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": "项目配置文件",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"bundle": false,
"userConfirmedBundleSwitch": false,
@ -24,8 +20,6 @@
"nodeModules": false,
"enhance": true,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"showShadowRootInWxmlPanel": true,
"packNpmManually": false,
"enableEngineNative": false,
@ -43,12 +37,15 @@
"ignoreUploadUnusedFiles": false
},
"compileType": "miniprogram",
"libVersion": "2.19.4",
"appid": "wxa0d7db44777041f7",
"projectname": "miniprogram-92",
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
}
},
"libVersion": "2.19.4",
"packOptions": {
"ignore": [],
"include": []
},
"appid": "wxa0d7db44777041f7"
}

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