diff --git a/pages/goods-update/goods-update.js b/pages/goods-update/goods-update.js
index 1c48295..847b7df 100644
--- a/pages/goods-update/goods-update.js
+++ b/pages/goods-update/goods-update.js
@@ -1104,7 +1104,8 @@ Page({
region: goodsDetail.region || '',
grossWeight: goodsDetail.grossWeight || '',
product_contact: goodsDetail.product_contact || '',
- contact_phone: goodsDetail.contact_phone || ''
+ contact_phone: goodsDetail.contact_phone || '',
+ description: goodsDetail.description || goodsDetail.remark || ''
};
// 保存原始规格和价格信息,用于比较差异
@@ -1219,12 +1220,13 @@ Page({
console.log('【saveEdit】editSupply.id:', editSupply.id);
console.log('【saveEdit】最终使用的productId:', productId);
- // 使用新的快速更新接口,只更新价格、联系人和电话
+ // 使用新的快速更新接口,更新价格、联系人和电话以及货源描述
const updateData = {
productId: productId,
price: priceStr,
product_contact: editSupply.product_contact || '',
contact_phone: editSupply.contact_phone || '',
+ description: editSupply.description || ''
};
console.log('【saveEdit】快速更新数据:', updateData);
diff --git a/pages/goods-update/goods-update.wxml b/pages/goods-update/goods-update.wxml
index 064878f..d166a26 100644
--- a/pages/goods-update/goods-update.wxml
+++ b/pages/goods-update/goods-update.wxml
@@ -304,8 +304,11 @@
联系电话
+ 货源描述
+
+
-
+
diff --git a/pages/goods-update/goods-update.wxss b/pages/goods-update/goods-update.wxss
index bff7c8f..de6c7b0 100644
--- a/pages/goods-update/goods-update.wxss
+++ b/pages/goods-update/goods-update.wxss
@@ -1032,6 +1032,29 @@ video.slider-media .wx-video-volume-icon {
font-family: inherit;
}
+.edit-form-textarea {
+ width: 100%;
+ min-height: 150rpx;
+ padding: 24rpx;
+ font-size: 30rpx;
+ border: 2rpx solid #eee;
+ border-radius: 12rpx;
+ box-sizing: border-box;
+ margin: 0 auto 30rpx;
+ display: block;
+ font-family: inherit;
+ color: #333;
+ resize: none;
+ line-height: 1.5;
+}
+
+.edit-form-textarea::placeholder {
+ font-size: 24rpx;
+ color: #999;
+ text-align: left;
+ font-family: inherit;
+}
+
.edit-form-select {
width: 100%;
height: 90rpx;
diff --git a/server-example/server-mysql.js b/server-example/server-mysql.js
index 6190c9d..d708505 100644
--- a/server-example/server-mysql.js
+++ b/server-example/server-mysql.js
@@ -7375,7 +7375,7 @@ app.post('/api/products/update-contacts', async (req, res) => {
app.post('/api/products/quick-update', async (req, res) => {
console.log('【快速更新】收到请求:', req.body);
try {
- const { productId, price, product_contact, contact_phone } = req.body;
+ const { productId, price, product_contact, contact_phone, description } = req.body;
if (!productId) {
return res.status(400).json({
@@ -7420,6 +7420,11 @@ app.post('/api/products/quick-update', async (req, res) => {
updateFields.contact_phone = contact_phone;
console.log('【快速更新】更新联系电话:', contact_phone);
}
+
+ if (description !== undefined) {
+ updateFields.description = description;
+ console.log('【快速更新】更新货源描述:', description);
+ }
// 执行更新
await Product.update(updateFields, {