Jelajahi Sumber

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

lifanagju_citu 4 bulan lalu
induk
melakukan
699511d24b

+ 3 - 0
components.d.ts

@@ -72,4 +72,7 @@ declare module 'vue' {
     VerifySlide: typeof import('./src/components/Verifition/Verify/VerifySlide.vue')['default']
     WangEditor: typeof import('./src/components/FormUI/wangEditor/index.vue')['default']
   }
+  export interface ComponentCustomProperties {
+    vLoading: typeof import('element-plus/es')['ElLoadingDirective']
+  }
 }

+ 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()
     }

+ 9 - 11
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)
       }
@@ -130,7 +130,7 @@ service.interceptors.request.use(
         appId: 'web_client',
         AppSecret: 'fa0fc0b5098b974b',
         // timestamp: 1735282548997,
-        timestamp: process?.env?.NODE_ENV === 'production' ? systemInfo.beijingTimestamp : new Date().getTime(),
+        timestamp: import.meta.env.VITE_USER_NODE_ENV === 'production' ? systemInfo.beijingTimestamp : new Date().getTime(),
       })
       const content = {
         data: config.data,
@@ -272,20 +272,18 @@ service.interceptors.response.use(
       // 未注册过的手机号将code码返回
       return Promise.reject(data)
     }
-    if (code !== 200) {
-      const _index = errorData.findIndex(e => e.url === config.url && e.time === +config.headers.timestamp)
-      if (_index > -1) {
-        const _item = errorData.splice(_index, 1)
-        // 保存错误信息
+    const _index = errorData.findIndex(e => e.url === config.url && e.time === +config.headers.timestamp)
+    if (_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)
     }
-    const _index = errorData.findIndex(e => e.url === config.url && e.time === +config.headers.timestamp)
-    if (_index > -1) {
-      errorData.splice(_index, 1)
-    }
     // 请求成功后触发获取积分
     if (response.config.headers?.Authorization) {
       const url = getSuffixAfterPrefix(response.config.url)

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

@@ -68,12 +68,15 @@
       </div>
     </v-card>
   </div>
+  
   <!-- 快速登录 -->
   <loginPage v-if="showLogin" @loginSuccess="loginSuccess" @close="loginClose"></loginPage>
+
   <!-- 结算 -->
   <CtDialog :visible="showSettlement" titleClass="text-h6" :widthType="3" title="订单信息" @submit="handleSubmit" @close="handleClose">
     <confirm ref="confirmRef" :data="skuInfo" @orderCreated="orderCreated"></confirm>
   </CtDialog>
+  
   <!-- 支付 -->
   <CtDialog :visible="showPay" titleClass="text-h6" :widthType="3" title="收银台" :footer="false" @close="payCancel">
     <pay ref="payRef" :id="payOrderId" @paySuccess="paySuccess"></pay>

+ 1 - 1
src/views/mall/components/details/order/addressSelection.vue

@@ -28,7 +28,7 @@
         </div>
       </div>
     </v-card>
-    <CtDialog :visible="selectAddress" titleClass="text-h6" :footer="true" :widthType="1" title="修改收货地址" @submit="handleSubmit" @close="selectAddress = false">
+    <CtDialog :visible="selectAddress" titleClass="text-h6" :footer="true" :widthType="1" title="选择收货地址" @submit="handleSubmit" @close="selectAddress = false">
       <div style="min-height: 60vh;">
         <addressPage ref="addressPageRef" showSelect></addressPage>
       </div>

+ 13 - 2
src/views/mall/components/prizeDraw.vue

@@ -15,6 +15,17 @@
       @end="endCallback"
     />
     <div class="numberBox mt-5">您还剩余<span class="colorBase">{{ number }}</span>次抽奖机会</div>
+
+    <CtDialog :visible="showDialog" titleClass="text-h6" :footer="false" :widthType="3" title="抽奖详情" @close="showDialog = false">
+      <div class="d-flex align-center flex-column">
+        <svg-icon name="submit" size="300"></svg-icon>
+        恭喜您获得三亚五日游
+        <div class="my-10">
+          <v-btn color="primary" variant="outlined" width="120">取 消</v-btn>
+          <v-btn color="primary" width="120" class="ml-5">领 取</v-btn>
+        </div>
+      </div>
+    </CtDialog>
   </div>
 </template>
 
@@ -30,8 +41,6 @@ import { ref } from 'vue'
 //   }
 // })
 
-// const blocksImg1 = { src: 'https://img1.baidu.com/it/u=681765036,1809656907&fm=253&fmt=auto&app=138&f=JPEG?w=400&h=400', width: '100%', height: '100%' }
-
 const myLucky = ref()
 const blocks = [
   // { padding: '10px', background: '#fff', imgs:[] },
@@ -83,8 +92,10 @@ const startCallback = () => {
   }, 1500)
 }
 
+const showDialog = ref(false)
 const endCallback  = (prize) => {
   console.log(prize, 'end')
+  showDialog.value = true
   getData()
 }
 

+ 9 - 1
src/views/mall/home/components/carousel.vue

@@ -10,8 +10,16 @@
       </v-img> -->
 
       <!-- <figure> -->
-        <img :src="item.imgUrl" :lazy-src="item.imgUrl" style="width: 100%;" />
+        <!-- <img :src="item.imgUrl" :lazy-src="item.imgUrl" style="width: 100%;" /> -->
       <!-- </figure> -->
+      
+      <v-img :src="item.imgUrl" :lazy-src="item.imgUrl" style="width: 100%">
+        <template v-slot:placeholder>
+          <v-row align="center" class="fill-height ma-0" justify="center">
+            <v-progress-circular color="grey-lighten-5" indeterminate></v-progress-circular>
+          </v-row>
+        </template>
+      </v-img>
     </v-carousel-item>
   </v-carousel>
 </template>

+ 65 - 17
src/views/mall/user/prize/index.vue

@@ -11,15 +11,35 @@
 		:page-info="queryParams"
     itemKey="id"
   >
+    <template #prize="{ item }">
+      <div class="d-flex align-center my-1">
+        <v-img :src="item.prize.image" width="80px" height="80px"></v-img>
+        <div class="ml-1">{{ item.prize.name }}</div>
+      </div>
+    </template>
+    <template #deliverInfo="{ item }">
+      {{ item.record.deliverInfo ? JSON.parse(item.record.deliverInfo).name + '-' + JSON.parse(item.record.deliverInfo).no  : ''}}
+    </template>
+    <template #receiveInfo="{ item }">
+      {{ item.record.receiveInfo ? JSON.parse(item.record.receiveInfo).name + ',' + JSON.parse(item.record.receiveInfo).phone + ',' + JSON.parse(item.record.receiveInfo).address : ''}}
+    </template>
     <template #actions="{ item }">
-      <v-btn color="primary" @click.stop="handleSelectAddress(item)" variant="text">选择收货地址</v-btn>
+      <v-btn v-if="item.record.isReceive && !item.record.receiveInfo" color="primary" @click.stop="handleSelectAddress(item)" variant="text">选择收货地址</v-btn>
     </template>
   </CtTable>
+
+  <CtDialog :visible="showDialog" titleClass="text-h6" :footer="true" :widthType="1" title="选择收货地址" @submit="handleSubmit" @close="showDialog = false">
+    <div style="min-height: 60vh;">
+      <SelectAddress ref="selectAddressRef" showSelect></SelectAddress>
+    </div>
+  </CtDialog>
 </template>
 
 <script setup>
 defineOptions({ name: 'mall-user-prize-index' })
 import { ref } from 'vue'
+import SelectAddress from '@/views/mall/user/address'
+import Snackbar from '@/plugins/snackbar'
 
 const queryParams = ref({
 	pageNo: 1,
@@ -27,29 +47,57 @@ const queryParams = ref({
 })
 const items = ref([
 	{
-		lotteryName: '抽奖活动1',
-		name: '奖品1',
-		address: '收货地址1',
-		phone: '联系电话1',
+		record: {
+      createTime: 1735128516469,
+      isReceive: true,
+      deliverInfo: "{\"no\":\"SF112056000216589\",\"name\":\"顺丰速运\"}",
+      receiveInfo: '{"name":"张三","phone":"13800138000","address":"北京市海淀区上地十街10号百度大厦"}',
+    },
+    prize: {
+      name: '三亚酒店房券',
+      image: 'https://menduner.citupro.com:3443/dev/e13f9b76b26907f35d0ccf7e7f3e88f89a725429172e0b56ceb88362bc9032e6.jpg'
+    },
+    lottery: {
+      name: '房券抽奖活动'
+    }
 	},
-	{
-		lotteryName: '抽奖活动2',
-		name: '奖品2',
-		address: '收货地址2',
-		phone: '联系电话2',
+  {
+		record: {
+      createTime: 1735128516469,
+      isReceive: true,
+      deliverInfo: '',
+      receiveInfo: ''
+    },
+    prize: {
+      name: '三亚酒店房券',
+      image: 'https://menduner.citupro.com:3443/dev/e13f9b76b26907f35d0ccf7e7f3e88f89a725429172e0b56ceb88362bc9032e6.jpg'
+    },
+    lottery: {
+      name: '房券抽奖活动'
+    }
 	}
 ])
+
 const headers = [
-  { title: '活动名称', key: 'lotteryName', sortable: false },
-  { title: '奖品信息', key: 'name', sortable: false },
-  { title: '收货地址', key: 'address', sortable: false },
-  { title: '联系电话', key: 'phone', sortable: false },
-  { title: '快递信息', key: 'deliveryInfo', sortable: false },
+  { title: '活动名称', key: 'lottery.name', sortable: false },
+  { title: '奖品信息', key: 'prize', sortable: false },
+  { title: '是否领取', key: 'isReceive', sortable: false, value: item => item.record.isReceive ? '是' : '否' },
+  { title: '收货信息', key: 'receiveInfo', sortable: false },
+  { title: '快递信息', key: 'deliverInfo', sortable: false },
   { title: '操作', key: 'actions', sortable: false }
 ]
 
-const handleSelectAddress = (item) => {
-	console.log(item, 'select')
+// 设置收货地址
+const selectAddressRef = ref()
+const showDialog = ref(false)
+const handleSelectAddress = () => {
+  showDialog.value = true
+}
+
+const handleSubmit = async () => {
+  const receive = selectAddressRef.value.getSelected() || {}
+  if (!receive || !Object.keys(receive).length) return Snackbar.warning('请选择您的收货地址')
+  console.log(receive, '收货地址')
 }
 </script>