Browse Source

Merge branch 'pre' of http://git.dgtis.com/sunlupeng/pointsMall

sunlupeng 1 year ago
parent
commit
923ba53255

+ 2 - 1
package.json

@@ -15,7 +15,8 @@
     "node-sass": "6.0.0",
     "sass-loader": "11.1.0",
     "vue": "^2.6.14",
-    "vue-router": "^3.5.1"
+    "vue-router": "^3.5.1",
+    "vuex": "3.0.1"
   },
   "devDependencies": {
     "@babel/core": "^7.12.16",

+ 3 - 0
src/App.vue

@@ -25,6 +25,9 @@ export default {
       visible:true,
     };
   },
+  created(){
+    this.$store.dispatch('GetUserInfo');
+  },
   methods:{
     // 保存滚动值,这是兼容的写法
     handleScroll () {

+ 26 - 3
src/assets/icon/demo_index.html

@@ -54,6 +54,12 @@
       <div class="content unicode" style="display: block;">
           <ul class="icon_lists dib-box">
           
+            <li class="dib">
+              <span class="icon iconfont">&#xe608;</span>
+                <div class="name">通知</div>
+                <div class="code-name">&amp;#xe608;</div>
+              </li>
+          
             <li class="dib">
               <span class="icon iconfont">&#xe620;</span>
                 <div class="name">功能管理</div>
@@ -150,9 +156,9 @@
 <pre><code class="language-css"
 >@font-face {
   font-family: 'iconfont';
-  src: url('iconfont.woff2?t=1681783689038') format('woff2'),
-       url('iconfont.woff?t=1681783689038') format('woff'),
-       url('iconfont.ttf?t=1681783689038') format('truetype');
+  src: url('iconfont.woff2?t=1687225905766') format('woff2'),
+       url('iconfont.woff?t=1687225905766') format('woff'),
+       url('iconfont.ttf?t=1687225905766') format('truetype');
 }
 </code></pre>
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -178,6 +184,15 @@
       <div class="content font-class">
         <ul class="icon_lists dib-box">
           
+          <li class="dib">
+            <span class="icon iconfont icon-mall-tongzhi"></span>
+            <div class="name">
+              通知
+            </div>
+            <div class="code-name">.icon-mall-tongzhi
+            </div>
+          </li>
+          
           <li class="dib">
             <span class="icon iconfont icon-mall-gongnengguanli"></span>
             <div class="name">
@@ -322,6 +337,14 @@
       <div class="content symbol">
           <ul class="icon_lists dib-box">
           
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-mall-tongzhi"></use>
+                </svg>
+                <div class="name">通知</div>
+                <div class="code-name">#icon-mall-tongzhi</div>
+            </li>
+          
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
                   <use xlink:href="#icon-mall-gongnengguanli"></use>

+ 7 - 3
src/assets/icon/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 4020610 */
-  src: url('iconfont.woff2?t=1681783689038') format('woff2'),
-       url('iconfont.woff?t=1681783689038') format('woff'),
-       url('iconfont.ttf?t=1681783689038') format('truetype');
+  src: url('iconfont.woff2?t=1687225905766') format('woff2'),
+       url('iconfont.woff?t=1687225905766') format('woff'),
+       url('iconfont.ttf?t=1687225905766') format('truetype');
 }
 
 .iconfont {
@@ -22,6 +22,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-mall-tongzhi:before {
+  content: "\e608";
+}
+
 .icon-mall-gongnengguanli:before {
   content: "\e620";
 }

File diff suppressed because it is too large
+ 1 - 1
src/assets/icon/iconfont.js


+ 7 - 0
src/assets/icon/iconfont.json

@@ -5,6 +5,13 @@
   "css_prefix_text": "icon-mall-",
   "description": "",
   "glyphs": [
+    {
+      "icon_id": "27003809",
+      "name": "通知",
+      "font_class": "tongzhi",
+      "unicode": "e608",
+      "unicode_decimal": 58888
+    },
     {
       "icon_id": "1320055",
       "name": "功能管理",

BIN
src/assets/icon/iconfont.ttf


BIN
src/assets/icon/iconfont.woff


BIN
src/assets/icon/iconfont.woff2


BIN
src/assets/image/banner.jpg


BIN
src/assets/image/banner.png


BIN
src/assets/image/banner2.png


BIN
src/assets/image/banner3.png


BIN
src/assets/image/banner4.png


BIN
src/assets/image/banner5.png


BIN
src/assets/image/banner6.png


BIN
src/assets/image/banner7.png


BIN
src/assets/image/birthday.png


+ 39 - 2
src/components/AppHeader.vue

@@ -4,7 +4,7 @@
             <img class="logo" src="./../assets/image/logo.png"/>
             <router-link to="/home">
                 <div class="header-item">
-                    <i class="icon-mall-gongnengguanli"></i>功能列表
+                    <i class="icon-mall-gongnengguanli"></i>首页
                 </div>
             </router-link>
             <router-link to="/noticeCenter">
@@ -20,21 +20,58 @@
                     <i class="el-icon-trophy"></i>积分排行
                 </div>
             </router-link> -->
+            <div class="userInfo flex-center">
+                <el-avatar fit="fill" :size="50" :src="avatar"></el-avatar>
+                <div class="nameAndIntegral">
+                    <div>姓名: {{ userInfo.userName }}</div>
+                    <div>积分: <span class="blue">{{ userInfo.surplusIntegral }}</span></div>
+                </div>
+            </div>
         </nav>
     </div>
 </template>
 <script>
+import { mapGetters } from 'vuex'
 export default {
     props:['visible'],
+    data() {
+        return {};
+    },
+    computed: {
+        // 将 getter 映射到当前组件的计算属性
+        ...mapGetters(['userInfo','avatar'])
+    },
+    created() {},
+    methods: {},
 }
 </script>
 
 <style>
 .logo{
     position: absolute;
-    left: 120px;
+    left: 80px;
     width: 160px;
 }
+.userInfo{
+    position: absolute;
+    right: 80px;
+    
+}
+.flex-center{
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+.nameAndIntegral{
+    margin-left: 10px;
+    font-size: 14px;
+    color: #252933;
+    line-height: px;
+    line-height: 23px;
+}
+.blue {
+    color: #1e80ff;
+}
 .header-box {
   display: flex;
   justify-content: center;

+ 9 - 9
src/components/AppSidebar.vue

@@ -20,11 +20,18 @@ export default {
   data() {
     return {
         sideBarList:[
+            {
+                value:'pointsMall',
+                name:'积分商城',
+                path:'/home/pointsMall',
+                icon:'icon-mall-jifenshangcheng',
+                checked:false,
+            },
             {
                 value:'index',
-                name:'首页',
+                name:'最新通知',
                 path:'/home/index',
-                icon:'icon-mall-shouye',
+                icon:'icon-mall-tongzhi',
                 checked:false,
             },
             {
@@ -34,13 +41,6 @@ export default {
                 icon:'icon-mall-qiandao',
                 checked:false,
             },
-            {
-                value:'pointsMall',
-                name:'积分商城',
-                path:'/home/pointsMall',
-                icon:'icon-mall-jifenshangcheng',
-                checked:false,
-            },
             {
                 value:'festiveEvents',
                 name:'节日活动',

+ 15 - 36
src/components/SiderInfo.vue

@@ -10,74 +10,59 @@
                     <div class="second-line">点亮在商城的每一天</div>
                 </div>
                 <button class="btn signedin-btn">
-                    <span @click="goToSignIn" v-if="dataInfo.signStatus==0" class="btn-text sign-text">去签到</span>
+                    <span @click="goToSignIn" v-if="userInfo.signStatus==0" class="btn-text sign-text">去签到</span>
                     <span v-else class="btn-text signed-text">已签到</span>
                 </button>
             </div>
         </div>
         <div class="signin-tip sidebar-block">
             <div class="avatar">
-                <el-avatar fit="fill" :size="65" :src="avatarUrl"></el-avatar>
-                <span class="name">{{ dataInfo.userName }}</span>
+                <el-avatar fit="fill" :size="65" :src="avatar"></el-avatar>
+                <span class="name">{{ userInfo.userName }}</span>
             </div>
             <div class="info">
                 <div class="info-item">
                     <div class="item-title">部门:</div>
-                    <div :title="dataInfo.deptName" class="item-content" style="line-height: 1.5rem;">{{ dataInfo.deptName }}</div>
+                    <div :title="userInfo.deptName" class="item-content" style="line-height: 1.5rem;">{{ userInfo.deptName }}</div>
                 </div>
                 <div class="info-item">
                     <div class="item-title">积分:</div>
-                    <div class="item-content blue">{{ dataInfo.surplusIntegral }}</div>
+                    <div class="item-content blue">{{ userInfo.surplusIntegral }}</div>
                 </div>
-                <!-- <div class="info-item">
-                    <div class="item-title">排行:</div>
-                    <div class="item-content blue">{{ dataInfo.nowtop }}</div>
-                </div> -->
-                <!-- <div class="info-item">
-                    <div class="item-title">勋章:</div>
-                    <div class="item-content blue">{{ dataInfo.medalCount }}枚</div>
-                </div> -->
             </div>
         </div>
         <div class="sidebar-block sticky-block">
             <div class="avatar">
-                <el-avatar :size="65" :src="avatarUrl"></el-avatar>
-                <span class="name">{{ dataInfo.userName }}</span>
+                <el-avatar :size="65" :src="avatar"></el-avatar>
+                <span class="name">{{ userInfo.userName }}</span>
             </div>
             <div class="info">
                 <div class="info-item">
                     <div class="item-title">部门:</div>
-                    <div :title="dataInfo.deptName" class="item-content">{{ dataInfo.deptName }}</div>
+                    <div :title="userInfo.deptName" class="item-content">{{ userInfo.deptName }}</div>
                 </div>
                 <div class="info-item">
                     <div class="item-title">积分:</div>
-                    <div class="item-content blue">{{ dataInfo.surplusIntegral }}</div>
+                    <div class="item-content blue">{{ userInfo.surplusIntegral }}</div>
                 </div>
-                <!-- <div class="info-item">
-                    <div class="item-title">排行:</div>
-                    <div class="item-content blue">{{ dataInfo.nowtop }}</div>
-                </div> -->
-                <!-- <div class="info-item">
-                    <div class="item-title">勋章:</div>
-                    <div class="item-content blue">{{ dataInfo.medalCount }}枚</div>
-                </div> -->
             </div>
         </div>
     </div>
 </template>
 <script>
-import { useInfo } from "@/api/allApi";
+import { mapGetters } from 'vuex'
 export default {
     data() {
         return {
             hoursTip:'你好!',
             isActive: false,
-            dataInfo:{},
-            avatarUrl: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
         };
     },
+    computed: {
+        // 将 getter 映射到当前组件的计算属性
+        ...mapGetters(['userInfo','avatar'])
+    },
     created() {
-        this.getUserInfo();
         this.getHoursTip()
     },
     methods: {
@@ -86,12 +71,6 @@ export default {
                 path: '/home/signIn',
             });
         },
-        getUserInfo(){
-            useInfo().then(response=>{
-                this.dataInfo = response.data.data;
-                this.avatarUrl = this.dataInfo.httpFile + this.dataInfo.headImage;
-            })
-        },
         getHoursTip() {
             let date = new Date();
             if (date.getHours() >= 0 && date.getHours() < 12) {
@@ -241,7 +220,7 @@ destroyed() {
 }
 
 .info .info-item {
-    font-size: 1rem;
+    font-size: 14px;
     display: flex;
     justify-content: space-between;
     line-height: 1.5rem;

+ 2 - 0
src/main.js

@@ -2,6 +2,7 @@ import Vue from 'vue'
 import App from './App.vue'
 // import { msgTips } from "@/api/allApi";
 import router from './router'
+import store from './store'
 import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
 import './assets/css/global.css';
@@ -27,5 +28,6 @@ Vue.config.productionTip = false;
 Vue.use(ElementUI);
 new Vue({
   router,
+  store,
   render: h => h(App)
 }).$mount('#app')

+ 1 - 1
src/router/index.js

@@ -13,7 +13,7 @@ const routes = [
   {
     path: '/home',
     component: HomeView,
-    redirect:'/home/index',
+    redirect:'/home/pointsMall',
     children: [
       {
         path: '/home/index',

+ 5 - 0
src/store/getters.js

@@ -0,0 +1,5 @@
+const getters = {
+  userInfo: state => state.user.userInfo,
+  avatar: state => state.user.avatar,
+}
+export default getters

+ 15 - 0
src/store/index.js

@@ -0,0 +1,15 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+import user from './modules/user'
+import getters from './getters'
+
+Vue.use(Vuex)
+
+const store = new Vuex.Store({
+  modules: {
+    user
+  },
+  getters
+})
+
+export default store

+ 35 - 0
src/store/modules/user.js

@@ -0,0 +1,35 @@
+import { useInfo } from '@/api/allApi'
+
+const user = {
+  state: {
+    userInfo:{},
+    avatar: '',
+  },
+
+  mutations: {
+    SET_USERINFO: (state, userInfo) => {
+      state.userInfo = userInfo
+    },
+    SET_AVATAR: (state, avatar) => {
+      state.avatar = avatar
+    },
+  },
+
+  actions: {
+    // 获取用户信息
+    GetUserInfo({ commit }) {
+      return new Promise((resolve, reject) => {
+        useInfo().then(response => {
+          const data = response.data.data
+          commit('SET_USERINFO', data)
+          commit('SET_AVATAR', data.httpFile + data.headImage)
+          resolve(response)
+        }).catch(error => {
+          reject(error)
+        })
+      })
+    },
+  }
+}
+
+export default user

+ 13 - 6
src/views/HomeView/EarnPoints.vue

@@ -6,9 +6,7 @@
           <el-button size="small" type="primary" @click="dialogVisible = true">上传证书</el-button>
           <el-table size="small" :data="dataList" border style="margin-top: 20px;width: 100%">
             <el-table-column align="center" type="index" width="50" label="序号"></el-table-column>
-            <el-table-column min-width="100" align="center" prop="typeName" label="类型"></el-table-column>
-            <el-table-column align="center" prop="categoryName" min-width="100" label="名称"></el-table-column>
-            <el-table-column align="center" min-width="200" label="证书">
+            <el-table-column align="center" min-width="200" label="附件">
               <template slot-scope="props">
                 <div v-for="(item, index) in props.row.files" :key="index">
                   <a style="color: #1e80ff;" target="_blank" :href="item.url">{{ item.oldName }}</a>
@@ -16,9 +14,13 @@
 
               </template>
             </el-table-column>
+            <el-table-column min-width="100" align="center" prop="typeName" label="证书大类"></el-table-column>
+            <el-table-column align="center" prop="categoryName" min-width="100" label="证书类型"></el-table-column>
+            <el-table-column align="center" prop="title" min-width="100" label="证书名称"></el-table-column>
             <el-table-column align="center" prop="integral" min-width="100" label="积分"></el-table-column>
             <el-table-column min-width="60" align="center" prop="statusName" label="状态"></el-table-column>
             <el-table-column min-width="150" align="center" prop="createTime" label="上传时间"></el-table-column>
+            <el-table-column min-width="150" align="center" prop="content" label="备注"></el-table-column>
           </el-table>
           <!-- 分页 -->
           <div class="myPage">
@@ -36,14 +38,17 @@
       </el-tabs>
     </div>
     <el-dialog title="上传证书" :visible.sync="dialogVisible" width="40%">
-      <el-form :rules="rules" ref="dataForm" :model="dataForm" label-width="80px">
+      <el-form :rules="rules" ref="dataForm" :model="dataForm" label-width="100px">
         <el-form-item label="类别:" prop="type">
           <el-cascader clearable size="small" style="width: 95%;" v-model="dataForm.type" :options="typeList"
           :props="{ value: 'id',label: 'typeName',children: 'children'}"
             @change="handleChange"></el-cascader>
         </el-form-item>
-
-        <el-form-item label="证书:" prop="fileIds">
+        <el-form-item label="证书名称:" prop="title">
+          <el-input clearable style="width: 95%;" size="small" v-model="dataForm.title"></el-input>
+        </el-form-item>
+        
+        <el-form-item label="证书附件:" prop="fileIds">
           <el-upload :action="fileUrl" :file-list="dataForm.files" :on-success="handleAvatarSuccess"
             :before-upload="beforeUploadFile" :on-remove="handleRemove">
             <el-button size="small" type="primary">点击上传</el-button>
@@ -70,6 +75,7 @@ export default {
       dialogVisible: false,
       rules: {
         type: [{ required: true, message: "请选择证书类别", trigger: "blur" }],
+        title: [{ required: true, message: "请填写证书名称", trigger: "blur" }],
         fileIds: [{ required: true, message: "请上传附件", trigger: "blur" }],
       },
       total: 0,
@@ -79,6 +85,7 @@ export default {
       },
       dataForm: {
         type: [],
+        title:'',
         fileIds: '',
         files:[],
       }

+ 4 - 2
src/views/HomeView/FestiveEvents.vue

@@ -148,8 +148,10 @@ export default {
 }
 
 .prize-card .img-container .prize-img {
-    max-height: 120px;
-    max-width: 120px;
+    width: 100%;
+    height: 100%;
+    /* max-height: 120px;
+    max-width: 120px; */
 }
 
 .prize-card .content {

+ 10 - 8
src/views/HomeView/GoodsDetail.vue

@@ -35,7 +35,7 @@
                 </div>
               </div>
               <p class="phone">{{ data.contactPhone }}</p>
-              <p class="address">{{ data.contactAddr }}{{ data.contactEmail }}</p>
+              <p class="address">{{ data.contactAddr }}</p>
             </div>
           </div>
       </div>
@@ -49,6 +49,7 @@
               <th style="text-align: center;">数量</th>
               <th style="text-align: center;">单价</th>
               <th style="text-align: center;">兑换方式</th>
+              <th v-if="data.reclaimAddrName" style="text-align: center;">领取地点</th>
               <th style="text-align: center;">总计</th>
             </tr>
           </thead>
@@ -57,20 +58,21 @@
               <td>
                 <div class="prize-info">
                   <div class="prize-img-container">
-                    <el-image :src="data.imgUrl" :preview-src-list="[data.imgUrl]"
+                    <el-image :src="data.imgUrl" v-if="data.imgUrl" :preview-src-list="[data.imgUrl]"
                                         class="prize-img"></el-image>
                   </div>
                   <div class="prize-detail-info">
                     <h3 class="title">{{ data.name }}</h3>
-                    <p class="desc">
+                    <!-- <p class="desc">
                       <span v-if="data.location">{{ data.location }}</span>
-                    </p>
+                    </p> -->
                   </div>
                 </div>
               </td>
               <td style="text-align: center;">{{ data.skuCount }}</td>
               <td style="text-align: center;">{{ data.price }} 积分</td>
               <td style="text-align: center;">{{ data.deliveryTypeName }}</td>
+              <td v-if="data.reclaimAddrName" style="text-align: center;">{{ data.reclaimAddrName }}</td>
               <td style="text-align: center;" class="finlly-price">
                 {{ data.total }} 积分
               </td>
@@ -94,14 +96,14 @@
               <td>
                 <div class="prize-info">
                   <div class="prize-img-container">
-                    <el-image :src="data.imgUrl" :preview-src-list="[data.imgUrl]"
+                    <el-image :src="data.imgUrl" v-if="data.imgUrl" :preview-src-list="[data.imgUrl]"
                                         class="prize-img"></el-image>
                   </div>
                   <div class="prize-detail-info">
                     <h3 class="title">{{ data.name }}</h3>
-                    <p class="desc">
+                    <!-- <p class="desc">
                       <span v-if="data.location">{{ data.location }}</span>
-                    </p>
+                    </p> -->
                   </div>
                 </div>
               </td>
@@ -122,7 +124,7 @@
         <el-table-column align="center" prop="orderStatus" label="状态"></el-table-column>
         <el-table-column align="center" prop="createTime" label="处理时间"></el-table-column>
       </el-table>
-      <div class="footer" v-if="(data.orderType == 3 || data.orderType == 4) && data.deliveryType != 3">
+      <div class="footer" v-if="(data.orderType == 3 || data.orderType == 4) && (data.deliveryType == 0 || data.deliveryType == 1 || data.deliveryType == 2)">
         <div class="left-info">
           <span class="info-title">
             <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"

+ 19 - 12
src/views/HomeView/Index.vue

@@ -2,16 +2,15 @@
     <div class="timeline-container">
         <div class="timeline-content">
             <div class="timeline-entry-list">
-                <div class="hot-list-wrap">
+                <img src="@/assets/image/banner4.png" alt="banner" class="banner">
+                <!-- <div class="hot-list-wrap">
                     <el-empty :image-size="200" v-if="bannerList.length < 1"></el-empty>
-                    <el-carousel arrow="never" indicator-position="none" height="207px" :interval="5000" v-if="bannerList.length > 0">
+                    <el-carousel arrow="never" indicator-position="none" height="120px" :interval="5000" v-if="bannerList.length > 0">
                         <el-carousel-item v-for="(item, index) in bannerList" :key="index">
-                            <!-- <router-link to="/productTrials"> -->
-                                <img style="width: 100%; height: 100%" :src="item.url" />
-                            <!-- </router-link> -->
+                                <img style="width: 100%; height: 100%" :src="item.url" class="banner" />
                         </el-carousel-item>
                     </el-carousel>
-                </div>
+                </div> -->
                 <div class="entry-list-container">
                     <div class="tab-header">
                         <span class="tab-title">最新通知</span>
@@ -21,7 +20,7 @@
                         <div v-for="(item,index) in dataList" :key="index" @click="handleClickMag(item.msgId)" class="list-item">
                             <div class="meta-container">
                                 <div class="user-message">
-                                        系统通知
+                                    {{ item.type==2 ? '生日祝福' : '系统通知'}}
                                 </div> 
                                 <div class="dividing"></div> 
                                 <div class="date">{{ item.createTime }}</div>
@@ -58,11 +57,11 @@ export default{
         dataInfo:'',
         bannerList: [
             {
-                url: require('@/assets/image/banner1.jpg')
-            },
-            {
-                url: require('@/assets/image/banner.jpg')
+                url: require('@/assets/image/banner4.png')
             },
+            // {
+            //     url: require('@/assets/image/banner.jpg')
+            // },
         ],
         dataList:[],
         page:1,
@@ -93,7 +92,7 @@ export default{
         let data = {
             limit:10,
             page:this.page,
-            type:0,
+            type:'0,2',
         };
         msgList(data).then(response=>{
             if(this.page==1){
@@ -140,6 +139,14 @@ export default{
 }
 </script>
 <style scoped>
+.banner {
+    width: 100%;
+    height: 100px;
+    background-color: #2c82fe;
+    border-radius: 4px;
+    margin-bottom: 15px;
+    display: block;
+}
 .timeline-container{
     margin: 0 auto;
 }

+ 29 - 2
src/views/HomeView/MsgDetail.vue

@@ -11,7 +11,15 @@
                             {{ data.createTime }}
                         </div>
                     </div>
-                    <div class="markdown-body" v-html="data.content"></div>
+                    <div v-if="data.type==2" class="markdown-body">
+                        <div class="userInfo">
+                            <el-avatar fit="fill" :size="65" :src="avatarUrl"></el-avatar>
+                            <div style="text-align: center;font-size: 16px;font-weight: 600;">{{ dataInfo.userName }}</div>
+                        </div>
+                        <img  src="./../../assets/image/birthday.png">
+                    </div>
+                    <div v-else class="markdown-body" v-html="data.content"></div>
+                    
                 </div>
             </div>
             <SiderInfo></SiderInfo>
@@ -19,7 +27,7 @@
     </div>
 </template>
 <script>
-import { msgInfo } from "@/api/allApi";
+import { msgInfo,useInfo } from "@/api/allApi";
 import SiderInfo from '@/components/SiderInfo.vue'
 export default{
   components: {
@@ -28,12 +36,21 @@ export default{
   data() {
     return {
         data:{},
+        dataInfo:{},
+        avatarUrl: "",
     };
   },
   created(){
+    this.getUserInfo();
     this.getDataInfo(this.$route.query.id);
   },
   methods:{
+    getUserInfo(){
+            useInfo().then(response=>{
+                this.dataInfo = response.data.data;
+                this.avatarUrl = this.dataInfo.httpFile + this.dataInfo.headImage;
+            })
+        },
         getDataInfo(id){
             msgInfo({msgId:id}).then(response => {
                     this.data = response.data.data;
@@ -43,6 +60,16 @@ export default{
 }
 </script>
 <style scoped>
+.userInfo{
+    width: 65px;
+    position: absolute;
+    top: 37%;
+    left: 46%;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-content: center;
+}
 .timeline-container{
     margin: 0 auto;
 }

+ 56 - 17
src/views/HomeView/PointsMall.vue

@@ -1,6 +1,17 @@
 <template>
     <div class="right-wrap">
-        <img src="@/assets/image/banner4.png" alt="banner" class="banner">
+        <!-- <img src="@/assets/image/banner4.png" alt="banner" class="banner"> -->
+        <div class="hot-list-wrap">
+                    <el-empty :image-size="200" v-if="bannerList.length < 1"></el-empty>
+                    <!-- arrow="never" indicator-position="none" -->
+                    <el-carousel indicator-position="none" height="250px" :interval="5000" v-if="bannerList.length > 0">
+                        <el-carousel-item v-for="(item, index) in bannerList" :key="index">
+                            <!-- <router-link to="/productTrials"> -->
+                                <img style="width: 100%; height: 100%" :src="item.url" class="banner" />
+                            <!-- </router-link> -->
+                        </el-carousel-item>
+                    </el-carousel>
+                </div>
         <div class="notice-board">
             <div class="notice-header">
                 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"
@@ -36,12 +47,12 @@
                             {{ item.dictLabel }}
                         </div>
                     </div>
-                    <div class="tab-list" style="margin-top: 10px;">
+                    <!-- <div class="tab-list" style="margin-top: 10px;">
                         <div :class="{ 'tab': true, 'checked': item.checked }" v-for="(item) in deliveryTypeList"
                             :key="item.type" @click="choseDeliveryType(item)">
                             {{ item.name }}
                         </div>
-                    </div>
+                    </div> -->
                     <div class="tab-list" style="margin-top: 10px;">
                         <div :class="{ 'tab': true, 'checked': item.checked }" v-for="(item) in orderByClauseList"
                             :key="item.orderByClause" @click="changeOrderByClause(item)">
@@ -53,7 +64,7 @@
                         <div v-else class="prize-list">
                             <div v-for="(item, index) in goodsList" :key="index" class="prize-card prize-item">
                                 <div class="img-container">
-                                    <el-image :src="item.imgUrl" :preview-src-list="[item.imgUrl]"
+                                    <el-image :src="item.imgUrl" v-if="item.imgUrl" :preview-src-list="[item.imgUrl]"
                                         class="prize-img"></el-image>
                                 </div>
                                 <div class="content">
@@ -81,9 +92,13 @@
                                     </p>
                                 </div>
                                 <div class="btn-container">
-                                    <button @click="handleClickExchange(item.skuId)"
-                                        class="ui-btn primary medium default btn">
-                                        {{item.stock == 0 ? '敬请期待' : '立即兑换'}}
+                                    <button v-if="item.stock == 0" @click="handleClickExchange(item.skuId)"
+                                        class="ui-btn gray medium btn">
+                                        敬请期待
+                                    </button>
+                                    <button v-else @click="handleClickExchange(item.skuId)"
+                                        class="ui-btn primary medium btn">
+                                       立即兑换
                                     </button>
                                 </div>
                             </div>
@@ -102,7 +117,7 @@
                         <div class="prize-list">
                             <div v-for="(item, index) in giftList" :key="index" class="prize-card prize-item">
                                 <div class="img-container">
-                                    <el-image :src="item.imgUrl" :preview-src-list="[item.imgUrl]"
+                                    <el-image :src="item.imgUrl" v-if="item.imgUrl" :preview-src-list="[item.imgUrl]"
                                         class="prize-img"></el-image>
                                 </div>
                                 <div class="content">
@@ -130,9 +145,13 @@
                                     </p>
                                 </div>
                                 <div class="btn-container">
-                                    <button @click="handleClickExchange(item.skuId)"
+                                    <button v-if="item.stock == 0" @click="handleClickExchange(item.skuId)"
+                                        class="ui-btn medium default btn">
+                                        敬请期待
+                                    </button>
+                                    <button v-else @click="handleClickExchange(item.skuId)"
                                         class="ui-btn primary medium default btn">
-                                        {{item.stock == 0 ? '敬请期待' : '立即兑换'}}
+                                       立即兑换
                                     </button>
                                 </div>
                             </div>
@@ -153,6 +172,17 @@ import { debounce } from '@/utils/index'
 export default {
     data() {
         return {
+            bannerList: [
+            {
+                url: require('@/assets/image/banner5.png')
+            },
+            {
+                url: require('@/assets/image/banner6.png')
+            },
+            {
+                url: require('@/assets/image/banner7.png')
+            },
+        ],
             page: 1,
             pages: 1,
             // tab 列表
@@ -315,7 +345,7 @@ export default {
                 name: this.goodsName,
                 productAttribute: this.productAttribute,
                 orderByClause: this.orderByClause,
-                deliveryType: this.deliveryType
+                // deliveryType: this.deliveryType
             }
 
             integralList(params).then(response => {
@@ -387,11 +417,14 @@ export default {
 };
 </script>
 <style scoped>
+.hot-list-wrap{
+    margin-bottom: 10px;
+}
 button {
     -webkit-appearance: none;
     -moz-appearance: none;
     appearance: none;
-    background-color: #007fff;
+    /* background-color: #007fff; */
     color: #fff;
     border-radius: 2px;
     border: none;
@@ -442,6 +475,8 @@ button {
 }
 
 .prize-card .img-container .prize-img {
+    /* width: 100%;
+    height: 100%; */
     max-height: 120px;
     max-width: 120px;
 }
@@ -494,7 +529,7 @@ button {
     font-weight: 500;
     font-size: 14px;
     line-height: 24px;
-    color: #1e80ff;
+    color: #ff8462;
     flex: auto;
     display: flex;
     align-items: center;
@@ -520,12 +555,16 @@ button {
     border-radius: 16px;
 }
 
-.ui-btn.medium {
+.medium {
     padding: 5px 16px;
 }
 
-.ui-btn.primary {
-    background-color: #1d7dfa;
+.primary {
+    background-image: linear-gradient(to right, #f5b543,#faa029);
+}
+.gray{
+    background-color: gray;
+    opacity: 0.5;
 }
 
 .ui-btn {
@@ -604,7 +643,7 @@ button {
     height: 1.8rem;
     background-color: #fff;
     border-radius: 1rem;
-    font-size: 0.5rem;
+    font-size: 12px;
     line-height: 1.8rem;
     color: #8a9aa9;
     padding: 0 0.83rem;

File diff suppressed because it is too large
+ 240 - 61
src/views/HomeView/RedeemView.vue


+ 17 - 38
src/views/HomeView/SignIn.vue

@@ -33,7 +33,7 @@
       <div class="index-aside aside" :class="{ 'sticky top': isActive }">
         <div class="signin-tip sidebar-block signin">
           <div class="first-line">
-            <button @click="signIn" v-if="dataInfo.signStatus == 0" class="btn">
+            <button @click="signIn" v-if="userInfo.signStatus == 0" class="btn">
               立即签到
             </button>
             <button v-else class="btn signed-btn">今日已签到</button>
@@ -41,54 +41,38 @@
         </div>
         <div class="signin-tip sidebar-block">
           <div class="avatar">
-            <el-avatar :size="65" :src="avatarUrl"></el-avatar>
-            <span class="name">{{ dataInfo.userName }}</span>
+            <el-avatar :size="65" :src="avatar"></el-avatar>
+            <span class="name">{{ userInfo.userName }}</span>
           </div>
           <div class="info">
             <div class="info-item">
               <div class="item-title">部门:</div>
-              <div :title="dataInfo.deptName" class="item-content">{{ dataInfo.deptName }}</div>
+              <div :title="userInfo.deptName" class="item-content">{{ userInfo.deptName }}</div>
             </div>
             <div class="info-item">
               <div class="item-title">积分:</div>
               <div class="item-content blue">
-                {{ dataInfo.surplusIntegral }}
+                {{ userInfo.surplusIntegral }}
               </div>
             </div>
-            <!-- <div class="info-item">
-                    <div class="item-title">排行:</div>
-                    <div class="item-content blue">{{ dataInfo.nowtop }}</div>
-                </div> -->
-                <!-- <div class="info-item">
-                    <div class="item-title">勋章:</div>
-                    <div class="item-content blue">{{ dataInfo.medalCount }}枚</div>
-                </div> -->
           </div>
         </div>
         <div class="sidebar-block sticky-block">
           <div class="avatar">
-            <el-avatar :size="65" :src="avatarUrl"></el-avatar>
-            <span class="name">{{ dataInfo.userName }}</span>
+            <el-avatar :size="65" :src="avatar"></el-avatar>
+            <span class="name">{{ userInfo.userName }}</span>
           </div>
           <div class="info">
             <div class="info-item">
               <div class="item-title">部门:</div>
-              <div :title="dataInfo.deptName" class="item-content" style="line-height: 1.5rem;">{{ dataInfo.deptName }}</div>
+              <div :title="userInfo.deptName" class="item-content" style="line-height: 1.5rem;">{{ userInfo.deptName }}</div>
             </div>
             <div class="info-item">
               <div class="item-title">积分:</div>
               <div class="item-content blue">
-                {{ dataInfo.surplusIntegral }}
+                {{ userInfo.surplusIntegral }}
               </div>
             </div>
-            <!-- <div class="info-item">
-                    <div class="item-title">排行:</div>
-                    <div class="item-content blue">{{ dataInfo.nowtop }}</div>
-                </div> -->
-                <!-- <div class="info-item">
-                    <div class="item-title">勋章:</div>
-                    <div class="item-content blue">{{ dataInfo.medalCount }}枚</div>
-                </div> -->
           </div>
         </div>
       </div>
@@ -96,7 +80,8 @@
   </div>
 </template>
 <script>
-import { sign, signInfo,useInfo } from "@/api/allApi";
+import { mapGetters } from 'vuex'
+import { sign, signInfo } from "@/api/allApi";
 import calendar from '@/components/Calendar'
 export default {
   components: {
@@ -108,15 +93,15 @@ export default {
       integral:'',
       markDate: [],
       isActive: false,
-      dataInfo: {},
-      avatarUrl:
-        "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
       dataList: [],
     };
   },
+  computed: {
+        // 将 getter 映射到当前组件的计算属性
+        ...mapGetters(['userInfo','avatar'])
+  },
   created() {
     this.getSignInfo();
-    this.getUserInfo();
   },
   methods: {
     // 点击日期
@@ -127,12 +112,6 @@ export default {
     changeMonth(date) {
       console.log(date);
     },
-    getUserInfo() {
-      useInfo().then((response) => {
-        this.dataInfo = response.data.data;
-        this.avatarUrl = this.dataInfo.httpFile + this.dataInfo.headImage;
-      });
-    },
     getSignInfo() {
       signInfo().then((response) => {
           this.markDate = response.data.data.signDays;
@@ -148,7 +127,7 @@ export default {
           type: 'success'
         });
         this.getSignInfo();
-        this.getUserInfo();
+        this.$store.dispatch('GetUserInfo');
       });
     },
     // 保存滚动值,这是兼容的写法
@@ -436,7 +415,7 @@ export default {
 }
 
 .info .info-item {
-  font-size: 1rem;
+  font-size: 14px;
   display: flex;
   justify-content: space-between;
   line-height: 1.5rem;

+ 4 - 2
src/views/HomeView/WelfareList.vue

@@ -164,8 +164,10 @@ export default {
 }
 
 .prize-card .img-container .prize-img {
-    max-height: 120px;
-    max-width: 120px;
+    width: 100%;
+    height: 100%;
+    /* max-height: 159px;
+    max-width: 223px; */
 }
 
 .prize-card .content {

+ 5 - 0
yarn.lock

@@ -6995,6 +6995,11 @@ vue@^2.6.14:
     "@vue/compiler-sfc" "2.7.14"
     csstype "^3.1.0"
 
+vuex@3.0.1:
+  version "3.0.1"
+  resolved "https://registry.npmmirror.com/vuex/-/vuex-3.0.1.tgz#e761352ebe0af537d4bb755a9b9dc4be3df7efd2"
+  integrity sha512-wLoqz0B7DSZtgbWL1ShIBBCjv22GV5U+vcBFox658g6V0s4wZV9P4YjCNyoHSyIBpj1f29JBoNQIqD82cR4O3w==
+
 watchpack@^2.4.0:
   version "2.4.0"
   resolved "https://registry.npmmirror.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d"