<template>
    <div class="content">
        <div class="header">
            <u-navbar
                :background="{backgroundColor: '#ffcb57'}"
                :border-bottom="false"
                title="验收"
                title-color="#472d21"
            ></u-navbar>
        </div>
        <view class="wrap">
            <web-view
                :webview-styles="webviewStyles"
                :src="url"
            ></web-view>
        </view>
        <u-toast ref="uToast" />
    </div>
</template>

<script>
import request from '../../common/service';
export default {
    data() {
        return {
            url: '',
            webviewStyles: {
                progress: {
                    color: '#FF3333',
                },
            },
        };
    },
    onLoad(options) {
        this.url = `https://www.jtfw8.com/WXXCX/Evaluate/index/${options.orderId}`
    },
    computed: {},
    methods: {
        placeOrder() {
            if (!this.content) {
                this.$refs.uToast.show({
                    title: '请完善信息后再提交！',
                });
                return;
            }
            request
                .post('/api/Feedback/SH', {
                    Model: {
                        FContent: this.content,
                    },
                })
                .then((res) => {
                    const { code, message } = res;
                    if (code === 0) {
                        this.$refs.uToast.show({
                            title: '提交成功！',
                            isTab: true,
                            url: '/pages/my/index',
                        });
                    } else {
                        this.$refs.uToast.show({
                            title: message,
                        });
                    }
                });
        },
    },
    onShareAppMessage(res) {
        if (res.from === 'button') {
            // 来自页面内分享按钮
            console.log(res.target);
        }
        return {
            title: '京台分享更多精彩',
            path: '/pages/index/index',
            imageUrl: '/static/images/share/WechatIMG96.png'
        };
    },
};
</script>

<style lang="scss" scoped>
.content {
    .header {
        background-color: #ffcb57;
    }
    .wrap {
        display: flex;
        flex-direction: column;
        height: calc(100vh - var(--window-top));
        width: 100%;
    }
}
</style>
