修改iOS支持购买vip

This commit is contained in:
mac·ufutx 2026-04-21 17:54:33 +08:00
parent ec59edc7f9
commit 17bb3b847c
4 changed files with 339 additions and 225 deletions

View File

@ -1,155 +1,22 @@
<style lang="less" scoped>
@import url(../../styles/theme.less);
page {
background-color: #f5f5f5;
}
.ui-member-data-box{
padding: 30rpx 40rpx 0;
background: #FFFFFF;
width: 100vw;
.ui-member-list{
display: flex;
align-items: center;
flex-wrap: wrap;
.ui-member-box{
margin: 0 52rpx 42rpx 0;
display: flex;
flex-direction: column;
align-items: center;
.ui-member-pic{
margin-bottom: 10rpx;
width: 92rpx;
height: 92rpx;
border-radius: 50%;
}
.ui-member-name{
max-width: 88rpx;
}
}
.ui-member-block:nth-child(5n) .ui-member-box{
margin-right: 0;
}
}
.ui-more-list{
margin-left: 234rpx;
display: flex;
align-items: center;
padding-bottom: 30rpx;
.ui-more-pic{
margin-left: 10rpx;
width: 12rpx;
height: 24rpx;
}
.ui-more-pic-v1{
margin-right: 10rpx;
width: 24rpx;
height: 12rpx;
}
}
.ui-more-list-v1{
margin-left: 274rpx;
}
}
.ui-group-detail{
margin-top: 12rpx;
padding: 22rpx 40rpx;
width: 100vw;
background: #ffffff;
.ui-detail-list{
display: flex;
justify-content: space-between;
flex-direction: row;
align-items: center;
.ui-detail-title{
width: 400rpx;
}
.ui-detail-name{
//text-align: right;
max-width: 430rpx;
display: flex;
align-items: center;
.ui-detail-name-text{
margin-right: 10rpx;
text-align: right;
width: 420rpx;
}
.ui-detail-name-icon{
width: 28rpx;
height: 28rpx;
}
}
.ui-detail-pic{
width: 60rpx;
height: 60rpx;
border-radius: 50%;
}
}
.ui-detail-line{
margin: 20rpx 0 30rpx;
width: 670rpx;
height: 2rpx;
background: #F8F8F8;
}
.ui-detail-intro{
margin-top: 20rpx;
}
}
.ui-group-quit{
margin-top: 12rpx;
padding: 30rpx 0;
color: #FF3051;
background: #ffffff;
text-align: center;
button::after{
border: none;
}
}
.ui-group-join{
margin-top: 12rpx;
padding: 30rpx 0;
color: #2d8cf0;
background: #ffffff;
text-align: center;
}
.ui-server{
width: 100%;
height: 100%;
background: #ffffff;
box-sizing: border-box;
}
.service {
position: fixed;
bottom: 12vh;
right: 5vw;
image {
width: 130rpx;
height: 130rpx;
}
}
</style>
<template> <template>
<view class="ui-groupChitchatDetail"> <view class="ui-groupChitchatDetail">
<view class="ui-member-data-box"> <view class="ui-member-data-box">
<view class="ui-member-list" v-if="hidden"> <!-- 显示成员列表(根据加载数量动态显示) -->
<view class="ui-member-block" v-for="(item,index) in detail.members" :key="index"> <view class="ui-member-list">
<view class="ui-member-block" v-for="(item,index) in displayMembers" :key="index">
<view class="ui-member-box"> <view class="ui-member-box">
<image @tap.stop="jumpPath(`/pages/home/information?id=${item.id}`)" class="ui-member-pic" :src="item.photo === 'https://image.fulllinkai.com/202207/04/1fa9a906b956efa26852fb685a845fff.png?x-oss-process=style/scale1' ? defaultImg : item.photo" mode="aspectFill"></image> <image @tap.stop="jumpPath(`/pages/home/information?id=${item.id}`)" class="ui-member-pic" :src="item.photo === 'https://image.fulllinkai.com/202207/04/1fa9a906b956efa26852fb685a845fff.png?x-oss-process=style/scale1' ? defaultImg : item.photo" mode="aspectFill"></image>
<view class="ui-member-name color-666 font_22 ellipsis_1">{{item.nickname}}</view> <view class="ui-member-name color-666 font_22 ellipsis_1">{{item.nickname}}</view>
</view> </view>
</view> </view>
<!-- 添加成员按钮 -->
<view class="ui-member-block"> <view class="ui-member-block">
<view class="ui-member-box"> <view class="ui-member-box">
<image @tap.stop="jumpPath(`/pages/news/editGroupMembers?id=${id}&type=add`)" class="ui-member-pic" src="https://image.fulllinkai.com/202410/30/05749286f02a045fe8344f4f2006bcaa.png" mode="aspectFill"></image> <image @tap.stop="jumpPath(`/pages/news/editGroupMembers?id=${id}&type=add`)" class="ui-member-pic" src="https://image.fulllinkai.com/202410/30/05749286f02a045fe8344f4f2006bcaa.png" mode="aspectFill"></image>
<view class="ui-member-name colorF font_22">--</view> <view class="ui-member-name colorF font_22">--</view>
</view> </view>
</view> </view>
<!-- 删除成员按钮 -->
<view class="ui-member-block"> <view class="ui-member-block">
<view class="ui-member-box"> <view class="ui-member-box">
<image @tap.stop="jumpPath(`/pages/news/editGroupMembers?id=${id}&type=delete`)" class="ui-member-pic" src="https://image.fulllinkai.com/202410/30/c0ef2d197961d0435f1e83b254cd9c33.png" mode="aspectFill"></image> <image @tap.stop="jumpPath(`/pages/news/editGroupMembers?id=${id}&type=delete`)" class="ui-member-pic" src="https://image.fulllinkai.com/202410/30/c0ef2d197961d0435f1e83b254cd9c33.png" mode="aspectFill"></image>
@ -157,19 +24,22 @@ page {
</view> </view>
</view> </view>
</view> </view>
<block v-if="detail.members.length > 20 && !hidden">
<view class="ui-more-list" @tap="moreMembers"> <!-- 查看更多/收起按钮 -->
<view class="color-666 font_26">查看更多群成员</view> <block v-if="detail.members && detail.members.length > pageSize">
<!-- 未显示完全时显示"查看更多" -->
<view class="ui-more-list" v-if="!isLoadAll" @tap="loadMoreMembers">
<view class="color-666 font_26">查看更多群成员({{ currentPage }}/{{ totalPages }}</view>
<image class="ui-more-pic" src="https://image.fulllinkai.com/202307/24/8c1a30360cf0c55605ae784dd47022e0.png" mode="scaleToFill"></image> <image class="ui-more-pic" src="https://image.fulllinkai.com/202307/24/8c1a30360cf0c55605ae784dd47022e0.png" mode="scaleToFill"></image>
</view> </view>
</block> <!-- 已显示全部时显示"收起" -->
<block v-else-if="detail.members.length > 20 && hidden"> <view class="ui-more-list ui-more-list-v1" v-else @tap="collapseMembers">
<view class="ui-more-list ui-more-list-v1" @tap="moreMembers">
<image class="ui-more-pic-v1" src="https://image.fulllinkai.com/202307/28/a9ab5fc1b5c91a01df47de4473bdbeb6.png" mode="scaleToFill"></image> <image class="ui-more-pic-v1" src="https://image.fulllinkai.com/202307/28/a9ab5fc1b5c91a01df47de4473bdbeb6.png" mode="scaleToFill"></image>
<view class="color-666 font_26">收起</view> <view class="color-666 font_26">收起</view>
</view> </view>
</block> </block>
</view> </view>
<view class="ui-group-detail"> <view class="ui-group-detail">
<view class="ui-detail-list"> <view class="ui-detail-list">
<view class="ui-detail-title bold font30 color-333">群聊头像</view> <view class="ui-detail-title bold font30 color-333">群聊头像</view>
@ -192,6 +62,7 @@ page {
<view class="font30 color-333 bold">群聊简介</view> <view class="font30 color-333 bold">群聊简介</view>
<view class="ui-detail-intro color-666 font_26">{{ detail.team.intro }}</view> <view class="ui-detail-intro color-666 font_26">{{ detail.team.intro }}</view>
</view> </view>
<view class="ui-group-detail" v-if="detail.is_join == 1"> <view class="ui-group-detail" v-if="detail.is_join == 1">
<view class="ui-detail-list"> <view class="ui-detail-list">
<view class="ui-detail-title bold font30 color-333">显示群成员昵称</view> <view class="ui-detail-title bold font30 color-333">显示群成员昵称</view>
@ -208,6 +79,7 @@ page {
<switch checked="{{detail.user_team.is_top}}" @change="changeShowTop" color="#d92553" class="flo_r" style="margin-right: -2rpx;margin-top: -6rpx;"/> <switch checked="{{detail.user_team.is_top}}" @change="changeShowTop" color="#d92553" class="flo_r" style="margin-right: -2rpx;margin-top: -6rpx;"/>
</view> </view>
</view> </view>
<view class="ui-group-quit font_30 color-333" @tap.stop="handleContact"> <view class="ui-group-quit font_30 color-333" @tap.stop="handleContact">
<button class="btn ui-server text-center font_30" hover-class="btn_active" @tap.stop="handleContact"> <button class="btn ui-server text-center font_30" hover-class="btn_active" @tap.stop="handleContact">
联系客服 联系客服
@ -234,15 +106,44 @@ wepy.page({
data: { data: {
id: '', id: '',
defaultImg: 'https://image.fulllinkai.com/202307/18/449c3253ca2bbed9314d39977a486d0e.png', // 默认头像 defaultImg: 'https://image.fulllinkai.com/202307/18/449c3253ca2bbed9314d39977a486d0e.png',
detail: {}, detail: {
members: [],
team: {},
user_team: {}
},
notiTypeList: [], notiTypeList: [],
notiTypeData: {muteNotiType: 0}, notiTypeData: {muteNotiType: 0},
notiTypeIndex: null, notiTypeIndex: null,
hidden: true,
throttle: true, throttle: true,
isCodeIn: false // 是否扫码进入详情 isCodeIn: false,
// 分页加载相关
pageSize: 25, // 每页显示数量
currentLoadCount: 25, // 当前已加载数量默认25
isLoadAll: false // 是否已加载全部成员
}, },
computed: {
displayMembers() {
// 返回当前已加载的成员列表
if (this.detail.members && this.detail.members.length > 0) {
return this.detail.members.slice(0, this.currentLoadCount)
}
return []
},
// 当前页码
currentPage() {
return Math.ceil(this.currentLoadCount / this.pageSize)
},
// 总页数
totalPages() {
if (!this.detail.members || this.detail.members.length === 0) return 1
return Math.ceil(this.detail.members.length / this.pageSize)
}
},
methods: { methods: {
getDetail() { getDetail() {
let vm = this let vm = this
@ -250,6 +151,11 @@ wepy.page({
vm.$get({url: `${service.host}/team/${vm.id}/detail`}).then(({code, data}) => { vm.$get({url: `${service.host}/team/${vm.id}/detail`}).then(({code, data}) => {
if (code === 0) { if (code === 0) {
vm.detail = data vm.detail = data
if (!vm.detail.members) {
vm.detail.members = []
}
// 重置加载状态
vm.resetLoadState()
} }
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {
@ -257,7 +163,40 @@ wepy.page({
console.log(err) console.log(err)
}) })
}, },
// 修改群信息
// 重置加载状态
resetLoadState() {
this.currentLoadCount = this.pageSize
// 判断是否需要显示"查看更多"按钮
if (this.detail.members && this.detail.members.length <= this.pageSize) {
this.isLoadAll = true
} else {
this.isLoadAll = false
}
},
// 加载更多成员
loadMoreMembers() {
let vm = this
let totalCount = vm.detail.members.length
let newLoadCount = vm.currentLoadCount + vm.pageSize
// 如果新加载数量大于等于总成员数,则加载全部并显示"收起"
if (newLoadCount >= totalCount) {
vm.currentLoadCount = totalCount
vm.isLoadAll = true
} else {
vm.currentLoadCount = newLoadCount
vm.isLoadAll = false
}
},
// 收起成员列表
collapseMembers() {
this.currentLoadCount = this.pageSize
this.isLoadAll = false
},
changeGroupData() { changeGroupData() {
let vm = this let vm = this
let data = { let data = {
@ -284,19 +223,19 @@ wepy.page({
}) })
} }
}, },
// 监听群昵称是否显示
changeShowNick(e) { changeShowNick(e) {
let vm = this let vm = this
vm.detail.user_team.show_other_nick = e.$wx.detail.value ? 1 : 0 vm.detail.user_team.show_other_nick = e.$wx.detail.value ? 1 : 0
vm.changeGroupData() vm.changeGroupData()
}, },
// 监听置顶
changeShowTop(e) { changeShowTop(e) {
let vm = this let vm = this
vm.detail.user_team.is_top = e.$wx.detail.value ? 1 : 0 vm.detail.user_team.is_top = e.$wx.detail.value ? 1 : 0
vm.changeGroupData() vm.changeGroupData()
}, },
// 消息免打扰设置
changeMutenotiType(e) { changeMutenotiType(e) {
let vm = this let vm = this
vm.$showLoading('') vm.$showLoading('')
@ -316,7 +255,6 @@ wepy.page({
if (res) { if (res) {
vm.notiTypeData.muteNotiType = muteNotiType vm.notiTypeData.muteNotiType = muteNotiType
vm.notiTypeData.muteTeam = muteTeam vm.notiTypeData.muteTeam = muteTeam
console.log(vm.notiTypeIndex, e.$wx.detail.value, vm.detail, 'vm.notiTypeIndex')
if (vm.notiTypeIndex !== null) { if (vm.notiTypeIndex !== null) {
vm.notiTypeList[vm.notiTypeIndex].muteNotiType = muteNotiType vm.notiTypeList[vm.notiTypeIndex].muteNotiType = muteNotiType
vm.notiTypeList[vm.notiTypeIndex].muteTeam = muteTeam vm.notiTypeList[vm.notiTypeIndex].muteTeam = muteTeam
@ -331,13 +269,12 @@ wepy.page({
if (!e.$wx.detail.value) { if (!e.$wx.detail.value) {
vm.notiTypeList.splice(vm.notiTypeIndex, 1) vm.notiTypeList.splice(vm.notiTypeIndex, 1)
} }
console.log(vm.notiTypeList, 'vm.notiTypeList')
wx.setStorageSync('muteNotList', vm.notiTypeList) wx.setStorageSync('muteNotList', vm.notiTypeList)
} }
wx.hideLoading() wx.hideLoading()
}) })
}, },
// 退出群聊
quitGroup() { quitGroup() {
let vm = this let vm = this
wx.showModal({ wx.showModal({
@ -350,15 +287,14 @@ wepy.page({
if (code == 0) { if (code == 0) {
wx.switchTab({url: '/pages/tabBar/news'}) wx.switchTab({url: '/pages/tabBar/news'})
} }
}).catch(() => { }).catch(() => {})
})
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消') console.log('用户点击取消')
} }
} }
}) })
}, },
// 加入群聊
joinGroup() { joinGroup() {
let vm = this let vm = this
wx.showModal({ wx.showModal({
@ -371,27 +307,23 @@ wepy.page({
if (code == 0) { if (code == 0) {
vm.getDetail() vm.getDetail()
} }
}).catch(() => { }).catch(() => {})
})
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消') console.log('用户点击取消')
} }
} }
}) })
}, },
// 返回群聊天
backChat() { backChat() {
let vm = this let vm = this
wx.redirectTo({url: `/pages/news/groupChitchat?id=${vm.id}&name=${encodeURIComponent(vm.detail.tname)}`}) wx.redirectTo({url: `/pages/news/groupChitchat?id=${vm.id}&name=${encodeURIComponent(vm.detail.team.tname)}`})
},
// 展示、收起更多成员
moreMembers() {
let vm = this
vm.hidden = !vm.hidden
}, },
jumpPath(e) { jumpPath(e) {
wx.navigateTo({url: e}) wx.navigateTo({url: e})
}, },
handleContact(e) { handleContact(e) {
let vm = this let vm = this
try { try {
@ -404,6 +336,7 @@ wepy.page({
} }
} }
}, },
onLoad(e) { onLoad(e) {
let vm = this let vm = this
if (e.scene) { if (e.scene) {
@ -424,23 +357,183 @@ wepy.page({
} }
}) })
} }
// 初始化加载状态
vm.currentLoadCount = vm.pageSize
vm.isLoadAll = false
vm.getDetail() vm.getDetail()
}, },
onShow() { onShow() {
let vm = this let vm = this
if (vm.id) { if (vm.id) {
vm.getDetail() vm.getDetail()
} }
}, },
created() {
} created() {}
}) })
</script> </script>
<style lang="less" scoped>
@import url(../../styles/theme.less);
page {
background-color: #f5f5f5;
}
.ui-member-data-box {
padding: 30rpx 40rpx 0;
background: #FFFFFF;
width: 100vw;
.ui-member-list {
display: flex;
align-items: center;
flex-wrap: wrap;
.ui-member-box {
margin: 0 52rpx 42rpx 0;
display: flex;
flex-direction: column;
align-items: center;
.ui-member-pic {
margin-bottom: 10rpx;
width: 92rpx;
height: 92rpx;
border-radius: 50%;
}
.ui-member-name {
max-width: 88rpx;
}
}
.ui-member-block:nth-child(5n) .ui-member-box {
margin-right: 0;
}
}
.ui-more-list {
margin-left: 234rpx;
display: flex;
align-items: center;
padding-bottom: 30rpx;
.ui-more-pic {
margin-left: 10rpx;
width: 12rpx;
height: 24rpx;
}
.ui-more-pic-v1 {
margin-right: 10rpx;
width: 24rpx;
height: 12rpx;
}
}
.ui-more-list-v1 {
margin-left: 274rpx;
}
}
.ui-group-detail {
margin-top: 12rpx;
padding: 22rpx 40rpx;
width: 100vw;
background: #ffffff;
.ui-detail-list {
display: flex;
justify-content: space-between;
flex-direction: row;
align-items: center;
.ui-detail-title {
width: 400rpx;
}
.ui-detail-name {
max-width: 430rpx;
display: flex;
align-items: center;
.ui-detail-name-text {
margin-right: 10rpx;
text-align: right;
width: 420rpx;
}
.ui-detail-name-icon {
width: 28rpx;
height: 28rpx;
}
}
.ui-detail-pic {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
}
}
.ui-detail-line {
margin: 20rpx 0 30rpx;
width: 670rpx;
height: 2rpx;
background: #F8F8F8;
}
.ui-detail-intro {
margin-top: 20rpx;
}
}
.ui-group-quit {
margin-top: 12rpx;
padding: 30rpx 0;
color: #FF3051;
background: #ffffff;
text-align: center;
button::after {
border: none;
}
}
.ui-group-join {
margin-top: 12rpx;
padding: 30rpx 0;
color: #2d8cf0;
background: #ffffff;
text-align: center;
}
.ui-server {
width: 100%;
height: 100%;
background: #ffffff;
box-sizing: border-box;
}
.service {
position: fixed;
bottom: 12vh;
right: 5vw;
image {
width: 130rpx;
height: 130rpx;
}
}
</style>
<config> <config>
{ {
navigationBarTitleText: '群聊详情', navigationBarTitleText: '群聊详情',
enablePullDownRefresh: false, enablePullDownRefresh: false,
backgroundColorTop: '#f5f5f5', backgroundColorTop: '#f5f5f5',
backgroundColorBottom: '#f5f5f5', backgroundColorBottom: '#f5f5f5'
} }
</config> </config>

View File

@ -126,7 +126,7 @@ page {
height: 124rpx; height: 124rpx;
width: 124rpx; width: 124rpx;
right: 30rpx; right: 30rpx;
bottom: 320rpx; bottom: 200rpx;
text-align: center; text-align: center;
z-index: 1000; z-index: 1000;
} }
@ -134,7 +134,7 @@ page {
.m_returnTop { .m_returnTop {
position: fixed; position: fixed;
right: 46rpx; right: 46rpx;
bottom: 160rpx; bottom: 100rpx;
z-index: 99; z-index: 99;
-webkit-transition: opacity 1s; -webkit-transition: opacity 1s;
transition: opacity 1s; transition: opacity 1s;

View File

@ -26,7 +26,7 @@
@tap="goto('/pages/users/upgradeVIP')"> @tap="goto('/pages/users/upgradeVIP')">
<block v-if="user.rank_id > 0"> <block v-if="user.rank_id > 0">
<view class="member">升级VIP尊贵特权</view> <view class="member">升级VIP尊贵特权</view>
<veiw class="equities">{{ user.deadline }}到期</veiw> <veiw class="equities">{{ user.deadline }}</veiw>
<view class="dredge bold">去续费</view> <view class="dredge bold">去续费</view>
</block> </block>
<block v-else> <block v-else>
@ -61,9 +61,9 @@
<span class="font_30 color-333">{{ item.title }}</span> <span class="font_30 color-333">{{ item.title }}</span>
</view> </view>
<view class="f-fc"> <view class="f-fc">
<view class="font_24 zf-tag-text color-theme" v-if="item.title == '会员中心'"> <view class=" zf-tag-text color-theme " v-if="item.title == '会员中心'">
<span v-if="user.deadline">{{ user.deadline }} 到期</span> <span v-if="user.deadline" class="font_24">{{ user.deadline }} </span>
<span v-else>未激活</span> <span v-else class="font_24">未激活</span>
</view> </view>
<image src="https://images.ufutx.com/202012/23/f9713dc39b5d236067834ea0f1a6edaf.png" mode="aspectFit" <image src="https://images.ufutx.com/202012/23/f9713dc39b5d236067834ea0f1a6edaf.png" mode="aspectFit"
class="icon flo_r"></image> class="icon flo_r"></image>
@ -634,7 +634,7 @@ wepy.page({
this.init = true this.init = true
this.user = data.user this.user = data.user
this.user.rank_id = data.rank_profile.rank_id this.user.rank_id = data.rank_profile.rank_id
this.user.deadline = data.rank_profile.deadline this.user.deadline = (data.rank_profile?.deadline).substring(0, 16)
// this.user.card_num = data.approve_profile.card_num // this.user.card_num = data.approve_profile.card_num
this.user.is_approved = data.approve_profile.is_approved this.user.is_approved = data.approve_profile.is_approved
this.user.is_real_approved = data.approve_profile.is_real_approved this.user.is_real_approved = data.approve_profile.is_real_approved
@ -1577,7 +1577,7 @@ page {
{ {
navigationBarTitleText: '我的', navigationBarTitleText: '我的',
navigationStyle: 'custom', navigationStyle: 'custom',
enablePullDownRefresh: false, enablePullDownRefresh: true,
backgroundColorTop: '#f2f2f2', backgroundColorTop: '#f2f2f2',
backgroundColorBottom: '#f2f2f2', backgroundColorBottom: '#f2f2f2',
usingComponents: { usingComponents: {

View File

@ -66,6 +66,7 @@ background: linear-gradient(270deg, #E6C7AB 0%, #F5E6D8 100%);">
style="width:{{100/index}}%"></view> style="width:{{100/index}}%"></view>
</block> </block>
</view> </view>
<view style="height: 80px"></view>
</view> </view>
<view style="height: 42px"></view> <view style="height: 42px"></view>
@ -114,14 +115,17 @@ background: linear-gradient(270deg, #E6C7AB 0%, #F5E6D8 100%);">
v-else>{{ deductionPrice > 0 ? deductionPrice : '0.00' }}</span> v-else>{{ deductionPrice > 0 ? deductionPrice : '0.00' }}</span>
</view> </view>
<view class="text-left f-fcc"> <view class="text-left f-fcc">
<span class="font_24" style="color: #3C2913;text-decoration-line: line-through;">原价:¥{{ payData.price }}</span> <span class="font_24" style="color: #3C2913;text-decoration-line: line-through;">原价:¥{{
payData.price
}}</span>
</view> </view>
<view class="item-xl text-left f-fcc"> <view class="item-xl text-left f-fcc">
<span class="font_24" style="color: #66676C;">{{ payData.title }}</span> <span class="font_24" style="color: #66676C;">{{ payData.title }}</span>
</view> </view>
<view class="m_payData f-fbc" @tap="payChoice('cash')"> <view class="m_payData f-fbc" @tap="payChoice('cash')">
<view class="f-fc"> <view class="f-fc">
<image class="u_payData_img" src="https://images.health.ufutx.com/202512/25/5bcd5b54fc5325aa50e841e0cf9542d0.png" <image class="u_payData_img"
src="https://images.health.ufutx.com/202512/25/5bcd5b54fc5325aa50e841e0cf9542d0.png"
mode="aspectFit" lazy-load="true"></image> mode="aspectFit" lazy-load="true"></image>
<view class="font_28" style="color: #0E0E0E;">微信支付</view> <view class="font_28" style="color: #0E0E0E;">微信支付</view>
</view> </view>
@ -212,6 +216,8 @@ wepy.page({
}, },
onShow() { onShow() {
let that = this
}, },
onLoad(e) { onLoad(e) {
@ -228,6 +234,7 @@ wepy.page({
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getPageData()
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
@ -242,7 +249,8 @@ wepy.page({
success: function (res) { success: function (res) {
wx.showToast({title: '转发成功', icon: 'success'}) wx.showToast({title: '转发成功', icon: 'success'})
}, },
fail: function (res) {} fail: function (res) {
}
} }
}, },
@ -279,6 +287,7 @@ wepy.page({
vm.worthShare() vm.worthShare()
} }
wx.hideLoading() wx.hideLoading()
wx.stopPullDownRefresh()
}).finally(() => { }).finally(() => {
this.loaded = false this.loaded = false
this.init = true this.init = true
@ -382,7 +391,8 @@ wepy.page({
return return
} }
that.trade_no = data.order?.trade_no that.trade_no = data?.order_no
console.log('---', that.trade_no)
// 测试订单直接回调 // 测试订单直接回调
if (data.length == 0 || data.config?.payment_debug) { if (data.length == 0 || data.config?.payment_debug) {
@ -394,14 +404,6 @@ wepy.page({
// iOS虚拟支付 // iOS虚拟支付
const virtualPayData = data || {} const virtualPayData = data || {}
console.log('virtualPayData', virtualPayData)
console.log({
signData: virtualPayData.sign_data,
paySig: virtualPayData.paySig || '',
signature: virtualPayData.signature || '',
mode: virtualPayData.mode || 'short_series_goods',
})
wx.requestVirtualPayment({ wx.requestVirtualPayment({
signData: virtualPayData.sign_data, signData: virtualPayData.sign_data,
paySig: virtualPayData.paySig || '', paySig: virtualPayData.paySig || '',
@ -410,12 +412,26 @@ wepy.page({
success(res) { success(res) {
console.log('requestVirtualPayment success', res) console.log('requestVirtualPayment success', res)
// 虚拟支付成功后回调 // 虚拟支付成功后回调
that.$post({url: `${service.host}/order/${that.trade_no}/callback`}).then(() => { that.$post({
that.getUserData() url: `${service.host}/order/callback/virtual`,
that.$Toast_success('支付成功') data: {orderNo: that.trade_no}
}).then(() => {
that.getPageData()
wx.showModal({ // 使用模态框提示用户进行操作
title: '支付完成',
content: '会员开通成功,权益将在几分钟内到账,到账后即可生效。',
showCancel: false,
confirmText: `知道了`,
success: function (res) {
if (res.confirm) {
let userInfo = wx.getStorageSync('userInfo') let userInfo = wx.getStorageSync('userInfo')
userInfo.rank_id = 9 userInfo.rank_id = 9
wx.setStorageSync('userInfo', userInfo) wx.setStorageSync('userInfo', userInfo)
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}) })
}, },
fail({errMsg, errCode}) { fail({errMsg, errCode}) {
@ -567,7 +583,8 @@ page {
.m_payData { .m_payData {
padding: 20px 20px; padding: 20px 20px;
margin: 32rpx;border-radius: 10px; margin: 32rpx;
border-radius: 10px;
background: #FBFAFC; background: #FBFAFC;
.u_payData_img { .u_payData_img {
@ -634,6 +651,7 @@ page {
.card-swiper { .card-swiper {
width: 100% !important; width: 100% !important;
.swiper-item { .swiper-item {
border-radius: 22rpx; border-radius: 22rpx;
} }
@ -650,25 +668,27 @@ page {
.payBtn { .payBtn {
position: relative; position: relative;
position: fixed; position: fixed;
bottom: 32rpx; bottom: 0rpx;
left: 0; left: 0;
height: 60px; //height: 60px;
width: 100%; width: 100%;
padding: 32rpx; padding: 22rpx 32rpx 46rpx 32rpx;
display: flex; display: flex;
background: #FFFFFF; background: #FFFFFF;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
box-shadow: 0 -6px 6px rgba(199, 213, 227, 0.4);
.l_text { .l_text {
color: var(--0-e-0-e-0-e, #0E0E0E); color: var(--0-e-0-e-0-e, #0E0E0E);
font-size: 12px; font-size: 14px;
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
line-height: normal; line-height: normal;
.price { .price {
color: var(--ff-2946, #FF2946);; color: var(--ff-2946, #FF2946);;
font-size: 20px; font-size: 26px;
font-style: normal; font-style: normal;
font-weight: 600; font-weight: 600;
line-height: normal; line-height: normal;
@ -681,7 +701,8 @@ page {
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 500;
line-height: normal;display: flex; line-height: normal;
display: flex;
padding: 12px 36px; padding: 12px 36px;
height: 92rpx; height: 92rpx;
justify-content: center; justify-content: center;
@ -783,7 +804,7 @@ page {
{ {
navigationBarTitleText: 'VIP服务', navigationBarTitleText: 'VIP服务',
navigationStyle: 'custom', navigationStyle: 'custom',
enablePullDownRefresh: false, enablePullDownRefresh: true,
backgroundColorTop: '#f2f2f2', backgroundColorTop: '#f2f2f2',
backgroundColorBottom: '#f2f2f2', backgroundColorBottom: '#f2f2f2',
usingComponents: { usingComponents: {