|
|
@@ -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("操作成功!");
|
|
|
});
|
|
|
},
|