ソースを参照

企业端:我的积分+积分商城

lifanagju_citu 11 ヶ月 前
コミット
8f3b1eb710

+ 109 - 0
src/views/enterprise/memberCenter/myPoints/components/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: 'pointsMall-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>

+ 41 - 0
src/views/enterprise/memberCenter/myPoints/components/integralTable.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>

+ 28 - 33
src/views/enterprise/memberCenter/myPoints/index.vue

@@ -1,45 +1,40 @@
-<!--  -->
+<!-- 积分管理 -->
 <template>
-  <v-card class="card-box pa-5">
-    <integralShow></integralShow>
-    <!-- 任务中心 -->
-    <!-- <div style="font-size: 14px; color: #777; text-align: right;" class="mr-5 mt-3 cursor-pointer" @click="router.push({ path: '/personalTaskCenter' })">《<span style=" color: var(--v-primary-base);">任务中心</span>》</div> -->
-    <!-- 积分明细 -->
-    <div class="mt-3">
-      <v-tabs v-model="tab" style="border-radius: 5px;" align-tabs="start" color="primary" bg-color="#f7f8fa" @update:model-value="handleChangeTab">
-        <v-tab :value="1"> {{ $t('points.whole') }}</v-tab>
-        <v-tab :value="2"> {{ $t('points.In') }}</v-tab>
-        <v-tab :value="3"> {{ $t('points.freezing') }}</v-tab>
-        <v-tab :value="4"> {{ $t('points.pay') }}</v-tab>
+  <div>
+    <div class="pa-3 mb-2 white-bgc">
+      <integralShow :showMall="false" :taskCenter="false" :title="descriptiveTitle"></integralShow>
+    </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.pointsMall') }}</v-tab>
+        <v-tab :value="2">{{ $t('points.pointsDetails') }}</v-tab>
       </v-tabs>
-      <TablePage :items="dataList"></TablePage>
     </div>
-  </v-card>
+    <div class="mt-3 white-bgc pa-3 pt-1">
+      <div v-if="tab === 2">
+        <pointsDetails></pointsDetails>
+      </div>
+      <div v-if="tab === 1" class="pt-5">
+        <pointsMall></pointsMall>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script setup>
-import TablePage from '@/views/personal/myPublicRecruitment/components/integralTable.vue'
+import pointsDetails from './pointsDetails.vue'
+import pointsMall from './pointsMall.vue'
 import integralShow from '@/views/personal/components/integralShow.vue'
-// import { useRouter } from 'vue-router'; const router = useRouter()
+import { useRoute } from 'vue-router'; const route = useRoute()
+import { useRouter } from 'vue-router'; const router = useRouter()
 import { ref } from 'vue'
-defineOptions({name: 'enterprise-memberCenter-myPoints'})
-const tab = ref(0)
-const dataList = ref([])
-// 数据
-const getData = () => {
-  dataList.value = [
-    { 积分类型: '积分签到', 时间: '2024-06-20 20:00', 积分: '5' },
-    { 积分类型: '积分到期', 时间: '2024-06-20 00:00', 积分: '-100' },
-    { 积分类型: '浏览积分', 时间: '2024-06-21 09:05', 积分: '15' },
-    { 积分类型: '浏览职业分析报告', 时间: '2024-06-22 10:27', 积分: '-20' },
-  ]
-}
-getData()
-// 切换
-const handleChangeTab = () => {
-  // tab
-  // getData()
+defineOptions({name: 'personal-pointsManagement-index'})
+const tab = ref(+route.query?.tab || 1)
+const getPositionList = () => {
+  if (route.query) router.replace({ path: route.path }) // 不留记录的清除跳转带过来的参数
 }
+const descriptiveTitle = '您当前可用积分'
 </script>
 <style lang="scss" scoped>
 </style>
+

+ 39 - 0
src/views/enterprise/memberCenter/myPoints/pointsDetails.vue

@@ -0,0 +1,39 @@
+<!-- 积分明细 -->
+<template>
+  <div class="mt-3">
+    <v-tabs v-model="tab" style="border-radius: 5px;" align-tabs="start" color="primary" bg-color="#f7f8fa" @update:model-value="handleChangeTab">
+      <v-tab :value="1"> {{ $t('points.whole') }}</v-tab>
+      <v-tab :value="2"> {{ $t('points.In') }}</v-tab>
+      <v-tab :value="3"> {{ $t('points.freezing') }}</v-tab>
+      <v-tab :value="4"> {{ $t('points.pay') }}</v-tab>
+    </v-tabs>
+    <TablePage  :items="dataList"></TablePage>
+  </div>
+</template>
+
+<script setup>
+import TablePage from './components/integralTable.vue'
+import { ref } from 'vue'
+defineOptions({name: 'personal-pointsManagement-pointsDetails'})
+const tab = ref(0)
+
+// 数据
+const dataList = ref([])
+const getData = () => {
+  dataList.value = [
+    { 积分类型: '积分签到', 时间: '2024-06-20 20:00', 积分: '5' },
+    { 积分类型: '积分到期', 时间: '2024-06-20 00:00', 积分: '-100' },
+    { 积分类型: '浏览积分', 时间: '2024-06-21 09:05', 积分: '15' },
+    { 积分类型: '浏览职业分析报告', 时间: '2024-06-22 10:27', 积分: '-20' },
+  ]
+}
+getData()
+
+// 切换
+const handleChangeTab = () => {
+  // tab
+  // getData()
+}
+</script>
+<style lang="scss" scoped>
+</style>

+ 16 - 0
src/views/enterprise/memberCenter/myPoints/pointsMall.vue

@@ -0,0 +1,16 @@
+<!-- 积分商城 -->
+<template>
+  <exchange></exchange>
+</template>
+
+<script setup>
+import exchange from './components/exchange.vue'
+defineOptions({name: 'personal-pointsManagement-pointsMall'})
+</script>
+<style lang="scss" scoped>
+.statisticsBox {
+  padding: 10px 0;
+  border-radius: 10px;
+  background-color: var(--default-bgc);
+}
+</style>