Explorar o código

显示问题添加

fuwei %!s(int64=6) %!d(string=hai) anos
pai
achega
110fcb16e5
Modificáronse 2 ficheiros con 14 adicións e 3 borrados
  1. 13 2
      store/src/admin/goodsManage/add.vue
  2. 1 1
      store/src/static/css/common.scss

+ 13 - 2
store/src/admin/goodsManage/add.vue

@@ -45,7 +45,7 @@
             <block v-for="(item, index) in categoryData" :key="index">
               <button
                 class="admin-button-com"
-                :class="[form.categoryIdList.includes(item.id) ? '' : 'default']"
+                :class="[form.categoryIdList.includes(item.id*1) ? '' : 'default']"
                 @click="selCategoryFn(item)"
               >{{ item.categoryName || '暂无' }}</button>
             </block>
@@ -187,19 +187,29 @@ export default {
     ...mapGetters({ categoryData: "getCategory" })
   },
   onLoad() {
+    console.log(this.categoryData)
     // this.init()
   },
+  watch:{
+    categoryData(val){
+      console.log('1111',val)
+    }
+  },
   methods: {
     init() {
       getCategory()
         .then(() => {
         if (this.option.id) {
+          uni.setNavigationBarTitle({
+              title: '修改商品'
+          });
           this._getDet();
         }
       });
     },
     _getDet() {
-      return getDetailB({ id: this.option.id }).then(res => {
+      return getDetailB({ id: this.option.id })
+        .then(res => {
         if (this.$util.isEmpty(res.data)) {
           return;
         }
@@ -237,6 +247,7 @@ export default {
         status: this.status,
         ...form
       }).then(res => {
+        uni.navigateBack({});
         this.$msg("操作成功!");
       });
     },

+ 1 - 1
store/src/static/css/common.scss

@@ -107,7 +107,7 @@ body {
     padding: 10px 20px;
     background-color: #fff;
     border-radius: 8px;
-    border: 1px solid $mainColor;
+    // border: 1px solid $mainColor;
     text-align: center;
     line-height: 1;
     margin: 0;