This commit is contained in:
2026-04-22 17:49:33 +08:00
parent 562a9b5172
commit eced5c75d7
23 changed files with 790 additions and 244 deletions

View File

@@ -35,9 +35,9 @@
:product-config="pickerProductConfig" @change="onPriceChange" />
<div class="flex items-center justify-between my-2">
<div class="text-sm text-gray-500">推广收益为 <span class="text-orange-500">{{ promotionRevenue
}}</span> </div>
}}</span> </div>
<div class="text-sm text-gray-500">我的成本为 <span class="text-orange-500">{{ costPrice
}}</span> </div>
}}</span> </div>
</div>
</van-cell-group>
</div>
@@ -87,16 +87,6 @@
<script setup>
import PriceInputPopup from '@/components/PriceInputPopup.vue';
import VipBanner from '@/components/VipBanner.vue';
const reportTypes = [
{ text: "小微企业", value: "companyinfo", id: 2 },
{ text: "贷前风险", value: "preloanbackgroundcheck", id: 5 },
{ text: "个人大数据", value: "personaldata", id: 27 },
{ text: '入职风险', value: 'backgroundcheck', id: 1 },
{ text: '家政风险', value: 'homeservice', id: 3 },
{ text: '婚恋风险', value: 'marriage', id: 4 },
{ text: '租赁风险', value: 'rentalrisk', id: 6 },
];
const showTypePicker = ref(false);
const showApplyPopup = ref(false); // 用来控制申请代理弹窗的显示
const showPricePicker = ref(false);
@@ -107,6 +97,16 @@ const selectedReportType = ref([]);
const clientPrice = ref(null);
const productConfig = ref(null);
const linkIdentifier = ref("")
const reportTypes = computed(() => {
if (!productConfig.value?.length) return []
return productConfig.value
.map(item => ({
id: item.product_id,
text: item.product_name || `产品${item.product_id}`,
value: item.product_en || '',
}))
.filter(item => !!item.value)
})
@@ -185,10 +185,10 @@ onMounted(() => {
// getAgentInfo();
});
const SelectTypePicker = (reportType) => {
selectedReportType.value = [reportType];
selectedReportType.value = [reportType.value];
pickerFieldText.value = reportType.text;
pickerFieldVal.value = reportType.value;
for (let i of productConfig.value) {
for (let i of (productConfig.value || [])) {
if (i.product_id === reportType.id) {
pickerProductConfig.value = i
clientPrice.value = i.cost_price
@@ -202,8 +202,16 @@ const getPromoteConfig = async () => {
if (data.value && !error.value) {
if (data.value.code === 200) {
productConfig.value = data.value.data.AgentProductConfig;
SelectTypePicker(reportTypes[0])
productConfig.value = data.value.data.AgentProductConfig || [];
if (reportTypes.value.length > 0) {
SelectTypePicker(reportTypes.value[0])
} else {
pickerProductConfig.value = null
pickerFieldText.value = ''
pickerFieldVal.value = null
clientPrice.value = null
showToast({ message: '暂无可推广产品' });
}
} else {
console.log("Error fetching agent info", data.value);
}