第一次提交

This commit is contained in:
gxwebsoft
2023-08-04 13:14:48 +08:00
commit 1b923e5cff
1030 changed files with 128016 additions and 0 deletions

View File

@@ -0,0 +1,251 @@
<template>
<view class="container">
<view class="user-list">
<block v-for="(item,index) in list" :key="index">
<view class="item" v-if="item.userInfo" @click="$push('sub_pages/member/detail/detail',{userId: item.userId})">
<view class="has-house-num">
南宁1套
</view>
<view class="content">
喜欢极限运动摩托健身旅游看书等事业单位正式工作收入稳定想找个聊得...
</view>
<view class="user-info">
<view class="left">
<view class="avatar">
<u-avatar size="25" :src="item.userInfo.avatar"
customStyle="margin-right:5px; border: 4rpx solid #ffffff;"></u-avatar>
<view class="nickname">{{ item.userInfo.nickname }}</view>
</view>
<view class="desc">
南宁 31 20w-30w
</view>
</view>
<view class="follow-btn" @click.stop="onFollow">
<image src="@/static/icon/follow.png" mode="widthFix"></image>
<text>关注</text>
</view>
</view>
<view class="bg-color"></view>
<image class="bg" :src="item.userBgImg" mode="aspectFill"></image>
</view>
</block>
<!-- <u-list @scrolltolower="scrolltolower">
<view class="list">
<u-list-item v-for="(item, index) in list" :key="index">
<u-cell :title="`${item.userInfo.nickname}`" :label="`粉丝:${ item.id }`" isLink
@click="navTo('/pages/member/detail/detail',{userId: item.userId})">
<u-avatar slot="icon" size="50" :src="item.userInfo.avatar"
customStyle="margin: -3px 5px -3px 0"></u-avatar>
<view slot="right-icon" class="follow-btn" @click.stop="onFollow">
<image src="@/static/icon/follow.png" mode="widthFix"></image>
<text>关注</text>
</view>
</u-cell>
</u-list-item>
<u-empty
v-if="list.length == 0"
mode="search"
icon="http://cdn.uviewui.com/uview/empty/car.png"
>
</u-empty>
</view>
</u-list> -->
</view>
</view>
</template>
<script>
import * as UserProfileApi from '@/api/love-user-profile.js'
export default {
data() {
return {
list: [],
page: 0,
where: {},
// 控制onShow事件是否刷新订单列表
canReset: false,
disabled: false
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.where = options
this.onRefreshList()
uni.setNavigationBarTitle({
title: options.name
})
},
onPullDownRefresh(){
const app = this
setTimeout(function() {
uni.stopPullDownRefresh();
app.onRefreshList()
}, 500);
},
methods: {
// 刷新会员列表
onRefreshList() {
const app = this
app.where.page = app.page
return new Promise((resolve, reject) => {
UserProfileApi.pageUserProfile(app.where)
.then(result => {
const list = result.data.list
// 合并新数据
app.list = app.list.concat(list)
if(result.data.count > app.list.length){
app.canReset = true
}else{
app.canReset = false
}
// 获取第一张图片作为背景图片
list.map((d, i) => {
if(!app.list[i].userBgImg){
const imgs = JSON.parse(d.images)
console.log("imgs: ",imgs);
imgs.map(pic => {
console.log("pic: ",pic);
if (pic.type == 'image') {
app.list[i].userBgImg = pic.url
}
})
}
})
resolve(list)
})
})
},
scrolltolower(e){
console.log("e: ",e);
},
navTo(url,userId){
this.$push(url,userId)
},
onFollow(e){
console.log("e11: ",e);
},
onSearch(){
this.list = []
this.where.page = 1
this.onRefreshList()
}
}
}
</script>
<style lang="scss" scoped>
.container {
padding: 0 20rpx;
background-color: #ffffff;
}
.search-wrapper {
display: flex;
height: 64rpx;
}
.user-list{
.item{
margin: 40rpx auto;
width: 660rpx;
min-height: 500rpx;
background-color: #f3f3f3;
border-radius: 15rpx;
position: relative;
z-index: 0;
overflow: hidden;
/* 背景叠加 */
.bg-color {
position: absolute;
top: 0;
z-index: 1;
width: 660rpx;
height: 365rpx;
background-color: #000000;
opacity: .2;
filter: Alpha(opacity=20);
}
.bg{
position: absolute;
top: 0;
z-index: 0;
width: 660rpx;
}
.has-house-num{
position: absolute;
top: 20rpx;
left: 20rpx;
z-index: 3;
height: 43rpx;
line-height: 43rpx;
padding: 4rpx 20rpx;
color: #ffffff;
font-size: 26rpx;
border-radius: 10rpx;
margin-right: 40rpx;
background: linear-gradient(#47076b, #8d1a50);
}
.content{
width: 640rpx;
position: absolute;
top: 250rpx;
color: #ffffff;
font-size: 28rpx;
padding: 20rpx;
z-index: 2;
}
.user-info{
width: 660rpx;
height: 100rpx;
padding: 20rpx;
position: absolute;
bottom: 0;
z-index: 1;
background-color: #1b0121;
color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
.left{
display: flex;
flex-direction: column;
justify-content: space-between;
.avatar{
display: flex;
align-items: center;
.nickname{
font-size: 26rpx;
}
}
.desc{
color: #999999;
font-size: 26rpx;
}
}
.follow-btn {
width: 85rpx;
height: 43rpx;
padding: 4rpx 20rpx;
color: #ffffff;
font-size: 26rpx;
border-radius: 10rpx;
margin-right: 40rpx;
background: linear-gradient(#47076b, #8d1a50);
image {
width: 24rpx;
height: 36rpx;
margin-right: 6rpx;
}
}
}
}
}
</style>

171
pages/zone/zone.vue Normal file
View File

@@ -0,0 +1,171 @@
<template>
<view class="container">
<view class="category" @click="$push('pages/zone/member/member',{name: '有车有房',desc: '0.9w人'})">
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/0036e686027d4994ab03de5cbd0caf34.png" mode="widthFix"></image>
</view>
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/03a95e32bc094c09bf56c3ac3ff78f0d.jpeg" mode="widthFix"></image>
</view>
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/b37e315c128241f69d3a7fa5a54fea23.jpeg" mode="widthFix"></image>
</view>
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/26f0ed191b174478b10a510991d18262.jpeg" mode="widthFix"></image>
</view>
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/60b27769b8bb4a0d822a6219ed8767bc.jpeg" mode="widthFix"></image>
</view>
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/03a95e32bc094c09bf56c3ac3ff78f0d.jpeg" mode="widthFix"></image>
</view>
</view>
<view class="category" @click="$push('pages/zone/member/member',{name: '精选人类90后',desc: '1w+人'})">
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/0036e686027d4994ab03de5cbd0caf34.png" mode="widthFix"></image>
</view>
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/03a95e32bc094c09bf56c3ac3ff78f0d.jpeg" mode="widthFix"></image>
</view>
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/b37e315c128241f69d3a7fa5a54fea23.jpeg" mode="widthFix"></image>
</view>
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/26f0ed191b174478b10a510991d18262.jpeg" mode="widthFix"></image>
</view>
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/60b27769b8bb4a0d822a6219ed8767bc.jpeg" mode="widthFix"></image>
</view>
<view class="item">
<image src="https://file.wsdns.cn/thumbnail/20230604/03a95e32bc094c09bf56c3ac3ff78f0d.jpeg" mode="widthFix"></image>
</view>
</view>
</view>
</template>
<script>
import store from '@/store/index.js'
import * as DictApi from '@/api/dict.js'
import * as UserProfileApi from '@/api/love-user-profile.js'
import mixin from '@/core/mixins/tabbar'
export default {
mixins: [mixin],
data() {
return {
list: [
{
name: '有房有车'
},
{
name: '人类精选90后'
}
],
user: {},
avatar: '/static/logo.png',
nickName: 'Hello',
latitude: 22.766777,
longitude: 108.375152,
scale: 10,
isLogin: false,
// #ifdef MP-ALIPAY
canIUseAuthButton: my.canIUse('button.open-type.getAuthorize'),
// #endif
}
},
onLoad() {
this.getLocation(res => {
if (res.latitude && res.longitude) {
app.latitude = res.latitude
app.longitude = res.longitude
app.scale = 16
}
})
this.getDict()
},
onShow() {
// this.getUserInfo()
},
methods: {
getDict() {
DictApi.getDictionaryOptions({dictCode: 'zone'}).then(res => {
this.dict = res.data;
})
},
getUserInfo() {
const {
form
} = this
const app = this
getUser().then(res => {
console.log(res);
if (res.code == 0 && res.data) {
app.isLogin = true
} else {
app.$error('请先登录', function() {
app.$navTo('pages/login/index');
});
return false;
}
})
},
// 检查是否登录
checkLogin() {
if (!!store.getters.userId && store.getters.userId != userId) {
this.isLogin = true
}
},
// 获取用户坐标
// 参考文档https://uniapp.dcloud.io/api/location/location?id=getlocation
getLocation(callback) {
const app = this
uni.getLocation({
success: callback,
fail() {
app.$toast('获取定位失败,请点击右下角按钮重新尝试定位')
app.isAuthor = false
}
})
},
// 跳转页面
navTo(url) {
this.$navTo(url)
},
scan() {
const app = this
this.$navTo('pages/order/get-food/get-food')
// 只允许从相机扫码
// uni.scanCode({
// success (res) {
// console.log("res: ",res);
// }
// })
}
}
}
</script>
<style lang="scss" scoped>
.category{
width: 681rpx;
margin: 30rpx auto;
background-color: #ffffff;
border-radius: 12rpx;
overflow: hidden;
display: flex;
flex-wrap: wrap;
.item{
width: 220rpx;
height: 240rpx;
overflow: hidden;
image{
width: 100%;
}
}
}
</style>