wxy hace 4 años
padre
commit
3bdf36ca52
Se han modificado 2 ficheros con 20 adiciones y 7 borrados
  1. 15 6
      src/views/index.vue
  2. 5 1
      src/views/userCenter/dock/detail.vue

+ 15 - 6
src/views/index.vue

@@ -8,7 +8,7 @@
         <el-col :span="24" class="main">
           <van-field readonly clickable name="picker" :value="value" label="选择器" placeholder="点击选择城市" @click="showPicker = true" />
           <van-popup v-model="showPicker" position="bottom">
-            <van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="showPicker = false" />
+            <van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="showPicker = false" value-key="name" />
           </van-popup>
         </el-col>
         <el-col :span="24" class="foot">
@@ -41,17 +41,26 @@ export default {
       value: '',
       showPicker: false,
       columns: [
-        { id: '1', name: '1' },
-        { id: '2', name: '2' },
-        { id: '3', name: '3' },
-        { id: '4', name: '4' },
+        { id: '1', name: '长春' },
+        { id: '2', name: '吉林' },
+        { id: '3', name: '沈阳' },
+        { id: '4', name: '大连' },
       ],
+      // columns: ['长春', '吉林', '沈阳', '大连'],
+      // columns: [
+      //   { id: '1', text: '长春' },
+      //   { id: '2', text: '吉林' },
+      //   { id: '3', text: '沈阳' },
+      //   { id: '4', text: '大连' },
+      // ],
     };
   },
   created() {},
   methods: {
     onConfirm(value) {
-      console.log(value);
+      this.value = value.name;
+      this.showPicker = false;
+      // console.log(value);
     },
   },
   computed: {

+ 5 - 1
src/views/userCenter/dock/detail.vue

@@ -68,6 +68,7 @@ export default {
   async created() {
     await this.searchtype();
     await this.searchinfo();
+    await this.searchproduct();
   },
   methods: {
     ...markettype({ markettypeList: 'query' }),
@@ -116,7 +117,10 @@ export default {
       if (this.$checkRes(res)) {
         this.$set(this, `cooperationList`, res.data);
       }
-      res = await this.marketquery({ userid: this.user.uid, status: 1 });
+    },
+    //查询产品列表
+    async searchproduct() {
+      let res = await this.marketquery({ userid: this.user.uid, status: 1 });
       if (this.$checkRes(res)) {
         this.$set(this, `goodsLists`, res.data);
       }