|
@@ -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>
|