瀏覽代碼

no message

sys 1 年之前
父節點
當前提交
f6341f633c

+ 8 - 0
api/my.js

@@ -0,0 +1,8 @@
+import { request } from '@/service/ajax'
+// 商品模块路由
+const goodsUrl = '/admin/'
+// 猜你喜欢
+export const getMemberInfo = (data) => request(goodsUrl + 'myself', 'get', {  })
+export const getMyMoments = (data) => request(goodsUrl + 'myself/myMoments', 'get', data)
+export const getMyLikeMoments = (data) => request(goodsUrl + 'myself/moments', 'get', data)
+

+ 6 - 0
api/utility.js

@@ -0,0 +1,6 @@
+import { request } from '@/service/ajax'
+// 商品模块路由
+const goodsUrl = '/admin/'
+// 猜你喜欢
+export const getScreenDict = (data) => request(goodsUrl + 'utility/getDict/app_user_filter_hobby,%20app_user_filter_constellation,%20app_user_filter_purpose', 'get', {  })
+

+ 28 - 2
pages/common/dynamic/dynamic-items.vue

@@ -19,7 +19,6 @@
           </view>
       </view>
     </view>
-    {{list.length}}
     <view class="dynamic-item" v-for="(item,itemIndex) in list">
       <view class="dynamic-title">
         <view class="dynamic-title-left" v-if="item.dateArr.length>0">
@@ -82,10 +81,14 @@ import DynamicTag from "@/pages/common/tag/dynamic-tag";
 import {getMoments} from "@/api/discovery";
 import tools from "@/service/tools";
 import {setLike, setUnLike} from "@/api/community";
+import {getMyMoments} from "@/api/my";
 export default {
   name: "dynamic-items",
   components: {DynamicTag, ImgThree, ImgTwo, ImgOne},
   props: {
+    type:{
+      default:1
+    },
     userId:{
       default:0
     },
@@ -139,7 +142,30 @@ export default {
       this.isAjax=false
       this.total=undefined
       this.page=1
-      this.getMoments()
+      if(this.type===1){
+        this.getMoments()
+      }else {
+        this.getMyMoments()
+      }
+
+    },
+    getMyMoments(){
+      if(this.isAjax){
+        return
+      }
+      this.isAjax=true
+      let that=this
+      getMyMoments({'userId':this.userId,'pageNo':this.page,'pageSize':20}).then((res)=>{
+        this.isAjax=false
+        if(res.code===0){
+          res.data.data.forEach((item)=>{
+            item.dateArr=tools.getDateArr(item.createdAt)
+            that.list.push(item )
+          })
+          ++that.page
+          that.total=res.data.total
+        }
+      })
     },
     getMoments(){
       if(this.isAjax){

+ 8 - 1
pages/common/img/img-three.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="img-box">
     <view class="img-item" v-for="(fileItem,fileIndex) in fileList">
-      <image :src="fileItem" @click.stop="previewImage(fileIndex)" mode="aspectFill"></image>
+      <image :class="{'image-two':type===2}" :src="fileItem" @click.stop="previewImage(fileIndex)" mode="aspectFill"></image>
     </view>
   </view>
 </template>
@@ -13,6 +13,9 @@ export default {
   props: {
     fileList:{
       default:[]
+    },
+    type:{
+      default:1
     }
   },
   data() {
@@ -46,6 +49,10 @@ export default {
       height: calc((100vw - 214rpx)/3);
       border-radius: 16rpx;
     }
+    .image-two{
+      width: calc((100vw - 288rpx)/3);
+      height: calc((100vw - 288rpx)/3);
+    }
   }
   .img-item:nth-of-type(3n+0){
     margin-right:0;

+ 7 - 0
pages/index/model/screen-item.vue

@@ -87,6 +87,7 @@
 <script>
 	import cjSlider from '@/components/cj-slider/cj-slider.vue'
   import {getFilter} from "@/api/discovery";
+  import {getScreenDict} from "@/api/utility";
 	export default {
 		components: {
 			cjSlider,
@@ -110,8 +111,14 @@
 		},
 		mounted() {
       this.getFilter()
+      this.getScreenDict()
     },
     methods: {
+      getScreenDict(){
+        getScreenDict().then((res)=>{
+          console.log(res)
+        })
+      },
       getFilter(){
         getFilter().then((res)=>{
           console.log(res)

+ 47 - 19
pages/my/index.vue

@@ -2,25 +2,26 @@
   <view class="my-box">
     <my-nav @navHeight="setNavHeight"></my-nav>
     <view class="my-data" :style="{'height':'calc(100vh - '+navHeight+'rpx)'}">
-      <scroll-view :scroll-y="true" :style="{'height':'calc(100vh - '+navHeight+'rpx)'}">
+      <scroll-view :scroll-y="true" :style="{'height':'calc(100vh - '+navHeight+'rpx)'}" @scrolltolower="scrolltolower">
         <view class="my-item">
           <view class="my-content">
             <view class="content-basic">
               <view class="basic-left" @click="goToUrl(1)">
-                <image class="basic-img" src="/static/img/temporary/4.png" mode="aspectFill"></image>
+                <image class="basic-img" :src="memberInfo.avatar" mode="aspectFill"></image>
               </view>
               <view class="basic-right">
                 <view @click="goToUrl(1)" class="basic-name">
-                  <view class="name-text sys-color-black-0 sys-weight-600">出江湖救急</view>
-                  <view class="name-vip">
-                    <image class="name-img" src="/static/img/my/svip.png" mode="heightFix"></image>
+                  <view class="name-text sys-color-black-0 sys-weight-600">{{memberInfo.nickname}}</view>
+                  <view class="name-vip" v-show="memberInfo.vipLevel" >
+                    <image class="name-img" v-if="memberInfo.vipLevel==='VIP1'" src="/static/img/my/vip.png" mode="heightFix"></image>
+                    <image class="name-img" v-else src="/static/img/my/svip.png" mode="heightFix"></image>
                   </view>
-                  <view class="name-ok name-no">
+                  <view class="name-ok " :class="{'name-no':memberInfo.verified===false}">
                     <image class="name-img" src="/static/img/my/open.png" mode="heightFix"></image>
                   </view>
                 </view>
                 <view @click="goToUrl(1)" class="basic-signature sys-color-gray-9">
-                  都能拿到你
+                  {{memberInfo.slogan}}
                 </view>
                 <view class="basic-wallet">
                   <view class="wallet-item" @click="goToUrl(2)">
@@ -36,27 +37,27 @@
             </view>
             <view class="content-statistics">
               <view class="statistics-item" @click="goToUrl(4)">
-                <view class="statistics-num sys-color-black sys-weight-600">431
-                  <view class="statistics-dot sys-color-white">1</view>
+                <view class="statistics-num sys-color-black sys-weight-600">{{memberInfo.mylikeCount}}
+                  <view class="statistics-dot sys-color-white" v-show="memberInfo.newMylikeCount>0">{{memberInfo.newMylikeCount>99?'..':memberInfo.newMylikeCount}}</view>
                 </view>
                 <view class="statistics-text sys-color-gray-9 sys-weight-400">礼物墙</view>
               </view>
               <view class="statistics-item" @click="goToUrl(5)">
-                <view class="statistics-num sys-color-black sys-weight-600">431
-                  <view class="statistics-dot sys-color-white">1</view>
+                <view class="statistics-num sys-color-black sys-weight-600">{{memberInfo.mylikeCount}}
+                  <view class="statistics-dot sys-color-white" v-show="memberInfo.newMylikeCount>0">{{memberInfo.newMylikeCount>99?'..':memberInfo.newMylikeCount}}</view>
                 </view>
                 <view class="statistics-text sys-color-gray-9 sys-weight-400">心动足迹</view>
               </view>
               <view class="statistics-item" @click="goToUrl(6)">
-                <view class="statistics-num sys-color-black sys-weight-600">431
-                  <view class="statistics-dot sys-color-white">1</view>
+                <view class="statistics-num sys-color-black sys-weight-600">{{memberInfo.guestCount}}
+                  <view class="statistics-dot sys-color-white" v-show="memberInfo.newGuestCount>0">{{memberInfo.newGuestCount>99?'..':memberInfo.newGuestCount}}</view>
                 </view>
                 <view class="statistics-text sys-color-gray-9 sys-weight-400">访客</view>
               </view>
               <view class="statistics-item" @click="goToUrl(7)">
                 <view class="statistics-num sys-color-black sys-weight-600">
-                  165
-                  <view class="statistics-dot sys-color-white">..</view>
+                  {{memberInfo.admireCount}}
+                  <view class="statistics-dot sys-color-white" v-show="memberInfo.newAdmireCount>0">{{memberInfo.newAdmireCount>99?'..':memberInfo.newAdmireCount}}</view>
                 </view>
                 <view class="statistics-text sys-color-gray-9 sys-weight-400">谁喜欢我</view>
 
@@ -99,10 +100,10 @@
         <view class="halving-line"></view>
         <view class="my-item">
           <view class="my-dynamic" v-if="tagNum===0">
-            <dynamic-items text-color="#141414" operate-color="#999999" tag-color="#999999" tag-bg="#F2F2F2" division-color="#F2F2F2" :show-add="true"></dynamic-items>
+            <dynamic-items :type="2" text-color="#141414" operate-color="#999999" tag-color="#999999" tag-bg="#F2F2F2" division-color="#F2F2F2" :show-add="true" ref="dynamicObj"></dynamic-items>
           </view>
-          <view class="my-praise">
-            <my-praise></my-praise>
+          <view class="my-praise" v-else>
+            <my-praise ref="praiseObj"></my-praise>
           </view>
         </view>
 
@@ -116,15 +117,42 @@
 import MyNav from "@/pages/my/model/my-nav";
 import DynamicItems from "@/pages/common/dynamic/dynamic-items";
 import MyPraise from "@/pages/my/model/my-praise";
+import {getMemberInfo} from "@/api/my";
 export default {
   components: {MyPraise, DynamicItems, MyNav},
   data() {
     return {
       navHeight:0,
-      tagNum:1
+      tagNum:0,
+      memberInfo:{
+        admireCount:'',
+        nickname:'',
+      }
     }
   },
+  onLoad(query) {
+    this.getMemberInfo()
+  },
   methods: {
+    scrolltolower(){
+      if(this.tagNum===0){
+        this.$refs.dynamicObj.getMyMoments()
+      }else {
+        this.$refs.praiseObj.getMyLikeMoments()
+      }
+    },
+    getMemberInfo(){
+      getMemberInfo().then((res)=>{
+        console.log(res)
+        if(res.code===0){
+          this.memberInfo=res.data
+        }else {
+          uni.reLaunch({
+            'url':'/pages/login/index'
+          })
+        }
+      })
+    },
     setNavHeight(navHeight){
       this.navHeight=navHeight
     },

+ 68 - 41
pages/my/model/my-praise.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="my-praise-box">
-		<view class="" v-show="tagNum == 0">
+		<view class="" v-show="false">
 				<view class="publish-box" v-show="publishBoxOff">
 				<image class="publish-img sys-radius-12" src="/static/img/circle/1.png" mode=""></image>
 				<view class="publish-text">
@@ -19,12 +19,12 @@
 				</view>
 			</view>
 		</view>
-	
-		<scroll-view class="recommended-box" scroll-x="true" v-show="tagNum == 2">
+
+		<scroll-view class="recommended-box" scroll-x="true" v-show="false">
 		 <view class="recommended-list" v-for="(item,i) in listTwo" :key="i" @click="goRecommended">
 		 	<image class="recommended-list-img sys-radius-16" :src="item.img" mode=""></image>
 		 	<view class="recommended-list-name">
-		 		<image class="list-name-img" src="../../../static/dgex-tantan/like.png" mode=""></image>
+		 		<image class="list-name-img" src="/static/dgex-tantan/like.png" mode=""></image>
 		 		<view class="sys-color-white sys-size-28">
 		 			{{item.text}}
 		 		</view>
@@ -43,22 +43,22 @@
 		 	</view>
 		 </view>
 		</scroll-view>
-		
+
     <view class="praise-item" @click="goToDetails" v-for="(item,itemIndex) in list">
       <view class="praise-left">
-        <image class="praise-head" src="/static/img/temporary/3.png" mode="aspectFill"></image>    
+        <image class="praise-head" :src="item.avatar" mode="aspectFill"></image>
       </view>
       <view class="praise-right">
         <view class="praise-top-data">
           <view class="praise-top-left">
             <view class="praise-top-left-title">
-              <view class="left-title-text sys-height-44 sys-color-black sys-weight-600">WWWWW</view>
+              <view class="left-title-text sys-height-44 sys-color-black sys-weight-600">{{item.nickname}}</view>
               <view class="left-title-vip">
                 <image class="left-title-vip-img" src="/static/img/my/vip.png" mode="heightFix"></image>
               </view>
 
             </view>
-            <view class="left-title-time sys-color-gray-9">2021-04-18 15:53发布.<100m</view>
+            <view class="left-title-time sys-color-gray-9">{{item.createdAt}}发布</view>
           </view>
           <view class="praise-top-right">
            <call></call>
@@ -66,20 +66,20 @@
         </view>
 
         <view class="right-text sys-color-black sys-weight-400">
-          我是阳光大男孩
+          {{item.content}}
         </view>
         <view class="right-img">
-          <view class="one-img" v-if="item.img.length===1">
-            <img-one :file-list="item.img"></img-one>
+          <view class="one-img" v-if="item.galleryUrls.length===1">
+            <img-one :file-list="item.galleryUrls"></img-one>
           </view>
-          <view class="two-img" v-else-if="item.img.length===2 || item.img.length===4">
-            <img-two :file-list="item.img"></img-two>
+          <view class="two-img" v-else-if="item.galleryUrls.length===2 || item.galleryUrls.length===4">
+            <img-two :file-list="item.galleryUrls"></img-two>
           </view>
           <view class="three-img" v-else>
-            <img-three :file-list="item.img"></img-three>
+            <img-three :type="2" :file-list="item.galleryUrls"></img-three>
           </view>
         </view>
-        <view class="right-tag-list" 	>
+        <view class="right-tag-list"  v-if="false"	>
           <dynamic-tag :list="item.tag" :tag-bg="tagBg" :tag-color="tagColor"></dynamic-tag>
         </view>
         <view class="right-operation-list">
@@ -92,14 +92,14 @@
           <view class="operation-items">
             <view class="operation-item">
               <view class="operation-icon" @click="setLike(itemIndex)">
-                <text class="iconfont icon-dianzan" v-if="!item.isLike"  :style="{'color':operateColor}"> &#xe8ad;</text>
+                <text class="iconfont icon-dianzan" v-if="!item.liked"  :style="{'color':operateColor}"> &#xe8ad;</text>
                 <text class="iconfont icon-dianzan1" v-else  :style="{'color':'#ED301D'}"> &#xe8c3;</text>
               </view>
-              <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.likeNum>0?item.likeNum:'点赞'}}</view>
+              <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.likeCount>0?item.likeCount:'点赞'}}</view>
             </view>
             <view class="operation-item">
               <view class="operation-icon"><text class="iconfont icon-pinglun"  :style="{'color':operateColor}">&#xe891;</text></view>
-              <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.evaluateNum>0?item.evaluateNum:'评论'}}</view>
+              <view class="operation-text sys-weight-400" :style="{'color':operateColor}">{{item.commentCount>0?item.commentCount:'评论'}}</view>
             </view>
           </view>
 
@@ -117,6 +117,9 @@ import ImgTwo from "@/pages/common/img/img-two";
 import ImgThree from "@/pages/common/img/img-three";
 import DynamicTag from "@/pages/common/tag/dynamic-tag";
 import Call from "@/pages/common/call/call";
+import {setLike, setUnLike} from "@/api/community";
+import {getMyLikeMoments, getMyMoments} from "@/api/my";
+import tools from "@/service/tools";
 export default {
   name: "my-praise",
   components: {Call, DynamicTag, ImgThree, ImgTwo, ImgOne},
@@ -129,35 +132,59 @@ export default {
       tagColor:'#999999',
       operateColor:'#999999',
       list:[
-        {'text':'我是阳光大男孩我','img':['/static/img/temporary/1.png'],'tag':[{'text':'南亭新都会商场','icon':'1'},{'text':'你好认识一哈','icon':'2'}],'likeNum':1,'evaluateNum':0,'isLike':true},
-        {'text':'我是阳光大男孩我','img':['/static/img/temporary/1.png','/static/img/temporary/2.png','/static/img/temporary/3.png','/static/img/temporary/2.png'],'tag':[{'text':'南亭新都会商场','icon':'1'},{'text':'你好认识一哈','icon':'2'}],'likeNum':0,'evaluateNum':20,'isLike':false},
-        {'text':'我是阳光大男孩我','img':[
-            '/static/img/temporary/1.png',
-            '/static/img/temporary/3.png',
-            '/static/img/temporary/2.png',
-            '/static/img/temporary/1.png',
-            '/static/img/temporary/3.png',
-            '/static/img/temporary/2.png',
-          ],'tag':[{'text':'南亭新都会商场','icon':'1'},{'text':'你好认识一哈','icon':'2'}],'likeNum':10,'evaluateNum':20,'isLike':true},
+
       ],
 			listTwo:[
-				{'text':'24h照片营业馆','img':'/static/img/temporary/1.png','icon':['/static/img/temporary/1.png','/static/img/temporary/1.png'],'num':'815.4w'},
-				{'text':'24h照片营业馆','img':'/static/img/temporary/1.png'},{'img':'/static/img/login/2.jpg','text':'24h照片营业馆'},{'img':'/static/img/login/2.jpg','text':'24h照片营业馆'},
+
 			],
-			publishBoxOff:true
+			publishBoxOff:true,
+      isAjax:false,
+      total:undefined,
+      page:1,
     }
   },
   watch: {},
   mounted() {
-
+    this.startList()
   },
   methods: {
+    startList(){
+      if(this.userId<=0){
+        // return false
+      }
+      this.list=[]
+      this.isAjax=false
+      this.total=undefined
+      this.page=1
+      this.getMyLikeMoments()
+
+    },
+    getMyLikeMoments(){
+      if(this.isAjax){
+        return
+      }
+      this.isAjax=true
+      let that=this
+      getMyLikeMoments({'userId':this.userId,'pageNo':this.page,'pageSize':20}).then((res)=>{
+        this.isAjax=false
+        if(res.code===0){
+          res.data.data.forEach((item)=>{
+            item.dateArr=tools.getDateArr(item.createdAt)
+            that.list.push(item )
+          })
+          ++that.page
+          that.total=res.data.total
+        }
+      })
+    },
     setLike(index){
-      this.list[index].isLike=!this.list[index].isLike
-      if(this.list[index].isLike){
-        ++this.list[index].likeNum
+      this.list[index].liked=!this.list[index].liked
+      if(this.list[index].liked){
+        ++this.list[index].likeCount
+        setLike( this.list[index].id).then((res)=>{})
       }else {
-        --this.list[index].likeNum
+        --this.list[index].likeCount
+        setUnLike( this.list[index].id).then((res)=>{})
       }
     },
     goToDetails(){
@@ -191,30 +218,30 @@ export default {
 		position: relative;
 		align-items: center;
 		box-sizing: border-box;
-	
+
 		.publish-img {
 			width: 120rpx;
 			height: 120rpx;
 			flex-shrink: 0;
 		}
-	
+
 		.publish-text {
 			.publish-title {
 				margin: 0 0 8rpx 0;
 			}
 		}
-	
+
 		.publish-button {
 			flex-shrink: 0;
 			padding: 6rpx 32rpx;
 		}
-	
+
 		.off-button {
 			position: absolute;
 			right: 0;
 			top: 0;
 			padding: 0rpx 2rpx 6rpx 12rpx;
-	
+
 			.off-img {
 				width: 24rpx;
 				height: 24rpx;

+ 1 - 1
service/ajax.js

@@ -13,7 +13,7 @@ export const request = (url, method, data, show = false) => {
   console.log(url)
   let token=uni.getStorageSync('token')
   let userId=uni.getStorageSync('userId')
-  data.userId=userId
+  // data.userId=userId
   let header={
     'content-type': 'application/json',
     'hversion': '1.0',