diff --git a/src/pages/category/index.vue b/src/pages/category/index.vue
index bae3729..ef1ff57 100644
--- a/src/pages/category/index.vue
+++ b/src/pages/category/index.vue
@@ -65,10 +65,15 @@
×
+
+ 公式:
+
+
+ 添加属性
@@ -192,17 +197,18 @@ export default {
name: a.name,
attrType: a.attrType || 'number',
unit: a.unit || '',
+ formula: a.formula || '',
attrId: a.attrId
}))
if (this.attributes.length === 0) {
- this.attributes.push({ name: '', attrType: 'number', unit: '', attrId: '' })
+ this.attributes.push({ name: '', attrType: 'number', unit: '', formula: '', attrId: '' })
}
} catch (e) {
- this.attributes = [{ name: '', attrType: 'number', unit: '', attrId: '' }]
+ this.attributes = [{ name: '', attrType: 'number', unit: '', formula: '', attrId: '' }]
}
},
addAttr() {
- this.attributes.push({ name: '', attrType: 'number', unit: '', attrId: '' })
+ this.attributes.push({ name: '', attrType: 'number', unit: '', formula: '', attrId: '' })
},
removeAttr(index) {
this.attributes.splice(index, 1)
@@ -464,5 +470,29 @@ export default {
border: 2rpx dashed #667eea;
border-radius: 12rpx;
margin-top: 20rpx;
+
+.formula-item {
+ display: flex;
+ align-items: center;
+ margin-bottom: 20rpx;
+ padding: 10rpx 0;
+ background: #fffbe6;
+ border-radius: 12rpx;
}
-
\ No newline at end of file
+
+.formula-label {
+ font-size: 26rpx;
+ color: #fa8c16;
+ padding: 0 20rpx;
+}
+
+.formula-input {
+ flex: 1;
+ height: 70rpx;
+ background: transparent;
+ border-radius: 12rpx;
+ padding: 0 20rpx;
+ font-size: 26rpx;
+ color: #fa8c16;
+}
+