feat:支付选择优惠券

This commit is contained in:
dzc committed 2026-05-26 18:24:57 +08:00
1 parent bce6da0a0f
commit 150b8b3ac7
15 files changed
+591 -106

No files matched your search

+9
View File
@@ -19,4 +19,13 @@ export default {
method: "GET",
params,
}),
/**
* 用户领取核销券列表
*/
mchList: (data: any) =>
request({
url: "/wallet/act-coupon-record/app/mch-list",
method: "POST",
data,
}),
}
@@ -46,6 +46,7 @@ function getNavTop() {
}
function doToDashboard() {
tabbarStore.setRootActiveIndex(0)
router.jump("/pages/root/dashboard", {}, 3)
}
</script>
@@ -46,6 +46,7 @@ function doBackClick() {
}
function doToDashboard() {
tabbarStore.setRootActiveIndex(0)
router.jump("/pages/root/dashboard", {}, 3)
}
</script>
@@ -182,16 +182,17 @@ defineExpose({
<slot name="main-bottom"></slot>
</view>
</view>
<view class="layout_foot">
<tm-tabbar v-if="tabbarStore.isTabbar && tabbarStore.rootActiveIndex != 2" class="layout_foot"
:activeIndex="tabbarStore.activeIndex" :list="tabbarStore.pageTabbarList" :outIndex="-1" fontSize="12px"
iconSize="24px" bgColor="#F6F5FA" :zIndex="99999" darkBgColor="#F6F5FA" borderColor="#DBDDDE"
color="#8E8E8E" selected-color="#0094ff" position="fixed" @change="tabbarChange" />
<tm-tabbar v-else-if="tabbarStore.isDashboardPage" class="layout_foot"
:activeIndex="tabbarStore.rootActiveIndex" :list="tabbarStore.rootPageTabbarList" :outIndex="1"
fontSize="12px" iconSize="24px" bgColor="#F6F5FA" :zIndex="99999" darkBgColor="#F6F5FA"
borderColor="#DBDDDE" color="#8E8E8E" outBgColor="#0094ff" selected-color="#0094ff" position="fixed"
@change="rootTabbarChange" />
<view v-if="tabbarStore.isTabbar && tabbarStore.rootActiveIndex != 2" class="layout_foot">
<tm-tabbar class="layout_foot" :activeIndex="tabbarStore.activeIndex" :list="tabbarStore.pageTabbarList"
:outIndex="-1" fontSize="12px" iconSize="24px" bgColor="#F6F5FA" :zIndex="99999" darkBgColor="#F6F5FA"
borderColor="#DBDDDE" color="#8E8E8E" selected-color="#0094ff" position="fixed"
@change="tabbarChange" />
</view>
<view class="layout_foot" v-else-if="tabbarStore.isDashboardPage">
<tm-tabbar class="layout_foot" :activeIndex="tabbarStore.rootActiveIndex"
:list="tabbarStore.rootPageTabbarList" :outIndex="1" fontSize="12px" iconSize="24px" bgColor="#F6F5FA"
:zIndex="99999" darkBgColor="#F6F5FA" borderColor="#DBDDDE" color="#8E8E8E" outBgColor="#0094ff"
selected-color="#0094ff" position="fixed" @change="rootTabbarChange" />
</view>
<VerifyDeviceImpModel ref="verifyDeviceImpModelRef" :close="verifyDeviceImpModelClose" />
</view>
+89 -28
View File
@@ -1,33 +1,35 @@
<template>
<view class="bg-[#f5f5f5] px-8rpx py-16rpx rounded-4 fixed bottom-0 left-0 right-0 w-full">
<view class="flex justify-end">
<image v-if="show" class="w-[50rpx] h-[50rpx] mx-16rpx mb-8rpx" src="@/static/page/fold.svg"
@click="show = !show" />
<image v-if="!show" class="w-[50rpx] h-[50rpx] mx-16rpx mb-8rpx" src="@/static/page/unfold.svg"
@click="show = !show" />
</view>
<view v-if="show" class="flex mb-20rpx" v-for="(row, rowIndex) in keyboardLayout" :key="rowIndex">
<view
class="flex-1 h-[90rpx] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
v-for="(key, keyIndex) in row" :key="keyIndex" @click="handleKeyPress(key.toString())">
{{ key }}
<view class="keyboard-wrap">
<view class="keyboard-panel" :class="{ 'keyboard-panel--open': show }">
<view class="keyboard-toggle" @tap.stop="toggleShow">
<image class="keyboard-toggle__icon"
:src="show ? '/static/page/fold.svg' : '/static/page/unfold.svg'" />
</view>
</view>
<view v-if="show" class="flex mb-0rpx">
<view
class="flex-1 h-[90rpx] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
@click="handleKeyPress('.')">
.
</view>
<view
class="flex-auto h-[90rpx] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
@click="handleKeyPress('0')">
0
</view>
<view
class="flex-1 h-[90rpx] flex items-center justify-center bg-white mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
@click="handleDelete">
<image class="size-45rpx" src="@/static/page/keyboard-delete.svg" />
<view v-show="show" class="keyboard-content">
<view class="flex mb-20rpx" v-for="(row, rowIndex) in keyboardLayout" :key="rowIndex">
<view
class="flex-1 h-[90rpx] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
v-for="(key, keyIndex) in row" :key="keyIndex" @tap="handleKeyPress(key.toString())">
{{ key }}
</view>
</view>
<view class="flex mb-0rpx">
<view
class="flex-1 h-[90rpx] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
@tap="handleKeyPress('.')">
.
</view>
<view
class="flex-auto h-[90rpx] flex items-center justify-center bg-white text-2xl text-[#333] mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
@tap="handleKeyPress('0')">
0
</view>
<view
class="flex-1 h-[90rpx] flex items-center justify-center bg-white mx-[5px] rounded-lg cursor-pointer select-none active:bg-[#f0f0f0]"
@tap="handleDelete">
<image class="size-45rpx" src="@/static/page/keyboard-delete.svg" />
</view>
</view>
</view>
</view>
</view>
@@ -45,6 +47,10 @@ const keyboardLayout = ref([
])
const show = ref(true)
const toggleShow = () => {
show.value = !show.value
}
// 按下键盘
const handleKeyPress = (key) => {
if (key === "." && amount.value.includes(".")) return
@@ -74,3 +80,58 @@ const handleDelete = () => {
}
}
</script>
<style scoped lang="scss">
.keyboard-wrap {
--keyboard-toggle-size: 82rpx;
--keyboard-expanded-height: 538rpx;
position: fixed;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
z-index: 1000001;
}
.keyboard-panel {
position: absolute;
right: 0;
bottom: calc(var(--keyboard-expanded-height) - var(--keyboard-toggle-size));
width: 82rpx;
padding: 12rpx 0 12rpx 12rpx;
background: transparent;
overflow: hidden;
pointer-events: auto;
transition: width 0.2s ease, padding 0.2s ease, background-color 0.2s ease, bottom 0.2s ease;
&--open {
bottom: 0;
width: 100%;
padding: 12rpx;
background: #f5f5f5;
border-radius: 24rpx 24rpx 0 0;
box-shadow: 0 0 24rpx rgba(0, 0, 0, 0.08);
}
}
.keyboard-toggle {
width: 82rpx;
height: 82rpx;
margin-left: auto;
display: flex;
align-items: center;
justify-content: center;
background: #f5f5f5;
border-radius: 24rpx 0 0 24rpx;
box-shadow: 0 0 24rpx rgba(0, 0, 0, 0.08);
}
.keyboard-toggle__icon {
width: 50rpx;
height: 50rpx;
}
.keyboard-content {
margin-top: 12rpx;
}
</style>
+1
View File
@@ -76,6 +76,7 @@ const actUserReceiveEnum = {
"4": "已领取,核销码在我的礼券中",
"5": "用户不能参加此活动",
"6": "其他错误",
"7": "已领完",
"99": "用户可以参加活动",
// 特殊
"-100": "仅限生日当月使用",
+6 -1
View File
@@ -1,8 +1,13 @@
import { router } from ".."
import { getUrlParamsObj } from "../utils/app"
import { getUrlParamsObj, isDevEnv } from "../utils/app"
export function useScanCode(actModalShow) {
async function scanCodeAction(): Promise<string | undefined> {
if (isDevEnv()) {
const testQrCode = "https://stgl.pj.gov.cn/h5/#/pages/pay/scanPay?id=1931916121241079810"
uni.showModal({ content: "开发环境不是浙政钉和诗画环境,扫码仅供测试" })
return Promise.resolve(testQrCode)
}
const scanResult = await new Promise<string>((resolve, reject) => {
uni.scanCode({
success: (res) => {