bding 5 meses atrás
pai
commit
1a7daab0a7

BIN
build.zip


+ 8 - 0
src/Activity/Activity.service.ts

@@ -171,6 +171,7 @@ export interface IActivityTypeDetailRes {
   SellerName: string //销售姓名
 }
 export interface IActivityTypeDetail extends IActivityDetialBase {
+  IsResearchPointsByUser: boolean //是否为扣用户点数的研选扣点
   SignupNum: number //已报名人数
   ArticleList: IArticleListItem[]
   Listndustrial: IListndustrialItem[] //活动关联的产业信息
@@ -243,6 +244,7 @@ export interface IActivitySignupRes {
   IsResearchSpecial: boolean // 是否属于特殊的研选
 }
 export interface IActivityCheckRes {
+  CheckSiginUpNum: boolean //人数是否通过校验
   GoodsList: IGoodsListItem[]
   IsShowWxPay: boolean // 是否展示微信支付
   CheckPermission: boolean //权限是否通过校验
@@ -427,5 +429,11 @@ export const ActivityService = {
       url: `/order/cancel`,
       method: 'post',
       data: { OrderCode }
+    }),
+  bindingEmail: (Email: string): INewResponse =>
+    NewAxiosInstanceFunc({
+      url: `/user/email/binding`,
+      method: 'post',
+      data: { Email }
     })
 }

+ 30 - 28
src/Activity/ActivityTypeDetail.tsx

@@ -249,31 +249,32 @@ const ActivityTypeDetail: React.FC<IActivityTypeDetail> = props => {
                         <span className="activity-detail-label">活动时间:</span>
                         {data?.Detail.ActivityTimeText}
                       </div>
-                      {data?.Detail.DistinguishedGuest && (
+
+                      {data?.Detail.DistinguishedGuest && data?.HasPermission === INewPermissionType.OK && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">嘉宾:</span>
                           {data?.Detail.DistinguishedGuest}
                         </div>
                       )}
-                      {data?.Detail.Host && (
+                      {data?.Detail.Host && data?.HasPermission === INewPermissionType.OK && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">主持人:</span>
                           {data?.Detail.Host}
                         </div>
                       )}
-                      {data?.Detail.Speaker && (
+                      {data?.Detail.Speaker && data?.HasPermission === INewPermissionType.OK && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">主讲人:</span>
                           {data?.Detail.Speaker}
                         </div>
                       )}
-                      {data?.Detail.Expert && (
+                      {data?.Detail.Expert && data?.HasPermission === INewPermissionType.OK && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">专家背景:</span>
                           <div dangerouslySetInnerHTML={{ __html: data?.Detail.Expert }} className="reset-pm" />
                         </div>
                       )}
-                      {login2p.jwt && data?.HasPermission === INewPermissionType.OK && data?.Detail.Address && (
+                      {login2p.jwt && data?.Detail.Address && data?.HasPermission === INewPermissionType.OK && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">活动地点:</span>
                           {data.Detail.ActivityTypeId === 4
@@ -284,33 +285,33 @@ const ActivityTypeDetail: React.FC<IActivityTypeDetail> = props => {
                         </div>
                       )}
 
-                      {data?.Detail.MainlandTell && (
+                      {data?.Detail.MainlandTell && data?.HasPermission === INewPermissionType.OK && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">大陆拨入:</span>
                           <span className="detail-link">{data?.Detail.MainlandTell}</span>
                         </div>
                       )}
-                      {data?.Detail.HongKongTell && (
+                      {data?.Detail.HongKongTell && data?.HasPermission === INewPermissionType.OK && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">香港拨入:</span>
                           <span className="detail-link">{data?.Detail.HongKongTell}</span>
                         </div>
                       )}
-                      {data?.Detail.TaiwanTell && (
+                      {data?.Detail.TaiwanTell && data?.HasPermission === INewPermissionType.OK && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">台湾拨入:</span>
                           <span className="detail-link">{data?.Detail.TaiwanTell}</span>
                         </div>
                       )}
-                      {data?.Detail.AmericaTell && (
+                      {data?.Detail.AmericaTell && data?.HasPermission === INewPermissionType.OK && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">美国拨入:</span>
                           <span className="detail-link">{data?.Detail.AmericaTell}</span>
                         </div>
                       )}
                       {login2p.jwt &&
-                        data?.HasPermission === INewPermissionType.OK &&
-                        data?.Detail.ParticipationCode && (
+                        data?.Detail.ParticipationCode &&
+                        data?.HasPermission === INewPermissionType.OK && (
                           <div className="activity-detail-line">
                             <span className="activity-detail-label">拨入密码:</span>
                             {!!data?.Detail.IsLimitPeople
@@ -321,8 +322,8 @@ const ActivityTypeDetail: React.FC<IActivityTypeDetail> = props => {
                           </div>
                         )}
                       {login2p.jwt &&
-                        data?.HasPermission === INewPermissionType.OK &&
-                        data?.Detail.OnlineParticipation && (
+                        data?.Detail.OnlineParticipation &&
+                        data?.HasPermission === INewPermissionType.OK && (
                           <div className="activity-detail-line">
                             <span className="activity-detail-label">网络参会:</span>
                             {!!data?.Detail.IsLimitPeople &&
@@ -342,8 +343,8 @@ const ActivityTypeDetail: React.FC<IActivityTypeDetail> = props => {
                           </div>
                         )}
                       {login2p.jwt &&
-                        data?.HasPermission === INewPermissionType.OK &&
-                        data?.Detail.LinkParticipants && (
+                        data?.Detail.LinkParticipants &&
+                        data?.HasPermission === INewPermissionType.OK && (
                           <div className="activity-detail-line">
                             <span className="activity-detail-label">链接参会:</span>
                             {!!data?.Detail.IsLimitPeople
@@ -353,14 +354,15 @@ const ActivityTypeDetail: React.FC<IActivityTypeDetail> = props => {
                               : formatLinkText(data?.Detail.LinkParticipants)}
                           </div>
                         )}
-                      {(data?.Detail?.ArticleList?.length || 0) > 0 && (
-                        <div className="activity-detail-line">
-                          <span className="activity-detail-label">相关报告:</span>
-                          <div onClick={handleArticleLink} className="detail-btn-link">
-                            点击查看
+                      {(data?.Detail?.ArticleList?.length || 0) > 0 &&
+                        data?.HasPermission === INewPermissionType.OK && (
+                          <div className="activity-detail-line">
+                            <span className="activity-detail-label">相关报告:</span>
+                            <div onClick={handleArticleLink} className="detail-btn-link">
+                              点击查看
+                            </div>
                           </div>
-                        </div>
-                      )}
+                        )}
                       {data?.Detail.Theme && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">主题:</span>
@@ -368,8 +370,8 @@ const ActivityTypeDetail: React.FC<IActivityTypeDetail> = props => {
                         </div>
                       )}
                       {login2p.jwt &&
-                        data?.HasPermission === INewPermissionType.OK &&
-                        data?.Detail.TencentConferenceNumber && (
+                        data?.Detail.TencentConferenceNumber &&
+                        data?.HasPermission === INewPermissionType.OK && (
                           <div className="activity-detail-line">
                             <span className="activity-detail-label">腾讯会议号:</span>
                             <div className="detail-link">
@@ -381,15 +383,15 @@ const ActivityTypeDetail: React.FC<IActivityTypeDetail> = props => {
                             </div>
                           </div>
                         )}
-                      {data?.Detail.AppAttendance && (
+                      {data?.Detail.AppAttendance && data?.HasPermission === INewPermissionType.OK && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">App参会:</span>
                           {data.Detail.AppAttendance}
                         </div>
                       )}
                       {login2p.jwt &&
-                        data?.HasPermission === INewPermissionType.OK &&
-                        data?.Detail.ConferencePassword && (
+                        data?.Detail.ConferencePassword &&
+                        data?.HasPermission === INewPermissionType.OK && (
                           <div className="activity-detail-line">
                             <span className="activity-detail-label">会议密码:</span>
                             {!!data?.Detail.IsLimitPeople
@@ -405,7 +407,7 @@ const ActivityTypeDetail: React.FC<IActivityTypeDetail> = props => {
                           <div dangerouslySetInnerHTML={{ __html: data?.Detail.Highlights }} className="reset-pm" />
                         </div>
                       )}
-                      {data?.Detail.Remarks && (
+                      {data?.Detail.Remarks && data?.HasPermission === INewPermissionType.OK && (
                         <div className="activity-detail-line">
                           <span className="activity-detail-label">备注:</span>
                           <div dangerouslySetInnerHTML={{ __html: data?.Detail.Remarks }} className="reset-pm" />

+ 3 - 5
src/Activity/components/ActivityBtn.component.tsx

@@ -408,8 +408,7 @@ const ActivityBtnComponent: React.FC<IActivityBtnComponent> = props => {
       history.push(`/login2p?next=${encodeURIComponent(location.pathname + location.search)}`)
       return
     }
-
-    // 先简单的检查一下权限
+    //先简单的检查一下权限
     const powerCheck = handleCheckPower(
       item?.AuthInfo?.HasPermission,
       item?.IsResearch,
@@ -719,7 +718,7 @@ const ActivityBtnComponent: React.FC<IActivityBtnComponent> = props => {
     if (!res.CheckPoints) {
       // todo 如果需要付费 需要判断一下(需要加字段,是否需要支付,提示文案里的价格需要替换)
       if (res.IsShowWxPay) {
-        Modal.warning({
+        Modal.confirm({
           title: '提示',
           content: (
             <div className="reset-pm">
@@ -734,10 +733,9 @@ const ActivityBtnComponent: React.FC<IActivityBtnComponent> = props => {
               </div>
             </div>
           ),
-          cancelText: '取消',
           okText: '付费报名',
           onOk: () => {
-            onNeedToDoSome && onNeedToDoSome()
+            window.open(`/activity/detail/${(item as IActivityTypeListItem).ActivityId}`)
           },
           width: 520,
           centered: true

+ 1 - 0
src/Activity/css/ActivityTypeDetail.module.scss

@@ -135,6 +135,7 @@
       justify-content: center;
       text-align: center;
       gap: 20px;
+      margin: 30px auto;
     }
     .detail-btn-link {
       width: 90px;

+ 1 - 12
src/Column/ColumnDetail.tsx

@@ -48,8 +48,7 @@ const ColumnDetail: React.FC<IColumnDetailProps> = props => {
     refreshArcticleDetail()
   }
   const formatRender = (data: IColumnDetail) => {
-    // 买方研选网页版1.0,专栏详情页不需要判断权限,只要登录就能查看
-    if (data.HasPermission !== ColumnHasPermissionType.OK) {
+    if (data.HasPermission && data.HasPermission !== ColumnHasPermissionType.OK) {
       return (
         <div className={styles['art-nopower-bg']}>
           {data?.IsShowWxPay && !media.isSmallMax ? ( // 暂时这么写
@@ -69,16 +68,6 @@ const ColumnDetail: React.FC<IColumnDetailProps> = props => {
             />
           )}
         </div>
-
-        // <div className={`${styles['columndetail-page']}`}>
-        //   <NoPermission
-        //     hasPermission={data?.HasPermission}
-        //     detailID={data.Id}
-        //     specialType={ISpecialType.YanxuanSpecial}
-        //     tryType={ITryType.YanxuanSpecial}
-        //     border={true}
-        //   />
-        // </div>
       )
     }
     if (login2p.userInfo?.UserId === data.UserId || data.IsApprovalAdmin || data.Status === 3) {

+ 2 - 0
src/Material/Material.service.ts

@@ -200,6 +200,8 @@ export interface IOrderInfoRes {
   PayTimeCountdown: number //订单倒计时
 }
 export interface IOrderPayStatusRes {
+  IsSignUp: boolean //是否自动报名
+  IsPublicActivitie: boolean //是否是公开活动
   OrderCode: string //订单编号
   OrderType: number //订单类型 1:畅读卡订单,2:单场付费订单
   EndDate: string //结束日期

+ 9 - 6
src/Material/components/ApplyResult.tsx

@@ -44,25 +44,29 @@ const ApplyResult: React.FC<IApplyPermissionProps> = props => {
                 <>
                   <img src={SuccessSvg} alt="图标" className="paymodel-success-icon" />
                   <span>畅读卡购买成功</span>
+                  <div className="paymodel-text">有效期至:{info.EndDate}</div>
                 </>
               ) : (
                 <>
                   <img src={FailSvg} alt="图标" className="paymodel-success-icon" />
-                  <span>畅读卡购买失败</span>
+                  <span>支付失败</span>
                 </>
               )}
             </div>
-            <div className="paymodel-text">有效期至:{info.EndDate}</div>
           </>
         )}
         {info.Source === 'activity' && (
           <>
             <div className="paymodel-title">
               {info.OrderStatus === EOrderStatus.Payed ? (
-                <>
+                <div>
                   <img src={SuccessSvg} alt="图标" className="paymodel-success-icon" />
-                  <span>支付成功</span>
-                </>
+                  <span>{info.IsPublicActivitie ? '畅读卡购买成功' : '支付成功'}</span>
+                  {info.IsPublicActivitie && <div className="paymodel-text">有效期至:{info.EndDate}</div>}
+                  <div className="paymodel-text">
+                    {info.IsSignUp ? '您已成功报名此活动' : '请到活动页面选择参会方式'}
+                  </div>
+                </div>
               ) : (
                 <>
                   <img src={FailSvg} alt="图标" className="paymodel-success-icon" />
@@ -70,7 +74,6 @@ const ApplyResult: React.FC<IApplyPermissionProps> = props => {
                 </>
               )}
             </div>
-            <div className="paymodel-text">请到活动页面选择参会方式</div>
           </>
         )}
       </div>

+ 103 - 8
src/Material/components/PayNoPermission.tsx

@@ -1,7 +1,7 @@
 import React, { useEffect, useState } from 'react'
 import useRequest from '@ahooksjs/use-request'
 
-import { Tooltip, message } from 'antd'
+import { Tooltip, message, Modal, Input } from 'antd'
 
 import NoPowerImg from 'assets/nopower.png'
 import BagImg from 'assets/bag.png'
@@ -11,7 +11,7 @@ import NButton from 'components/NButton/NButton'
 import { IArcticleInfo, MaterialService } from 'Material/Material.service'
 import { ITryType, INewPermissionType } from './NoPermission'
 import { PayType } from './BuyModel'
-import { IActivityTypeDetailRes } from 'Activity/Activity.service'
+import { IActivityTypeDetailRes, ActivityService, IActivityCheckRes } from 'Activity/Activity.service'
 import PayProcessModel from './PayProcessModel'
 import styles from '../css/NoPermission.module.scss'
 import { IColumnDetail } from 'Column/Column.service'
@@ -28,6 +28,9 @@ const PayNoPermission: React.FC<IPayNoPermissionProps> = props => {
   const [visibleBuyCard, setVisibleBuyCard] = useState(false) // 购买畅读卡弹框
   const payType = dataInfo.GoodsList.length > 1 ? PayType.Card : PayType.Single // 支付类型[1:畅销卡,2:单场活动
 
+  const [emailVisible, setEmailVisible] = useState<boolean>() // 含有邮箱填写的弹框
+  const [emailInput, setEmailInput] = useState<string>('') // 编写邮箱
+
   // 申请试用接口
   const { run: postApplyTry } = useRequest(MaterialService.postApplyTry, {
     manual: true,
@@ -35,10 +38,76 @@ const PayNoPermission: React.FC<IPayNoPermissionProps> = props => {
       res.data.Ret === 200 ? message.success('提交成功,请等待销售人员与您联系') : message.info(res.data.Msg)
     }
   })
+
+  // 活动报名之前的校验(权限、时间、点数、邮箱)
+  const { run: applyActivityCheck } = useRequest(ActivityService.postActivityCheck, {
+    manual: true,
+    formatResult: response => response.data.Data,
+    onSuccess: res => {
+      handleReturnGoOn(res)
+    }
+  })
+
+  // 邮箱的填写
+  const { run: bindingEmailUse } = useRequest(ActivityService.bindingEmail, {
+    manual: true,
+    formatResult: response => response.data.Data,
+    onSuccess: res => {
+      if (res.Ret !== 200) {
+        message.error(res.ErrMsg || res.Msg)
+      } else {
+        handleOnClose()
+        setVisibleBuyCard(true)
+      }
+    }
+  })
+
+  // 整理报名前的校验结果
+  const handleReturnGoOn = (res: IActivityCheckRes) => {
+    // 1.人数
+    if (!res.CheckSiginUpNum) {
+      Modal.warning({
+        title: '提示',
+        content: (
+          <div dangerouslySetInnerHTML={{ __html: '此活动报名人数已满,请留意下期活动' }} className="reset-pm" />
+        ),
+        okText: '知道了',
+        centered: true
+      })
+      return
+    }
+    // 2.时间
+    if (!res.CheckTime) {
+      Modal.warning({
+        title: '提示',
+        content: (
+          <div
+            dangerouslySetInnerHTML={{ __html: '该活动已截止报名 \n\n若想参加,请联系对口销售' }}
+            className="reset-pm"
+          />
+        ),
+        okText: '知道了',
+        centered: true
+      })
+      return
+    }
+    // 3.已有归属机构 ?
+    // if(!IsNeedBusinessCard){
+    // }
+
+    // 4.邮箱绑定
+    if (!res.CheckEmail) {
+      setEmailVisible(true)
+      return
+    }
+    // 都通过校验的话就打开畅读卡弹框
+    setVisibleBuyCard(true)
+  }
   // 点击购买畅读卡按钮
   const handleOpenBuyModel = () => {
-    // 打开畅读卡弹框
-    setVisibleBuyCard(true)
+    tryType === ITryType.Activity
+      ? applyActivityCheck((dataInfo as IActivityTypeDetailRes).Detail.ActivityId)
+      : setVisibleBuyCard(true)
   }
   // 申请试用
   const handleToAskTry = () => {
@@ -64,12 +133,41 @@ const PayNoPermission: React.FC<IPayNoPermissionProps> = props => {
     // HasPermission=7,弹表单填写,提交申请
     setVisibleApply(true)
   }
+  // 关闭弹框
+  const handleOnClose = () => {
+    setEmailInput('')
+    setEmailVisible(false)
+  }
+  // 邮箱填写
+  const handleChangeEmail = (e: React.ChangeEvent<HTMLInputElement>) => {
+    setEmailInput(e.target.value)
+  }
+  // 邮箱填写后报名
+  const handleApplySignUpWithEmail = () => {
+    if (!emailInput) return message.error('请输入邮箱地址')
+    // 研选扣点校验通过时需要弹框扣点提示
+    bindingEmailUse(emailInput)
+  }
+
   const parentMethod = () => {
+    setVisibleApply(false)
     // 关闭畅读卡弹框
     setVisibleBuyCard(false)
   }
   return (
     <>
+      {emailVisible ? (
+        <div onClick={e => e.stopPropagation()}>
+          <Modal title="提示" centered open={emailVisible} onOk={handleApplySignUpWithEmail} onCancel={handleOnClose}>
+            <div className="reset-pm">
+              <p>应上市公司要求,该会议报名需提供邮箱,请填写您的工作邮箱</p>
+              <p>
+                <Input type="text" placeholder="请输入正确的邮箱地址" value={emailInput} onChange={handleChangeEmail} />
+              </p>
+            </div>
+          </Modal>
+        </div>
+      ) : null}
       <div className={`${border ? styles['gray-boder-box'] : ''} ${styles['nopower-showwxpay-wrapper']} `}>
         {tryType !== ITryType.Activity ? <img src={NoPowerImg} alt="无权限" className="nopower-big-img" /> : null}
         <div className="nopower-content-wrapper">
@@ -120,10 +218,7 @@ const PayNoPermission: React.FC<IPayNoPermissionProps> = props => {
               ? '或者申请开通机构年度付费通道'
               : '或向销售申请开通机构试用权限'}
           </div>
-          {!(
-            (dataInfo as IActivityTypeDetailRes).Detail.IsResearchPoints ||
-            (dataInfo as IActivityTypeDetailRes).OrderCode
-          ) ? (
+          {!(dataInfo as IActivityTypeDetailRes).Detail.IsResearchPointsByUser ? (
             <>
               <NButton
                 type="default"

+ 1 - 2
src/Material/components/PayProcessModel.tsx

@@ -150,6 +150,7 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
   }
   // 关闭申请试用弹框
   const handleCloseApply = () => {
+    parentMethod && parentMethod()
     setVisibleApply(false)
   }
   // 点击购买畅读卡按钮
@@ -159,7 +160,6 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
   }
   // 点击支付
   const handleClickPay = (GoodsId: number) => {
-    console.log('GoodsId', GoodsId)
     setWantBuyGoodsId(GoodsId)
     // 判断是否需要上传名片
     if (dataInfo.IsNeedBusinessCard) {
@@ -215,7 +215,6 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
 
   // 订单支付结果
   const handleDoPayResult = (OrderRes: IOrderPayStatusRes) => {
-    console.log('OrderRes', OrderRes)
     setPayInfo(OrderRes)
     switch (OrderRes.OrderStatus) {
       case EOrderStatus.Cancel:

+ 1 - 1
src/Material/components/QRCodeModel.tsx

@@ -68,7 +68,7 @@ const QRCodeModel: React.FC<IQRCodeModelProps> = props => {
     >
       <div className={styles['paymodel-content-wrapper']}>
         <div className="paymodel-title">
-          <span>请用 </span>
+          <span>请使用 </span>
           <img src={WechartSvg} alt="图标" className="paymodel-wechat-icon" />
           <span className="paymodel-text-green"> 微信</span>
           <span> 扫描二维码完成支付</span>

+ 9 - 4
src/NewPageHeader.tsx

@@ -314,11 +314,16 @@ const NewPage: React.FC = props => {
                   <div className="person-power-wraper">
                     {login2p.userInfo?.HasPermission === INewPermissionType.OK ? (
                       <div className="person-haspower">
-                        <div className="person-haspower-label">{login2p.userInfo?.PermissionStatus}</div>
+                        {login2p.userInfo?.PermissionStatus && (
+                          <div className="person-haspower-label">{login2p.userInfo?.PermissionStatus}</div>
+                        )}
+
                         <div className="person-haspower-text">
-                          <div>
-                            {login2p.userInfo?.StartDate}~{login2p.userInfo?.EndDate}
-                          </div>
+                          {login2p.userInfo?.StartDate && login2p.userInfo?.EndDate && (
+                            <div>
+                              {login2p.userInfo?.StartDate}~{login2p.userInfo?.EndDate}
+                            </div>
+                          )}
                           {login2p.userInfo?.PermissionStatus.includes('试用') ? null : (
                             <div>
                               剩余研选点数:

+ 3 - 3
src/Personal/components/Order.component.tsx

@@ -92,9 +92,9 @@ const OrderComponent: React.FC = () => {
                   onClick={handleToDetail.bind(this, item)}
                 >
                   {orderType === 1
-                    ? item.OrderStatusText === '已取消'
-                      ? ''
-                      : `有效期:${item.StartDate}~${item.EndDate}`
+                    ? item.OrderStatus === 2
+                      ? `有效期:${item.StartDate}~${item.EndDate}`
+                      : ''
                     : item.SourceTitle}
                 </div>
                 <div className="order-bottom-line g-flex g-flex-between g-flex-v-center">