bding пре 6 месеци
родитељ
комит
c9aafb2fbe

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

@@ -243,6 +243,8 @@ export interface IActivitySignupRes {
   IsResearchSpecial: boolean // 是否属于特殊的研选
 }
 export interface IActivityCheckRes {
+  GoodsList: IGoodsListItem[]
+  IsShowWxPay: boolean // 是否展示微信支付
   CheckPermission: boolean //权限是否通过校验
   HasPermission: number
   PopupMsg: string //权限弹窗信息

+ 2 - 2
src/Activity/components/ActivityBtn.component.tsx

@@ -718,13 +718,13 @@ const ActivityBtnComponent: React.FC<IActivityBtnComponent> = props => {
     // 3.研选扣点
     if (!res.CheckPoints) {
       // todo 如果需要付费 需要判断一下(需要加字段,是否需要支付,提示文案里的价格需要替换)
-      if (true) {
+      if (res.IsShowWxPay) {
         Modal.warning({
           title: '提示',
           content: (
             <div className="reset-pm">
               <p>
-                <span>点数不足,您可以通过单场付费 ¥1299 参与或者联系销售机构充值</span>
+                <span>点数不足,您可以通过单场付费 ¥{res.GoodsList[0].CurrentPrice} 参与或者联系销售机构充值</span>
               </p>
               <div>
                 当前剩余点数:<span className={styles['link-text']}>{res.CompanyPoints}</span>

+ 13 - 4
src/Material/Material.service.ts

@@ -197,6 +197,7 @@ export interface IBusinessCardParams {
 export interface IOrderInfoRes {
   CodeUrl: string //二维码参数链接
   OrderCode: string //订单编号rl
+  PayTimeCountdown: number //订单倒计时
 }
 export interface IOrderPayStatusRes {
   OrderCode: string //订单编号
@@ -333,16 +334,24 @@ export const MaterialService = {
       method: 'post',
       data: { ...params }
     }),
-  postCreateOrderByArticle: (GoodsId: number, SourceId: number): INewResponse<IOrderInfoRes> =>
+  postCreateOrderByArticle: (
+    GoodsId: number,
+    SourceId: number,
+    InviteShareCode: string | null
+  ): INewResponse<IOrderInfoRes> =>
     NewAxiosInstanceFunc({
       url: `/order/addByArticle`,
       method: 'post',
-      data: { GoodsId, SourceId }
+      data: { GoodsId, SourceId, InviteShareCode }
     }),
-  postCreateOrderByActivity: (GoodsId: number, SourceId: number): INewResponse<IOrderInfoRes> =>
+  postCreateOrderByActivity: (
+    GoodsId: number,
+    SourceId: number,
+    InviteShareCode: string | null
+  ): INewResponse<IOrderInfoRes> =>
     NewAxiosInstanceFunc({
       url: `/order/addByActivity`,
       method: 'post',
-      data: { GoodsId, SourceId }
+      data: { GoodsId, SourceId, InviteShareCode }
     })
 }

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

@@ -31,7 +31,7 @@ const BuyModel: React.FC<IBuyModelProps> = props => {
   const [isRead, setIsRead] = useState<boolean>(false) // 我已阅读并同意
 
   const handleBackClose = () => {
-    setBuyItem(null)
+    // setBuyItem(null)
     setIsRead(false)
     onCloseModel()
   }

+ 5 - 1
src/Material/components/PayNoPermission.tsx

@@ -64,7 +64,10 @@ const PayNoPermission: React.FC<IPayNoPermissionProps> = props => {
     // HasPermission=7,弹表单填写,提交申请
     setVisibleApply(true)
   }
-
+  const parentMethod = () => {
+    // 关闭畅读卡弹框
+    setVisibleBuyCard(false)
+  }
   return (
     <>
       <div className={`${border ? styles['gray-boder-box'] : ''} ${styles['nopower-showwxpay-wrapper']} `}>
@@ -171,6 +174,7 @@ const PayNoPermission: React.FC<IPayNoPermissionProps> = props => {
         open={visibleBuyCard}
         applyTrial={visibleApply}
         onRefresh={onRefresh}
+        parentMethod={parentMethod}
       />
     </>
   )

+ 29 - 7
src/Material/components/PayProcessModel.tsx

@@ -21,10 +21,11 @@ interface IPayProcessModelProps {
   continuePayFlag?: boolean // 继续支付
   countDownRender?: React.ReactNode
   onRefresh?: () => void // 刷新页面
+  parentMethod?: () => void
 }
 /**支付流程汇总弹框 */
 const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
-  const { dataInfo, tryType, open, applyTrial, continuePayFlag, countDownRender, onRefresh } = props
+  const { dataInfo, tryType, open, applyTrial, continuePayFlag, countDownRender, parentMethod, onRefresh } = props
   const [visibleApply, setVisibleApply] = useState(false) // 普通申请权限弹框
   const [visibleUpload, setVisibleUpload] = useState(false) // 机构申请试用弹框
   const [visibleBuyCard, setVisibleBuyCard] = useState(false) // 购买畅读卡弹框
@@ -77,7 +78,11 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
     if (tryType === ITryType.Activity && payType === PayType.Single && continuePayFlag) {
       // 继续支付(现在只有活动有继续支付的需求)
       // todo 二维码的倒计时,需要后端返回订单剩余支付时间
-      postCreateOrderByActivity(dataInfo.GoodsList[0]?.GoodsId, (dataInfo as IActivityTypeDetailRes).Detail.ActivityId)
+      postCreateOrderByActivity(
+        dataInfo.GoodsList[0]?.GoodsId,
+        (dataInfo as IActivityTypeDetailRes).Detail.ActivityId,
+        sessionStorage.getItem('invite_code')
+      )
     }
   }, [open, applyTrial, continuePayFlag])
   // 关闭支付结果弹框
@@ -96,6 +101,7 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
   }
   // 关闭购买畅读卡弹框
   const handleCloseBuy = () => {
+    parentMethod && parentMethod()
     setVisibleBuyCard(false)
   }
   // 上传名片成功后,关闭上传名片弹框,并请求创建订单接口
@@ -103,10 +109,18 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
     handleCloseUpload()
     // 调接口获取支付二维码
     if (tryType === ITryType.Article) {
-      postCreateOrderByArticle(wantBuyGoodsId, (dataInfo as IArcticleInfo).Detail.ArticleId)
+      postCreateOrderByArticle(
+        wantBuyGoodsId,
+        (dataInfo as IArcticleInfo).Detail.ArticleId,
+        sessionStorage.getItem('invite_code')
+      )
     }
     if (tryType === ITryType.Activity) {
-      postCreateOrderByActivity(wantBuyGoodsId, (dataInfo as IActivityTypeDetailRes).Detail.ActivityId)
+      postCreateOrderByActivity(
+        wantBuyGoodsId,
+        (dataInfo as IActivityTypeDetailRes).Detail.ActivityId,
+        sessionStorage.getItem('invite_code')
+      )
     }
   }
   // 关闭上传名片弹框
@@ -133,10 +147,18 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
     }
     // 调接口获取支付二维码
     if (tryType === ITryType.Article) {
-      postCreateOrderByArticle(GoodsId, (dataInfo as IArcticleInfo).Detail.ArticleId)
+      postCreateOrderByArticle(
+        GoodsId,
+        (dataInfo as IArcticleInfo).Detail.ArticleId,
+        sessionStorage.getItem('invite_code')
+      )
     }
     if (tryType === ITryType.Activity) {
-      postCreateOrderByActivity(GoodsId, (dataInfo as IActivityTypeDetailRes).Detail.ActivityId)
+      postCreateOrderByActivity(
+        GoodsId,
+        (dataInfo as IActivityTypeDetailRes).Detail.ActivityId,
+        sessionStorage.getItem('invite_code')
+      )
     }
     setVisibleBuyCard(false)
   }
@@ -197,7 +219,7 @@ const PayProcessModel: React.FC<IPayProcessModelProps> = props => {
         visible={visibleOrderCode}
         codeUrl={articleOrderInfo?.Data.CodeUrl || activityOrderInfo?.Data.CodeUrl || ''}
         orderCode={articleOrderInfo?.Data.OrderCode || activityOrderInfo?.Data.OrderCode || ''}
-        // countDown={todo} 需要后端返回订单剩余支付时间
+        countDown={articleOrderInfo?.Data.PayTimeCountdown || activityOrderInfo?.Data.PayTimeCountdown}
         onCloseModel={handleCloseCode}
         onSendPayResult={handleDoPayResult}
       />

+ 1 - 0
src/Personal/Personal.service.ts

@@ -147,6 +147,7 @@ export interface IBodySlice {
   Body: string //内容
 }
 export interface IOrderListItem {
+  LabelKeyword: string //标签关键词
   CreateTime: string //创建时间
   EndDate: string //结束日期
   LabelKeywordImgLink: string //标签关键词ico

+ 1 - 4
src/Personal/components/Order.component.tsx

@@ -84,10 +84,7 @@ const OrderComponent: React.FC = () => {
             renderItem={(item: IOrderListItem) => (
               <div className={styles['order-list-item']}>
                 <div className="order-item-title g-flex g-flex-between g-flex-v-center">
-                  <div className="order-name">
-                    {/* todo 这里后端返回文字,替换 */}
-                    {orderType === 1 ? '畅读卡' : '单场付费订单'}
-                  </div>
+                  <div className="order-name">{item.LabelKeyword}</div>
                   <div className="order-status">{item.OrderStatusText}</div>
                 </div>
                 <div