提交 1de420ac 作者: 翁进城

Merge branch 'master' into feature/chuck

import request, { Response } from "~/api/request";
import config from "./config";
import request, { Response } from '~/api/request'
import config from './config'
export interface RegionResp {
childInfo?: RegionResp[] | null;
id: number;
level: number;
name: string;
pid: number;
childInfo?: RegionResp[] | null
id: number
level: number
name: string
pid: number
}
export interface UserInfoResp {
id: number;
accountType: number;
uid: string;
phoneNum: string;
userName: string;
nickName: string;
userImg: string;
userSex: number;
email: string;
source: number;
accountStatus: number;
remark: string;
portType: number;
createTime: string;
companyAuthStatus: number;
token: string;
id: number
accountType: number
uid: string
phoneNum: string
userName: string
nickName: string
userImg: string
userSex: number
email: string
source: number
accountStatus: number
remark: string
portType: number
createTime: string
companyAuthStatus: number
token: string
cooperationTagId: number | null
}
export interface TestAppletLoginResp {
userAccountId: number;
token: string;
uid: string;
phoneNum?: string;
nickName: string;
sessionKey?: any;
userAccountId: number
token: string
uid: string
phoneNum?: string
nickName: string
sessionKey?: any
}
export default {
//获取区域数据
region: (): Promise<Response<Array<RegionResp>>> => {
return request("/pms/webDevice/getSecondDistrictInfo");
return request('/pms/webDevice/getSecondDistrictInfo')
},
//测试-小程序unionId登录-注册
testAppletLogin: (): Promise<Response<TestAppletLoginResp>> => {
let params = new URLSearchParams();
params.append("unionId", "oQZEd5hy0Qrwaj10BGtP8xq8vH--s88888");
let params = new URLSearchParams()
params.append('unionId', 'oQZEd5hy0Qrwaj10BGtP8xq8vH--s88888')
return request(
"/userapp/auth/testAppletLogin",
"post",
'/userapp/auth/testAppletLogin',
'post',
{},
{
headers: {
"Content-Type": "application/x-www-form-urlencoded",
'Content-Type': 'application/x-www-form-urlencoded',
},
body: params,
}
);
)
},
//生成小程序码
getAppletQRCode: (params: { randomLoginCode: string }) => {
return request("/userapp/wx/getAppletQRCode", "get", {
page: "page-identity/identity-empower/index",
scene: "randomLoginCode=" + params.randomLoginCode,
});
return request('/userapp/wx/getAppletQRCode', 'get', {
page: 'page-identity/identity-empower/index',
scene: 'randomLoginCode=' + params.randomLoginCode,
})
},
//查询登录信息
getLoginInfo: (params: { randomLoginCode: string }) => {
return request("/userapp/temp-auth/getLoginInfo", "get", params, {
hideError: true //隐藏错误提示
});
return request('/userapp/temp-auth/getLoginInfo', 'get', params, {
hideError: true, //隐藏错误提示
})
},
//获取用户基本信息
userInfo: (): Promise<Response<UserInfoResp>> => {
return request("/userapp/user-account/info", "get");
return request('/userapp/user-account/info', 'get')
},
//图片上传地址
imgOss: () => {
return config.baseUrl + "/pms/upload/imgOss";
return config.baseUrl + '/pms/upload/imgOss'
},
};
}
......@@ -32,7 +32,7 @@ const beforeUpload = (file: RcFile) => {
//限制上传10M
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isLt2M) {
message.error("Image must smaller than 2MB!");
message.error("请上传10M以内的JPG、JPEG、BMP、GIF、PNG格式图片");
}
return isJpgOrPng && isLt2M;
};
......
......@@ -231,10 +231,15 @@ export default function EquipmentLeasingDetail() {
) : (
<div className="function not"></div>
)}
<div className="menoy">
<span className="menoy-left">{`¥${detail?.price! | 0}`}</span>
<span className="menoy-right">/天起</span>
</div>
{userInfo?.cooperationTagId ? (
<div className="menoy">
<span className="menoy-left">{`¥${detail?.price! | 0}`}</span>
<span className="menoy-right">/天起</span>
</div>
) : (
<div className="menoy">暂无报价</div>
)}
<div className="classification">
<div className="top">
<div className="left">
......@@ -282,9 +287,7 @@ export default function EquipmentLeasingDetail() {
style={{ textAlign: 'center' }}
dangerouslySetInnerHTML={{ __html: detail?.goodsDetail.content }}
></div>
) : (
<div style={{ textAlign: 'center' }}></div>
)}
) : null}
{/* 立即租赁 */}
<Modal
wrapClassName="application"
......
......@@ -12,7 +12,6 @@ import {
} from '../../api'
import { UserContext } from '~/lib/userProvider'
const { TextArea } = Input
interface PropsBox {
setIsorderForGoods: (boolean: boolean) => void
detailData?: GetWebDeviceDetailResult | null
......@@ -142,44 +141,78 @@ export default function OrderForGoods(props: PropsBox) {
}
}
//扫码管理地址
const [isAddAddressOpen, setIsAddAddressOpen] = useState(false)
const [addressVisible, setAddressVisible] = useState(false)
return (
<OrderForGoodsBox>
<div className="address">
<div className="top">
<div className="left">确认收货地址</div>
<div className="right">
<Button type="link" style={{ color: '#007aff' }}>
<Button
onClick={() => setIsAddAddressOpen(true)}
type="link"
style={{ color: '#007aff' }}
>
管理收货地址
</Button>
</div>
</div>
<div className="bottom">
{list?.map((item, index) => (
<div
key={item.id}
className={`item ${value === index ? 'active' : ''}`}
onClick={() => onChangeValue(index)}
>
{list?.length ? (
list?.map((item, index) => (
<div
key={item.id}
className={`item ${value === index ? 'active' : ''}`}
onClick={() => onChangeValue(index)}
>
<div className="left">
<div className="active">
<div className="icon"></div>
<div className="label">寄送至</div>
</div>
<Radio.Group onChange={onChange} value={value}>
<Space direction="vertical">
<Radio value={index}>{item.takeAddress}</Radio>
</Space>
</Radio.Group>
</div>
{value === index ? (
<div className="right">
<Button
onClick={() => setIsAddAddressOpen(true)}
type="link"
style={{ color: '#007aff' }}
>
修改地址
</Button>
</div>
) : null}
</div>
))
) : (
<div className="item active">
<div className="left">
<div className="active">
<div className="icon"></div>
<div className="label">寄送至</div>
<div className="label">
暂无地址,请打开手机端【云享飞】微信小程序,【我的】-【个人设置】-【地址管理】添加
</div>
</div>
<Radio.Group onChange={onChange} value={value}>
<Space direction="vertical">
<Radio value={index}>{item.takeAddress}</Radio>
</Space>
</Radio.Group>
</div>
{value === index ? (
<div className="right">
<Button type="link" style={{ color: '#007aff' }}>
修改地址
</Button>
</div>
) : null}
<div className="right">
<Button
onClick={() => setIsAddAddressOpen(true)}
type="link"
style={{ color: '#007aff' }}
>
添加地址
</Button>
</div>
</div>
))}
)}
</div>
</div>
<div className="info">
......@@ -206,6 +239,7 @@ export default function OrderForGoods(props: PropsBox) {
<div className="body-item article" style={{ width: 290 }}>
<div className="image">
<Image
className="image-box"
preview={{ visible: false }}
src={(wareSkuList && wareSkuList![0].specImage) || ''}
onClick={() => setVisible(true)}
......@@ -332,6 +366,51 @@ export default function OrderForGoods(props: PropsBox) {
<div>云享飞账号: {userInfo?.uid}</div>
<div>付款方式: 可用(¥{paymentDetail?.balance})</div>
</Modal>
<Modal
wrapClassName="addAddress"
open={isAddAddressOpen}
onCancel={() => setIsAddAddressOpen(false)}
getContainer={false}
maskClosable={false}
width={420}
footer={false}
>
<div className="title">扫码管理地址</div>
<div className="image">
<Image
className="addressImg"
preview={{ visible: false }}
src={
window.location.href.includes('https://test.iuav.shop/')
? 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/app-iuav-trial.jpg'
: 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/app-iuav-formal.jpg' ||
''
}
onClick={() => setAddressVisible(true)}
/>
<div style={{ display: 'none' }}>
<Image.PreviewGroup
preview={{
visible: addressVisible,
onVisibleChange: (vis) => setAddressVisible(vis),
}}
>
<Image
src={
window.location.href.includes('https://test.iuav.shop/')
? 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/app-iuav-trial.jpg'
: 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/app-iuav-formal.jpg' ||
''
}
/>
</Image.PreviewGroup>
</div>
</div>
<div className="content">
【打开微信扫一扫】-进入云享飞【我的】- 【个人设置】-【地址管理】
</div>
</Modal>
</OrderForGoodsBox>
)
}
......@@ -106,10 +106,11 @@ export const OrderForGoodsBox = styled.div`
display: flex;
justify-content: space-between;
.image {
width: 80px;
height: 80px;
background-color: pink;
margin-right: 10px;
.image-box {
width: 80px;
height: 80px;
}
}
.right {
.top {
......@@ -309,4 +310,34 @@ export const OrderForGoodsBox = styled.div`
color: #ff552d;
}
}
.addAddress {
.title {
text-align: center;
height: 25px;
font-size: 20px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #000000;
line-height: 25px;
}
.image {
display: flex;
justify-content: center;
align-items: center;
padding: 48px 0 32px;
.addressImg {
width: 150px;
height: 150px;
}
}
.content {
text-align: center;
width: 311px;
height: 38px;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #3e454d;
line-height: 19px;
}
}
`
......@@ -35,6 +35,8 @@ export const Box = styled.div`
}
.menoy {
margin-top: 17px;
font-size: 32px;
color: #ef2e00;
&-left {
width: 79px;
height: 41px;
......
import { Pagination } from 'antd'
import Image from 'next/image'
import { useRouter } from 'next/router'
import { useEffect, useRef, useState } from 'react'
import { useContext, useEffect, useRef, useState } from 'react'
import ContentBox from '~/components/contentBox'
import Filter, { AdapterResult, FilterResult } from '~/components/filter'
import Layout from '~/components/layout'
import api, { Advertisement, Device } from './api'
import { Box } from './styled'
import { UserContext } from '~/lib/userProvider'
// 此函数在构建时被调用
export async function getStaticProps() {
//获取筛选数据,进行静态渲染
......@@ -18,6 +19,7 @@ export async function getStaticProps() {
type Props = {}
export default function EquipmentLeasing(props: Props) {
const { userInfo } = useContext(UserContext)
const router = useRouter()
const [productList, setProductList] = useState(
Array<{ element: JSX.Element }>
......@@ -42,10 +44,14 @@ export default function EquipmentLeasing(props: Props) {
<div className="item-bottom-title" title={item.goodsName}>
{item.goodsName}
</div>
<div className="item-bottom-price">
<span className="money">¥{item.price}</span>
<span className="unit">/天起</span>
</div>
{userInfo?.cooperationTagId ? (
<div className="item-bottom-price">
<span className="money">¥{item.price}</span>
<span className="unit">/天起</span>
</div>
) : (
<div className="unit">暂无报价</div>
)}
</div>
</div>
)
......
import styled from "styled-components";
import styled from 'styled-components'
export default function Style() {
return <></>;
return <></>
}
export const Box = styled.div`
......@@ -54,14 +54,14 @@ export const Box = styled.div`
color: #ff552d;
line-height: 22px;
}
.unit {
width: 58px;
height: 22px;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #ff552d;
line-height: 22px;
}
}
.unit {
width: 58px;
height: 22px;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #ff552d;
line-height: 22px;
}
}
}
......@@ -76,4 +76,4 @@ export const Box = styled.div`
.pagination-page {
text-align: right;
}
`;
`
......@@ -16,6 +16,7 @@ export interface Flying {
free: 0 | 1
curriculumDesc: string
videoUrl: string
surfaceUrl: string
}
export interface ListPageFlyingInfoResp {
......
......@@ -29,6 +29,11 @@ export default function FlyingDetail() {
<div className="content">{detail?.curriculumDesc}</div>
</div>
{/* <div className="bottom">详情</div> */}
{detail?.detailContent && (
<div
dangerouslySetInnerHTML={{ __html: detail?.detailContent }}
></div>
)}
</div>
),
},
......
......@@ -64,7 +64,11 @@ export default function FlyingHandService() {
>
<div className="item-top">
<Image
src={`${item.videoUrl}?x-oss-process=video/snapshot,t_1000,m_fast`}
src={
item.videoUrl
? `${item.videoUrl}?x-oss-process=video/snapshot,t_1000,m_fast`
: item.surfaceUrl
}
alt="#"
fill
/>
......
......@@ -46,7 +46,11 @@ export default function JobServicesDetail() {
src={detail?.teamPoster ? detail?.teamPoster : ''}
alt="error"
/> */}
{detail?.serviceIntroduction}
{detail?.serviceIntroduction ? (
<div
dangerouslySetInnerHTML={{ __html: detail?.serviceIntroduction }}
></div>
) : null}
</div>
),
},
......@@ -254,7 +258,6 @@ export default function JobServicesDetail() {
<RangePicker
style={{ width: 376, marginTop: 10 }}
disabledDate={disabledDate}
showTime
/>
</Form.Item>
<Form.Item
......
......@@ -86,44 +86,77 @@ export default function OrderForGoods(props: PropsBox) {
//图片预览
const [visible, setVisible] = useState(false)
//扫码管理地址
const [isAddAddressOpen, setIsAddAddressOpen] = useState(false)
const [addressVisible, setAddressVisible] = useState(false)
return (
<OrderForGoodsBox>
<div className="address">
<div className="top">
<div className="left">确认收货地址</div>
<div className="right">
<Button type="link" style={{ color: '#007aff' }}>
<Button
onClick={() => setIsAddAddressOpen(true)}
type="link"
style={{ color: '#007aff' }}
>
管理收货地址
</Button>
</div>
</div>
<div className="bottom">
{list?.map((item, index) => (
<div
key={item.id}
className={`item ${value === item.id ? 'active' : ''}`}
onClick={() => onChangeValue(item.id)}
>
{list?.length ? (
list?.map((item, index) => (
<div
key={item.id}
className={`item ${value === item.id ? 'active' : ''}`}
onClick={() => onChangeValue(item.id)}
>
<div className="left">
<div className="active">
<div className="icon"></div>
<div className="label">寄送至</div>
</div>
<Radio.Group onChange={onChange} value={value}>
<Space direction="vertical">
<Radio value={item.id}>{item.takeAddress}</Radio>
</Space>
</Radio.Group>
</div>
{value === item.id ? (
<div className="right">
<Button
onClick={() => setIsAddAddressOpen(true)}
type="link"
style={{ color: '#007aff' }}
>
修改地址
</Button>
</div>
) : null}
</div>
))
) : (
<div className="item active">
<div className="left">
<div className="active">
<div className="icon"></div>
<div className="label">寄送至</div>
<div className="label">
暂无地址,请打开手机端【云享飞】微信小程序,【我的】-【个人设置】-【地址管理】添加
</div>
</div>
<Radio.Group onChange={onChange} value={value}>
<Space direction="vertical">
<Radio value={item.id}>{item.takeAddress}</Radio>
</Space>
</Radio.Group>
</div>
{value === item.id ? (
<div className="right">
<Button type="link" style={{ color: '#007aff' }}>
修改地址
</Button>
</div>
) : null}
<div className="right">
<Button
onClick={() => setIsAddAddressOpen(true)}
type="link"
style={{ color: '#007aff' }}
>
添加地址
</Button>
</div>
</div>
))}
)}
</div>
</div>
<div className="info">
......@@ -148,6 +181,7 @@ export default function OrderForGoods(props: PropsBox) {
<div className="body-item article" style={{ width: 290 }}>
<div className="image">
<Image
className="image-box"
preview={{ visible: false }}
src={item.prodSkuSpecImage || ''}
onClick={() => setVisible(true)}
......@@ -233,6 +267,50 @@ export default function OrderForGoods(props: PropsBox) {
</div>
</div>
</div>
<Modal
wrapClassName="addAddress"
open={isAddAddressOpen}
onCancel={() => setIsAddAddressOpen(false)}
getContainer={false}
maskClosable={false}
width={420}
footer={false}
>
<div className="title">扫码管理地址</div>
<div className="image">
<Image
className="addressImg"
preview={{ visible: false }}
src={
window.location.href.includes('https://test.iuav.shop/')
? 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/app-iuav-trial.jpg'
: 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/app-iuav-formal.jpg' ||
''
}
onClick={() => setAddressVisible(true)}
/>
<div style={{ display: 'none' }}>
<Image.PreviewGroup
preview={{
visible: addressVisible,
onVisibleChange: (vis) => setAddressVisible(vis),
}}
>
<Image
src={
window.location.href.includes('https://test.iuav.shop/')
? 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/app-iuav-trial.jpg'
: 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/app-iuav-formal.jpg' ||
''
}
/>
</Image.PreviewGroup>
</div>
</div>
<div className="content">
【打开微信扫一扫】-进入云享飞【我的】- 【个人设置】-【地址管理】
</div>
</Modal>
</OrderForGoodsBox>
)
}
......@@ -106,10 +106,11 @@ export const OrderForGoodsBox = styled.div`
display: flex;
justify-content: space-between;
.image {
width: 80px;
height: 80px;
background-color: pink;
margin-right: 10px;
.image-box {
width: 80px;
height: 80px;
}
}
.right {
.top {
......@@ -272,4 +273,34 @@ export const OrderForGoodsBox = styled.div`
color: #ff552d;
}
}
.addAddress {
.title {
text-align: center;
height: 25px;
font-size: 20px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #000000;
line-height: 25px;
}
.image {
display: flex;
justify-content: center;
align-items: center;
padding: 48px 0 32px;
.addressImg {
width: 150px;
height: 150px;
}
}
.content {
text-align: center;
width: 311px;
height: 38px;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #3e454d;
line-height: 19px;
}
}
`
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论