|
@@ -38,7 +38,7 @@
|
|
|
<image :style="{height: item.boxHeight + 'px',width:item.boxWidth+'px'}" mode="aspectFill" :src="item.image" ></image>
|
|
<image :style="{height: item.boxHeight + 'px',width:item.boxWidth+'px'}" mode="aspectFill" :src="item.image" ></image>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="user-authentication">
|
|
|
|
|
|
|
+ <view class="user-authentication" v-show="item.verified">
|
|
|
<image class="authentication-img" mode="aspectFill" src="/static/img/index/authentication.png" ></image>
|
|
<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 class="authentication-text sys-color-white sys-weight-600">真实头像</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -61,7 +61,7 @@
|
|
|
<text class="user-item sys-color-white sys-weight-600">{{item.age}}</text>
|
|
<text class="user-item sys-color-white sys-weight-600">{{item.age}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="user-city">
|
|
<view class="user-city">
|
|
|
- <text class="city-item sys-color-yellow sys-weight-600">17.16</text>
|
|
|
|
|
|
|
+ <text class="city-item sys-color-yellow sys-weight-600">{{item.distance}}</text>
|
|
|
<text class="city-item sys-color-white sys-weight-400">km</text>
|
|
<text class="city-item sys-color-white sys-weight-400">km</text>
|
|
|
<text class="city-item sys-color-white sys-weight-600">{{item.city}}</text>
|
|
<text class="city-item sys-color-white sys-weight-600">{{item.city}}</text>
|
|
|
</view>
|
|
</view>
|
|
@@ -157,7 +157,6 @@
|
|
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
|
const res = uni.getSystemInfoSync()
|
|
const res = uni.getSystemInfoSync()
|
|
|
- console.log(res)
|
|
|
|
|
this.winWidth = res.windowWidth
|
|
this.winWidth = res.windowWidth
|
|
|
this.winHeight = res.windowHeight-84
|
|
this.winHeight = res.windowHeight-84
|
|
|
|
|
|
|
@@ -178,7 +177,9 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- setData(list){
|
|
|
|
|
|
|
+ async setData(list){
|
|
|
|
|
+
|
|
|
|
|
+ let isNew=false
|
|
|
list.forEach((item)=>{
|
|
list.forEach((item)=>{
|
|
|
item.imgIndex=0
|
|
item.imgIndex=0
|
|
|
item.moveX=0
|
|
item.moveX=0
|
|
@@ -187,13 +188,16 @@
|
|
|
if( this.list.length<=0){
|
|
if( this.list.length<=0){
|
|
|
item.boxWidth=this.winWidth-18
|
|
item.boxWidth=this.winWidth-18
|
|
|
item.boxHeight=this.winHeight
|
|
item.boxHeight=this.winHeight
|
|
|
|
|
+ isNew=true
|
|
|
}else {
|
|
}else {
|
|
|
item.boxWidth=this.winWidth-28
|
|
item.boxWidth=this.winWidth-28
|
|
|
item.boxHeight=this.winHeight-30
|
|
item.boxHeight=this.winHeight-30
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
this.list.push(item)
|
|
this.list.push(item)
|
|
|
})
|
|
})
|
|
|
|
|
+ if(isNew && this.list.length>0){
|
|
|
|
|
+ this.list[0].distance=await tools.getDistance(this.list[0].latitude,this.list[0].longitude)
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
setImgKey(item, type){
|
|
setImgKey(item, type){
|
|
|
if(this.animationData){
|
|
if(this.animationData){
|
|
@@ -362,45 +366,29 @@
|
|
|
this.setBox(index+1,3)
|
|
this.setBox(index+1,3)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- setLike(userId){
|
|
|
|
|
- setLike(userId).then((res)=>{
|
|
|
|
|
- console.log(res)
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- setDislike(userId){
|
|
|
|
|
- setDislike(userId).then((res)=>{
|
|
|
|
|
- console.log(res)
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- touchEndNext(index) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ async touchEndNext(index) {
|
|
|
this.slideing = true;
|
|
this.slideing = true;
|
|
|
this.list[index].x = this.list[index].x * 5;
|
|
this.list[index].x = this.list[index].x * 5;
|
|
|
this.list[index].y = this.list[index].y * 5;
|
|
this.list[index].y = this.list[index].y * 5;
|
|
|
this.list[index].moveX *= 5 ;
|
|
this.list[index].moveX *= 5 ;
|
|
|
this.list[index].angleNum *= 5;
|
|
this.list[index].angleNum *= 5;
|
|
|
this.setBox(this.currentIndex+1,1)
|
|
this.setBox(this.currentIndex+1,1)
|
|
|
- console.log(this.list[this.currentIndex])
|
|
|
|
|
- if(this.love !== 0){
|
|
|
|
|
- //选择了喜欢
|
|
|
|
|
- this.setLike(this.list[this.currentIndex].userId)
|
|
|
|
|
- }else {
|
|
|
|
|
- //选择了不喜欢
|
|
|
|
|
- this.setDislike(this.list[this.currentIndex].userId)
|
|
|
|
|
- }
|
|
|
|
|
- this.touchEndDone()
|
|
|
|
|
|
|
+ let newIndex=this.currentIndex+1
|
|
|
|
|
+ this.list[newIndex].distance=await tools.getDistance(this.list[newIndex].latitude,this.list[newIndex].longitude)
|
|
|
|
|
+
|
|
|
|
|
+ await this.touchEndDone()
|
|
|
},
|
|
},
|
|
|
touchEndDone() {
|
|
touchEndDone() {
|
|
|
-
|
|
|
|
|
|
|
+ this.$emit('onChange', {
|
|
|
|
|
+ currentIndex: this.currentIndex,
|
|
|
|
|
+ currentItem: this.list[this.currentIndex],
|
|
|
|
|
+ type: this.love !== 0 ? 'love' : 'dislike'
|
|
|
|
|
+ })
|
|
|
return new Promise((resolve) => {
|
|
return new Promise((resolve) => {
|
|
|
this.imgKey=0
|
|
this.imgKey=0
|
|
|
- setTimeout(() => {
|
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
this.slideing = false
|
|
this.slideing = false
|
|
|
- this.$emit('onChange', {
|
|
|
|
|
- currentIndex: this.currentIndex,
|
|
|
|
|
- currentItem: this.list[this.currentIndex],
|
|
|
|
|
- type: this.love !== 0 ? 'love' : 'dislike'
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
this.currentIndex++
|
|
this.currentIndex++
|
|
|
this.x.move = 0
|
|
this.x.move = 0
|
|
|
this.y.move = 0
|
|
this.y.move = 0
|