<template>
	<view class='flex-col page'>
		<view class='flex-row justify-between group'>
			<text class='font_1'>设置规格</text>
			<text class='font_2 text'>规格类型排序</text>
		</view>
		<view class='flex-col section space-y-18'>
			<view class='flex-row justify-between items-center group_2'>
				<view class='flex-row items-center space-x-8'>
					<text class='font_3'>款式</text>
					<image class='shrink-0 image'
						src='https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/640728685a7e3f031012ae38/648fe0ea54fe0000116a1654/16871508408832332958.png' />
					<text class='font_4 text_2'>添加图片</text>
				</view>
				<view class='flex-row space-x-6'>
					<text class='font_2'>排序</text>
					<text class='font_2'>删除</text>
				</view>
			</view>
			<view class='flex-col space-y-8'>
				<view class='flex-row items-center space-x-8' v-for='(item, index) in inputs' :key='index'>
					<image class='shrink-0 image_2'
						src='https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/640728685a7e3f031012ae38/648fe0ea54fe0000116a1654/16871508408942998222.png' />
					<input placeholder='请输入参数名' v-model='item.name' class='flex-auto section_2'
						@confirm='addInput(index)' />
					<image class='shrink-0 image_3'
						src='https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/640728685a7e3f031012ae38/648fe0ea54fe0000116a1654/16871508408965531102.png' />
				</view>
<pre><code>		&lt;/view&gt;
	&lt;/view&gt;

	&lt;view class='flex-col section space-y-18' v-for='(item, index) in adds' :key='index'&gt;
		&lt;view class='flex-row justify-between items-center group_2'&gt;
			&lt;view class='flex-row items-center space-x-8'&gt;
				&lt;text class='font_3'&gt;{{item.name}}&lt;/text&gt;
				&lt;image class='shrink-0 image'
					src='https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/640728685a7e3f031012ae38/648fe0ea54fe0000116a1654/16871508408832332958.png' /&gt;
				&lt;text class='font_4 text_2'&gt;添加图片&lt;/text&gt;
			&lt;/view&gt;
			&lt;view class='flex-row space-x-6'&gt;
				&lt;text class='font_2'&gt;排序&lt;/text&gt;
				&lt;text class='font_2'&gt;删除&lt;/text&gt;
			&lt;/view&gt;
		&lt;/view&gt;
		&lt;view class='flex-col space-y-8'&gt;
			&lt;view class='flex-row items-center space-x-8' v-for='(info, inx) in inputs[item.index].values'
				:key='inx'&gt;
				&lt;image class='shrink-0 image_2'
					src='https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/640728685a7e3f031012ae38/648fe0ea54fe0000116a1654/16871508408942998222.png' /&gt;
				&lt;input placeholder='请输入参数名' v-model='info.name' class='flex-auto section_2'
					@confirm='addInputt(item.index,inx)' /&gt;
				&lt;image class='shrink-0 image_3'
					src='https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/640728685a7e3f031012ae38/648fe0ea54fe0000116a1654/16871508408965531102.png' /&gt;
			&lt;/view&gt;

		&lt;/view&gt;
	&lt;/view&gt;


	&lt;view class='flex-row justify-between group_3 view'&gt;
		&lt;text class='font_1'&gt;设置价格与库存&lt;/text&gt;
		&lt;text class='font_2 text_3'&gt;批量设置&lt;/text&gt;
	&lt;/view&gt;
	&lt;view class='flex-col group_4'&gt;
		&lt;view class='flex-col section_3'&gt;
			&lt;view class='flex-row group_3 space-x-12'&gt;
				&lt;text class='font_3'&gt;套餐一&lt;/text&gt;
				&lt;text class='font_3'&gt;套餐二&lt;/text&gt;
				&lt;text class='font_3'&gt;套餐二&lt;/text&gt;
			&lt;/view&gt;
			&lt;view class='flex-col list'&gt;
				&lt;view class='flex-col list-item' v-for='(brand, index) in inputs[0].values' :key='index'&gt;
					&lt;view class='flex-col'&gt;
						&lt;view class='flex-row justify-between items-center group_5'&gt;
							&lt;view class='flex-row items-center space-x-8'&gt;
								&lt;image class='shrink-0 image_4'
									src='https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/640728685a7e3f031012ae38/648fe0ea54fe0000116a1654/16871508408990824311.png' /&gt;
								&lt;text class='font_4'&gt;{{brand.name}}&lt;/text&gt;
							&lt;/view&gt;
							&lt;view class='flex-row items-center'&gt;
								&lt;text class='font_5'&gt;待设置&lt;/text&gt;
								&lt;image class='shrink-0 image_5'
									src='https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/640728685a7e3f031012ae38/648fe0ea54fe0000116a1654/16871508409002854272.png' /&gt;
							&lt;/view&gt;
						&lt;/view&gt;
						&lt;view class='flex-row justify-between items-center section_5'&gt;
							&lt;text class='font_4'&gt;单价:1525.20&lt;/text&gt;
							&lt;text class='font_4'&gt;库存数:356&lt;/text&gt;
						&lt;/view&gt;
					&lt;/view&gt;
				&lt;/view&gt;
			&lt;/view&gt;
		&lt;view class='flex-col group_9 space-y-137'&gt;
			&lt;view class='flex-col justify-start items-center button'&gt;&lt;text class='font_6'&gt;确定&lt;/text&gt;&lt;/view&gt;
			&lt;view class='flex-col group_10 space-y-14'&gt;
				&lt;view class='flex-col justify-start items-center image-wrapper'&gt;
					&lt;image class='image_6'
						src='https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/640728685a7e3f031012ae38/648fe0ea54fe0000116a1654/16871508408899544527.png' /&gt;
				&lt;/view&gt;
				&lt;text class='self-center font_4'&gt;套餐一&lt;/text&gt;
			&lt;/view&gt;
		&lt;/view&gt;
		&lt;view class='flex-col section_6'&gt;
			&lt;view class='flex-row items-center group_11 space-x-12'&gt;
				&lt;view class='group_12'&gt;
					&lt;text class='font_7'&gt;拼单价&lt;/text&gt;
					&lt;text class='font_8'&gt;*&lt;/text&gt;
				&lt;/view&gt;
				&lt;view class='flex-auto section_7'&gt;&lt;/view&gt;
			&lt;/view&gt;
			&lt;view class='flex-col justify-start items-start text-wrapper'&gt;
				&lt;text class='font_3 text_4'&gt;系统将根据拼单价自动计算出单买价和参考价&lt;/text&gt;
			&lt;/view&gt;
			&lt;view class='flex-row items-center group_13 space-x-12'&gt;
				&lt;view class='flex-col items-center shrink-0 space-y-28'&gt;
					&lt;view class='group_15'&gt;
						&lt;text class='font_7'&gt;库存数&lt;/text&gt;
						&lt;text class='font_8'&gt;*&lt;/text&gt;
					&lt;/view&gt;
					&lt;view class='group_16'&gt;
						&lt;text class='font_7'&gt;商品码&lt;/text&gt;
						&lt;text class='font_8'&gt;*&lt;/text&gt;
					&lt;/view&gt;
				&lt;/view&gt;
				&lt;view class='flex-col flex-auto group_14 space-y-8'&gt;
					&lt;view class='section_8'&gt;&lt;/view&gt;
					&lt;view class='section_8'&gt;&lt;/view&gt;
				&lt;/view&gt;
			&lt;/view&gt;
		&lt;/view&gt;
	&lt;/view&gt;
	&lt;view class='flex-col justify-start items-center self-center button_2'&gt;&lt;text class='font_6'&gt;确定&lt;/text&gt;&lt;/view&gt;
&lt;/view&gt;
</code></pre>
</template>
<script>
	export default {
		components: {},
		data() {
			return {
				list_K4owPVR4: [null, null, null],
				inputs: [{
					name: '',
					values: [{
						name: '',
						values: [],
						price: ''
					}],
					price: ''
				}],
				adds: [],
			};
		},

		methods: {
			addInput(index) {
				console.log(index)
				if (index === this.inputs.length - 1) {
					this.inputs.push({
						name: '',
						values: [{
							name: '',
							values: [],
							price: ''
						}],
						price: ''
					})
					this.adds.push({
						index: index,
						name: this.inputs[index].name
					})
				}
			},
			addInputt(id,index) {
				if (index === this.inputs[id].values.length - 1) {
					this.inputs[id].values.push({ name: '', values: [], price: '' })
					//this.endadds.push({ value: this.inputss[index].value})
				}
			},
		}
	};
</script>
商品规格设置 - 完善商品信息,提升用户体验

原文地址: https://www.cveoy.top/t/topic/oLm0 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录