diff --git a/pages/home/xx/index.js b/pages/home/xx/index.js index fefa166..1ffebb4 100644 --- a/pages/home/xx/index.js +++ b/pages/home/xx/index.js @@ -13,7 +13,9 @@ Page({ hasLover:false,// 是否单身 userInfo:{}, Send:false, - SendScs:false + SendScs:false, + isBoundLove: false, + mac:'' }, closeSend(){ @@ -39,28 +41,42 @@ Page({ }) }, doQueryInit(){ - req.getRequest('/api/user/curt',{}).then((res)=>{ - if(res.data.code==200){ - this.setData({hasLover:res.data.data.hasLover}) - this.setData({userInfo:res.data.data}) - if(res.data.data.hasLover){ - wx.navigateTo({ + // 获取个人信息 + req.getRequest('/api/user/curt',{}).then(res => { + if (res.data.code === 200) { + const userInfo = res.data.data + + // 是单身显示当前页面 + if (!userInfo.hasLover) { + this.setData({hasLover: true}) + } + + // 绑定情侣判断 + if (this.data.mac) { + if (userInfo.hasLover) { + return this.setData({isBoundLove:true}) + }else{ + return this.bandingLove() + } + } + + // 是情侣页面跳转 + if (userInfo.hasLover) { + wx.redirectTo({ url: '/pages/home/xx/lindex/lindex' - }) + }) } - - } - }).catch((err)=>{ - console.log(err); - }) - req.getRequest('/api/user/curt/lover',{}).then((res)=>{ - if(res.data.code==200){ - this.setData({loverInfo:res.data.data}) + this.setData({ + userInfo: userInfo + }) } - }).catch((err)=>{ - console.log(err); }) + + + + + }, // 关闭分享成功弹层 closeScsBtn(){ @@ -69,10 +85,41 @@ Page({ }) }, + closeBoundLove(){ + this.setData({ + isBoundLove:false, + mac: '' + }) + wx.switchTab({ + url: '/pages/home/jl/index' + }) + }, + // 绑定情侣 + bandingLove(){ + req.patchRequest('/api/user/curt/lover/binding',{ + mac: this.data.mac + }).then(res => { + this.setData({mac: ''}), + this.doQueryInit() + }) + }, + /** * 生命周期函数--监听页面加载 */ onLoad(options) { + // 获取绑定情侣的mac + if (options.mac) { + // 判断是否登入 + const token = wx.getStorageSync('token') + if (token) { + this.setData({mac : options.mac}) + }else{ + wx.redirectTo({ + url: '/pages/index/index?loveMac=' + options.mac + }) + } + } this.doQueryInit() }, @@ -122,10 +169,15 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage() { + const mac = wx.getStorageSync('mac-key') + console.log(mac,'111'); this.setData({ Send: false, SendScs: true }) + return { + path: '/pages/home/xx/index?mac=' + mac + } }, toSend(){ wx.navigateTo({ diff --git a/pages/home/xx/index.wxml b/pages/home/xx/index.wxml index cb82e98..70acc53 100644 --- a/pages/home/xx/index.wxml +++ b/pages/home/xx/index.wxml @@ -1,5 +1,5 @@ - + @@ -37,4 +37,19 @@ + + + + + + + + 您已绑定情侣 + 不可多次绑定 + 需要绑定其他人 + 需要先与当前用户解绑 + + + + \ No newline at end of file diff --git a/pages/home/xx/index.wxss b/pages/home/xx/index.wxss index 4bf0406..216d74d 100644 --- a/pages/home/xx/index.wxss +++ b/pages/home/xx/index.wxss @@ -613,4 +613,42 @@ font-family: SourceHanSansSC-regular; justify-content: center; align-items: center; margin-top: 20rpx; +} + +.openSend-main-text6 { + width: 100%; + display: flex; + justify-content: center; + color: rgba(248, 99, 42, 1); + font-size: 24px; + margin-top: 80rpx; + font-weight: 700; +} + +.openSend-main-text7 { + width: 100%; + display: flex; + justify-content: center; + color: rgba(248, 99, 42, 1); + font-size: 24px; + margin-top: 10rpx; + font-weight: 700; +} + +.openSend-main-text8 { + color: rgba(108, 108, 108, 1); + font-size: 36rpx; + display: flex; + justify-content: center; + align-items: center; + margin-top: 42rpx; +} + +.openSend-main-text9 { + color: rgba(108, 108, 108, 1); + font-size: 36rpx; + display: flex; + justify-content: center; + align-items: center; + margin-top: 10rpx; } \ No newline at end of file diff --git a/pages/home/xx/lindex/lindex.wxml b/pages/home/xx/lindex/lindex.wxml index 0036038..784a687 100644 --- a/pages/home/xx/lindex/lindex.wxml +++ b/pages/home/xx/lindex/lindex.wxml @@ -1,12 +1,12 @@ - + + + 回忆 + + 星讯 + - - - 回忆 - - 星讯 - + @@ -104,7 +104,7 @@ - + @@ -223,10 +223,24 @@ - + + + + 取消 + 发送 + 发送 + {{dsQTime}} + + + + + + + + @@ -243,23 +257,9 @@ - - - - - - - - - - - - 取消 - 发送 - 发送 - - + + diff --git a/pages/home/xx/lindex/lindex.wxss b/pages/home/xx/lindex/lindex.wxss index 91848b6..e786289 100644 --- a/pages/home/xx/lindex/lindex.wxss +++ b/pages/home/xx/lindex/lindex.wxss @@ -6,6 +6,9 @@ position: relative; width: 100%; height: 100%; + padding-top: 224rpx; + box-sizing: border-box; + overflow: hidden; } .allTap-header { @@ -59,7 +62,8 @@ .ltinfo{ width: 100%; - margin-top: 224rpx; + height: 100%; + overflow-y: scroll; } .bkgfs{ @@ -599,6 +603,16 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); } .zjtableatp2{ + width: 100%; + height: 150rpx; + padding: 0 32rpx; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: flex-start; +} + +.zjtableatp3{ width: 100%; height: 220rpx; padding: 0 32rpx; @@ -759,10 +773,15 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); display: block; } - .header { + .luying-box .header { + width: 100%; + height: 74rpx; + padding: 0 36rpx; + box-sizing: border-box; display: flex; align-items: center; - height: 116rpx; + justify-content: space-between; + border-bottom: 2rpx solid #E9E9E8; } .btn { @@ -784,22 +803,19 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); max-width: 500rpx; } .luyinblock{ - left: 0px; - top: 547px; - width: 375px; - height: 231px; + /* left: 0px; + top: 547px; */ + width: 100%; + height: 462rpx; line-height: 20px; border-radius: 10px 10px 0px 0px; background-color: rgba(255, 255, 255, 1); color: rgba(16, 16, 16, 1); - font-size: 14px; + font-size: 28rpx; text-align: center; font-family: Arial; } .qxly{ - position: absolute; - left: 32rpx; - top: 12rpx; width: 64rpx; height: 50rpx; color: rgba(108, 108, 108, 1); @@ -808,9 +824,6 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); font-family: SourceHanSansSC-regular; } .qrfs{ - position: absolute; - left: 650rpx; - top: 12rpx; width: 64rpx; height: 50rpx; font-size: 32rpx; @@ -823,29 +836,18 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); .qrfs2{ color: rgba(108, 108, 108, 1); } -.lyhx{ - position: absolute; - left: 0px; - top: 72rpx; - width: 100%; - height: NaNpx; - border: 1px solid rgba(233, 233, 232, 1); -} .luyinjishiqi{ - position: absolute; - left: 286rpx; - top: 114rpx; - width: 180rpx; - height: 44rpx; + width: 100%; + height: 128rpx; color: rgba(108, 108, 108, 1); font-size: 32rpx; - text-align: center; - font-family: SourceHanSansSC-regular; + display: flex; + justify-content: center; + align-items: center; } .weiluyinanniu{ - position: absolute; - left: 316rpx; - top: 300rpx; + margin: 0 auto; + margin-top: 42rpx; width: 120rpx; height: 120rpx; border-radius: 50%; @@ -857,9 +859,6 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); border: 3px solid rgba(255, 255, 255, 1); } .wlyan1{ - position: absolute; - left: 15rpx; - top: 15rpx; width: 90rpx; height: 90rpx; border-radius: 45rpx; @@ -868,14 +867,9 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); text-align: center; } .luyinlbt{ - position: absolute; width: 750rpx; height: 50rpx; - top:198rpx; overflow: hidden; - - /* scroll-snap-type: x mandatory; - scroll-snap-align: start; */ } .box2{ animation: move 5s infinite linear; @@ -900,9 +894,6 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); animation-play-state: paused; } */ .wlyan2{ - position: absolute; - left: 30rpx; - top: 30rpx; width: 60rpx; height: 60rpx; line-height: 17px; @@ -912,34 +903,20 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); } .wlyan3{ - /* position: absolute; - left: 40rpx; - top: 20rpx; */ width: 70rpx; height: 70rpx; - /* border-top: 50rpx solid transparent; - border-left: 60rpx solid rgba(248,99,42,1); - border-bottom: 35rpx solid transparent; */ background-size: cover; background-image: url(https://wish-assets.windymuse.com.cn/xy/if-ui-play%20Copy%401x.png); } .wlyan4{ - /* position: absolute; - left: 40rpx; - top: 20rpx; */ width: 70rpx; height: 70rpx; - /* border-top: 50rpx solid transparent; - border-left: 60rpx solid rgba(248,99,42,1); - border-bottom: 35rpx solid transparent; */ background-size: cover; background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/semiDesign.png); } .luyinlbt1{ - position: absolute; width: 750rpx; height: 50rpx; - top:198rpx; overflow: hidden; background-image: url(https://wish-assets.windymuse.com.cn/xy/lylbt.png); } @@ -1141,5 +1118,15 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); font-size: 14px!important; text-align: left; font-family: SourceHanSansSC-regular; +} +.luying-box { + position: absolute; + top: 0; + width: 100%; + height: 100%; + display: flex; + align-items: flex-end; + background-color: rgba(255, 255, 255, 0.9); + z-index: 99999; } \ No newline at end of file diff --git a/pages/home/xyc/tdyw/tdyw.js b/pages/home/xyc/tdyw/tdyw.js index a12163b..5c9e67b 100644 --- a/pages/home/xyc/tdyw/tdyw.js +++ b/pages/home/xyc/tdyw/tdyw.js @@ -13,8 +13,25 @@ Page({ visible:false, shareVisible:false, //分享弹层 wishes:[], - showCanvas: true + showCanvas: true, + ywUrl: '' //愿望链接 }, + // 复制链接 + handerCopy(){ + if (this.data.ywUrl) { + wx.setClipboardData({ + data: this.data.ywUrl, + success() { + wx.showToast({ + title: '已复制', + icon: 'success', + duration: 1500 + }); + } + }); + } + }, + // 分享微信 shareWx(){ console.log('分享微信') @@ -192,8 +209,29 @@ startDraw() { }) }, go2WishDetail(e){/**查看愿望详情 */ - this.setData({visible:true,detail:e.currentTarget.dataset.wish}) - this.setData({detail:e.currentTarget.dataset.wish}) + const status = e.currentTarget.dataset.wish.status + // 获取分享链接 + if (status === 'processing') { + const token = wx.getStorageSync('token') + req.postRequest('/api/v1/wx/generate-url-link',{ + path: '/pages/home/xyc/tdyw/tdyw', + query: `token=${token}` + }).then(res => { + console.log(res); + if (res.data.code === 200) { + this.setData({ + ywUrl : res.data.data.urlLink, + visible:true,detail:e.currentTarget.dataset.wish, + detail:e.currentTarget.dataset.wish + }) + } + }) + }else { + this.setData({ + visible:true,detail:e.currentTarget.dataset.wish, + detail:e.currentTarget.dataset.wish + }) + } }, onVisibleChange(e) { this.setData({ @@ -221,7 +259,12 @@ startDraw() { * 生命周期函数--监听页面加载 */ onLoad(options) { - this.getMyWish() + if (options.token) { + wx.setStorageSync('token', options.token) + this.getMyWish() + }else { + this.getMyWish() + } }, /** diff --git a/pages/home/xyc/tdyw/tdyw.json b/pages/home/xyc/tdyw/tdyw.json index b11bd4d..ba6f56a 100644 --- a/pages/home/xyc/tdyw/tdyw.json +++ b/pages/home/xyc/tdyw/tdyw.json @@ -2,6 +2,8 @@ "usingComponents": { "t-image": "tdesign-miniprogram/image/image", "t-popup": "tdesign-miniprogram/popup/popup", - "t-dialog": "tdesign-miniprogram/dialog/dialog" + "t-dialog": "tdesign-miniprogram/dialog/dialog", + "t-input": "tdesign-miniprogram/input/input", + "t-icon": "tdesign-miniprogram/icon/icon" } } \ No newline at end of file diff --git a/pages/home/xyc/tdyw/tdyw.wxml b/pages/home/xyc/tdyw/tdyw.wxml index abafb17..a22735f 100644 --- a/pages/home/xyc/tdyw/tdyw.wxml +++ b/pages/home/xyc/tdyw/tdyw.wxml @@ -50,7 +50,7 @@ - + @@ -63,25 +63,19 @@ - - - - - 修改 - - - - - 已达成 - - - - - 分享 - + + + + + + + + 愿望链接,点击复制 - + + + 分享 @@ -105,7 +99,7 @@ 分享到 - + diff --git a/pages/home/xyc/tdyw/tdyw.wxss b/pages/home/xyc/tdyw/tdyw.wxss index a810611..65ef722 100644 --- a/pages/home/xyc/tdyw/tdyw.wxss +++ b/pages/home/xyc/tdyw/tdyw.wxss @@ -407,4 +407,61 @@ top: 166rpx; width: 620rpx; height: 1080rpx; +} + +.ywcczk1{ + position: absolute; + height:192rpx; + top:1290rpx; + width:750rpx; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} + + +.ywcczk-input { + width: 496rpx !important; + height: 70rpx !important; + padding: 0 !important; + flex: none !important; + border: 2rpx solid #EFEFEF; + border-radius: 20rpx; + background-color: rgba(255, 255, 255, 1); + font-size: 28rpx; + color: #000000 !important; +} + +.ywcczk-btn { + width: 100%; + height: 84rpx; + margin-top: 32rpx; + display: flex; + align-items: center; + justify-content: center; +} + +.ywcczk-btn .btn { + width: 84rpx; + height: 84rpx; + border-radius: 50%; + background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); + box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); + border: 6rpx solid rgba(255, 255, 255, 1); + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: center; +} + +.ywcczk-btn .btn image { + width: 50rpx; + height: 50rpx; +} + +.ywcczk-btn .text { + margin-left: 32rpx; + color: rgba(108, 108, 108, 1); + font-size: 28rpx; } \ No newline at end of file diff --git a/pages/home/xyc/wdyw/wdyw.wxml b/pages/home/xyc/wdyw/wdyw.wxml index 5a5370a..edba218 100644 --- a/pages/home/xyc/wdyw/wdyw.wxml +++ b/pages/home/xyc/wdyw/wdyw.wxml @@ -140,7 +140,7 @@ 分享到 - + diff --git a/pages/index/index.js b/pages/index/index.js index 54c64b6..f1ae032 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -7,13 +7,26 @@ import WxmpRsa from 'wxmp-rsa' Page({ data: { - + showFail: false }, // 此处为周期事件 /** * 生命周期函数--监听页面加载 */ + closeShowFail(){ + this.setData({ + showFail: false + }) + }, + onLoad(options) { + // 绑定情侣时为未登入状态 + if (options.loveMac) { + this.setData({ + showFail: true + }) + } + if(options&&options.sn&&options.sn!=null&&options.sn!=''){ console.log('有数据'+options.sn) wx.showToast({ diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 48ec543..b604563 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -15,3 +15,17 @@ + + + + + 绑定失败 + 需要先唤醒精灵 + 绑定情侣用户需要先使用 + 晶石设备唤醒精灵 + + + 获取晶石 + 好的 + + diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 2987545..c15c5df 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -97,3 +97,91 @@ background-size:100% 100%; background-image: url(https://wish-assets.windymuse.com.cn/xy/yx.png); } + + .binding-fail { + position: relative; + width: 100%; + height: 100%; + background-color: rgba(255, 255, 255, 0.9); + z-index: 1; + display: flex; + align-items: center; + flex-direction: column; + } + + .binding-top { + width: 620rpx; + height: 1080rpx; + margin-top: 188rpx; + background-size: cover; + background-image: url(https://wish-assets.windymuse.com.cn/xy/%E7%BB%91%E5%AE%9A%E6%83%85%E4%BE%A3%E8%83%8C%E6%99%AF.png); + } + + .top-img { + width: 404rpx; + height: 404rpx; + margin: 0 auto; + margin-top: 110rpx; + background-size: cover; + background-image: url(https://wish-assets.windymuse.com.cn/xy/%E9%92%BB%E7%9F%B3.png); + } + + .top-text1 { + width: 100%; + margin-top: 52rpx; + display: flex; + justify-content: center; + color: rgba(248, 99, 42, 1); + font-size: 48rpx; + font-weight: 700; + } + + .top-text2 { + width: 100%; + margin-top: 10rpx; + display: flex; + justify-content: center; + color: rgba(248, 99, 42, 1); + font-size: 48rpx; + font-weight: 700; + } + + .top-text3 { + width: 100%; + margin-top: 42rpx; + display: flex; + justify-content: center; + color: rgba(108, 108, 108, 1); + font-size: 36rpx; + } + + .top-text4 { + width: 100%; + margin-top: 10rpx; + display: flex; + justify-content: center; + color: rgba(108, 108, 108, 1); + font-size: 36rpx; + } + + .binding-btm { + width: 100%; + margin-top: 42rpx; + display: flex; + justify-content: space-evenly; + } + + .btm-btn { + width: 210rpx; + height: 70rpx; + border-radius: 20rpx; + background: linear-gradient(233.49deg, rgba(248,99,42,1) 10.48%,rgba(249,135,89,1) 89.2%); + text-align: center; + box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); + border: 6rpx solid rgba(255, 255, 255, 1); + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: center; + color: #fff; + } \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index 883e9bd..82d878a 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -10,7 +10,7 @@ "list": [ { "name": "", - "pathName": "pages/home/me/indexx", + "pathName": "pages/home/xx/index", "query": "", "launchMode": "default", "scene": null