feat:适配支付,第三方app

This commit is contained in:
dzc committed 2026-03-14 14:57:51 +08:00
1 parent 196ed0285a
commit 7ec67acded
22 files changed
+173 -119

No files matched your search

+2 -2
View File
@@ -9,11 +9,11 @@
fill="#2BCDA3" p-id="1709" data-spm-anchor-id="a313x.search_index.0.i2.beb13a81SVstw0"
class="selected"></path>
</svg>
<text class="text-36 mt-24rpx font-bold c-#333333!">支付成功</text>
<text class="text-36rpx mt-24rpx font-bold c-#333333!">支付成功</text>
</view>
<view class="flex-col-center m-b-60rpx">
<text class="text-90 c-#333333!">¥{{ scanPayData.payPrice }}</text>
<text class="text-90rpx c-#333333!">¥{{ scanPayData.payPrice }}</text>
</view>
<view class="w-full p-10rpx flex-col justify-center">
+6 -8
View File
@@ -1,31 +1,29 @@
<template>
<crud-layout title="支付" bg="/static/page/blue-bg.png">
<crud-layout :title="scanPayState.mchName" bg="/static/page/blue-bg.png">
<view class="h-screen flex flex-col">
<view class="mx-auto text-34 py-16rpx h-80rpx">{{ scanPayState.mchName }}</view>
<tm-sheet :margin="[0, 10]" class="flex flex-row">
<span class="text-2xl text-[#333] mr-8rpx line-height-normal">¥</span>
<span class="text-3xl font-medium text-[#333]">{{ displayAmount }}</span>
</tm-sheet>
<tm-sheet v-if="walletList.length > 0" :margin="[0, 10]" class="flex flex-col">
<view class="text-gray-700 font-bold text-28 mb-8rpx">选择支付钱包:</view>
<view class="text-gray-700 font-bold text-28rpx mb-8rpx">选择支付钱包:</view>
<view v-for="(v, index) in walletList" :key="index"
class="border-6 border-solid border-#efefef my-16rpx duration-200 flex justify-between items-center p-24rpx rounded-2"
:class="{ 'border-6 border-solid border-blue!': selectWallet.id == v.id }"
@click="selectWallet = v">
<view class="flex items-center">
<image class="w-70 h-70 mr-16rpx" :src="filePath(v.walletTypeIcon)" />
<view class="text-32">{{ v.walletTypeName }}</view>
<image class="size-70rpx mr-16rpx" :src="filePath(v.walletTypeIcon)" />
<view class="text-32rpx">{{ v.walletTypeName }}</view>
</view>
<view class="text-28 flex items-center">
<view class="text-28rpx flex items-center">
<view>余额:</view>
<text class="main-text-28">{{ hooks.useMoney(v.balance) }} 元</text>
</view>
</view>
</tm-sheet>
<tm-button class="mt-8rpx" :block="true" @click="handlePay()" :disabled="loading">支 付</tm-button>
<tm-button class="mt-30rpx" :block="true" @click="handlePay()" :disabled="loading">支 付</tm-button>
<number-keyboard v-if="numberKeyboardShow" v-model="amount" />
</view>
+4 -3
View File
@@ -1,5 +1,5 @@
<template>
<crud-layout mainIsScroll bg="/static/page/blue-bg.png">
<crud-layout title="共富商城" mainIsScroll bg="/static/page/blue-bg.png">
<swiper class="w-full h-500rpx" circular :indicator-dots="true" indicator-active-color="#0779FD"
indicator-color="#ffffff" :autoplay="true">
<swiper-item v-for="(v, i) in goodsDetail.carouselImages?.split(',')" :key="i">
@@ -21,8 +21,9 @@
</view>
<view class="main-text-32 c-red! font-italic">
<text>约省</text>
<text class="text-44rpx mx-8rpx">{{ displayPrice(Number(goodsDetail.originalPrice) -
Number(goodsDetail.spuPrice), "") }}</text>
<text class="text-44rpx mx-8rpx">
{{ displayPrice(Number(goodsDetail.originalPrice) - Number(goodsDetail.spuPrice), "") }}
</text>
<text>元</text>
</view>
</view>
+18 -14
View File
@@ -1,30 +1,32 @@
<template>
<crud-layout mainIsScroll bg="/static/page/blue-bg.png">
<crud-layout title="共富商城" mainIsScroll bg="/static/page/blue-bg.png">
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="10"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
<template #top>
<view class="w-full my-16rpx">
<view
class="w-full my-16rpx flex items-center mb-16rpx border-4rpx border-solid border-#0779fd rounded-14rpx p-r-10rpx">
<tm-input class="flex-1" v-model="state.params.keyword" type="text" height="72" minHeight="72"
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商品名称"
style="border: 4rpx solid #0779fd; border-radius: 14rpx" :focus-highlight="false"
color="#ECF4F9">
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商品名称" :focus-highlight="false"
color="#ECF4F9" width="100%">
<template v-slot:rightIcon>
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">搜
索</tm-button>
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">
搜索
</tm-button>
</template>
</tm-input>
</view>
</template>
<view v-for="v in pageHook.list" :key="v.id" class="card flex mx-20rpx mb-16rpx p-16rpx"
<view v-for="v in pageHook.list" :key="v.id" class="card flex mb-16rpx p-16rpx"
@click="doGoodsDetail(v.id)">
<image :src="filePath(v.coverImage)" class="size-160rpx rounded-12rpx bg-#eeeeee" mode="aspectFill" />
<view class="flex-1 ml-16rpx overflow-hidden">
<view class="truncate sub-text-30">{{ v.title }}</view>
<view>
<text class="c-#0094ff! sub-text-24 px-16rpx bg-#0094ff22 rounded-2">{{ v.status == "0" ? "在售" :
"未售" }}</text>
<text class="c-#0094ff! sub-text-24 px-16rpx bg-#0094ff22 rounded-2">
{{ v.status == "0" ? "在售" : "未售" }}
</text>
</view>
<view>
<text class="second-text-26 mr-16rpx">单位 {{ v.unit }}</text>
@@ -38,10 +40,12 @@
</text>
<text class="color-red">
<text class="text-26rpx">¥</text>
<text class="text-32rpx font-bold">{{ displayPrice(v.spuPrice, "").split(".")[0]
}}.</text>
<text class="text-30rpx font-bold">{{ displayPrice(v.spuPrice, "").split(".")[1]
}}</text>
<text class="text-32rpx font-bold">
{{ displayPrice(v.spuPrice, "").split(".")[0] }}.
</text>
<text class="text-30rpx font-bold">
{{ displayPrice(v.spuPrice, "").split(".")[1] }}
</text>
</text>
</template>
<template v-else>
+4 -4
View File
@@ -1,11 +1,11 @@
<template>
<crud-layout mainIsScroll bg="/static/page/blue-bg.png" @scroll="onScroll">
<crud-layout title="共富商城" mainIsScroll bg="/static/page/blue-bg.png" @scroll="onScroll">
<view class="w-full h-400rpx relative">
<image :src="filePath(mchDetail.images)" class="w-full h-full bg-#eeeeee" mode="aspectFill" />
<view class="absolute w-full h-full top-0 left-0" :style="filterStyle"></view>
</view>
<view
class="fixed right-160rpx h-72rpx bg-#ECF4F9cc px-20rpx top-160rpx flex items-center flex-nowrap overflow-hidden rounded-20rpx"
<view v-if="visible"
class="fixed right-20rpx h-72rpx bg-#ECF4F9cc px-20rpx top-120rpx flex items-center flex-nowrap overflow-hidden rounded-20rpx"
:style="searchStyle" @click="goSearch">
<image class="w-36rpx h-36rpx" src="@/static/page/shop-goods-search.png" />
<text v-if="scrollDetail.scrollTop > 30"
@@ -121,7 +121,7 @@ const state = reactive<any>({
})
const mchDetail = computed(() => state.mchDetail)
const { scrollDetail, onScroll, filterStyle, searchStyle } = useShopDetailScroll()
const { scrollDetail, onScroll, visible, filterStyle, searchStyle } = useShopDetailScroll()
const { totPrice, totalCount, skuAddToCart, getShopCart, goSettlement } = useCartBuy()
onLoad(async (option: any) => {
@@ -11,8 +11,14 @@ interface scrollDetail {
export default function useShopDetailScroll() {
const scrollDetail = ref<scrollDetail>({} as scrollDetail)
const visible = ref<boolean>(true)
const onScroll = (e: any) => {
if (e.detail.scrollTop > 250) {
visible.value = false
} else {
visible.value = true
}
scrollDetail.value = e.detail
}
@@ -41,5 +47,5 @@ export default function useShopDetailScroll() {
}
})
return { scrollDetail, onScroll, filterStyle, searchStyle }
return { scrollDetail, visible, onScroll, filterStyle, searchStyle }
}
+4 -1
View File
@@ -48,7 +48,10 @@ onHide(() => {
})
const doMenu = async (v: any) => {
console.log("tabbarStore:", tabbarStore);
if (v.page.includes("thirdApp")) {
router.jump("/pages/third-app/happyMall")
return
}
await tabbarStore.componetTabbarList(v.page)
tabbarStore.jumpFirstTabbar()
}
+24
View File
@@ -0,0 +1,24 @@
<script setup lang="ts">
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
const state = reactive({
url: ""
})
onLoad((options: any) => {
if (options.url) {
state.url = decodeURIComponent(options.url)
}
})
</script>
<template>
<crud-layout mainIsScroll tabBarType="just-flot-back">
<web-view :update-title="false" :fullscreen="false" :webview-styles="{
width: '100%',
height: '100%',
backgroundColor: '#fff'
}" :src="state.url" />
</crud-layout>
</template>
+4 -3
View File
@@ -61,7 +61,7 @@ const toDetail = async (v: any) => {
</script>
<template>
<crud-layout bg="/static/page/blue-bg.png">
<crud-layout title="合作商家" bg="/static/page/blue-bg.png">
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="10"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
@@ -72,8 +72,9 @@ const toDetail = async (v: any) => {
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商家名称" width="100%"
:focus-highlight="false" color="#ECF4F9">
<template v-slot:rightIcon>
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">搜
索</tm-button>
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">
搜索
</tm-button>
</template>
</tm-input>
</view>
+27 -11
View File
@@ -1,14 +1,25 @@
<template>
<crud-layout title="我的" mainIsScroll bg="/static/page/blue-bg.png">
<template #main-top>
<view class="flex items-center py-24rpx mx-30rpx">
<image v-if="state.userInfo?.sysUser?.avatar && false" class="size-100rpx rounded-full"
:src="filePath(state.userInfo.sysUser.avatar)" mode="aspectFill" />
<image v-else class="w-100rpx h-100rpx rounded-full" src="/static/icon/default-avatar.png"
mode="aspectFill" />
<view class="ml-30rpx" v-if="state.userInfo?.sysUser?.userId">
<view class="sub-text-30">{{ state.userInfo?.sysUser?.name }}</view>
<view class="sub-text-26">ID {{ state.userInfo?.sysUser?.userId }}</view>
<view class="flex items-center py-24rpx px-40rpx" @tap="doUserArea">
<view class="flex items-center" v-if="state.userInfo?.sysUser?.userId">
<image v-if="state.userInfo?.sysUser?.avatar" class="size-100rpx rounded-full"
:src="filePath(state.userInfo.sysUser.avatar)" mode="aspectFill" />
<image v-else class="w-100rpx h-100rpx rounded-full" src="/static/icon/default-avatar.png"
mode="aspectFill" />
<view class="ml-30rpx">
<view class="flex items-center">
<view class="sub-text-30">{{ state.userInfo?.sysUser?.name }}</view>
<view v-if="state.userInfo?.sysUser?.birthday"
class="ml-20rpx flex items-center bg-#FFFFFF px-16rpx py-6rpx rounded-full shadow-sm">
<image class="size-32rpx mr-8rpx" src="/static/icon/birthday.png" mode="aspectFit" />
<text class="text-24rpx color-blue font-bold lh-1">
{{ dayjs(state.userInfo.sysUser.birthday).format("MM-DD") }}
</text>
</view>
</view>
<view class="m-t-5rpx sub-text-26">ID {{ state.userInfo?.sysUser?.userId }}</view>
</view>
</view>
<view v-else class="flex items-center ml-30rpx" @tap="onTabLogin">
<text class="sub-text-32">请先登录</text>
@@ -42,6 +53,8 @@
</view>
</crud-layout>
<modify-user ref="modifyUserRef" warnText="填写出生日期即可领取生日兑换券" @close="storage.getUserInfo" />
<tm-modal :show="state.actModalShow" :showCancel="false" title="核销活动兑换券" zIndex="999" @confirm="" @cancel=""
@close="">
<view class="text-center text-28">是否核销该活动兑换券?</view>
@@ -56,7 +69,7 @@
</template>
<script setup lang="ts">
import { reactive, computed } from "vue"
import { ref, reactive, computed } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
import dayjs from "dayjs"
@@ -66,6 +79,9 @@ import { hooks, router, constant } from "@@/index"
import { accessStatsApi, actCancelApi, userApi } from "@@/api"
import { APPENV } from "@/sheep/constant"
import ModifyUser from "@@/components/modify-user.vue"
const modifyUserRef = ref(null)
const state = reactive<any>({
wallet: [],
userInfo: {},
@@ -307,8 +323,8 @@ const onTabMenu = async (item: any) => {
}
}
const onNavRightClick = () => {
router.jump("/pages/setting/index")
const doUserArea = () => {
modifyUserRef.value?.open()
}
// 退出登录
+13 -10
View File
@@ -1,5 +1,5 @@
<template>
<crud-layout bg="/static/page/blue-bg.png">
<crud-layout title="共富商城" bg="/static/page/blue-bg.png">
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="10"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
@@ -14,8 +14,9 @@
fontSize="28" :showClear="true" :focus="false" placeholder="请输入超市名称" :focus-highlight="false"
color="#ECF4F9" width="100%">
<template v-slot:rightIcon>
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">搜
索</tm-button>
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">
搜索
</tm-button>
</template>
</tm-input>
</view>
@@ -41,23 +42,25 @@
</view>
</view>
<scroll-view scroll-x>
<view class="flex mt-16rpx">
<view class="h-20rpx"></view>
<view class="flex">
<view class="w-180rpx flex-col items-center mr-20rpx" v-for="(pV, pI) in v.featuredProducts"
:key="pI">
<image class="size-180rpx rounded-12rpx bg-#eeeeee" :src="filePath(pV.coverImage)"
mode="aspectFill" />
<view class="w-full mt-4rpx sub-text-24 truncate">{{ pV.title }}</view>
<view class="w-full flex justify-between">
<text class="text-26 color-red!">
<text class="text-26rpx color-red!">
<text class="text-22rpx">¥</text>
<text>{{ pV.priceType == "1" ? displayPrice(pV.minPrice, "") :
displayPrice(pV.spuPrice, "")
}}</text>
<text>
{{ pV.priceType == "1" ? displayPrice(pV.minPrice, "")
: displayPrice(pV.spuPrice, "") }}
</text>
</text>
</view>
<view class="w-full flex justify-between second-text-24">
<text>库存{{ pV.totalStock }}</text>
<text>{{ pV.status ? "已停售" : "在售" }}</text>
<view>库存{{ pV.totalStock }}</view>
<view>{{ pV.status ? "已停售" : "在售" }}</view>
</view>
</view>
</view>
+8 -7
View File
@@ -69,20 +69,21 @@ const toDetail = async (v: any) => {
</script>
<template>
<crud-layout bg="/static/page/blue-bg.png">
<crud-layout title="共富商家" bg="/static/page/blue-bg.png">
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="10"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
<template #top>
<view class="h-30rpx" />
<view class="flex w-full">
<view
class="flex w-full items-center mb-16rpx border-4rpx border-solid border-#0779fd rounded-14rpx p-r-10rpx">
<tm-input class="flex-1" v-model="state.pa.name" type="text" height="72" minHeight="72"
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商家名称"
style="border: 4rpx solid #0779fd; border-radius: 14rpx" :focus-highlight="false"
color="#ECF4F9">
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商家名称" :focus-highlight="false"
color="#ECF4F9" width="100%">
<template v-slot:rightIcon>
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">搜
索</tm-button>
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">
搜索
</tm-button>
</template>
</tm-input>
</view>
+1 -1
View File
@@ -34,7 +34,7 @@ const toDetail = async (v: any) => {
</script>
<template>
<crud-layout bg="/static/page/blue-bg.png">
<crud-layout title="自营商家" bg="/static/page/blue-bg.png">
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="10"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">