|
@@ -100,24 +100,33 @@
|
|
|
|
|
|
|
|
<!-- 商品规格 -->
|
|
<!-- 商品规格 -->
|
|
|
<view class="pro-cate-container">
|
|
<view class="pro-cate-container">
|
|
|
- <view class="cate-title" v-if="!isProductCenter"><text style="color:red;">*</text>商品规格</view>
|
|
|
|
|
|
|
+ <view class="cate-title" v-if="!isProductCenter">商品规格批量设置</view>
|
|
|
|
|
|
|
|
<view class="cate-list">
|
|
<view class="cate-list">
|
|
|
<view class="cate-item">
|
|
<view class="cate-item">
|
|
|
<view class="cate-pic-line">
|
|
<view class="cate-pic-line">
|
|
|
- <image src="@/static/avator.png" class="cate-pic" mode="widthFix"></image>
|
|
|
|
|
- <view class="cate-name">
|
|
|
|
|
- 属性1;属性2
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <!-- <image src="@/static/avator.png" class="cate-pic" mode="widthFix"></image> -->
|
|
|
|
|
+ <up-upload :fileList="oneTemplate.imgs" @afterRead="async (e) => {
|
|
|
|
|
+ await afterRead(e);
|
|
|
|
|
+ getImageProductGg('oneTemplate');
|
|
|
|
|
+ }" @delete="onProductImageGgDelete('oneTemplate')" name="productGg" :maxCount="1">
|
|
|
|
|
+ <view class="upload-btn">
|
|
|
|
|
+ <up-icon name="plus" size="20" color="#666"></up-icon>
|
|
|
|
|
+ <text class="upload-tip">上传图片</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </up-upload>
|
|
|
|
|
+ <!-- <view class="cate-name">
|
|
|
|
|
+ {{oneTemplate.attrName}}
|
|
|
|
|
+ </view> -->
|
|
|
</view>
|
|
</view>
|
|
|
<view class="cate-ipt-line">
|
|
<view class="cate-ipt-line">
|
|
|
- <up-input class="cate-ipt" style="margin-right: 16rpx;" v-model="formData.laborCost" placeholder="请输入工费"
|
|
|
|
|
- inputAlign="left" border="none" type="digit" labelWidth="">
|
|
|
|
|
|
|
+ <up-input class="cate-ipt" style="margin-right: 16rpx;" v-model="oneTemplate.price"
|
|
|
|
|
+ placeholder="请输入工费" inputAlign="left" border="none" type="digit" labelWidth="">
|
|
|
<template #suffix>
|
|
<template #suffix>
|
|
|
<text class="unit">元/g</text>
|
|
<text class="unit">元/g</text>
|
|
|
</template>
|
|
</template>
|
|
|
</up-input>
|
|
</up-input>
|
|
|
- <up-input class="cate-ipt" v-model="formData.stock" placeholder="请输入库存"
|
|
|
|
|
|
|
+ <up-input class="cate-ipt" v-model="oneTemplate.stock" placeholder="请输入库存"
|
|
|
inputAlign="left" border="none" type="number" labelWidth="">
|
|
inputAlign="left" border="none" type="number" labelWidth="">
|
|
|
<template #suffix>
|
|
<template #suffix>
|
|
|
<text class="unit">件</text>
|
|
<text class="unit">件</text>
|
|
@@ -125,13 +134,72 @@
|
|
|
</up-input>
|
|
</up-input>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="cate-ipt-line">
|
|
<view class="cate-ipt-line">
|
|
|
- <up-input class="cate-ipt" style="margin-right: 16rpx;" v-model="formData.weight" placeholder="请输入重量"
|
|
|
|
|
|
|
+ <up-input class="cate-ipt" style="margin-right: 16rpx;" v-model="oneTemplate.weight"
|
|
|
|
|
+ placeholder="请输入重量" inputAlign="left" border="none" type="digit" labelWidth="">
|
|
|
|
|
+ <template #suffix>
|
|
|
|
|
+ <text class="unit">g</text>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </up-input>
|
|
|
|
|
+ <up-input class="cate-ipt" v-model="oneTemplate.additionalAmount" placeholder="请输入附加金额"
|
|
|
|
|
+ inputAlign="left" border="none" type="number" labelWidth="">
|
|
|
|
|
+ <template #suffix>
|
|
|
|
|
+ <text class="unit">元</text>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </up-input>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="cate-ipt-line" style="padding: 0;">
|
|
|
|
|
+ <up-input class="cate-ipt" v-model="oneTemplate.barCode" placeholder="请输入商品编号"
|
|
|
inputAlign="left" border="none" type="digit" labelWidth="">
|
|
inputAlign="left" border="none" type="digit" labelWidth="">
|
|
|
|
|
+ </up-input>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="cate-add" @click="setAllAttr">
|
|
|
|
|
+ 批量设置规格
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="pro-cate-container">
|
|
|
|
|
+ <view class="cate-title" v-if="!isProductCenter"><text style="color:red;">*</text>商品规格</view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="cate-list">
|
|
|
|
|
+ <view class="cate-item" v-for="(item,index) of attrTable" :key="'attr'+index">
|
|
|
|
|
+ <view class="cate-pic-line">
|
|
|
|
|
+ <!-- <image src="@/static/avator.png" class="cate-pic" mode="widthFix"></image> -->
|
|
|
|
|
+ <up-upload :fileList="item.imgs" @afterRead="async (e) => {
|
|
|
|
|
+ await afterRead(e);
|
|
|
|
|
+ getImageProductGg(index);
|
|
|
|
|
+ }" @delete="onProductImageGgDelete(index)" name="productGg" :maxCount="1">
|
|
|
|
|
+ <view class="upload-btn">
|
|
|
|
|
+ <up-icon name="plus" size="20" color="#666"></up-icon>
|
|
|
|
|
+ <text class="upload-tip">上传图片</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </up-upload>
|
|
|
|
|
+ <view class="cate-name">
|
|
|
|
|
+ {{item.attrName}}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="cate-ipt-line">
|
|
|
|
|
+ <up-input class="cate-ipt" style="margin-right: 16rpx;" v-model="item.price"
|
|
|
|
|
+ placeholder="请输入工费" inputAlign="left" border="none" type="digit" labelWidth="">
|
|
|
|
|
+ <template #suffix>
|
|
|
|
|
+ <text class="unit">元/g</text>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </up-input>
|
|
|
|
|
+ <up-input class="cate-ipt" v-model="item.stock" placeholder="请输入库存" inputAlign="left"
|
|
|
|
|
+ border="none" type="number" labelWidth="">
|
|
|
|
|
+ <template #suffix>
|
|
|
|
|
+ <text class="unit">件</text>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </up-input>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="cate-ipt-line">
|
|
|
|
|
+ <up-input class="cate-ipt" style="margin-right: 16rpx;" v-model="item.weight"
|
|
|
|
|
+ placeholder="请输入重量" inputAlign="left" border="none" type="digit" labelWidth="">
|
|
|
<template #suffix>
|
|
<template #suffix>
|
|
|
<text class="unit">g</text>
|
|
<text class="unit">g</text>
|
|
|
</template>
|
|
</template>
|
|
|
</up-input>
|
|
</up-input>
|
|
|
- <up-input class="cate-ipt" v-model="formData.additionalFee" placeholder="请输入附加金额"
|
|
|
|
|
|
|
+ <up-input class="cate-ipt" v-model="item.additionalAmount" placeholder="请输入附加金额"
|
|
|
inputAlign="left" border="none" type="number" labelWidth="">
|
|
inputAlign="left" border="none" type="number" labelWidth="">
|
|
|
<template #suffix>
|
|
<template #suffix>
|
|
|
<text class="unit">元</text>
|
|
<text class="unit">元</text>
|
|
@@ -139,7 +207,7 @@
|
|
|
</up-input>
|
|
</up-input>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="cate-ipt-line" style="padding: 0;">
|
|
<view class="cate-ipt-line" style="padding: 0;">
|
|
|
- <up-input class="cate-ipt" v-model="formData.barCode" placeholder="请输入商品编号"
|
|
|
|
|
|
|
+ <up-input class="cate-ipt" v-model="item.barCode" placeholder="请输入商品编号"
|
|
|
inputAlign="left" border="none" type="digit" labelWidth="">
|
|
inputAlign="left" border="none" type="digit" labelWidth="">
|
|
|
</up-input>
|
|
</up-input>
|
|
|
</view>
|
|
</view>
|
|
@@ -149,7 +217,7 @@
|
|
|
管理规格
|
|
管理规格
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="card-title">商品规格</view>
|
|
|
|
|
|
|
+ <!-- <view class="card-title">商品规格</view>
|
|
|
<up-form-item label="工费" prop="laborCost" :borderBottom="false" :required="true">
|
|
<up-form-item label="工费" prop="laborCost" :borderBottom="false" :required="true">
|
|
|
<up-input v-model="formData.laborCost" placeholder="请输入工费" inputAlign="right" border="none"
|
|
<up-input v-model="formData.laborCost" placeholder="请输入工费" inputAlign="right" border="none"
|
|
|
type="digit"></up-input>
|
|
type="digit"></up-input>
|
|
@@ -193,7 +261,7 @@
|
|
|
</up-upload>
|
|
</up-upload>
|
|
|
<text class="format-tip">支持上传PNG、JPG格式图片,每张不超过5MB,最多可上传1张。</text>
|
|
<text class="format-tip">支持上传PNG、JPG格式图片,每张不超过5MB,最多可上传1张。</text>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
|
|
+ </view> -->
|
|
|
<up-form-item label="商品排序" prop="sort" :borderBottom="false">
|
|
<up-form-item label="商品排序" prop="sort" :borderBottom="false">
|
|
|
<up-input v-model="formData.sort" placeholder="请输入排序号" inputAlign="right" border="none"
|
|
<up-input v-model="formData.sort" placeholder="请输入排序号" inputAlign="right" border="none"
|
|
|
type="number"></up-input>
|
|
type="number"></up-input>
|
|
@@ -238,7 +306,8 @@
|
|
|
} from 'vue';
|
|
} from 'vue';
|
|
|
import {
|
|
import {
|
|
|
onShow,
|
|
onShow,
|
|
|
- onLoad
|
|
|
|
|
|
|
+ onLoad,
|
|
|
|
|
+ onUnload
|
|
|
} from "@dcloudio/uni-app";
|
|
} from "@dcloudio/uni-app";
|
|
|
import {
|
|
import {
|
|
|
productCategory,
|
|
productCategory,
|
|
@@ -320,6 +389,25 @@
|
|
|
const productId = ref(null);
|
|
const productId = ref(null);
|
|
|
const isProductCenter = ref(null);
|
|
const isProductCenter = ref(null);
|
|
|
|
|
|
|
|
|
|
+ // 规格
|
|
|
|
|
+ const attr = ref([]);
|
|
|
|
|
+ // 规格列表
|
|
|
|
|
+ const attrTable = ref([]);
|
|
|
|
|
+ // 规格数据模板
|
|
|
|
|
+ const oneTemplate = ref({
|
|
|
|
|
+ image: '',
|
|
|
|
|
+ imgs: [],
|
|
|
|
|
+ price: '',
|
|
|
|
|
+ additionalAmount: '',
|
|
|
|
|
+ stock: '',
|
|
|
|
|
+ barCode: '',
|
|
|
|
|
+ weight: '',
|
|
|
|
|
+ })
|
|
|
|
|
+ // 规格历史数据,防止刷新数据时已填数据丢失
|
|
|
|
|
+ let historyAttr = []
|
|
|
|
|
+ // 规格表历史数据
|
|
|
|
|
+ let historyTable = {}
|
|
|
|
|
+
|
|
|
// 材质列表
|
|
// 材质列表
|
|
|
const materialList = ref([{
|
|
const materialList = ref([{
|
|
|
name: '黄金',
|
|
name: '黄金',
|
|
@@ -379,27 +467,6 @@
|
|
|
message: '请选择材质',
|
|
message: '请选择材质',
|
|
|
trigger: ['blur', 'change']
|
|
trigger: ['blur', 'change']
|
|
|
},
|
|
},
|
|
|
- weight: {
|
|
|
|
|
- type: 'string',
|
|
|
|
|
- required: true,
|
|
|
|
|
- pattern: /^\d+(\.\d+)?$/,
|
|
|
|
|
- message: '重量必须是数字,可以是小数',
|
|
|
|
|
- trigger: ['blur', 'change']
|
|
|
|
|
- },
|
|
|
|
|
- laborCost: {
|
|
|
|
|
- type: 'string',
|
|
|
|
|
- required: true,
|
|
|
|
|
- pattern: /^\d+(\.\d+)?$/,
|
|
|
|
|
- message: '工费必须是数字,可以是小数',
|
|
|
|
|
- trigger: ['blur', 'change']
|
|
|
|
|
- },
|
|
|
|
|
- additionalFee: {
|
|
|
|
|
- type: 'string',
|
|
|
|
|
- required: true,
|
|
|
|
|
- pattern: /^\d+(\.\d+)?$/,
|
|
|
|
|
- message: '附加费必须是数字,可以是小数',
|
|
|
|
|
- trigger: ['blur', 'change']
|
|
|
|
|
- },
|
|
|
|
|
sort: {
|
|
sort: {
|
|
|
type: 'string',
|
|
type: 'string',
|
|
|
pattern: /^\d*$/,
|
|
pattern: /^\d*$/,
|
|
@@ -410,36 +477,60 @@
|
|
|
return /^\d+$/.test(value);
|
|
return /^\d+$/.test(value);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- stock: {
|
|
|
|
|
- type: 'string',
|
|
|
|
|
- required: true,
|
|
|
|
|
- pattern: /^\d*$/,
|
|
|
|
|
- message: '库存必须是整数',
|
|
|
|
|
- trigger: ['blur', 'change'],
|
|
|
|
|
- validator: (rule, value) => {
|
|
|
|
|
- if (!value || value.trim().length === 0) return false;
|
|
|
|
|
- return /^\d+$/.test(value);
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- barCode: {
|
|
|
|
|
- type: 'string',
|
|
|
|
|
- required: true,
|
|
|
|
|
- pattern: /^\d*$/,
|
|
|
|
|
- message: '商品编号必须是整数',
|
|
|
|
|
- trigger: ['blur', 'change'],
|
|
|
|
|
- validator: (rule, value) => {
|
|
|
|
|
- if (!value || value.trim().length === 0) return false;
|
|
|
|
|
- return /^\d+$/.test(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // additionalFee: {
|
|
|
|
|
+ // type: 'string',
|
|
|
|
|
+ // required: true,
|
|
|
|
|
+ // pattern: /^\d+(\.\d+)?$/,
|
|
|
|
|
+ // message: '附加费必须是数字,可以是小数',
|
|
|
|
|
+ // trigger: ['blur', 'change']
|
|
|
|
|
+ // },
|
|
|
|
|
+ // weight: {
|
|
|
|
|
+ // type: 'string',
|
|
|
|
|
+ // required: true,
|
|
|
|
|
+ // pattern: /^\d+(\.\d+)?$/,
|
|
|
|
|
+ // message: '重量必须是数字,可以是小数',
|
|
|
|
|
+ // trigger: ['blur', 'change']
|
|
|
|
|
+ // },
|
|
|
|
|
+ // laborCost: {
|
|
|
|
|
+ // type: 'string',
|
|
|
|
|
+ // required: true,
|
|
|
|
|
+ // pattern: /^\d+(\.\d+)?$/,
|
|
|
|
|
+ // message: '工费必须是数字,可以是小数',
|
|
|
|
|
+ // trigger: ['blur', 'change']
|
|
|
|
|
+ // },
|
|
|
|
|
+ // stock: {
|
|
|
|
|
+ // type: 'string',
|
|
|
|
|
+ // required: true,
|
|
|
|
|
+ // pattern: /^\d*$/,
|
|
|
|
|
+ // message: '库存必须是整数',
|
|
|
|
|
+ // trigger: ['blur', 'change'],
|
|
|
|
|
+ // validator: (rule, value) => {
|
|
|
|
|
+ // if (!value || value.trim().length === 0) return false;
|
|
|
|
|
+ // return /^\d+$/.test(value);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // },
|
|
|
|
|
+ // barCode: {
|
|
|
|
|
+ // type: 'string',
|
|
|
|
|
+ // required: true,
|
|
|
|
|
+ // pattern: /^\d*$/,
|
|
|
|
|
+ // message: '商品编号必须是整数',
|
|
|
|
|
+ // trigger: ['blur', 'change'],
|
|
|
|
|
+ // validator: (rule, value) => {
|
|
|
|
|
+ // if (!value || value.trim().length === 0) return false;
|
|
|
|
|
+ // return /^\d+$/.test(value);
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // },
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 页面加载
|
|
// 页面加载
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
onLoad(async (options) => {
|
|
onLoad(async (options) => {
|
|
|
|
|
+ appStore.SET_CPATTR([])
|
|
|
|
|
+ appStore.SET_CPATTRVALUE([])
|
|
|
await getProductCategory();
|
|
await getProductCategory();
|
|
|
await getTempData();
|
|
await getTempData();
|
|
|
console.log(options)
|
|
console.log(options)
|
|
@@ -450,8 +541,22 @@
|
|
|
} else {
|
|
} else {
|
|
|
resetForm();
|
|
resetForm();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ uni.$on("updateAttr", onUpdateAttr)
|
|
|
|
|
+ })
|
|
|
|
|
+ onUnload(() => {
|
|
|
|
|
+ uni.$off("updateAttr")
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ // 规格设置页面点击确认,更新当前页规格表格
|
|
|
|
|
+ const onUpdateAttr = (data) => {
|
|
|
|
|
+ // console.log("onUpdateAttr", data)
|
|
|
|
|
+ const table = attrFormat(data)
|
|
|
|
|
+ attr.value = data.concat();
|
|
|
|
|
+ attrTable.value = table
|
|
|
|
|
+ // console.log("table==>", table)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 获取商品分类
|
|
// 获取商品分类
|
|
|
async function getProductCategory() {
|
|
async function getProductCategory() {
|
|
|
let obj = {
|
|
let obj = {
|
|
@@ -517,9 +622,12 @@
|
|
|
// 方法2:延迟触发字段验证
|
|
// 方法2:延迟触发字段验证
|
|
|
setTimeout(async () => {
|
|
setTimeout(async () => {
|
|
|
// 逐个触发必填字段的验证
|
|
// 逐个触发必填字段的验证
|
|
|
|
|
+ // const requiredFields = ['categoryIds', 'storeName', 'keyword', 'storeInfo', 'unitName',
|
|
|
|
|
+ // 'tempIds', 'metalType', 'weight', 'laborCost', 'additionalFee',
|
|
|
|
|
+ // 'stock', 'barCode'
|
|
|
|
|
+ // ];
|
|
|
const requiredFields = ['categoryIds', 'storeName', 'keyword', 'storeInfo', 'unitName',
|
|
const requiredFields = ['categoryIds', 'storeName', 'keyword', 'storeInfo', 'unitName',
|
|
|
- 'tempIds', 'metalType', 'weight', 'laborCost', 'additionalFee',
|
|
|
|
|
- 'stock', 'barCode'
|
|
|
|
|
|
|
+ 'tempIds', 'metalType'
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
for (const field of requiredFields) {
|
|
for (const field of requiredFields) {
|
|
@@ -587,20 +695,42 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// 商品属性
|
|
// 商品属性
|
|
|
if (data.attrValue && data.attrValue.length > 0) {
|
|
if (data.attrValue && data.attrValue.length > 0) {
|
|
|
- formData.value.additionalFee = data.attrValue[0].additionalAmount;
|
|
|
|
|
- formData.value.laborCost = data.attrValue[0].price;
|
|
|
|
|
- formData.value.barCode = data.attrValue[0].barCode;
|
|
|
|
|
- formData.value.stock = data.attrValue[0].stock;
|
|
|
|
|
- formData.value.weight = data.attrValue[0].weight;
|
|
|
|
|
-
|
|
|
|
|
- // 规格图片
|
|
|
|
|
- productImagesGg.value = data.attrValue[0].image ? [{
|
|
|
|
|
- url: data.attrValue[0].image
|
|
|
|
|
- }] : [];
|
|
|
|
|
|
|
+ data.attr.forEach(item => {
|
|
|
|
|
+ attr.value.push({
|
|
|
|
|
+ attrName: item.attrName,
|
|
|
|
|
+ attrValue: item.attrValues.split(',')
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ data.attrValue.forEach(item => {
|
|
|
|
|
+ let attrName = item.suk;
|
|
|
|
|
+ attrTable.value.push({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ attrName: attrName,
|
|
|
|
|
+ imgs: item?.image ? [{
|
|
|
|
|
+ url: item.image
|
|
|
|
|
+ }] : []
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ appStore.SET_CPATTR(attr.value)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 商品属性
|
|
|
|
|
+ // if (data.attrValue && data.attrValue.length > 0) {
|
|
|
|
|
+ // formData.value.additionalFee = data.attrValue[0].additionalAmount;
|
|
|
|
|
+ // formData.value.laborCost = data.attrValue[0].price;
|
|
|
|
|
+ // formData.value.barCode = data.attrValue[0].barCode;
|
|
|
|
|
+ // formData.value.stock = data.attrValue[0].stock;
|
|
|
|
|
+ // formData.value.weight = data.attrValue[0].weight;
|
|
|
|
|
+
|
|
|
|
|
+ // // 规格图片
|
|
|
|
|
+ // productImagesGg.value = data.attrValue[0].image ? [{
|
|
|
|
|
+ // url: data.attrValue[0].image
|
|
|
|
|
+ // }] : [];
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
// 商品描述
|
|
// 商品描述
|
|
|
descriptionText.value = data.content ? data.content.replace(/<[^>]*>/g, '').substring(0, 500) : '';
|
|
descriptionText.value = data.content ? data.content.replace(/<[^>]*>/g, '').substring(0, 500) : '';
|
|
|
formData.value.content = data.content || '';
|
|
formData.value.content = data.content || '';
|
|
@@ -743,10 +873,19 @@
|
|
|
}
|
|
}
|
|
|
imageList.value = [];
|
|
imageList.value = [];
|
|
|
}
|
|
}
|
|
|
- async function getImageProductGg() {
|
|
|
|
|
|
|
+ async function getImageProductGg(index) {
|
|
|
if (imageList.value.length > 0) {
|
|
if (imageList.value.length > 0) {
|
|
|
if (imageList.value[0].status == "success") {
|
|
if (imageList.value[0].status == "success") {
|
|
|
- productImagesGg.value = imageList.value;
|
|
|
|
|
|
|
+ console.log(imageList.value)
|
|
|
|
|
+ if (index == "oneTemplate") {
|
|
|
|
|
+ oneTemplate.value.imgs = imageList.value
|
|
|
|
|
+ oneTemplate.value.image = imageList.value[0].info.url
|
|
|
|
|
+ } else {
|
|
|
|
|
+ attrTable.value[index].imgs = imageList.value
|
|
|
|
|
+ attrTable.value[index].image = imageList.value[0].info.url
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // productImagesGg.value = imageList.value;
|
|
|
// change();
|
|
// change();
|
|
|
} else {
|
|
} else {
|
|
|
Toast({
|
|
Toast({
|
|
@@ -764,6 +903,13 @@
|
|
|
productImages.value.splice(e.index, 1);
|
|
productImages.value.splice(e.index, 1);
|
|
|
};
|
|
};
|
|
|
const onProductImageGgDelete = (e) => {
|
|
const onProductImageGgDelete = (e) => {
|
|
|
|
|
+ console.log(e)
|
|
|
|
|
+ if (e == "oneTemplate") {
|
|
|
|
|
+ oneTemplate.value.imgs = []
|
|
|
|
|
+ } else {
|
|
|
|
|
+ attrTable.value[e].imgs = []
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
productImagesGg.value.splice(e.index, 1);
|
|
productImagesGg.value.splice(e.index, 1);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -830,53 +976,53 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (productImagesGg.value.length === 0) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '请上传商品规格图片',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (productImagesGg.value.length === 0) {
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // title: '请上传商品规格图片',
|
|
|
|
|
+ // icon: 'none'
|
|
|
|
|
+ // });
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
// 验证数字字段
|
|
// 验证数字字段
|
|
|
- if (!/^\d+(\.\d+)?$/.test(formData.value.weight)) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '重量格式不正确',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (!/^\d+(\.\d+)?$/.test(formData.value.laborCost)) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '工费格式不正确',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (!/^\d+(\.\d+)?$/.test(formData.value.additionalFee)) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '附加费格式不正确',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (!/^\d+$/.test(formData.value.stock)) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '库存必须是整数',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (!/^\d+$/.test(formData.value.barCode)) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '商品编号必须是整数',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (!/^\d+(\.\d+)?$/.test(formData.value.weight)) {
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // title: '重量格式不正确',
|
|
|
|
|
+ // icon: 'none'
|
|
|
|
|
+ // });
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // if (!/^\d+(\.\d+)?$/.test(formData.value.laborCost)) {
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // title: '工费格式不正确',
|
|
|
|
|
+ // icon: 'none'
|
|
|
|
|
+ // });
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // if (!/^\d+(\.\d+)?$/.test(formData.value.additionalFee)) {
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // title: '附加费格式不正确',
|
|
|
|
|
+ // icon: 'none'
|
|
|
|
|
+ // });
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // if (!/^\d+$/.test(formData.value.stock)) {
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // title: '库存必须是整数',
|
|
|
|
|
+ // icon: 'none'
|
|
|
|
|
+ // });
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (!/^\d+$/.test(formData.value.barCode)) {
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // title: '商品编号必须是整数',
|
|
|
|
|
+ // icon: 'none'
|
|
|
|
|
+ // });
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
const valid = formRef.value.validate();
|
|
const valid = formRef.value.validate();
|
|
|
return valid;
|
|
return valid;
|
|
@@ -885,42 +1031,127 @@
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ const validateAttr = (item)=>{
|
|
|
|
|
+ if (!item.image) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '请上传商品规格图片',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 验证数字字段
|
|
|
|
|
+ if (!/^\d+(\.\d+)?$/.test(item.weight)) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '重量格式不正确',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!/^\d+(\.\d+)?$/.test(item.price)) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '工费格式不正确',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!/^\d+(\.\d+)?$/.test(item.additionalAmount)) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '附加费格式不正确',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!/^\d+$/.test(item.stock)) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '库存必须是整数',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!/^\d+$/.test(item.barCode)) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '商品编号必须是整数',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
const submitForm = async () => {
|
|
const submitForm = async () => {
|
|
|
const valid = validateForm();
|
|
const valid = validateForm();
|
|
|
-
|
|
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
const submitData = {
|
|
const submitData = {
|
|
|
...formData.value
|
|
...formData.value
|
|
|
};
|
|
};
|
|
|
let urlString = '';
|
|
let urlString = '';
|
|
|
|
|
+ console.log(previewImages.value[0])
|
|
|
if (isProductCenter.value) {
|
|
if (isProductCenter.value) {
|
|
|
submitData.image = previewImages.value[0].url;
|
|
submitData.image = previewImages.value[0].url;
|
|
|
urlString = JSON.stringify(productImages.value.map(item => item.url));
|
|
urlString = JSON.stringify(productImages.value.map(item => item.url));
|
|
|
} else {
|
|
} else {
|
|
|
- submitData.image = previewImages.value[0].info.url;
|
|
|
|
|
- urlString = JSON.stringify(productImages.value.map(item => item.info.url));
|
|
|
|
|
|
|
+ submitData.image = previewImages.value[0]?.info?.url || previewImages.value[0]?.url;
|
|
|
|
|
+ urlString = JSON.stringify(productImages.value.map(item => item?.info?.url || item?.url));
|
|
|
}
|
|
}
|
|
|
submitData.sliderImage = urlString;
|
|
submitData.sliderImage = urlString;
|
|
|
submitData.cateId = formData.value.categoryIds.join(',');
|
|
submitData.cateId = formData.value.categoryIds.join(',');
|
|
|
|
|
|
|
|
|
|
|
|
|
submitData.merchantId = parseInt(merchantInfo.id);
|
|
submitData.merchantId = parseInt(merchantInfo.id);
|
|
|
- submitData.specType = 0;
|
|
|
|
|
|
|
+ submitData.specType = true;
|
|
|
submitData.isSub = false;
|
|
submitData.isSub = false;
|
|
|
- submitData.attr = [{
|
|
|
|
|
- "attrName": "规格",
|
|
|
|
|
- "attrValues": "默认",
|
|
|
|
|
- "id": 0
|
|
|
|
|
- }];
|
|
|
|
|
- submitData.attrValue = [{
|
|
|
|
|
- additionalAmount: formData.value.additionalFee,
|
|
|
|
|
- attrValue: "{\"规格\":\"默认\"}",
|
|
|
|
|
- barCode: formData.value.barCode,
|
|
|
|
|
- image: productImagesGg.value[0]?.info?.url || productImagesGg.value[0].url,
|
|
|
|
|
- price: formData.value.laborCost,
|
|
|
|
|
- stock: formData.value.stock,
|
|
|
|
|
- weight: formData.value.weight
|
|
|
|
|
- }];
|
|
|
|
|
|
|
+ // 规格长度为0
|
|
|
|
|
+ console.log(attr.value,attrTable.value)
|
|
|
|
|
+ if (!attr.value || attr.value.length <= 0 || !attrTable.value || attrTable.value.length <= 0) {
|
|
|
|
|
+ return Toast({
|
|
|
|
|
+ title: "请添加商品规格!"
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const pass = true;
|
|
|
|
|
+ submitData.attr = attr.value.map(item => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ attrName: item.attrName,
|
|
|
|
|
+ attrValues: item.attrValue.join(','),
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ submitData.attrValue = attrTable.value.map(item => {
|
|
|
|
|
+
|
|
|
|
|
+ if(!validateAttr(item)){
|
|
|
|
|
+ pass = false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ console.log(typeof(item.attrValue))
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ productId: 0,
|
|
|
|
|
+ attrValue: typeof(item.attrValue)=='object'?JSON.stringify(item.attrValue):item.attrValue,
|
|
|
|
|
+ image: item.image || item.imgs[0]?.info?.url || item.imgs[0]?.url
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ console.dir(submitData)
|
|
|
|
|
+ if(!pass) return false;
|
|
|
|
|
+ // return false;
|
|
|
|
|
+ // submitData.attr = [{
|
|
|
|
|
+ // "attrName": "规格",
|
|
|
|
|
+ // "attrValues": "默认",
|
|
|
|
|
+ // "id": 0
|
|
|
|
|
+ // }];
|
|
|
|
|
+ // submitData.attrValue = [{
|
|
|
|
|
+ // additionalAmount: formData.value.additionalFee,
|
|
|
|
|
+ // attrValue: "{\"规格\":\"默认\"}",
|
|
|
|
|
+ // barCode: formData.value.barCode,
|
|
|
|
|
+ // image: productImagesGg.value[0]?.info?.url || productImagesGg.value[0].url,
|
|
|
|
|
+ // price: formData.value.laborCost,
|
|
|
|
|
+ // stock: formData.value.stock,
|
|
|
|
|
+ // weight: formData.value.weight
|
|
|
|
|
+ // }];
|
|
|
|
|
|
|
|
if (productId.value && !isProductCenter.value) {
|
|
if (productId.value && !isProductCenter.value) {
|
|
|
const {
|
|
const {
|
|
@@ -939,10 +1170,15 @@
|
|
|
icon: 'success'
|
|
icon: 'success'
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: '/pages/merchantCenters/productManagement'
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ // 编辑时,返回上个页面
|
|
|
|
|
+ if(!!productId.value && !isProductCenter.value){
|
|
|
|
|
+ uni.navigateBack()
|
|
|
|
|
+ }else{
|
|
|
|
|
+ uni.redirectTo({
|
|
|
|
|
+ url: '/pages/merchantCenters/productManagement'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 重置表单(用于新建场景)
|
|
// 重置表单(用于新建场景)
|
|
@@ -976,12 +1212,160 @@
|
|
|
formRef.value.clearValidate();
|
|
formRef.value.clearValidate();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- const editCatePage = ()=>{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const editCatePage = () => {
|
|
|
|
|
+ if (attrTable.value && attrTable.value.length) {
|
|
|
|
|
+ historyAttr = []
|
|
|
|
|
+ historyTable = {}
|
|
|
|
|
+ // 防止刷新数据时已填数据丢失
|
|
|
|
|
+ attrTable.value.forEach(item => {
|
|
|
|
|
+ historyAttr.push(item.attrName)
|
|
|
|
|
+ historyTable[item.attrName] = {
|
|
|
|
|
+ ...item
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(historyAttr, historyTable)
|
|
|
|
|
+
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: "/pages/merchantCenters/productCate/productCate"
|
|
url: "/pages/merchantCenters/productCate/productCate"
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ const setAllAttr = () => {
|
|
|
|
|
+ if(!validateAttr(oneTemplate.value)) return false;
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: '所有商品规格将修改为当前配置',
|
|
|
|
|
+ confirmText: '确认',
|
|
|
|
|
+ cancelText: "取消",
|
|
|
|
|
+ success(res) {
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ console.log(oneTemplate.value)
|
|
|
|
|
+ console.log("确认了", attrTable.value);
|
|
|
|
|
+ if (attrTable.value && attrTable.value.length > 0) {
|
|
|
|
|
+ attrTable.value = attrTable.value.map(item => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ ...oneTemplate.value
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function attrFormat(arr) {
|
|
|
|
|
+ // console.log('arr', arr)
|
|
|
|
|
+ let data = [];
|
|
|
|
|
+ const res = [];
|
|
|
|
|
+ return format(arr);
|
|
|
|
|
+
|
|
|
|
|
+ function format(arr) {
|
|
|
|
|
+ console.log("attrFormat", arr)
|
|
|
|
|
+ if (arr.length > 1) {
|
|
|
|
|
+ arr.forEach((v, i) => {
|
|
|
|
|
+ if (i === 0) data = arr[i]["attrValue"];
|
|
|
|
|
+ const tmp = [];
|
|
|
|
|
+ if (!data) return;
|
|
|
|
|
+ data.forEach(function(vv) {
|
|
|
|
|
+ arr[i + 1] &&
|
|
|
|
|
+ arr[i + 1]["attrValue"] &&
|
|
|
|
|
+ arr[i + 1]["attrValue"].forEach(g => {
|
|
|
|
|
+ const rep2 =
|
|
|
|
|
+ (i !== 0 ? "" : arr[i]["attrName"] + "_") +
|
|
|
|
|
+ vv +
|
|
|
|
|
+ "$&" +
|
|
|
|
|
+ arr[i + 1]["attrName"] +
|
|
|
|
|
+ "_" +
|
|
|
|
|
+ g;
|
|
|
|
|
+ tmp.push(rep2);
|
|
|
|
|
+ if (i === arr.length - 2) {
|
|
|
|
|
+ const rep4 = {
|
|
|
|
|
+ additionalAmount: "",
|
|
|
|
|
+ image: "",
|
|
|
|
|
+ price: "",
|
|
|
|
|
+ cost: 0,
|
|
|
|
|
+ otPrice: 0,
|
|
|
|
|
+ stock: "",
|
|
|
|
|
+ barCode: "",
|
|
|
|
|
+ weight: "",
|
|
|
|
|
+ volume: 0,
|
|
|
|
|
+ brokerage: 0,
|
|
|
|
|
+ brokerage_two: 0,
|
|
|
|
|
+ imgs: []
|
|
|
|
|
+ };
|
|
|
|
|
+ rep2.split("$&").forEach((h, k) => {
|
|
|
|
|
+ const rep3 = h.split("_");
|
|
|
|
|
+ if (!rep4["attrValue"]) rep4["attrValue"] = {};
|
|
|
|
|
+ rep4["attrValue"][rep3[0]] =
|
|
|
|
|
+ rep3.length > 1 ? rep3[1] : "";
|
|
|
|
|
+ });
|
|
|
|
|
+ for (const attrValueKey in rep4.attrValue) {
|
|
|
|
|
+ rep4[attrValueKey] = rep4.attrValue[attrValueKey];
|
|
|
|
|
+ }
|
|
|
|
|
+ res.push(rep4);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ data = tmp.length ? tmp : [];
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const dataArr = [];
|
|
|
|
|
+ arr.forEach((v, k) => {
|
|
|
|
|
+ // console.log("v['attrValue']", v['attrValue'])
|
|
|
|
|
+ v["attrValue"] &&
|
|
|
|
|
+ v["attrValue"].forEach((vv, kk) => {
|
|
|
|
|
+ dataArr[kk] = v["attrName"] + "_" + vv;
|
|
|
|
|
+ res[kk] = {
|
|
|
|
|
+ additionalAmount: "",
|
|
|
|
|
+ image: "",
|
|
|
|
|
+ price: "",
|
|
|
|
|
+ cost: 0,
|
|
|
|
|
+ otPrice: 0,
|
|
|
|
|
+ stock: "",
|
|
|
|
|
+ barCode: "",
|
|
|
|
|
+ weight: "",
|
|
|
|
|
+ volume: 0,
|
|
|
|
|
+ brokerage: 0,
|
|
|
|
|
+ brokerage_two: 0,
|
|
|
|
|
+ attrValue: {
|
|
|
|
|
+ [v["attrName"]]: vv
|
|
|
|
|
+ },
|
|
|
|
|
+ imgs: []
|
|
|
|
|
+ };
|
|
|
|
|
+ // Object.values(res[kk].attrValue).forEach((v, i) => {
|
|
|
|
|
+ // res[kk]['value' + i] = v
|
|
|
|
|
+ // })
|
|
|
|
|
+ for (const attrValueKey in res[kk].attrValue) {
|
|
|
|
|
+ res[kk][attrValueKey] = res[kk].attrValue[attrValueKey];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ data.push(dataArr.join("$&"));
|
|
|
|
|
+ }
|
|
|
|
|
+ // console.log(res)
|
|
|
|
|
+ const result = []
|
|
|
|
|
+ res.forEach(item => {
|
|
|
|
|
+ let attrName = [];
|
|
|
|
|
+ for (const name in item.attrValue) {
|
|
|
|
|
+ attrName.push(item.attrValue[name]);
|
|
|
|
|
+ }
|
|
|
|
|
+ item.attrName = attrName.join(',');
|
|
|
|
|
+ // 防止刷新数据时已填数据丢失
|
|
|
|
|
+ if (historyAttr.includes(item.attrName)) {
|
|
|
|
|
+ console.log(historyAttr, item.attrName, historyTable[item.attrName])
|
|
|
|
|
+ item = {
|
|
|
|
|
+ ...historyTable[item.attrName]
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ result.push(item)
|
|
|
|
|
+ console.log("res-item==>", item)
|
|
|
|
|
+ })
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
@@ -1033,17 +1417,17 @@
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
- width: 200rpx;
|
|
|
|
|
- height: 200rpx;
|
|
|
|
|
- border: 2rpx dashed #ccc;
|
|
|
|
|
- border-radius: 12rpx;
|
|
|
|
|
- background: #fafafa;
|
|
|
|
|
|
|
+ width: 5rem;
|
|
|
|
|
+ height: 5rem;
|
|
|
|
|
+ border: 1rpx dashed #DCDFE6;
|
|
|
|
|
+ border-radius: 8rpx;
|
|
|
|
|
+ background: #fff;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.upload-tip {
|
|
.upload-tip {
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- color: #999;
|
|
|
|
|
- margin-top: 10rpx;
|
|
|
|
|
|
|
+ font-size: 20rpx;
|
|
|
|
|
+ color: #666;
|
|
|
|
|
+ margin-top: 6rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.format-tip {
|
|
.format-tip {
|
|
@@ -1094,6 +1478,7 @@
|
|
|
background: #F8C008;
|
|
background: #F8C008;
|
|
|
border-radius: 16rpx;
|
|
border-radius: 16rpx;
|
|
|
font-size: 32rpx;
|
|
font-size: 32rpx;
|
|
|
|
|
+ font-weight: bold;
|
|
|
color: #333333;
|
|
color: #333333;
|
|
|
border: none;
|
|
border: none;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
@@ -1214,8 +1599,8 @@
|
|
|
color: #333;
|
|
color: #333;
|
|
|
margin-bottom: 16rpx;
|
|
margin-bottom: 16rpx;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- .cate-add{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .cate-add {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 88rpx;
|
|
height: 88rpx;
|
|
|
line-height: 88rpx;
|
|
line-height: 88rpx;
|
|
@@ -1235,6 +1620,19 @@
|
|
|
background-color: #F9F7F0;
|
|
background-color: #F9F7F0;
|
|
|
border-radius: 16rpx;
|
|
border-radius: 16rpx;
|
|
|
padding: 16rpx;
|
|
padding: 16rpx;
|
|
|
|
|
+ margin-bottom: 16rpx;
|
|
|
|
|
+
|
|
|
|
|
+ .upload-btn {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ width: 100rpx;
|
|
|
|
|
+ height: 100rpx;
|
|
|
|
|
+ border: 1rpx dashed #DCDFE6;
|
|
|
|
|
+ border-radius: 8rpx;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
.cate-pic-line {
|
|
.cate-pic-line {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
@@ -1244,6 +1642,24 @@
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
margin-bottom: 16rpx;
|
|
margin-bottom: 16rpx;
|
|
|
|
|
|
|
|
|
|
+ ::v-deep .u-upload {
|
|
|
|
|
+ flex: 0;
|
|
|
|
|
+ margin-right: 16rpx;
|
|
|
|
|
+ width: 100rpx;
|
|
|
|
|
+ height: 100rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep .u-upload__wrap__preview {
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ width: 100rpx;
|
|
|
|
|
+ height: 100rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep .u-upload__wrap__preview__image {
|
|
|
|
|
+ width: 100rpx !important;
|
|
|
|
|
+ height: 100rpx !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.cate-pic {
|
|
.cate-pic {
|
|
|
width: 100rpx;
|
|
width: 100rpx;
|
|
|
height: 100rpx;
|
|
height: 100rpx;
|
|
@@ -1277,9 +1693,9 @@
|
|
|
border-radius: 16rpx;
|
|
border-radius: 16rpx;
|
|
|
padding: 0 16rpx !important;
|
|
padding: 0 16rpx !important;
|
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
|
-
|
|
|
|
|
- .unit{
|
|
|
|
|
- color:#333;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .unit {
|
|
|
|
|
+ color: #333;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|