xuqiang 4 лет назад
Родитель
Сommit
f3f0616df1
2 измененных файлов с 8 добавлено и 19 удалено
  1. 1 1
      src/main.js
  2. 7 18
      src/pages/wallet.vue

+ 1 - 1
src/main.js

@@ -107,7 +107,7 @@ export default {
             'van-sticky': '/vant/sticky/index',
             'van-loading': '/vant/loading/index',
             'van-action-sheet': '/vant/action-sheet/index',
-            'van-picker': '/vant/picker/index',
+            'van-datetime-picker': '/vant/datetime-picker/index',
             'van-cell-group': '/vant/cell-group/index',
             'van-cell': '/vant/cell/index',
             'van-field': '/vant/field/index',

+ 7 - 18
src/pages/wallet.vue

@@ -27,7 +27,7 @@
         <van-sticky :offset-top="0">
             <div class="time-box">
                 <van-dropdown-menu>
-                    <van-dropdown-item :value="time" :options="option1" />
+                    <van-dropdown-item @click="change(text)" :value="time" :options="option1" />
                 </van-dropdown-menu>
                 <div class="flex1"></div>
                 <span class="text">
@@ -66,20 +66,7 @@ export default {
             moneyInfo: {},
             time: 0,
             newDate: {},
-            option1: [
-                { text: '2012年1月', value: 0 },
-                { text: '2012年2月', value: 1 },
-                { text: '2012年3月', value: 2 },
-                { text: '2012年4月', value: 3 },
-                { text: '2012年5月', value: 4 },
-                { text: '2012年6月', value: 5 },
-                { text: '2012年7月', value: 6 },
-                { text: '2012年8月', value: 7 },
-                { text: '2012年9月', value: 8 },
-                { text: '2012年10月', value: 9 },
-                { text: '2012年11月', value: 10 },
-                { text: '2012年12月', value: 11 }
-            ],
+            option1: [{ text: '2012-05', value: 0 }, { text: '2012-06', value: 1 }, { text: '2012-07', value: 2 }],
             empty: true
         };
     },
@@ -102,12 +89,14 @@ export default {
                 query: {}
             });
         },
-        Withdrawal() {}
+        Withdrawal() {},
+        change(text) {
+            console.log('====');
+            console.log(text);
+        }
     },
     onShow() {
         this.newDate = this.option1;
-        let Aike = this.dateList.text.replace(/%E5%B9%B4/g, '年');
-        console.log(Aike);
         // this.$http.get('/transactionRecord/showMyTransactionRecords', { yearMonth: Aike }).then(res => {
         //     console.log(res);
         // });