wzp
2022-02-21 2667d6931e0f85f3dda26238330d9c45385025cf
assetMgtH5/pages/index/index.vue
@@ -17,6 +17,7 @@
            </u-grid-item>
         </u-grid>
      </view>
   </view>
</template>
@@ -24,6 +25,7 @@
   export default {
      data() {
         return {
            token:'',
            current: 0,
            list5: [
               '/static/swiper/swiper1.png',
@@ -46,27 +48,59 @@
                  name: 'hourglass',
                  title: '资产报修'
               },
               {
                  name: 'star',
                  title: '资产报废'
               },
               {
                  name: 'star',
                  title: '资产清单'
               },
            ],
            code:0,
            state:0
         }
      },
      onLoad() {
      onLoad(options) {
         console.log('code='+options.code)
         this.code=options.code;
         this.state=options.state;
         //发布使用
         // this.login(this.code);
         //this.getUserInfo();
      },
      methods: {
         login(){
         //登陆
         login(code){
            this.$http.get('/h5login',{params:{code:code}})
               .then(res => {
                  // debugger;
                  console.log(res.data)
                  if (res.data.code === 0) {
                     this.token=res.data.token;
                     console.log('token='+this.token);
                     uni.setStorageSync('token', this.token);
                  }
               }).catch(err => {
            
                  console.log('错误',err.data)
               })
         },
         getUserInfo(){
            this.$http.get('/assets/approval/getUserDetail')
               .then(res => {
                  // debugger;
                  if (res.data.code === 0) {
                     let data = res.data.data
                     uni.setStorageSync('user', data);
                  }
               }).catch(err => {
                  console.log('错误',err.data)
               })
         },
         
         gridClick(index) {
            console.log(index);
            // console.log(index);
            switch (index) {
               case 0: {
                  this.navTo("../assets/use");
@@ -85,7 +119,7 @@
                  break;
               }
               case 4: {
                  this.navTo("../assets/scrapped");
                  this.navTo("../assets/list");
                  break;
               }
               case 5: {