优化细节
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<template>
|
||||
<view class="marketing-combination-create">
|
||||
<view class="page-header">
|
||||
<view class="back-btn" @click="handleBack">
|
||||
<text class="back-ic">←</text>
|
||||
<text class="back-txt">返回</text>
|
||||
<text class="back-ic">鈫?/text>
|
||||
<text class="back-txt">杩斿洖</text>
|
||||
</view>
|
||||
<text class="page-title">{{ isEdit ? '编辑拼团商品' : '添加拼团商品' }}</text>
|
||||
<text class="page-title">{{ isEdit ? '缂栬緫鎷煎洟鍟嗗搧' : '娣诲姞鎷煎洟鍟嗗搧' }}</text>
|
||||
</view>
|
||||
|
||||
<view class="steps-card border-shadow">
|
||||
@@ -13,7 +13,7 @@
|
||||
<view v-for="(step, index) in steps" :key="index" :class="['step-item', currentStep >= index ? 'active' : '']">
|
||||
<view class="step-icon">
|
||||
<text class="step-num" v-if="currentStep <= index">{{ index + 1 }}</text>
|
||||
<text class="step-check" v-else>✓</text>
|
||||
<text class="step-check" v-else>鉁?/text>
|
||||
</view>
|
||||
<text class="step-text">{{ step }}</text>
|
||||
<view class="step-line" v-if="index < steps.length - 1"></view>
|
||||
@@ -21,82 +21,82 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 步骤1: 选择商品 -->
|
||||
<!-- 姝ラ1: 閫夋嫨鍟嗗搧 -->
|
||||
<view v-if="currentStep === 0" class="step-content border-shadow">
|
||||
<view class="form-item row-center">
|
||||
<text class="label required">选择商品:</text>
|
||||
<text class="label required">閫夋嫨鍟嗗搧锛?/text>
|
||||
<view class="goods-selector" @click="openGoodsSelector">
|
||||
<view v-if="selectedGood" class="selected-inner">
|
||||
<image class="good-img" :src="selectedGood.image" mode="aspectFill"></image>
|
||||
<text class="good-name">{{ selectedGood.title }}</text>
|
||||
</view>
|
||||
<view v-else class="selector-empty">
|
||||
<text class="empty-ic">🛍️</text>
|
||||
<text class="empty-txt">选择商品</text>
|
||||
<text class="empty-ic">馃泹锔?/text>
|
||||
<text class="empty-txt">閫夋嫨鍟嗗搧</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 步骤2: 填写基础信息 -->
|
||||
<!-- 姝ラ2: 濉啓鍩虹淇℃伅 -->
|
||||
<view v-if="currentStep === 1" class="step-content border-shadow">
|
||||
<view class="form-scroll">
|
||||
<view class="form-section">
|
||||
<text class="section-title">基础配置</text>
|
||||
<text class="section-title">鍩虹閰嶇疆</text>
|
||||
<view class="form-item">
|
||||
<text class="label required">拼团名称:</text>
|
||||
<input class="input" v-model="form.title" placeholder="请输入拼团名称" />
|
||||
<text class="label required">鎷煎洟鍚嶇О锛?/text>
|
||||
<input class="input" v-model="form.title" placeholder="璇疯緭鍏ユ嫾鍥㈠悕绉? />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label required">拼团简介:</text>
|
||||
<textarea class="textarea" v-model="form.info" placeholder="请输入拼团简介" />
|
||||
<text class="label required">鎷煎洟绠€浠嬶細</text>
|
||||
<textarea class="textarea" v-model="form.info" placeholder="璇疯緭鍏ユ嫾鍥㈢畝浠? />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label required">拼团时间:</text>
|
||||
<text class="label required">鎷煎洟鏃堕棿锛?/text>
|
||||
<view class="date-range">
|
||||
<input class="input-half" v-model="form.start_time" placeholder="开始日期" />
|
||||
<input class="input-half" v-model="form.start_time" placeholder="寮€濮嬫棩鏈? />
|
||||
<text class="range-sep">-</text>
|
||||
<input class="input-half" v-model="form.stop_time" placeholder="结束日期" />
|
||||
<input class="input-half" v-model="form.stop_time" placeholder="缁撴潫鏃ユ湡" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-section">
|
||||
<text class="section-title">拼团规则</text>
|
||||
<text class="section-title">鎷煎洟瑙勫垯</text>
|
||||
<view class="form-item">
|
||||
<text class="label required">拼团时效:</text>
|
||||
<text class="label required">鎷煎洟鏃舵晥锛?/text>
|
||||
<view class="input-unit">
|
||||
<input class="input" type="number" v-model="form.effective_time" />
|
||||
<text class="unit">小时</text>
|
||||
<text class="unit">灏忔椂</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label required">拼团人数:</text>
|
||||
<text class="label required">鎷煎洟浜烘暟锛?/text>
|
||||
<view class="input-unit">
|
||||
<input class="input" type="number" v-model="form.people" />
|
||||
<text class="unit">人</text>
|
||||
<text class="unit">浜?/text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label">虚拟成团:</text>
|
||||
<text class="label">铏氭嫙鎴愬洟锛?/text>
|
||||
<view class="input-unit">
|
||||
<input class="input" type="number" v-model="form.virtual_people" />
|
||||
<text class="unit">人</text>
|
||||
<text class="unit">浜?/text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 步骤3: 修改商品详情 -->
|
||||
<!-- 姝ラ3: 淇敼鍟嗗搧璇︽儏 -->
|
||||
<view v-if="currentStep === 2" class="step-content border-shadow">
|
||||
<view class="spec-table">
|
||||
<view class="table-head">
|
||||
<view class="th">规格</view>
|
||||
<view class="th">拼团价</view>
|
||||
<view class="th">成本价</view>
|
||||
<view class="th">限量</view>
|
||||
<view class="th">库存</view>
|
||||
<view class="th">瑙勬牸</view>
|
||||
<view class="th">鎷煎洟浠?/view>
|
||||
<view class="th">鎴愭湰浠?/view>
|
||||
<view class="th">闄愰噺</view>
|
||||
<view class="th">搴撳瓨</view>
|
||||
</view>
|
||||
<view class="table-row" v-for="(spec, index) in specs" :key="index">
|
||||
<view class="td">{{ spec.name }}</view>
|
||||
@@ -108,25 +108,25 @@
|
||||
</view>
|
||||
|
||||
<view class="detail-section">
|
||||
<text class="label">商品详情:</text>
|
||||
<text class="label">鍟嗗搧璇︽儏锛?/text>
|
||||
<view class="editor-placeholder">
|
||||
<text class="p-txt">这里是编辑器区域 (WangEditor 映射)</text>
|
||||
<text class="p-txt">杩欓噷鏄紪杈戝櫒鍖哄煙 (WangEditor 鏄犲皠)</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="footer-actions">
|
||||
<view v-if="currentStep > 0" class="btn outline" @click="prevStep">上一步</view>
|
||||
<view class="btn primary" @click="nextStep">{{ currentStep === 2 ? '提交' : '下一步' }}</view>
|
||||
<view v-if="currentStep > 0" class="btn outline" @click="prevStep">涓婁竴姝?/view>
|
||||
<view class="btn primary" @click="nextStep">{{ currentStep === 2 ? '鎻愪氦' : '涓嬩竴姝? }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品选择弹窗 -->
|
||||
<!-- 鍟嗗搧閫夋嫨寮圭獥 -->
|
||||
<view v-if="showSelector" class="modal">
|
||||
<view class="modal-mask" @click="showSelector = false"></view>
|
||||
<view class="modal-content">
|
||||
<view class="modal-header">
|
||||
<text class="modal-title">选择商品</text>
|
||||
<text class="close" @click="showSelector = false">✕</text>
|
||||
<text class="modal-title">閫夋嫨鍟嗗搧</text>
|
||||
<text class="close" @click="showSelector = false">鉁?/text>
|
||||
</view>
|
||||
<view class="modal-body">
|
||||
<view v-for="g in goodsList" :key="g.id" class="good-item" @click="selectGood(g)">
|
||||
@@ -142,7 +142,7 @@
|
||||
<script setup lang="uts">
|
||||
import { ref, reactive } from 'vue'
|
||||
|
||||
const steps = ['选择拼团商品', '填写基础信息', '修改商品详情']
|
||||
const steps = ['閫夋嫨鎷煎洟鍟嗗搧', '濉啓鍩虹淇℃伅', '淇敼鍟嗗搧璇︽儏']
|
||||
const currentStep = ref(0)
|
||||
const isEdit = ref(false)
|
||||
const showSelector = ref(false)
|
||||
@@ -160,12 +160,12 @@ const form = reactive({
|
||||
})
|
||||
|
||||
const specs = ref([
|
||||
{ name: '默认规格', price: '0.01', cost: '0.00', quota: '100', stock: '999' }
|
||||
{ name: '榛樿瑙勬牸', price: '0.01', cost: '0.00', quota: '100', stock: '999' }
|
||||
])
|
||||
|
||||
const goodsList = ref([
|
||||
{ id: 1, title: 'UR2024夏季新款女装...', image: 'https://img14.360buyimg.com/n1/jfs/t1/172605/32/17036/114175/609a473eE6997455c/df82c6168e36712b.jpg' },
|
||||
{ id: 2, title: 'FOMIX 蛋壳椅...', image: 'https://img12.360buyimg.com/n1/jfs/t1/185449/19/11995/4379/60d96d27E6a877c8e/3c38d4e92a2a7a5a.jpg' }
|
||||
{ id: 1, title: 'UR2024澶忓鏂版濂宠...', image: 'https://img14.360buyimg.com/n1/jfs/t1/172605/32/17036/114175/609a473eE6997455c/df82c6168e36712b.jpg' },
|
||||
{ id: 2, title: 'FOMIX 铔嬪3妞?..', image: 'https://img12.360buyimg.com/n1/jfs/t1/185449/19/11995/4379/60d96d27E6a877c8e/3c38d4e92a2a7a5a.jpg' }
|
||||
])
|
||||
|
||||
const handleBack = () => {
|
||||
@@ -184,13 +184,13 @@ const selectGood = (g: any) => {
|
||||
|
||||
const nextStep = () => {
|
||||
if (currentStep.value === 0 && !selectedGood.value) {
|
||||
uni.showToast({ title: '请先选择商品', icon: 'none' })
|
||||
uni.showToast({ title: '璇峰厛閫夋嫨鍟嗗搧', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (currentStep.value < 2) {
|
||||
currentStep.value++
|
||||
} else {
|
||||
uni.showToast({ title: '提交成功' })
|
||||
uni.showToast({ title: '鎻愪氦鎴愬姛' })
|
||||
setTimeout(() => uni.navigateBack(), 1500)
|
||||
}
|
||||
}
|
||||
@@ -431,10 +431,11 @@ const prevStep = () => {
|
||||
/* Modal */
|
||||
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
|
||||
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
|
||||
.modal-content { position: relative; width: 600px; background: #fff; border-radius: 8px; padding: 20px; }
|
||||
.modal-content { position: relative; width: 600px; background: #fff; border-radius: 8px; /* padding removed */ }
|
||||
.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
|
||||
.modal-body { display: flex; flex-direction: column; gap: 12px; }
|
||||
.good-item { display: flex; flex-direction: row; align-items: center; padding: 10px; border-bottom: 1px solid #f2f2f2; cursor: pointer; }
|
||||
.g-thumb { width: 40px; height: 40px; margin-right: 12px; }
|
||||
.g-title { font-size: 14px; }
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user