用AI写网站(一个按摩店的介绍网站)


from flask import Flask, render_template

app = Flask(__name__)

# 模拟按摩店的信息(中文)

massage_shop = {

    'name': '放松天地按摩店',

    'description': '欢迎来到放松天地按摩店,我们提供舒缓身心的宁静体验。无论您寻求疗愈按摩还是只是想放松一下,我们的专业治疗师都会满足您的需求。',

    'services': [

        {'name': '瑞典按摩', 'description': '经典按摩,有助于放松和缓解肌肉紧张。'},

        {'name': '深层组织按摩', 'description': '针对深层肌肉和结缔组织,适合慢性肌肉问题。'},

        {'name': '热石按摩', 'description': '利用加热石头放松肌肉,促进血液循环,平静神经系统。'}

    ],

    'contact': {

        'phone': '+1234567890',

        'email': 'info@relaxationhaven.com',

        'address': '54321, 禅静城, 宁静路123号'

    }

}

@app.route('/')

# #在当前目录下新建一个名为templates的文件夹,将index.html放在这个文件夹下

def index():

    return render_template('index.html', shop=massage_shop)

if __name__ == '__main__':

    app.run(host='0.0.0.0', port=5000, debug=True)


##index.html文件代码

<!-- <!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Remote Movie Player</title>

</head>

<body>

    <h1>Welcome to the Remote Movie Player!</h1>

    <p>Click below to play the movie:</p>

    <a href="/play_movie" target="_blank">Play Movie</a>

</body>

</html> -->

<!DOCTYPE html>

<html lang="zh-CN">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>{{ shop.name }}</title>

    <style>

        body {

            font-family: Arial, sans-serif;

            line-height: 1.6;

            padding: 20px;

        }

        .container {

            max-width: 800px;

            margin: auto;

        }

        .service {

            margin-bottom: 20px;

            padding: 10px;

            background-color: #f0f0f0;

        }

    </style>

</head>

<body>

    <div class="container">

        <h1>{{ shop.name }}</h1>

        <p>{{ shop.description }}</p>


        <h2>我们的服务</h2>

        {% for service in shop.services %}

        <div class="service">

            <h3>{{ service.name }}</h3>

            <p>{{ service.description }}</p>

        </div>

        {% endfor %}

        <h2>联系我们</h2>

        <p>电话:{{ shop.contact.phone }}</p>

        <p>邮箱:<a href="mailto:{{ shop.contact.email }}">{{ shop.contact.email }}</a></p>

        <p>地址:{{ shop.contact.address }}</p>

    </div>

</body>

</html>

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容