| | |
| | | 修改 |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- |
| | | |
| | | <u-picker @confirm="select_category" keyName="name" @cancel="show_select_category=false" |
| | | :show="show_select_category" :columns="columns_categorys"></u-picker> |
| | | :show="show_select_category" :columns="columns_categorys"></u-picker> --> |
| | | |
| | | <u-picker @confirm="select_level" keyName="label" @cancel="show_select_level=false" :show="show_select_level" |
| | | :columns="columns_levels"></u-picker> |
| | |
| | | <view class="button-green" @click="closeParamPop">返回</view> |
| | | </view> |
| | | </uni-popup> |
| | | |
| | | <dying318picker :pickerList="columns_categorys" ref="picker_category" :pickerKey="pickerKey"></dying318picker> |
| | | <dying318picker :picker-list="columns_categorys" ref="picker_category" @confirm="confirmPickerCategory"> |
| | | </dying318picker> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | columns_categorys: [], |
| | | columns_levels: [], |
| | | // columns_params: [], //弹窗选择具体的值 |
| | | pickerKey: { |
| | | value: 'id', |
| | | lable: 'name', |
| | | children: 'children' |
| | | }, |
| | | cancel: { |
| | | color: '#999', |
| | | }, |
| | |
| | | var data = res.data |
| | | this.columns_categorys = data || [] |
| | | console.log('columns_categorys',this.columns_categorys) |
| | | |
| | | // this.columns_categorys = [data || []] |
| | | // this.columns_categorys[0].unshift({ |
| | | // label: '全部', |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | async confirmPickerCategory(picker) { |
| | | console.log('confirmPickerCategory', picker) |
| | | var id = picker.value |
| | | var name = picker.label |
| | | if (id !== this.dto.category) { |
| | | if (this.dto.category) { |
| | | await this.$message.confirm('修改分类将清空商品参数,确定修改吗') |
| | | } |
| | | this.dto.categoryStr = name |
| | | this.dto.category = id |
| | | this.$message.showLoading() |
| | | await this.refresh_category() |
| | | this.$message.hideLoading() |
| | | } |
| | | }, |
| | | closeParamPop() { |
| | | this.$refs.popup_param.close() |
| | | }, |
| | | |
| | | async select_category(e) { |
| | | if (e.value[0].id !== this.dto.category) { |
| | | if (this.dto.category) { |
| | | await this.$message.confirm('修改分类将清空商品参数,确定修改吗') |
| | | } |
| | | console.log('select_category', e) |
| | | this.show_select_category = false |
| | | this.dto.categoryStr = e.value[0].name |
| | | this.dto.category = e.value[0].id |
| | | this.$message.showLoading() |
| | | await this.refresh_category() |
| | | this.$message.hideLoading() |
| | | } else { |
| | | |
| | | } |
| | | |
| | | }, |
| | | async refresh_category() { |
| | | // this.columns_params = [] |
| | | this.dto.params = [] |