<script setup lang="ts">
    import successfulDialog from '@/components/ConfirmDialog/successfulDialog.vue'
    import { getCurrentDateTime } from '@/utils/date'
    import * as HomeAPI from '@/api/model/home'
    import { useUserStore } from '@/store/modules/user'

    const userStore = useUserStore()
    const consultRecord = reactive({
        id: '',
        mobile: '', // 咨询人号码
        consultTime: '', // 咨询时间
        bizType: 5, // 业务类型(1代理记账,2农资,3农机,4金融)
        enterpriseId: '2004840258270437514', // 意向企业
        feedbackRemark: '', // 反馈备注
    })
    const pageData = reactive({
        showLogoutDialog: false,
        allpyMessageTitle: '',
        applyMessageText: '',
    })
    onShow(() => {
        const { id, realname, phone } = userStore.getUserInfo
        consultRecord.id = id
        consultRecord.mobile = phone
        consultRecord.feedbackRemark = realname
    })
    // 洽谈合作
    function onCooperationClick() {
        // Message.alert('洽谈合作功能暂不可用，敬请期待~', '温馨提示')
        consultRecord.consultTime = getCurrentDateTime()
        HomeAPI.postConsultRecordAdd(consultRecord).then((res) => {
            pageData.allpyMessageTitle = '申请成功'
            pageData.applyMessageText = '平台已收到申请，将尽快与您取得联系！'
            pageData.showLogoutDialog = true
        })
    }
</script>

<template>
    <view class="codefun-flex-col page">
        <view class="codefun-flex-col section">
            <view class="codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch group">
                <view class="image" />
                <view class="codefun-flex-row group_2" />
            </view>
            <view class="codefun-self-start image_5 mt-17" />
        </view>
        <view class="codefun-flex-col codefun-relative group_3">
            <view class="codefun-flex-col section_2">
                <image
                    class="codefun-self-start image_6"
                    src="/static/images/codefun/d2a84f1b89b07a6933618103d252e7b0.png"
                />
                <view
                    class="codefun-mt-14 codefun-flex-col codefun-justify-start codefun-items-start codefun-self-stretch text-wrapper"
                >
                    <text class="font text">主营：快消品、生鲜食品、家居日百、即时零售</text>
                </view>
                <text class="codefun-mt-14 codefun-self-stretch font text_2 indent-md">
                    小象超市是新零售时代的智能超市品牌，融合线上线下购物体验，为都市人群提供便捷、高效的购物服务。采用先进的智能设备和大数据技术，实现商品精准推荐和库存管理。承诺30分钟极速配送，覆盖周边3公里范围。精选全球优质商品，严格把控品质关。门店配备自助结账系统，提升购物效率。专业采购团队每日精选新鲜食材，确保商品品质。致力于打造智能、便捷、品质的新零售购物体验。
                </text>
            </view>
            <view class="codefun-mt-12 codefun-flex-col section_3">
                <view class="codefun-flex-col codefun-items-start">
                    <text class="font_2">市场服务</text>
                    <view class="codefun-mt-12 section_4" />
                </view>
                <view class="codefun-mt-16 grid">
                    <view class="codefun-flex-col codefun-items-center grid-item">
                        <image class="image_7" src="/static/images/codefun/1c894d991cb2f0bc70d7b3800e700423.png" />
                        <text class="font text_3 mt-7">企业采购</text>
                    </view>
                    <view class="codefun-flex-col codefun-items-center grid-item_2">
                        <image class="image_7" src="/static/images/codefun/bcef1c15592bbd3c1cea02585ab7df5e.png" />
                        <text class="codefun-mt-8 font">生鲜直达</text>
                    </view>
                    <view class="codefun-flex-col codefun-items-center grid-item_3">
                        <image class="image_7" src="/static/images/codefun/4c062022080fd91d26f0e788b0c7bcc3.png" />
                        <text class="codefun-mt-8 font">品质优选</text>
                    </view>
                    <view class="codefun-flex-col codefun-items-center grid-item_4">
                        <image class="image_7" src="/static/images/codefun/1fea922d5a84f1606c718ff6f84dd2d5.png" />
                        <text class="font mt-9">即时配送</text>
                    </view>
                    <view class="codefun-flex-col codefun-items-center grid-item_5">
                        <image class="image_7" src="/static/images/codefun/992b9452dc42a5ce3e7ba8e8331e04b6.png" />
                        <text class="font text_4 mt-9">会员专享价</text>
                    </view>
                    <view class="codefun-flex-col codefun-items-center grid-item_6">
                        <image class="image_7" src="/static/images/codefun/28e6ba6a7044ff17819971d0ee111232.png" />
                        <text class="font mt-9">预售团购</text>
                    </view>
                </view>
            </view>
            <view class="codefun-mt-12 codefun-flex-col section_5">
                <view class="codefun-flex-col codefun-items-start">
                    <text class="font_2 text_5">合作伙伴</text>
                    <view class="codefun-mt-12 section_4" />
                </view>
                <view class="codefun-flex-col group_4 mt-11">
                    <view class="codefun-flex-row codefun-justify-between group_5">
                        <image class="image_8" src="/static/images/codefun/561cbade5e492859310397601e8f681b.png" />
                        <image
                            class="image_8 image_9"
                            src="/static/images/codefun/ca51ef39a15d5c8414c9a427b3c4434b.png"
                        />
                    </view>
                    <view
                        class="codefun-flex-row codefun-justify-between codefun-relative group_6"
                        @click="onCooperationClick"
                    >
                        <image class="image_8" src="/static/images/codefun/979b55187f885f1b302dd29760bb516b.png" />
                        <image class="image_8" src="/static/images/codefun/ecb55b953a8e07a17301bcd12aec591f.png" />
                        <view class="codefun-flex-row codefun-justify-center codefun-items-center section_6 pos">
                            <image class="image_10" src="/static/images/codefun/3e23931a51dff8d555bc053a33133be1.png" />
                            <text class="text_6 ml-9">洽谈合作</text>
                        </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
    <successfulDialog
        v-model:show="pageData.showLogoutDialog"
        :title="pageData.allpyMessageTitle"
        :content="pageData.applyMessageText"
        confirmText="我知道了"
        @confirm="pageData.showLogoutDialog = false"
    />
</template>

<style scoped lang="scss">
    .ml-5 {
        margin-left: 10rpx;
    }
    .mt-17 {
        margin-top: 34rpx;
    }
    .mt-7 {
        margin-top: 14rpx;
    }
    .mt-9 {
        margin-top: 18rpx;
    }
    .mt-11 {
        margin-top: 22rpx;
    }
    .ml-9 {
        margin-left: 18rpx;
    }
    page {
        background-color: #e6f5e8;
    }
    .page {
        padding-bottom: 140rpx;
        background-color: #e6f5e8;
        mix-blend-mode: NOTTHROUGH;
        height: 100%;
        width: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        .section {
            padding: 28rpx 38rpx 382rpx;
            background-image: url('/static/images/codefun/d64598e1f76d3e1977d820f8b2f02843.png');
            background-size: 100% 100%;
            background-repeat: no-repeat;
            .group {
                padding: 0 2rpx;
                .image {
                    border-radius: 64rpx;
                    width: 108rpx;
                    height: 42rpx;
                }
                .group_2 {
                    margin-right: 16rpx;
                    .image_2 {
                        mix-blend-mode: NOTTHROUGH;
                        width: 34rpx;
                        height: 22rpx;
                    }
                    .image_3 {
                        mix-blend-mode: NOTTHROUGH;
                        width: 30rpx;
                        height: 22rpx;
                    }
                    .image_4 {
                        width: 48rpx;
                        height: 22rpx;
                    }
                }
            }
            .image_5 {
                mix-blend-mode: NOTTHROUGH;
                width: 14rpx;
                height: 26rpx;
            }
        }
        .group_3 {
            margin-top: -188rpx;
            padding: 0 24rpx;
            .section_2 {
                margin-right: 8rpx;
                padding: 34rpx 28rpx 26rpx;
                background-color: #ffffff;
                border-radius: 16rpx;
                mix-blend-mode: NOTTHROUGH;
                .image_6 {
                    width: 236rpx;
                    height: 72rpx;
                }
                .text-wrapper {
                    padding: 16rpx 0;
                    background-image: linear-gradient(273.7deg, #00c53b 0.1%, #64d63e 99.9%);
                    border-radius: 8rpx;
                    .text {
                        margin-left: 20rpx;
                        color: #ffffff;
                        line-height: 22.76rpx;
                    }
                }
                .text_2 {
                    line-height: 40rpx;
                    text-align: justify;
                }
            }
            .section_3 {
                margin-right: 8rpx;
                padding: 24rpx 28rpx 28rpx;
                background-color: #ffffff;
                border-radius: 16rpx;
                mix-blend-mode: NOTTHROUGH;
                .grid {
                    height: 276rpx;
                    display: grid;
                    grid-template-rows: repeat(2, minmax(0, 1fr));
                    grid-template-columns: repeat(3, minmax(0, 1fr));
                    row-gap: 22rpx;
                    column-gap: 22rpx;
                    .grid-item {
                        padding: 28rpx 0;
                        background-color: #eefaeb;
                        border-radius: 8rpx;
                        .text_3 {
                            line-height: 22.44rpx;
                        }
                    }
                    .grid-item_2 {
                        padding: 28rpx 0;
                        background-color: #eff1ff;
                        border-radius: 8rpx;
                    }
                    .image_7 {
                        width: 32rpx;
                        height: 32rpx;
                    }
                    .grid-item_3 {
                        padding: 28rpx 0;
                        background-color: #fff3f1;
                        border-radius: 8rpx;
                    }
                    .grid-item_4 {
                        padding: 26rpx 0 32rpx;
                        background-color: #e8f7f7;
                        border-radius: 8rpx;
                    }
                    .grid-item_5 {
                        padding: 26rpx 0 32rpx;
                        background-color: #fff3e7;
                        border-radius: 8rpx;
                        .text_4 {
                            line-height: 22.68rpx;
                        }
                    }
                    .grid-item_6 {
                        padding: 28rpx 0;
                        background-color: #faf8ea;
                        border-radius: 8rpx;
                    }
                }
            }
            .font {
                font-size: 24rpx;
                font-family: SourceHanSansCN;
                line-height: 22.4rpx;
                color: #333333;
            }
            .section_5 {
                margin-right: 8rpx;
                padding: 28rpx 20rpx 28rpx 28rpx;
                background-color: #ffffff;
                border-radius: 16.14rpx;
                mix-blend-mode: NOTTHROUGH;
                .text_5 {
                    line-height: 29.82rpx;
                }
                .group_4 {
                    height: 152rpx;
                    .group_5 {
                        padding: 0 20rpx;
                        .image_9 {
                            margin-right: 60rpx;
                        }
                    }
                    .group_6 {
                        margin-top: -22rpx;
                        padding: 46rpx 20rpx 0 84rpx;
                        .section_6 {
                            padding: 20rpx 0;
                            background-color: #ff9800;
                            border-radius: 198rpx;
                            .image_10 {
                                width: 30rpx;
                                height: 30rpx;
                            }
                            .text_6 {
                                color: #ffffff;
                                font-size: 28rpx;
                                font-family: SourceHanSansCN;
                                line-height: 25.92rpx;
                            }
                        }
                        .pos {
                            position: fixed;
                            left: 40rpx;
                            right: 40rpx;
                            bottom: 40rpx;
                            z-index: 1;
                        }
                    }
                    .image_8 {
                        filter: drop-shadow(0rpx 4rpx 4rpx #0e421829);
                        width: 242rpx;
                        height: 64rpx;
                    }
                }
            }
            .font_2 {
                font-size: 32rpx;
                font-family: SourceHanSansCN;
                line-height: 30.04rpx;
                color: #333333;
            }
            .section_4 {
                background-image: linear-gradient(272deg, #5cb56e 0%, #64d63e 100%);
                width: 128rpx;
                height: 6rpx;
            }
        }
    }
</style>
