فهرست منبع

招聘会-门票购买

Xiao_123 1 ماه پیش
والد
کامیت
af60379194
8فایلهای تغییر یافته به همراه25 افزوده شده و 10 حذف شده
  1. 7 1
      components/payPopup/index.vue
  2. 7 6
      pages/index/jobFair.vue
  3. 0 1
      pagesB/jobFair/join.vue
  4. 1 1
      static/style/index.css
  5. 0 0
      static/style/index.min.css
  6. 2 1
      static/style/index.scss
  7. 7 0
      utils/index.js
  8. 1 0
      utils/request.js

+ 7 - 1
components/payPopup/index.vue

@@ -208,12 +208,15 @@ let interTimer = null
 let payLoading = false
 let payLoading = false
 const checkPayStatus = async (id) => {
 const checkPayStatus = async (id) => {
   if (!id) return
   if (!id) return
+  uni.showLoading({ title: '加载中' })
   try {
   try {
     if (payLoading || !interTimer) return
     if (payLoading || !interTimer) return
     payLoading = true
     payLoading = true
     const res = await getOrderPayStatus({ id })
     const res = await getOrderPayStatus({ id })
     if (res?.data?.status === 10) {
     if (res?.data?.status === 10) {
+      handleClose()
       if (interTimer) clearInterval(interTimer)
       if (interTimer) clearInterval(interTimer)
+      uni.hideLoading()
       uni.showToast({ title: '支付成功', icon: 'none'})
       uni.showToast({ title: '支付成功', icon: 'none'})
       setTimeout(async () => {
       setTimeout(async () => {
         emit('paySuccess')
         emit('paySuccess')
@@ -221,6 +224,9 @@ const checkPayStatus = async (id) => {
     }
     }
   } catch (error) {
   } catch (error) {
     console.log(error)
     console.log(error)
+    handleClose()
+    uni.hideLoading()
+    if (interTimer) clearInterval(interTimer)
   } finally {
   } finally {
     payLoading = false
     payLoading = false
   }
   }
@@ -259,7 +265,7 @@ const weChatMiniProgramPay = async (data) => {
     success: (res) => {
     success: (res) => {
       // 用户支付成功
       // 用户支付成功
       initIntervalFun()
       initIntervalFun()
-      handleClose()
+      // handleClose()
     },
     },
     fail: (err) => {
     fail: (err) => {
       if (err.errMsg === 'requestPayment:fail cancel') {
       if (err.errMsg === 'requestPayment:fail cancel') {

+ 7 - 6
pages/index/jobFair.vue

@@ -13,7 +13,7 @@
       </view>
       </view>
     </view>
     </view>
 
 
-    <payPopup ref="payRef" amount="123" @paySuccess="paySuccess"></payPopup>
+    <payPopup ref="payRef" :amount="FenYuanTransform(itemData?.admissionPrice || 0)" @paySuccess="paySuccess"></payPopup>
   </layout-page>
   </layout-page>
 </template>
 </template>
 
 
@@ -27,6 +27,7 @@ import { getJobFairList, checkJobFairPermission } from '@/api/jobFair'
 import { timesTampChange } from '@/utils/date'
 import { timesTampChange } from '@/utils/date'
 import { userStore } from '@/store/user'
 import { userStore } from '@/store/user'
 import payPopup from '@/components/payPopup'
 import payPopup from '@/components/payPopup'
+import { FenYuanTransform } from '@/utils'
 
 
 const useUserStore = userStore()
 const useUserStore = userStore()
 const items = ref([])
 const items = ref([])
@@ -63,15 +64,18 @@ const handleToJobFairEnterprises = async (val) => {
   if (!val?.id) {
   if (!val?.id) {
     uni.showToast({ title: '资源获取失败,请稍后重试', icon: 'none' })
     uni.showToast({ title: '资源获取失败,请稍后重试', icon: 'none' })
   }
   }
+  uni.showLoading({ title: '加载中' })
 
 
   try {
   try {
     const { data } = await checkJobFairPermission(val.id)
     const { data } = await checkJobFairPermission(val.id)
+    uni.hideLoading()
     if (data) {
     if (data) {
       uni.navigateTo({
       uni.navigateTo({
         url: '/pagesB/jobFair/details?id=' + val.id
         url: '/pagesB/jobFair/details?id=' + val.id
       })
       })
     }
     }
   } catch (error) {
   } catch (error) {
+    uni.hideLoading()
     // 权限被禁用
     // 权限被禁用
     if (error?.code === 1100056008) {
     if (error?.code === 1100056008) {
       uni.showToast({ title: error.msg, icon: 'none', duration: 2000 })
       uni.showToast({ title: error.msg, icon: 'none', duration: 2000 })
@@ -87,17 +91,14 @@ const handleToJobFairEnterprises = async (val) => {
       // 设置门票金额则提示购买门票
       // 设置门票金额则提示购买门票
       uni.showToast({ title: '您暂时无法参加该招聘会,请先购买门票', icon: 'none', duration: 2000 })
       uni.showToast({ title: '您暂时无法参加该招聘会,请先购买门票', icon: 'none', duration: 2000 })
 
 
-      payRef.value && payRef.value.handleOpen({ spuId: val?.id || '', spuName: val?.title || '', price: 0.1, type: 5 })
+      payRef.value && payRef.value.handleOpen({ spuId: val?.id || '', spuName: val?.title || '', price: val.admissionPrice, type: 5 })
     }
     }
   }
   }
 }
 }
 
 
 // 支付成功
 // 支付成功
 const paySuccess = () => {
 const paySuccess = () => {
-  uni.showToast({ title: '支付成功', icon: 'success' })
-  uni.navigateTo({
-    url: '/pagesB/jobFair/details?id=' + itemData.value.id
-  })
+  handleToJobFairEnterprises(itemData.value)
 }
 }
 </script>
 </script>
 
 

+ 0 - 1
pagesB/jobFair/join.vue

@@ -126,7 +126,6 @@ const handleJoin = async (item) => {
 		}, 1000)
 		}, 1000)
 	} catch (e) {
 	} catch (e) {
 		uni.hideLoading()
 		uni.hideLoading()
-		uni.showToast({ title: e.message })
 	}
 	}
 }
 }
 </script>
 </script>

+ 1 - 1
static/style/index.css

@@ -9045,7 +9045,7 @@
   position: fixed;
   position: fixed;
   bottom: 0;
   bottom: 0;
   left: 0;
   left: 0;
-  background-image: linear-gradient(rgba(255, 255, 255, 0.8), white);
+  background-color: #fff;
 }
 }
 
 
 .send-button {
 .send-button {

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
static/style/index.min.css


+ 2 - 1
static/style/index.scss

@@ -420,7 +420,8 @@
   position: fixed;
   position: fixed;
   bottom:0;
   bottom:0;
   left: 0;
   left: 0;
-  background-image:linear-gradient(rgba(255,255,255,0.8),white);
+  background-color: #fff;
+  // background-image:linear-gradient(rgba(255,255,255,0.8),white);
 }
 }
 // 主要页面大按钮用这个
 // 主要页面大按钮用这个
 .send-button {
 .send-button {

+ 7 - 0
utils/index.js

@@ -167,3 +167,10 @@ export const removeEmptyProperties = (obj) => {
     Object.entries(obj).filter(([key, value]) => value !== null && value !== undefined && value !== '' && (Array.isArray(value) ? value.length > 0 : true))
     Object.entries(obj).filter(([key, value]) => value !== null && value !== undefined && value !== '' && (Array.isArray(value) ? value.length > 0 : true))
   )
   )
 }
 }
+
+export const FenYuanTransform = (count, type='toYuan') => {
+  if ((count - 0) === 0) return 0
+  if (!count) return ''
+  const Magnification = type === 'toCent' ? 100 : 1/100 
+  return type === 'toCent' ? (count - 0)*Magnification : ((count - 0)*Magnification).toFixed(2)
+}

+ 1 - 0
utils/request.js

@@ -293,6 +293,7 @@ http.interceptors.response.use(
 				uni.showToast({
 				uni.showToast({
 					title: error.data?.msg || errorMessage,
 					title: error.data?.msg || errorMessage,
 					icon: 'none',
 					icon: 'none',
+					duration: 2000,
 					mask: true,
 					mask: true,
 				});
 				});
 			}
 			}

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است