提交 | 用户 | 时间
820397 1 <template>
H 2   <ComponentContainerProperty v-model="formData.style">
3     <el-form label-width="80px" :model="formData">
4       <el-card header="拼团活动" class="property-group" shadow="never">
9259c2 5         <CombinationShowcase v-model="formData.activityIds" />
820397 6       </el-card>
H 7       <el-card header="商品样式" class="property-group" shadow="never">
8         <el-form-item label="布局" prop="type">
9           <el-radio-group v-model="formData.layoutType">
9259c2 10             <el-tooltip class="item" content="单列大图" placement="bottom">
H 11               <el-radio-button value="oneColBigImg">
820397 12                 <Icon icon="fluent:text-column-one-24-filled" />
H 13               </el-radio-button>
14             </el-tooltip>
9259c2 15             <el-tooltip class="item" content="单列小图" placement="bottom">
H 16               <el-radio-button value="oneColSmallImg">
17                 <Icon icon="fluent:text-column-two-left-24-filled" />
820397 18               </el-radio-button>
H 19             </el-tooltip>
9259c2 20             <el-tooltip class="item" content="双列" placement="bottom">
H 21               <el-radio-button value="twoCol">
22                 <Icon icon="fluent:text-column-two-24-filled" />
23               </el-radio-button>
24             </el-tooltip>
25             <!--<el-tooltip class="item" content="三列" placement="bottom">
26               <el-radio-button value="threeCol">
27                 <Icon icon="fluent:text-column-three-24-filled" />
28               </el-radio-button>
29             </el-tooltip>-->
820397 30           </el-radio-group>
H 31         </el-form-item>
32         <el-form-item label="商品名称" prop="fields.name.show">
33           <div class="flex gap-8px">
34             <ColorInput v-model="formData.fields.name.color" />
35             <el-checkbox v-model="formData.fields.name.show" />
36           </div>
37         </el-form-item>
9259c2 38         <el-form-item label="商品简介" prop="fields.introduction.show">
H 39           <div class="flex gap-8px">
40             <ColorInput v-model="formData.fields.introduction.color" />
41             <el-checkbox v-model="formData.fields.introduction.show" />
42           </div>
43         </el-form-item>
820397 44         <el-form-item label="商品价格" prop="fields.price.show">
H 45           <div class="flex gap-8px">
46             <ColorInput v-model="formData.fields.price.color" />
47             <el-checkbox v-model="formData.fields.price.show" />
9259c2 48           </div>
H 49         </el-form-item>
50         <el-form-item label="市场价" prop="fields.marketPrice.show">
51           <div class="flex gap-8px">
52             <ColorInput v-model="formData.fields.marketPrice.color" />
53             <el-checkbox v-model="formData.fields.marketPrice.show" />
54           </div>
55         </el-form-item>
56         <el-form-item label="商品销量" prop="fields.salesCount.show">
57           <div class="flex gap-8px">
58             <ColorInput v-model="formData.fields.salesCount.color" />
59             <el-checkbox v-model="formData.fields.salesCount.show" />
60           </div>
61         </el-form-item>
62         <el-form-item label="商品库存" prop="fields.stock.show">
63           <div class="flex gap-8px">
64             <ColorInput v-model="formData.fields.stock.color" />
65             <el-checkbox v-model="formData.fields.stock.show" />
820397 66           </div>
H 67         </el-form-item>
68       </el-card>
69       <el-card header="角标" class="property-group" shadow="never">
70         <el-form-item label="角标" prop="badge.show">
71           <el-switch v-model="formData.badge.show" />
72         </el-form-item>
73         <el-form-item label="角标" prop="badge.imgUrl" v-if="formData.badge.show">
74           <UploadImg v-model="formData.badge.imgUrl" height="44px" width="72px">
9259c2 75             <template #tip> 建议尺寸:36 * 22</template>
820397 76           </UploadImg>
H 77         </el-form-item>
9259c2 78       </el-card>
H 79       <el-card header="按钮" class="property-group" shadow="never">
80         <el-form-item label="按钮类型" prop="btnBuy.type">
81           <el-radio-group v-model="formData.btnBuy.type">
82             <el-radio-button value="text">文字</el-radio-button>
83             <el-radio-button value="img">图片</el-radio-button>
84           </el-radio-group>
85         </el-form-item>
86         <template v-if="formData.btnBuy.type === 'text'">
87           <el-form-item label="按钮文字" prop="btnBuy.text">
88             <el-input v-model="formData.btnBuy.text" />
89           </el-form-item>
90           <el-form-item label="左侧背景" prop="btnBuy.bgBeginColor">
91             <ColorInput v-model="formData.btnBuy.bgBeginColor" />
92           </el-form-item>
93           <el-form-item label="右侧背景" prop="btnBuy.bgEndColor">
94             <ColorInput v-model="formData.btnBuy.bgEndColor" />
95           </el-form-item>
96         </template>
97         <template v-else>
98           <el-form-item label="图片" prop="btnBuy.imgUrl">
99             <UploadImg v-model="formData.btnBuy.imgUrl" height="56px" width="56px">
100               <template #tip> 建议尺寸:56 * 56</template>
101             </UploadImg>
102           </el-form-item>
103         </template>
820397 104       </el-card>
H 105       <el-card header="商品样式" class="property-group" shadow="never">
106         <el-form-item label="上圆角" prop="borderRadiusTop">
107           <el-slider
108             v-model="formData.borderRadiusTop"
109             :max="100"
110             :min="0"
111             show-input
112             input-size="small"
113             :show-input-controls="false"
114           />
115         </el-form-item>
116         <el-form-item label="下圆角" prop="borderRadiusBottom">
117           <el-slider
118             v-model="formData.borderRadiusBottom"
119             :max="100"
120             :min="0"
121             show-input
122             input-size="small"
123             :show-input-controls="false"
124           />
125         </el-form-item>
126         <el-form-item label="间隔" prop="space">
127           <el-slider
128             v-model="formData.space"
129             :max="100"
130             :min="0"
131             show-input
132             input-size="small"
133             :show-input-controls="false"
134           />
135         </el-form-item>
136       </el-card>
137     </el-form>
138   </ComponentContainerProperty>
139 </template>
140
141 <script setup lang="ts">
142 import { PromotionCombinationProperty } from './config'
143 import { usePropertyForm } from '@/components/DiyEditor/util'
144 import * as CombinationActivityApi from '@/api/mall/promotion/combination/combinationActivity'
145 import { CommonStatusEnum } from '@/utils/constants'
9259c2 146 import CombinationShowcase from '@/views/mall/promotion/combination/components/CombinationShowcase.vue'
820397 147
H 148 // 拼团属性面板
149 defineOptions({ name: 'PromotionCombinationProperty' })
150
151 const props = defineProps<{ modelValue: PromotionCombinationProperty }>()
152 const emit = defineEmits(['update:modelValue'])
153 const { formData } = usePropertyForm(props.modelValue, emit)
154 // 活动列表
9259c2 155 const activityList = ref<CombinationActivityApi.CombinationActivityVO[]>([])
820397 156 onMounted(async () => {
H 157   const { list } = await CombinationActivityApi.getCombinationActivityPage({
158     status: CommonStatusEnum.ENABLE
159   })
160   activityList.value = list
161 })
162 </script>
163
164 <style scoped lang="scss"></style>