|
@@ -11,12 +11,13 @@
|
|
|
<script lang="ts" setup>
|
|
|
import useRequest from '../../hooks/useRequest'
|
|
|
import dayjs from 'dayjs'
|
|
|
-import { getCircles } from '../../core/libs/requests'
|
|
|
+import { getCircles, scanCodeCheckPaper } from '../../core/libs/requests'
|
|
|
import SectionHeading from '@designer-hub/app/src/components/section-heading.vue'
|
|
|
import Card from '@designer-hub/app/src/components/card.vue'
|
|
|
import { merchantPageHeaderBg, scanIcon, bookIcon } from '@designer-hub/assets/src/svgs'
|
|
|
import { useUserStore } from '../../store'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
+import { requestToast } from '@designer-hub/app/src/core/utils/common'
|
|
|
|
|
|
defineOptions({
|
|
|
name: 'Home',
|
|
@@ -104,6 +105,16 @@ const toSettlement = async () => {
|
|
|
|
|
|
await uni.navigateTo({ url: '/pages/home/merchant/settlement' })
|
|
|
}
|
|
|
+const handleScanning = async () => {
|
|
|
+ console.log('handleScanning')
|
|
|
+
|
|
|
+ const { result } = await uni.scanCode({ scanType: ['qrCode'] })
|
|
|
+ console.log(result)
|
|
|
+ await requestToast(() => scanCodeCheckPaper({ orderNo: result }), {
|
|
|
+ success: true,
|
|
|
+ successTitle: '验券成功',
|
|
|
+ })
|
|
|
+}
|
|
|
onShow(async () => {
|
|
|
// await run()
|
|
|
console.log(circlesData.value)
|
|
@@ -218,7 +229,7 @@ onShareAppMessage(() => ({}))
|
|
|
<wd-img width="36px" height="36px" :src="scanIcon"></wd-img>
|
|
|
</div>
|
|
|
<div class="w-full mt-[45px]">
|
|
|
- <wd-button block :round="false">
|
|
|
+ <wd-button block :round="false" @click="handleScanning">
|
|
|
<div
|
|
|
class="text-center text-white text-base font-normal font-['PingFang_SC'] leading-normal"
|
|
|
>
|
|
@@ -271,11 +282,4 @@ onShareAppMessage(() => ({}))
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
-<style>
|
|
|
-/* :deep(.wd-input) {
|
|
|
- background: transparent;
|
|
|
- height: 100%;
|
|
|
- border: none;
|
|
|
- width: 100%;
|
|
|
-} */
|
|
|
-</style>
|
|
|
+<style></style>
|