潘志宝
8 天以前 f6ea543b3de9a770c1bf5db2baf3e8a5dc2c867a
提交 | 用户 | 时间
9259c2 1 <template>
H 2   <ComponentContainerProperty v-model="formData.style">
3     <el-form :model="formData" label-width="80px">
4       <el-card class="property-group" header="积分商城活动" shadow="never">
5         <PointShowcase v-model="formData.activityIds" />
6       </el-card>
7       <el-card class="property-group" header="商品样式" shadow="never">
8         <el-form-item label="布局" prop="type">
9           <el-radio-group v-model="formData.layoutType">
10             <el-tooltip class="item" content="单列大图" placement="bottom">
11               <el-radio-button value="oneColBigImg">
12                 <Icon icon="fluent:text-column-one-24-filled" />
13               </el-radio-button>
14             </el-tooltip>
15             <el-tooltip class="item" content="单列小图" placement="bottom">
16               <el-radio-button value="oneColSmallImg">
17                 <Icon icon="fluent:text-column-two-left-24-filled" />
18               </el-radio-button>
19             </el-tooltip>
20             <el-tooltip class="item" content="双列" placement="bottom">
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>-->
30           </el-radio-group>
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>
38         <el-form-item label="商品简介" prop="fields.introduction.show">
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>
44         <el-form-item label="商品价格" prop="fields.price.show">
45           <div class="flex gap-8px">
46             <ColorInput v-model="formData.fields.price.color" />
47             <el-checkbox v-model="formData.fields.price.show" />
48           </div>
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" />
66           </div>
67         </el-form-item>
68       </el-card>
69       <el-card class="property-group" header="角标" 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 v-if="formData.badge.show" label="角标" prop="badge.imgUrl">
74           <UploadImg v-model="formData.badge.imgUrl" height="44px" width="72px">
75             <template #tip> 建议尺寸:36 * 22</template>
76           </UploadImg>
77         </el-form-item>
78       </el-card>
79       <el-card class="property-group" header="按钮" 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>
104       </el-card>
105       <el-card class="property-group" header="商品样式" 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-controls="false"
112             input-size="small"
113             show-input
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-controls="false"
122             input-size="small"
123             show-input
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-controls="false"
132             input-size="small"
133             show-input
134           />
135         </el-form-item>
136       </el-card>
137     </el-form>
138   </ComponentContainerProperty>
139 </template>
140
141 <script lang="ts" setup>
142 import { PromotionPointProperty } from './config'
143 import { usePropertyForm } from '@/components/DiyEditor/util'
144 import PointShowcase from '@/views/mall/promotion/point/components/PointShowcase.vue'
145
146 // 秒杀属性面板
147 defineOptions({ name: 'PromotionPointProperty' })
148
149 const props = defineProps<{ modelValue: PromotionPointProperty }>()
150 const emit = defineEmits(['update:modelValue'])
151 const { formData } = usePropertyForm(props.modelValue, emit)
152 </script>
153
154 <style lang="scss" scoped></style>