Bladeren bron

增加生日祝福功能

sunlupeng 1 jaar geleden
bovenliggende
commit
6b734e61ad

BIN
src/assets/image/birthday.png


+ 1 - 1
src/views/HomeView/Index.vue

@@ -20,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>

+ 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;
 }

+ 3 - 0
src/views/HomeView/RedeemView.vue

@@ -490,6 +490,7 @@ export default {
                     skuId: this.data.skuId,
                     skuCount: this.skuCount,
                     price:this.data.price,
+                    deliveryType:this.deliveryType,
                     contact: this.name,
                     contactPhone: this.phone,
                     contactAddr: this.address,
@@ -502,6 +503,7 @@ export default {
                     skuId: this.data.skuId,
                     skuCount: this.skuCount,
                     price:this.data.price,
+                    deliveryType:this.deliveryType,
                     contactPhone: this.phoneNumber,
 
                     skuType: this.data.skuType,
@@ -512,6 +514,7 @@ export default {
                     skuId: this.data.skuId,
                     skuCount: this.skuCount,
                     price:this.data.price,
+                    deliveryType:this.deliveryType,
                     reclaimAddr:this.reclaimAddr,
 
                     skuType: this.data.skuType,