diff --git a/app.json b/app.json index 0a1410f..13dc3f1 100644 --- a/app.json +++ b/app.json @@ -25,7 +25,11 @@ "pages/home/xyc/tdyw/tdyw", "pages/home/me/grzl/grzl", "pages/home/jl/jlai", - "pages/home/jl/jlai/jlai" + "pages/home/jl/jlai/jlai", + "pages/home/xx/hy/index", + "pages/home/xx/hy/hx/hx", + "pages/home/xx/hy/xz/zt", + "pages/home/xx/hy/zt/zt" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/home/jl/index.js b/pages/home/jl/index.js index 7c90418..035f0e7 100644 --- a/pages/home/jl/index.js +++ b/pages/home/jl/index.js @@ -1,11 +1,93 @@ // pages/home/jl/index.js +const app = getApp();//新建页面时 默认引入 +const req = app.xzjlReq();//初始化一个的request() 实例 Page({ /** * 页面的初始数据 */ data: { - + singleShow:false, + loverShow:false, + xingxiangtu:{}, + userInfo:{}, + loverInfo:{}, + showSexLogo:false,//不展示形象修改按钮 + }, + ShowOrNotLogoS(){ + this.setData({singleShow:!this.data.singleShow}) + }, + ShowOrNotLogoL(){ + this.setData({loverShow:!this.data.loverShow}) + }, + doSetXxtAnimal(){ + this.doSetXxt('animal') + }, + doSetXxtMale(){ + this.doSetXxt('male') + }, + doSetXxtFemale(){ + this.doSetXxt('female') + }, + doSetXxt(e){ + req.patchRequest('/api/user/curt',{spriteType:e}).then((res)=>{ + if(res.data.code==200){ + } + this.getUserInfo() + }).catch((err)=>{ + console.log(err); + }) + }, + doSetXxtAnimalS(){ + this.doSetXxtS('animal') + }, + doSetXxtMaleS(){ + this.doSetXxtS('male') + }, + doSetXxtFemaleS(){ + this.doSetXxtS('female') + }, + doSetXxtS(e){ + req.patchRequest('/api/user/curt/lover',{spriteType:e}).then((res)=>{ + if(res.data.code==200){ + } + this.getUserLoverInfo() + }).catch((err)=>{ + console.log(err); + }) + }, + getXxObj(){/**获取形象对应的图片 */ + req.getRequest('/api/dict/values/sprite-type',{}).then((res)=>{ + if(res.data.code==200){ + this.setData({xingxiangtu:res.data.data}) + } + console.log(this.data.xingxiangtu); + }).catch((err)=>{ + console.log(err); + }) + }, + ShowOrNotLogo(){ + this.setData({showSexLogo:!this.data.showSexLogo}) + }, + getUserLoverInfo(){ + req.getRequest('/api/user/curt/lover',{}).then((res)=>{ + if(res.data.code==200){ + this.setData({loverInfo:res.data.data}) + } + console.log(this.userInfo); + }).catch((err)=>{ + console.log(err); + }) + }, + getUserInfo(){ + req.getRequest('/api/user/curt',{}).then((res)=>{ + if(res.data.code==200){ + this.setData({userInfo:res.data.data}) + } + console.log(this.userInfo); + }).catch((err)=>{ + console.log(err); + }) }, go2Jlai(){ wx.navigateTo({ @@ -18,7 +100,9 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - + this.getUserInfo() + this.getUserLoverInfo() + this.getXxObj() }, /** diff --git a/pages/home/jl/index.json b/pages/home/jl/index.json index 8ed80a2..ebd120c 100644 --- a/pages/home/jl/index.json +++ b/pages/home/jl/index.json @@ -2,6 +2,7 @@ "usingComponents": { "t-progress": "tdesign-miniprogram/progress/progress", "t-popup": "tdesign-miniprogram/popup/popup", - "t-rate": "tdesign-miniprogram/rate/rate" + "t-rate": "tdesign-miniprogram/rate/rate", + "t-image": "tdesign-miniprogram/image/image" } } \ No newline at end of file diff --git a/pages/home/jl/index.wxml b/pages/home/jl/index.wxml index 15873e9..a6f6741 100644 --- a/pages/home/jl/index.wxml +++ b/pages/home/jl/index.wxml @@ -1,20 +1,21 @@ +    - - 为七个字的头像 + + {{userInfo.nick}}
- - + + - + - + @@ -37,36 +38,35 @@    - - 七个字的头像 + + {{userInfo.nick}} - - 为七个字的头像 + + {{loverInfo.nick}}
- - - + + - + - + - - + + - + - + - + @@ -88,34 +88,34 @@ - - 为七个字的头像 + + {{loverInfo.nick}}
- + -
- -
+
{{loverInfo.horoscope.number}}
幸运数字
Ta的运势
幸运颜色
-
+
{{loverInfo.horoscope.color}}
- + Tips:记得提醒ta哦~ + {{loverInfo.horoscope.summary}} +
diff --git a/pages/home/jl/index.wxss b/pages/home/jl/index.wxss index 9a0b0e7..4453e2b 100644 --- a/pages/home/jl/index.wxss +++ b/pages/home/jl/index.wxss @@ -125,8 +125,10 @@ margin: 0; padding: 0; width:750rpx; - height:1624rpx; + height:1624rpx!important; overflow: hidden; + padding: 0!important; + margin: 0!important; } .call1{ @@ -207,13 +209,14 @@ .txtextl{ position:absolute; - width:772rpx; + width:166rpx; height:72rpx; line-height:72rpx; color: #9a9a9a; margin-top:142.67rpx; margin-left:36rpx; font-size: 27rpx; + text-align: right; } .jiuchan{ position: absolute; @@ -435,6 +438,11 @@ background-size:100% 100%; background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/jl/circle.png); + +color: rgba(248, 99, 42, 1); +font-size: 36px; +font-family: SourceHanSansSC-regular; + } .k2{ @@ -460,6 +468,8 @@ background-repeat: no-repeat; background-size:100% 100%; background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/jl/circle.png); + color: rgba(108, 108, 108, 1); +font-size: 16px; } @@ -517,16 +527,17 @@ .ztys{ position: absolute; - width: 542.67rpx; - height: 290rpx; display: flex; flex-direction: column; background-repeat: no-repeat; background-size:100% 100%; - left: 0; - right: 0; - margin: 84rpx auto; - background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xzt/ztys.png); + left: 46rpx; + top:98rpx; + width: 284px; +height: 159px; +line-height: 50rpx; +color: rgba(108, 108, 108, 1); +font-size: 16px; } .jkzs{ @@ -622,3 +633,26 @@ font-size: 14px; text-align: center; font-family: SourceHanSansSC-medium; } + +.tips{ + position: absolute; + left: 46rpx; +top: 36rpx; +width: 119px; +height: 18px; +color: rgba(248, 99, 42, 1); +font-size: 12px; +text-align: left; +font-family: SourceHanSansSC-regular; +} + +.ysfgx{ + position: absolute; + left: 90rpx; +top: 486rpx; +width: 240px; +height: 11px; +background-repeat: no-repeat; +background-size:100% 100%; +background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/jl/ysfgx.png); +} diff --git a/pages/home/jl/jlai/jlai.js b/pages/home/jl/jlai/jlai.js index 38452b0..ccfd6aa 100644 --- a/pages/home/jl/jlai/jlai.js +++ b/pages/home/jl/jlai/jlai.js @@ -1,12 +1,89 @@ // pages/home/jl/jlai/jlai.js +const app = getApp();//新建页面时 默认引入 +const req = app.xzjlReq();//初始化一个的request() 实例 Page({ /** * 页面的初始数据 */ data: { + times:0,//非会员聊天次数 + chatList:[], + ltinfo:'', + isBlank:true,//没有聊天 + userInfo:{}, + stxx:false, + }, + dovipTips(){ + wx: wx.showToast({ + title: '请购买会员或聊天次数', + icon:'none', + }) + }, + go2Member(){ + console.log('一天啊啊啊') + wx.navigateTo({ + url: '/pages/home/me/member/member' + }) + }, + doLt(e){/**点击快捷选项 */ + console.log('到此一游') + this.setData({ltinfo:e.target.dataset.lt}) - + }, + go2BB(e){/**鼠标回显事件 */ + this.setData({ltinfo:e.detail.value}) + }, + go2Send(e){/**发送消息 */ + this.setData({isBlank:false}) + if(e.target.dataset.lt==''){ + wx: wx.showToast({ + title: '聊天内容不能为空', + icon:'none', + }) + }else{ + this.setData({ + chatList:this.data.chatList.concat({'type':1,'value':e.target.dataset.lt}) + }) + let that = this + req.postRequest('/api/v1/chat-records/completions',{'content':e.target.dataset.lt}).then((res)=>{ + console.log(res) + console.log(res.data) + if(res.data.code==500){ + console.log('500状态码') + wx: wx.showToast({ + title: '获取星座精灵AI聊天消息超时', + icon:'none', + }) + } + if(res.data.code==200){ + this.setData({times:res.data.data.freeChatCount}) + console.log(res) + this.setData({ + chatList:this.data.chatList.concat({'type':2,'value':res.data.data.content}) + }) + } + console.log(this.userInfo); + }).catch((err)=>{ + console.log(err); + }) + this.setData({ltinfo:''}) + } + + }, + getUserInfo(){ + req.getRequest('/api/user/curt',{}).then((res)=>{ + if(res.data.code==200){ + this.setData({userInfo:res.data.data}) + if(!res.data.data.isChatVip){ + this.setData({times:res.data.data.freeChatCount}) + } + console.log(this.data.times) + } + console.log(this.userInfo); + }).catch((err)=>{ + console.log(err); + }) }, go2Reback(){ wx.navigateBack({ changed: true }); @@ -15,7 +92,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - + this.getUserInfo() }, /** diff --git a/pages/home/jl/jlai/jlai.json b/pages/home/jl/jlai/jlai.json index 3928faa..a420e2b 100644 --- a/pages/home/jl/jlai/jlai.json +++ b/pages/home/jl/jlai/jlai.json @@ -1,3 +1,7 @@ { - "usingComponents": {} + "usingComponents": { + "t-image": "tdesign-miniprogram/image/image", + "t-input": "tdesign-miniprogram/input/input", + "t-textarea": "tdesign-miniprogram/textarea/textarea" + } } \ No newline at end of file diff --git a/pages/home/jl/jlai/jlai.wxml b/pages/home/jl/jlai/jlai.wxml index ebf8e82..46e0abb 100644 --- a/pages/home/jl/jlai/jlai.wxml +++ b/pages/home/jl/jlai/jlai.wxml @@ -1,3 +1,61 @@ - -星座精灵AI + +星座精灵AI +免费次数剩余:{{times}}条 + + + 星座运势 + 星座占卜 + 塔罗占卜 + 情感倾诉 + 我和Ta未来会怎样 + 文字冒险游戏 + 帮我写一封情书 + + 你好,我是你的星座守护精灵。除此之外,我还可以帮你解答更多问题。快来跟我聊聊吧! + + + + + 星座运势 + 星座占卜 + 塔罗占卜 + 情感倾诉 + 我和Ta未来会怎样 + 文字冒险游戏 + 帮我写一封情书 + + 你好,我是你的星座守护精灵。除此之外,我还可以帮你解答更多问题。快来跟我聊聊吧! + + 开通会员 + 开通会员享不限次畅聊 + + + + + + + + {{item.value}} + + + + + + + + + + + + + + + + + + + + + + diff --git a/pages/home/jl/jlai/jlai.wxss b/pages/home/jl/jlai/jlai.wxss index 2238215..b231fa0 100644 --- a/pages/home/jl/jlai/jlai.wxss +++ b/pages/home/jl/jlai/jlai.wxss @@ -20,4 +20,274 @@ font-size: 32rpx; text-align: center; font-family: SourceHanSansSC-regular; +} + +.mfcs{ + position: absolute; + left: 0px; +top: 88px; +width: 375px; +height: 44px; +line-height: 88rpx; +opacity: 0.8; +background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); +text-align: center; +color: rgba(255, 255, 255, 1); +font-size: 14px; +} +.ltkjj{ + position: absolute; + left: 16px; +top: 164px; +width: 343px; +height: 382px; +line-height: 20px; +opacity: 0.9; +border-radius: 15px; +background-color: rgba(255, 255, 255, 1); +color: rgba(16, 16, 16, 1); +font-size: 14px; +text-align: center; +box-shadow: 1px 2px 6px 0px rgba(0, 0, 0, 0.2); +font-family: Arial; +} + + +.ltkjj1{ + position: absolute; + left: 16px; +top: 164px; +width: 343px; +height: 1000rpx; +line-height: 20px; +opacity: 0.9; +border-radius: 15px; +background-color: rgba(255, 255, 255, 1); +color: rgba(16, 16, 16, 1); +font-size: 14px; +text-align: center; +box-shadow: 1px 2px 6px 0px rgba(0, 0, 0, 0.2); +font-family: Arial; +} + +.ltat{ + position: absolute; + height: 50px; + line-height: 100rpx; + opacity: 0.9; + border-radius: 24px; + background: linear-gradient(222.69deg, rgba(248,99,42,1) 14.04%,rgba(249,135,89,1) 88.56%); + color: rgba(16, 16, 16, 1); + font-size: 12px; + text-align: center; + box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); + font-family: Arial; + color: rgba(255, 255, 255, 1); + font-size: 14px; + text-align: center; + font-family: SourceHanSansSC-regular; +} + +.ltxzys{ + left: 38rpx; + top: 64rpx; + width: 88px; + +} +.ltxzzb{ + left: 128px; + top: 64rpx; + width: 88px; +} + +.lttlzb{ + top: 64rpx; + width: 88px; + left:237px; +} +.ltqgqs{ + width:118px; + left:38rpx; + top:228rpx; +} +.ltwm{ + left:158px; + top:228rpx; + width:167px; +} + +.wzmxyx{ + left:38rpx; + width:137px; + top:392rpx; +} +.ltqs{ + left:172px; + width:153px; + top:392rpx; +} + +.tximg{ + position: absolute; + left: 38rpx; + top: 278px; + width: 42px; + height: 42px; + border: 3px solid rgba(161, 134, 81, 1); + background-color: coral; +} +.ltwzk{ + position: absolute; + left: 154rpx; + top: 278px; + width: 241px; + height: 72px; + color: rgba(108, 108, 108, 1); + font-size: 17px; + line-height: 43rpx; + text-align: justify; + font-family: SourceHanSansSC-regular; +} + +.ltk1{ + position: absolute; + left: 0px; +top: 722px; +width: 375px; +height: 90px; +line-height: 20px; +background-color: rgba(248, 248, 248, 1); +text-align: center; +border: 1px solid rgba(255, 0, 0, 0); +} + +.ltk1txt{ + position: absolute; + left: 16px; + top: 14rpx; + width: 265px; + height: 84rpx; + border-radius: 5px; + color: rgba(136, 136, 136, 1); + font-size: 14px; + text-align: left; + font-family: Arial; + border: 1px solid rgba(255, 0, 0, 0); +} +.t-textarea{ + margin: 0!important; + padding: 0!important; + height:84rpx; + line-height: 84rpx!important; +} +.ltk1txt1{ + width: 265px; + height: 84rpx; +} +.t-textarea__wrapper-inner{ + +} +.t-textarea__label{ + height:84rpx; + line-height: 84rpx!important; +} + +.fsan{ + position: absolute; + left: 332px; +top: 32rpx; +width: 27px; +height: 27px; +background-repeat: no-repeat; +background-size:100% 100%; +background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/jl/chatbtn.png); +} + +.addbtn{ + position: absolute; + left: 293px; +top: 30rpx; +width: 27px; +height: 27px; +background-repeat: no-repeat; +background-size:100% 100%; +background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/jl/addbtn.png); +} + +.chatbox{ + position: absolute; + top:132px; + width:750rpx; + height:1360rpx; + overflow: auto; +} + +.chatbox1{ + width:750rpx; + height:148rpx; + display: block; +} +.chattoux{ + margin-left: 32rpx; + margin-top: 32rpx; + width: 84rpx; + height: 84rpx; + display: online; +} + +.chatinfo{ + margin-left: 74px; + margin-top: -70rpx; + width: 280px; + height: 90px; + color: rgba(79, 79, 79, 1); + font-size: 17px; + text-align: justify; + font-family: SourceHanSansSC-regular; +} + +.dd1{ + width:750rpx; + height:160rpx; +} + +.kthybtn{ + position: absolute; + left: 224rpx; +top: 826rpx; +width: 120px; +height: 35px; +line-height: 70rpx; +border-radius: 10px; +background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); +color: rgba(16, 16, 16, 1); +font-size: 12px; +text-align: center; +font-family: Arial; +color: rgba(255, 255, 255, 1); +font-size: 14px; +text-align: center; +font-family: SourceHanSansSC-medium; +} + +.kthytips{ + position: absolute; +top: 448px; +width: 343px; +height: 20px; +color: rgba(108, 108, 108, 1); +font-size: 12px; +text-align: center; +font-family: SourceHanSansSC-regular; +} + +.hyhgtx{ + position: absolute; + left: 196px; +top: 371px; +width: 59.8px; +height: 66.45px; +background-repeat: no-repeat; +background-size:100% 100%; +background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/jl/hyhg.png); } \ No newline at end of file diff --git a/pages/home/me/cjwt/cjwt.wxml b/pages/home/me/cjwt/cjwt.wxml index b077891..b51fe1c 100644 --- a/pages/home/me/cjwt/cjwt.wxml +++ b/pages/home/me/cjwt/cjwt.wxml @@ -1,2 +1,5 @@ - + +跳转页面,待完善--> +跳转页面,待完善--> +跳转页面,待完善 \ No newline at end of file diff --git a/pages/home/me/gw/gw.wxml b/pages/home/me/gw/gw.wxml index efd4b69..75bbd5d 100644 --- a/pages/home/me/gw/gw.wxml +++ b/pages/home/me/gw/gw.wxml @@ -1,3 +1,4 @@ - + +跳转页面,待完善 diff --git a/pages/home/me/manual/manual.wxml b/pages/home/me/manual/manual.wxml index 0fa45ac..a65e4c6 100644 --- a/pages/home/me/manual/manual.wxml +++ b/pages/home/me/manual/manual.wxml @@ -1,3 +1,4 @@ - + +跳转页面,待完善 diff --git a/pages/home/me/sq/sq.wxml b/pages/home/me/sq/sq.wxml index f458aa9..40c9e94 100644 --- a/pages/home/me/sq/sq.wxml +++ b/pages/home/me/sq/sq.wxml @@ -1,2 +1,3 @@ - + +跳转页面,待完善 diff --git a/pages/home/me/yhsyxy/yhsyxy.wxml b/pages/home/me/yhsyxy/yhsyxy.wxml index 06ff9d2..dff7b60 100644 --- a/pages/home/me/yhsyxy/yhsyxy.wxml +++ b/pages/home/me/yhsyxy/yhsyxy.wxml @@ -1,2 +1,3 @@ - + +跳转页面,待完善 diff --git a/pages/home/me/ysxy/ysxy.wxml b/pages/home/me/ysxy/ysxy.wxml index 5c76ea3..e249f6e 100644 --- a/pages/home/me/ysxy/ysxy.wxml +++ b/pages/home/me/ysxy/ysxy.wxml @@ -1,3 +1,4 @@ - + +跳转页面,待完善 diff --git a/pages/home/xx/hy/hx/hx.js b/pages/home/xx/hy/hx/hx.js new file mode 100644 index 0000000..d9535f2 --- /dev/null +++ b/pages/home/xx/hy/hx/hx.js @@ -0,0 +1,66 @@ +// pages/home/xx/hy/hx/hx.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/home/xx/hy/hx/hx.json b/pages/home/xx/hy/hx/hx.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/home/xx/hy/hx/hx.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/home/xx/hy/hx/hx.wxml b/pages/home/xx/hy/hx/hx.wxml new file mode 100644 index 0000000..96bf465 --- /dev/null +++ b/pages/home/xx/hy/hx/hx.wxml @@ -0,0 +1,2 @@ + +pages/home/xx/hy/hx/hx.wxml diff --git a/pages/home/xx/hy/hx/hx.wxss b/pages/home/xx/hy/hx/hx.wxss new file mode 100644 index 0000000..322196e --- /dev/null +++ b/pages/home/xx/hy/hx/hx.wxss @@ -0,0 +1 @@ +/* pages/home/xx/hy/hx/hx.wxss */ \ No newline at end of file diff --git a/pages/home/xx/hy/index.js b/pages/home/xx/hy/index.js new file mode 100644 index 0000000..1295561 --- /dev/null +++ b/pages/home/xx/hy/index.js @@ -0,0 +1,66 @@ +// pages/home/xx/hy/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/home/xx/hy/index.json b/pages/home/xx/hy/index.json new file mode 100644 index 0000000..bea53a8 --- /dev/null +++ b/pages/home/xx/hy/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "t-image": "tdesign-miniprogram/image/image" + } +} \ No newline at end of file diff --git a/pages/home/xx/hy/index.wxml b/pages/home/xx/hy/index.wxml new file mode 100644 index 0000000..af89345 --- /dev/null +++ b/pages/home/xx/hy/index.wxml @@ -0,0 +1,2 @@ + +pages/home/xx/hy/index.wxml diff --git a/pages/home/xx/hy/index.wxss b/pages/home/xx/hy/index.wxss new file mode 100644 index 0000000..8b5148f --- /dev/null +++ b/pages/home/xx/hy/index.wxss @@ -0,0 +1 @@ +/* pages/home/xx/hy/index.wxss */ \ No newline at end of file diff --git a/pages/home/xx/hy/xz/zt.js b/pages/home/xx/hy/xz/zt.js new file mode 100644 index 0000000..43cc39c --- /dev/null +++ b/pages/home/xx/hy/xz/zt.js @@ -0,0 +1,66 @@ +// pages/home/xx/hy/xz/zt.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/home/xx/hy/xz/zt.json b/pages/home/xx/hy/xz/zt.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/home/xx/hy/xz/zt.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/home/xx/hy/xz/zt.wxml b/pages/home/xx/hy/xz/zt.wxml new file mode 100644 index 0000000..52fd8df --- /dev/null +++ b/pages/home/xx/hy/xz/zt.wxml @@ -0,0 +1,2 @@ + +pages/home/xx/hy/xz/zt.wxml diff --git a/pages/home/xx/hy/xz/zt.wxss b/pages/home/xx/hy/xz/zt.wxss new file mode 100644 index 0000000..406f939 --- /dev/null +++ b/pages/home/xx/hy/xz/zt.wxss @@ -0,0 +1 @@ +/* pages/home/xx/hy/xz/zt.wxss */ \ No newline at end of file diff --git a/pages/home/xx/hy/zt/zt.js b/pages/home/xx/hy/zt/zt.js new file mode 100644 index 0000000..1004423 --- /dev/null +++ b/pages/home/xx/hy/zt/zt.js @@ -0,0 +1,66 @@ +// pages/home/xx/hy/zt/zt.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/home/xx/hy/zt/zt.json b/pages/home/xx/hy/zt/zt.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/home/xx/hy/zt/zt.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/home/xx/hy/zt/zt.wxml b/pages/home/xx/hy/zt/zt.wxml new file mode 100644 index 0000000..053e55b --- /dev/null +++ b/pages/home/xx/hy/zt/zt.wxml @@ -0,0 +1,2 @@ + +pages/home/xx/hy/zt/zt.wxml diff --git a/pages/home/xx/hy/zt/zt.wxss b/pages/home/xx/hy/zt/zt.wxss new file mode 100644 index 0000000..e0284c4 --- /dev/null +++ b/pages/home/xx/hy/zt/zt.wxss @@ -0,0 +1 @@ +/* pages/home/xx/hy/zt/zt.wxss */ \ No newline at end of file diff --git a/pages/home/xx/index.js b/pages/home/xx/index.js index 4e1f9f8..1237cba 100644 --- a/pages/home/xx/index.js +++ b/pages/home/xx/index.js @@ -8,13 +8,15 @@ Page({ */ data: { hasLover:false,// 是否单身 + userInfo:{} }, doQueryInit(){ req.getRequest('/api/user/curt',{}).then((res)=>{ if(res.data.code==200){ this.setData({hasLover:res.data.data.hasLover}) - console.log(res.data.data.hasLover) + this.setData({userInfo:res.data.data}) + console.log(this.data.userInfo) } }).catch((err)=>{ console.log(err); diff --git a/pages/home/xx/index.wxml b/pages/home/xx/index.wxml index 63376d0..138a9ec 100644 --- a/pages/home/xx/index.wxml +++ b/pages/home/xx/index.wxml @@ -8,5 +8,20 @@
-111 + + + + + + + + + + 回忆 + + + + 星讯 + + diff --git a/pages/home/xx/index.wxss b/pages/home/xx/index.wxss index 8adab9d..c3690fd 100644 --- a/pages/home/xx/index.wxss +++ b/pages/home/xx/index.wxss @@ -1,5 +1,38 @@ /* pages/home/xx/index.wxss */ +/* pages/home/xyc/wdyw/wdyw.wxss */ +.reback{ + position: fixed; + margin-left: 20rpx; + margin-top:108rpx; + width:48rpx; + height:48rpx; + background-repeat: no-repeat; + background-size:100% 100%; + background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/me/reback.png); +} +.title{ + position: fixed; + left: 278rpx; + top: 108rpx; + width: 196rpx; + height: 48rpx; + color: rgba(108, 108, 108, 1); + font-size: 32rpx; + text-align: center; + font-family: SourceHanSansSC-regular; +} +.bkgfs{ + position: absolute; + left: 48px; +top: 70rpx; +width: 279px; +height: 128px; +line-height: 20px; +border-radius: 15px; +background-color: rgba(253, 190, 196, 1); +text-align: center; +} .bkg{ position: absolute; @@ -94,4 +127,61 @@ color:#9A9A9A; text-align: center; font-size: 27rpx; +} + +.hybtn{ + position: fixed; + left: 0px; +top: 104px; +width: 83px; +height: 35px; +line-height: 70rpx; +opacity: 0.7; +border-radius: 0px 10px 10px 0px; +background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); +text-align: center; +box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); +color: rgba(255, 255, 255, 1); +font-size: 14px; +text-align: center; +font-family: SourceHanSansSC-regular; +} + +.xfgjl{ + position: fixed; + left: 0px; + margin-top: 1286rpx; + width: 375px; + height: 87px; + line-height: 20px; + opacity: 0.7; + background-color: rgba(255, 255, 255, 1); + text-align: center; + background-color: aqua; +} + +.ltinfo{ + position: absolute; + background-color: brown; + width: 750rpx; + height: 2000rpx; + margin-top:200rpx; +} +.h1{ + position: fixed; + left: 0px; +width: 375px; +height: 88px; +line-height: 20px; +background-color: rgba(255, 255, 255, 1); +text-align: center; +} + +.txl{ + position: absolute; + left: 122px; + top: 30rpx; + width: 36px; + height: 36px; + background-color: burlywood; } \ No newline at end of file diff --git a/pages/home/xyc/index.js b/pages/home/xyc/index.js index b6c1f77..39c0271 100644 --- a/pages/home/xyc/index.js +++ b/pages/home/xyc/index.js @@ -9,12 +9,15 @@ Page({ * 页面的初始数据 */ data: { + xyLink:'', + xyContent:'', + imgUrl:'', fileList: [],//图片list form:{ content:"", deadline:'', link:'', - img:'111' + img:'' }, cvisible: false, @@ -40,16 +43,21 @@ Page({ this.setData({ fileList: [...fileList, ...files], // 此时设置了 fileList 之后才会展示选择的图片 }); - // files.forEach(file => this.uploadFile(file)) - wx.chooseImage({ - count: 1, // 默认9 - sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 - sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 - success: res => { - var tempFilePaths = res.tempFilePaths; - wx.uploadFile({ + files.forEach(file => this.uploadFile(file)) + }, + handleRemove(e){/**删除图片 */ + const { index } = e.detail; + const { fileList } = this.data; + + fileList.splice(index, 1); + this.setData({ + fileList, + }); + }, + uploadFile(file) {/**执行 */ + wx.uploadFile({ url: 'https://xzjl-api.windymuse.cn/api/resource', - filePath: tempFilePaths[0], + filePath: file.url, name: 'file', header: { 'Authorization': wx.getStorageSync('token'), @@ -59,8 +67,12 @@ Page({ type: 'poster' }, success: async res => { - console.log(res, '111111'); - if (res.statusCode == 200) { + 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) { @@ -77,34 +89,6 @@ Page({ showToast('图片上传失败'); } }); - } - }); - }, - handleRemove(e){/**删除图片 */ - const { index } = e.detail; - const { fileList } = this.data; - - fileList.splice(index, 1); - this.setData({ - fileList, - }); - }, - uploadFile(file) {/**执行 */ - const FormData = require('./../../../utils/formdata/index.js') - let fd = new FormData() - fd.append('type','graphic') - console.log(file) - fd.appendFile(file.name,file.url) - console.log('文件上传') - req.postRequest('/api/resource',fd.getData()).then((res)=>{ - console.log(res) - if(res.data.code==200){ - console.log('res') - } - console.log(this.userInfo); - }).catch((err)=>{ - console.log(err); - }) console.log('许愿成功!') }, go2MyYw(){ @@ -162,31 +146,53 @@ Page({ }, doFinishXy(e){/**许愿 */ - console.log('开始执行xxxx') - console.log(e.target) - console.log(e.target.dataset.fs) - this.setData({ - visible: false, - }); - let param = e.target.dataset.fs - console.log(e.target.dataset) - console.log(e.target.dataset.note) - param.deadline = e.target.dataset.note - console.log(this.note) - //api/user/curt/wish - req.postRequest('/api/user/curt/wish',param).then((res)=>{ - console.log(res) - if(res.data.code==200){ - this.setData({userInfo:res.data.data}) - if(res.data.data&&res.data.data.loverId&&res.data.data.loverId!=null){ - this.setData({single:false}) + if(!this.data.xyContent){ + wx.showToast({ + title:'许愿内容不能为空!', + icon: 'none', + duration: 5000 + }) + }else if(!this.data.note){ + wx.showToast({ + title:'期望事件不能为空!', + icon: 'none', + duration: 5000 + }) + }else if(!this.data.imgUrl){ + wx.showToast({ + title:'许愿图片不能为空!', + icon: 'none', + duration: 5000 + }) + }else{ + + //api/user/curt/wish + req.postRequest('/api/user/curt/wish',{content:this.data.xyContent,deadline:this.data.note,img:this.data.imgUrl,link:this.data.xyLink}).then((res)=>{ + console.log(res) + if(res.data.code==200){ + this.setData({ + visible: false, + }); + this.setData({userInfo:res.data.data}) + if(res.data.data&&res.data.data.loverId&&res.data.data.loverId!=null){ + this.setData({single:false}) + } + this.setData({xyContent:'',xyLink:'',note:'',imgUrl:'',fileList:[]}) + }else{ + wx.showToast({ + title:res.data.msg, + icon: 'none', + duration: 5000 + }) } - } - console.log(this.userInfo); - }).catch((err)=>{ - console.log(err); - }) - console.log('许愿成功!') + + + }).catch((err)=>{ + console.log(err); + }) + console.log('许愿成功!') + } + }, initXy(){ diff --git a/pages/home/xyc/index.wxml b/pages/home/xyc/index.wxml index e17c2ed..090f235 100644 --- a/pages/home/xyc/index.wxml +++ b/pages/home/xyc/index.wxml @@ -21,10 +21,10 @@ 期望时间 许愿链接 许愿图片 - + - + { + console.log(res) + if(res.data.code==200){ + wx.showToast({ + title:'愿望删除成功', + icon: 'none', + duration: 1000 + }) + } + }).catch((err)=>{ + console.log(err); + }) }, + doFinishWish(e){/**愿望已达成 */ + console.log(e.target.dataset.del) + console.log('愿望达成') + console.log(this.data.detail.id) + /**确定删除愿望 */ + this.setData({showDelDialog:false}) + req.patchRequest('/api/user/curt/wish/'+this.data.detail.id+"/completed",{}).then((res)=>{ + console.log(res) + if(res.data.code==200){ + wx.showToast({ + title:'愿望达成成功', + icon: 'none', + duration: 1000 + }) + }else{ + wx.showToast({ + title:res.data.msg, + icon: 'none', + duration: 1000 + }) + } + }).catch((err)=>{ + console.log(err); + }) + }, + go2WishDetail(e){/**查看愿望详情 */ + this.setData({visible:true,detail:e.target.dataset.wish}) + this.setData({detail:e.target.dataset.wish}) + }, + onVisibleChange(e) { + this.setData({ + visible: e.detail.visible, + }); + }, + changeVisible(){ + this.setData({visible:false}) + }, go2Reback(){ wx.navigateBack({ changed: true }); }, + getMyWish(){ + req.getRequest('/api/user/curt/wish/lover',{}).then((res)=>{ + console.log(res) + if(res.data.code==200){ + this.setData({wishes:res.data.data.records}) + } + }).catch((err)=>{ + console.log(err); + }) + }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + this.getMyWish() }, /** diff --git a/pages/home/xyc/tdyw/tdyw.json b/pages/home/xyc/tdyw/tdyw.json index 3928faa..b11bd4d 100644 --- a/pages/home/xyc/tdyw/tdyw.json +++ b/pages/home/xyc/tdyw/tdyw.json @@ -1,3 +1,7 @@ { - "usingComponents": {} + "usingComponents": { + "t-image": "tdesign-miniprogram/image/image", + "t-popup": "tdesign-miniprogram/popup/popup", + "t-dialog": "tdesign-miniprogram/dialog/dialog" + } } \ No newline at end of file diff --git a/pages/home/xyc/tdyw/tdyw.wxml b/pages/home/xyc/tdyw/tdyw.wxml index 329944f..3a89581 100644 --- a/pages/home/xyc/tdyw/tdyw.wxml +++ b/pages/home/xyc/tdyw/tdyw.wxml @@ -1,4 +1,103 @@ - + -Ta的愿望 +我的愿望 + + + + + + + + + + + {{item.content}} + 期望时间:{{item.deadline}} + + + + 进行中 + 已完成 + 已过期 + + + + + + + + + + + + + 愿望 + {{detail.content}} + 期望时间 + {{detail.deadline}} + + + + + + 删除 + + + + + 修改 + + + + + 已达成 + + + + + 分享 + + + + + + + 删除 + + + + + 分享 + + + + + + + 删除 + + + + + 修改 + + + + + + + + + + + diff --git a/pages/home/xyc/tdyw/tdyw.wxss b/pages/home/xyc/tdyw/tdyw.wxss index 26db95b..8cb305e 100644 --- a/pages/home/xyc/tdyw/tdyw.wxss +++ b/pages/home/xyc/tdyw/tdyw.wxss @@ -1,4 +1,4 @@ -/* pages/home/xyc/tdyw/tdyw.wxss */ +/* pages/home/xyc/wdyw/wdyw.wxss */ .reback{ position: absolute; margin-left: 20rpx; @@ -20,4 +20,275 @@ font-size: 32rpx; text-align: center; font-family: SourceHanSansSC-regular; +} + +.ywbjt1{ + position: absolute; + left: -22px; +top: 140px; +width: 421px; +height: 584px; +background-repeat: no-repeat; +background-size:100% 100%; +background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xyc/bg111.png); +} + +.xycbg2{ + position: absolute; + left: -14px; + top: 342px; + width: 399px; + height: 341px; + background-repeat: no-repeat; + background-size:100% 100%; + background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xyc/xycbg2.png); +} + +.wishbox{ + position: absolute; + width:750rpx; + top:190rpx; + height:1300rpx; +} + +.xycbg3{ + position: absolute; + left: -24px; +top: 116px; +width: 440px; +height: 635px; +background-repeat: no-repeat; +background-size:100% 100%; +background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xyc/xycbg3.png); +} + +.boxitem{ + margin-left: 16px; + top: 104px; + width: 343px; + height: 94px; + line-height: 20px; + border-radius: 10px; + background-color: rgba(255, 255, 255, 1); + text-align: center; + box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.4); + margin-bottom: 30rpx; +} + +.boximg{ + float: left; + margin-left: 32rpx; + padding-top: 39rpx; + width: 55px; + height: 55px; +} + + + +.boxtitle{ + float:initial; + margin-left: 174rpx; + padding-top: 58rpx; + width: 180px; + height: 20px; + color: rgba(108, 108, 108, 1); + font-size: 30rpx; + text-align: left; + font-weight: 700; + overflow:hidden; + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow:ellipsis; +} + +.qwsjbox{ + float:initial; + margin-left: 174rpx; +top: 153px; +width: 143px; +height: 17px; +color: rgba(108, 108, 108, 1); +font-size: 12px; +text-align: left; +font-family: SourceHanSansSC-regular; +} + +.wczt{ + float:initial; + margin-left: 295px; + margin-top: -75rpx; + width: 36px; + height: 17px; + color: rgba(108, 108, 108, 1); + font-size: 12px; + text-align: left; + font-family: SourceHanSansSC-regular; +} + +.logosta{ + float:initial; + margin-left: 289px; + margin-top: -100rpx; + width: 34px; + height: 34px; +} + +.logostajxz{ + float:initial; + margin-left: 283px; + margin-top: -130rpx; + width: 60px; + height: 60px; +} +.all{ + width:750rpx; + height:1624rpx; +} +.wishdetail{ + position: absolute; + width:750rpx; + height:1624rpx; +} +.popbox{ + position: absolute; + left: 33px; + top: 83px; + width: 310px; + height: 540px; + background-repeat: no-repeat; + background-size:100% 100%; + background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xyc/detailbkg.png); +} + +.yximg{ + position: absolute; + left: 73px; + top: 165px; + width: 230px; + height: 154px; + border-radius: 10px; + background-color: #767686; +} +.ywwz{ + position: absolute; + left: 164px; +top: 353px; +width: 48px; +height: 33px; +color: rgba(248, 99, 42, 1); +font-size: 24px; +text-align: left; +font-family: SourceHanSansSC-bold; +} + +.ywxq{ + position: absolute; + left: 91px; +top: 399px; +width: 194px; +height: 150rpx; +color: rgba(108, 108, 108, 1); +font-size: 18px; +text-align: center; +font-family: SourceHanSansSC-regular; +} +.qwsj{ + position: absolute; + left: 140px; +top: 490px; +width: 96px; +height: 33px; +color: rgba(248, 99, 42, 1); +font-size: 24px; +text-align: center; +font-family: SourceHanSansSC-regular; +} +.qwsjtxt{ + position: absolute; + left: 125px; +top: 536px; +width: 127px; +height: 25px; +color: rgba(108, 108, 108, 1); +font-size: 18px; +text-align: center; +font-family: SourceHanSansSC-regular; +} + +.yqq{/*圆圈*/ + border-radius: 64rpx; + position: absolute; + width: 60px; + height:60px; + line-height: 120rpx; + background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); + color: rgba(16, 16, 16, 1); + font-size: 12px; + text-align: center; + box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); + font-family: Arial; + border: 3px solid rgba(255, 255, 255, 1); +} + +.sc{ + border-radius: 64rpx; + position: absolute; + left: 21px; +top: 644px; +width: 60px; +height: 60px; +background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); +color: rgba(16, 16, 16, 1); +font-size: 12px; +text-align: center; +box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); +font-family: Arial; +border: 3px solid rgba(255, 255, 255, 1); +} + +.ywcczk{ + position: absolute; + height:192rpx; + top:1290rpx; + width:750rpx; +} + +.anwz1{ + position: absolute; + width:120rpx; + height: 192rpx; +} +.anwztxt1{ + position: absolute; + width:120rpx; + top: 140rpx; + height: 26px; + color: rgba(108, 108, 108, 1); + font-size: 18px; + text-align: center; + font-family: SourceHanSansSC-regular; +} +.anzmlogo1{ + position: absolute; + margin: 21rpx; + width: 42px; + height: 42px; +} +.sc1{ + margin-left: 42rpx; +} +.xg1{ + margin-left: 112px; +} +.wc1{ + margin-left: 203px; +} +.fx1{ + margin-left: 294px; +} +.sc2{ + margin-left: 112px; +} +.fx2{ + margin-left: 203px; } \ No newline at end of file diff --git a/pages/home/xyc/wdyw/wdyw.js b/pages/home/xyc/wdyw/wdyw.js index 0a61e35..0f2ab2b 100644 --- a/pages/home/xyc/wdyw/wdyw.js +++ b/pages/home/xyc/wdyw/wdyw.js @@ -1,21 +1,99 @@ // pages/home/xyc/wdyw/wdyw.js +const app = getApp();//新建页面时 默认引入 +const req = app.xzjlReq();//初始化一个的request() 实例 Page({ /** * 页面的初始数据 */ data: { - + showDelDialog:false, + detail:{}, + visible:false, + rrs:[{"lastModifiedDate":"2023-03-29T14:49:58.000+08:00","createdAt":"2023-03-14T15:44:16.000+08:00","id":1,"userid":1,"link":"http://www.baidu.com","img":"http://oss.wish.ydxxkj.top/resource/24130a65-ec5e-4c48-86d1-e964859f8532-1680072583657.jpg","content":"我希望明年去富士山下的樱花.","status":"processing","deadline":"2024-04-16"},{"lastModifiedDate":"2023-03-29T14:49:58.000+08:00","createdAt":"2023-03-14T15:44:16.000+08:00","id":1,"userid":1,"link":"http://www.baidu.com","img":"http://oss.wish.ydxxkj.top/resource/24130a65-ec5e-4c48-86d1-e964859f8532-1680072583657.jpg","content":"我希望明年去富士山下的樱花.","status":"completed","deadline":"2024-04-16"},{"lastModifiedDate":"2023-03-29T14:49:58.000+08:00","createdAt":"2023-03-14T15:44:16.000+08:00","id":1,"userid":1,"link":"http://www.baidu.com","img":"http://oss.wish.ydxxkj.top/resource/24130a65-ec5e-4c48-86d1-e964859f8532-1680072583657.jpg","content":"我希望明年去富士山下的樱花.","status":"expired","deadline":"2024-04-16"}], + wishes:[] + }, + go2DelDialog(){ + this.setData({showDelDialog:true}) + }, + closeDelDialog(){ + this.setData({showDelDialog:false}) + }, + confirmDelDialog(e){ + console.log(e.target.dataset.del) + console.log('确定删除') + console.log(this.data.detail.id) + /**确定删除愿望 */ + this.setData({showDelDialog:false}) + req.deleteRequest('/api/user/curt/wish/'+this.data.detail.id,{}).then((res)=>{ + console.log(res) + if(res.data.code==200){ + wx.showToast({ + title:'愿望删除成功', + icon: 'none', + duration: 1000 + }) + } + }).catch((err)=>{ + console.log(err); + }) }, + doFinishWish(e){/**愿望已达成 */ + console.log(e.target.dataset.del) + console.log('愿望达成') + console.log(this.data.detail.id) + /**确定删除愿望 */ + this.setData({showDelDialog:false}) + req.patchRequest('/api/user/curt/wish/'+this.data.detail.id+"/completed",{}).then((res)=>{ + console.log(res) + if(res.data.code==200){ + wx.showToast({ + title:'愿望达成成功', + icon: 'none', + duration: 1000 + }) + }else{ + wx.showToast({ + title:res.data.msg, + icon: 'none', + duration: 1000 + }) + } + }).catch((err)=>{ + console.log(err); + }) + }, + go2WishDetail(e){/**查看愿望详情 */ + this.setData({visible:true,detail:e.target.dataset.wish}) + this.setData({detail:e.target.dataset.wish}) + }, + onVisibleChange(e) { + this.setData({ + visible: e.detail.visible, + }); + }, + changeVisible(){ + this.setData({visible:false}) + }, go2Reback(){ wx.navigateBack({ changed: true }); }, + getMyWish(){ + req.getRequest('/api/user/curt/wish',{}).then((res)=>{ + console.log(res) + if(res.data.code==200){ + this.setData({wishes:res.data.data.records}) + } + }).catch((err)=>{ + console.log(err); + }) + }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + this.getMyWish() }, /** diff --git a/pages/home/xyc/wdyw/wdyw.json b/pages/home/xyc/wdyw/wdyw.json index 3928faa..b11bd4d 100644 --- a/pages/home/xyc/wdyw/wdyw.json +++ b/pages/home/xyc/wdyw/wdyw.json @@ -1,3 +1,7 @@ { - "usingComponents": {} + "usingComponents": { + "t-image": "tdesign-miniprogram/image/image", + "t-popup": "tdesign-miniprogram/popup/popup", + "t-dialog": "tdesign-miniprogram/dialog/dialog" + } } \ No newline at end of file diff --git a/pages/home/xyc/wdyw/wdyw.wxml b/pages/home/xyc/wdyw/wdyw.wxml index 12f0e68..3a89581 100644 --- a/pages/home/xyc/wdyw/wdyw.wxml +++ b/pages/home/xyc/wdyw/wdyw.wxml @@ -2,3 +2,102 @@ 我的愿望 + + + + + + + + + + + {{item.content}} + 期望时间:{{item.deadline}} + + + + 进行中 + 已完成 + 已过期 + + + + + + + + + + + + + 愿望 + {{detail.content}} + 期望时间 + {{detail.deadline}} + + + + + + 删除 + + + + + 修改 + + + + + 已达成 + + + + + 分享 + + + + + + + 删除 + + + + + 分享 + + + + + + + 删除 + + + + + 修改 + + + + + + + + + + + diff --git a/pages/home/xyc/wdyw/wdyw.wxss b/pages/home/xyc/wdyw/wdyw.wxss index 2a57683..8cb305e 100644 --- a/pages/home/xyc/wdyw/wdyw.wxss +++ b/pages/home/xyc/wdyw/wdyw.wxss @@ -20,4 +20,275 @@ font-size: 32rpx; text-align: center; font-family: SourceHanSansSC-regular; +} + +.ywbjt1{ + position: absolute; + left: -22px; +top: 140px; +width: 421px; +height: 584px; +background-repeat: no-repeat; +background-size:100% 100%; +background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xyc/bg111.png); +} + +.xycbg2{ + position: absolute; + left: -14px; + top: 342px; + width: 399px; + height: 341px; + background-repeat: no-repeat; + background-size:100% 100%; + background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xyc/xycbg2.png); +} + +.wishbox{ + position: absolute; + width:750rpx; + top:190rpx; + height:1300rpx; +} + +.xycbg3{ + position: absolute; + left: -24px; +top: 116px; +width: 440px; +height: 635px; +background-repeat: no-repeat; +background-size:100% 100%; +background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xyc/xycbg3.png); +} + +.boxitem{ + margin-left: 16px; + top: 104px; + width: 343px; + height: 94px; + line-height: 20px; + border-radius: 10px; + background-color: rgba(255, 255, 255, 1); + text-align: center; + box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.4); + margin-bottom: 30rpx; +} + +.boximg{ + float: left; + margin-left: 32rpx; + padding-top: 39rpx; + width: 55px; + height: 55px; +} + + + +.boxtitle{ + float:initial; + margin-left: 174rpx; + padding-top: 58rpx; + width: 180px; + height: 20px; + color: rgba(108, 108, 108, 1); + font-size: 30rpx; + text-align: left; + font-weight: 700; + overflow:hidden; + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow:ellipsis; +} + +.qwsjbox{ + float:initial; + margin-left: 174rpx; +top: 153px; +width: 143px; +height: 17px; +color: rgba(108, 108, 108, 1); +font-size: 12px; +text-align: left; +font-family: SourceHanSansSC-regular; +} + +.wczt{ + float:initial; + margin-left: 295px; + margin-top: -75rpx; + width: 36px; + height: 17px; + color: rgba(108, 108, 108, 1); + font-size: 12px; + text-align: left; + font-family: SourceHanSansSC-regular; +} + +.logosta{ + float:initial; + margin-left: 289px; + margin-top: -100rpx; + width: 34px; + height: 34px; +} + +.logostajxz{ + float:initial; + margin-left: 283px; + margin-top: -130rpx; + width: 60px; + height: 60px; +} +.all{ + width:750rpx; + height:1624rpx; +} +.wishdetail{ + position: absolute; + width:750rpx; + height:1624rpx; +} +.popbox{ + position: absolute; + left: 33px; + top: 83px; + width: 310px; + height: 540px; + background-repeat: no-repeat; + background-size:100% 100%; + background-image: url(https://xzjl-1257436036.cos.ap-nanjing.myqcloud.com/xyc/detailbkg.png); +} + +.yximg{ + position: absolute; + left: 73px; + top: 165px; + width: 230px; + height: 154px; + border-radius: 10px; + background-color: #767686; +} +.ywwz{ + position: absolute; + left: 164px; +top: 353px; +width: 48px; +height: 33px; +color: rgba(248, 99, 42, 1); +font-size: 24px; +text-align: left; +font-family: SourceHanSansSC-bold; +} + +.ywxq{ + position: absolute; + left: 91px; +top: 399px; +width: 194px; +height: 150rpx; +color: rgba(108, 108, 108, 1); +font-size: 18px; +text-align: center; +font-family: SourceHanSansSC-regular; +} +.qwsj{ + position: absolute; + left: 140px; +top: 490px; +width: 96px; +height: 33px; +color: rgba(248, 99, 42, 1); +font-size: 24px; +text-align: center; +font-family: SourceHanSansSC-regular; +} +.qwsjtxt{ + position: absolute; + left: 125px; +top: 536px; +width: 127px; +height: 25px; +color: rgba(108, 108, 108, 1); +font-size: 18px; +text-align: center; +font-family: SourceHanSansSC-regular; +} + +.yqq{/*圆圈*/ + border-radius: 64rpx; + position: absolute; + width: 60px; + height:60px; + line-height: 120rpx; + background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); + color: rgba(16, 16, 16, 1); + font-size: 12px; + text-align: center; + box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); + font-family: Arial; + border: 3px solid rgba(255, 255, 255, 1); +} + +.sc{ + border-radius: 64rpx; + position: absolute; + left: 21px; +top: 644px; +width: 60px; +height: 60px; +background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); +color: rgba(16, 16, 16, 1); +font-size: 12px; +text-align: center; +box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); +font-family: Arial; +border: 3px solid rgba(255, 255, 255, 1); +} + +.ywcczk{ + position: absolute; + height:192rpx; + top:1290rpx; + width:750rpx; +} + +.anwz1{ + position: absolute; + width:120rpx; + height: 192rpx; +} +.anwztxt1{ + position: absolute; + width:120rpx; + top: 140rpx; + height: 26px; + color: rgba(108, 108, 108, 1); + font-size: 18px; + text-align: center; + font-family: SourceHanSansSC-regular; +} +.anzmlogo1{ + position: absolute; + margin: 21rpx; + width: 42px; + height: 42px; +} +.sc1{ + margin-left: 42rpx; +} +.xg1{ + margin-left: 112px; +} +.wc1{ + margin-left: 203px; +} +.fx1{ + margin-left: 294px; +} +.sc2{ + margin-left: 112px; +} +.fx2{ + margin-left: 203px; } \ No newline at end of file diff --git a/pages/index/out/out.wxml b/pages/index/out/out.wxml index af8dee3..1fb03a7 100644 --- a/pages/index/out/out.wxml +++ b/pages/index/out/out.wxml @@ -1,2 +1,3 @@ - + +跳转页面,待完善 diff --git a/utils/request.js b/utils/request.js index 91e981e..dec2747 100644 --- a/utils/request.js +++ b/utils/request.js @@ -70,7 +70,7 @@ class request { wx.showToast({ title:'Token无效或过期,请重新登录!', icon: 'none', - duration: 1000 + duration: 5000 }) wx.navigateTo({ url: '/pages/index/index' @@ -81,11 +81,11 @@ class request { if (res.statusCode === 200) { //200: 服务端业务处理正常结束 - if(res.data.code==500){ + if(res.data.code==401){ wx.showToast({ title:'Token无效或过期,请重新登录!', icon: 'none', - duration: 1000 + duration: 5000 }) wx.navigateTo({ url: '/pages/index/index' @@ -126,7 +126,7 @@ class request { wx.showToast({ title:'Token无效或过期,请重新登录!', icon: 'none', - duration: 1000 + duration: 5000 }) wx.navigateTo({ url: '/pages/index/index' @@ -137,11 +137,11 @@ class request { if (res.statusCode === 200) { //200: 服务端业务处理正常结束 - if(res.data.code==500){ + if(res.data.code==401){ wx.showToast({ title:'Token无效或过期,请重新登录!', icon: 'none', - duration: 1000 + duration: 5000 }) wx.navigateTo({ url: '/pages/index/index'