feat:适配支付,第三方app
This commit is contained in:
1 parent
196ed0285a
commit
7ec67acded
22 files changed
+173
-119
No files matched your search
+2
-2
@@ -21,8 +21,8 @@ export default {
|
|||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
console.log("App Hide");
|
console.log("App Hide");
|
||||||
const _this = this;
|
// const _this = this;
|
||||||
wx.offAppRoute(_this.watchRouter)
|
// wx.offAppRoute(_this.watchRouter)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async watchRouter(route) {
|
async watchRouter(route) {
|
||||||
|
|||||||
@@ -92,6 +92,13 @@
|
|||||||
"navigationBarTitleText": "账号密码登录",
|
"navigationBarTitleText": "账号密码登录",
|
||||||
"disableScroll": true
|
"disableScroll": true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/root/web-view",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "webview页面",
|
||||||
|
"disableScroll": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
@@ -440,6 +447,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"root": "pages/third-app",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "happyMall",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "美好商城"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
@@ -9,11 +9,11 @@
|
|||||||
fill="#2BCDA3" p-id="1709" data-spm-anchor-id="a313x.search_index.0.i2.beb13a81SVstw0"
|
fill="#2BCDA3" p-id="1709" data-spm-anchor-id="a313x.search_index.0.i2.beb13a81SVstw0"
|
||||||
class="selected"></path>
|
class="selected"></path>
|
||||||
</svg>
|
</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>
|
||||||
|
|
||||||
<view class="flex-col-center m-b-60rpx">
|
<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>
|
||||||
|
|
||||||
<view class="w-full p-10rpx flex-col justify-center">
|
<view class="w-full p-10rpx flex-col justify-center">
|
||||||
|
|||||||
@@ -1,31 +1,29 @@
|
|||||||
<template>
|
<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="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">
|
<tm-sheet :margin="[0, 10]" class="flex flex-row">
|
||||||
<span class="text-2xl text-[#333] mr-8rpx line-height-normal">¥</span>
|
<span class="text-2xl text-[#333] mr-8rpx line-height-normal">¥</span>
|
||||||
<span class="text-3xl font-medium text-[#333]">{{ displayAmount }}</span>
|
<span class="text-3xl font-medium text-[#333]">{{ displayAmount }}</span>
|
||||||
</tm-sheet>
|
</tm-sheet>
|
||||||
|
|
||||||
<tm-sheet v-if="walletList.length > 0" :margin="[0, 10]" class="flex flex-col">
|
<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"
|
<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-#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 }"
|
:class="{ 'border-6 border-solid border-blue!': selectWallet.id == v.id }"
|
||||||
@click="selectWallet = v">
|
@click="selectWallet = v">
|
||||||
<view class="flex items-center">
|
<view class="flex items-center">
|
||||||
<image class="w-70 h-70 mr-16rpx" :src="filePath(v.walletTypeIcon)" />
|
<image class="size-70rpx mr-16rpx" :src="filePath(v.walletTypeIcon)" />
|
||||||
<view class="text-32">{{ v.walletTypeName }}</view>
|
<view class="text-32rpx">{{ v.walletTypeName }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-28 flex items-center">
|
<view class="text-28rpx flex items-center">
|
||||||
<view>余额:</view>
|
<view>余额:</view>
|
||||||
<text class="main-text-28">{{ hooks.useMoney(v.balance) }} 元</text>
|
<text class="main-text-28">{{ hooks.useMoney(v.balance) }} 元</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</tm-sheet>
|
</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" />
|
<number-keyboard v-if="numberKeyboardShow" v-model="amount" />
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<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"
|
<swiper class="w-full h-500rpx" circular :indicator-dots="true" indicator-active-color="#0779FD"
|
||||||
indicator-color="#ffffff" :autoplay="true">
|
indicator-color="#ffffff" :autoplay="true">
|
||||||
<swiper-item v-for="(v, i) in goodsDetail.carouselImages?.split(',')" :key="i">
|
<swiper-item v-for="(v, i) in goodsDetail.carouselImages?.split(',')" :key="i">
|
||||||
@@ -21,8 +21,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="main-text-32 c-red! font-italic">
|
<view class="main-text-32 c-red! font-italic">
|
||||||
<text>约省</text>
|
<text>约省</text>
|
||||||
<text class="text-44rpx mx-8rpx">{{ displayPrice(Number(goodsDetail.originalPrice) -
|
<text class="text-44rpx mx-8rpx">
|
||||||
Number(goodsDetail.spuPrice), "") }}</text>
|
{{ displayPrice(Number(goodsDetail.originalPrice) - Number(goodsDetail.spuPrice), "") }}
|
||||||
|
</text>
|
||||||
<text>元</text>
|
<text>元</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1,30 +1,32 @@
|
|||||||
<template>
|
<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"
|
<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"
|
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">
|
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
|
||||||
<template #top>
|
<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"
|
<tm-input class="flex-1" v-model="state.params.keyword" type="text" height="72" minHeight="72"
|
||||||
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商品名称"
|
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商品名称" :focus-highlight="false"
|
||||||
style="border: 4rpx solid #0779fd; border-radius: 14rpx" :focus-highlight="false"
|
color="#ECF4F9" width="100%">
|
||||||
color="#ECF4F9">
|
|
||||||
<template v-slot:rightIcon>
|
<template v-slot:rightIcon>
|
||||||
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">搜
|
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">
|
||||||
索</tm-button>
|
搜索
|
||||||
|
</tm-button>
|
||||||
</template>
|
</template>
|
||||||
</tm-input>
|
</tm-input>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</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)">
|
@click="doGoodsDetail(v.id)">
|
||||||
<image :src="filePath(v.coverImage)" class="size-160rpx rounded-12rpx bg-#eeeeee" mode="aspectFill" />
|
<image :src="filePath(v.coverImage)" class="size-160rpx rounded-12rpx bg-#eeeeee" mode="aspectFill" />
|
||||||
<view class="flex-1 ml-16rpx overflow-hidden">
|
<view class="flex-1 ml-16rpx overflow-hidden">
|
||||||
<view class="truncate sub-text-30">{{ v.title }}</view>
|
<view class="truncate sub-text-30">{{ v.title }}</view>
|
||||||
<view>
|
<view>
|
||||||
<text class="c-#0094ff! sub-text-24 px-16rpx bg-#0094ff22 rounded-2">{{ v.status == "0" ? "在售" :
|
<text class="c-#0094ff! sub-text-24 px-16rpx bg-#0094ff22 rounded-2">
|
||||||
"未售" }}</text>
|
{{ v.status == "0" ? "在售" : "未售" }}
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<text class="second-text-26 mr-16rpx">单位 {{ v.unit }}</text>
|
<text class="second-text-26 mr-16rpx">单位 {{ v.unit }}</text>
|
||||||
@@ -38,10 +40,12 @@
|
|||||||
</text>
|
</text>
|
||||||
<text class="color-red">
|
<text class="color-red">
|
||||||
<text class="text-26rpx">¥</text>
|
<text class="text-26rpx">¥</text>
|
||||||
<text class="text-32rpx font-bold">{{ displayPrice(v.spuPrice, "").split(".")[0]
|
<text class="text-32rpx font-bold">
|
||||||
}}.</text>
|
{{ displayPrice(v.spuPrice, "").split(".")[0] }}.
|
||||||
<text class="text-30rpx font-bold">{{ displayPrice(v.spuPrice, "").split(".")[1]
|
</text>
|
||||||
}}</text>
|
<text class="text-30rpx font-bold">
|
||||||
|
{{ displayPrice(v.spuPrice, "").split(".")[1] }}
|
||||||
|
</text>
|
||||||
</text>
|
</text>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<template>
|
<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">
|
<view class="w-full h-400rpx relative">
|
||||||
<image :src="filePath(mchDetail.images)" class="w-full h-full bg-#eeeeee" mode="aspectFill" />
|
<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 class="absolute w-full h-full top-0 left-0" :style="filterStyle"></view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view v-if="visible"
|
||||||
class="fixed right-160rpx h-72rpx bg-#ECF4F9cc px-20rpx top-160rpx flex items-center flex-nowrap overflow-hidden rounded-20rpx"
|
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">
|
:style="searchStyle" @click="goSearch">
|
||||||
<image class="w-36rpx h-36rpx" src="@/static/page/shop-goods-search.png" />
|
<image class="w-36rpx h-36rpx" src="@/static/page/shop-goods-search.png" />
|
||||||
<text v-if="scrollDetail.scrollTop > 30"
|
<text v-if="scrollDetail.scrollTop > 30"
|
||||||
@@ -121,7 +121,7 @@ const state = reactive<any>({
|
|||||||
})
|
})
|
||||||
const mchDetail = computed(() => state.mchDetail)
|
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()
|
const { totPrice, totalCount, skuAddToCart, getShopCart, goSettlement } = useCartBuy()
|
||||||
|
|
||||||
onLoad(async (option: any) => {
|
onLoad(async (option: any) => {
|
||||||
|
|||||||
@@ -11,8 +11,14 @@ interface scrollDetail {
|
|||||||
|
|
||||||
export default function useShopDetailScroll() {
|
export default function useShopDetailScroll() {
|
||||||
const scrollDetail = ref<scrollDetail>({} as scrollDetail)
|
const scrollDetail = ref<scrollDetail>({} as scrollDetail)
|
||||||
|
const visible = ref<boolean>(true)
|
||||||
|
|
||||||
const onScroll = (e: any) => {
|
const onScroll = (e: any) => {
|
||||||
|
if (e.detail.scrollTop > 250) {
|
||||||
|
visible.value = false
|
||||||
|
} else {
|
||||||
|
visible.value = true
|
||||||
|
}
|
||||||
scrollDetail.value = e.detail
|
scrollDetail.value = e.detail
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,5 +47,5 @@ export default function useShopDetailScroll() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return { scrollDetail, onScroll, filterStyle, searchStyle }
|
return { scrollDetail, visible, onScroll, filterStyle, searchStyle }
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,10 @@ onHide(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const doMenu = async (v: any) => {
|
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)
|
await tabbarStore.componetTabbarList(v.page)
|
||||||
tabbarStore.jumpFirstTabbar()
|
tabbarStore.jumpFirstTabbar()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -61,7 +61,7 @@ const toDetail = async (v: any) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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"
|
<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"
|
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">
|
: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%"
|
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商家名称" width="100%"
|
||||||
:focus-highlight="false" color="#ECF4F9">
|
:focus-highlight="false" color="#ECF4F9">
|
||||||
<template v-slot:rightIcon>
|
<template v-slot:rightIcon>
|
||||||
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">搜
|
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">
|
||||||
索</tm-button>
|
搜索
|
||||||
|
</tm-button>
|
||||||
</template>
|
</template>
|
||||||
</tm-input>
|
</tm-input>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
+27
-11
@@ -1,14 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<crud-layout title="我的" mainIsScroll bg="/static/page/blue-bg.png">
|
<crud-layout title="我的" mainIsScroll bg="/static/page/blue-bg.png">
|
||||||
<template #main-top>
|
<template #main-top>
|
||||||
<view class="flex items-center py-24rpx mx-30rpx">
|
<view class="flex items-center py-24rpx px-40rpx" @tap="doUserArea">
|
||||||
<image v-if="state.userInfo?.sysUser?.avatar && false" class="size-100rpx rounded-full"
|
<view class="flex items-center" v-if="state.userInfo?.sysUser?.userId">
|
||||||
:src="filePath(state.userInfo.sysUser.avatar)" mode="aspectFill" />
|
<image v-if="state.userInfo?.sysUser?.avatar" class="size-100rpx rounded-full"
|
||||||
<image v-else class="w-100rpx h-100rpx rounded-full" src="/static/icon/default-avatar.png"
|
:src="filePath(state.userInfo.sysUser.avatar)" mode="aspectFill" />
|
||||||
mode="aspectFill" />
|
<image v-else class="w-100rpx h-100rpx rounded-full" src="/static/icon/default-avatar.png"
|
||||||
<view class="ml-30rpx" v-if="state.userInfo?.sysUser?.userId">
|
mode="aspectFill" />
|
||||||
<view class="sub-text-30">{{ state.userInfo?.sysUser?.name }}</view>
|
<view class="ml-30rpx">
|
||||||
<view class="sub-text-26">ID {{ state.userInfo?.sysUser?.userId }}</view>
|
<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>
|
||||||
<view v-else class="flex items-center ml-30rpx" @tap="onTabLogin">
|
<view v-else class="flex items-center ml-30rpx" @tap="onTabLogin">
|
||||||
<text class="sub-text-32">请先登录</text>
|
<text class="sub-text-32">请先登录</text>
|
||||||
@@ -42,6 +53,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</crud-layout>
|
</crud-layout>
|
||||||
|
|
||||||
|
<modify-user ref="modifyUserRef" warnText="填写出生日期即可领取生日兑换券" @close="storage.getUserInfo" />
|
||||||
|
|
||||||
<tm-modal :show="state.actModalShow" :showCancel="false" title="核销活动兑换券" zIndex="999" @confirm="" @cancel=""
|
<tm-modal :show="state.actModalShow" :showCancel="false" title="核销活动兑换券" zIndex="999" @confirm="" @cancel=""
|
||||||
@close="">
|
@close="">
|
||||||
<view class="text-center text-28">是否核销该活动兑换券?</view>
|
<view class="text-center text-28">是否核销该活动兑换券?</view>
|
||||||
@@ -56,7 +69,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, computed } from "vue"
|
import { ref, reactive, computed } from "vue"
|
||||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||||
import { isEmpty } from "radash"
|
import { isEmpty } from "radash"
|
||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
@@ -66,6 +79,9 @@ import { hooks, router, constant } from "@@/index"
|
|||||||
import { accessStatsApi, actCancelApi, userApi } from "@@/api"
|
import { accessStatsApi, actCancelApi, userApi } from "@@/api"
|
||||||
import { APPENV } from "@/sheep/constant"
|
import { APPENV } from "@/sheep/constant"
|
||||||
|
|
||||||
|
import ModifyUser from "@@/components/modify-user.vue"
|
||||||
|
|
||||||
|
const modifyUserRef = ref(null)
|
||||||
const state = reactive<any>({
|
const state = reactive<any>({
|
||||||
wallet: [],
|
wallet: [],
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
@@ -307,8 +323,8 @@ const onTabMenu = async (item: any) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onNavRightClick = () => {
|
const doUserArea = () => {
|
||||||
router.jump("/pages/setting/index")
|
modifyUserRef.value?.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 退出登录
|
// 退出登录
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<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"
|
<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"
|
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">
|
: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"
|
fontSize="28" :showClear="true" :focus="false" placeholder="请输入超市名称" :focus-highlight="false"
|
||||||
color="#ECF4F9" width="100%">
|
color="#ECF4F9" width="100%">
|
||||||
<template v-slot:rightIcon>
|
<template v-slot:rightIcon>
|
||||||
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">搜
|
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">
|
||||||
索</tm-button>
|
搜索
|
||||||
|
</tm-button>
|
||||||
</template>
|
</template>
|
||||||
</tm-input>
|
</tm-input>
|
||||||
</view>
|
</view>
|
||||||
@@ -41,23 +42,25 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-x>
|
<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"
|
<view class="w-180rpx flex-col items-center mr-20rpx" v-for="(pV, pI) in v.featuredProducts"
|
||||||
:key="pI">
|
:key="pI">
|
||||||
<image class="size-180rpx rounded-12rpx bg-#eeeeee" :src="filePath(pV.coverImage)"
|
<image class="size-180rpx rounded-12rpx bg-#eeeeee" :src="filePath(pV.coverImage)"
|
||||||
mode="aspectFill" />
|
mode="aspectFill" />
|
||||||
<view class="w-full mt-4rpx sub-text-24 truncate">{{ pV.title }}</view>
|
<view class="w-full mt-4rpx sub-text-24 truncate">{{ pV.title }}</view>
|
||||||
<view class="w-full flex justify-between">
|
<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 class="text-22rpx">¥</text>
|
||||||
<text>{{ pV.priceType == "1" ? displayPrice(pV.minPrice, "") :
|
<text>
|
||||||
displayPrice(pV.spuPrice, "")
|
{{ pV.priceType == "1" ? displayPrice(pV.minPrice, "")
|
||||||
}}</text>
|
: displayPrice(pV.spuPrice, "") }}
|
||||||
|
</text>
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="w-full flex justify-between second-text-24">
|
<view class="w-full flex justify-between second-text-24">
|
||||||
<text>库存{{ pV.totalStock }}</text>
|
<view>库存{{ pV.totalStock }}</view>
|
||||||
<text>{{ pV.status ? "已停售" : "在售" }}</text>
|
<view>{{ pV.status ? "已停售" : "在售" }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -69,20 +69,21 @@ const toDetail = async (v: any) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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"
|
<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"
|
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">
|
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
|
||||||
<template #top>
|
<template #top>
|
||||||
<view class="h-30rpx" />
|
<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"
|
<tm-input class="flex-1" v-model="state.pa.name" type="text" height="72" minHeight="72"
|
||||||
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商家名称"
|
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商家名称" :focus-highlight="false"
|
||||||
style="border: 4rpx solid #0779fd; border-radius: 14rpx" :focus-highlight="false"
|
color="#ECF4F9" width="100%">
|
||||||
color="#ECF4F9">
|
|
||||||
<template v-slot:rightIcon>
|
<template v-slot:rightIcon>
|
||||||
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">搜
|
<tm-button class="mr-8rpx px-24rpx py-26rpx text-30rpx!" size="xs" @click="search">
|
||||||
索</tm-button>
|
搜索
|
||||||
|
</tm-button>
|
||||||
</template>
|
</template>
|
||||||
</tm-input>
|
</tm-input>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const toDetail = async (v: any) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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"
|
<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"
|
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">
|
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="bg-[#f5f5f5] px-8rpx py-16rpx rounded-4 fixed bottom-0 left-0 right-0 w-full">
|
<view class="bg-[#f5f5f5] px-8rpx py-16rpx rounded-4 fixed bottom-0 left-0 right-0 w-full">
|
||||||
<view class="flex justify-end">
|
<view class="flex justify-end">
|
||||||
<image v-show="show" class="w-[50rpx] h-[50rpx] mx-16rpx mb-8rpx" src="@/static/page/fold.svg"
|
<image v-if="show" class="w-[50rpx] h-[50rpx] mx-16rpx mb-8rpx" src="@/static/page/fold.svg"
|
||||||
@click="show = !show" />
|
@click="show = !show" />
|
||||||
<image v-show="!show" class="w-[50rpx] h-[50rpx] mx-16rpx mb-8rpx" src="@/static/page/unfold.svg"
|
<image v-if="!show" class="w-[50rpx] h-[50rpx] mx-16rpx mb-8rpx" src="@/static/page/unfold.svg"
|
||||||
@click="show = !show" />
|
@click="show = !show" />
|
||||||
</view>
|
</view>
|
||||||
<view v-show="show" class="flex mb-20rpx" v-for="(row, rowIndex) in keyboardLayout" :key="rowIndex">
|
<view v-if="show" class="flex mb-20rpx" v-for="(row, rowIndex) in keyboardLayout" :key="rowIndex">
|
||||||
<view
|
<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]"
|
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())">
|
v-for="(key, keyIndex) in row" :key="keyIndex" @click="handleKeyPress(key.toString())">
|
||||||
{{ key }}
|
{{ key }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-show="show" class="flex mb-0rpx">
|
<view v-if="show" class="flex mb-0rpx">
|
||||||
<view
|
<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]"
|
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('.')">
|
@click="handleKeyPress('.')">
|
||||||
|
|||||||
@@ -1,59 +1,28 @@
|
|||||||
import { router } from ".."
|
import { router } from ".."
|
||||||
import { APPENV } from "../constant"
|
import { getUrlParamsObj } from "../utils/app"
|
||||||
import { getAppInfo, isDevEnv } from "../utils/app"
|
|
||||||
|
|
||||||
export function useScanCode(actModalShow) {
|
export function useScanCode(actModalShow) {
|
||||||
async function scanCodeAction(): Promise<string | undefined> {
|
async function scanCodeAction(): Promise<string | undefined> {
|
||||||
const appInfo = await getAppInfo()
|
const scanResult = await new Promise<string>((resolve, reject) => {
|
||||||
if (isDevEnv() && appInfo != APPENV.APP) {
|
uni.scanCode({
|
||||||
// 开发环境模拟扫码
|
success: (res) => {
|
||||||
// const testQrCode = "eyJpZCI6IjE5MDU4ODg4NjQ0NTQ1MzMxMjEiLCJuYW1lIjoi6ICB5Y6/5bqc6aOf5aCCIn0=" // 测试线上-老县府食堂-收款二维码
|
console.log("uniapp扫码成功:", JSON.stringify(res))
|
||||||
// const testQrCode = "eyJoYXJkRG9vcklkIjoiMTkxNDIxNTYwODQzNzQxMTg0MSIsImNhYmluZXRObyI6IjEifQ==" // 测试线上-智能柜-收款二维码
|
resolve(res.result || "")
|
||||||
// const testQrCode = "eyJpZCI6IjE5MDU4MTY3NTEwNDM0NTI5MzAiLCJuYW1lIjoi5paw5Y6/5bqc6LaF5biCIn0=" // 邓本地-测试环境-新县府超市收款二维码
|
},
|
||||||
// const testQrCode = "eyJoYXJkRG9vcklkIjoiMTkxMzE1NzA4MDQxODI5NTgwOSIsImNhYmluZXRObyI6IjEifQ==" // 邓本地-测试单门智能柜柜门二维码
|
fail: (err) => {
|
||||||
// const testQrCode = "http://192.168.101.45:8889/h5/#/pages/pay/scanPay?id=1905816751043452930&name=测试新县府超市" // 邓本地-测试环境-新县府超市收款二维码
|
console.error("uniapp扫码失败", JSON.stringify(err))
|
||||||
// const testQrCode = "http://192.168.101.45:8889/h5/#/pages/pay/scanPay?hardDoorId=1913157080418295809&cabinetNo=1" // 测试智能柜柜门二维码
|
resolve("")
|
||||||
const testQrCode = "eyJjYW5jZWxJZCI6IjE5ODQyNDA4MzM5NDMyMDc5MzcifQ==" // 测试商户活动核销
|
},
|
||||||
uni.showModal({ content: "开发环境不是浙政钉和诗画环境,扫码仅供测试" })
|
|
||||||
return Promise.resolve(testQrCode)
|
|
||||||
}
|
|
||||||
if (appInfo == APPENV.APP) {
|
|
||||||
const scanResult = await new Promise<string>((resolve, reject) => {
|
|
||||||
uni.scanCode({
|
|
||||||
success: (res) => {
|
|
||||||
console.log("APP扫码成功:", JSON.stringify(res))
|
|
||||||
resolve(res.result || "")
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
console.error("APP扫码失败", JSON.stringify(err))
|
|
||||||
resolve("")
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
return scanResult
|
})
|
||||||
}
|
return scanResult
|
||||||
if (appInfo == APPENV.ZZD) {
|
|
||||||
// 浙政钉扫码
|
|
||||||
const res: any = await (window as any).dd.scan({ type: "all" })
|
|
||||||
return res.text || ""
|
|
||||||
}
|
|
||||||
if (appInfo == APPENV.SH) {
|
|
||||||
// 诗画扫码
|
|
||||||
const res = await (window as any).CP2.showScanQr({ needResult: 1 })
|
|
||||||
if (res.code == 1) return res.data.qrCode || ""
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
uni.showToast({ title: "当前环境未知", icon: "none" })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理url扫码结果
|
// 处理url扫码结果
|
||||||
function processUrlScanResult(url: string) {
|
function processUrlScanResult(url: string) {
|
||||||
if (!url) return
|
if (!url) return
|
||||||
const searchParams = new URL(url).searchParams
|
const searchParams = getUrlParamsObj(url)
|
||||||
const paramsObj: Record<string, string> = {}
|
const { hardDoorId, cabinetNo, action, id, name } = searchParams
|
||||||
searchParams.forEach((value, key) => (paramsObj[key] = value))
|
|
||||||
const { hardDoorId, cabinetNo, action, id, name } = paramsObj
|
|
||||||
|
|
||||||
// 智能柜扫码
|
// 智能柜扫码
|
||||||
if (hardDoorId && cabinetNo) {
|
if (hardDoorId && cabinetNo) {
|
||||||
router.jump("/pages/cabinet/buy", { hardDoorId, cabinetNo })
|
router.jump("/pages/cabinet/buy", { hardDoorId, cabinetNo })
|
||||||
@@ -61,7 +30,7 @@ export function useScanCode(actModalShow) {
|
|||||||
}
|
}
|
||||||
// 扫收款机上生成的码支付
|
// 扫收款机上生成的码支付
|
||||||
if (action === "harQrCodeScanPay") {
|
if (action === "harQrCodeScanPay") {
|
||||||
const { mchId, orderId } = paramsObj
|
const { mchId, orderId } = searchParams
|
||||||
router.jump("/pages/pay/scanPay", { action, mchId, orderId })
|
router.jump("/pages/pay/scanPay", { action, mchId, orderId })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ const TABBAR_CONSTANT: Array<TabbarItem> = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
pagePath: "/pages/tabbar/prosperityShopMchList",
|
pagePath: "/pages/tabbar/prosperityShopMchList",
|
||||||
text: "共富商城",
|
text: "共富商家",
|
||||||
iconPath: "/static/tabbar/prosperity-shop.png",
|
iconPath: "/static/tabbar/prosperity-shop.png",
|
||||||
selectedIconPath: "/static/tabbar/prosperity-shop-select.png",
|
selectedIconPath: "/static/tabbar/prosperity-shop-select.png",
|
||||||
launchParam: ["prosperityShopMchList"],
|
launchParam: ["prosperityShopMchList"],
|
||||||
|
|||||||
@@ -38,3 +38,13 @@ export const getLaunchParam = (url?: string) => {
|
|||||||
const params = getUrlParams(url)
|
const params = getUrlParams(url)
|
||||||
return params?.launchParam
|
return params?.launchParam
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getUrlParamsObj = (url?: string): Record<string, any> => {
|
||||||
|
if (!url) {
|
||||||
|
const pages = getCurrentPages()
|
||||||
|
const currentPage = pages[pages.length - 1]
|
||||||
|
url = currentPage?.route ?? ""
|
||||||
|
}
|
||||||
|
const params = getUrlParams(url)
|
||||||
|
return params
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
Reference in new issue
Block a user