!2097 新增:上传和编辑画廊前端增加全景图链接字段

pull/2094/MERGE
林三 2 years ago committed by ChenX
parent 8a99af6094
commit 7aebc2155d

@ -184,6 +184,7 @@ export const GalleryURL = {
GalleryDepoly: CURRENT_HOST + '/CAD-galleryDepoly', //用户-发布画廊文件
GalleryDelete: CURRENT_HOST + '/CAD-galleryDelete', //用户-下架画廊文件
UserGalleryList: CURRENT_HOST + '/CAD-galleryListUser', //用户画廊列表
GalleryUpdate: CURRENT_HOST + '/CAD-galleryUpdate', //单个修改画廊文件
GalleryUpdateBatch: CURRENT_HOST + '/CAD-galleryUpdateBatch', //批量修改画廊文件
GalleryIndexList: CURRENT_HOST + '/CAD-galleryListIndex', //首页画廊列表
GalleryDetile: CURRENT_HOST + '/CAD-galleryDetail', //画廊文件详情

@ -4,7 +4,7 @@ import { observer } from 'mobx-react';
import React, { Component, createRef, RefObject } from 'react';
import { CURRENT_HOST } from '../../../../Common/HostUrl';
import { getFileSize } from '../../../../Common/Utils';
import { UpdateBatchGallery } from '../data/GalleryData';
import { UpdateGallery } from '../data/GalleryData';
import GalleryStore from '../GalleryStore';
import { IGalleryItem } from '../interface/GalleryInterfaces';
@ -33,7 +33,7 @@ export default class GalleryDetailDrawer extends Component<GalleryDetailDrawerPr
const class_name = formData.get('class_id') as string;
formData.set('class_id', this.GalleryStore.GalleryAsideMenu.get('GalleryLists').children.get(class_name).key);
const res = await UpdateBatchGallery(formData);
const res = await UpdateGallery(formData);
if (res.err_code === 0 && res.err_msg === "success")
{
@ -81,7 +81,7 @@ export default class GalleryDetailDrawer extends Component<GalleryDetailDrawerPr
</div>
<div className={Classes.DIALOG_BODY}>
<FormGroup label='画廊ID' inline helperText='画廊ID,上传时自动分配无法修改' >
<InputGroup name='gallery_id[]' readOnly fill autoComplete='off' defaultValue={this.props.gallery.gallery_id} />
<InputGroup name='gallery_id' readOnly fill autoComplete='off' defaultValue={this.props.gallery.gallery_id} />
</FormGroup>
<FormGroup
label='画廊名称'
@ -102,6 +102,9 @@ export default class GalleryDetailDrawer extends Component<GalleryDetailDrawerPr
else this.isGalleryNameEmpty = false;
}} />
</FormGroup>
<FormGroup label='全景图链接' inline>
<InputGroup name='pano_url' defaultValue={this.props.gallery.pano_url} />
</FormGroup>
<FormGroup label='画廊类目' inline helperText="选择画廊风格类型" >
<HTMLSelect
name='class_id'

@ -28,6 +28,16 @@ export default class GalleryItem extends Component<GalleryItemProps>
<span><Icon icon='user' />&nbsp;{this.props.item.login_name} </span>
<span>{this.props.item.create_date}</span>
</div>
<div className='panoramaButton'>
<Button
text='全景图漫游>'
onClick={() =>
{
if (this.props.item.pano_url)
window.open(this.props.item.pano_url);
}}
/>
</div>
<div>
<span><Icon icon='shop' />&nbsp;{this.props.item.shop_name}</span>
<span><Icon icon='flame' />&nbsp;{this.props.item.hot}</span>
@ -61,6 +71,16 @@ export default class GalleryItem extends Component<GalleryItemProps>
<span><Icon icon='flame' /> {this.props.item.hot}</span>
<span><Icon icon='document' />{getFileSize(Number.parseInt(this.props.item.size))}</span>
<span>{this.props.item.create_date}</span>
<div className='panoramaButton'>
<Button
text='全景图漫游'
onClick={() =>
{
if (this.props.item.pano_url)
window.open(this.props.item.pano_url);
}}
/>
</div>
<Button text='免费使用' intent={Intent.PRIMARY} onClick={async () => { await this.GalleryStore.OpenGallery(this.props.item.gallery_id); }} />
</div>
</div>

@ -70,6 +70,9 @@ export default class UploadGalleryDialog extends Component<UploadGalleryDialogPr
<FormGroup label='文件ID' helperText="选择上传文件的ID" >
<InputGroup defaultValue={this.GalleryStore?.galleryFileData?.file_id ?? ''} readOnly fill name='file_id' />
</FormGroup>
<FormGroup label='全景图链接'>
<InputGroup defaultValue={this.GalleryStore?.galleryFileData?.pano_url ?? ''} name='pano_url' />
</FormGroup>
<FormGroup label='画廊名称' helperText="为您上传的画廊起个标题" >
<InputGroup defaultValue={this.GalleryStore?.galleryFileData?.name ?? ''} fill name='name' />
</FormGroup>

@ -36,7 +36,12 @@ export async function UploadNewGallery(params: FormData)
{
return await Post(GalleryURL.GalleryDepoly, params);
};
//管理员修改画廊
//管理员批量修改画廊
export async function UpdateGallery(params: FormData)
{
return await Post(GalleryURL.GalleryUpdate, params);
};
//管理员批量修改画廊
export async function UpdateBatchGallery(params: FormData)
{
return await Post(GalleryURL.GalleryUpdateBatch, params);

@ -41,9 +41,10 @@ export interface IGalleryItemDetail
state: string; //画廊状态
hot: string; //画廊热度
file: string; //画廊文件内容
pano_url: string;//全景图链接
}
export type IGalleryItem = Pick<IGalleryItemDetail,
'gallery_id' | 'class_id' | 'name' | 'logo' | 'size' | 'create_date' | 'hot' | 'audit_desc' | 'audit_state' | 'state'>
'gallery_id' | 'class_id' | 'name' | 'logo' | 'size' | 'create_date' | 'hot' | 'audit_desc' | 'audit_state' | 'state' | 'pano_url'>
& {
login_name: string; //发布用户
shop_name: string; //发布店铺

@ -82,6 +82,13 @@
{
transform: scale(1.1);
}
.panoramaButton
{
button{
opacity: 0.95;
}
}
}
}
.GalleryItemDescAndImg
@ -120,6 +127,22 @@
}
}
.panoramaButton{
height: 100%;
button{
font-size : 12px;
position : absolute;
right : 0;
height : 27px;
min-height : 27px;
margin : 3px 9px;
opacity : 0;
transition : opacity 0.15s ease-in 0s;
border-radius: 5px;
}
}
}
.GalleryItemOption
{

@ -216,7 +216,7 @@
{
>label
{
min-width : 80px;
min-width : 85px;
color : @font-color-title;
font-size : 1.4rem;
font-weight : bold;

@ -30,6 +30,10 @@
{
width: 100%;
}
.bp3-form-group:nth-child(2)
{
width: 100%;
}
.OtherInfo
{
width : 100%;

Loading…
Cancel
Save