zoukankan      html  css  js  c++  java
  • 工作记录1

    1.vue 编辑页面

    create 调用两个接口 

    listSpu接口

     let vm = this;
       vm.uistate.loading =true;
       let payload = {
          params: {
            spu_code: ''
          },
          callback: {
            success: (result) => {
              vm.uistate.loading =false;
              vm.uistate.result = {
                resultcode: rests.SUCCEED
              }
              // 得到的货号的数值
              vm.spus = result;
              vm.filtered_spus = vm.spus;
    
            },
            failed: (resultcode, message, detail) => {
              vm.uistate.result = {
                resultcode: resultcode,
                messagesizes: message,
                detail: detail
              };
            },
            completed: () => {
              vm.uistate.loading = false;
            }
          }
        }
       this.listSpu(payload);
    

      getSku接口

    this.model.kid = this.$route.query.kid;
       if (!this.model.kid) {
         this.uistate.loading = false;
         this.uistate.result = {
           resultcode: -1,
           message: '参数不能为空',
           detail: '请返回重试!'
         };
         return;
       }
       payload={
         params:{
            kid:vm.model.kid
         },
         callback : {
              success: (result) => {
                vm.model.kid=result.kid;
                vm.model.spu = result.spu_code;      //货号
                vm.model.remark = result.remark;     //备注
                vm.model.color = result.color;       //颜色
                vm.model.size = result.size;         //尺码
                vm.model.price = parseFloat(result.price/100).toFixed(2);   //价格,保留两位小数
                vm.model.barcode = result.barcode;   //条码
               },
             failed: (resultcode, message, detail) => {
                 vm.uistate.result = {
                   resultcode: resultcode,
                   message: message,
                   detail: detail
                 };
                 vm.uistate.loading = false;
               },
               completed: () => {}
             }
         };
       this.getSku(payload);
    

      

  • 相关阅读:
    Bzoj3998 [TJOI2015]弦论
    Bzoj3669 [Noi2014]魔法森林
    Bzoj2157 旅游
    Bzoj3282 Tree
    POJ1743 Musical Theme
    CodeVs1515 跳
    Bzoj1013 [JSOI2008]球形空间产生器sphere
    Bzoj1007 [HNOI2008]水平可见直线
    洛谷P3120 [USACO15FEB]Cow Hopscotch
    洛谷P3112 [USACO14DEC]后卫马克Guard Mark
  • 原文地址:https://www.cnblogs.com/guangzhou11/p/9399428.html
Copyright © 2011-2022 走看看