Преглед на файлове

Merge branch 'master' of http://git.lcpcp.cc/root/lcoco

# Conflicts:
#	pages/index/model/screen-item.vue
py преди 1 година
родител
ревизия
344ac7146b

+ 7 - 0
api/community.js

@@ -0,0 +1,7 @@
+import { request } from '@/service/ajax'
+// 商品模块路由
+const goodsUrl = '/admin/community/'
+// 猜你喜欢
+export const setUnLike = (data) => request(goodsUrl + 'unLike/'+data, 'post', {  })
+export const setLike = (data) => request(goodsUrl + 'like/'+data, 'post', {  })
+

+ 3 - 1
api/discovery.js

@@ -4,7 +4,9 @@ const goodsUrl = '/admin/discovery/'
 // 猜你喜欢
 export const getMoments = (data) => request(goodsUrl + 'moments', 'get', { ...data })
 export const getDiscoverList = (data) => request(goodsUrl + 'list', 'get', { ...data })
-export const getNearbyList = (data) => request(goodsUrl + 'nearby', 'get', { ...data })
+export const getNearbyList = (data) => request(goodsUrl + 'nearby', 'post', { ...data })
 export const setLike = (data) => request(goodsUrl + 'right/'+data, 'get', {  })
 export const setDislike = (data) => request(goodsUrl + 'left/'+data, 'get', {  })
+export const setFilter = (data) => request(goodsUrl + 'filter', 'post', { ...data })
+export const getFilter = (data) => request(goodsUrl + 'filter', 'get', { ...data })
 

+ 1 - 1
components/dgex-tantan/dgex-tantan.vue

@@ -38,7 +38,7 @@
                 <image     :style="{height: item.boxHeight + 'px',width:item.boxWidth+'px'}"  mode="aspectFill" :src="item.image" ></image>
 
               </view>
-              <view class="user-authentication" v-show="item.verified">
+              <view class="user-authentication" v-show="item.realAvatar">
                 <image  class="authentication-img"     mode="aspectFill" src="/static/img/index/authentication.png" ></image>
                 <view class="authentication-text sys-color-white sys-weight-600">真实头像</view>
               </view>

+ 7 - 4
pages/common/dynamic/dynamic-items.vue

@@ -81,6 +81,7 @@ import ImgThree from "@/pages/common/img/img-three";
 import DynamicTag from "@/pages/common/tag/dynamic-tag";
 import {getMoments} from "@/api/discovery";
 import tools from "@/service/tools";
+import {setLike, setUnLike} from "@/api/community";
 export default {
   name: "dynamic-items",
   components: {DynamicTag, ImgThree, ImgTwo, ImgOne},
@@ -159,11 +160,13 @@ export default {
       })
     },
     setLike(index){
-      this.dynamicList[index].liked=!this.dynamicList[index].liked
-      if(this.dynamicListdynamicList[index].liked){
-        ++this.dynamicList[index].likeCount
+      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.dynamicList[index].likeCount
+        --this.list[index].likeCount
+        setUnLike( this.list[index].id).then((res)=>{})
       }
     }
   }

+ 6 - 2
pages/index/index.vue

@@ -6,7 +6,7 @@
         <slide-item></slide-item>
       </view>
       <view class="box-two" v-else-if="tabNum===1">
-        <attachment-list></attachment-list>
+        <attachment-list ref="attachmentObj"></attachment-list>
       </view>
       <view class="box-three" v-else>
         <attachment-list></attachment-list>
@@ -26,7 +26,11 @@ export default {
       tabNum:0
     }
   },
-
+  onReachBottom(){
+    if(this.tabNum===1){
+      this.$refs.attachmentObj.getAttachmentList()
+    }
+  },
   methods: {
     setTabNum(tabNum){
       this.tabNum=tabNum

+ 39 - 13
pages/index/model/attachment-list.vue

@@ -17,7 +17,7 @@
 
       </view>
     </view>
-    <view class="attachment-open">
+    <view class="attachment-open" v-show="isLock">
       <view class="open-data sys-background-yellow sys-radius-200">
         <image class="open-img" src="/static/img/common/lock.png" mode="aspectFill"></image>
         <view class="open-text sys-color-black sys-weight-500" >立即解锁</view>
@@ -34,13 +34,16 @@ import tools from "@/service/tools";
 export default {
   name: "attachment-list",
   components: {},
-  props: {},
+  props: {
+
+  },
   data() {
     return {
       page:1,
       total:undefined,
       isAjax:false,
       list:[],
+      isLock:false
     }
   },
   watch: {},
@@ -48,22 +51,45 @@ export default {
     this.getAttachmentList()
   },
   methods: {
+
     async  getAttachmentList(){
+      if(this.isLock && this.page>1 ){
+        return false
+      }
+      if(this.total<=this.list.length){
+        return false
+      }
+      if(this.isAjax){
+        return false
+      }
+      this.isAjax=true
       let locationData=await tools.getLocation()
       getNearbyList({'pageNo':this.page,'pageSize':20,'longitude':locationData.longitude,'latitude':locationData.latitude}).then((res)=>{
+        this.isAjax=false
         if(res.code===0){
-
+          this.page++
+          this.total=res.total
+          res.data.data.forEach( (item)=>{
+            let galleryUrls=item.galleryUrls
+            let age=tools.getAge(item.dateOfBirth)
+            if(galleryUrls.length>0){
+              if(galleryUrls.length>8){
+                galleryUrls=galleryUrls.slice(0,7)
+              }
+              let newdata = {
+                img: galleryUrls[0],
+                age:  age,
+                name:  item.nickname,
+                userId:  item.userId,
+                sex:  '女',
+                constellation:  '处女座',
+              }
+              this.list.push(newdata)
+            }
+          })
         }
       })
-      let list=[
-        {'name':'仰看辉煌仰看辉煌仰看辉煌仰看辉煌','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/1.png'},
-        {'name':'Maple','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/2.png'},
-        {'name':'仰看辉煌','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/3.png'},
-        {'name':'Maple','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/1.png'},
-        {'name':'仰看辉煌','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/2.png'},
-        {'name':'Maple','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/3.png'},
-      ];
-      this.list.push(...list)
+
     }
 
   }
@@ -128,7 +154,7 @@ export default {
   .attachment-open{
     position: fixed;
     left: 0;
-    bottom: 0;
+    bottom: 80rpx;
     width: 100vw;
     height: 190rpx;
     background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #FFFFFF 100%);

+ 8 - 1
pages/index/model/index-nav.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="">
     <view class="header"  :style="[{'height': customBarH + 'px', 'padding-top': statusBarH + 'px'}]">
-      <view class="header-left">
+      <view class="header-left" @click="goToUrl(1)">
         <view class="left-text sys-color-black-0 sys-weight-600">筛选</view>
         <view class="left-img">
           <image class="down-img" src="/static/img/common/down.png" mode="aspectFill"></image>
@@ -53,6 +53,13 @@
 
     },
     methods: {
+      goToUrl(type){
+        if(type===1){
+          uni.navigateTo({
+            'url':'/pages/index/model/screen-item'
+          })
+        }
+      },
       setTabNum(tabNum){
         if(this.tabNum!==tabNum){
           this.tabNum=tabNum

+ 15 - 3
pages/index/model/screen-item.vue

@@ -86,6 +86,10 @@
 
 <script>
 	import cjSliderTwo from '@/components/jxs-slider/jxs-slider.vue'
+	import cjSlider from '@/components/cj-slider/cj-slider.vue'
+	import {
+		getFilter
+	} from "@/api/discovery";
 	export default {
 		components: {
 			cjSliderTwo
@@ -107,17 +111,25 @@
 				sexId: 0,
 			};
 		},
-		mounted() {},
+		mounted() {
+			this.getFilter()
+		},
 		methods: {
+			getFilter() {
+				getFilter().then((res) => {
+					console.log(res)
+				})
+			},
 			scroll() {},
 			scrolltolower() {},
-			blockMoving() {
-				console.log('正在滑动中', this.age)
+			blockMoving(e) {
+				console.log('正在滑动中', e)
 			},
 			sliderChange(e) {
 				this.distance = e.detail.value
 			},
 			selsectSex(id) {
+				//点击没反应
 				this.sexId = id
 				console.log(id);
 			},

+ 1 - 1
pages/index/model/slide-item.vue

@@ -83,7 +83,7 @@ export default {
                 likeCount:  item.likeCount,
                 tagList:  item.tagList,
                 slogan:  item.slogan,
-                verified:  item.verified,
+                realAvatar:  item.realAvatar,
                 animation:{}
               }
               arr.push(newdata)