baid222u 5 years ago
parent
commit
26be595470
3 changed files with 41 additions and 13 deletions
  1. 1 1
      components/areaSelect.vue
  2. 33 12
      pages/index.vue
  3. 7 0
      pages/project/index.vue

+ 1 - 1
components/areaSelect.vue

@@ -22,7 +22,7 @@
     </ul>
     <!-- end:选择省份 -->
 
-    <button>确定</button>
+    <button @click="coolse">确定</button>
   </div>
 </template>
 <script>

+ 33 - 12
pages/index.vue

@@ -17,11 +17,7 @@
       </div>
       <areaone class="regions" v-on:province="province" :regiont="regiont" v-if="region[0]"/>
       <ul id="category" v-if="region[1]">
-        <li>535656</li>
-        <li>535656</li>
-        <li>535656</li>
-        <li>535656</li>
-        <li>535656</li>
+        <li v-for="v in bid" :key="v.id" @click="biding(v.id)">{{v.name}}</li>
       </ul>
       <div class="bg" v-if="region[0]||region[1]"></div>
     </div>
@@ -109,11 +105,18 @@ export default {
   },
   data() {
     return {
-      author: '微信公众号 jinkey-love',
-      region: [false, false],
-      img: ['open', 'hide'],
-      name: '选择区域',
-      regiont: []
+      region: [false, false], //选择项切换
+      img: ['open', 'hide'], //图片切换
+      regiont: [], //区域列表
+      bid: [
+        { id: 0, name: '全部' },
+        { id: 1, name: '招标预告' },
+        { id: 2, name: '招标公告' },
+        { id: 3, name: '招标变更' },
+        { id: 4, name: '中标公告' }
+      ], //类别列表
+      cd: '', //区域的值
+      b: '' //类别的值
     }
   },
   fetch({ app }) {
@@ -128,6 +131,7 @@ export default {
     //   })
   },
   created() {
+    //获取区域列表
     this.$axios
       .get('/province.html')
       .then(response => {
@@ -137,7 +141,8 @@ export default {
       .catch(response => {})
   },
   methods: {
-     regions(e) {
+    regions(e) {
+      //切换选择项
       const region = [false, false]
       region[e] = true
       const img = ['open', 'hide']
@@ -146,10 +151,26 @@ export default {
       this.region = [].concat(region)
     },
     province: function(somedata) {
-      console.log(somedata)
+      //接收区域的值
+      this.close()
     },
     Subscribe(e) {
       this.$router.push({ path: '/bidding/subList' })
+    },
+    close: function(e) {
+      //关闭选择项
+      const region = [false, false]
+      this.region = [].concat(region)
+    },
+    biding: function(e) {
+      if (e > 0) {
+        this.b = 'b' + e
+      } else {
+        this.b = false
+      }
+
+      console.log(this.b)
+      this.close()
     }
   }
 }

+ 7 - 0
pages/project/index.vue

@@ -28,6 +28,13 @@
         <li>535656</li>
         <li>535656</li>
       </ul>
+       <ul id="category" v-if="region[2]">
+        <li>535656</li>
+        <li>535656</li>
+        <li>535656</li>
+        <li>535656</li>
+        <li>535656</li>
+      </ul>
       <div class="bg" v-if="region[0]||region[1]||region[2]"></div>
     </div>
     <ul class="bidlist">