瀏覽代碼

积分商城独立出来

lifanagju_citu 10 月之前
父節點
當前提交
c29ad9e67d

+ 41 - 0
src/views/mall/components/table.vue

@@ -0,0 +1,41 @@
+<template>
+  <v-data-table
+    class="mt-3"
+    v-model="selected"
+    :items="items"
+    :headers="headers"
+    hover
+    height="60vh"
+    item-value="id"
+  >
+    <template #bottom></template>
+  </v-data-table>
+</template>
+
+<script setup>
+defineOptions({ name: 'myRegistration-integralTable'})
+import { ref } from 'vue'
+defineProps({
+  tab: String,
+  items: Array
+})
+
+
+const selected = ref([])
+const headers = [
+  { title: '兑换物品', key: '兑换物品' },
+  { title: '兑换时间', key: '兑换时间' },
+  { title: '消耗积分', key: '消耗积分' },
+]
+
+</script>
+
+<style scoped lang="scss">
+:deep(.v-table > .v-table__wrapper > table > thead) {
+  background-color: #f7f8fa !important;
+}
+:deep(.v-selection-control__input) {
+  // color: var(--v-primary-base) !important;
+  color: #767778;
+}
+</style>

+ 109 - 0
src/views/mall/exchange.vue

@@ -0,0 +1,109 @@
+<!-- 积分兑换 -->
+<template>
+  <div class="listBox">
+    <div v-for="(item, index) in dataList" :key="'exchange' + index">
+      <div class="cursor-pointer mx-5 mb-4" style="width: 180px;" @click="handleShowDetail(item)">
+        <v-img width="180" height="180" :src="item.图片 || 'https://minio.citupro.com/dev/menduner/7.png'"></v-img>
+        <div class="ellipsis mt-2" style="font-size: 14px;">{{ item.物品名称 }}</div>
+        <div class="ellipsis mt-1" style="font-size: 13px;">消耗积分<span class="ml-1" style="color: var(--v-primary-base)">{{ item.消耗积分 }}</span></div>
+      </div>
+    </div>
+  </div>
+  <Dialog :visible="showDetail" titleClass="text-h6" :widthType="3" title="详情说明" @submit="handleSubmit" @close="showDetail = false">
+    <div>
+      <!-- <span style="font-size: 15px;">物品名称:</span> -->
+      <span style="font-size: 14px;color: red;">{{ detailItem.物品名称 }}</span>
+    </div>
+    <div class="tips">
+      <div>使用规则:</div>
+      <span>兑换时,优先使用即将到期积分进行兑换</span>
+      <div>使用时间:</div>
+      <span>使用时间为当前招聘通期限内都可以使用, 超出当前招聘通期限不可以使用</span>
+      <div>使用说明:</div>
+      <span>积分一经兑换概不退回,敬请谅解。</span>
+    </div>
+    <div class="d-flex align-center my-5">
+      <div class="mr-5">兑换数量</div>
+      <textUI class="mr-5" v-model="num" :item="textItem" @change="handleChange"></textUI>
+      <div class="mr-1">消耗积分</div>
+      <div style="color: var(--v-primary-base);">{{ (detailItem.消耗积分- 0)*num }}</div>
+    </div>
+    <div v-if="(detailItem.消耗积分- 0)*num > 135" style="font-size: 14px;color: red;">积分不足,快去赚取积分吧</div>
+  </Dialog>
+</template>
+
+<script setup>
+import Dialog from '@/components/CtDialog'
+import textUI from '@/components/FormUI/TextInput'
+// import Snackbar from '@/plugins/snackbar'
+import { ref } from 'vue'
+defineOptions({name: 'mall-exchange'})
+
+// 数据
+const dataList = ref([])
+const getData = () => {
+  dataList.value = [
+    { 物品名称: '掼蛋文娱套装·茶牌款', 消耗积分: '29888', 图片: 'http://www.51lip.com/public/images/17/64/c2/bd52d2072e4304a43d383069fe63d15cb12fddf6.jpg' },
+    { 物品名称: '户外两键无绳跳绳大球+羽毛球拍+抽象几何飞盘运动套装', 消耗积分: '18888', 图片: 'http://www.51lip.com/public/images/72/9b/de/42d8056bdd889217793f84cb68936d5682ea72dc.png' },
+    { 物品名称: '懒人挂脖风扇', 消耗积分: '8888', 图片: 'http://www.51lip.com/public/images/34/fb/dd/dfc8757b4204fc79352490478e6be8ae71fd748a.jpg' },
+    { 物品名称: '艾优 全自动防水成人声波电动牙刷T11-A', 消耗积分: '12888', 图片: 'http://www.51lip.com/public/images/68/0a/f4/53d5f128b19d22c04ed4538360ae0db0a388f5f8.jpg' },
+    { 物品名称: 'ApiYoo艾优成人声波电动牙刷T1-A-F', 消耗积分: '19888', 图片: 'http://www.51lip.com/public/images/07/4c/e3/0917d02b646e9a5eeec427f70197d4915007ddbe.jpg' },
+    { 物品名称: '幻响小宜多功能照明灯 led台灯', 消耗积分: '88888', 图片: 'http://www.51lip.com/public/images/2e/75/36/6c6fae90c1e7cf134a704dbcb917d2bdc9ac2805.jpg' },
+    { 物品名称: '眼罩颈枕', 消耗积分: '10080', 图片: 'http://www.51lip.com/public/images/2f/e1/99/1a861d35c0e7358633f548d6f142b92d5ec2f6cb.jpg' },
+    { 物品名称: 'PGG 腰果按摩枕W8', 消耗积分: '25000', 图片: 'http://www.51lip.com/public/images/f0/66/e2/6f9b0b756352324af411e4e4b36fed9f71c078d9.jpg' },
+    { 物品名称: '现代酒店管理实用教程电子书', 消耗积分: '100', 图片: 'https://img2.baidu.com/it/u=153650066,2494782747&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=704' },
+    // { 物品名称: '星巴克美式一杯', 消耗积分: '500', 图片: 'https://file-ve.veimg.cn/files/2024/05/2024052714240147ow0eijdnjxg.jpg' },
+  ]
+}
+getData()
+
+// 详情说明弹窗
+const showDetail = ref(false)
+const detailItem = ref(null)
+const handleShowDetail = (item) =>{
+  detailItem.value = item
+  showDetail.value = true
+}
+
+// 兑换提交
+const handleSubmit = async () =>{
+}
+
+// 兑换数量
+const num = ref(1)
+const textItem = ref({
+  type: 'number',
+  value: num.value,
+  width: 80,
+  hideDetails: true,
+  // density: 'compact',
+  // label: '请输入自定义标签',
+})
+const handleChange = async () =>{
+}
+</script>
+<style lang="scss" scoped>
+.listBox {
+  display: flex;
+  flex-wrap: wrap;
+}
+.ellipsis {
+  width: 100%;
+}
+.tips {
+  margin-top: 20px;
+  padding: 12px 20px;
+  border-radius: 5px;
+  background-color: var(--default-bgc);
+  // width: 400px;
+  div {
+    font-size: 15px;
+    margin-bottom: 4px;
+  }
+  span {
+    display: inline-block;
+    font-size: 14px;
+    margin-bottom: 20px;
+  }
+}
+</style>

+ 27 - 0
src/views/mall/exchangeRecords.vue

@@ -0,0 +1,27 @@
+<!-- 积分兑换记录 -->
+<template>
+  <div>
+    <TablePage :items="dataList"></TablePage>
+  </div>
+</template>
+
+<script setup>
+import TablePage from './components/table.vue'
+import { ref } from 'vue'
+defineOptions({name: 'mall-exchangeRecords'})
+
+// 数据
+const dataList = ref([])
+const getData = () => {
+  dataList.value = [
+    { 兑换物品: '刷新简历1次体验卡', 兑换时间: '2024-06-20 20:00', 消耗积分: '500' },
+    { 兑换物品: '会员3天体验卡', 兑换时间: '2024-06-20 00:00', 消耗积分: '1000' },
+    { 兑换物品: '主动打招呼加量包(15次包)', 兑换时间: '2024-06-21 09:05', 消耗积分: '1500' },
+    { 兑换物品: '职业分析报告1次体验卡', 兑换时间: '2024-06-22 10:27', 消耗积分: '600' },
+    { 兑换物品: '星巴克美式一杯', 兑换时间: '2024-06-22 10:27', 消耗积分: '2000' },
+  ]
+}
+getData()
+</script>
+<style lang="scss" scoped>
+</style>

+ 50 - 3
src/views/mall/index.vue

@@ -1,10 +1,57 @@
 <!-- 臻选商城 -->
-<template>
-  <div>vue3PageInit</div>
+ <template>
+  <div class="default-width white-bgc px-3 pt-5 pb-10">
+    <div class="statisticsBox">
+      <div class="mt-2">
+        <span style="font-size: 20px; color: #333; line-height: 28px; font-weight: bold;" class="ml-10">您当前可用积分</span>
+        <span style="font-size: 14px; color: #777; line-height: 24px; cursor: pointer;" class="ml-2" @click="toPointsDetails">积分明细</span>
+      </div>
+      <div class="d-flex justify-space-between align-end my-1">
+        <span style="font-size: 42px; color: #10897bba; line-height: 50px;" class="ml-10 cursor-pointer" @click="toPointsDetails">{{ integral }}</span>
+      </div>
+    </div>
+    <!-- <v-tabs v-model="tab" class="mt-1" align-tabs="start" color="primary" bg-color="#fff" @update:model-value="getPositionList()"> -->
+    <v-tabs v-model="tab" class="mt-1" align-tabs="start" color="primary" bg-color="#fff" @update:model-value="getPositionList">
+      <v-tab :value="1">{{ $t('points.exchange') }}</v-tab>
+      <v-tab :value="2">{{ $t('points.exchangeRecords') }}</v-tab>
+    </v-tabs>
+    <div class="mt-5">
+      <!-- 积分兑换 -->
+      <div v-if="tab === 1">
+        <exchange></exchange>
+      </div>
+      <!-- 积分兑换记录 -->
+      <div v-if="tab === 2">
+        <exchangeRecords></exchangeRecords>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script setup>
-defineOptions({name: 'mall-index'})
+import exchange from './exchange.vue'
+import exchangeRecords from './exchangeRecords.vue'
+import { ref } from 'vue'
+import { useRoute } from 'vue-router'; const route = useRoute()
+import { useRouter } from 'vue-router'; const router = useRouter()
+defineOptions({name: 'personal-pointsMall'})
+const integral = '135'
+
+const toPointsDetails = () => {
+  router.push({ path: '/pointsManagement', query: { tab: 2 } })
+}
+
+const getPositionList = () => {
+  if (route.query) router.replace({ path: route.path }) // 不留记录的清除跳转带过来的参数
+}
+const tab = ref(+route.query?.tab || 1)
 </script>
 <style lang="scss" scoped>
+.statisticsBox {
+  padding: 10px 0;
+  border-radius: 10px;
+  background-color: var(--default-bgc);
+  // background-color: #f3f3f3;
+  // font-family: 宋体, SimSun;
+}
 </style>

+ 2 - 1
src/views/personal/components/integralShow.vue

@@ -65,7 +65,8 @@ const integralRulesClick = () => {
 
 // 跳转臻选商城
 const handleClickMall = (has) => {
-  if (has) return window.open(props.isEnterprise ? '/enterprise/memberCenter/myPoints?tab=2' : '/pointsManagement?tab=2')
+  // if (has) return window.open(props.isEnterprise ? '/enterprise/memberCenter/myPoints?tab=2' : '/pointsManagement?tab=2')
+  if (has) return window.open('/mall')
   window.open(props.isEnterprise ? '/enterprise/memberCenter/myPoints' : '/pointsManagement')
 }
 </script>

+ 2 - 2
src/views/personal/pointsManagement/index.vue

@@ -6,8 +6,8 @@
     </div>
     <div>
       <v-tabs v-model="tab" align-tabs="start" color="primary" bg-color="#fff" @update:model-value="getPositionList">
-        <v-tab :value="1">{{ $t('points.redemptionOfPoints') }}</v-tab>
-        <v-tab :value="2">{{ $t('points.pointsDetails') }}</v-tab>
+        <!-- <v-tab :value="1">{{ $t('points.redemptionOfPoints') }}</v-tab> -->
+        <v-tab :value="1">{{ $t('points.pointsDetails') }}</v-tab>
       </v-tabs>
     </div>
     <div class="mt-3 white-bgc pa-3 pt-1">