| | |
| | | <view class="container-page" style="padding: 0rpx;"> |
| | | <view> |
| | | <view class="form-item"> |
| | | <view class="label required">商品分类todo</view> |
| | | <view class="label required">商品分类</view> |
| | | <view class="m-l-a m-r-0 flex " :class="[!dto.category?'desc-gray':'']" @click="()=>{ |
| | | show_select_category=true |
| | | // show_select_category=true |
| | | $refs.picker_category.showPicker() |
| | | }"> |
| | | <view>{{dto.categoryStr||dto.category || '请选择'}}</view> |
| | | <u-icon class="m-l-a" name="arrow-right"></u-icon> |
| | |
| | | |
| | | } |
| | | }"> |
| | | <view>{{ '去设置'}}</view> |
| | | <view>{{ paramstr || '去设置'}}</view> |
| | | <u-icon class="m-l-a" name="arrow-right"></u-icon> |
| | | </view> |
| | | |
| | |
| | | </view> |
| | | </uni-popup> |
| | | |
| | | <dying318picker :pickerList="columns_categorys" ref="picker_category" :pickerKey="pickerKey"></dying318picker> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import environments from '@/environments' |
| | | import dying318picker from '@/components/dying318-picker/Picker.vue' |
| | | |
| | | import { |
| | | mapState |
| | |
| | | columns_categorys: [], |
| | | columns_levels: [], |
| | | // columns_params: [], //弹窗选择具体的值 |
| | | pickerKey: { |
| | | value: 'id', |
| | | lable: 'name', |
| | | children: 'children' |
| | | }, |
| | | cancel: { |
| | | color: '#999', |
| | | }, |
| | | confirm: { |
| | | color: '#20613D', |
| | | }, |
| | | // column: [ |
| | | // {flex: 1}, |
| | | // {flex: 1}, |
| | | // {flex: 3}, |
| | | // ] |
| | | } |
| | | }, |
| | | async onLoad(options) { |
| | | //tree |
| | | this.$http.request('get', '/api/flower/category/tree', {}).then(res => { |
| | | 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: '全部', |
| | | // value: '', |
| | | // children: [] |
| | | // }) |
| | | |
| | | }) |
| | | |
| | | this.$http.request('get', '/api/code/value', { |
| | | params: { |
| | | typeCode: 'FLOWER_LEVEL' |
| | | } |
| | | }).then(res => { |
| | | var data = res.data |
| | | this.columns_levels = [data || []] |
| | | this.columns_levels[0].unshift({ |
| | | label: '全部', |
| | | value: '' |
| | | }) |
| | | |
| | | }) |
| | | if (options.id) { |
| | | this.id = options.id |
| | | uni.setNavigationBarTitle({ |
| | |
| | | }) |
| | | } |
| | | |
| | | //tree |
| | | this.$http.request('get', '/api/flower/category/tree', {}).then(res => { |
| | | var data = res.data |
| | | this.columns_categorys = [data || []] |
| | | this.columns_categorys[0].unshift({ |
| | | label: '全部', |
| | | value: '', |
| | | children: [] |
| | | }) |
| | | |
| | | }) |
| | | |
| | | this.$http.request('get', '/api/code/value', { |
| | | params: { |
| | | typeCode: 'FLOWER_LEVEL' |
| | | } |
| | | }).then(res => { |
| | | var data = res.data |
| | | this.columns_levels = [data || []] |
| | | this.columns_levels[0].unshift({ |
| | | label: '全部', |
| | | value: '' |
| | | }) |
| | | |
| | | }) |
| | | } |
| | | |
| | | }, |
| | |
| | | |
| | | }, |
| | | computed: { |
| | | ...mapState(['currentInfo']) |
| | | ...mapState(['currentInfo']), |
| | | paramstr() { |
| | | if (this.dto && this.dto.params) { |
| | | var strs = [] |
| | | for (var i of this.dto.params) { |
| | | if (i.value) { |
| | | strs.push(i.value) |
| | | } |
| | | } |
| | | return strs.join(',') |
| | | } |
| | | return '' |
| | | } |
| | | }, |
| | | components: { |
| | | |
| | | dying318picker |
| | | } |
| | | } |
| | | </script> |