hid_msrpuwgj56ccf29 1 year ago
parent
commit
b9178033f9

BIN
task/ai-frontend/1.png


BIN
task/ai-frontend/2.png


BIN
task/ai-frontend/3.png


+ 55 - 0
task/ai-frontend/task-comp.html

@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+<head>
+    
+  <style>
+    /* 搜索栏CSS 样式 */
+    .search-container {
+      display: flex;
+      align-items: center;
+      width: 300px;
+    }
+
+    .search-input {
+      flex: 1;
+      padding: 8px;
+      font-size: 16px;
+      border: 1px solid #ccc;
+      border-radius: 4px;
+    }
+
+    .search-input::placeholder {
+      color: #999;
+      opacity: 1;
+    }
+
+    .search-button {
+      padding: 8px 12px;
+      background-color: #4CAF50;
+      color: white;
+      font-size: 16px;
+      border: none;
+      border-radius: 4px;
+      cursor: pointer;
+    }
+  </style>
+</head>
+<body>
+  <div class="search-container">
+    <input type="text" id="search-input" class="search-input" placeholder="Enter your search term">
+    <button id="search-button" class="search-button">Search</button>
+  </div>
+
+  <script>
+    // JavaScript 代码
+    const searchButton = document.getElementById("search-button");
+    const searchInput = document.getElementById("search-input");
+
+    searchButton.addEventListener("click", function() {
+      const searchTerm = searchInput.value;
+      // 在这里执行搜索操作,可以根据需求进行相应的处理
+      console.log("Search term:", searchTerm);
+    });
+  </script>
+</body>
+</html>

+ 66 - 0
task/ai-frontend/task-comp1.html

@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>城市选择</title>
+  <style>
+    .select-container {
+      display: inline-block;
+      margin-right: 10px;
+    }
+  </style>
+</head>
+<body>
+  <div id="app">
+    <div class="select-container">
+      <select v-model="selectedProvince" @change="onProvinceChange">
+        <option value="">请选择省份</option>
+        <option v-for="province in provinces" :value="province">{{ province }}</option>
+      </select>
+    </div>
+    <div class="select-container">
+      <select v-model="selectedCity" @change="onCityChange">
+        <option value="">请选择城市</option>
+        <option v-for="city in cities" :value="city">{{ city }}</option>
+      </select>
+    </div>
+    <div class="select-container">
+      <select v-model="selectedDistrict">
+        <option value="">请选择区域</option>
+        <option v-for="district in districts" :value="district">{{ district }}</option>
+      </select>
+    </div>
+  </div>
+
+  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script>
+  <script>
+    new Vue({
+      el: '#app',
+      data: {
+        provinces: ['江西省', '浙江省', '江苏省'],
+        cities: {
+          '江西省': '南昌市',
+          '浙江省': '杭州市',
+          '江苏市': '南京市'
+        },
+        districts: {
+          '南昌市': ['东湖区', '西湖区', '青山湖区'],
+          '上海市': ['黄浦区', '徐汇区', '静安区'],
+          '北京市': ['东城区', '西城区', '朝阳区']
+        },
+        selectedProvince: '',
+        selectedCity: '',
+        selectedDistrict: ''
+      },
+      methods: {
+        onProvinceChange() {
+          this.selectedCity = '';
+          this.selectedDistrict = '';
+        },
+        onCityChange() {
+          this.selectedDistrict = '';
+        }
+      }
+    });
+  </script>
+</body>
+</html>

+ 66 - 0
task/ai-frontend/task-comp2.html

@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>卡片组示例</title>
+  <style>
+    .card-container {
+      display: flex;
+      flex-wrap: wrap;
+    }
+
+    .card {
+      width: 300px;
+      margin: 10px;
+      border: 1px solid #ccc;
+      border-radius: 5px;
+      padding: 10px;
+      box-sizing: border-box;
+      text-align: center;
+    }
+
+    .card img {
+      width: 100%;
+      height: auto;
+      border-radius: 5px;
+      margin-bottom: 10px;
+    }
+
+    .card p {
+      margin: 0;
+    }
+  </style>
+</head>
+<body>
+  <div id="app">
+    <div class="card-container">
+      <div v-for="card in cards" class="card">
+        <img :src="card.image" alt="Card Image">
+        <p>{{ card.text }}</p>
+      </div>
+    </div>
+  </div>
+
+  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script>
+  <script>
+    new Vue({
+      el: '#app',
+      data: {
+        cards: [
+          {
+            image: '1.png',
+            text: '布偶猫'
+          },
+          {
+            image: '2.png',
+            text: '幼猫'
+          },
+          {
+            image: '3.png',
+            text: '健康宠物猫'
+          }
+        ]
+      }
+    });
+  </script>
+</body>
+</html>