瀏覽代碼

12/23 update code

任重 1 月之前
父節點
當前提交
81ba52a5f2

+ 5 - 1
packages/merchant/src/composables/followUp.ts

@@ -36,12 +36,16 @@ export const useFollowUp = () => {
       label: '备注',
       labelWidth: 64,
     },
+  })
+  const schemaTypeOffline = ref<DataFormSchema>({
     address: {
       // required: true,
       type: 'TextField',
       label: '地址',
       labelWidth: 64,
     },
+  })
+  const schemaTypeOnline = ref<DataFormSchema>({
     imgUrl: {
       required: true,
       type: 'ImageUploader',
@@ -60,5 +64,5 @@ export const useFollowUp = () => {
     // address: [{ required: true, message: '请输入地址' }],
     // images: [{ required: true, message: '请上传图片' }],
   })
-  return { schema, rules }
+  return { schema, rules, schemaTypeOffline, schemaTypeOnline }
 }

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

@@ -334,7 +334,7 @@ export const getPointsCounts = (query = {}) =>
         title: '当前剩余积分',
         value: res.data.points ?? 0,
         subTitle: '最近',
-        subValue: dayjs(res.data.pointsTime).format('YY/MM/DD'),
+        subValue: res.data.pointsTime ? dayjs(res.data.pointsTime).format('YY/MM/DD') : '--',
       },
       {
         userId: '',

+ 56 - 3
packages/merchant/src/layouts/tabbar.vue

@@ -3,6 +3,8 @@ import TabbarEvo from '@/components/tabbar-evo.vue'
 import { currRoute } from '../utils'
 import { defaultThemeVars } from '../core/themes/default'
 import DataForm from '@/components/data-form.vue'
+import { addUnit } from 'wot-design-uni/components/common/util'
+
 import { useUserStore } from '../store'
 import { storeToRefs } from 'pinia'
 import {
@@ -17,13 +19,20 @@ import { getDesignerList } from '../core/libs/requests'
 import { requestToast } from '@designer-hub/app/src/core/utils/common'
 import { createFollowUp } from '../core/libs/agent-requests'
 import { useFollowUp } from '../composables/followUp'
+import { success } from '@/core/libs/svgs'
 
 const userStore = useUserStore()
 const { userInfo, isAgent, isMerchant } = storeToRefs(userStore)
-const { schema, rules } = useFollowUp()
+const { schema, rules, schemaTypeOnline, schemaTypeOffline } = useFollowUp()
 const publishState = ref(false)
-const dataForm = ref({})
+const designerList = ref<any[]>([])
+const dataForm = ref({
+  stylistId: '',
+  followType: '1',
+})
 const dataFormRef = ref<ComponentExposed<typeof DataForm>>()
+const schemaTypeOfflineRef = ref<ComponentExposed<typeof DataForm>>()
+const schemaTypeOnlineRef = ref<ComponentExposed<typeof DataForm>>()
 const items = computed(() => {
   if (isAgent.value) {
     return [
@@ -34,7 +43,7 @@ const items = computed(() => {
         path: '/pages/home/index',
       },
       {
-        title: '发布',
+        title: '跟进',
         iconPath: addBlue,
         selectedIconPath: addBlue,
         path: '/pages/publish/index',
@@ -67,6 +76,10 @@ const items = computed(() => {
 })
 const handleTabbarItemClick = (path: string) => {
   if (path === '/pages/publish/index') {
+    if (schema.value.stylistId.props.columns.length > 0) {
+      const { value } = designerList.value[0]
+      dataForm.value.stylistId = value
+    }
     publishState.value = true
     return
   }
@@ -94,6 +107,17 @@ const handleSubmit = async () => {
     publishState.value = false
   }
 }
+const getCurrentLocation = () => {
+  console.log('点击地址')
+  uni.chooseAddress({
+    success: (success) => {
+      console.log('地理位置 成功', success)
+    },
+    fail: (fail) => {
+      console.log('获取地址失败', fail)
+    },
+  })
+}
 onMounted(async () => {
   const {
     data: { list },
@@ -106,6 +130,8 @@ onMounted(async () => {
     value: item.id,
     label: item.name,
   }))
+  designerList.value = schema.value.stylistId.props.columns
+  console.log('dataForm.value', designerList.value)
 })
 </script>
 
@@ -132,6 +158,33 @@ onMounted(async () => {
             direction="horizontal"
             v-model="dataForm"
           ></DataForm>
+          <!-- 根据 followType 值 区分 线下 线上 -->
+          <template v-if="dataForm.followType === '1'">
+            <div
+              class="grid mb-4 items-start"
+              :style="{ 'grid-template-columns': `${addUnit(64)} auto` }"
+            >
+              <label
+                class="text-sm font-normal leading-relaxed text-black/60 h-10 flex items-center"
+              >
+                地址
+              </label>
+              <div
+                class="wd-input h-[40px] lh-[40px] flex justify-between px-[20px]"
+                @click="getCurrentLocation"
+              >
+                <div>点击获取当前位置</div>
+                <wd-icon name="refresh" size="14px"></wd-icon>
+              </div>
+            </div>
+          </template>
+          <DataForm
+            ref="schemaTypeOnlineRef"
+            :schema="schemaTypeOnline"
+            :rules="rules"
+            direction="horizontal"
+            v-model="dataForm"
+          ></DataForm>
         </div>
         <div><wd-button block :round="false" @click="handleSubmit">提交</wd-button></div>
       </view>

+ 25 - 2
packages/merchant/src/pages/agent/designer/archives/index.vue

@@ -47,6 +47,7 @@ const tabs = [
 ]
 const id = ref()
 const { data: basicData, run: setBasicData } = useRequest(() => getDesignerBasicInfo(id.value))
+console.log('basicData::::', basicData)
 const query = computed(() => ({ userId: id.value }))
 const eventsQuery = computed(() => ({ type: '3' }))
 const actionSheetStatus = ref(false)
@@ -247,9 +248,31 @@ onShow(async () => {
           >
             <div class="flex items-center justify-between">
               <div class="text-black/40 text-base font-normal font-['PingFang_SC'] leading-none">
-                {{ (messages.objects.designerBasiceInfo as any)[key] }}
+                {{ (messages.objects?.designerBasiceInfo as any)[key] }}
               </div>
-              <DataRender v-bind="(renders.designerBasiceInfo as any)[key](value)"></DataRender>
+              <template v-if="key === 'avatar'">
+                <DataRender v-bind="{ type: 'Avatar', value: value }"></DataRender>
+              </template>
+              <template
+                v-else-if="key === 'birthday' || key === 'cooperationTime' || key === 'createTime'"
+              >
+                <DataRender v-bind="{ type: 'Date', value: value }"></DataRender>
+              </template>
+              <template v-else-if="key === 'sex'">
+                <DataRender
+                  v-bind="{
+                    type: 'Select',
+                    value: value,
+                    options: [
+                      { label: '男', value: 0 },
+                      { label: '女', value: 1 },
+                    ],
+                  }"
+                ></DataRender>
+              </template>
+              <template v-else>
+                <DataRender v-bind="{ type: 'Original', value: value }"></DataRender>
+              </template>
             </div>
             <!-- <SectionHeading size="base" :title="messages.objects.designerBasiceInfo[key]">
           <template #append>

+ 3 - 3
packages/merchant/src/pages/agent/designer/detail.vue

@@ -89,7 +89,7 @@ const browseRecordCountItems = computed(() => [
     subValue: browseRecordCount.value?.homeShareNumberYear ?? 0,
   },
   {
-    title: '分享浏览数',
+    title: '主页浏览数',
     subTitle: '本年',
     value: browseRecordCount.value?.shareViewNumber ?? 0,
     subValue: browseRecordCount.value?.shareViewNumberYear ?? 0,
@@ -148,8 +148,8 @@ onLoad(async (query) => {
       <div class="bg-white rounded-2xl shadow flex items-center p-4">
         <div class="relative">
           <wd-img width="64" height="64" round :src="data?.avatar"></wd-img>
-          <div v-if="data?.retryStatus" class="absolute right-0 bottom--1">
-            <wd-img width="14" height="14" :src="link" round custom-class="bg-[#ff9a9a]"></wd-img>
+          <div v-if="data?.retryStatus" class="absolute right-0 bottom-1">
+            <wd-img width="14" height="14" :src="link" round></wd-img>
           </div>
         </div>
         <div class="flex-1 ml-[11px]">

+ 30 - 6
packages/merchant/src/pages/agent/designer/index.vue

@@ -45,6 +45,7 @@ const filterQuery = ref<{
   minPoints?: string
   maxPoints?: string
   brokerId?: string
+  recommend?: boolean
 }>({
   tags: [],
   levels: [],
@@ -124,9 +125,9 @@ const createFollowUpSubmit = async () => {
 const handleSubmit = () => {
   query.value = {
     ...filterQuery.value,
-    tags: filterQuery.value.tags.join(','),
-    levels: filterQuery.value.levels.join(','),
-    retryStatus: filterQuery.value.retryStatus.join(','),
+    tags: filterQuery.value.tags ? filterQuery.value.tags.join(',') : '',
+    levels: filterQuery.value.levels ? filterQuery.value.levels.join(',') : '',
+    retryStatus: filterQuery.value.retryStatus ? filterQuery.value.retryStatus.join(',') : '',
   }
   filterState.value = false
 }
@@ -160,6 +161,7 @@ onLoad(async (params: { title?: string; filter?: string; tags?: string }) => {
           <div class="flex-1">
             <wd-search
               v-model="searchText"
+              placeholder="输入设计师姓名模糊搜索"
               @focus="searchFocus"
               @blur="searchBlur"
               @search="search"
@@ -200,13 +202,20 @@ onLoad(async (params: { title?: string; filter?: string; tags?: string }) => {
                           </div>
 
                           <div
-                            class="h-4 bg-neutral-100 rounded-[20px] justify-start items-center inline-flex flex-row ml-[9px]"
+                            class="h-4 rounded-[20px] justify-start items-center inline-flex flex-row ml-[9px]"
                           >
+                            <div
+                              v-if="!it.recommend"
+                              class="text-[10px] bg-[#fff3e4] px-[4px] py-[4px] c-[#f2a64f] rounded-[3px]"
+                            >
+                              推荐设计师
+                            </div>
                             <wd-img
                               v-if="it.levelId"
                               width="63"
                               height="18.6"
-                              :src="getMemberLevelLogo(it.levelId)"
+                              custom-class="ml-[9px]"
+                              :src="getMemberLevelLogo(Number(it.levelId))"
                             ></wd-img>
                           </div>
                         </div>
@@ -398,7 +407,22 @@ onLoad(async (params: { title?: string; filter?: string; tags?: string }) => {
           </wd-checkbox>
         </template>
       </wd-checkbox-group>
-      <div class="flex gap-4">
+      <SectionHeading title="推荐设计师"></SectionHeading>
+      <wd-checkbox-group shape="button" v-model="filterQuery.recommend">
+        <template
+          v-for="(tag, index) in [
+            // { label: '全部', value: '' },
+            { label: '否', value: false },
+            { label: '是', value: true },
+          ]"
+          :key="index"
+        >
+          <wd-checkbox custom-class="w-50%!" :model-value="tag.value">
+            {{ tag.label }}
+          </wd-checkbox>
+        </template>
+      </wd-checkbox-group>
+      <div class="flex gap-4 pt-[10px]">
         <div class="flex-1">
           <wd-button block :round="false" @click="handleReset">重置</wd-button>
         </div>

+ 7 - 1
packages/merchant/src/pages/agent/report-infos/index.vue

@@ -31,6 +31,9 @@ const handleDelete = async (reportInfo: ReportInfo) => {
   })
   pageHelperRef.value?.refresh()
 }
+onShow(async () => {
+  pageHelperRef.value?.refresh()
+})
 </script>
 <template>
   <div class="flex-grow flex flex-col">
@@ -69,7 +72,10 @@ const handleDelete = async (reportInfo: ReportInfo) => {
                 <template
                   v-for="(item, index) in [
                     { label: '店面名称', value: it.shopName },
-                    { value: it.arrivalTime, label: '到店时间' },
+                    {
+                      value: dayjs(it.arrivalTime).format('YYYY-MM-DD hh:mm:ss'),
+                      label: '到店时间',
+                    },
                     { value: it.receptionist, label: '接待人员' },
                     { value: it.contactNumber, label: '联系电话' },
                     { value: it.customerName, label: '客户姓名' },

+ 19 - 2
packages/merchant/src/pages/common/auth/change-password/index.vue

@@ -14,6 +14,11 @@ import { requestToast } from '@designer-hub/app/src/core/utils/common'
 const userStore = useUserStore()
 const { userInfo } = storeToRefs(userStore)
 const dataFormRef = ref<ComponentExposed<typeof DataForm>>()
+const formData = ref({
+  oldPassword: '',
+  newPassword: '',
+  confirmPassword: '',
+})
 const schema = ref<DataFormSchema>({
   oldPassword: {
     type: 'TextField',
@@ -43,12 +48,24 @@ const schema = ref<DataFormSchema>({
     },
   },
 })
+const confirmPasswordValidator = (val: any) => {
+  if (!val) {
+    return false
+  }
+  if (formData.value?.newPassword?.trim() === '') {
+    return Promise.reject('请输入新密码')
+  }
+  if (formData.value?.newPassword !== formData.value?.confirmPassword) {
+    return Promise.reject('输入两次新密码不一致')
+  }
+}
 const rules = ref({
   oldPassword: [{ required: true, message: '请输入旧密码' }],
   newPassword: [{ required: true, message: '请输入新密码' }],
-  confirmPassword: [{ required: true, message: '请再次输入新密码' }],
+  confirmPassword: [
+    { required: true, message: '请再次输入新密码', validator: confirmPasswordValidator },
+  ],
 })
-const formData = ref({})
 const submitDisabled = computed(() => ({}))
 const handleSubmit = async () => {
   // const data = await dataFormRef.value?.validate()

+ 35 - 11
packages/merchant/src/pages/home/merchant/add-reporting-information.vue

@@ -3,6 +3,7 @@
 </route>
 <script setup lang="ts">
 import dayjs from 'dayjs'
+import { ComponentExposed } from 'vue-component-type-helpers'
 import { DataFormSchema } from '../../../components/data-form'
 import DataForm from '../../../components/data-form.vue'
 import { createReportInfo, getDesignerList } from '../../../core/libs/requests'
@@ -80,6 +81,7 @@ const customerSchema = ref<DataFormSchema>({
     type: 'TextField',
     label: '客户姓名:',
     labelWidth: 84,
+    required: true,
     props: {
       placeholder: '请输入客户姓名',
     },
@@ -101,17 +103,31 @@ const customerSchema = ref<DataFormSchema>({
     },
   },
 })
+const rules = ref({
+  customerName: [{ required: true, message: '请填写客户姓名' }],
+})
+const customInfoRef = ref<ComponentExposed<typeof DataForm>>()
 const SubmitClick = async () => {
+  console.log(await customInfoRef.value!.validate())
+  const { valid } = await customInfoRef.value!.validate()
+  const submitForm = formData.value
   console.log(formData.value)
-  formData.value.stylistName = stylistIdName.value
-  uni.showLoading()
-  const { code, msg } = await createReportInfo(formData.value)
-  uni.hideLoading()
-  if (code === 0) {
-    uni.showToast({
-      title: '上报成功',
-      icon: 'none',
-    })
+  if (valid) {
+    submitForm.stylistName = stylistIdName.value
+    submitForm.arrivalTime = new Date(formData.value.arrivalTime).getTime()
+    uni.showLoading()
+    const { code, msg } = await createReportInfo(submitForm)
+    uni.hideLoading()
+    if (code === 0) {
+      uni
+        .showToast({
+          title: '上报成功',
+          icon: 'none',
+        })
+        .then(() => {
+          uni.navigateBack()
+        })
+    }
   }
 }
 const getDesInfo = async () => {
@@ -137,10 +153,18 @@ onMounted(async () => {
     </div>
     <div>客户信息</div>
     <div class="mt-1">
-      <data-form :schema="customerSchema" :direction="'horizontal'" v-model="formData" />
+      <data-form
+        ref="customInfoRef"
+        :schema="customerSchema"
+        :direction="'horizontal'"
+        :rules="rules"
+        v-model="formData"
+      />
     </div>
     <div class="flex-1"></div>
-    <div><wd-button block :round="false" @click="SubmitClick">提交</wd-button></div>
+    <div>
+      <wd-button block :round="false" @click="SubmitClick">提交</wd-button>
+    </div>
   </div>
 </template>
 

+ 0 - 1
packages/merchant/src/pages/home/merchant/mine.vue

@@ -6,7 +6,6 @@ style:
 </route>
 <script lang="ts" setup>
 import { desinTopBg } from '@designer-hub/assets/src/svgs'
-
 </script>
 
 <template>