From 9e0d2563ee3adc08b27f365e315855d776fd08f0 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期五, 11 七月 2025 10:00:11 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 pages/supplier/publish-goods/publishGoods.vue |   85 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/pages/supplier/publish-goods/publishGoods.vue b/pages/supplier/publish-goods/publishGoods.vue
new file mode 100644
index 0000000..8b0daeb
--- /dev/null
+++ b/pages/supplier/publish-goods/publishGoods.vue
@@ -0,0 +1,85 @@
+<template>
+	<view class="container">
+		<uni-steps :options="publishSteps" :active="currentStep" active-color='#f31947'></uni-steps>
+		<choose-categery @choose="chooseCategrey" v-show="currentStep === 0"></choose-categery>
+		<goods-info @submit="submit" v-show="currentStep === 1"></goods-info>
+		<view style="position: fixed;bottom: 80px;display: flex;width: calc(100% - 70rpx);">
+			<button :disabled="currentStep === 0" @click="lastStep" size="mini" style="flex: 1;font-size: 32rpx;margin-right: 3rpx;" type="primary">涓婁竴姝�</button>
+			<button :disabled="currentStep === 1" @click="nextStep" size="mini" style="flex: 1;font-size: 32rpx;margin-left: 3rpx;" type="primary">涓嬩竴姝�</button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import chooseCategery from './chooseCategery.vue';
+	import goodsInfo from './goodsInfo.vue';
+	import {createGoods} from "@/api/store.js"
+	export default {
+		components: { chooseCategery, goodsInfo },
+		data() {
+			return {
+				goods: {
+					
+				},
+				categoryPath: '',
+				currentStep:0,
+				publishSteps: [{
+						title: ' 閫夋嫨鍟嗗搧鍝佺被'
+					},
+					{
+						title: ' 濉啓鍟嗗搧璇︽儏'
+					}
+				],
+			}
+		},
+		methods: {
+			// 鑾峰彇閫夋嫨鐨勫晢鍝佸垎绫�
+			chooseCategrey(categreyId) {
+				this.categoryPath = categreyId + ",,"
+			},
+			submit(data) {
+				if (! this.categoryPath) {
+					uni.showToast({ title: '璇烽�変腑鍟嗗搧鍒嗙被', icon: 'none' })
+					return
+				}
+				data['categoryPath'] = this.categoryPath
+				if (data.skuList) {
+					data.skuList.forEach(sku => {
+						delete sku.specValues
+					})
+				}
+				delete data.specs
+				// 鍙戝竷鍟嗗搧
+				console.log("鍟嗗搧鏁版嵁", data);
+				createGoods(data).then(res => {
+					uni.showToast({ title: '鍟嗗搧宸叉彁浜ゅ鏍�', icon: 'success' })
+					setTimeout(() => {
+						uni.navigateBack({
+							delta: 1
+						});
+					}, 2000)
+				})
+			},
+			// 涓婁竴姝�
+			lastStep() {
+				if (this.currentStep > 0) {
+					this.currentStep--
+				}
+			},
+			// 涓嬩竴姝�
+			nextStep() {
+				if (this.currentStep < 1) {
+					this.currentStep++
+				}
+			}
+		}
+	}
+</script>
+
+<style>
+	.container {
+		width: 750rpx;
+		padding: 32rpx;
+		box-sizing: border-box;
+	}
+</style>
\ No newline at end of file

--
Gitblit v1.8.0