|
@@ -14,26 +14,36 @@ import PageHelper from '@/components/page-helper.vue'
|
|
|
import {
|
|
|
deleteMessage,
|
|
|
getMessages,
|
|
|
+ getPointsCoupons,
|
|
|
orderPointsCancel,
|
|
|
orderPointsSubmit,
|
|
|
updateMessage,
|
|
|
} from '../../core/libs/requests'
|
|
|
-import { integral, interact, system } from '../../core/libs/svgs'
|
|
|
+import { integral, interact, message, system } from '../../core/libs/svgs'
|
|
|
import { beforeNow } from '../../utils/date-util'
|
|
|
import dayjs from 'dayjs'
|
|
|
import { MessageType } from '../../core/libs/enums'
|
|
|
-import { group } from 'radash'
|
|
|
import { ComponentExposed } from 'vue-component-type-helpers'
|
|
|
import { Message } from '../../core/libs/models'
|
|
|
import { requestToast } from '../../core/utils/common'
|
|
|
+import { useUserStore } from '../../store'
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
|
|
|
const pageHelperRef = ref<ComponentExposed<typeof PageHelper>>()
|
|
|
+const userStore = useUserStore()
|
|
|
+const { userInfo } = storeToRefs(userStore)
|
|
|
+const show = ref(false)
|
|
|
+const businessId = ref()
|
|
|
const tab = ref(0)
|
|
|
const tabs = ref([
|
|
|
{ label: '积分消息', value: MessageType.Integral },
|
|
|
{ label: '系统消息', value: MessageType.System },
|
|
|
{ label: '互动消息', value: MessageType.Interact },
|
|
|
])
|
|
|
+const selectedCoupon = ref()
|
|
|
+const { data: coupons, run: setCoupons } = useRequest(() =>
|
|
|
+ getPointsCoupons({ userId: userInfo.value.userId, businessId: businessId.value }),
|
|
|
+)
|
|
|
onShow(async () => {
|
|
|
nextTick(() => {
|
|
|
pageHelperRef.value?.refresh()
|
|
@@ -49,14 +59,32 @@ const handleCancel = async (message: Message) => {
|
|
|
await pageHelperRef.value?.refresh()
|
|
|
}
|
|
|
const handleSubmit = async (message: Message) => {
|
|
|
- await requestToast(() => orderPointsSubmit({ id: message.businessId.toString() }), {
|
|
|
- success: true,
|
|
|
- successTitle: '积分已确认',
|
|
|
- })
|
|
|
+ await requestToast(
|
|
|
+ () =>
|
|
|
+ orderPointsSubmit({
|
|
|
+ id: message.businessId,
|
|
|
+ userId: message.designerId,
|
|
|
+ couponUserId: 19,
|
|
|
+ }),
|
|
|
+ {
|
|
|
+ success: true,
|
|
|
+ successTitle: '积分已确认',
|
|
|
+ },
|
|
|
+ )
|
|
|
// await deleteMessage(message.id.toString())
|
|
|
await updateMessage({ id: message.id, isRead: '1' })
|
|
|
await pageHelperRef.value?.refresh()
|
|
|
}
|
|
|
+const handleQ = async (message: Message) => {
|
|
|
+ // const { data } = await getPointsCoupons({
|
|
|
+ // userId: message.designerId,
|
|
|
+ // businessId: message.businessId,
|
|
|
+ // })
|
|
|
+ // console.log(data)
|
|
|
+ businessId.value = message.businessId
|
|
|
+ await setCoupons()
|
|
|
+ show.value = true
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -111,6 +139,27 @@ const handleSubmit = async (message: Message) => {
|
|
|
v-if="it.messageType === MessageType.Integral"
|
|
|
v-html="it.detailBody"
|
|
|
></div>
|
|
|
+ <div class="grid grid-cols-[auto_1fr] gap-x-5 gap-y-4.5">
|
|
|
+ <template v-if="true">
|
|
|
+ <div
|
|
|
+ class="text-black/40 text-sm font-normal font-['PingFang_SC'] h-5.5 flex items-center"
|
|
|
+ >
|
|
|
+ 积分券
|
|
|
+ </div>
|
|
|
+ <div class="flex items-center">
|
|
|
+ <div class="text-black/60 text-sm font-normal font-['PingFang_SC']">
|
|
|
+ 无可用
|
|
|
+ </div>
|
|
|
+ <div class="h-5.5 overflow-hidden">
|
|
|
+ <wd-icon
|
|
|
+ name="chevron-right"
|
|
|
+ custom-class="text-black/60!"
|
|
|
+ size="20"
|
|
|
+ ></wd-icon>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
<!-- {{ it.detailBody }} -->
|
|
|
</div>
|
|
|
</div>
|
|
@@ -173,6 +222,9 @@ const handleSubmit = async (message: Message) => {
|
|
|
</wd-button>
|
|
|
</div>
|
|
|
<div class="flex-1">
|
|
|
+ <wd-button block :round="false" @click="handleQ(it)">积分券</wd-button>
|
|
|
+ </div>
|
|
|
+ <div class="flex-1">
|
|
|
<wd-button block :round="false" @click="handleSubmit(it)">确认</wd-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -183,6 +235,42 @@ const handleSubmit = async (message: Message) => {
|
|
|
</div>
|
|
|
</template>
|
|
|
</PageHelper>
|
|
|
+ <wd-action-sheet title="优惠券" v-model="show">
|
|
|
+ <view class="">
|
|
|
+ <wd-tabs>
|
|
|
+ <wd-tab title="可用优惠券"></wd-tab>
|
|
|
+ <wd-tab title="不可用优惠券"></wd-tab>
|
|
|
+ </wd-tabs>
|
|
|
+ <div class="bg-[#f6f6f6] p-3.5">
|
|
|
+ <template v-for="(it, i) in coupons" :key="i">
|
|
|
+ <div
|
|
|
+ class="bg-white rounded-2xl p-3.5 flex gap-2.5"
|
|
|
+ @click="(selectedCoupon = it), (show = false)"
|
|
|
+ >
|
|
|
+ <div class="w-[94px] h-[94px] bg-[#f6f6f6] rounded-[10px]"></div>
|
|
|
+ <div class="flex flex-col justify-around flex-1">
|
|
|
+ <div class="text-black text-sm font-normal font-['PingFang_SC'] leading-normal">
|
|
|
+ {{ it.couponName }}
|
|
|
+ </div>
|
|
|
+ <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">
|
|
|
+ <!-- 2024/04/01-2024/05/30 -->
|
|
|
+ {{ dayjs(it.validityStartDate).format('YYYY/MM/DD') }}-{{
|
|
|
+ dayjs(it.validityEndDate).format('YYYY/MM/DD')
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">
|
|
|
+ 使用说明
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="flex items-center">
|
|
|
+ <div class="w-4 h-4 rounded-full border border-black/60 border-solid"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <!-- <wd-button block :round="false">确认</wd-button> -->
|
|
|
+ </view>
|
|
|
+ </wd-action-sheet>
|
|
|
</view>
|
|
|
</template>
|
|
|
|