充值页面调整

商品折扣显示逻辑调整
增加公众号跳转修改资料逻辑
This commit is contained in:
Waiting 2024-05-10 17:51:30 +08:00
parent dccdd43e3a
commit 74dba2ef29
7 changed files with 133 additions and 46 deletions

View File

@ -27,6 +27,14 @@ onLaunch((options) => {
if(params.split('=')[0] === 'storeId') {
setRegisterStoreId(params.split('=')[1]);
}
if(options?.query.scene === 'edit_avatar_nickname') {
setTimeout(()=>{
uni.reLaunch({
url: '/pages/mine/subs/profile/index'
});
},500)
}
}
}

View File

@ -23,7 +23,7 @@
<image class='goods-image' :src='item.images||defaultImage' />
<text class='goods-name'>{{ item.goodsName || '未知' }}</text>
<text class='goods-price'>¥{{ (item.price * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
<text v-if='userInfo.levelEntity?.discount>0'
<text v-if='userInfo.levelEntity?.discount>0&&userInfo.levelEntity?.discount<100'
style='text-decoration: line-through;color: #999999;font-size: 25rpx'>¥{{ item.price }}
</text>
</text>

View File

@ -16,7 +16,7 @@
<view class='c-flex-row'>
<text class='goods-price accent-text-color'>
¥{{ ((goodsBean?.price || 0) * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
<text v-if='userInfo.levelEntity?.discount>0'
<text v-if='userInfo.levelEntity?.discount>0&&userInfo.levelEntity?.discount<100'
style='display:unset;text-decoration: line-through;font-size: 30rpx;color: #999999'>
¥{{ goodsBean?.price || 0 }}
</text>
@ -57,7 +57,7 @@
<image :src='item.images||defaultImage' />
<text>{{ item.goodsName || '未知' }}</text>
<text class='goods-price'>{{ (item.price * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
<text v-if='userInfo.levelEntity?.discount>0'
<text v-if='userInfo.levelEntity?.discount>0&&userInfo.levelEntity?.discount<100'
style='text-decoration: line-through;font-size: 25rpx;color: #999999'>{{ item.price }}
</text>
</text>

View File

@ -14,7 +14,7 @@
<image class='goods-image' :src='item.images||defaultImage' />
<text class='goods-name'>{{ item.goodsName || '未知' }}</text>
<text class='goods-price'>¥{{ (item.price * ((userInfo.levelEntity?.discount || 100)/100)).toFixed(2) }}
<text v-if='userInfo.levelEntity?.discount>0'
<text v-if='userInfo.levelEntity?.discount>0&&userInfo.levelEntity?.discount<100'
style='text-decoration: line-through;color: #999999;font-size: 25rpx'>¥{{ item.price }}
</text>
</text>

View File

@ -26,7 +26,7 @@
</view>
<text style='margin-top: 50rpx'>
{{ (item?.price * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
<text v-if='userInfo.levelEntity?.discount>0'
<text v-if='userInfo.levelEntity?.discount>0&&userInfo.levelEntity?.discount<100'
style='text-decoration: line-through;color: #999999;font-size: 25rpx'>¥{{ item?.price }}
</text>
</text>

View File

@ -13,17 +13,30 @@
</view>
<view class='recharge-option-card'>
<text>充值金额</text>
<tabbar :titles='rechargeItems?.map(res=>res.rechargeamount)' @change='change' />
<view class='divider' />
<view class='option-item'>
<image :src='assetsUrl("bg_member_recharge_item.png")' />
<text>充值{{ rechargeItems[currentIndex]?.rechargeamount }}{{ rechargeItems[currentIndex]?.rewardamount }}
<view class='top-border'></view>
<text class='title'>充值金额</text>
<scroll-view scroll-y style='flex: 1;padding-bottom: 180rpx'>
<view class='option-item' :class="{'option-item-active': currentIndex==index}"
v-for='(item,index) in rechargeItems' :key='index' @click.stop='change(index)'>
<image v-if='currentIndex==index' class='checked-image' src='/static/images/ic_recharge_checked.png' />
<label class='amount-title'>{{ item.rechargeamount }}</label>
<view class='divider' style='margin-bottom: 36rpx' />
<view class='card-view'>
<view class='title-container'>
<text>充值{{ item?.rechargeamount || 0 }}{{ item?.rewardamount || 0
}}
</text>
<text class='accent-text-color'>
实得{{ rechargeItems[currentIndex]?.rechargeamount + (rechargeItems[currentIndex]?.rewardamount) }}
实得{{ item?.rechargeamount + (item?.rewardamount) }}
</text>
</view>
<text class='description'>{{ item.rewardamount || 0 }}{{ item.rewardcouponamount || 0
}}元优惠券共{{ item.rewardcouponnum || 0 }}
返利{{ item.rewardrefundamount || 0 }}
</text>
</view>
</view>
</scroll-view>
</view>
<view class='bottom-button-view'>
@ -47,7 +60,7 @@
<script lang='ts' setup>
import { assetsUrl } from '@/utils/assets';
import { useUserStore } from '@/store';
import { getRechargeList, preRecharge, recharge, rechargeVerify } from '@/api/user';
import { getRechargeList, preRecharge, rechargeVerify } from '@/api/user';
import { parseParameter, sortASCII } from '@/utils';
import { hexMD5 } from '@/utils/common/md5';
import { handlePayResult } from '@/utils/order';
@ -55,12 +68,16 @@ import { handlePayResult } from '@/utils/order';
const userState = useUserStore();
const { userInfo, terminalInfo } = storeToRefs(userState);
const rechargeOptionBackgroundUrl = assetsUrl('bg_member_recharge_item.png');
const rechargeItems = ref<{
itemid: string
rechargeamount: number
rewardamount: number
rewardcouponamount: number,
rechargetype: number
rewardcouponnum: number
rechargetype: number,
rewardrefundamount: number
}[]>([]);
const currentIndex = ref<number>(0);
const preRechargeOrderId = ref();
@ -68,6 +85,12 @@ const preRechargeOrderId = ref();
onLoad(async () => {
const { ruleitems } = await getRechargeList();
rechargeItems.value = ruleitems;
// rechargeItems.value.push(rechargeItems.value[0]);
// rechargeItems.value.push(rechargeItems.value[0]);
// rechargeItems.value.push(rechargeItems.value[0]);
// rechargeItems.value.push(rechargeItems.value[0]);
console.log(rechargeItems.value);
await change(0);
});
@ -158,53 +181,109 @@ const goRecharge = async () => {
.recharge-option-card {
display: flex;
flex-direction: column;
background: #FFFFFF;
border-radius: 30rpx 30rpx 0 0;
background: #F5F5F5;
position: relative;
margin-top: -25rpx;
//margin-top: -25rpx;
text:nth-of-type(1) {
.top-border {
background: #FFFFFF;
height: 30rpx;
margin-top: -35rpx;
border-radius: 30rpx 30rpx 0 0;
}
.title {
font-size: 30rpx;
font-weight: bold;
color: #333333;
margin-top: 20rpx;
margin-left: 30rpx;
background: #FFFFFF;
border-radius: 10rpx 10rpx 0 0;
padding: 10rpx 20rpx 20rpx 20rpx;
margin-bottom: 20rpx;
margin-top: -15rpx;
}
.option-item {
display: flex;
flex-direction: column;
margin: 10rpx 20rpx 20rpx 20rpx;
background: #FFFFFF;
border-radius: 20rpx;
padding-top: 20rpx;
box-sizing: border-box;
border: solid #00000000 2rpx;
position: relative;
margin: 36rpx 20rpx;
image {
.amount-title {
font-weight: bold;
font-size: 40rpx;
width: fit-content;
color: #333333;
margin-left: 30rpx;
}
.amount-title:after {
content: "";
display: block;
border: 2rpx solid black;
}
.checked-image {
width: 70rpx;
height: 70rpx;
position: absolute;
right: 0;
top: 0;
border-radius: 0 18rpx 0 0
}
.card-view {
display: flex;
flex-direction: column;
width: 100%;
height: 167rpx;
border-radius: 20rpx;
}
//background-image: url(v-bind(rechargeOptionBackgroundUrl));
background-image: url('https://img.lakeapp.cn/wx/images/bg_member_recharge_item.png');
background-size: 100% 100%;
justify-content: flex-start;
color: #FFFFFF;
.title-container {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-top: 27rpx;
padding: 0 30rpx;
text:nth-of-type(1) {
display: flex;
font-size: 36rpx;
color: #FFFFFF;
margin-top: 27rpx;
margin-left: 30rpx;
position: absolute;
}
text:nth-of-type(2) {
display: flex;
font-size: 30rpx;
margin-top: 85rpx;
margin-left: 30rpx;
align-items: center;
justify-content: center;
width: 185rpx;
height: 50rpx;
background: #FFFFFF;
border-radius: 25rpx;
position: absolute;
}
}
.description {
margin-top: 30rpx;
margin-left: 30rpx;
}
}
}
.option-item-active {
@extend .option-item;
border: 2rpx solid #f95e5d;
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB