From 5005d00a485dfa3460f096752933e68036b018cf Mon Sep 17 00:00:00 2001 From: lanzhihui <503792708@qq.com> Date: Thu, 6 Feb 2025 09:07:35 +0800 Subject: [PATCH] update --- src/app.wpy | 2 +- src/pages/books/bookDetail.wpy | 61 +++++++++++- src/pages/news/chitchat.wpy | 6 +- src/pages/tabBar/home.wpy | 168 ++++++++++++++++++++++++++++++++- 4 files changed, 231 insertions(+), 6 deletions(-) diff --git a/src/app.wpy b/src/app.wpy index 3c6d2f7..7bba58d 100644 --- a/src/app.wpy +++ b/src/app.wpy @@ -35,7 +35,7 @@ wepy.app({ } }, globalData: { - versions: 'v5.5.87', // 版本号 + versions: 'v5.5.89', // 版本号 navBarHeight: 0, // 导航栏高度 navRight: 0, // 胶囊距右方间距(方保持左、右间距一致) navTop: 0, // 胶囊距顶部间距 diff --git a/src/pages/books/bookDetail.wpy b/src/pages/books/bookDetail.wpy index b0b33e0..4b98976 100644 --- a/src/pages/books/bookDetail.wpy +++ b/src/pages/books/bookDetail.wpy @@ -1,6 +1,6 @@ @@ -60,13 +60,42 @@ onLoad(e) { console.log(e) + console.log(wx, 'wx===') this.url = decodeURIComponent(e.url) console.log(this.url) this.from_openid = wx.getStorageSync('openid') wx.showShareMenu({ withShareTicket: true }) - }, + // wx.onMessage({ + // onMessage: (msg) => { + // console.log(msg, 'gggg') + // if (msg.action === 'pay') { + // // 调用支付API + // wx.requestPayment({ + // timeStamp: msg.payInfo.timeStamp, + // nonceStr: msg.payInfo.nonceStr, + // package: msg.payInfo.package, + // signType: msg.payInfo.signType, + // paySign: msg.payInfo.paySign, + // success(res) { + // console.log('支付成功', res) + // // 将支付结果返回给H5页面 + // wx.postMessage({ + // data: { + // action: 'payResult', + // data: res + // } + // }) + // }, + // fail(err) { + // console.log('支付失败', err) + // } + // }) + // } + // } + // }) +}, onPullDownRefresh() { // this.initPageData() @@ -100,7 +129,35 @@ }, goto(url) { wx.navigateTo({url: url}) + }, + onMessage(data) { + console.log(data.$wx.detail.data[0], 'gggg') + let msg = data.$wx.detail.data[0] + if (msg.action === 'pay') { + // 调用支付API + wx.requestPayment({ + timeStamp: msg.payInfo.timestamp, + nonceStr: msg.payInfo.nonceStr, + package: msg.payInfo.package, + signType: msg.payInfo.signType, + paySign: msg.payInfo.paySign, + success(res) { + console.log('支付成功', res) + // 将支付结果返回给H5页面 + wx.postMessage({ + data: { + action: 'payResult', + data: res + } + }) + }, + fail(err) { + console.log('支付失败', err) + } + }) + } } + } }) diff --git a/src/pages/news/chitchat.wpy b/src/pages/news/chitchat.wpy index 322e927..6749284 100644 --- a/src/pages/news/chitchat.wpy +++ b/src/pages/news/chitchat.wpy @@ -860,8 +860,12 @@ wepy.page({ vm.lastTime = format(msg.time) vm.callbackSend('text') }) - } + }, + done: sendMsgDone }) + function sendMsgDone(error, file) { + console.log('上传' + (!error ? '成功' : '失败'), file) + } // }) }, // 发送图片消息 diff --git a/src/pages/tabBar/home.wpy b/src/pages/tabBar/home.wpy index 543f3e0..4d716d8 100644 --- a/src/pages/tabBar/home.wpy +++ b/src/pages/tabBar/home.wpy @@ -8,6 +8,19 @@ page { padding-bottom: 45rpx; } +.ui-swiper-box{ + margin:32rpx 32rpx 0; + height: 200rpx; + border-radius:32rpx!important; + overflow: hidden; +} +.ui-swiper-list{ + width: 100%; + overflow: hidden; + height: 200rpx; + border-radius:32rpx; +} + .ui-top-up{ width: 174rpx; height: 36rpx; @@ -15,7 +28,7 @@ page { } .ui-top-box{ - display: fiex; + display: flex; overflow-x: auto; margin-left: 6rpx; @@ -283,10 +296,111 @@ page { width: 30rpx; height: 30rpx; } +.ui-adv-box{ + position: fixed; + bottom: 270rpx; + right: 0rpx; + width: 120rpx; + height: 120rpx; + color:#ffffff; + z-index: 1000; + background: url('https://image.fulllinkai.com/202501/07/92fabd6990d6c166d3352cf95987049f.png'); + background-size: cover; +} +.ui-adv-message{ + width: 120rpx; + height: 120rpx; + background: url('https://image.fulllinkai.com/202501/07/2294cafbfe5261dad430371f0aed9b52.png'); + background-size: cover; +} +.ui-adv-close{ + position: absolute; + width: 32rpx; + height: 32rpx; + bottom: -44rpx; + left: 50%; + transform: translateX(-50%); + background: url('https://image.fulllinkai.com/202501/07/3a14b8cc539285e3ba96b0977749bfc5.png'); + background-size: cover; +} +.ui--message-fade{ + animation: adv-message-shake 1s infinite linear; +} +@keyframes adv-message-shake { + 0% { + transform:rotate(0deg); + } + 25% { + transform:rotate(15deg); + } + 50% { + transform:rotate(0deg); + } + 75% { + transform:rotate(-15deg); + } + //100% { + // transform:rotate(0deg); + //} +} +.ui-fade-in { + opacity: 0; + animation: enter-x-left 0.4s ease-in-out 0.3s; + animation-fill-mode: forwards; + transform: translateX(120rpx); +} +.ui-fade-out { + opacity: 1; + animation: enter-x-right 0.4s ease-in-out 0.3s; + animation-fill-mode: forwards; +} +@keyframes enter-x-left { + to { + opacity: 1; + transform: translateX(0); + } +} +@keyframes enter-x-right { + to { + opacity: 0; + transform: translateX(120rpx); + } +} +.login_prompt_box { + position: fixed; + top:50%; + left: 50%; + transform: translate(-50%,-50%); + .ui-adv-modal{ + width: 750rpx; + height: auto; + } + .loginCancelIcon { + width: 56rpx; + height: 56rpx; + position: absolute; + bottom:-60rpx; + left: 50%; + transform: translateX(-50%); + z-index: 99; + } +}