Bladeren bron

merge code

kevin.T 2 maanden geleden
bovenliggende
commit
15b43b73fa

+ 11 - 1
packages/app/src/pages-sub/home/moment/index.vue

@@ -193,7 +193,17 @@ onLoad(async (query?: { id: string; isShared?: boolean; circleType?: string }) =
 //   await shareCircle(id.value)
 //   return { title: data.value?.circleDesc }
 // })
-onShareAppMessage(shareAppMessage)
+onShareAppMessage(({ from }) => {
+  if (from === 'button') {
+    return shareAppMessage
+  } else if (from === 'menu') {
+    return {
+      title: `${data.value?.stylistName}: ${data.value?.circleDesc}`,
+      path: `/pages-sub/home/moment/index?id=${data.value?.id}&isShared=true&circleType=${data.value?.circleType}`,
+      imageUrl: data.value?.bannerUrls[0],
+    }
+  }
+})
 
 const handleClick = async (value: boolean) => {
   active.value = value ? 'hot' : 'time'

+ 5 - 1
packages/app/src/pages/messages/components/coupon-card.vue

@@ -5,6 +5,10 @@ import dayjs from 'dayjs'
 import used from '@designer-hub/assets/src/libs/assets/used'
 import expired from '@designer-hub/assets/src/libs/assets/expired'
 import invalid from '@designer-hub/assets/src/libs/assets/invalid'
+import { useMessage } from 'wot-design-uni'
+import { handleClickInstruction } from '@/core/libs/actions'
+
+const { alert, confirm } = useMessage()
 
 const props = withDefaults(
   defineProps<{ options?: Coupon; canSelect?: boolean; selected?: boolean }>(),
@@ -57,7 +61,7 @@ const emits = defineEmits<{ select: [coupon: Coupon]; clickInstruction: [coupon:
           </div>
           <div
             class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal flex items-center"
-            @click.stop="emits('clickInstruction', options)"
+            @click.stop="handleClickInstruction(alert, options)"
           >
             使用说明
             <wd-icon name="arrow-right" size="14"></wd-icon>

+ 2 - 2
packages/app/src/pages/messages/components/message-card.vue

@@ -159,7 +159,7 @@ onMounted(async () => {
               >
                 <div
                   class="text-sm font-normal font-['PingFang_SC']"
-                  :class="`${coupons.length > 0 ? 'text-[#ef4343]' : 'text-black/60'}`"
+                  :class="`${options.availableCouponsNum > 0 ? 'text-[#ef4343]' : 'text-black/60'}`"
                 >
                   <!--                  {{ `${coupons.length > 0 ? `${coupons.length}张可用` : '无可用'}` }}-->
                   {{ couponSelectText }}
@@ -167,7 +167,7 @@ onMounted(async () => {
                 <div class="h-5.5 flex items-center overflow-hidden">
                   <wd-icon
                     name="chevron-right"
-                    :custom-class="`${coupons.length > 0 ? 'text-[#ef4343]' : 'text-black/60'}`"
+                    :custom-class="`${options.availableCouponsNum > 0 ? 'text-[#ef4343]' : 'text-black/60'}`"
                     size="16"
                   ></wd-icon>
                 </div>

+ 1 - 2
packages/app/src/pages/messages/index.vue

@@ -65,7 +65,7 @@ const tabs = ref([
   },
 ])
 const selectedCoupons = ref<Coupon[]>([])
-
+const { alert, confirm } = useMessage()
 const instructionClick = (val: any) => {
   selectedCoupons.value = val
   // handleClickInstruction(alert, Array.isArray(val) ? val[0] : val)
@@ -74,7 +74,6 @@ const instructionClick = (val: any) => {
 const coupons = ref<Coupon[]>([])
 const cancelReason = ref('')
 const currentMessage = ref<Message>()
-const { alert, confirm } = useMessage()
 const { confirm: rejectConfirm } = useMessage('wd-message-box-slot')
 
 const query = computed(() => ({ messageType: tabs.value[tab.value]?.value }))

+ 13 - 3
packages/merchant/src/pages/agent/designer/archives/sale-info/index.vue

@@ -12,6 +12,7 @@ import SectionHeading from '@/components/section-heading.vue'
 import { storeToRefs } from 'pinia'
 import Card from '@/components/card.vue'
 import PageHelper from '@/components/page-helper.vue'
+import { ComponentExposed } from 'vue-component-type-helpers'
 import dayjs from 'dayjs'
 import PageHelperEvo from '@/components/page-helper-evo.vue'
 import { useUserStore } from '@/store'
@@ -22,6 +23,7 @@ const { userInfo } = storeToRefs(userStore)
 const id = ref()
 const type = ref()
 const current = ref('累计')
+const pageHelperRef = ref<ComponentExposed<typeof PageHelperEvo>>()
 const info = computed(() => [
   {
     label: '订单数',
@@ -36,8 +38,16 @@ const info = computed(() => [
     unit: '¥',
   },
 ])
-const query = computed(() => ({ year:  type.value == 1, userId: id.value ,type : type.value}))
+const query = computed(() => ({
+  year: current.value == '本年',
+  userId: id.value,
+  type: type.value,
+}))
 const { data, run: setData } = useRequest(() => getSalesOrdersCount({ userId: id.value }))
+const handleSegmentedChange = () => {
+  setData()
+  pageHelperRef.value?.refresh()
+}
 onLoad(async (query) => {
   id.value = query?.id
   type.value = query?.type
@@ -53,7 +63,7 @@ onLoad(async (query) => {
             <wd-segmented
               v-model:value="current"
               :options="['累计', '本年']"
-              @change="setData"
+              @change="handleSegmentedChange"
             ></wd-segmented>
           </div>
         </template>
@@ -76,7 +86,7 @@ onLoad(async (query) => {
         </template>
       </div>
     </Card>
-    <PageHelperEvo :request="getSalesOrders" :query="query">
+    <PageHelperEvo ref="pageHelperRef" :request="getSalesOrders" :query="query">
       <template #default="{ source }">
         <div class="flex flex-col gap-4">
           <template v-for="(it, index) in source?.list" :key="index">