You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/pages/news/user/vip.vue

351 lines
8.5 KiB

11 months ago
<template>
<view class="user">
<view class="search">
10 months ago
<!-- <view class="box">
11 months ago
<image src="/static/news/icon-search.png"></image>
<input type="search" placeholder="商品名称/编码" />
10 months ago
</view> -->
10 months ago
<u-search placeholder="输入用户昵称/姓名/手机号" @search="searchhandle" shape="round" :show-action="false" height="60" bg-color="#ffffff" v-model="keyword"></u-search>
11 months ago
</view>
<view class="user-bd">
10 months ago
<view class="li" v-for="i in list" :key="i.user_id" @click="goVipDetails(i)">
11 months ago
<view class="a">
<view class="l">
10 months ago
<image :src="i.avatar_url?i.avatar_url:$picUrl+'/static/news/avater.png'"></image>
11 months ago
</view>
10 months ago
<view class="r">
<view class="m">
<view class="n">{{i.nick_name}}</view>
<view class="btn">{{i.user_type_text}}</view>
</view>
<view class="n">
<view>
<text>{{i.mobile}}</text>
10 months ago
<image @click.stop="copyText(i.mobile)" :src="$picUrl+'/static/news/icon-copy.png'" style="margin-top:-4rpx;"></image>
10 months ago
</view>
10 months ago
<image :src="$picUrl+'/static/news/tel.png'" @click.stop="makeCall(i.mobile)"></image>
10 months ago
</view>
</view>
<!-- <view class="m">
<view class="n">{{nick_name}}</view>
11 months ago
<view class="n">真实姓名张三</view>
10 months ago
<view class="n">{{mobile}}<image :src="$picUrl+'/static/news/icon-copy.png'"></image></view>
11 months ago
</view>
<view class="r">
11 months ago
<view class="btn">会员</view>
10 months ago
<image :src="$picUrl+'/static/news/tel.png'"></image>
10 months ago
</view> -->
11 months ago
</view>
<view class="b">
10 months ago
<view class="l">余额(<text>¥{{i.balance?i.balance:0.00}}</text></view>
10 months ago
<view class="l">积分(<text>{{i.points?i.points:0}}</text></view>
11 months ago
</view>
</view>
10 months ago
<!-- <view class="li" v-for="i in 2" :key="i">
11 months ago
<view class="a">
<view class="l">
10 months ago
<image :src="$picUrl+'/static/news/avater.png'"></image>
11 months ago
</view>
<view class="m">
<view class="n">昵称</view>
<view class="n">真实姓名张三</view>
10 months ago
<view class="n">18089800909<image :src="$picUrl+'/static/news/avater.png'"></image></view>
11 months ago
</view>
<view class="r">
<view class="btn btn-on">游客</view>
10 months ago
<image :src="$picUrl+'/static/news/tel.png'"></image>
11 months ago
</view>
</view>
<view class="b">
<view class="l">余额(<text>¥0.00</text></view>
<view class="l">积分(<text>0.00</text></view>
</view>
10 months ago
</view> -->
11 months ago
</view>
</view>
</template>
10 months ago
<script>
import * as Vip from '@/api/user/vip'
11 months ago
export default {
data() {
return {
10 months ago
keyword:'',
page:1,
total:0,
list:[],
title:'会员管理'
11 months ago
};
},
methods: {
10 months ago
searchhandle(){
this.list=[]
this.page = 1;
this.getList()
},
10 months ago
async getList(){
10 months ago
let res = await Vip.getVipList({page:this.page,search:this.keyword,user_type:this.title=='会员管理'?"10,20":'30'})
10 months ago
console.log(res,"===")
this.list.push(...res.data.list.data);
this.total = res.data.list.total;
},
copyText(text) {
uni.setClipboardData({
data: text,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'success',
duration: 2000
});
},
fail: () => {
uni.showToast({
title: '复制失败',
icon: 'none'
});
}
});
},
makeCall(phoneNumber) {
9 months ago
uni.makePhoneCall({
phoneNumber: phoneNumber, // 电话号码
success: (res) => {
},
// 失败回调
fail: (res) => {
}
10 months ago
});
9 months ago
// uni.getSetting({
// success(res) {
// if (!res.authSetting['scope.makePhoneCall']) {
// // 没有权限,需要请求用户授权
// uni.authorize({
// scope: 'scope.makePhoneCall',
// success() {
// // 用户已授权,可以拨打电话
// uni.makePhoneCall({
// phoneNumber: phoneNumber // 电话号码
// });
// },
// fail() {
// // 用户拒绝授权,可以引导用户开启
// uni.showModal({
// title: '提示',
// content: '需要电话权限',
// success: function(modalRes) {
// console.log(modalRes)
// if (modalRes.confirm) {
// uni.openSetting({
// success: (res) => {
// console.log(res)
// if (res.authSetting['scope.makePhoneCall']) {
// uni.makePhoneCall({
// phoneNumber: phoneNumber // 电话号码
// });
// }
// }
// });
// }
// }
// });
// }
// });
// } else {
// // 已经有权限,直接拨打电话
// uni.makePhoneCall({
// phoneNumber: phoneNumber // 电话号码
// });
// }
// }
// });
10 months ago
},
goVipDetails(item){
let details = JSON.stringify(item)
uni.navigateTo({
10 months ago
url:"/pages/news/user/index?item="+details+"&title="+this.title
10 months ago
})
}
},
onLoad(option) {
this.title = option.title
uni.setNavigationBarTitle({
title: this.title
});
this.list = []
this.getList()
},
onReachBottom() {
if (this.list.length < this.total) {
this.page++;
this.getList()
}
},
11 months ago
}
</script>
<style lang="scss" scoped>
.user{
padding: 0 0 130rpx;
overflow: hidden;
.search{
width: 750rpx;
10 months ago
padding: 34rpx 34rpx 0 34rpx;
11 months ago
box-sizing: border-box;
10 months ago
// .box{
// padding: 15rpx 25rpx;
// box-sizing: border-box;
// display: flex;
// align-items: center;
// background: #F3F3F3;
// border-radius: 60rpx;
// image{
// width: 28rpx;
// height: 28rpx;
// margin-right: 22rpx;
// }
// input{
// flex: 1;
// font-size: 28rpx;
// line-height: 30rpx;
// }
// }
11 months ago
}
&-bd{
10 months ago
padding: 0 34rpx;
11 months ago
overflow: hidden;
.li{
10 months ago
padding:0 12rpx;
11 months ago
background-color: #FFFFFF;
overflow: hidden;
10 months ago
border-radius: 8rpx;
margin-top: 18rpx;
// &:first-child{
// margin-top: 0;
// }
11 months ago
.a{
display: flex;
10 months ago
// align-items: flex-start;
align-items: center;
11 months ago
justify-content: space-between;
padding: 15rpx 0 30rpx;
border-bottom: 1px solid #F2F2F2;
.l{
width: 114rpx;
height: 114rpx;
margin-right: 25rpx;
image{
width: 100%;
height: 100%;
border-radius: 50%;
}
}
10 months ago
.r{
11 months ago
flex: 1;
10 months ago
// width: 98rpx;
// overflow: hidden;
.m{
// flex: 1;
// max-width: 400rpx;
// margin-right: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
.btn{
// width: 98rpx;
padding:0 10rpx;
height: 56rpx;
line-height: 56rpx;
background: #FFFFFF;
border-radius: 3px 3px 3px 3px;
border: 1px solid #FFA928;
text-align: center;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #FFA928;
&-on{
border-color:#FFA928;
color: #FFA928;
}
}
}
11 months ago
.n{
10 months ago
display: flex;
align-items: center;
justify-content: space-between;
margin-top:20rpx;
text{
font-size: 28rpx;
color: #454545;
}
11 months ago
image{
width: 30rpx;
height: 30rpx;
margin-left: 10rpx;
vertical-align: middle;
}
11 months ago
}
10 months ago
// image{
// display: block;
// width: 30rpx;
// height: 30rpx;
// float: right;
// margin-top: 20rpx;
// margin-right: 20rpx;
// }
11 months ago
}
10 months ago
// .m{
// flex: 1;
// max-width: 400rpx;
// margin-right: 20rpx;
// .n{
// font-size: 28rpx;
// font-weight: 400;
// color: #545454;
// height: 50rpx;
// image{
// width: 30rpx;
// height: 30rpx;
// margin-left: 10rpx;
// vertical-align: middle;
// margin-top: -1px;
// }
// }
// }
11 months ago
}
.b{
10 months ago
padding-top: 20rpx;
11 months ago
padding-bottom: 20rpx;
overflow: hidden;
display: flex;
align-items: center;
.l{
flex: 1;
text-align: center;
font-size: 28rpx;
font-weight: 400;
10 months ago
color: #B1B1B1;
11 months ago
text{
font-size: 28rpx;
font-weight: 400;
10 months ago
color: #454545;
11 months ago
display: block;
10 months ago
margin-top: 12rpx;
11 months ago
}
}
}
}
}
}
</style>