Forráskód Böngészése

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

Xiao_123 4 hónapja
szülő
commit
42874730c9

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 635 - 18
pnpm-lock.yaml


+ 1 - 2
src/App.vue

@@ -17,8 +17,7 @@ function open () {
 }
 onMounted(() => {
   nextTick(() => {
-    // console.log('baseurl:', import.meta.env?.VITE_BASE_URL, 'vue_version:', vue_version) // 打印
-    const process_ENV = process?.env?.NODE_ENV || ''
+    const process_ENV = import.meta.env.VITE_USER_NODE_ENV || ''
     if (process_ENV === 'production') {
       open()
     }

+ 27 - 24
src/config/axios/service.js

@@ -119,7 +119,7 @@ service.interceptors.request.use(
        * params: { data, params, raw }
        * content
        */
-      if (process?.env?.NODE_ENV === 'production' && systemInfo.beijingTimestamp === 0) {
+      if (import.meta.env.VITE_USER_NODE_ENV === 'production' && systemInfo.beijingTimestamp === 0) {
         const _timestamp = await getBeijingTimestamp()
         setBeijingTimestamp(_timestamp)
       }
@@ -129,7 +129,8 @@ service.interceptors.request.use(
         body,
         appId: 'web_client',
         AppSecret: 'fa0fc0b5098b974b',
-        timestamp: process?.env?.NODE_ENV === 'production' ? systemInfo.beijingTimestamp : new Date().getTime(),
+        // timestamp: 1735282548997,
+        timestamp: import.meta.env.VITE_USER_NODE_ENV === 'production' ? systemInfo.beijingTimestamp : new Date().getTime(),
       })
       const content = {
         data: config.data,
@@ -200,11 +201,11 @@ service.interceptors.response.use(
     const code = data.code || result_code
     // 获取错误信息
     const msg = data.msg || errorCode[code] || errorCode['default']
-    const _index = errorData.findIndex(e => e.url === config.url && e.time === +config.headers.timestamp)
-    if (ignoreMsgs.indexOf(msg) !== -1) {
+    if (ignoreMsgs.indexOf(msg) > -1) {
       // 如果是忽略的错误码,直接返回 msg 异常
       return Promise.reject(msg)
-    } else if (code === 401) {
+    }
+    if (code === 401) {
       // 如果未认证,并且未进行刷新令牌,说明可能是访问令牌过期了
       // token类型
       const tokenIndex = config.tokenIndex ? config.tokenIndex : getIsEnterprise() ? 1 : 2
@@ -253,33 +254,35 @@ service.interceptors.response.use(
           })
         })
       }
-    } else if (code === 500) {
+    }
+    if (code === 500) {
       Snackbar.error(t('sys.api.errMsg500'))
       return Promise.reject(new Error(msg))
-    } else if (code === 900 && msg === '重复请求,请稍后重试') {
+    }
+    if (code === 900 && msg === '重复请求,请稍后重试') {
       console.error('前台打印: 重复请求,请稍后重试')
       return Promise.reject(new Error(msg))
-    } else if (code === 901) {
+    }
+    if (code === 901) {
       Snackbar.error(t('sys.api.errMsg901'))
       return Promise.reject(new Error(msg))
-    } else if (code !== 200) {
-      if ([1100017019, 1100016002, 1100021016, 1100017022].includes(code)) {
-        // 1100017019邮箱未注册、1100016002手机号未注册过、1100021016注册企业申请中
-        // 未注册过的手机号将code码返回
-        return Promise.reject(data)
-      } else {
-        if (_index > -1) {
-          // 保存错误信息
-          sendError({ content: JSON.stringify(errorData[_index].content), mark: errorData[_index].time + '' })
-          // 移除
-          errorData.splice(_index, 1)
-        }
-        Snackbar.error(msg)
-      }
-      return Promise.reject(msg)
     }
+    if ([1100017019, 1100016002, 1100021016, 1100017022].includes(code)) {
+      // 1100017019邮箱未注册、1100016002手机号未注册过、1100021016注册企业申请中
+      // 未注册过的手机号将code码返回
+      return Promise.reject(data)
+    }
+    const _index = errorData.findIndex(e => e.url === config.url && e.time === +config.headers.timestamp)
     if (_index > -1) {
-      errorData.splice(_index, 1)
+      const _item = errorData.splice(_index, 1)
+      // 保存错误信息
+      if (code === 400) {
+        sendError({ content: JSON.stringify(_item.content), mark: _item.time + '' })
+      }
+    }
+    if (code !== 200) {
+      Snackbar.error(msg)
+      return Promise.reject(msg)
     }
     // 请求成功后触发获取积分
     if (response.config.headers?.Authorization) {

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

@@ -59,10 +59,12 @@
           <v-tabs v-model="describeTab" align-tabs="start" color="primary" bg-color="#f7f8fa" @update:model-value="null">
             <v-tab :value="0">商品介绍</v-tab>
             <v-tab :value="1">商品评价</v-tab>
+            <v-tab :value="2" v-if="(id-0)=== 648">房券抽奖活动</v-tab>
           </v-tabs>
         </div>
         <describe v-if="describeTab === 0 && state.goodsInfo?.description" :content="state.goodsInfo.description"></describe>
-        <comment v-if="describeTab === 1 && state.goodsId" class="detail-comment-selector" :goodsId="state.goodsId" />
+        <commentCard v-if="describeTab === 1 && state.goodsId" class="detail-comment-selector" :goodsId="state.goodsId" />
+        <prizeDrawContent v-if="describeTab === 2" />
       </div>
     </v-card>
   </div>
@@ -87,7 +89,8 @@ import { getProductDetail } from '@/api/mall/product'
 import { addCart } from '@/api/mall/cart'
 import selectSku from './details/s-select-sku.vue'
 import describe from './details/describe.vue'
-import comment from './details/detail-comment-card.vue'
+import commentCard from './details/detail-comment-card.vue'
+import prizeDrawContent from './details/prizeDrawContent.vue'
 import confirm from './details/order/confirm.vue'
 import { ref, reactive } from 'vue'
 import { useRouter } from 'vue-router'

+ 22 - 0
src/views/mall/components/details/prizeDrawContent.vue

@@ -0,0 +1,22 @@
+<!--  -->
+<template>
+  <div class=" px-15">
+    <div style="font-size: 28px;" class="my-5">房券列表:</div>
+    <div v-for="(item, index) of list" :key="index" class="mb-5">
+      <v-img :src="item" style="border-radius: 8px;"></v-img>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+
+defineOptions({name: 'GoodsItem-prizeDrawContent'})
+
+const list = ref([
+  'https://img1.baidu.com/it/u=2343227867,4040084608&fm=253&fmt=auto&app=138&f=JPEG?w=499&h=248',
+  'https://img1.baidu.com/it/u=2343227867,4040084608&fm=253&fmt=auto&app=138&f=JPEG?w=499&h=248',
+])
+</script>
+<style lang="scss" scoped>
+</style>

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott