Browse Source

Merge remote-tracking branch 'origin/main' into main

赵添更 2 months ago
parent
commit
1925f3e844

+ 1 - 1
packages/app/src/pages-sub/home/spread/wx-agent-operation/index.vue

@@ -54,7 +54,7 @@ onShareTimeline(() => ({
                 {{ it.showFavourable ? it.favourablePoints : it.points }}
               </div>
               <div class="text-black/60 text-sm font-normal font-['PingFang_SC'] leading-[34px]">
-                积分
+                {{ String(it.needPoints) == '1' ? '折' : '积分' }}
               </div>
               <div class="flex-1"></div>
               <div

+ 17 - 9
packages/merchant/src/core/libs/agent-requests.ts

@@ -77,6 +77,11 @@ export const getDesignerFamilyInfo = (query = {}) =>
 export const saveDesignerFamilyInfo = (data: Partial<DesignerFamilyInfo>) =>
   httpPost('/app-api/member/stylist-family/save', data)
 /**
+ * 保存设计师家庭信息
+ */
+export const updateDesignerFamilyInfo = (data: Partial<DesignerFamilyInfo>) =>
+  httpPost('/app-api/member/stylist-family/update', data)
+/**
  * 获取设计师额外事件
  */
 export const getDesignerExtraEvents = (query = {}) =>
@@ -327,10 +332,10 @@ export const getSalesOrdersCounts = (query = {}) =>
   getSalesOrdersCount(query).then((res) => ({
     ...res,
     data: [
-      { label: '今年成交订单数', value: res.data.orderCountYear ?? 0, userId: '' },
-      { label: '今年成交金额', value: res.data.salesAmountYtd ?? 0 },
-      { label: '累计成交订单数', value: res.data.orderCount ?? 0 },
-      { label: '累计成交金额', value: res.data.salesAmount ?? 0 },
+      { label: '今年成交订单数', value: res.data.orderCountYear ?? 0, userId: '' ,type: 1},
+      { label: '今年成交金额', value: res.data.salesAmountYtd ?? 0 ,type: 1},
+      { label: '累计成交订单数', value: res.data.orderCount ?? 0,type: 2 },
+      { label: '累计成交金额', value: res.data.salesAmount ?? 0 ,type: 2},
       { label: '其他销售信息', value: `${res.data.otherSale ?? 0}条` },
     ],
   }))
@@ -390,22 +395,25 @@ export const getDesignerActivities = (query = {}) =>
     ...res,
     data: [
       ...(res.data.study as any[]).map((it) => ({
-        type: '',
+        type: 1,
+        subType: it.type,
         label: it.name,
-        value: it.quantity + '次',
+        value: it.quantity,
         path: '',
       })),
       { type: 'line', label: '', value: '' },
       ...(res.data.activity as any[]).map((it) => ({
-        type: '',
+        type: 2,
+        subType: it.type,
         label: it.name,
-        value: it.quantity + '次',
+        value: it.quantity,
         path: '',
       })),
       {
         type: '',
+        subType: '',
         label: '其他活动',
-        value: res.data.extraEventsQuantity + '次',
+        value: res.data.extraEventsQuantity,
         path: '/pages/agent/designer/archives/index',
       },
     ],

+ 2 - 0
packages/merchant/src/core/libs/requests.ts

@@ -59,6 +59,8 @@ export const refreshToken = (refreshToken: string) =>
  */
 export const scanCodeCheckPaper = (data: { orderNo: string }) =>
   httpPost('/app-api/member/vendorApp/scanCodeCheckPaper', data)
+export const productByOrderNo = (query: any) =>
+  httpGet('/app-api/member/points-order/productByOrderNo', query)
 /**
  * 商家端-获取商家信息
  */

+ 17 - 1
packages/merchant/src/pages.json

@@ -167,6 +167,14 @@
       }
     },
     {
+      "path": "pages/home/result/orderConfirm",
+      "type": "page",
+      "style": {
+      "navigationBarTitleText": "确认卷码信息",
+      "navigationBarBackgroundColor": "#fff"
+      }
+    },
+    {
       "path": "pages/home/result/success",
       "type": "page",
       "style": {
@@ -247,6 +255,14 @@
       }
     },
     {
+      "path": "pages/agent/designer/archives/activity/index",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "数据明细",
+        "navigationBarBackgroundColor": "#fff"
+      }
+    },
+    {
       "path": "pages/agent/designer/archives/award/imgs",
       "type": "page",
       "style": {
@@ -304,4 +320,4 @@
     }
   ],
   "subPackages": []
-}
+}

+ 7 - 7
packages/merchant/src/pages/agent/designer/archives/award/imgs.vue

@@ -9,12 +9,12 @@ onLoad((query?: Record<string | 'id', string>) => {
 })
 </script>
 
-<template>
-  <div class="flex-grow bg-white grid grid-cols-2 gap-4 p-4">
-    <template v-for="(it, index) in urls" :key="index">
-      <div><wd-img width="100%" mode="widthFix" :src="it" :enable-preview="true"></wd-img></div>
-    </template>
-  </div>
-</template>
+  <template>
+    <div class="flex-grow bg-white">
+      <template v-for="(it, index) in urls" :key="index">
+     <wd-img width="100%" :hidden="200" mode="widthFix" :src="it" :enable-preview="true"></wd-img>
+      </template>
+    </div>
+  </template>
 
 <style scoped lang="scss"></style>

+ 82 - 9
packages/merchant/src/pages/agent/designer/archives/index.vue

@@ -20,7 +20,7 @@ import {
   getSalesOrdersCounts,
   saveDesignerFamilyInfo,
   getUserInfoById,
-  getEditRecords,
+  getEditRecords, updateDesignerFamilyInfo,
 } from '../../../../core/libs/agent-requests'
 import { messages } from '../../../../core/libs/messages'
 import { omit } from 'radash'
@@ -66,7 +66,7 @@ const formDataFoucs = ref<{
 }>({
   focus: '',
 })
-const submitType = ref<'family' | 'award'>()
+const submitType = ref<'family' | 'award' | 'updateFamily'>()
 const familyPageRef = ref<ComponentExposed<typeof PageHelperEvo>>()
 const awardsListRef = ref<ComponentExposed<typeof ListHelperEvo>>()
 const saleListRef = ref<ComponentExposed<typeof ListHelperEvo>>()
@@ -76,7 +76,7 @@ const getFormDataFoucs = computed(() => familyData.value?.focus)
 const handleEditBasicInfo = async () => {
   await uni.navigateTo({ url: `/pages/agent/designer/archives/basic-info/index?id=${id.value}` })
 }
-const handleAddFamilyInfo = async () => {
+const handleAddFamilyInfo = async (item:DesignerFamilyInfo) => {
   submitType.value = 'family'
   const familySchema: DataFormSchema<Omit<DesignerFamilyInfo, 'userId' | 'createTime' | 'id'>> = {
     familyRelation: {
@@ -128,9 +128,7 @@ const handleAddFamilyInfo = async () => {
       },
     },
   }
-  formData.value = {
-    familyBirthday: '',
-  }
+
   schema.value = familySchema
   actionSheetStatus.value = true
 }
@@ -183,6 +181,20 @@ const handleSubmit = async () => {
       }
       break
     }
+    case 'updateFamily': {
+      const { code } = await requestToast(
+        () => updateDesignerFamilyInfo({ ...formData.value, userId: id.value }),
+        {
+          success: true,
+          successTitle: '修改成功',
+        },
+      )
+      if (code === 0) {
+        actionSheetStatus.value = false
+        familyPageRef.value?.reload()
+      }
+      break
+    }
     case 'award':
       {
         const { code } = await requestToast(
@@ -217,6 +229,63 @@ const handleDeleteFamilyInfo = async (item: DesignerFamilyInfo) => {
   })
   familyPageRef.value?.reload()
 }
+const handleUpdateFamily = (item) =>{
+  submitType.value = 'updateFamily'
+  const familySchema: DataFormSchema<Omit<DesignerFamilyInfo, 'userId' | 'createTime' | 'id'>> = {
+    familyRelation: {
+      type: 'TextField',
+      label: messages.objects.designerFamilyInfo.familyRelation,
+      props: {
+        placeholder: `请输入${messages.objects.designerFamilyInfo.familyRelation}`,
+      },
+    },
+    familyName: {
+      type: 'TextField',
+      label: messages.objects.designerFamilyInfo.familyName,
+      props: {
+        placeholder: `请输入${messages.objects.designerFamilyInfo.familyName}`,
+      },
+    },
+    familySex: {
+      type: 'Radio',
+      label: messages.objects.designerFamilyInfo.familySex,
+      props: {
+        columns: [
+          { label: '男', value: '1' },
+          { label: '女', value: '2' },
+        ],
+      },
+    },
+    familyBirthday: {
+      type: 'TimePick',
+      label: messages.objects.designerFamilyInfo.familyBirthday,
+      props: {
+        type: 'date',
+        placeholder: `请选择${messages.objects.designerFamilyInfo.familyBirthday}`,
+        minDate: new Date('1925-01-01').getTime(),
+        // defaultVale: new Date('1990-01-01').getTime(),
+      },
+    },
+    familyInterset: {
+      type: 'TextField',
+      label: messages.objects.designerFamilyInfo.familyInterset,
+      props: {
+        placeholder: `请输入${messages.objects.designerFamilyInfo.familyInterset}`,
+      },
+    },
+    familyOccupation: {
+      type: 'TextField',
+      label: messages.objects.designerFamilyInfo.familyOccupation,
+      props: {
+        placeholder: `请输入${messages.objects.designerFamilyInfo.familyOccupation}`,
+      },
+    },
+  }
+  formData.value = item
+  schema.value = familySchema
+  actionSheetStatus.value = true
+
+}
 const handleSubmitFocus = async () => {
   await requestToast(() => createFocus({ ...formDataFoucs.value, userId: id.value }), {
     success: true,
@@ -354,6 +423,7 @@ onShow(async () => {
               </template>
               <template v-else-if="key === 'imageUrl'">
                 <SectionHeading
+                  :end-text="`${basicData.imageNumber}张`"
                   end-arrow
                   :path="`/pages/agent/designer/archives/award/imgs?urls=${basicData['imageUrl'] ?? ''}`"
                 ></SectionHeading>
@@ -418,7 +488,10 @@ onShow(async () => {
                     size="base"
                     :end-text="item.familyOccupation"
                   ></SectionHeading>
-                  <wd-button type="text" @click="handleDeleteFamilyInfo(item)">删除</wd-button>
+                  <div style="display: flex;">
+                    <wd-button type="text" @click="handleUpdateFamily(item)">编辑</wd-button>
+                    <wd-button type="text" @click="handleDeleteFamilyInfo(item)">删除</wd-button>
+                  </div>
                   <div v-if="!(index === list.length - 1)" class="w-full h-1 bg-[#dadada]"></div>
                 </div>
               </template>
@@ -511,7 +584,7 @@ onShow(async () => {
                     end-arrow
                     :path="
                       !(index === list.length - 1)
-                        ? `/pages/agent/designer/archives/sale-info/index?id=${id}`
+                        ? `/pages/agent/designer/archives/sale-info/index?id=${id}&type=${item.type}`
                         : `/pages/agent/designer/archives/sale-info/others/index?id=${id}`
                     "
                   ></SectionHeading>
@@ -583,7 +656,7 @@ onShow(async () => {
 			        <div class="record">
 						<div class="record-time">
 							<div class="time">{{dayjs(it.createTime).format('YYYY-MM-DD')}}</div>
-							<div class="createBy">经纪人:杨温</div>
+							<div class="createBy">经纪人:{{it.createName}}</div>
 						</div>
 						<div class="record-title">修改信息:</div>
 						<div class="record-content">{{it.content}}</div>

+ 4 - 2
packages/merchant/src/pages/agent/designer/archives/sale-info/index.vue

@@ -20,6 +20,7 @@ import { getSalesOrders, getSalesOrdersCount } from '@/core/libs/agent-requests'
 const userStore = useUserStore()
 const { userInfo } = storeToRefs(userStore)
 const id = ref()
+const type = ref()
 const current = ref('累计')
 const info = computed(() => [
   {
@@ -35,10 +36,11 @@ const info = computed(() => [
     unit: '¥',
   },
 ])
-const query = computed(() => ({ isYear: current.value === '本年', userId: id.value }))
+const query = computed(() => ({ year:  type.value == 1, userId: id.value ,type : type.value}))
 const { data, run: setData } = useRequest(() => getSalesOrdersCount({ userId: id.value }))
-onLoad(async (query?: Record<string | 'id', string>) => {
+onLoad(async (query) => {
   id.value = query?.id
+  type.value = query?.type
   await setData()
 })
 </script>

+ 1 - 6
packages/merchant/src/pages/home/index.vue

@@ -59,18 +59,13 @@ const toDesigner = () => {
   uni.navigateTo({ url: '/pages/designer/index' })
 }
 const handleScanning = async () => {
-  console.log('handleScanning')
-
   const { result } = await uni.scanCode({ scanType: ['qrCode'] })
   const { type, options } = qrCodeString2Object(result)
   if (type !== QrCodeBusinessType.InStoreWriteOff) {
     uni.showToast({ title: '不支持此二维码/条码', icon: 'none', duration: 5000 })
     return
   }
-  const { data } = await requestToast(() => scanCodeCheckPaper({ orderNo: options.no }))
-  if (data) {
-    uni.navigateTo({ url: '/pages/home/result/success' })
-  }
+  uni.navigateTo({ url: `/pages/home/result/orderConfirm?orderNo=${options.no}` })
 }
 const handle2Settlement = () => {
   if ((orderAmount.value ?? '') === '') {

+ 77 - 0
packages/merchant/src/pages/home/result/orderConfirm.vue

@@ -0,0 +1,77 @@
+<route lang="yaml">
+style:
+  navigationBarTitleText: 确认卷码信息
+  navigationBarBackgroundColor: '#fff'
+</route>
+
+<script setup lang="ts">
+import { ref } from 'vue';
+import { productByOrderNo , scanCodeCheckPaper } from "@/core/libs/requests";
+import { qrCodeString2Object, requestToast } from '@designer-hub/app/src/core/utils/common'
+const productInfo = ref({
+  productName: '',
+  productCoverImgUrl: '',
+  productPoints: '',
+  num: 0,
+  price: '',
+});
+const orderNo =ref()
+const query = computed(() => ({ orderNo: orderNo.value}))
+// 获取接口数据
+const getProductByOrderNo = async () => {
+    const response = await productByOrderNo({ orderNo: orderNo.value });
+    if (response) {
+      productInfo.value = response.data;
+    }
+};
+const submit = async () =>{
+  const { data } = await requestToast(() => scanCodeCheckPaper({ orderNo: orderNo.value}))
+  if (data) {
+    uni.navigateTo({ url: '/pages/home/result/success' })
+  }
+}
+// 页面加载时调用
+onLoad(async (query) => {
+  orderNo.value = query?.orderNo
+  await getProductByOrderNo();
+});
+
+// 返回上一页
+const navigateBack = () => {
+  uni.navigateBack({
+    delta: 1,
+  })
+}
+</script>
+
+<template>
+  <view class="bg-white p-[16px] flex-grow flex flex-col">
+    <!-- 商品信息 -->
+    <view class="flex items-center bg-white p-[16px] shadow-sm rounded-md">
+      <wd-img
+        :width="80" :height="80"
+        :src="productInfo.productCoverImgUrl"
+      ></wd-img>
+      <view class="flex-1 ml-[25px]">
+        <view class="text-lg font-bold mb-[8px]">{{ productInfo.productName }}</view>
+        <view class="text-sm text-gray-500 mb-[8px]">数量: x{{ productInfo.num }}</view>
+        <view class="text-sm text-gray-500">
+          {{ productInfo.productPoints }} 积分
+        </view>
+      </view>
+    </view>
+
+    <div class="w-full mt-auto pb-[20px]">
+      <wd-button block :round="false" @click="submit">
+        <div
+          class="text-center text-white text-base font-normal font-['PingFang_SC'] leading-normal"
+        >
+          确认核销
+        </div>
+      </wd-button>
+    </div>
+  </view>
+</template>
+
+<style scoped lang="scss">
+</style>

+ 1 - 1
packages/merchant/src/pages/home/result/success.vue

@@ -6,7 +6,7 @@ style:
 <script lang="ts" setup>
 const navigateBack = () => {
   uni.navigateBack({
-    delta: 1,
+    delta: 2,
   })
 }
 </script>