| | |
| | | <u-form :border-bottom="false" :model="form" ref="uForm" :error-type="['toast']" :rule="rules"> |
| | | |
| | | <u-form-item label="商品分类" label-width="130" prop=""> |
| | | <div @click="showPicker"> |
| | | {{ form.___path || '请选择所在地区' }} |
| | | </div> |
| | | <picker @change="bindCategoryChange" :value="index" :range="categoryArray"> |
| | | <view class="uni-input">{{categoryArray[index]}}</view> |
| | | </picker> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="border" label="商品名称" label-width="130" prop="name"> |
| | |
| | | </u-form-item> |
| | | |
| | | <u-form-item label="商品品牌" label-width="130" prop=""> |
| | | <div @click="showPicker"> |
| | | {{ form.___path || '请选择所在地区' }} |
| | | <div @click="showBrands"> |
| | | {{ form.___path || '请选择品牌' }} |
| | | </div> |
| | | </u-form-item> |
| | | |
| | | <u-form-item label="计量单位" label-width="130" prop="___path"> |
| | | <div @click="showPicker"> |
| | | <div @click="showUnit"> |
| | | {{ form.___path || '请选择所在地区' }} |
| | | </div> |
| | | </u-form-item> |
| | |
| | | import UCheckboxGroup from '@/uview-components/uview-ui/components/u-checkbox-group/u-checkbox-group.vue'; |
| | | import UCheckbox from '@/uview-components/uview-ui/components/u-checkbox/u-checkbox.vue'; |
| | | import UIcon from '@/uview-components/uview-ui/components/u-icon/u-icon.vue'; |
| | | import UActionSheet from '@/uview-components/uview-ui/components/u-action-sheet/u-action-sheet.vue'; |
| | | |
| | | |
| | | import storage from "@/utils/storage.js"; |
| | | import * as API_GOODS from "@/api/goods.js"; |
| | | export default { |
| | | components: { UForm, UFormItem, UInput, UUpload, UCheckboxGroup, UCheckbox, UIcon, UActionSheet }, |
| | | components: { UForm, UFormItem, UInput, UUpload, UCheckboxGroup, UCheckbox, UIcon }, |
| | | data() { |
| | | return { |
| | | storage, |
| | | form: {} |
| | | form: {}, |
| | | categoryArray:[], |
| | | brandsArray:[], |
| | | unitArray:[] |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | }); |
| | | this.form.images = images; |
| | | }, |
| | | bindCategoryChange(){}, |
| | | bindBrandsChange(){}, |
| | | bindUnitChange(){}, |
| | | initCategory(){ |
| | | API_GOODS.getStoreGoodsCategory().then((res) => { |
| | | const params = res.data.result; |
| | | this.categoryArray = params |
| | | if(params.length>0){ |
| | | this.initBrands(params[0].id) |
| | | } |
| | | }); |
| | | }, |
| | | initBrands(categoryId){ |
| | | API_GOODS.getStoreGoodsBrands(categoryId).then((res) => { |
| | | const params = res.data.result; |
| | | this.brandsArray = params |
| | | }); |
| | | }, |
| | | initGoods(){ |
| | | API_GOODS.getgoodsUnit().then((res) => { |
| | | const params = res.data.result; |
| | | this.unitArray = params |
| | | }); |
| | | }, |
| | | }, |
| | | |
| | | onShow() { |
| | | this.initGoods() |
| | | this.initCategory() |
| | | |
| | | }, |
| | | onLoad(option) { |
| | | uni.showLoading({ |
| | | title: "加载中", |
| | | }); |
| | | this.routerVal = option; |
| | | console.log(option); |
| | | |
| | | if (option.id) { |
| | | getGoodsDetail(option.id).then((res) => { |
| | | API_GOODS.getStoreGoodsInfo(option.id).then((res) => { |
| | | const params = res.data.result; |
| | | params.___path = params.consigneegoodsPath; |
| | | this.$set(this, "form", params); |