|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="slide-box">
|
|
|
- <tantan ref="jmList" @onChange="change" @onClickImage="clickImage"></tantan>
|
|
|
+ <tantan ref="jmList" @onChange="getDiscoverList" @onClickImage="clickImage"></tantan>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -26,7 +26,6 @@ export default {
|
|
|
|
|
|
mounted() {
|
|
|
|
|
|
- // this.change({'currentIndex':1})
|
|
|
this.getDiscoverList()
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -34,74 +33,43 @@ export default {
|
|
|
if(this.isAjax){
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
this.isAjax=true
|
|
|
getDiscoverList({'count':10}).then((res)=>{
|
|
|
this.isAjax=false
|
|
|
- this.list=res
|
|
|
- let arr=[]
|
|
|
- res.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 = {
|
|
|
- image: galleryUrls[0],
|
|
|
- images: galleryUrls,
|
|
|
- imgIndex:0,
|
|
|
- title: item.nickname,
|
|
|
- age: age,
|
|
|
- online: item.online,
|
|
|
- longitude: item.longitude,
|
|
|
- latitude: item.latitude,
|
|
|
- distance: 17,
|
|
|
- city: item.province+' '+item.city,
|
|
|
- weChat: item.wechatId,
|
|
|
- animation:{}
|
|
|
+ if(res.code===0){
|
|
|
+ this.list=res
|
|
|
+ let arr=[]
|
|
|
+ res.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 = {
|
|
|
+ image: galleryUrls[0],
|
|
|
+ images: galleryUrls,
|
|
|
+ imgIndex:0,
|
|
|
+ title: item.nickname,
|
|
|
+ userId: item.userId,
|
|
|
+ age: age,
|
|
|
+ online: item.online,
|
|
|
+ longitude: item.longitude,
|
|
|
+ latitude: item.latitude,
|
|
|
+ distance: 17,
|
|
|
+ city: item.province+' '+item.city,
|
|
|
+ weChat: item.wechatId,
|
|
|
+ animation:{}
|
|
|
+ }
|
|
|
+ console.log(newdata)
|
|
|
+ arr.push(newdata)
|
|
|
}
|
|
|
- console.log(newdata)
|
|
|
- arr.push(newdata)
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- this.$refs.jmList.setData(arr)
|
|
|
- })
|
|
|
- },
|
|
|
|
|
|
- change(data) {
|
|
|
- // 判断倒数
|
|
|
- let arr=[]
|
|
|
- // 模拟一下最加数据
|
|
|
- const tu = [
|
|
|
- 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2Fc7a27a1ej00qvpu700019c000hs00vlc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
|
|
- 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F9f81e6aaj00qvpu70001xc000hs00vmc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
|
|
- 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F55bf2cb3j00qvpu70002cc000hs012jc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
|
|
- 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F2017725bj00qvpu70001jc000hs00zxc.jpg&thumbnail=660x2147483647&quality=80&type=jpg'
|
|
|
- ]
|
|
|
- for (let index = 0; index < 10; index++) {
|
|
|
- const n = Math.floor(Math.random() * (tu.length - 1))
|
|
|
- let newdata = {
|
|
|
- image: tu[n],
|
|
|
- images: [
|
|
|
- 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2Fc7a27a1ej00qvpu700019c000hs00vlc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
|
|
- 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F9f81e6aaj00qvpu70001xc000hs00vmc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
|
|
- 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F55bf2cb3j00qvpu70002cc000hs012jc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
|
|
- 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0704%2F2017725bj00qvpu70001jc000hs00zxc.jpg&thumbnail=660x2147483647&quality=80&type=jpg'
|
|
|
- ],
|
|
|
- imgIndex:0,
|
|
|
- title: '你好',
|
|
|
- age: '19',
|
|
|
- distance: '19.6',
|
|
|
- city: '香港九龙城',
|
|
|
- weChat: 'siococos',
|
|
|
- animation:{}
|
|
|
+ })
|
|
|
+ this.$refs.jmList.setData(arr)
|
|
|
}
|
|
|
- arr.push(newdata)
|
|
|
- }
|
|
|
- this.$refs.jmList.setData(arr)
|
|
|
- // console.log(data);
|
|
|
+
|
|
|
+ })
|
|
|
},
|
|
|
clickImage(data) {
|
|
|
console.log(data);
|