purui 2 kuukautta sitten
vanhempi
commit
3e50f99929

+ 29 - 19
packages/app/src/pages-sub/mine/homepage/qr-code/index.vue

@@ -3,7 +3,7 @@
 </route>
 <script setup lang="ts">
 import UQRCode from 'uqrcodejs'
-import { getPointsOrder, storeAndPunchIn } from '../../../../core/libs/requests'
+import { getPointsOrder, getDesignerInfo,storeAndPunchIn } from '../../../../core/libs/requests'
 import { qrCodeString2Object, toQrCodeString } from '../../../../core/utils/common'
 import { QrCodeBusinessType } from '../../../../core/libs/enums'
 import { useUserStore } from '../../../../store'
@@ -16,7 +16,9 @@ const { userInfo } = storeToRefs(userStore)
 const router = useRouter()
 const qrCodeCanvas = ref()
 const { data, run: setData } = useRequest(() => getPointsOrder(id.value), { initialData: {} })
-
+const { data: designerInfo, run: setDesignerInfo } = useRequest(() => getDesignerInfo(id.value), {
+  initialData: {},
+})
 const a = async (canvasContext: UniApp.CanvasContext) => {
   const qr = new UQRCode()
   // 设置二维码内容
@@ -112,20 +114,26 @@ const handleClickScan = async () => {
 const saveQrcode = async () => {
   try {
     console.log(qrCodeCanvas.value)
-    const option = {
-      // #ifdef H5
-      canvasId: 'qrcode',
-      // #endif
-      // #ifdef MP-WEIXIN
-      canvas: toRaw(qrCodeCanvas.value),
-      // #endif
-    }
-    console.log(option)
-    const { tempFilePath } = await wx.canvasToTempFilePath(option)
-    console.log(tempFilePath)
-    await uni.saveImageToPhotosAlbum({
-      filePath: tempFilePath,
-    })
+    // const option = {
+    //   // #ifdef H5
+    //   canvasId: 'qrcode',
+    //   // #endif
+    //   // #ifdef MP-WEIXIN
+    //   canvas: toRaw(qrCodeCanvas.value),
+    //   // #endif
+    // }
+    // console.log(option)
+    // const { tempFilePath } = await wx.canvasToTempFilePath(option)
+    // console.log(tempFilePath)
+    uni.downloadFile({
+		url:designerInfo.value.homeUrl,
+		success: (res) => {
+			uni.saveImageToPhotosAlbum({
+			  // filePath: res.tempFilePath,
+			  filePath: res.tempFilePath,
+			})
+		}
+	})
     await uni.showToast({ title: '保存成功' })
   } catch (e) {
     await uni.showToast({ title: '保存失败', icon: 'none' })
@@ -134,7 +142,8 @@ const saveQrcode = async () => {
 onLoad(async (query: { id: string }) => {
   id.value = query.id
   // #ifdef MP-WEIXIN
-  await generateCodeMp()
+  // await generateCodeMp()
+  await setDesignerInfo()
   // #endif
   // #ifdef H5
   await generateCode()
@@ -147,12 +156,13 @@ onReady(() => {})
     <div class="flex-grow flex flex-col justify-center">
       <div>
         <!-- #ifdef MP-WEIXIN -->
-        <canvas
+		<wd-img :width="204" :height="204" :src="designerInfo.homeUrl"></wd-img>
+        <!-- <canvas
           type="2d"
           id="qrcode"
           canvas-id="qrcode"
           style="width: 200px; height: 200px"
-        ></canvas>
+        ></canvas> -->
         <!-- #endif -->
         <!-- #ifdef H5 -->
         <canvas id="qrcode" canvas-id="qrcode" style="width: 200px; height: 200px"></canvas>

+ 13 - 1
packages/merchant/src/core/libs/agent-requests.ts

@@ -249,6 +249,10 @@ export const getSalesOrdersCount = (query = {}) =>
      * 其他订单数量
      */
     otherSale: number
+	/**
+	 * 历史数据
+	 */
+	history: Array<any>
   }>('/app-api/member/stylist-other-sales/get', query)
 /**
  * 其他销售列表
@@ -336,7 +340,8 @@ export const getSalesOrdersCounts = (query = {}) =>
       { 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}条` },
+	  { label: '历史记录', value:encodeURIComponent(JSON.stringify(res.data.history)), type: 2},
+      { label: '其他销售信息', value: `${res.data.otherSale ?? 0}条` },	  
     ],
   }))
 /**
@@ -409,6 +414,13 @@ export const getDesignerActivities = (query = {}) =>
         value: it.quantity,
         path: '',
       })),
+	  {
+	    type: '',
+	    subType: '',
+	    label: '历史记录',
+	    value: encodeURIComponent(JSON.stringify(res.data.history)),
+	    path: '/pages/agent/designer/archives/activity/history',
+	  },
       {
         type: '',
         subType: '',

+ 16 - 0
packages/merchant/src/pages.json

@@ -271,6 +271,14 @@
       }
     },
     {
+      "path": "pages/agent/designer/archives/activity/history",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "历史记录",
+        "navigationBarBackgroundColor": "#ffffff"
+      }
+    },
+    {
       "path": "pages/agent/designer/archives/activity/index",
       "type": "page",
       "style": {
@@ -295,6 +303,14 @@
       }
     },
     {
+      "path": "pages/agent/designer/archives/sale-info/history",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "历史记录",
+        "navigationBarBackgroundColor": "#ffffff"
+      }
+    },
+    {
       "path": "pages/agent/designer/archives/sale-info/index",
       "type": "page",
       "style": {

+ 29 - 0
packages/merchant/src/pages/agent/designer/archives/activity/history.vue

@@ -0,0 +1,29 @@
+<route lang="json">
+{
+  "style": {
+    "navigationBarTitleText": "历史记录",
+    "navigationBarBackgroundColor": "#ffffff"
+  }
+}
+</route>
+<script setup lang="ts">
+import SectionHeading from '@designer-hub/app/src/components/section-heading.vue'
+const history = ref()
+onLoad(async (query) => {	
+  history.value = JSON.parse(decodeURIComponent(query.data))
+  console.log( history.value)
+})
+</script>
+<template>
+	<view class="contanier">
+		<div class="bg-white p-4 mt-4 flex-grow flex flex-col">
+			<block v-for="(item,index) in history" :key="index">
+				<div class="flex flex-col gap-4 py-4">
+					<SectionHeading size="base" :title="item.name" :end-text="item.num"></SectionHeading>
+				</div>			
+			</block>
+		</div>	
+	</view>
+</template>
+<style>
+</style>

+ 17 - 12
packages/merchant/src/pages/agent/designer/archives/index.vue

@@ -101,9 +101,9 @@ const handleAddFamilyInfo = async (item: DesignerFamilyInfo) => {
       label: messages.objects.designerFamilyInfo.familySex,
       props: {
         columns: [
-          { label: '男', value: '1' },
-          { label: '女', value: '2' },
-          { label: '未知', value: '0' },
+         { label: '未知', value: 0 },
+         { label: '男', value: 1 },
+         { label: '女', value: 2 },
         ],
       },
     },
@@ -269,9 +269,9 @@ const handleUpdateFamily = (item) => {
       label: messages.objects.designerFamilyInfo.familySex,
       props: {
         columns: [
-          { label: '男', value: '1' },
-          { label: '女', value: '2' },
-          { label: '未知', value: '0' },
+          { label: '男', value: 1 },
+          { label: '女', value: 2 },
+          { label: '未知', value: 0 },
         ],
       },
     },
@@ -385,8 +385,9 @@ onShow(async () => {
                     type: 'Select',
                     value: value,
                     options: [
-                      { label: '男', value: 0 },
-                      { label: '女', value: 1 },
+					  { label: '未知', value: 0 },
+                      { label: '男', value: 1 },
+                      { label: '女', value: 2 },
                     ],
                   }"
                 ></DataRender>
@@ -571,11 +572,13 @@ onShow(async () => {
                   <SectionHeading
                     :title="item.label"
                     size="base"
-                    :end-text="String(item.value)"
+                    :end-text="index !== list.length - 2 ?String(item.value):''"
                     end-arrow
                     :path="
                       !(index === list.length - 1)
-                        ? `/pages/agent/designer/archives/sale-info/index?id=${id}&type=${item.type}`
+                        ? !(index === list.length - 2)
+						?`/pages/agent/designer/archives/sale-info/index?id=${id}&type=${item.type}`
+						:`/pages/agent/designer/archives/sale-info/history?data=${item.value}`
                         : `/pages/agent/designer/archives/sale-info/others/index?id=${id}`
                     "
                   ></SectionHeading>
@@ -603,11 +606,13 @@ onShow(async () => {
                     <div class="py-4">
                       <SectionHeading
                         :title="item.label"
-                        :end-text="`${item.value}次`"
+                        :end-text="index !== list.length - 2?`${item.value}次`:''"
                         :path="
                           index === list.length - 1
                             ? `/pages/agent/designer/archives/activity/others/index?id=${id}`
-                            : item.value > 0
+                            : index === list.length - 2
+							?`/pages/agent/designer/archives/activity/history?data=${item.value}`
+							:item.value > 0
                               ? `/pages/agent/designer/archives/activity/index?userId=${id}&type=${item.type}&subType=${item.subType}`
                               : ''
                         "

+ 29 - 0
packages/merchant/src/pages/agent/designer/archives/sale-info/history.vue

@@ -0,0 +1,29 @@
+<route lang="json">
+{
+  "style": {
+    "navigationBarTitleText": "历史记录",
+    "navigationBarBackgroundColor": "#ffffff"
+  }
+}
+</route>
+<script setup lang="ts">
+import SectionHeading from '@designer-hub/app/src/components/section-heading.vue'
+const history = ref()
+onLoad(async (query) => {	
+  history.value = JSON.parse(decodeURIComponent(query.data))
+  console.log( history.value)
+})
+</script>
+<template>
+	<view class="contanier">
+		<div class="bg-white p-4 mt-4 flex-grow flex flex-col">
+			<block v-for="(item,index) in history" :key="index">
+				<div class="flex flex-col gap-4 py-4">
+					<SectionHeading size="base" :title="item.name" :end-text="item.num"></SectionHeading>
+				</div>			
+			</block>
+		</div>	
+	</view>
+</template>
+<style>
+</style>

+ 2 - 0
packages/merchant/src/types/uni-pages.d.ts

@@ -31,9 +31,11 @@ interface NavigateToOptions {
        "/pages/mine/agent/business-card/index" |
        "/pages/mine/agent/invite/index" |
        "/pages/mine/agent/settings/index" |
+       "/pages/agent/designer/archives/activity/history" |
        "/pages/agent/designer/archives/activity/index" |
        "/pages/agent/designer/archives/award/imgs" |
        "/pages/agent/designer/archives/basic-info/index" |
+       "/pages/agent/designer/archives/sale-info/history" |
        "/pages/agent/designer/archives/sale-info/index" |
        "/pages/mine/merchant/orders/detail/index" |
        "/pages/agent/designer/archives/activity/others/index" |