import { INumberConfigType, ISelectConfigType, ITextConfigType, TSelectDefaultType, ISwitchConfigType, TSwitchDefaultType, TProductListDefaultType, IProductListConfigType, } from 'editorCore/FormComponents/types'; import { commonConfig, commonEditData, ICommonConfig } from '../../common'; import _ from 'lodash'; export type TTemplateKey = 'twoInARow' | 'horizontalScrolling'; export type TProductRecommendationEditData = Array< | ITextConfigType | INumberConfigType | IProductListConfigType | ISelectConfigType | ISwitchConfigType >; export type TProductRecommendationConfig = Pick & { productList: TProductListDefaultType; template: TSelectDefaultType; enableProductTitle: TSwitchDefaultType; enableProductDesc: TSwitchDefaultType; enableProductPrice: TSwitchDefaultType; enableProductSales: TSwitchDefaultType; }; export interface IProductRecommendationSchema { editData: TProductRecommendationEditData; config: TProductRecommendationConfig; } const ProductRecommendation: IProductRecommendationSchema = { editData: [ commonEditData.name, { key: 'template', name: '选择模板', type: 'Select', range: [ { key: 'twoInARow', text: '一行二个', }, { key: 'horizontalScrolling', text: '横向滑动', }, ], }, { key: 'productList', name: '选择商品', type: 'ProductList', }, commonEditData.borderRadius, { key: 'enableProductTitle', name: '启用商品名称', type: 'Switch', }, { key: 'enableProductDesc', name: '启用商品描述', type: 'Switch', }, { key: 'enableProductPrice', name: '启用商品价格', type: 'Switch', }, { key: 'enableProductSales', name: '启用商品销量', type: 'Switch', }, ], config: { ..._.pick(commonConfig, ['name', 'borderRadius']), productList: [ { id: '10408784', name: '这里显示商品名称', cover_path: 'https://static.liweijia.com/site-php/upload/commodity-goods/57df103db60b73ea0f71187d97f6e54f.png', price: 99, sales_volume: 99, description: '这里显示商品描述', wxapplink: '', }, { id: '10357209', name: '这里显示商品名称', cover_path: 'https://static.liweijia.com/site-php/upload/commodity-goods/91200c9ffa04149b904edc05e91c1016.png', price: 99, sales_volume: 99, description: '这里显示商品描述', wxapplink: '', }, ], template: 'twoInARow', enableProductDesc: true, enableProductPrice: true, enableProductSales: true, enableProductTitle: true, }, }; export default ProductRecommendation;