瀏覽代碼

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

lifanagju_citu 4 月之前
父節點
當前提交
bd5d193387

+ 0 - 1
src/layout/enterprise.vue

@@ -55,7 +55,6 @@ const whiteList = [
 ]
 // 查询是否在白名单内,在则不展示面包屑
 const isInWhiteList = (url, whiteList)=> {
-  debugger
   const path = url.split('?')[0]
   for (const item of whiteList) {
     if (path.startsWith(item)) {

+ 8 - 8
src/router/modules/components/recruit/personCenter.js

@@ -171,14 +171,14 @@ const personCenter = [
               //     enName: 'Account binding'
               //   }
               // },
-              {
-                path: '/recruit/personal/personalCenter/accountSettings/realAuthentication',
-                component: () => import('@/views/recruit/personal/PersonalCenter/accountSettings/realAuthentication'),
-                meta: {
-                  title: '实名认证',
-                  enName: 'Real name authentication'
-                }
-              }
+              // {
+              //   path: '/recruit/personal/personalCenter/accountSettings/realAuthentication',
+              //   component: () => import('@/views/recruit/personal/PersonalCenter/accountSettings/realAuthentication'),
+              //   meta: {
+              //     title: '实名认证',
+              //     enName: 'Real name authentication'
+              //   }
+              // }
               // {
               //   path: '/recruit/personal/personalCenter/accountSettings/privacySettings',
               //   component: () => import('@/views/recruit/personal/PersonalCenter/accountSettings/privacySettings'),

+ 2 - 5
src/views/mall/components/confirm_order/confirm.vue

@@ -102,7 +102,7 @@
   })
 
   const goodsType = ref(0)
-  const email = ref('') // 如果商品spu的type不是0(不是普通商品)则要填这个邮箱
+  const email = ref('1687284007@qq.com') // 如果商品spu的type不是0(不是普通商品)则要填这个邮箱
 
   const state = reactive({
     orderPayload: {},
@@ -233,10 +233,7 @@
     const data = await createOrder(query)
     if (!data.payOrderId && data.payOrderId > 0) return
     // 更新购物车列表,如果来自购物车
-    emit('orderCreated', {
-      payOrderId: data.payOrderId,
-      orderId: data.id
-    })
+    emit('orderCreated', data.payOrderId, data.id)
     // payImmediately(data.payOrderId)
   }
 

+ 8 - 10
src/views/mall/components/confirm_order/index.vue

@@ -37,10 +37,8 @@ import { luckTargetCreate } from '@/api/mall/prize'
 const { t } = useI18n()
 
 const route = useRoute()
-const { spuId } = route.query
+const { spuId, skuId } = route.query
 const skuInfo = ref(localStorage.getItem('confirm_order_data')) // 购买商品规格信息
-debugger
-
 const confirmRef = ref()
 // onMounted(() => {
 //   confirmRef.value.onConfirm()
@@ -54,13 +52,13 @@ const onBuy = () => {
 }
 
 // 创建用户期望奖品所在城市记录
-const setTargetData = async () => {
+const setTargetData = async (orderId) => {
   try {
     await luckTargetCreate({
-      orderId: orderId.value,
+      orderId,
       spuId,
-      skuId: orderId.value,
-      target:skuInfo.value.city,
+      skuId,
+      target: JSON.parse(skuInfo.value).city,
     })
   } catch (error) {
     console.log(error)
@@ -72,11 +70,11 @@ const payRef = ref()
 const showPay = ref(false)
 const payOrderId = ref('')
 const orderId = ref('')
-const orderCreated = ({id, orderId}) => {
+const orderCreated = ( id, value ) => {
   payOrderId.value = id
-  orderId.value = orderId
+  orderId.value = value
+  if (JSON.parse(skuInfo.value).city?.length) setTargetData(value)
   showPay.value = true
-  if (skuInfo.value?.city?.length) setTargetData()
 }
 const confirmWord = ref('立即支付') // '立即购买' : '立即支付'
 

+ 3 - 2
src/views/mall/components/details.vue

@@ -178,14 +178,15 @@ const onBuy = async (e) => {
         skuId: e.id,
         count: e.goods_num,
         categoryId: state.goodsInfo.categoryId,
-      },
+      }
     ],
+    city: e.city,
     goodsType: state.goodsInfo?.type || 0,
   })
 
   localStorage.setItem('confirm_order_data', data)
   nextTick(() => {
-    router.push({path: '/mall/confirm_order', query: { price: e.price, spuId: id }})
+    router.push({path: '/mall/confirm_order', query: { price: e.price, spuId: id, skuId: e.id }})
   })
 }
 

+ 5 - 4
src/views/mall/components/details/s-select-sku.vue

@@ -177,7 +177,8 @@
       Snackbar.warning('库存不足')
       return;
     }
-    emits('buy', { ...state.selectedSku, city: choose.value });
+    if (isGetPrize.value && !choose.value?.length) return Snackbar.warning('请勾选期望获赠房券的所在地!')
+    emits('buy', { ...state.selectedSku, city: isGetPrize.value ? choose.value : [] });
   }
 
   // 改变禁用状态:计算每个 property 属性值的按钮,是否禁用
@@ -326,7 +327,7 @@
 
   const choose = ref([])
   const noCity = ref(false)
-  // const getPrizeLoading = ref(false)
+  const getPrizeLoading = ref(false)
   const prizeAreaList = ref([])
   // 根据商品id活动对应的奖品区域信息
   const getAreaData = async () => {
@@ -336,7 +337,7 @@
       spuId: id,
       type: 'city',
     }
-    // getPrizeLoading.value = true
+    getPrizeLoading.value = true
     const data = await getPrizeAreaByGoodsId(params)
     if (!data || !Object.keys(data).length) {
       noCity.value = true
@@ -353,7 +354,7 @@
       }
     })
     prizeAreaList.value = [...new Set(list)]
-    // getPrizeLoading.value = false
+    getPrizeLoading.value = false
   }
 
   const isGetPrizeChange = (bool) => {